45sixDoFRigidBodyDisplacementPointPatchVectorField::
46sixDoFRigidBodyDisplacementPointPatchVectorField
54 initialPoints_(
p.localPoints()),
63sixDoFRigidBodyDisplacementPointPatchVectorField::
64sixDoFRigidBodyDisplacementPointPatchVectorField
74 rhoName_(
dict.getOrDefault<
word>(
"rho",
"rho")),
79 if (rhoName_ ==
"rhoInf")
100 initialPoints_ =
p.localPoints();
105sixDoFRigidBodyDisplacementPointPatchVectorField::
106sixDoFRigidBodyDisplacementPointPatchVectorField
115 motion_(ptf.motion_),
116 initialPoints_(ptf.initialPoints_, mapper),
117 rhoInf_(ptf.rhoInf_),
118 rhoName_(ptf.rhoName_),
119 lookupGravity_(ptf.lookupGravity_),
125sixDoFRigidBodyDisplacementPointPatchVectorField::
126sixDoFRigidBodyDisplacementPointPatchVectorField
133 motion_(ptf.motion_),
134 initialPoints_(ptf.initialPoints_),
135 rhoInf_(ptf.rhoInf_),
136 rhoName_(ptf.rhoName_),
137 lookupGravity_(ptf.lookupGravity_),
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;
218 forcesDict.
add(
"rhoInf", rhoInf_);
219 forcesDict.
add(
"rho", rhoName_);
224 f.calcForcesMoments();
228 if (lookupGravity_ == 1)
242 ramp*(
f.forceEff() + motion_.
mass()*g_),
250 motion_.
transform(initialPoints_) - initialPoints_
263 if (rhoName_ ==
"rhoInf")
268 if (lookupGravity_ == 0 || lookupGravity_ == -2)
Macros for easy insertion into run-time selection tables.
const uniformDimensionedVectorField & g
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const
Return mesh.
Generic templated field type.
void autoMap(const FieldMapper &map, const bool applyFlip=true)
Map from self.
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
label timeIndex() const noexcept
Return current time index.
scalar deltaTValue() const noexcept
Return time step value.
scalar deltaT0Value() const noexcept
Return old time step value.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
void rmap(const atmBoundaryLayer &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
const Type & value() const
Return const reference to value.
A FixedValue boundary condition for pointField.
virtual bool write()
Write the output fields.
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.
const Time & time() const noexcept
Return time registry.
const Type & lookupObject(const word &name, const bool recursive=false) const
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
const pointPatch & patch() const
Return patch.
const objectRegistry & db() const
Return local objectRegistry.
const DimensionedField< Type, pointMesh > & internalField() const
Return dimensioned internal field reference.
bool updated() const
Return true if the boundary condition has already been updated.
Basic pointPatch represents a set of points from the mesh.
virtual const word & name() const =0
Return name.
Mesh consisting of general polyhedral cells.
Foam::sixDoFRigidBodyDisplacementPointPatchVectorField.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const pointPatchField< vector > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
void newTime()
Store the motion state at the beginning of the time-step.
void update(bool firstIter, const vector &fGlobal, const vector &tauGlobal, scalar deltaT, scalar deltaT0)
Symplectic integration of velocities, orientation and position.
void write(Ostream &) const
Write.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
vector momentArm() const
Return the current momentArm.
scalar mass() const
Return the mass.
const point & centreOfRotation() const
Return the current centre of rotation.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
List< word > wordList
A List of words.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define makePointPatchTypeField(PatchTypeField, typePatchTypeField)
static const char *const typeName
The type name used in ensight case files.