52 Foam::rigidBodyMeshMotion::bodyMesh::bodyMesh
57 const dictionary& dict
63 patchSet_(mesh.boundaryMesh().patchSet(patches_)),
70 name_ +
".motionScale",
83 Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
95 "rigidBodyMotionState",
104 "rigidBodyMotionState",
120 if (rhoName_ ==
"rhoInf")
131 if (bodyDict.
found(
"patches"))
139 model_.
bodyID(iter().keyword()),
162 /(bodyMeshes_[bi].do_ - bodyMeshes_[bi].di_),
211 <<
"The number of points in the mesh seems to have changed." <<
endl 212 <<
"In constant/polyMesh there are " <<
points0().
size()
213 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
224 if (
db().foundObject<uniformDimensionedVectorField>(
"g"))
234 for (
label i=0; i<nIter; i++)
250 const label bodyID = bodyMeshes_[bi].bodyID_;
253 forcesDict.
add(
"type", functionObjects::forces::typeName);
254 forcesDict.
add(
"patches", bodyMeshes_[bi].patches_);
255 forcesDict.
add(
"rhoInf", rhoInf_);
256 forcesDict.
add(
"rho", rhoName_);
277 model_.
status(bodyMeshes_[bi].bodyID_);
282 if (bodyMeshes_.
size() == 1)
286 bodyMeshes_[0].bodyID_,
287 bodyMeshes_[0].weight_,
297 bodyIDs[bi] = bodyMeshes_[bi].bodyID_;
298 weights[bi] = &bodyMeshes_[bi].weight_;
324 "rigidBodyMotionState",
335 return dict.regIOobject::write();
void newTime()
Store the motion state at the beginning of the time-step.
label timeIndex() const
Return current time index.
const Time & time() const
Return time.
const rigidBodyModelState & state() const
Return the motion state.
void append(T *)
Append an element at the end of the list.
Virtual base class for displacement motion solver.
#define forAll(list, i)
Loop across all elements in list.
pointVectorField pointDisplacement_
Point motion field.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
const objectRegistry & db() const
Return the local objectRegistry.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label bodyID(const word &name) const
Return the ID of the body with the given name.
void status(const label bodyID) const
Report the status of the motion of the given body.
void size(const label)
Override size to be inconsistent with allocated storage.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
virtual vector forceEff() const
Return the total force.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
static bool master(const label communicator=0)
Am I the master process.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write state using given format, version and compression.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
bool read(const dictionary &dict)
Read coefficients dictionary and update system parameters,.
label size() const
Return number of elements in list.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
~rigidBodyMeshMotion()
Destructor.
Macros for easy insertion into run-time selection tables.
label nBodies() const
Return the number of bodies in the model (bodies().size())
bool add(entry *, bool mergeEntry=false)
Add a new entry.
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
static const pointMesh & New(const polyMesh &mesh)
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
Mesh representing a set of points created from polyMesh.
virtual bool read()
Read dynamicMeshDict dictionary.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
label nDoF() const
Return the number of degrees of freedom of the model.
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar cos(const dimensionedScalar &ds)
virtual void solve()
Solve for motion.
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
const Time & time() const
Return time.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
Calculation of distance to nearest patch for all points.
void solve(scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
const polyMesh & mesh() const
Return reference to mesh.
streamFormat
Enumeration for the format of data in the stream.
void write(dictionary &dict) const
Write to dictionary.
const vector & g() const
Return the acceleration due to gravity.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
virtual void calcForcesMoment()
Calculate the forces and moments.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label readLabel(Istream &is)
virtual bool read()
Read dynamicMeshDict dictionary.
compressionType
Enumeration for the format of data in the stream.
pointField & points0()
Return reference to the reference field.
tmp< pointField > transformPoints(const label bodyID, const pointField &initialPoints) const
Transform the given initial pointField of the specified body.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
scalar deltaTValue() const
Return time step value.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual vector momentEff() const
Return the total moment.
word name(const complex &)
Return a string representation of a complex.
IOdictionary(const IOobject &)
Construct given an IOobject.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const Mesh & mesh() const
Return mesh.
bool headerOk()
Read and check header info.
Mesh consisting of general polyhedral cells.
static const Vector< scalar > zero
List< wordRe > wordReList
A List of wordRe (word or regular expression)
This function object calculates the forces and moments by integrating the pressure and skin-friction ...
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
bool report() const
Return the report Switch.
label size() const
Return the number of elements in the UPtrList.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.