FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

sixDoFRigidBodyMotion Class Reference

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. More...

#include <forces/sixDoFRigidBodyMotion.H>


Detailed Description

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.

Symplectic motion as per:

title = {Symplectic splitting methods for rigid body molecular dynamics}, publisher = {AIP}, year = {1997}, journal = {The Journal of Chemical Physics}, volume = {107}, number = {15}, pages = {5840-5851}, url = {http://link.aip.org/link/?JCP/107/5840/1}, doi = {10.1063/1.474310}

Can add restraints (i.e. a spring) and constraints (i.e. motion may only be on a plane).

Source files

Definition at line 83 of file sixDoFRigidBodyMotion.H.

Collaboration diagram for sixDoFRigidBodyMotion:

List of all members.

Public Member Functions

 sixDoFRigidBodyMotion ()
 Construct null.
 sixDoFRigidBodyMotion (const point &centreOfMass, const tensor &Q, const vector &v, const vector &a, const vector &pi, const vector &tau, scalar mass, const point &initialCentreOfMass, const tensor &initialQ, const diagTensor &momentOfInertia, scalar cDamp=0.0, scalar aLim=VGREAT, bool report=false)
 Construct from components.
 sixDoFRigidBodyMotion (const dictionary &dict)
 Construct from dictionary.
 sixDoFRigidBodyMotion (const sixDoFRigidBodyMotion &)
 Construct as copy.
 ~sixDoFRigidBodyMotion ()
 Destructor.
void  addRestraints (const dictionary &dict)
 Add restraints to the motion, public to allow external.
void  addConstraints (const dictionary &dict)
 Add restraints to the motion, public to allow external.
void  updatePosition (scalar deltaT, scalar deltaT0)
 First leapfrog velocity adjust and motion part, required.
void  updateForce (const vector &fGlobal, const vector &tauGlobal, scalar deltaT)
 Second leapfrog velocity adjust part, required after motion and.
void  updateForce (const pointField &positions, const vectorField &forces, scalar deltaT)
 Global forces supplied at locations, calculating net force.
tmp< pointField >  currentPosition (const pointField &pInitial) const
 Transform the given initial state pointField by the current.
point  currentPosition (const point &pInitial) const
 Transform the given initial state point by the current motion.
vector  currentOrientation (const vector &vInitial) const
 Transform the given initial state direction by the current.
const tensor &  orientation () const
 Access the orientation tensor, Q.
point  predictedPosition (const point &pInitial, const vector &deltaForce, const vector &deltaMoment, scalar deltaT) const
 Predict the position of the supplied initial state point.
vector  predictedOrientation (const vector &vInitial, const vector &deltaMoment, scalar deltaT) const
 Predict the orientation of the supplied initial state.
vector  omega () const
 Return the angular velocity in the global frame.
point  currentVelocity (const point &pt) const
 Return the velocity of a position given by the current.
void  status () const
 Report the status of the motion.
const point &  centreOfMass () const
 Return const access to the centre of mass.
const diagTensor &  momentOfInertia () const
 Return access to the inertia tensor.
scalar  mass () const
 Return const access to the mass.
bool  report () const
 Return the report Switch.
point &  centreOfMass ()
 Return non-const access to the centre of mass.
diagTensor &  momentOfInertia ()
 Return non-const access to the inertia tensor.
scalar &  mass ()
 Return non-const access to the mass.
void  write (Ostream &) const
 Write.

Friends

Istream &  operator>> (Istream &, sixDoFRigidBodyMotion &)
Ostream &  operator<< (Ostream &, const sixDoFRigidBodyMotion &)

Constructor & Destructor Documentation

Construct null.

Definition at line 165 of file sixDoFRigidBodyMotion.C.

sixDoFRigidBodyMotion ( const point &   centreOfMass,
const tensor &   Q,
const vector &   v,
const vector &   a,
const vector &   pi,
const vector &   tau,
scalar   mass,
const point &   initialCentreOfMass,
const tensor &   initialQ,
const diagTensor &   momentOfInertia,
scalar   cDamp = 0.0,
scalar   aLim = VGREAT,
bool   report = false  
)

Construct from components.

Definition at line 184 of file sixDoFRigidBodyMotion.C.

sixDoFRigidBodyMotion ( const dictionary &   dict  )

Construct from dictionary.

Definition at line 224 of file sixDoFRigidBodyMotion.C.

References sixDoFRigidBodyMotion::addConstraints(), and sixDoFRigidBodyMotion::addRestraints().

sixDoFRigidBodyMotion ( const sixDoFRigidBodyMotion &   sDoFRBM  )

Construct as copy.

Definition at line 253 of file sixDoFRigidBodyMotion.C.

Destructor.

Definition at line 275 of file sixDoFRigidBodyMotion.C.


Member Function Documentation

void addRestraints ( const dictionary &   dict  )

Add restraints to the motion, public to allow external.

addition of restraints after construction

Definition at line 282 of file sixDoFRigidBodyMotion.C.

References forAllConstIter, dictionary::found(), sixDoFRigidBodyMotionRestraint::New(), DLListBase::size(), and dictionary::subDict().

Referenced by sixDoFRigidBodyMotion::sixDoFRigidBodyMotion().

void addConstraints ( const dictionary &   dict  )

Add restraints to the motion, public to allow external.

addition of restraints after construction

Definition at line 322 of file sixDoFRigidBodyMotion.C.

References forAllConstIter, dictionary::found(), dictionary::lookup(), sixDoFRigidBodyMotionConstraint::New(), DLListBase::size(), and dictionary::subDict().

Referenced by sixDoFRigidBodyMotion::sixDoFRigidBodyMotion().

void updatePosition ( scalar   deltaT,
scalar   deltaT0  
)

First leapfrog velocity adjust and motion part, required.

before force calculation. Takes old timestep for variable timestep cases.

Definition at line 370 of file sixDoFRigidBodyMotion.C.

References Foam::endl(), Foam::mag(), Pstream::master(), Foam::min(), Foam::mathematicalConstant::pi(), Pstream::scatter(), and WarningIn.

Referenced by uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), and sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().

void updateForce ( const vector &   fGlobal,
const vector &   tauGlobal,
scalar   deltaT  
)
void updateForce ( const pointField &   positions,
const vectorField &   forces,
scalar   deltaT  
)

Global forces supplied at locations, calculating net force.

and moment

Definition at line 477 of file sixDoFRigidBodyMotion.C.

References forAll, Pstream::master(), Foam::sum(), and Vector< Cmpt >::zero.

Foam::tmp< Foam::pointField > currentPosition ( const pointField &   pInitial  ) const [inline]
Foam::point currentPosition ( const point &   pInitial  ) const [inline]

Transform the given initial state point by the current motion.

state

Definition at line 235 of file sixDoFRigidBodyMotionI.H.

Foam::vector currentOrientation ( const vector &   vInitial  ) const [inline]

Transform the given initial state direction by the current.

motion state

Definition at line 248 of file sixDoFRigidBodyMotionI.H.

const Foam::tensor & orientation (  ) const [inline]

Access the orientation tensor, Q.

globalVector = Q & bodyLocalVector bodyLocalVector = Q.T() & globalVector

Definition at line 257 of file sixDoFRigidBodyMotionI.H.

Referenced by fixedAxis::constrain(), tabulatedAxialAngularSpring::restrain(), sphericalAngularSpring::restrain(), and linearAxialAngularSpring::restrain().

Foam::point predictedPosition ( const point &   pInitial,
const vector &   deltaForce,
const vector &   deltaMoment,
scalar   deltaT  
) const

Predict the position of the supplied initial state point.

after deltaT given the current motion state and the additional supplied force and moment

Definition at line 502 of file sixDoFRigidBodyMotion.C.

References Foam::mathematicalConstant::pi(), and Tensor< Cmpt >::T().

Referenced by fixedPoint::constrain(), fixedPlane::constrain(), and fixedLine::constrain().

Foam::vector predictedOrientation ( const vector &   vInitial,
const vector &   deltaMoment,
scalar   deltaT  
) const

Predict the orientation of the supplied initial state.

vector after deltaT given the current motion state and the additional supplied moment

Definition at line 528 of file sixDoFRigidBodyMotion.C.

References Foam::mathematicalConstant::pi(), and Tensor< Cmpt >::T().

Referenced by fixedOrientation::constrain(), and fixedAxis::constrain().

Foam::vector omega (  ) const [inline]

Return the angular velocity in the global frame.

Definition at line 263 of file sixDoFRigidBodyMotionI.H.

References Foam::inv(), and Foam::mathematicalConstant::pi().

Referenced by tabulatedAxialAngularSpring::restrain(), sphericalAngularSpring::restrain(), and linearAxialAngularSpring::restrain().

Foam::point currentVelocity ( const point &   pt  ) const [inline]

Return the velocity of a position given by the current.

motion state

Definition at line 270 of file sixDoFRigidBodyMotionI.H.

Referenced by linearSpring::restrain().

void status (  ) const

Report the status of the motion.

Definition at line 544 of file sixDoFRigidBodyMotion.C.

References Foam::endl(), Foam::Info, and Foam::nl.

const Foam::diagTensor & momentOfInertia (  ) const [inline]

Return access to the inertia tensor.

Definition at line 285 of file sixDoFRigidBodyMotionI.H.

Referenced by fixedOrientation::constrain(), and fixedAxis::constrain().

Foam::point & centreOfMass (  ) [inline]

Return non-const access to the centre of mass.

Definition at line 303 of file sixDoFRigidBodyMotionI.H.

Foam::diagTensor & momentOfInertia (  ) [inline]

Return non-const access to the inertia tensor.

Definition at line 309 of file sixDoFRigidBodyMotionI.H.

Foam::scalar & mass (  ) [inline]

Return non-const access to the mass.

Definition at line 315 of file sixDoFRigidBodyMotionI.H.


Friends And Related Function Documentation

Istream& operator>> ( Istream &   ,
sixDoFRigidBodyMotion &    
) [friend]
Ostream& operator<< ( Ostream &   ,
const sixDoFRigidBodyMotion &    
) [friend]

The documentation for this class was generated from the following files: