Go to the documentation of this file.
99 motionState_(stateDict),
109 "initialCentreOfMass",
113 initialCentreOfRotation_(initialCentreOfMass_),
118 "initialOrientation",
123 momentOfInertia_(
dict.
lookup(
"momentOfInertia")),
133 addConstraints(
dict);
136 vector R(initialCentreOfMass_ - initialCentreOfRotation_);
144 if (!stateDict.
found(
"centreOfRotation"))
146 motionState_.centreOfRotation() = initialCentreOfRotation_;
151 motionState0_ = motionState_;
169 mass_(sDoFRBM.
mass_),
196 restraints_.setSize(restraintDict.size());
214 restraints_.setSize(i);
230 constraints_.setSize(constraintDict.size());
250 constraints_[i].setCentreOfRotation(initialCentreOfRotation_);
251 constraints_[i].constrainTranslation(pct);
252 constraints_[i].constrainRotation(pcr);
258 constraints_.setSize(i);
263 Info<<
"Translational constraint tensor " << tConstraints_ <<
nl
264 <<
"Rotational constraint tensor " << rConstraints_ <<
endl;
275 static bool first =
false;
279 vector tauPrevIter = tau();
283 tau() = (
Q().T() & tauGlobal);
289 a() = aRelax_*a() + (1 - aRelax_)*aPrevIter;
290 tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter;
308 solver_->solve(firstIter, fGlobal, tauGlobal, deltaT, deltaT0);
322 Info<<
"6-DoF rigid body motion" <<
nl
323 <<
" Centre of rotation: " << centreOfRotation() <<
nl
324 <<
" Centre of mass: " << centreOfMass() <<
nl
325 <<
" Orientation: " << orientation() <<
nl
326 <<
" Linear velocity: " << v() <<
nl
327 <<
" Angular velocity: " << omega()
340 + (
Q() & initialQ_.T() & (initialPoints - initialCentreOfRotation_))
354 centreOfRotation() - initialCentreOfRotation(),
364 if (scale[pointi] > SMALL)
367 if (scale[pointi] > 1 - SMALL)
377 initialCentreOfRotation()
380 initialPoints[pointi]
381 - initialCentreOfRotation()
vectorField pointField
pointField is a vectorField.
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
sixDoFRigidBodyMotion()
Construct null.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
const tensor & Q() const
Return the orientation.
sixDoFRigidBodyMotionState motionState0_
Motion state data object for previous time-step.
Septernion class used to perform translations and rotations in 3D space.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
static autoPtr< sixDoFSolver > New(const dictionary &dict, sixDoFRigidBodyMotion &body)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Accumulates point constraints through successive applications of the applyConstraint function.
A class representing the concept of 1 (scalar(1.0)) used to avoid unnecessary manipulations for objec...
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
~sixDoFRigidBodyMotion()
Destructor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar aDamp_
Acceleration damping coefficient (for steady-state simulations)
tensor rConstraints_
Rotational constraint tensor.
PtrList< sixDoFRigidBodyMotionRestraint > restraints_
Motion restraints.
void addRestraints(const dictionary &dict)
Add restraints to the motion, public to allow external.
Switch report_
Switch to turn reporting of motion data on and off.
dimensionSet transform(const dimensionSet &)
Quaternion class used to perform rotations in 3D space.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
This function object calculates and outputs the second invariant of the velocity gradient tensor [1/s...
point initialCentreOfRotation_
Centre of rotation of initial state.
vector transform(const vector &v) const
Transform the given vector.
static autoPtr< sixDoFRigidBodyMotionConstraint > New(const word &name, const dictionary &sDoFRBMCDict, const sixDoFRigidBodyMotion &motion)
Select constructed from the sDoFRBMCDict dictionary and Time.
void update(bool firstIter, const vector &fGlobal, const vector &tauGlobal, scalar deltaT, scalar deltaT0)
Symplectic integration of velocities, orientation and position.
#define R(A, B, C, D, E, F, K, M)
tensor tConstraints_
Translational constraint tensor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Pre-declare SubField and related Field type.
void addConstraints(const dictionary &dict)
Add restraints to the motion, public to allow external.
scalar aRelax_
Acceleration relaxation coefficient.
tensor initialQ_
Orientation of initial state.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static const sphericalTensor I(1)
A list of keyword definitions, which are a keyword followed by any number of values (e....
diagTensor momentOfInertia_
Moment of inertia of the body in reference configuration.
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))
void updateAcceleration(const vector &fGlobal, const vector &tauGlobal)
Update and relax accelerations from the force and torque.
static bool master(const label communicator=0)
Am I the master process.
scalar mass_
Mass of the body.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Six degree of freedom motion for a rigid body.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
sixDoFRigidBodyMotionState motionState_
Motion state data object.
static const septernion I
tensor constraintTransformation() const
Return the accumulated constraint transformation tensor.
const vector & a() const
Return the current acceleration.
PtrList< sixDoFRigidBodyMotionConstraint > constraints_
Motion constaints.
point initialCentreOfMass_
Centre of mass of initial state.
const point & centreOfRotation() const
Return the current centre of rotation.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
void applyRestraints()
Apply the restraints to the object.
void status() const
Report the status of the motion.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const vector & tau() const
Return the current torque.
static autoPtr< sixDoFRigidBodyMotionRestraint > New(const word &name, const dictionary &sDoFRBMRDict)
Select constructed from the sDoFRBMRDict dictionary and Time.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Tensor< Cmpt > T() const
Transpose.