35void Foam::RBD::rigidBodyMotion::initialize()
66 motionState_(*this,
dict),
67 motionState0_(motionState_),
73 "accelerationRelaxation",
79 aDamp_(
dict.getOrDefault<scalar>(
"accelerationDamping", 1)),
80 report_(
dict.getOrDefault<
Switch>(
"report", false)),
100 motionState_(*this, stateDict),
101 motionState0_(motionState_),
107 "accelerationRelaxation",
113 aDamp_(
dict.getOrDefault<scalar>(
"accelerationDamping", 1)),
114 report_(
dict.getOrDefault<
Switch>(
"report", false)),
141 const subBody& mBody = mergedBody(bodyId);
164 aRelax = aRelax_->value(motionState_.t());
167 state.
qDdot() = aDamp_*(aRelax*state.
qDdot() + (1 - aRelax)*qDdotPrev);
179 motionState_.t() = t;
180 motionState_.deltaT() = deltaT;
182 if (motionState0_.deltaT() < SMALL)
184 motionState0_.t() = t;
185 motionState0_.deltaT() = deltaT;
190 solver_->solve(tau, fx);
196 forwardDynamicsCorrection(motionState_);
205 Info<<
"Rigid-body motion of the " <<
name(bodyID) <<
nl
206 <<
" Centre of rotation: " << CofR.
r() <<
nl
207 <<
" Orientation: " << CofR.
E() <<
nl
208 <<
" Linear velocity: " << vCofR.
l() <<
nl
209 <<
" Angular velocity: " << vCofR.
w()
274 if (weight[i] > SMALL)
277 if (weight[i] > 1 - SMALL)
286 .transformPoint(initialPoints[i]);
307 const label bodyID = bodyIDs[bi];
329 w[bi] = (*(weights[bi]))[i];
330 sum1mw += w[bi]/(1 + SMALL - w[bi]);
340 w[bi] =
lambda*w[bi]/(1 + SMALL - w[bi]);
345 w[bodyIDs.
size()] = 1 - sumw;
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
static void scatter(const List< commsStruct > &comms, T &value, const int tag, const label comm)
Broadcast data: Distribute without modification.
Holds the motion state of rigid-body model.
const scalarField & qDdot() const
Return access to the joint acceleration.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
DynamicList< spatialTransform > X0_
Transform for external forces to the bodies reference frame.
void forwardDynamicsCorrection(const rigidBodyModelState &state) const
Correct the velocity and acceleration of the bodies in the model.
const vector & g() const
Return the acceleration due to gravity.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate the joint acceleration qDdot from the joint state q,.
Six degree of freedom motion for a rigid body.
spatialTransform X00(const label bodyId) const
Return the initial transform to the global frame for the.
tmp< pointField > transformPoints(const label bodyID, const pointField &initialPoints) const
Transform the given initial pointField of the specified body.
const vector vCofR(const label bodyID) const
Report linear velocity of the given body.
~rigidBodyMotion()
Destructor.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate and optionally relax the joint acceleration qDdot from.
const vector cCofR(const label bodyID) const
Report CofR of the given body.
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
label masterID() const
Return the master body Id.
Vector< Cmpt > w() const
Return the angular part of the spatial vector as a vector.
Vector< Cmpt > l() const
Return the linear part of the spatial vector as a vector.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
bool status() const
Return the execution status (on/off) of the function objects.
Septernion class used to perform translations and rotations in 3D space.
static const septernion I
splitCell * master() const
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
constexpr char nl
The newline '\n' character (0x0a)
scalarList X0(nSpecie, Zero)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.