170#ifndef Foam_functionObjects_forces_H
171#define Foam_functionObjects_forces_H
301 tmp<volScalarField>
mu()
const;
304 tmp<volScalarField>
rho()
const;
307 tmp<scalarField>
rho(
const label patchi)
const;
359 const string& descriptor,
423 virtual bool write();
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
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,...
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.
forces(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from name, Time and 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)
Add cell contributions to force and moment fields, and include porosity effects.
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.
void writeIntegratedDataFile(const vector &pres, const vector &vis, const vector &internal, OFstream &os) const
Write integrated data to a file.
tmp< symmTensorField > devRhoReff(const tensorField &gradUp, const label patchi) const
Return the effective stress (viscous + turbulent) for patch.
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 operations.
void operator=(const forces &)=delete
No copy assignment.
volVectorField & force()
Return access to the force field.
virtual bool write()
Write the function-object results.
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.
labelList patchIDs_
Selected operand patches.
virtual bool read(const dictionary &)
Read the function-object dictionary.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
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.
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
Registry of regIOobjects.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
OBJstream os(runTime.globalPath()/outputName)
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
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.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Forwards and collection of common volume field types.