38 namespace functionObjects
93 writeHeaderValue(file,
"Angle Units", angleFormat_);
94 writeCommented(file,
"Time");
97 <<
"centreOfRotation" <<
tab 98 <<
"centreOfMass" <<
tab 112 Foam::functionObjects::sixDoFRigidBodyState::motion()
const 114 const fvMeshMovers::motionSolver& mover =
115 refCast<const fvMeshMovers::motionSolver>(mesh_.mover());
117 return (refCast<const sixDoFRigidBodyMotion>(mover.motion()));
131 vector angularVelocity(motion().omega());
133 if (angleFormat_ ==
"degrees")
135 angularVelocity.
x() =
radToDeg(angularVelocity.
x());
136 angularVelocity.
y() =
radToDeg(angularVelocity.
y());
137 angularVelocity.
z() =
radToDeg(angularVelocity.
z());
140 return angularVelocity;
159 if (angleFormat_ ==
"degrees")
161 rotationAngle.
x() =
radToDeg(rotationAngle.x());
162 rotationAngle.y() =
radToDeg(rotationAngle.y());
163 rotationAngle.z() =
radToDeg(rotationAngle.z());
165 angularVelocity.x() =
radToDeg(angularVelocity.x());
166 angularVelocity.y() =
radToDeg(angularVelocity.y());
167 angularVelocity.z() =
radToDeg(angularVelocity.z());
175 << rotationAngle <<
tab 177 << angularVelocity <<
endl;
Six degree of freedom motion for a rigid body.
virtual bool write()
Write function.
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.
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...