229#ifndef Foam_functionObjects_forceCoeffs_H
230#define Foam_functionObjects_forceCoeffs_H
240namespace functionObjects
254 class forceComponents
286 return pressure_ + viscous_ + internal_;
305 pressure_ = pressure;
316 return vector(pressure_[cmpt], viscous_[cmpt], internal_[cmpt]);
343 const string& description,
360 return name_ +
"(f)";
366 return name_ +
"(r)";
370 vector value(
const forceComponents&
f,
const forceComponents& m)
const
396 <<
"Cannot determine value"
406 coeff.name_ = coeff.frontName();
407 coeff.desc_ = coeff.desc_ +
" front";
416 coeff.name_ = coeff.rearName();
417 coeff.desc_ = coeff.desc_ +
" rear";
418 coeff.splitType_ =
stRear;
435 HashTable<coeffDesc> coeffs_;
546 virtual bool write();
Generic templated field type.
A HashTable similar to std::unordered_map.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to file stream, using an OSstream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
Watches for presence of the named trigger file in the case directory and signals a simulation stop (o...
void reset() noexcept
Reset the components to zero.
vector operator[](const label cmpt) const
Return components in a given direction.
void reset(const vector &pressure, const vector &viscous, const vector &internal) noexcept
Reset the components to given values.
forceComponents()
Default construct.
const vector total() const noexcept
Return the sum of the components.
Computes force and moment coefficients over a given list of patches, and optionally over given porous...
volVectorField & momentCoeff()
Return access to the moment coefficients field.
void calcMomentCoeffs()
Calculate moment coefficients.
HashTable< coeffDesc > selectCoeffs() const
Return the operand coefficients.
void writeIntegratedDataFileHeader(const word &header, OFstream &os) const
Write header to the integrated-coefficient file.
void initialise()
Initialise containers and fields.
List< scalar > integrateData(const List< Field< scalar > > &coeff) const
Return integrated {total, pressure, viscous, porous} components.
virtual ~forceCoeffs()=default
Destructor.
void calcForceCoeffs()
Calculate force coefficients.
TypeName("forceCoeffs")
Runtime type information.
forceCoeffs(const forceCoeffs &)=delete
No copy construct.
void operator=(const forceCoeffs &)=delete
No copy assignment.
virtual bool read(const dictionary &dict)
Read the dictionary.
void reset()
Reset containers and fields.
void createIntegratedDataFile()
Create the integrated-coefficient file.
virtual bool execute()
Execute the function object.
virtual bool write()
Write to data files/fields and to streams.
void writeIntegratedDataFile()
Write integrated coefficients to the integrated-coefficient file.
volVectorField & forceCoeff()
Return access to the force coefficients field.
Computes forces and moments over a given list of patches by integrating pressure and viscous forces a...
Provides several methods to convert an input pressure field into derived forms, including:
Reads fields from the time directories and adds them to the mesh database for further post-processing...
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
const wordList internal
Standard dimensioned field types (scalar, vector, tensor, etc)
Ostream & operator<<(Ostream &, const fieldInfo &)
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
coeffDesc(const string &description, const word &name, const label c0, const label c1=-1)
Construct from components.
coeffDesc rear() const
Return rear-axle coefficient description.
const word rearName() const noexcept
Return name with rear-name appendix.
coeffDesc front() const
Return front-axle coefficient description.
const word frontName() const noexcept
Return name with front-name appendix.
vector value(const forceComponents &f, const forceComponents &m) const
Return force/moment components based on the specified split type.
A non-counting (dummy) refCount.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.