53 Foam::rigidBodyMeshMotion::bodyMesh::bodyMesh
58 const dictionary& dict
64 patchSet_(mesh.boundaryMesh().patchSet(patches_)),
71 name_ +
".motionScale",
96 "rigidBodyMotionState",
100 ).typeHeaderOk<IOdictionary>(
true)
105 "rigidBodyMotionState",
122 if (rhoName_ ==
"rhoInf")
142 if (bodyDict.
found(
"patches"))
149 <<
"Body " << iter().keyword()
150 <<
" has been merged with another body" 151 " and cannot be assigned a set of patches" 184 /(bodyMeshes_[bi].do_ - bodyMeshes_[bi].di_),
233 <<
"The number of points in the mesh seems to have changed." <<
endl 234 <<
"In constant/polyMesh there are " <<
points0().
size()
235 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
246 const scalar ramp = ramp_->value(t.
value());
259 for (
label i=0; i<nIter; i++)
279 forcesDict.
add(
"type", functionObjects::forces::typeName);
280 forcesDict.
add(
"patches", bodyMeshes_[bi].patches_);
281 forcesDict.
add(
"rhoInf", rhoInf_);
282 forcesDict.
add(
"rho", rhoName_);
304 status(bodyMeshes_[bi].bodyID_);
309 if (bodyMeshes_.
size() == 1)
313 bodyMeshes_[0].bodyID_,
314 bodyMeshes_[0].weight_,
324 bodyIDs[bi] = bodyMeshes_[bi].bodyID_;
325 weights[bi] = &bodyMeshes_[bi].weight_;
346 "rigidBodyMotionState",
359 dict.regIOobject::writeObject
363 mesh().time().writeCompression(),
void newTime()
Store the motion state at the beginning of the time-step.
Template class for intrusive linked lists.
virtual vector momentEff() const
Return the total moment.
void append(T *)
Append an element at the end of the list.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#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.
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 > &)
virtual bool write() const
Write motion state information for restart.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< pointField > transformPoints(const label bodyID, const pointField &initialPoints) const
Transform the given initial pointField of the specified body.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void status(const label bodyID) const
Report the status of the motion of the given body.
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/any.
static bool master(const label communicator=0)
Am I the master process.
bool foundObject(const word &name) const
Is the named Type found?
virtual bool write() const
Optionally write motion state information for restart.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
virtual vector forceEff() const
Return the total force.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
label nBodies() const
Return the number of bodies in the model (bodies().size())
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
const rigidBodyModelState & state() const
Return the motion state.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
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.
Templated function that returns the corresponding 1 (one).
bool add(entry *, bool mergeEntry=false)
Add a new entry.
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...
Mesh representing a set of points created from polyMesh.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
displacementMotionSolver(const polyMesh &, const dictionary &, const word &type)
Construct from mesh and dictionary.
Six degree of freedom motion for a rigid body.
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.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
void write(dictionary &dict) const
Write to dictionary.
Calculation of distance to nearest patch for all points.
scalar deltaTValue() const
Return time step value.
const Type & value() const
Return const reference to value.
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 successful.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label readLabel(Istream &is)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const Mesh & mesh() const
Return mesh.
void solve(const scalar t, const scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
const Time & time() const
Return time.
defineTypeNameAndDebug(combustionModel, 0)
label nDoF() const
Return the number of degrees of freedom of the model.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const vector & g() const
Return the acceleration due to gravity.
word name(const complex &)
Return a string representation of a complex.
label size() const
Return the number of elements in the UPtrList.
label timeIndex() const
Return current time index.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
static const versionNumber currentVersion
Current version number.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
rigidBodyMeshMotion(const polyMesh &, const dictionary &dict)
Construct from polyMesh and dictionary.
label bodyID(const word &name) const
Return the ID of the body with the given name.
Mesh consisting of general polyhedral cells.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
Calculates the forces and moments by integrating the pressure and skin-friction forces over a given l...
const polyMesh & mesh() const
Return reference to mesh.
A class for managing temporary objects.
pointField & points0()
Return reference to the reference field.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
bool report() const
Return the report Switch.
static const Vector< scalar > zero
static autoPtr< Function1< Type > > New(const word &entryName, const dictionary &dict)
Selector.