228#ifndef Foam_functionObjects_forceCoeffs_H
229#define Foam_functionObjects_forceCoeffs_H
285 return pressure_ + viscous_ + internal_;
304 pressure_ = pressure;
315 return vector(pressure_[cmpt], viscous_[cmpt], internal_[cmpt]);
342 const string& description,
359 return name_ +
"(f)";
365 return name_ +
"(r)";
375 vector value(
const forceComponents&
f,
const forceComponents& m)
const
401 <<
"Cannot determine value"
411 coeff.name_ = coeff.frontName();
412 coeff.desc_ = coeff.desc_ +
" front";
421 coeff.name_ = coeff.rearName();
422 coeff.desc_ = coeff.desc_ +
" rear";
423 coeff.splitType_ =
stRear;
551 virtual bool write();
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
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 as an OSstream, normally using std::ofstream for the actual output.
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,...
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.
void reset()
Reset containers and fields.
void createIntegratedDataFile()
Create the integrated-coefficient file.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
forceCoeffs(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from name, Time and dictionary.
virtual bool read(const dictionary &)
Read the function-object dictionary.
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...
forces(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from name, Time and dictionary.
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 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 volume internal field types (scalar, vector, tensor, etc).
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
GeometricField< vector, fvPatchField, volMesh > volVectorField
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static bool initialised_(false)
Coefficients description.
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.
void print(Ostream &os) const
Print 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.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.