38 namespace functionObjects
80 angleUnits_ =
dict.lookupOrDefaultBackwardsCompatible<
word>
82 {
"angleUnits",
"angleFormat"},
97 writeHeaderValue(
file,
"Angle Units", angleUnits_);
98 writeCommented(
file,
"Time");
101 <<
"centreOfRotation" <<
tab
102 <<
"centreOfMass" <<
tab
116 Foam::functionObjects::sixDoFRigidBodyState::motion()
const
119 refCast<const fvMeshMovers::motionSolver>(mesh_.mover());
121 return (refCast<const sixDoFRigidBodyMotion>(mover.
motion()));
137 if (angleUnits_ ==
"degrees")
139 angularVelocity.
x() =
radToDeg(angularVelocity.
x());
140 angularVelocity.
y() =
radToDeg(angularVelocity.
y());
141 angularVelocity.
z() =
radToDeg(angularVelocity.
z());
144 return angularVelocity;
163 if (angleUnits_ ==
"degrees")
165 rotationAngle.
x() =
radToDeg(rotationAngle.
x());
166 rotationAngle.
y() =
radToDeg(rotationAngle.
y());
167 rotationAngle.
z() =
radToDeg(rotationAngle.
z());
169 angularVelocity.
x() =
radToDeg(angularVelocity.
x());
170 angularVelocity.
y() =
radToDeg(angularVelocity.
y());
171 angularVelocity.
z() =
radToDeg(angularVelocity.
z());
179 << rotationAngle <<
tab
181 << angularVelocity <<
endl;
Macros for easy insertion into run-time selection tables.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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....
Abstract base-class for Time/database functionObjects.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
virtual bool write()
Write function.
virtual bool read(const dictionary &)
Read optional controls.
Writes the 6-DoF motion state.
vector velocity() const
Return the current body velocity.
virtual ~sixDoFRigidBodyState()
Destructor.
vector angularVelocity() const
Return the current body angular velocity.
sixDoFRigidBodyState(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual void writeFileHeader(const label i=0)
overloaded writeFileHeader from writeFile
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the sixDoFRigidBodyState.
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyState data.
const Foam::motionSolver & motion() const
Return the motionSolver.
Quaternion class used to perform rotations in 3D space.
vector eulerAngles(const rotationSequence rs) const
Return a vector of euler angles corresponding to the.
Six degree of freedom motion for a rigid body.
point centreOfMass() const
Return the current centre of mass.
const tensor & orientation() const
Return the orientation tensor, Q.
vector omega() const
Return the angular velocity in the global frame.
const point & centreOfRotation() const
Return the current centre of rotation.
A class for handling words, derived from string.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
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.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
word name(const complex &)
Return a string representation of a complex.
Unit conversion functions.