36 namespace functionObjects
89 writeHeaderValue(file,
"Angle Units", angleFormat_);
90 writeCommented(file,
"Time");
93 <<
"centreOfRotation" <<
tab 94 <<
"centreOfMass" <<
tab 108 Foam::functionObjects::sixDoFRigidBodyState::motion()
const 111 refCast<const dynamicMotionSolverFvMesh>(obr_);
113 return (refCast<const sixDoFRigidBodyMotion>(mesh.
motion()));
127 vector angularVelocity(motion().omega());
129 if (angleFormat_ ==
"degrees")
131 angularVelocity.
x() =
radToDeg(angularVelocity.
x());
132 angularVelocity.
y() =
radToDeg(angularVelocity.
y());
133 angularVelocity.
z() =
radToDeg(angularVelocity.
z());
136 return angularVelocity;
155 if (angleFormat_ ==
"degrees")
157 rotationAngle.
x() =
radToDeg(rotationAngle.x());
158 rotationAngle.y() =
radToDeg(rotationAngle.y());
159 rotationAngle.z() =
radToDeg(rotationAngle.z());
161 angularVelocity.x() =
radToDeg(angularVelocity.x());
162 angularVelocity.y() =
radToDeg(angularVelocity.y());
163 angularVelocity.z() =
radToDeg(angularVelocity.z());
171 << rotationAngle <<
tab 173 << 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.
Specialization 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...