34 namespace functionObjects
44 Foam::word Foam::functionObjects::pressure::resultName()
const
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_))
177 cannotFindObject<volScalarField>(fieldName_);
224 dict.readIfPresent(
"U", UName_);
225 dict.readIfPresent(
"rho", rhoName_);
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;
257 resultName_ =
dict.lookupOrDefault<
word>(
"result", resultName());
Macros for easy insertion into run-time selection tables.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Dimension set for the base types.
Abstract base-class for Time/database functionObjects.
const word fieldName_
Name of field to process.
Includes tools to manipulate the pressure into different forms.
pressure(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual ~pressure()
Destructor.
virtual bool read(const dictionary &)
Read the pressure data.
A class for managing temporary objects.
A class for handling words, derived from string.
#define WarningInFunction
Report a warning using Foam::Warning.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
const dimensionSet dimPressure
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimDensity
VolField< scalar > volScalarField
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
const dimensionSet dimVelocity
dimensioned< scalar > magSqr(const dimensioned< Type > &)
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.