170#ifndef Foam_functionObjects_forces_H
171#define Foam_functionObjects_forces_H
183namespace functionObjects
192 public fvMeshFunctionObject,
273 const dictionary&
dict,
296 tmp<volScalarField>
mu()
const;
299 tmp<volScalarField>
rho()
const;
351 const string& descriptor,
413 virtual bool write();
Output to file stream, using an OSstream.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const word & name() const noexcept
Return the name of this functionObject.
Computes forces and moments over a given list of patches by integrating pressure and viscous forces a...
virtual void calcForcesMoments()
Calculate forces and moments.
void writeIntegratedDataFileHeader(const word &header, OFstream &os) const
Write header for an integrated-data file.
word pName_
Name of pressure field.
scalar rhoRef_
Reference density needed for incompressible calculations.
bool porosity_
Flag to include porosity effects.
void initialise()
Initialise containers and fields.
void addToPatchFields(const label patchi, const vectorField &Md, const vectorField &fP, const vectorField &fV)
Add patch contributions to force and moment fields.
bool directForceDensity_
Flag to directly supply force density.
word UName_
Name of velocity field.
vector sumPatchForcesV_
Sum of patch viscous forces.
virtual ~forces()=default
Destructor.
void writeIntegratedDataFiles()
Write integrated data to files.
vector sumPatchForcesP_
Sum of patch pressure forces.
vector sumInternalMoments_
Sum of internal moments.
volVectorField & moment()
Return access to the moment field.
void createIntegratedDataFiles()
Create the integrated-data files.
bool initialised_
Flag of initialisation (internal)
autoPtr< OFstream > forceFilePtr_
File stream for forces.
vector sumPatchMomentsV_
Sum of patch viscous moments.
tmp< volScalarField > mu() const
Return dynamic viscosity field.
vector sumInternalForces_
Sum of internal forces.
virtual bool read(const dictionary &dict)
Read the dictionary.
virtual vector forceEff() const
Return the total force.
void logIntegratedData(const string &descriptor, const vector &pres, const vector &vis, const vector &internal) const
Write integrated data to stream.
autoPtr< coordinateSystem > coordSysPtr_
Coordinate system used when evaluating forces and moments.
virtual vector momentEff() const
Return the total moment.
void addToInternalField(const labelList &cellIDs, const vectorField &Md, const vectorField &f)
TypeName("forces")
Runtime type information.
autoPtr< OFstream > momentFilePtr_
File stream for moments.
vector sumPatchMomentsP_
Sum of patch pressure moments.
word rhoName_
Name of density field.
forces(const forces &)=delete
No copy construct.
labelHashSet patchSet_
Names of operand patches.
void writeIntegratedDataFile(const vector &pres, const vector &vis, const vector &internal, OFstream &os) const
Write integrated data to a file.
bool writeFields_
Flag to write force and moment fields.
tmp< volScalarField > rho() const
Return rho if specified otherwise rhoRef.
void reset()
Reset containers and fields.
virtual bool execute()
Execute the function object.
void operator=(const forces &)=delete
No copy assignment.
volVectorField & force()
Return access to the force field.
virtual bool write()
Write to data files/fields and to streams.
tmp< volSymmTensorField > devRhoReff() const
Return the effective stress (viscous + turbulent)
scalar pRef_
Reference pressure.
void setCoordinateSystem(const dictionary &dict, const word &e3Name=word::null, const word &e1Name=word::null)
Set the co-ordinate system from dictionary and axes names.
word fDName_
Name of force density field.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Reads fields from the time directories and adds them to the mesh database for further post-processing...
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
Base class for writing single files from the function objects.
Registry of regIOobjects.
A class for managing temporary objects.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
static const word null
An empty word.
OBJstream os(runTime.globalPath()/outputName)
GeometricField< vector, fvPatchField, volMesh > volVectorField
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< vector > vectorField
Specialisation of Field<T> for vector.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.