Six degree of freedom motion for a rigid body. More...
Public Member Functions | |
TypeName ("sixDoFRigidBodyMotion") | |
Runtime type information. More... | |
sixDoFRigidBodyMotion () | |
Construct null. More... | |
sixDoFRigidBodyMotion (const dictionary &dict, const dictionary &stateDict) | |
Construct from constant and state dictionaries. More... | |
sixDoFRigidBodyMotion (const sixDoFRigidBodyMotion &) | |
Copy constructor. More... | |
virtual | ~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... | |
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 80 of file sixDoFRigidBodyMotion.C.
Referenced by sixDoFRigidBodyMotion::sixDoFRigidBodyMotion().
sixDoFRigidBodyMotion | ( | const dictionary & | dict, |
const dictionary & | stateDict | ||
) |
Construct from constant and state dictionaries.
Definition at line 101 of file sixDoFRigidBodyMotion.C.
References sixDoFRigidBodyMotion::addConstraints(), sixDoFRigidBodyMotion::addRestraints(), sixDoFRigidBodyMotionState::centreOfRotation(), Foam::diag(), dictionary::found(), Foam::I, Foam::magSqr(), R, sixDoFRigidBodyMotion::sixDoFRigidBodyMotion(), and Foam::sqr().
sixDoFRigidBodyMotion | ( | const sixDoFRigidBodyMotion & | sDoFRBM | ) |
Copy constructor.
Definition at line 163 of file sixDoFRigidBodyMotion.C.
|
virtual |
Destructor.
Definition at line 186 of file sixDoFRigidBodyMotion.C.
References sixDoFRigidBodyMotion::addRestraints().
TypeName | ( | "sixDoFRigidBodyMotion" | ) |
Runtime type information.
|
inline |
Return the mass.
Definition at line 208 of file sixDoFRigidBodyMotionI.H.
|
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.
References sixDoFRigidBodyMotionState::centreOfRotation().
Referenced by sphericalAngularSpring::restrain(), linearAxialAngularSpring::restrain(), axialAngularSpring::restrain(), sixDoFRigidBodyMotion::status(), sixDoFRigidBodyMotion::transform(), sixDoFRigidBodyMotion::velocity(), and sixDoFRigidBodyState::write().
|
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 sixDoFRigidBodyMotion::transform().
Referenced by sixDoFRigidBodyMotion::momentArm(), sixDoFRigidBodyMotion::status(), and sixDoFRigidBodyState::write().
|
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(), axialAngularSpring::restrain(), sixDoFRigidBodyMotion::status(), and sixDoFRigidBodyState::write().
|
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(), axialAngularSpring::restrain(), sixDoFRigidBodyMotion::status(), sixDoFRigidBodyMotion::velocity(), and sixDoFRigidBodyState::write().
|
inline |
Return the current velocity.
Definition at line 140 of file sixDoFRigidBodyMotionI.H.
References sixDoFRigidBodyMotionState::a(), sixDoFRigidBodyMotionState::pi(), sixDoFRigidBodyMotionState::Q(), sixDoFRigidBodyMotionState::tau(), and sixDoFRigidBodyMotionState::v().
|
inline |
Definition at line 247 of file sixDoFRigidBodyMotionI.H.
References sixDoFRigidBodyMotion::centreOfMass(), and sixDoFRigidBodyMotionState::centreOfRotation().
|
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 axialAngularSpring::restrain().
|
inline |
Store the motion state at the beginning of the time-step.
Definition at line 272 of file sixDoFRigidBodyMotionI.H.
|
inline |
Return non-const access to the centre of rotation.
Definition at line 278 of file sixDoFRigidBodyMotionI.H.
References sixDoFRigidBodyMotionState::centreOfRotation(), and sixDoFRigidBodyMotion::velocity().
void addRestraints | ( | const dictionary & | dict | ) |
Add restraints to the motion, public to allow external.
addition of restraints after construction
Definition at line 193 of file sixDoFRigidBodyMotion.C.
References sixDoFRigidBodyMotion::addConstraints(), dict, forAllConstIter(), dictionary::found(), sixDoFRigidBodyMotionRestraint::New(), and dictionary::subDict().
Referenced by sixDoFRigidBodyMotion::read(), sixDoFRigidBodyMotion::sixDoFRigidBodyMotion(), and sixDoFRigidBodyMotion::~sixDoFRigidBodyMotion().
void addConstraints | ( | const dictionary & | dict | ) |
Add restraints to the motion, public to allow external.
addition of restraints after construction
Definition at line 227 of file sixDoFRigidBodyMotion.C.
References pointConstraint::constraintTransformation(), dict, Foam::endl(), forAllConstIter(), dictionary::found(), Foam::Info, sixDoFRigidBodyMotionConstraint::New(), Foam::nl, dictionary::subDict(), Tensor< Cmpt >::T(), and sixDoFRigidBodyMotion::update().
Referenced by sixDoFRigidBodyMotion::addRestraints(), sixDoFRigidBodyMotion::read(), and sixDoFRigidBodyMotion::sixDoFRigidBodyMotion().
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 307 of file sixDoFRigidBodyMotion.C.
References UPstream::master(), Pstream::scatter(), and sixDoFRigidBodyMotion::status().
Referenced by sixDoFRigidBodyMotion::addConstraints().
void status | ( | ) | const |
Report the status of the motion.
Definition at line 329 of file sixDoFRigidBodyMotion.C.
References sixDoFRigidBodyMotion::centreOfMass(), sixDoFRigidBodyMotion::centreOfRotation(), Foam::endl(), Foam::Info, Foam::nl, sixDoFRigidBodyMotion::omega(), sixDoFRigidBodyMotion::orientation(), and sixDoFRigidBodyMotion::transform().
Referenced by sixDoFRigidBodyMotion::update().
|
inline |
Return the velocity of a position.
Definition at line 285 of file sixDoFRigidBodyMotionI.H.
References sixDoFRigidBodyMotion::centreOfRotation(), sixDoFRigidBodyMotion::omega(), and sixDoFRigidBodyMotion::transform().
Referenced by sixDoFRigidBodyMotion::centreOfRotation(), and linearSpring::restrain().
|
inline |
Transform the given initial state point by the current motion.
state
Definition at line 294 of file sixDoFRigidBodyMotionI.H.
References sixDoFRigidBodyMotion::centreOfRotation(), and Tensor< Cmpt >::T().
Referenced by sixDoFRigidBodyMotion::centreOfMass(), linearSpring::restrain(), sixDoFRigidBodyMotion::status(), sixDoFRigidBodyMotion::transform(), and sixDoFRigidBodyMotion::velocity().
Foam::tmp< Foam::pointField > transform | ( | const pointField & | initialPoints | ) | const |
Transform the given initial state pointField by the current.
motion state
Definition at line 342 of file sixDoFRigidBodyMotion.C.
References sixDoFRigidBodyMotion::centreOfRotation(), Tensor< Cmpt >::T(), and sixDoFRigidBodyMotion::transform().
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 355 of file sixDoFRigidBodyMotion.C.
References sixDoFRigidBodyMotion::centreOfRotation(), forAll, septernion::I, septernion::invTransformPoint(), points, tmp< T >::ref(), s(), Foam::slerp(), Foam::T(), and sixDoFRigidBodyMotion::transform().
void write | ( | Ostream & | os | ) | const |
Write.
Definition at line 49 of file sixDoFRigidBodyMotionIO.C.
References token::BEGIN_BLOCK, Foam::decrIndent(), token::END_BLOCK, Foam::endl(), forAll, Foam::incrIndent(), Foam::indent(), Foam::nl, sixDoFRigidBodyMotionState::write(), and Foam::writeEntry().
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::addConstraints(), sixDoFRigidBodyMotion::addRestraints(), dictionary::lookup(), and dictionary::lookupOrDefault().
|
friend |
Definition at line 68 of file sixDoFRigidBodyMotion.H.