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_))
179 cannotFindObject<volScalarField>(fieldName_);
226 dict.readIfPresent(
"U", UName_);
227 dict.readIfPresent(
"rho", rhoName_);
229 if (rhoName_ ==
"rhoInf")
231 dict.lookup(
"rhoInf") >> rhoInf_;
234 dict.lookup(
"calcTotal") >> calcTotal_;
237 dict.lookup(
"pRef") >> pRef_;
240 dict.lookup(
"calcCoeff") >> calcCoeff_;
243 dict.lookup(
"pInf") >> pInf_;
244 dict.lookup(
"UInf") >> UInf_;
245 dict.lookup(
"rhoInf") >> rhoInf_;
247 scalar zeroCheck = 0.5*rhoInf_*
magSqr(UInf_) + pInf_;
249 if (
mag(zeroCheck) < rootVSmall)
253 <<
"Coefficient calculation requested, but reference "
254 <<
"pressure level is zero. Please check the supplied "
255 <<
"values of pInf, UInf and rhoInf" <<
endl;
259 resultName_ =
dict.lookupOrDefault<
word>(
"result", resultName());
Macros for easy insertion into run-time selection tables.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, 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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
const dimensionSet dimDensity
VolField< scalar > volScalarField
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimVelocity
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
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.