Go to the documentation of this file.
39 namespace functionObjects
54 Foam::functionObjects::sixDoFRigidBodyState::angleTypes
56 Foam::functionObjects::sixDoFRigidBodyState::angleTypeNames_
58 { angleTypes::RADIANS,
"radians" },
59 { angleTypes::DEGREES,
"degrees" },
72 <<
"centreOfRotation" <<
tab
73 <<
"centreOfMass" <<
tab
82 Foam::functionObjects::sixDoFRigidBodyState::sixDoFRigidBodyState
91 angleFormat_(angleTypes::RADIANS)
94 writeFileHeader(file());
105 angleTypeNames_.getOrDefault
128 refCast<const dynamicMotionSolverFvMesh>(obr_);
131 refCast<const sixDoFRigidBodyMotionSolver>(
mesh.motion());
140 vector angularVelocity(motion.omega());
142 switch (angleFormat_)
144 case angleTypes::RADIANS:
149 case angleTypes::DEGREES:
151 rotationAngle.
x() =
radToDeg(rotationAngle.x());
152 rotationAngle.y() =
radToDeg(rotationAngle.y());
153 rotationAngle.z() =
radToDeg(rotationAngle.z());
155 angularVelocity.x() =
radToDeg(angularVelocity.x());
156 angularVelocity.y() =
radToDeg(angularVelocity.y());
157 angularVelocity.z() =
radToDeg(angularVelocity.z());
163 <<
"Unhandled enumeration " << angleTypeNames_[angleFormat_]
168 writeCurrentTime(file());
171 << motion.centreOfRotation() <<
tab
172 << motion.centreOfMass() <<
tab
173 << rotationAngle <<
tab
175 << angularVelocity <<
endl;
const Cmpt & x() const
Access to the vector x component.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual void writeFileHeader(Ostream &os)
Overloaded writeFileHeader from writeFile.
A class for handling words, derived from Foam::string.
6-DoF solid-body mesh motion solver for an fvMesh.
virtual bool execute()
Execute, currently does nothing.
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyState data.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Unit conversion functions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
void writeHeaderValue(Ostream &os, const string &property, const Type &value) const
Write a (commented) header property and value pair.
Quaternion class used to perform rotations in 3D space.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
word name(const complex &c)
Return string representation of complex.
constexpr scalar radToDeg(const scalar rad) noexcept
Conversion from radians to degrees.
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
Macros for easy insertion into run-time selection tables.
virtual bool write()
Write the sixDoFRigidBodyState.
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
Six degree of freedom motion for a rigid body.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
defineTypeNameAndDebug(ObukhovLength, 0)
Base class for writing single files from the function objects.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
The dynamicMotionSolverFvMesh.