Six degree of freedom motion for a rigid body. More...
Public Member Functions | |
sixDoFRigidBodyMotion () | |
Construct null. More... | |
sixDoFRigidBodyMotion (const dictionary &dict, const dictionary &stateDict) | |
Construct from constant and state dictionaries. More... | |
sixDoFRigidBodyMotion (const sixDoFRigidBodyMotion &) | |
Construct as copy. More... | |
~sixDoFRigidBodyMotion () | |
Destructor. More... | |
scalar | mass () const |
Return the mass. More... | |
const diagTensor & | momentOfInertia () const |
Return the inertia tensor. More... | |
const sixDoFRigidBodyMotionState & | state () const |
Return the motion state. More... | |
const point & | centreOfRotation () const |
Return the current centre of rotation. More... | |
const point & | initialCentreOfMass () const |
Return the initial centre of mass. More... | |
point | centreOfMass () const |
Return the current centre of mass. More... | |
const tensor & | orientation () const |
Return the orientation tensor, Q. More... | |
vector | omega () const |
Return the angular velocity in the global frame. More... | |
const vector & | v () const |
Return the current velocity. More... | |
vector | momentArm () const |
bool | report () const |
Return the report Switch. More... | |
void | newTime () |
Store the motion state at the beginning of the time-step. More... | |
point & | centreOfRotation () |
Return non-const access to the centre of rotation. More... | |
void | addRestraints (const dictionary &dict) |
Add restraints to the motion, public to allow external. More... | |
void | addConstraints (const dictionary &dict) |
Add restraints to the motion, public to allow external. More... | |
void | update (bool firstIter, const vector &fGlobal, const vector &tauGlobal, scalar deltaT, scalar deltaT0) |
Symplectic integration of velocities, orientation and position. More... | |
void | status () const |
Report the status of the motion. More... | |
point | velocity (const point &pt) const |
Return the velocity of a position. More... | |
point | transform (const point &initialPoints) const |
Transform the given initial state point by the current motion. More... | |
tmp< pointField > | transform (const pointField &initialPoints) const |
Transform the given initial state pointField by the current. More... | |
tmp< pointField > | transform (const pointField &initialPoints, const scalarField &scale) const |
Transform the given initial state pointField by the current. More... | |
void | write (Ostream &) const |
Write. More... | |
bool | read (const dictionary &dict) |
Read coefficients dictionary and update system parameters,. More... | |
Private Member Functions | |
tensor | rotationTensorX (scalar deltaT) const |
Calculate the rotation tensor around the body reference. More... | |
tensor | rotationTensorY (scalar deltaT) const |
Calculate the rotation tensor around the body reference. More... | |
tensor | rotationTensorZ (scalar deltaT) const |
Calculate the rotation tensor around the body reference. More... | |
Tuple2< tensor, vector > | rotate (const tensor &Q0, const vector &pi, const scalar deltaT) const |
Apply rotation tensors to Q0 for the given torque (pi) and deltaT. More... | |
void | applyRestraints () |
Apply the restraints to the object. More... | |
void | updateAcceleration (const vector &fGlobal, const vector &tauGlobal) |
Update and relax accelerations from the force and torque. More... | |
const PtrList< sixDoFRigidBodyMotionRestraint > & | restraints () const |
Return the restraints. More... | |
const PtrList< sixDoFRigidBodyMotionConstraint > & | constraints () const |
Return the constraints. More... | |
const point & | initialCentreOfRotation () const |
Return the initial centre of rotation. More... | |
const tensor & | initialQ () const |
Return the initial orientation. More... | |
const tensor & | Q () const |
Return the orientation. More... | |
const vector & | a () const |
Return the current acceleration. More... | |
const vector & | pi () const |
Return the current angular momentum. More... | |
const vector & | tau () const |
Return the current torque. More... | |
point & | initialCentreOfRotation () |
Return the centre of rotation. More... | |
tensor & | initialQ () |
Return initial orientation. More... | |
tensor & | Q () |
Return non-const access to the orientation. More... | |
vector & | v () |
Return non-const access to vector. More... | |
vector & | a () |
Return non-const access to acceleration. More... | |
vector & | pi () |
Return non-const access to angular momentum. More... | |
vector & | tau () |
Return non-const access to torque. More... | |
Private Attributes | |
sixDoFRigidBodyMotionState | motionState_ |
Motion state data object. More... | |
sixDoFRigidBodyMotionState | motionState0_ |
Motion state data object for previous time-step. More... | |
PtrList< sixDoFRigidBodyMotionRestraint > | restraints_ |
Motion restraints. More... | |
PtrList< sixDoFRigidBodyMotionConstraint > | constraints_ |
Motion constaints. More... | |
tensor | tConstraints_ |
Translational constraint tensor. More... | |
tensor | rConstraints_ |
Rotational constraint tensor. More... | |
point | initialCentreOfMass_ |
Centre of mass of initial state. More... | |
point | initialCentreOfRotation_ |
Centre of rotation of initial state. More... | |
tensor | initialQ_ |
Orientation of initial state. More... | |
scalar | mass_ |
Mass of the body. More... | |
diagTensor | momentOfInertia_ |
Moment of inertia of the body in reference configuration. More... | |
scalar | aRelax_ |
Acceleration relaxation coefficient. More... | |
scalar | aDamp_ |
Acceleration damping coefficient (for steady-state simulations) More... | |
Switch | report_ |
Switch to turn reporting of motion data on and off. More... | |
autoPtr< sixDoFSolver > | solver_ |
Motion solver. More... | |
Friends | |
class | sixDoFSolver |
Six degree of freedom motion for a rigid body.
Angular momentum stored in body fixed reference frame. Reference orientation of the body (where Q = I) must align with the cartesian axes such that the Inertia tensor is in principle component form. Can add restraints (e.g. a spring) and constraints (e.g. motion may only be on a plane).
The time-integrator for the motion is run-time selectable with options for symplectic (explicit), Crank-Nicolson and Newmark schemes.
Definition at line 66 of file sixDoFRigidBodyMotion.H.
Construct null.
Definition at line 73 of file sixDoFRigidBodyMotion.C.
sixDoFRigidBodyMotion | ( | const dictionary & | dict, |
const dictionary & | stateDict | ||
) |
Construct from constant and state dictionaries.
Definition at line 94 of file sixDoFRigidBodyMotion.C.
References Foam::diag(), dict, dictionary::found(), Foam::I, Foam::magSqr(), R, and Foam::sqr().
sixDoFRigidBodyMotion | ( | const sixDoFRigidBodyMotion & | sDoFRBM | ) |
Construct as copy.
Definition at line 156 of file sixDoFRigidBodyMotion.C.
Destructor.
Definition at line 179 of file sixDoFRigidBodyMotion.C.
|
inlineprivate |
Calculate the rotation tensor around the body reference.
frame x-axis by the given angle
Definition at line 29 of file sixDoFRigidBodyMotionI.H.
References Foam::cos(), phi, and Foam::sin().
|
inlineprivate |
Calculate the rotation tensor around the body reference.
frame y-axis by the given angle
Definition at line 43 of file sixDoFRigidBodyMotionI.H.
References Foam::cos(), phi, and Foam::sin().
|
inlineprivate |
Calculate the rotation tensor around the body reference.
frame z-axis by the given angle
Definition at line 57 of file sixDoFRigidBodyMotionI.H.
References Foam::cos(), phi, and Foam::sin().
|
inlineprivate |
Apply rotation tensors to Q0 for the given torque (pi) and deltaT.
and return the rotated Q and pi as a tuple
Definition at line 72 of file sixDoFRigidBodyMotionI.H.
References Tuple2::first(), Foam::constant::mathematical::pi(), R, and Tuple2::second().
|
private |
Apply the restraints to the object.
Definition at line 32 of file sixDoFRigidBodyMotion.C.
References sixDoFRigidBodyMotion::a(), sixDoFRigidBodyMotion::centreOfRotation(), forAll, Foam::Info, sixDoFRigidBodyMotion::mass_, UPstream::master(), sixDoFRigidBodyMotion::Q(), sixDoFRigidBodyMotion::report_, sixDoFRigidBodyMotion::restraints_, Tensor::T(), sixDoFRigidBodyMotion::tau(), and Vector< scalar >::zero.
Update and relax accelerations from the force and torque.
Definition at line 270 of file sixDoFRigidBodyMotion.C.
|
inlineprivate |
Return the restraints.
Definition at line 107 of file sixDoFRigidBodyMotionI.H.
References sixDoFRigidBodyMotion::restraints_.
|
inlineprivate |
Return the constraints.
Definition at line 114 of file sixDoFRigidBodyMotionI.H.
|
inlineprivate |
Return the initial centre of rotation.
Definition at line 121 of file sixDoFRigidBodyMotionI.H.
|
inlineprivate |
Return the initial orientation.
Definition at line 128 of file sixDoFRigidBodyMotionI.H.
|
inlineprivate |
Return the orientation.
Definition at line 134 of file sixDoFRigidBodyMotionI.H.
Referenced by sixDoFRigidBodyMotion::applyRestraints().
|
inlineprivate |
Return the current acceleration.
Definition at line 146 of file sixDoFRigidBodyMotionI.H.
Referenced by sixDoFRigidBodyMotion::applyRestraints().
|
inlineprivate |
Return the current angular momentum.
Definition at line 152 of file sixDoFRigidBodyMotionI.H.
|
inlineprivate |
Return the current torque.
Definition at line 158 of file sixDoFRigidBodyMotionI.H.
Referenced by sixDoFRigidBodyMotion::applyRestraints().
|
inlineprivate |
Return the centre of rotation.
|
inlineprivate |
Return initial orientation.
|
inlineprivate |
Return non-const access to vector.
Definition at line 140 of file sixDoFRigidBodyMotionI.H.
Referenced by linearDamper::restrain().
|
inlineprivate |
Return non-const access to acceleration.
|
inlineprivate |
Return non-const access to angular momentum.
|
inlineprivate |
Return non-const access to torque.
|
inline |
Return the mass.
Definition at line 208 of file sixDoFRigidBodyMotionI.H.
Referenced by uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), and sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().
|
inline |
Return the inertia tensor.
Definition at line 215 of file sixDoFRigidBodyMotionI.H.
|
inline |
Return the motion state.
Definition at line 222 of file sixDoFRigidBodyMotionI.H.
|
inline |
Return the current centre of rotation.
Definition at line 228 of file sixDoFRigidBodyMotionI.H.
Referenced by sixDoFRigidBodyMotion::applyRestraints(), sphericalAngularSpring::restrain(), linearAxialAngularSpring::restrain(), tabulatedAxialAngularSpring::restrain(), and sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().
|
inline |
Return the initial centre of mass.
Definition at line 235 of file sixDoFRigidBodyMotionI.H.
|
inline |
Return the current centre of mass.
Definition at line 241 of file sixDoFRigidBodyMotionI.H.
References Foam::transform().
|
inline |
Return the orientation tensor, Q.
globalVector = Q & bodyLocalVector bodyLocalVector = Q.T() & globalVector
Definition at line 254 of file sixDoFRigidBodyMotionI.H.
Referenced by sphericalAngularSpring::restrain(), linearAxialAngularSpring::restrain(), and tabulatedAxialAngularSpring::restrain().
|
inline |
Return the angular velocity in the global frame.
Definition at line 260 of file sixDoFRigidBodyMotionI.H.
References Foam::inv(), and Foam::constant::mathematical::pi().
Referenced by sphericalAngularDamper::restrain(), sphericalAngularSpring::restrain(), linearAxialAngularSpring::restrain(), and tabulatedAxialAngularSpring::restrain().
|
inline |
Return the current velocity.
|
inline |
Definition at line 247 of file sixDoFRigidBodyMotionI.H.
Referenced by sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().
|
inline |
Return the report Switch.
Definition at line 266 of file sixDoFRigidBodyMotionI.H.
Referenced by sphericalAngularDamper::restrain(), linearDamper::restrain(), sphericalAngularSpring::restrain(), linearAxialAngularSpring::restrain(), linearSpring::restrain(), and tabulatedAxialAngularSpring::restrain().
|
inline |
Store the motion state at the beginning of the time-step.
Definition at line 272 of file sixDoFRigidBodyMotionI.H.
Referenced by uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), and sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().
|
inline |
Return non-const access to the centre of rotation.
void addRestraints | ( | const dictionary & | dict | ) |
Add restraints to the motion, public to allow external.
addition of restraints after construction
Definition at line 186 of file sixDoFRigidBodyMotion.C.
References dict, forAllConstIter(), dictionary::found(), sixDoFRigidBodyMotionRestraint::New(), and dictionary::subDict().
Referenced by sixDoFRigidBodyMotion::read().
void addConstraints | ( | const dictionary & | dict | ) |
Add restraints to the motion, public to allow external.
addition of restraints after construction
Definition at line 220 of file sixDoFRigidBodyMotion.C.
References pointConstraint::constraintTransformation(), dict, Foam::endl(), forAllConstIter(), dictionary::found(), Foam::Info, sixDoFRigidBodyMotionConstraint::New(), Foam::nl, and dictionary::subDict().
Referenced by sixDoFRigidBodyMotion::read().
void update | ( | bool | firstIter, |
const vector & | fGlobal, | ||
const vector & | tauGlobal, | ||
scalar | deltaT, | ||
scalar | deltaT0 | ||
) |
Symplectic integration of velocities, orientation and position.
Changes to Crank-Nicolson integration for subsequent iterations.
Definition at line 298 of file sixDoFRigidBodyMotion.C.
References UPstream::master(), and Pstream::scatter().
Referenced by uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), and sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().
void status | ( | ) | const |
Report the status of the motion.
Definition at line 320 of file sixDoFRigidBodyMotion.C.
References Foam::endl(), Foam::Info, and Foam::nl.
|
inline |
Return the velocity of a position.
Definition at line 285 of file sixDoFRigidBodyMotionI.H.
Referenced by linearSpring::restrain().
|
inline |
Transform the given initial state point by the current motion.
state
Definition at line 294 of file sixDoFRigidBodyMotionI.H.
Referenced by linearSpring::restrain(), uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), and sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().
Foam::tmp< Foam::pointField > transform | ( | const pointField & | initialPoints | ) | const |
Transform the given initial state pointField by the current.
motion state
Definition at line 333 of file sixDoFRigidBodyMotion.C.
Foam::tmp< Foam::pointField > transform | ( | const pointField & | initialPoints, |
const scalarField & | scale | ||
) | const |
Transform the given initial state pointField by the current.
motion state scaled by the given scale
Definition at line 346 of file sixDoFRigidBodyMotion.C.
References forAll, septernion::I, points, s(), Foam::slerp(), Foam::T(), Foam::transform(), and septernion::transform().
void write | ( | Ostream & | os | ) | const |
Write.
Definition at line 49 of file sixDoFRigidBodyMotionIO.C.
References token::BEGIN_BLOCK, Foam::decrIndent(), token::END_BLOCK, token::END_STATEMENT, Foam::endl(), forAll, Foam::incrIndent(), Foam::indent(), IOstream::name(), Foam::nl, and Ostream::writeKeyword().
Referenced by sixDoFRigidBodyDisplacementPointPatchVectorField::write().
bool read | ( | const dictionary & | dict | ) |
Read coefficients dictionary and update system parameters,.
constraints and restraints but not the current state
Definition at line 31 of file sixDoFRigidBodyMotionIO.C.
References sixDoFRigidBodyMotion::aDamp_, sixDoFRigidBodyMotion::addConstraints(), sixDoFRigidBodyMotion::addRestraints(), sixDoFRigidBodyMotion::aRelax_, sixDoFRigidBodyMotion::constraints_, dict, sixDoFRigidBodyMotion::mass_, sixDoFRigidBodyMotion::momentOfInertia_, sixDoFRigidBodyMotion::report_, and sixDoFRigidBodyMotion::restraints_.
|
friend |
Definition at line 68 of file sixDoFRigidBodyMotion.H.
|
private |
Motion state data object.
Definition at line 73 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFSolver::centreOfRotation().
|
private |
Motion state data object for previous time-step.
Definition at line 76 of file sixDoFRigidBodyMotion.H.
|
private |
Motion restraints.
Definition at line 79 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFRigidBodyMotion::applyRestraints(), sixDoFRigidBodyMotion::read(), and sixDoFRigidBodyMotion::restraints().
|
private |
Motion constaints.
Definition at line 82 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFRigidBodyMotion::read().
|
private |
Translational constraint tensor.
Definition at line 85 of file sixDoFRigidBodyMotion.H.
|
private |
Rotational constraint tensor.
Definition at line 88 of file sixDoFRigidBodyMotion.H.
|
private |
Centre of mass of initial state.
Definition at line 91 of file sixDoFRigidBodyMotion.H.
|
private |
Centre of rotation of initial state.
Definition at line 94 of file sixDoFRigidBodyMotion.H.
|
private |
Orientation of initial state.
Definition at line 97 of file sixDoFRigidBodyMotion.H.
|
private |
Mass of the body.
Definition at line 100 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFRigidBodyMotion::applyRestraints(), and sixDoFRigidBodyMotion::read().
|
private |
Moment of inertia of the body in reference configuration.
(Q = I)
Definition at line 104 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFRigidBodyMotion::read().
|
private |
Acceleration relaxation coefficient.
Definition at line 107 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFRigidBodyMotion::read().
|
private |
Acceleration damping coefficient (for steady-state simulations)
Definition at line 110 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFRigidBodyMotion::read().
|
private |
Switch to turn reporting of motion data on and off.
Definition at line 113 of file sixDoFRigidBodyMotion.H.
Referenced by sixDoFRigidBodyMotion::applyRestraints(), and sixDoFRigidBodyMotion::read().
|
private |
Motion solver.
Definition at line 116 of file sixDoFRigidBodyMotion.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.