36 namespace functionObjects
53 Foam::functionObjects::rigidBodyState::motion()
const
55 const fvMeshMovers::motionSolver& mover =
56 refCast<const fvMeshMovers::motionSolver>(
mesh_.
mover());
58 return (refCast<const RBD::rigidBodyMotion>(mover.motion()));
73 names_(motion().movingBodyNames())
91 angleUnits_ =
dict.lookupOrDefaultBackwardsCompatible<
word>
93 {
"angleUnits",
"angleFormat"},
106 writeHeaderValue(this->files()[i],
"Angle Units", angleUnits_);
107 writeCommented(this->files()[i],
"Time");
109 this->files()[i]<<
tab
110 <<
"Centre of rotation" <<
tab
111 <<
"Orientation" <<
tab
112 <<
"Linear velocity" <<
tab
113 <<
"Angular velocity" <<
endl;
144 vector angularVelocity(vCofR.
w());
146 if (angleUnits_ ==
"degrees")
148 rotationAngle.
x() =
radToDeg(rotationAngle.
x());
149 rotationAngle.
y() =
radToDeg(rotationAngle.
y());
150 rotationAngle.
z() =
radToDeg(rotationAngle.
z());
152 angularVelocity.
x() =
radToDeg(angularVelocity.
x());
153 angularVelocity.
y() =
radToDeg(angularVelocity.
y());
154 angularVelocity.
z() =
radToDeg(angularVelocity.
z());
157 writeTime(files()[i]);
161 << rotationAngle <<
tab
163 << angularVelocity <<
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 bodyID(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.
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.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
word name(const complex &)
Return a string representation of a complex.
Unit conversion functions.