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
125 + rhoScale(p, 0.5*
magSqr(lookupObject<volVectorField>(UName_)));
135 Foam::functionObjects::pressure::coeff
137 const tmp<volScalarField>& tp
142 tmp<volScalarField> tpCoeff(tp.ptr());
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...
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
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.
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimPressure, 0))
const dimensionSet dimPressure
dimensioned< scalar > magSqr(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
defineTypeNameAndDebug(Qdot, 0)
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.
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.
const dimensionSet dimVelocity