32 void Foam::RBD::rigidBodyMotion::initialise()
62 motionState_(*this,
dict),
63 motionState0_(motionState_),
65 aRelax_(
dict.lookupOrDefault<scalar>(
"accelerationRelaxation", 1.0)),
66 aDamp_(
dict.lookupOrDefault<scalar>(
"accelerationDamping", 1.0)),
67 report_(
dict.lookupOrDefault<
Switch>(
"report", false)),
86 motionState_(*this, stateDict),
87 motionState0_(motionState_),
89 aRelax_(
dict.lookupOrDefault<scalar>(
"accelerationRelaxation", 1.0)),
90 aDamp_(
dict.lookupOrDefault<scalar>(
"accelerationDamping", 1.0)),
91 report_(
dict.lookupOrDefault<
Switch>(
"report", false)),
118 const subBody& mBody = mergedBody(bodyId);
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);
166 forwardDynamicsCorrection(motionState_);
176 Info<<
"Rigid-body motion of the " <<
name(bodyID) <<
nl
177 <<
" Centre of rotation: " << CofR.
r() <<
nl
178 <<
" Orientation: " << CofR.
E() <<
nl
179 <<
" Linear velocity: " << vCofR.
l() <<
nl
180 <<
" Angular velocity: " << vCofR.
w() <<
nl
181 <<
" Linear acceleration: " << aCofR.
l() <<
nl
182 <<
" Angular acceleration: " << aCofR.
w()
192 return X0(bodyID).inv() & X00(bodyID);
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
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,.
spatialTransform X00(const label bodyId) const
Return the initial transform to the global frame for the.
~rigidBodyMotion()
Destructor.
void status(const label bodyID) const
Report the status of the motion of the given body.
rigidBodyMotion()
Construct null.
spatialTransform transform0(const label bodyID) const
Return the transformation of bodyID relative to the initial time.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate and optionally relax the joint acceleration qDdot from.
void solve(const scalar t, const scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
This specialised rigidBody holds the original body after it has been merged into a master.
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
label masterIndex() 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,...
static bool master(const label communicator=0)
Am I the master process.
A list of keyword definitions, which are a keyword followed by any number of values (e....
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Vector< scalar > vector
A scalar version of the templated Vector.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
scalarList X0(nSpecie, 0.0)