34 namespace sixDoFRigidBodyMotionRestraints
40 sixDoFRigidBodyMotionRestraint,
41 sphericalAngularSpring,
83 restraintMoment =
Zero;
91 refDir[(cmpt + 1) % 3] = 1;
95 axis = (refQ_ & axis);
96 refDir = (refQ_ & refDir);
97 newDir -= (axis & newDir)*axis;
99 restraintMoment += -stiffness_*(refDir ^ newDir);
102 restraintMoment += -damping_*motion.
omega();
104 restraintForce =
Zero;
112 Info<<
" moment " << restraintMoment
125 refQ_ = sDoFRBMRCoeffs_.lookupOrDefault<
tensor>(
"referenceOrientation",
I);
130 <<
"referenceOrientation " << refQ_ <<
" is not a rotation tensor. " 131 <<
"mag(referenceOrientation) - sqrt(3) = " 136 sDoFRBMRCoeffs_.lookup(
"stiffness") >> stiffness_;
137 sDoFRBMRCoeffs_.lookup(
"damping") >> damping_;
148 writeEntry(os,
"referenceOrientation", refQ_);
Six degree of freedom motion for a rigid body.
bool report() const
Return the report Switch.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void write(Ostream &) const
Write.
const point & centreOfRotation() const
Return the current centre of rotation.
Base class for defining restraints for sixDoF motions.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
defineTypeNameAndDebug(axialAngularSpring, 0)
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, axialAngularSpring, dictionary)
bool read(const char *, int32_t &)
static const direction nComponents
Number of components in this vector space.
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
static const Identity< scalar > I
vector omega() const
Return the angular velocity in the global frame.
A class for handling words, derived from string.
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
const tensor & orientation() const
Return the orientation tensor, Q.
virtual ~sphericalAngularSpring()
Destructor.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
sphericalAngularSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.