80 point attachmentPt = bodyPoint(refAttachmentPt_);
83 vector r = attachmentPt - anchor_;
88 vector v = bodyPointVelocity(refAttachmentPt_).l();
93 (-stiffness_*(magR - restLength_) - damping_*(r & v))*r
96 vector moment(attachmentPt ^ force);
100 Info<<
" attachmentPt " << attachmentPt
101 <<
" attachmentPt - anchor " << r*magR
102 <<
" spring length " << magR
103 <<
" force " << force
104 <<
" moment " << moment
120 coeffs_.lookup(
"anchor") >> anchor_;
121 coeffs_.lookup(
"refAttachmentPt") >> refAttachmentPt_;
122 coeffs_.lookup(
"stiffness") >> stiffness_;
123 coeffs_.lookup(
"damping") >> damping_;
124 coeffs_.lookup(
"restLength") >> restLength_;
A list of keyword definitions, which are a keyword followed by any number of values (e...
linearSpring(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from components.
Base class for defining restraints for rigid-body dynamics.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
virtual void write(Ostream &) const
Write.
bool read(const char *, int32_t &)
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
A class for handling words, derived from string.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
virtual void restrain(scalarField &tau, Field< spatialVector > &fx) const
Accumulate the retraint internal joint forces into the tau field and.
virtual ~linearSpring()
Destructor.
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(linearAxialAngularSpring, 0)
addToRunTimeSelectionTable(restraint, linearAxialAngularSpring, dictionary)
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints...
virtual void write(Ostream &) const =0
Write.