35 namespace functionObjects
52 Foam::functionObjects::rigidBodyState::motion()
const
54 const fvMeshMovers::motionSolver& mover =
55 refCast<const fvMeshMovers::motionSolver>(
mesh_.
mover());
57 return (refCast<const RBD::rigidBodyMotion>(mover.motion()));
73 angularVelocityUnits_(
"[rad/s]"),
74 names_(motion().movingBodyNames())
94 angleUnits_.readIfPresent(
"angleUnits",
dict);
95 angularVelocityUnits_.readIfPresent(
"angularVelocityUnits",
dict);
108 writeHeaderValue(
file,
"Angle Units", angleUnits_);
109 writeHeaderValue(
file,
"Angular Velocity Units", angularVelocityUnits_);
110 writeCommented(
file,
"Time");
113 <<
"Centre of rotation" <<
tab
114 <<
"Orientation" <<
tab
115 <<
"Linear velocity" <<
tab
116 <<
"Angular velocity" <<
endl;
145 writeTime(files()[i]);
149 << angleUnits_.toUser(theta) <<
tab
151 << angularVelocityUnits_.toUser(
omega) <<
endl;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
const spatialVector & v(const label i) const
Return the spatial velocity of the bodies.
label bodyIndex(const word &name) const
Return the ID of the body with the given name.
spatialTransform X0(const label bodyId) const
Return the current transform to the global frame for the given body.
Six degree of freedom motion for a rigid body.
Vector< Cmpt > w() const
Return the angular part of the spatial vector as a vector.
Vector< Cmpt > l() const
Return the linear part of the spatial vector as a vector.
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...
const fvMesh & mesh_
Reference to the 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 rigid body motion state.
rigidBodyState(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual ~rigidBodyState()
Destructor.
virtual void writeFileHeader(const label i=0)
overloaded writeFileHeader from writeFile
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the rigidBodyState.
virtual bool read(const dictionary &)
Read the rigidBodyState data.
const fvMeshMover & mover() const
Return the mover function class.
Convenience class to handle the input of constant rotational speed. Reads an omega entry with default...
Quaternion class used to perform rotations in 3D space.
vector eulerAngles(const rotationSequence rs) const
Return a vector of euler angles corresponding to the.
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.
word name(const bool)
Return a word representation of a bool.
const HashTable< unitConversion > & units()
Get the table of unit conversions.