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_;
Six degree of freedom motion for a rigid body.
bool report() const
Return the report Switch.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const double e
Elementary charge.
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.
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.
const tensor & orientation() const
Return the orientation tensor, Q.
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.
defineTypeNameAndDebug(linearAxialAngularSpring, 0)
const point & centreOfRotation() const
Return the current centre of rotation.
virtual ~sphericalAngularSpring()
Destructor.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void write(Ostream &) const
Write.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, linearAxialAngularSpring, dictionary)
sphericalAngularSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
dimensioned< scalar > mag(const dimensioned< Type > &)