227 #ifndef Foam_functionObjects_forceCoeffs_H 228 #define Foam_functionObjects_forceCoeffs_H 238 namespace functionObjects
252 class forceComponents
284 return pressure_ + viscous_ + internal_;
303 pressure_ = pressure;
305 internal_ =
internal;
314 return vector(pressure_[cmpt], viscous_[cmpt], internal_[cmpt]);
341 const string& description,
358 return name_ +
"(f)";
364 return name_ +
"(r)";
374 vector value(
const forceComponents&
f,
const forceComponents& m)
const 400 <<
"Cannot determine value" 410 coeff.name_ = coeff.frontName();
411 coeff.desc_ = coeff.desc_ +
" front";
420 coeff.name_ = coeff.rearName();
421 coeff.desc_ = coeff.desc_ +
" rear";
422 coeff.splitType_ =
stRear;
550 virtual bool write();
coeffDesc front() const
Return front-axle coefficient description.
void calcForceCoeffs()
Calculate force coefficients.
TypeName("forceCoeffs")
Runtime type information.
virtual bool write()
Write to data files/fields and to streams.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
coeffDesc(const string &description, const word &name, const label c0, const label c1=-1)
Construct from components.
const vector total() const noexcept
Return the sum of the components.
Output to file stream, using an OSstream.
void writeIntegratedDataFile()
Write integrated coefficients to the integrated-coefficient file.
volVectorField & momentCoeff()
Return access to the moment coefficients field.
HashTable< coeffDesc > selectCoeffs() const
Return the operand coefficients.
const word frontName() const noexcept
Return name with front-name appendix.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
forceCoeffs(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from Time and dictionary.
const word & name() const noexcept
Return the name of this functionObject.
vector operator[](const label cmpt) const
Return components in a given direction.
A class for handling words, derived from Foam::string.
void initialise()
Initialise containers and fields.
A HashTable similar to std::unordered_map.
errorManip< error > abort(error &err)
void reset()
Reset containers and fields.
coeffDesc rear() const
Return rear-axle coefficient description.
void calcMomentCoeffs()
Calculate moment coefficients.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual bool read(const dictionary &dict)
Read the dictionary.
const word rearName() const noexcept
Return name with rear-name appendix.
void operator=(const forceCoeffs &)=delete
No copy assignment.
void reset() noexcept
Reset the components to zero.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
List< scalar > integrateData(const List< Field< scalar >> &coeff) const
Return integrated {total, pressure, viscous, porous} components.
OBJstream os(runTime.globalPath()/outputName)
virtual void print(Ostream &os) const
Print stream description to Ostream.
volVectorField & forceCoeff()
Return access to the force coefficients field.
void print(Ostream &os) const
Print description.
forceComponents()
Default construct.
Computes force and moment coefficients over a given list of patches, and optionally over given porous...
void writeIntegratedDataFileHeader(const word &header, OFstream &os) const
Write header to the integrated-coefficient file.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
virtual ~forceCoeffs()=default
Destructor.
vector value(const forceComponents &f, const forceComponents &m) const
Return force/moment components based on the specified split type.
Coefficients description.
void createIntegratedDataFile()
Create the integrated-coefficient file.
virtual bool execute()
Execute the function object.
static constexpr const zero Zero
Global zero (0)