85 point p = bodyPoint(refAttachmentPt_);
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_);
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,...
virtual bool read()
Re-read model coefficients if they have changed.
Base class for defining restraints for rigid-body dynamics.
Soft wall is a Damper-Linear spring restraint. Acts as a "soft" wall when the distance between 'ancho...
virtual ~softWall()
Destructor.
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.
Holds the motion state of rigid-body model.
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,...
virtual bool write()
Write the output fields.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
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)
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
A non-counting (dummy) refCount.