34 namespace functionObjects
51 Foam::functionObjects::rigidBodyState::motion()
const
53 const fvMeshMovers::pointMeshMover& mover =
54 refCast<const fvMeshMovers::pointMeshMover>(
mesh_.
mover());
56 return (refCast<const RBD::rigidBodyMotion>(mover.mover()));
72 angularVelocityUnits_(
"[rad/s]"),
73 names_(motion().movingBodyNames())
93 angleUnits_.readIfPresent(
"angleUnits",
dict);
94 angularVelocityUnits_.readIfPresent(
"angularVelocityUnits",
dict);
107 writeHeaderValue(
file,
"Angle Units", angleUnits_);
108 writeHeaderValue(
file,
"Angular Velocity Units", angularVelocityUnits_);
109 writeCommented(
file,
"Time");
112 <<
"Centre of rotation" <<
tab
113 <<
"Orientation" <<
tab
114 <<
"Linear velocity" <<
tab
115 <<
"Angular velocity" <<
endl;
144 writeTime(files()[i]);
148 << angleUnits_.toUser(theta) <<
tab
150 << 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 body i.
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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(fvMeshFunctionObject, 0)
addToRunTimeSelectionTable(functionObject, fvModel, dictionary)
const HashTable< unitSet > & table()
Get the table of unit conversions.
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 LagrangianState state)
Return a string representation of a Lagrangian state enumeration.