36 namespace functionObjects
91 writeHeaderValue(file,
"Angle Units", angleFormat_);
92 writeCommented(file,
"Time");
95 <<
"centreOfRotation" <<
tab 96 <<
"centreOfMass" <<
tab 110 Foam::functionObjects::sixDoFRigidBodyState::motion()
const 113 refCast<const dynamicMotionSolverFvMesh>(obr_);
115 return (refCast<const sixDoFRigidBodyMotion>(mesh.
motion()));
129 vector angularVelocity(motion().omega());
131 if (angleFormat_ ==
"degrees")
133 angularVelocity.
x() =
radToDeg(angularVelocity.
x());
134 angularVelocity.
y() =
radToDeg(angularVelocity.
y());
135 angularVelocity.
z() =
radToDeg(angularVelocity.
z());
138 return angularVelocity;
157 if (angleFormat_ ==
"degrees")
159 rotationAngle.
x() =
radToDeg(rotationAngle.x());
160 rotationAngle.y() =
radToDeg(rotationAngle.y());
161 rotationAngle.z() =
radToDeg(rotationAngle.z());
163 angularVelocity.x() =
radToDeg(angularVelocity.x());
164 angularVelocity.y() =
radToDeg(angularVelocity.y());
165 angularVelocity.z() =
radToDeg(angularVelocity.z());
173 << rotationAngle <<
tab 175 << angularVelocity <<
endl;
Six degree of freedom motion for a rigid body.
virtual bool write()
Write function.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
vector velocity() const
Return the current body velocity.
A list of keyword definitions, which are a keyword followed by any number of values (e...
point centreOfMass() const
Return the current centre of mass.
const point & centreOfRotation() const
Return the current centre of rotation.
Unit conversion functions.
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
vector angularVelocity() const
Return the current body angular velocity.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
virtual bool execute()
Execute, currently does nothing.
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyState data.
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
vector omega() const
Return the angular velocity in the global frame.
A class for handling words, derived from string.
const tensor & orientation() const
Return the orientation tensor, Q.
Quaternion class used to perform rotations in 3D space.
virtual void writeFileHeader(const label i=0)
overloaded writeFileHeader from writeFile
defineTypeNameAndDebug(Qdot, 0)
sixDoFRigidBodyState(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool write()
Write the sixDoFRigidBodyState.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual ~sixDoFRigidBodyState()
Destructor.
const motionSolver & motion() const
Return the motionSolver.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
The dynamicMotionSolverFvMesh.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...