42 word fieldName = pName_;
46 fieldName =
"total(" + fieldName +
")";
50 fieldName =
"static(" + fieldName +
")";
55 fieldName = fieldName +
"_coeff";
97 p.mesh().time().timeName(),
116 value.value() += pRef_;
128 const fvMesh& mesh = refCast<const fvMesh>(obr_);
130 tmp<volScalarField> tpDyn
137 mesh.time().timeName(),
163 tmp<volScalarField> tCoeff(p);
182 Foam::pressureTools::pressureTools
187 const bool loadFromFiles
204 if (!isA<fvMesh>(obr_))
209 "pressureTools::pressureTools" 212 "const objectRegistry&, " 213 "const dictionary&, " 216 ) <<
"No fvMesh available, deactivating " << name_ <<
nl 231 const fvMesh& mesh = refCast<const fvMesh>(obr_);
250 mesh.objectRegistry::store(pPtr);
271 if (rhoName_ ==
"rhoInf")
273 dict.
lookup(
"rhoInf") >> rhoInf_;
276 dict.
lookup(
"calcTotal") >> calcTotal_;
279 dict.
lookup(
"pRef") >> pRef_;
282 dict.
lookup(
"calcCoeff") >> calcCoeff_;
285 dict.
lookup(
"pInf") >> pInf_;
286 dict.
lookup(
"UInf") >> UInf_;
287 dict.
lookup(
"rhoInf") >> rhoInf_;
289 scalar zeroCheck = 0.5*rhoInf_*
magSqr(UInf_) + pInf_;
291 if (
mag(zeroCheck) < ROOTVSMALL)
293 WarningIn(
"void Foam::pressureTools::read(const dictionary&)")
294 <<
type() <<
" " << name_ <<
": " 295 <<
"Coefficient calculation requested, but reference " 296 <<
"pressure level is zero. Please check the supplied " 297 <<
"values of pInf, UInf and rhoInf" <<
endl;
316 pResult == convertToCoeff(rhoScale(p)*p +
pDyn(p) +
pRef());
343 Info<<
type() <<
" " << name_ <<
" output:" <<
nl 344 <<
" writing field " << pResult.
name() <<
nl const dimensionSet dimPressure
Mesh data needed to do the Finite Volume discretisation.
virtual ~pressureTools()
Destructor.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual void end()
Execute at the final time-loop, currently does nothing.
virtual void read(const dictionary &)
Read the pressureTools data.
volScalarField pDyn(IOobject( "pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero", dimPressure, 0.0))
dimensioned< scalar > magSqr(const dimensioned< Type > &)
A class for handling words, derived from string.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const dimensionSet dimDensity
A list of keyword definitions, which are a keyword followed by any number of values (e...
const Time & time() const
Return the top-level database.
virtual bool write() const
Write using setting from DB.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
#define WarningIn(functionName)
Report a warning using Foam::Warning.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Dimension set for the base types.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
const word & name() const
Return name.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
GeometricField< vector, fvPatchField, volMesh > volVectorField
virtual void write()
Calculate the pressureTools and write.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Registry of regIOobjects.
virtual void execute()
Execute, currently does nothing.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
bool read(const char *, int32_t &)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
const dimensionSet dimVelocity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A class for managing temporary objects.
defineTypeNameAndDebug(combustionModel, 0)