36 namespace sixDoFRigidBodyMotionRestraints
42 sixDoFRigidBodyMotionRestraint,
60 refAttachmentPt_(
Zero),
79 restraintPosition = motion.
transform(refAttachmentPt_);
80 restraintForce =
Zero;
81 restraintMoment =
Zero;
83 const vector r(restraintPosition - anchor_);
87 const scalar d = (wallNormal_/
mag(wallNormal_)) & r;
91 const scalar m = motion.
mass();
92 const scalar wn = 3.14/C_;
93 const scalar damping = psi_*2*wn*m;
94 const scalar stiffness =
sqr(wn)*m;
98 restraintForce = (-damping*(rDir & v) + stiffness*d)*rDir;
99 restraintMoment = restraintPosition^restraintForce;
104 Info<<
" restraintPosition: " << restraintPosition
105 <<
" restraintForce: " << restraintForce
106 <<
" restraintMoment: " << restraintMoment
122 sDoFRBMRCoeffs_.readEntry(
"anchor", anchor_);
123 sDoFRBMRCoeffs_.readEntry(
"refAttachmentPt", refAttachmentPt_);
124 sDoFRBMRCoeffs_.readEntry(
"wallNormal", wallNormal_);
125 sDoFRBMRCoeffs_.readEntry(
"psi", psi_);
126 sDoFRBMRCoeffs_.readEntry(
"C", C_);
137 os.writeEntry(
"anchor", anchor_);
138 os.writeEntry(
"refAttachmentPt", refAttachmentPt_);
139 os.writeEntry(
"wallNormal", wallNormal_);
140 os.writeEntry(
"psi", psi_);
141 os.writeEntry(
"C", C_);
Six degree of freedom motion for a rigid body.
bool report() const
Return the report Switch.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Base class for defining restraints for sixDoF motions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
softWall(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.
Macros for easy insertion into run-time selection tables.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
defineTypeNameAndDebug(linearAxialAngularSpring, 0)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, linearAxialAngularSpring, dictionary)
point velocity(const point &pt) const
Return the velocity of a position.
virtual void write(Ostream &) const
Write.
scalar mass() const
Return the mass.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
static constexpr const zero Zero
Global zero (0)