Go to the documentation of this file.
35 void Foam::RBD::rigidBodyMotion::initialize()
48 Foam::RBD::rigidBodyMotion::rigidBodyMotion(
const Time& time)
59 Foam::RBD::rigidBodyMotion::rigidBodyMotion
66 motionState_(*
this,
dict),
67 motionState0_(motionState_),
69 aRelax_(
dict.getOrDefault<scalar>(
"accelerationRelaxation", 1)),
70 aDamp_(
dict.getOrDefault<scalar>(
"accelerationDamping", 1)),
71 report_(
dict.getOrDefault<
Switch>(
"report",
false)),
83 Foam::RBD::rigidBodyMotion::rigidBodyMotion
91 motionState_(*
this, stateDict),
92 motionState0_(motionState_),
94 aRelax_(
dict.getOrDefault<scalar>(
"accelerationRelaxation", 1)),
95 aDamp_(
dict.getOrDefault<scalar>(
"accelerationDamping", 1)),
96 report_(
dict.getOrDefault<
Switch>(
"report",
false)),
123 const subBody& mBody = mergedBody(bodyId);
142 state.
qDdot() = aDamp_*(aRelax_*state.
qDdot() + (1 - aRelax_)*qDdotPrev);
154 motionState_.t() = t;
155 motionState_.deltaT() = deltaT;
157 if (motionState0_.deltaT() < SMALL)
159 motionState0_.t() = t;
160 motionState0_.deltaT() = deltaT;
165 solver_->solve(tau, fx);
171 forwardDynamicsCorrection(motionState_);
180 Info<<
"Rigid-body motion of the " <<
name(bodyID) <<
nl
181 <<
" Centre of rotation: " << CofR.
r() <<
nl
182 <<
" Orientation: " << CofR.
E() <<
nl
183 <<
" Linear velocity: " << vCofR.
l() <<
nl
184 <<
" Angular velocity: " << vCofR.
w()
232 if (weight[i] > SMALL)
235 if (weight[i] > 1 - SMALL)
244 .transformPoint(initialPoints[i]);
265 const label bodyID = bodyIDs[bi];
287 w[bi] = (*(weights[bi]))[i];
288 sum1mw += w[bi]/(1 + SMALL - w[bi]);
298 w[bi] =
lambda*w[bi]/(1 + SMALL - w[bi]);
303 w[bodyIDs.size()] = 1 - sumw;
void solve(const scalar t, const scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
vectorField pointField
pointField is a vectorField.
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.
Holds the motion state of rigid-body model.
const scalarField & qDdot() const
Return access to the joint acceleration.
Septernion class used to perform translations and rotations in 3D space.
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))
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
scalarList X0(nSpecie, Zero)
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
void status(const label bodyID) const
Report the status of the motion of the given body.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label masterID() const
Return the master body Id.
#define forAll(list, i)
Loop across all elements in list.
DynamicList< spatialTransform > X0_
Transform for external forces to the bodies reference frame.
static autoPtr< rigidBodySolver > New(rigidBodyMotion &body, const dictionary &dict)
void forwardDynamicsCorrection(const rigidBodyModelState &state) const
Correct the velocity and acceleration of the bodies in the model.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
Vector< Cmpt > l() const
Return the linear part of the spatial vector as a vector.
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,...
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
spatialTransform X00(const label bodyId) const
Return the initial transform to the global frame for the.
const uniformDimensionedVectorField & g
static bool master(const label communicator=0)
Am I the master process.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate the joint acceleration qDdot from the joint state q,.
~rigidBodyMotion()
Destructor.
static const septernion I
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
tmp< pointField > transformPoints(const label bodyID, const pointField &initialPoints) const
Transform the given initial pointField of the specified body.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate and optionally relax the joint acceleration qDdot from.
Vector< Cmpt > w() const
Return the angular part of the spatial vector as a vector.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)