34 namespace sixDoFRigidBodyMotionRestraints
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_);
Macros for easy insertion into run-time selection tables.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static const direction nComponents
Number of components in this vector space.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Base class for defining restraints for sixDoF motions.
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
sixDoFRigidBodyMotionRestraints model. Spherical angular spring.
virtual void write(Ostream &) const
Write.
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.
virtual ~sphericalAngularSpring()
Destructor.
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
Six degree of freedom motion for a rigid body.
bool report() const
Return the report Switch.
const tensor & orientation() const
Return the orientation tensor, Q.
vector omega() const
Return the angular velocity in the global frame.
const point & centreOfRotation() const
Return the current centre of rotation.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
defineTypeNameAndDebug(axialAngularSpring, 0)
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, axialAngularSpring, dictionary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
static const Identity< scalar > I
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)