37namespace sixDoFRigidBodyMotionRestraints
61 oldRestraintForce_ =
Zero;
97 restraintPosition = motion.
transform(refAttachmentPt_);
100 vector r = restraintPosition - anchor_->value(t);
105 scalar m = motion.
mass();
107 restraintMoment =
Zero;
119 if (
mag(r) > restLength_)
127 scalar damping = psi_*2*m*wn_/numberOfChains_;
128 scalar stiffness =
sqr(wn_)*m/numberOfChains_;
133 - damping*(rDir & v)*rDir
134 - stiffness*(
mag(r) - restLength_)*rDir
136 + (1-frelax_)*oldRestraintForce_;
138 oldRestraintForce_ = restraintForce;
142 restraintForce =
Zero;
143 oldRestraintForce_ =
Zero;
149 Info<< t <<
" " << restraintForce.
x()
150 <<
" " << restraintForce.
y()
151 <<
" " << restraintForce.
z()
152 <<
" " <<
mag(r) - restLength_
165 sDoFRBMRCoeffs_.readEntry(
"refAttachmentPt", refAttachmentPt_);
166 psi_ = sDoFRBMRCoeffs_.getOrDefault<scalar>(
"psi", 1);
167 sDoFRBMRCoeffs_.readEntry(
"wn", wn_);
168 sDoFRBMRCoeffs_.readEntry(
"restLength", restLength_);
169 sDoFRBMRCoeffs_.readEntry(
"numberOfChains", numberOfChains_);
170 frelax_ = sDoFRBMRCoeffs_.getOrDefault<scalar>(
"frelax", 0.8);
181 os.writeEntry(
"refAttachmentPt", refAttachmentPt_);
182 os.writeEntry(
"psi", psi_);
183 os.writeEntry(
"wn", wn_);
184 os.writeEntry(
"restLength", restLength_);
185 os.writeEntry(
"numberOfChains", numberOfChains_);
186 os.writeEntryIfDifferent<scalar>(
"psi", 1, psi_);
187 os.writeEntryIfDifferent<scalar>(
"frelax", 0.8, frelax_);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
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.
scalar timeOutputValue() const
Return current time value.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool write()
Write the output fields.
Base class for defining restraints for sixDoF motions.
sixDoFRigidBodyMotionRestraints model. Linear Spring-Damper system.
virtual ~linearSpringDamper()
Destructor.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
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 Time & time() const
Return time.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
scalar mass() const
Return the mass.
point velocity(const point &pt) const
Return the velocity of a position.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.