170 #ifndef Foam_functionObjects_forces_H 171 #define Foam_functionObjects_forces_H 183 namespace functionObjects
192 public fvMeshFunctionObject,
273 const dictionary&
dict,
301 tmp<volScalarField>
mu()
const;
304 tmp<volScalarField>
rho()
const;
307 tmp<scalarField>
rho(
const label patchi)
const;
359 const string& descriptor,
421 virtual bool write();
bool writeFields_
Flag to write force and moment fields.
virtual vector momentEff() const
Return the total moment.
vector sumInternalForces_
Sum of internal forces.
vector sumPatchMomentsV_
Sum of patch viscous moments.
word UName_
Name of velocity field.
Forwards and collection of common volume field types.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
autoPtr< OFstream > forceFilePtr_
File stream for forces.
Output to file stream as an OSstream, normally using std::ofstream for the actual output...
vector sumPatchMomentsP_
Sum of patch pressure moments.
volVectorField & force()
Return access to the force field.
virtual vector forceEff() const
Return the total force.
word pName_
Name of pressure field.
TypeName("forces")
Runtime type information.
void operator=(const forces &)=delete
No copy assignment.
word rhoName_
Name of density field.
GeometricField< vector, fvPatchField, volMesh > volVectorField
void addToPatchFields(const label patchi, const vectorField &Md, const vectorField &fP, const vectorField &fV)
Add patch contributions to force and moment fields.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool read(const dictionary &dict)
Read the dictionary.
void writeIntegratedDataFiles()
Write integrated data to files.
tmp< symmTensorField > devRhoReff(const tensorField &gradUp, const label patchi) const
Return the effective stress (viscous + turbulent) for patch.
const word & name() const noexcept
Return the name of this functionObject.
void writeIntegratedDataFile(const vector &pres, const vector &vis, const vector &internal, OFstream &os) const
Write integrated data to a file.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual ~forces()=default
Destructor.
virtual bool execute()
Execute the function object.
virtual void calcForcesMoments()
Calculate forces and moments.
A class for handling words, derived from Foam::string.
tmp< volScalarField > mu() const
Return dynamic viscosity field.
scalar rhoRef_
Reference density needed for incompressible calculations.
bool initialised_
Flag of initialisation (internal)
static const word null
An empty word.
vector sumPatchForcesP_
Sum of patch pressure forces.
vector sumPatchForcesV_
Sum of patch viscous forces.
void addToInternalField(const labelList &cellIDs, const vectorField &Md, const vectorField &f)
Add cell contributions to force and moment fields, and include porosity effects.
tmp< volScalarField > rho() const
Return rho if specified otherwise rhoRef.
void createIntegratedDataFiles()
Create the integrated-data files.
volVectorField & moment()
Return access to the moment field.
autoPtr< OFstream > momentFilePtr_
File stream for moments.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void reset()
Reset containers and fields.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
void initialise()
Initialise containers and fields.
OBJstream os(runTime.globalPath()/outputName)
bool porosity_
Flag to include porosity effects.
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.
labelList patchIDs_
Selected operand patches.
scalar pRef_
Reference pressure.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
autoPtr< coordinateSystem > coordSysPtr_
Coordinate system used when evaluating forces and moments.
forces(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from Time and dictionary.
vector sumInternalMoments_
Sum of internal moments.
Computes forces and moments over a given list of patches by integrating pressure and viscous forces a...
List< label > labelList
A List of labels.
word fDName_
Name of force density field.
void writeIntegratedDataFileHeader(const word &header, OFstream &os) const
Write header for an integrated-data file.
Registry of regIOobjects.
void logIntegratedData(const string &descriptor, const vector &pres, const vector &vis, const vector &internal) const
Write integrated data to stream.
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
virtual bool write()
Write to data files/fields and to streams.
bool directForceDensity_
Flag to directly supply force density.