44 rigidBodyMeshMotionSolver,
52 Foam::rigidBodyMeshMotionSolver::bodyMesh::bodyMesh
57 const dictionary& dict
63 patchSet_(mesh.boundaryMesh().patchSet(patches_))
67 Foam::rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver
79 "rigidBodyMotionState",
83 ).typeHeaderOk<IOdictionary>(
true)
88 "rigidBodyMotionState",
112 "rigidBodyMotionSolver:meshSolver",
113 mesh.
time().constant(),
122 if (rhoName_ ==
"rhoInf")
133 if (bodyDict.
found(
"patches"))
135 const label bodyID = model_.
bodyID(iter().keyword());
140 <<
"Body " << iter().keyword()
141 <<
" has been merged with another body" 142 " and cannot be assigned a set of patches" 172 return meshSolverPtr_->curPoints();
183 <<
"The number of points in the mesh seems to have changed." <<
endl 184 <<
"In constant/polyMesh there are " << meshSolver_.
points0().
size()
185 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
196 if (
db().foundObject<uniformDimensionedVectorField>(
"g"))
206 for (
label i=0; i<nIter; i++)
223 const label bodyID = bodyMeshes_[bi].bodyID_;
226 forcesDict.
add(
"type", functionObjects::forces::typeName);
227 forcesDict.
add(
"patches", bodyMeshes_[bi].patches_);
228 forcesDict.
add(
"rhoInf", rhoInf_);
229 forcesDict.
add(
"rho", rhoName_);
251 model_.
status(bodyMeshes_[bi].bodyID_);
265 .patchInternalField(meshSolver_.
points0())
272 bodyMeshes_[bi].bodyID_,
279 meshSolverPtr_->solve();
295 "rigidBodyMotionState",
306 return dict.regIOobject::write();
327 meshSolverPtr_->movePoints(points);
333 meshSolverPtr_->updateMesh(mpm);
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.
Virtual base class for displacement motion solver.
#define forAll(list, i)
Loop across all elements in list.
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
tmp< pointField > transformPoints(const label bodyID, const pointField &initialPoints) const
Transform the given initial pointField of the specified body.
To & refCast(From &r)
Reference type cast template function.
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.
static bool master(const label communicator=0)
Am I the master process.
Virtual base class for mesh motion solver.
virtual vector forceEff() const
Return the total force.
static autoPtr< motionSolver > New(const polyMesh &)
Select constructed from polyMesh.
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,.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
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.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid) const
Write state using given format, version and compression.
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
stressControl lookup("compactNormalStress") >> compactNormalStress
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
virtual bool read()
Read dynamicMeshDict dictionary.
void write(dictionary &dict) const
Write to dictionary.
motionSolver(const polyMesh &mesh)
Construct from polyMesh.
scalar deltaTValue() const
Return time step value.
const Type & value() const
Return const reference to value.
streamFormat
Enumeration for the format of data in the stream.
virtual void calcForcesMoment()
Calculate the forces and moments.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
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)
virtual bool read()
Read dynamicMeshDict dictionary.
compressionType
Enumeration for the format of data in the stream.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
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.
const vector & g() const
Return the acceleration due to gravity.
word name(const complex &)
Return a string representation of a complex.
IOdictionary(const IOobject &)
Construct given an IOobject.
label timeIndex() const
Return current time index.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
const Time & time() const
Return time.
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.
const objectRegistry & db() const
Return the local objectRegistry.
pointField & points0()
Return reference to the reference field.
~rigidBodyMeshMotionSolver()
Destructor.
virtual void solve()
Solve for motion.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
bool report() const
Return the report Switch.
static const Vector< scalar > zero
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.