32 void Foam::RBD::rigidBodyMotion::initialise()
62 motionState_(*
this, dict),
63 motionState0_(motionState_),
86 motionState_(*
this, stateDict),
87 motionState0_(motionState_),
137 state.
qDdot() = aDamp_*(aRelax_*state.
qDdot() + (1 - aRelax_)*qDdotPrev);
149 motionState_.
t() = t;
150 motionState_.
deltaT() = deltaT;
152 if (motionState0_.
deltaT() < small)
154 motionState0_.
t() = t;
155 motionState0_.
deltaT() = deltaT;
160 solver_->solve(tau, fx);
175 Info<<
"Rigid-body motion of the " <<
name(bodyID) <<
nl 176 <<
" Centre of rotation: " << CofR.
r() <<
nl 177 <<
" Orientation: " << CofR.
E() <<
nl 178 <<
" Linear velocity: " << vCofR.
l() <<
nl 179 <<
" Angular velocity: " << vCofR.
w()
227 if (weight[i] > small)
230 if (weight[i] > 1 - small)
239 .transformPoint(initialPoints[i]);
260 const label bodyID = bodyIDs[bi];
282 w[bi] = (*(weights[bi]))[i];
283 sum1mw += w[bi]/(1 + small - w[bi]);
293 w[bi] = lambda*w[bi]/(1 + small - w[bi]);
298 w[bodyIDs.
size()] = 1 - sumw;
300 points[i] =
average(ss, w).transformPoint(initialPoints[i]);
const subBody & mergedBody(label mergedBodyID) const
Return the merged body for the given body ID.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
static autoPtr< rigidBodySolver > New(rigidBodyMotion &body, const dictionary &dict)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
DynamicList< spatialTransform > X0_
Transform for external forces to the bodies reference frame.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void forwardDynamicsCorrection(const rigidBodyModelState &state) const
Correct the velocity and acceleration of the bodies in the model.
tmp< pointField > transformPoints(const label bodyID, const pointField &initialPoints) const
Transform the given initial pointField of the specified body.
const spatialVector & v(const label i) const
Return the spatial velocity of the bodies.
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void status(const label bodyID) const
Report the status of the motion of the given body.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
static bool master(const label communicator=0)
Am I the master process.
spatialTransform X00(const label bodyId) const
Return the initial transform to the global frame for the.
Vector< scalar > vector
A scalar version of the templated Vector.
Septernion class used to perform translations and rotations in 3D space.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Holds the motion state of rigid-body model.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
vectorField pointField
pointField is a vectorField.
scalar t() const
Return access to the time.
This specialised rigidBody holds the original body after it has been merged into a master...
const word & name(const label bodyID) const
Return the name of body with the given ID.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
static const septernion I
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Vector< Cmpt > l() const
Return the linear part of the spatial vector as a vector.
void solve(const scalar t, const scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
scalar deltaT() const
Return access to the time-step.
label masterID() const
Return the master body Id.
rigidBodyMotion()
Construct null.
const vector & g() const
Return the acceleration due to gravity.
Vector< Cmpt > w() const
Return the angular part of the spatial vector as a vector.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
const DynamicList< label > & lambda() const
List of indices of the parent of each body.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints...
A class for managing temporary objects.
spatialTransform X0(const label bodyId) const
Return the current transform to the global frame for the given body.
~rigidBodyMotion()
Destructor.
rigidBodyModel()
Null-constructor which adds the single root-body at the origin.
const scalarField & qDdot() const
Return access to the joint acceleration.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate the joint acceleration qDdot from the joint state q,.
bool merged(label bodyID) const
Return true if the body with given ID has been merged with a parent.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate and optionally relax the joint acceleration qDdot from.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const spatialTransform & masterXT() const
Return the transform with respect to the master body.