85 point p = bodyPoint(refAttachmentPt_);
90 vector force = vector::zero;
91 vector moment = vector::zero;
93 vector v = bodyPointVelocity(refAttachmentPt_).l();
95 scalar m = model_.bodies()[bodyID_].m();
97 scalar d = (wallNormal_/
mag(wallNormal_)) & r;
102 scalar damping = psi_*2*m*wn;
103 scalar stiffness =
sqr(wn)*m;
108 (-damping*(rDir & v) + stiffness*d)*rDir;
110 moment = (
p ^ force);
115 Info<<
" stiffness :" << stiffness*d <<
nl 116 <<
" damping :" << -damping*
mag(rDir & v) <<
nl 117 <<
" force : " << force <<
nl 118 <<
" d : " << d <<
nl 119 <<
" r : " << r <<
nl 120 <<
" p : " <<
p <<
nl 121 <<
" velocity : " << v
137 coeffs_.readEntry(
"anchor", anchor_);
138 coeffs_.readEntry(
"refAttachmentPt", refAttachmentPt_);
139 coeffs_.readEntry(
"psi", psi_);
140 coeffs_.readEntry(
"C", C_);
141 coeffs_.readEntry(
"wallNormal", wallNormal_);
154 os.writeEntry(
"anchor", anchor_);
155 os.writeEntry(
"refAttachmentPt", refAttachmentPt_);
156 os.writeEntry(
"psi", psi_);
157 os.writeEntry(
"C", C_);
158 os.writeEntry(
"wallNormal", wallNormal_);
virtual void restrain(scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
Accumulate the restraint internal joint forces into the tau field and.
addToRunTimeSelectionTable(restraint, externalForce, dictionary)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
defineTypeNameAndDebug(externalForce, 0)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Base class for defining restraints for rigid-body dynamics.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void write(Ostream &) const
Write.
Macros for easy insertion into run-time selection tables.
Holds the motion state of rigid-body model.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
softWall(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from components.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual ~softWall()
Destructor.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints...
virtual void write(Ostream &) const =0
Write.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.