Go to the documentation of this file.
54 initialPoints_(
p.localPoints()),
79 if (rhoName_ ==
"rhoInf")
100 initialPoints_ =
p.localPoints();
115 motion_(ptf.motion_),
116 initialPoints_(ptf.initialPoints_, mapper),
117 rhoInf_(ptf.rhoInf_),
118 rhoName_(ptf.rhoName_),
119 lookupGravity_(ptf.lookupGravity_),
133 motion_(ptf.motion_),
134 initialPoints_(ptf.initialPoints_),
135 rhoInf_(ptf.rhoInf_),
136 rhoName_(ptf.rhoName_),
137 lookupGravity_(ptf.lookupGravity_),
152 initialPoints_.autoMap(m);
163 refCast<const sixDoFRigidBodyDisplacementPointPatchVectorField>(ptf);
167 initialPoints_.rmap(sDoFptf.initialPoints_, addr);
178 if (lookupGravity_ < 0)
180 if (
db().time().foundObject<uniformDimensionedVectorField>(
"g"))
182 if (lookupGravity_ == -2)
185 <<
"Specifying the value of g in this boundary condition "
186 <<
"when g is available from the database is considered "
187 <<
"a fatal error to avoid the possibility of inconsistency"
206 bool firstIter =
false;
216 forcesDict.
add(
"type", functionObjects::forces::typeName);
218 forcesDict.
add(
"rhoInf", rhoInf_);
219 forcesDict.
add(
"rho", rhoName_);
224 f.calcForcesMoment();
228 if (lookupGravity_ == 1)
242 ramp*(
f.forceEff() + motion_.
mass()*g_),
250 motion_.
transform(initialPoints_) - initialPoints_
261 os.writeEntry(
"rho", rhoName_);
263 if (rhoName_ ==
"rhoInf")
265 os.writeEntry(
"rhoInf", rhoInf_);
268 if (lookupGravity_ == 0 || lookupGravity_ == -2)
270 os.writeEntry(
"g", g_);
void newTime()
Store the motion state at the beginning of the time-step.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
scalar mass() const
Return the mass.
A class for handling words, derived from Foam::string.
Calculates the forces and moments by integrating the pressure and skin-friction forces over a given l...
static constexpr const zero Zero
Global zero (0)
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
const objectRegistry & db() const
Return local objectRegistry.
Basic pointPatch represents a set of points from the mesh.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Mesh consisting of general polyhedral cells.
const pointPatch & patch() const
Return patch.
Foam::pointPatchFieldMapper.
scalar deltaTValue() const noexcept
Return time step value.
Field< vector > vectorField
Specialisation of Field<T> for vector.
void write(Ostream &) const
Write.
List< word > wordList
A List of words.
scalar deltaT0Value() const noexcept
Return old time step value.
Foam::sixDoFRigidBodyDisplacementPointPatchVectorField.
void update(bool firstIter, const vector &fGlobal, const vector &tauGlobal, scalar deltaT, scalar deltaT0)
Symplectic integration of velocities, orientation and position.
label timeIndex() const noexcept
Return current time index.
const point & centreOfRotation() const
Return the current centre of rotation.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
makePointPatchTypeField(pointPatchVectorField, solidBodyMotionDisplacementPointPatchVectorField)
Generic templated field type.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const DimensionedField< vector, pointMesh > & internalField() const
Return dimensioned internal field reference.
virtual void write(Ostream &) const
Write.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
const Type & lookupObject(const word &name, const bool recursive=false) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
const uniformDimensionedVectorField & g
virtual const word & name() const =0
Return name.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool updated() const
Return true if the boundary condition has already been updated.
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given PointPatchField onto.
virtual void rmap(const pointPatchField< vector > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
vector momentArm() const
Return the current momentArm.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
virtual void write(Ostream &) const
Write.
const Time & time() const noexcept
Return time registry.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
sixDoFRigidBodyDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.