54 Foam::rigidBodyMeshMotionSolver::bodyMesh::bodyMesh
59 const dictionary&
dict
65 patchSet_(mesh.boundaryMesh().patchSet(patches_))
82 "rigidBodyMotionState",
91 "rigidBodyMotionState",
102 test_(coeffDict().lookupOrDefault<
Switch>(
"test", false)),
104 rhoName_(coeffDict().lookupOrDefault<
word>(
"rho",
"rho")),
118 mesh.time().constant(),
121 coeffDict().subDict(
"meshSolver")
127 if (rhoName_ ==
"rhoInf")
147 if (bodyDict.
found(
"patches"))
154 <<
"Body " << iter().keyword()
155 <<
" has been merged with another body"
156 " and cannot be assigned a set of patches"
186 return meshSolverPtr_->curPoints();
194 if (mesh().
nPoints() != meshSolver_.points0().size())
197 <<
"The number of points in the mesh seems to have changed." <<
endl
198 <<
"In constant/polyMesh there are " << meshSolver_.points0().size()
199 <<
" points; in the current mesh there are " << mesh().nPoints()
210 const scalar ramp = ramp_->value(t.
value());
212 if (mesh().foundObject<uniformDimensionedVectorField>(
"g"))
221 label nIter(coeffDict().lookup<label>(
"nIter"));
223 for (
label i=0; i<nIter; i++)
240 const label bodyID = bodyMeshes_[bi].bodyIndex_;
244 functionObjects::forces::typeName,
248 "type", functionObjects::forces::typeName,
249 "patches", bodyMeshes_[bi].patches_,
256 f.calcForcesMoments();
274 status(bodyMeshes_[bi].bodyIndex_);
287 meshSolver_.pointDisplacement().boundaryField()[
patchi]
288 .patchInternalField(meshSolver_.points0())
291 meshSolver_.pointDisplacement().boundaryFieldRef()[
patchi] ==
295 transform0(bodyMeshes_[bi].bodyIndex_),
302 meshSolverPtr_->solve();
308 meshSolverPtr_->movePoints(
points);
314 meshSolverPtr_->topoChange(map);
320 meshSolverPtr_->mapMesh(map);
329 meshSolverPtr_->distribute(map);
339 "rigidBodyMotionState",
340 mesh().time().
name(),
353 &&
dict.regIOobject::writeObject
357 mesh().time().writeCompression(),
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
static autoPtr< Function1< Type > > New(const word &name, const Function1s::unitConversions &units, const dictionary &dict)
Select from dictionary.
Templated function that returns the corresponding 1 (one).
Template class for intrusive linked lists.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static const versionNumber currentVersion
Current version number.
void append(T *)
Append an element at the end of the list.
label bodyIndex(const word &name) const
Return the ID of the body with the given name.
void solve(const scalar t, const scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
label timeIndex() const
Return current time index.
scalar deltaTValue() const
Return time step value.
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....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const Type & value() const
Return const reference to value.
Virtual base class for displacement motion solver.
Calculates the forces and moments by integrating the pressure and skin-friction forces over a given l...
Virtual base class for mesh motion solver.
const word & keyword() const
Return keyword.
virtual bool write() const
Optionally write motion state information for restart.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
const polyMesh & mesh() const
Return reference to mesh.
const Time & time() const
Return time.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Rigid-body mesh motion solver for fvMesh.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
~rigidBodyMeshMotionSolver()
Destructor.
virtual void topoChange(const polyTopoChangeMap &)
Update local data for topology changes.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
rigidBodyMeshMotionSolver(const word &name, const polyMesh &, const dictionary &dict)
Construct from polyMesh and dictionary.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
virtual bool write() const
Write motion state information for restart.
virtual void solve()
Solve for motion.
timeIOdictionary derived from IOdictionary with globalFile set false to enable writing to processor t...
A class for managing temporary objects.
Templated form of IOobject providing type information for file reading and header type checking.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
errorManipArg< error, int > exit(error &err, const int errNo=1)
void transformPoints(vectorField &, const spatialTransform &, const vectorField &)
Transform given vectorField of coordinates with the given spatialTransform.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
To & refCast(From &r)
Reference type cast template function.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimless
const dimensionSet dimTime
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
defineTypeNameAndDebug(combustionModel, 0)
word typedName(Name name)
Return the name of the object within the given type.
List< wordRe > wordReList
A List of wordRe (word or regular expression)