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
118 const tmp<volScalarField>& tp
124 tp + rhoScale(p, 0.5*
magSqr(lookupObject<volVectorField>(UName_)));
134 Foam::functionObjects::pressure::coeff
136 const tmp<volScalarField>& tp
141 tmp<volScalarField> tpCoeff(tp.ptr());
163 bool Foam::functionObjects::pressure::calc()
165 if (foundObject<volScalarField>(fieldName_))
167 const volScalarField& p = lookupObject<volScalarField>(fieldName_);
177 cannotFindObject<volScalarField>(fieldName_);
227 if (rhoName_ ==
"rhoInf")
229 dict.
lookup(
"rhoInf") >> rhoInf_;
232 dict.
lookup(
"calcTotal") >> calcTotal_;
235 dict.
lookup(
"pRef") >> pRef_;
238 dict.
lookup(
"calcCoeff") >> calcCoeff_;
241 dict.
lookup(
"pInf") >> pInf_;
242 dict.
lookup(
"UInf") >> UInf_;
243 dict.
lookup(
"rhoInf") >> rhoInf_;
245 scalar zeroCheck = 0.5*rhoInf_*
magSqr(UInf_) + pInf_;
247 if (
mag(zeroCheck) < rootVSmall)
251 <<
"Coefficient calculation requested, but reference " 252 <<
"pressure level is zero. Please check the supplied " 253 <<
"values of pInf, UInf and rhoInf" <<
endl;
A list of keyword definitions, which are a keyword followed by any number of values (e...
const dimensionSet dimPressure
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
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.
const dimensionSet dimDensity
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.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const dimensionSet dimVelocity
word name(const complex &)
Return a string representation of a complex.
defineTypeNameAndDebug(Qdot, 0)
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.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.