55Foam::rigidBodyMeshMotionSolver::bodyMesh::bodyMesh
70Foam::rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver
83 "rigidBodyMotionState",
92 "rigidBodyMotionState",
103 test_(coeffDict().getOrDefault(
"test", false)),
105 rhoName_(coeffDict().getOrDefault<
word>(
"rho",
"rho")),
116 "rigidBodyMotionSolver:meshSolver",
120 coeffDict().subDict(
"meshSolver")
126 if (rhoName_ ==
"rhoInf")
133 for (
const entry& dEntry : bodiesDict)
135 const keyType& bodyName = dEntry.keyword();
138 if (bodyDict.found(
"patches"))
140 const label bodyID = model_.
bodyID(bodyName);
145 <<
"Body " << bodyName
146 <<
" has been merged with another body"
147 " and cannot be assigned a set of patches"
171 return meshSolverPtr_->curPoints();
182 <<
"The number of points in the mesh seems to have changed." <<
endl
183 <<
"In constant/polyMesh there are " << meshSolver_.points0().size()
184 <<
" points; in the current mesh there are " <<
mesh().
nPoints()
189 if (curTimeIndex_ != this->db().time().
timeIndex())
192 curTimeIndex_ = this->db().time().timeIndex();
202 const label nIter(coeffDict().get<label>(
"nIter"));
204 for (label i=0; i<nIter; i++)
221 const label bodyID = bodyMeshes_[bi].bodyID_;
224 forcesDict.
add(
"type", functionObjects::forces::typeName);
225 forcesDict.add(
"patches", bodyMeshes_[bi].patches_);
226 forcesDict.add(
"rhoInf", rhoInf_);
227 forcesDict.add(
"rho", rhoName_);
231 f.calcForcesMoments();
249 model_.status(bodyMeshes_[bi].bodyID_);
256 for (
const label patchi : bodyMeshes_[bi].patchSet_)
260 meshSolver_.pointDisplacement().boundaryField()[patchi]
261 .patchInternalField(meshSolver_.points0())
264 meshSolver_.pointDisplacement().boundaryFieldRef()[patchi] ==
266 model_.transformPoints
268 bodyMeshes_[bi].bodyID_,
275 meshSolverPtr_->solve();
282 const bool writeOnProc
292 "rigidBodyMotionState",
302 model_.state().write(
dict);
303 return dict.regIOobject::writeObject(streamOpt, writeOnProc);
311 model_.read(coeffDict());
322 meshSolverPtr_->movePoints(
points);
328 meshSolverPtr_->updateMesh(mpm);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
label size() const noexcept
The number of elements in table.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (respects is_globalIOobject trait) and check its info. A void type suppresses trait and t...
const objectRegistry & db() const noexcept
Return the local objectRegistry.
A simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
@ ASCII
"ascii" (normal default)
label bodyID(const word &name) const
Return the ID of the body with the given name.
scalar deltaTValue() const noexcept
Return time step value.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect,...
dictionary()
Default construct, a top-level empty dictionary.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
friend class entry
Declare friendship with the entry class for IO.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
const Type & value() const noexcept
Return const reference to value.
Virtual base class for displacement motion solver.
A keyword and a list of tokens is an 'entry'.
Computes forces and moments over a given list of patches by integrating pressure and viscous forces a...
const Time & time() const
Return the top-level database.
A class for handling keywords in dictionaries.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Virtual base class for mesh motion solver.
const polyMesh & mesh() const
Return reference to mesh.
static autoPtr< motionSolver > New(const polyMesh &)
Select constructed from polyMesh.
motionSolver(const polyMesh &mesh)
Construct from polyMesh.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
virtual bool read()
Read dynamicMeshDict dictionary.
bool foundObject(const word &name, const bool recursive=false) const
Contains the named Type?
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
Mesh consisting of general polyhedral cells.
label nPoints() const noexcept
Number of mesh points.
Rigid-body mesh motion solver for fvMesh.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write state using stream options.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
virtual void solve()
Solve for motion.
virtual bool read()
Read dynamicMeshDict dictionary.
A class for managing temporary objects.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Different types of constants.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
UniformDimensionedField< vector > uniformDimensionedVectorField
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.