86 Function1<vector>::New
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_);
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
scalar timeOutputValue() const
Return the current user-time value. (ie, after applying any timeToUserTime() conversion).
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Base class for defining restraints for sixDoF motions.
sixDoFRigidBodyMotionRestraint(const word &name, const dictionary &sDoFRBMRDict)
Construct from the sDoFRBMRDict dictionary and Time.
const word & name() const
Return the name.
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
dictionary sDoFRBMRCoeffs_
Restraint model specific coefficient dictionary.
const dictionary & coeffDict() const
sixDoFRigidBodyMotionRestraints model. Linear Spring-Damper system.
virtual void write(Ostream &) const
Write.
virtual ~linearSpringDamper()
Destructor.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
linearSpringDamper(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
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)
Namespace for six DoF motion restraints.
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 expressions::valueTypeCode::INVALID.