37namespace sixDoFRigidBodyMotionRestraints
53Foam::sixDoFRigidBodyMotionRestraints::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_);
151 os.writeEntry(
"referenceOrientation", refQ_);
152 os.writeEntry(
"stiffness", stiffness_);
153 os.writeEntry(
"damping", damping_);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool write()
Write the output fields.
static constexpr direction nComponents
Number of components in bool is 1.
Base class for defining restraints for sixDoF motions.
sixDoFRigidBodyMotionRestraints model. Spherical angular spring.
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 Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
messageStream Info
Information stream (stdout output on master, null elsewhere)
static const Identity< scalar > I
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)