34 namespace functionObjects
44 Foam::word Foam::functionObjects::pressure::resultName()
const 50 rName =
"total(" + fieldName_ +
")";
54 rName =
"static(" + fieldName_ +
")";
85 const tmp<volScalarField>& tsf
90 return lookupObject<volScalarField>(rhoName_)*tsf;
101 const tmp<volScalarField>& tp
110 return std::move(tp);
118 const tmp<volScalarField>& tp
125 + rhoScale(p, 0.5*
magSqr(lookupObject<volVectorField>(UName_)));
129 return std::move(tp);
135 Foam::functionObjects::pressure::coeff
137 const tmp<volScalarField>& tp
142 tmp<volScalarField> tpCoeff(tp.ptr());
157 return std::move(tp);
164 bool Foam::functionObjects::pressure::calc()
166 if (foundObject<volScalarField>(fieldName_))
168 const volScalarField& p = lookupObject<volScalarField>(fieldName_);
226 if (rhoName_ ==
"rhoInf")
228 dict.
lookup(
"rhoInf") >> rhoInf_;
231 dict.
lookup(
"calcTotal") >> calcTotal_;
234 dict.
lookup(
"pRef") >> pRef_;
237 dict.
lookup(
"calcCoeff") >> calcCoeff_;
240 dict.
lookup(
"pInf") >> pInf_;
241 dict.
lookup(
"UInf") >> UInf_;
242 dict.
lookup(
"rhoInf") >> rhoInf_;
244 scalar zeroCheck = 0.5*rhoInf_*
magSqr(UInf_) + pInf_;
246 if (
mag(zeroCheck) < ROOTVSMALL)
250 <<
"Coefficient calculation requested, but reference " 251 <<
"pressure level is zero. Please check the supplied " 252 <<
"values of pInf, UInf and rhoInf" <<
endl;
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
pressure(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Dimension set for the base types.
bool read(const char *, int32_t &)
A class for handling words, derived from string.
virtual bool read(const dictionary &)
Read the pressure data.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
const dimensionSet dimPressure
dimensioned< scalar > magSqr(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
const dimensionSet dimDensity
Internal & ref()
Return a reference to the dimensioned internal field.
virtual ~pressure()
Destructor.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensioned< scalar > mag(const dimensioned< Type > &)
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimPressure, 0.0))
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
A class for managing temporary objects.
addToRunTimeSelectionTable(functionObject, add, dictionary)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dimensionSet dimVelocity