Go to the documentation of this file.
83 point attachmentPt = bodyPoint(refAttachmentPt_);
86 vector r = attachmentPt - anchor_;
91 vector v = bodyPointVelocity(refAttachmentPt_).l();
96 (-stiffness_*(magR - restLength_) - damping_*(r & v))*r
99 vector moment(attachmentPt ^ force);
103 Info<<
" attachmentPt " << attachmentPt
104 <<
" attachmentPt - anchor " << r*magR
105 <<
" spring length " << magR
106 <<
" force " << force
107 <<
" moment " << moment
123 coeffs_.readEntry(
"anchor", anchor_);
124 coeffs_.readEntry(
"refAttachmentPt", refAttachmentPt_);
125 coeffs_.readEntry(
"stiffness", stiffness_);
126 coeffs_.readEntry(
"damping", damping_);
127 coeffs_.readEntry(
"restLength", restLength_);
141 os.
writeEntry(
"refAttachmentPt", refAttachmentPt_);
virtual void write(Ostream &) const
Write.
addToRunTimeSelectionTable(restraint, externalForce, dictionary)
defineTypeNameAndDebug(externalForce, 0)
Holds the motion state of rigid-body model.
A class for handling words, derived from Foam::string.
Ostream & endl(Ostream &os)
Add newline and flush stream.
linearSpring(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from components.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
virtual void restrain(scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
Accumulate the restraint internal joint forces into the tau field and.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
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.
virtual ~linearSpring()
Destructor.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
virtual void write(Ostream &) const =0
Write.
Base class for defining restraints for rigid-body dynamics.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read(const dictionary &dict)
Update properties from given dictionary.