Go to the documentation of this file.
37 namespace sixDoFRigidBodyMotionRestraints
43 sixDoFRigidBodyMotionRestraint,
44 sphericalAngularSpring,
86 restraintMoment =
Zero;
94 refDir[(cmpt + 1) % 3] = 1;
98 axis = (refQ_ & axis);
99 refDir = (refQ_ & refDir);
100 newDir -= (axis & newDir)*axis;
102 restraintMoment += -stiffness_*(refDir ^ newDir);
105 restraintMoment += -damping_*motion.
omega();
107 restraintForce =
Zero;
115 Info<<
" moment " << restraintMoment
128 refQ_ = sDoFRBMRCoeffs_.getOrDefault<
tensor>(
"referenceOrientation",
I);
133 <<
"referenceOrientation " << refQ_ <<
" is not a rotation tensor. "
134 <<
"mag(referenceOrientation) - sqrt(3) = "
139 sDoFRBMRCoeffs_.readEntry(
"stiffness", stiffness_);
140 sDoFRBMRCoeffs_.readEntry(
"damping", damping_);
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
const tensor & orientation() const
Return the orientation tensor, Q.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, linearAxialAngularSpring, dictionary)
const point & centreOfRotation() const
Return the current centre of rotation.
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
Base class for defining restraints for sixDoF motions.
defineTypeNameAndDebug(linearAxialAngularSpring, 0)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Six degree of freedom motion for a rigid body.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual ~sphericalAngularSpring()
Destructor.
bool report() const
Return the report Switch.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual void write(Ostream &) const
Write.
vector omega() const
Return the angular velocity in the global frame.
sphericalAngularSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
static constexpr direction nComponents
Number of components in this vector space.
static const Identity< scalar > I