Go to the documentation of this file.
37 namespace sixDoFRigidBodyMotionRestraints
43 sixDoFRigidBodyMotionRestraint,
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_);
185 os.
writeEntry(
"numberOfChains", numberOfChains_);
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
const Cmpt & x() const
Access to the vector x component.
scalar mass() const
Return the mass.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
point velocity(const point &pt) const
Return the velocity of a position.
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
Light wrapper around Function1 to provide a mechanism to update time-based entries.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
const Time & time() const
Return time.
const Cmpt & z() const
Access to the vector z component.
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, linearAxialAngularSpring, dictionary)
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual ~linearSpringDamper()
Destructor.
word name(const complex &c)
Return string representation of complex.
linearSpringDamper(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
Base class for defining restraints for sixDoF motions.
virtual void write(Ostream &) const
Write.
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.
const Cmpt & y() const
Access to the vector y component.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Six degree of freedom motion for a rigid body.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
bool report() const
Return the report Switch.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...