Go to the documentation of this file.
139 #ifndef functionObjects_forces_H
140 #define functionObjects_forces_H
155 namespace functionObjects
164 public fvMeshFunctionObject,
173 List<Field<vector>>
force_;
331 const string& descriptor,
407 virtual bool write();
virtual vector forceEff() const
Return the total force.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
scalar binMin_
Minimum bin bounds.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
tmp< volScalarField > mu() const
Dynamic viscosity field.
bool initialised_
Initialised flag.
A class for handling words, derived from Foam::string.
word pName_
Name of pressure field.
void writeForces()
Write force data.
labelHashSet patchSet_
Patches to integrate forces over.
Calculates the forces and moments by integrating the pressure and skin-friction forces over a given l...
A class for managing temporary objects.
Switch directForceDensity_
Is the force density being supplied directly?
virtual bool write()
Write the forces.
void operator=(const forces &)=delete
No copy assignment.
autoPtr< OFstream > momentBinFilePtr_
Moment bins.
void writeBinHeader(const word &header, Ostream &os) const
Write header for binned data.
scalar binMax_
Maximum bin bounds.
List< Field< vector > > moment_
Pressure, viscous and porous moment per bin.
void writeIntegratedForceMoment(const string &descriptor, const vectorField &fm0, const vectorField &fm1, const vectorField &fm2, autoPtr< OFstream > &osPtr) const
Helper function to write integrated forces and moments.
void writeBins()
Write binned data.
word UName_
Name of velocity field.
word fDName_
The name of the force density (fD) field.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
vector binDir_
Direction used to determine bin orientation.
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.
autoPtr< OFstream > forceFilePtr_
Forces.
autoPtr< OFstream > momentFilePtr_
Moments.
virtual void calcForcesMoment()
Calculate the forces and moments.
void initialiseBins()
Initialise the collection bins.
Registry of regIOobjects.
autoPtr< coordinateSystem > coordSysPtr_
Coordinate system used when evaluating forces/moments.
tmp< volScalarField > rho() const
Return rho if specified otherwise rhoRef.
bool porosity_
Flag to include porosity effects.
List< point > binPoints_
Bin positions along binDir.
virtual vector momentEff() const
Return the total moment.
void resetFields()
Reset the fields prior to accumulation of force/moments.
label nBin_
Number of bins.
void initialise()
Initialise the fields.
List< Field< vector > > force_
Pressure, viscous and porous force per bin.
tmp< volSymmTensorField > devRhoReff() const
Return the effective viscous stress (laminar + turbulent).
TypeName("forces")
Runtime type information.
word rhoName_
Name of density field (optional)
virtual bool read(const dictionary &)
Read the forces data.
bool binCumulative_
Should bin data be cumulative?
scalar rhoRef_
Reference density needed for incompressible calculations.
autoPtr< OFstream > forceBinFilePtr_
Force bins.
void addToFields(const label patchi, const vectorField &Md, const vectorField &fN, const vectorField &fT, const vectorField &fP)
Add patch contributions to force and moment fields.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool execute()
Execute, currently does nothing.
OBJstream os(runTime.globalPath()/outputName)
void writeIntegratedHeader(const word &header, Ostream &os) const
Write header for integrated data.
bool writeFields_
Write fields flag.
Vector< scalar > vector
A scalar version of the templated Vector.
void writeBinnedForceMoment(const List< Field< vector >> &fm, autoPtr< OFstream > &osPtr) const
Helper function to write binned forces and moments.
scalar pRef_
Reference pressure.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const word & name() const noexcept
Return the name of this functionObject.
void applyBins(const vectorField &Md, const vectorField &fN, const vectorField &fT, const vectorField &fP, const vectorField &d)
Accumulate bin data.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void createFiles()
Create the output files.
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
static const word null
An empty word.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Base class for writing single files from the function objects.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
scalar binDx_
Distance between bin divisions.
forces(const forces &)=delete
No copy construct.
virtual ~forces()=default
Destructor.