This function object includes tools to manipulate the pressure into different forms. These currently include: More...
Public Member Functions | |
TypeName ("pressureTools") | |
Runtime type information. More... | |
pressureTools (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false) | |
Construct for given objectRegistry and dictionary. More... | |
virtual | ~pressureTools () |
Destructor. More... | |
virtual const word & | name () const |
Return name of the set of pressureTools. More... | |
virtual void | read (const dictionary &) |
Read the pressureTools data. More... | |
virtual void | execute () |
Execute, currently does nothing. More... | |
virtual void | end () |
Execute at the final time-loop, currently does nothing. More... | |
virtual void | timeSet () |
Called when time was set at the end of the Time::operator++. More... | |
virtual void | write () |
Calculate the pressureTools and write. More... | |
virtual void | updateMesh (const mapPolyMesh &) |
Update for changes of mesh. More... | |
virtual void | movePoints (const polyMesh &) |
Update for changes of mesh. More... | |
Private Member Functions | |
dimensionedScalar | rhoScale (const volScalarField &p) const |
Return the density scale. More... | |
tmp< volScalarField > | rho (const volScalarField &p) const |
Return the density field. More... | |
dimensionedScalar | pRef () const |
Return the reference pressure. More... | |
tmp< volScalarField > | pDyn (const volScalarField &p) const |
Calculate and return the dynamic pressure. More... | |
tmp< volScalarField > | convertToCoeff (const volScalarField &p) const |
Convert to coeff by applying the freestream dynamic pressure scaling. More... | |
pressureTools (const pressureTools &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const pressureTools &) |
Disallow default bitwise assignment. More... | |
Private Attributes | |
word | name_ |
Name of this set of pressureTools objects. More... | |
const objectRegistry & | obr_ |
Reference to the database. More... | |
bool | active_ |
On/off switch. More... | |
word | pName_ |
Name of pressure field, default is "p". More... | |
word | UName_ |
Name of velocity field, default is "U". More... | |
word | rhoName_ |
Name of density field, default is "rho". More... | |
word | resultName_ |
Result name. More... | |
Switch | log_ |
Switch to send output to Info as well as to file. More... | |
bool | calcTotal_ |
Flag to calculate total pressure. More... | |
scalar | pRef_ |
Reference pressure level. More... | |
bool | calcCoeff_ |
Flag to calculate pressure coefficient. More... | |
scalar | pInf_ |
Freestream pressure. More... | |
vector | UInf_ |
Freestream velocity. More... | |
scalar | rhoInf_ |
Freestream density. More... | |
bool | rhoInfInitialised_ |
Flag to show whether rhoInf has been initialised. More... | |
This function object includes tools to manipulate the pressure into different forms. These currently include:
where
![]() | = | density [kg/m3] |
![]() | = | velocity [m/s] |
![]() | = | freestream density [kg/m3] |
![]() | = | freestream pressure [Pa] |
![]() | = | freestream velocity [m/s] |
![]() | = | kinematic pressure (p/rho)[m2/s2] |
![]() | = | pressure [Pa] |
![]() | = | total pressure [Pa] |
![]() | = | reference pressure level [Pa] |
![]() | = | pressure coefficient |
![]() | = | total pressure coefficient |
The function object will operate on both kinematic ( ) and static pressure (
) fields, and the result is written as a volScalarField.
The modes of operation are:
Mode | calcTotal | calcCoeff |
---|---|---|
static pressure | no | no |
total pressure | yes | no |
pressure coefficient | no | yes |
total pressure coefficient | yes | yes |
Example of function object specification to calculate pressure coefficient:
pressureTools1 { type pressureTools; functionObjectLibs ("libutilityFunctionObjects.so"); ... calcTotal no; calcCoeff yes; }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | type name: pressureTools | yes | |
calcTotal | Calculate total coefficient | yes | |
pName | Name of pressure field | no | p |
UName | Name of velocity field | no | U |
rhoName | Name of density field | no | rho |
pRef | Reference pressure for total pressure | no | 0.0 |
calcCoeff | Calculate pressure coefficient | yes | |
pInf | Freestream pressure for coefficient calculation | no | |
UInf | Freestream velocity for coefficient calculation | no | |
rhoInf | Freestream density for coefficient calculation | no | |
resultName | Name of derived pressure field | no | auto generated |
log | log to standard output | no | yes |
Definition at line 264 of file pressureTools.H.
|
private |
Disallow default bitwise copy construct.
pressureTools | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Construct for given objectRegistry and dictionary.
Allow the possibility to load fields from files
Definition at line 171 of file pressureTools.C.
References dict, Foam::dimPressure, Foam::endl(), mesh, Foam::nl, IOobject::NO_READ, IOobject::NO_WRITE, Foam::read(), fvMesh::time(), Time::timeName(), and WarningInFunction.
|
virtual |
Destructor.
Definition at line 240 of file pressureTools.C.
|
private |
Return the density scale.
Definition at line 41 of file pressureTools.C.
References Foam::dimDensity, Foam::dimless, Foam::dimPressure, and p.
|
private |
Return the density field.
Definition at line 57 of file pressureTools.C.
References Foam::dimDensity, Foam::dimPressure, Foam::exit(), Foam::FatalError, FatalErrorInFunction, p, and Foam::type().
|
private |
Return the reference pressure.
Definition at line 98 of file pressureTools.C.
References pressureTools::calcTotal_, Foam::dimPressure, pressureTools::pRef_, and dimensioned::value().
|
private |
Calculate and return the dynamic pressure.
Definition at line 112 of file pressureTools.C.
References Foam::dimPressure, Foam::magSqr(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, p, rho, fvMesh::time(), Time::timeName(), and U.
|
private |
Convert to coeff by applying the freestream dynamic pressure scaling.
Definition at line 147 of file pressureTools.C.
References Foam::dimDensity, Foam::dimPressure, Foam::dimVelocity, Foam::magSqr(), p, rho, and U.
|
private |
Disallow default bitwise assignment.
TypeName | ( | "pressureTools" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of pressureTools.
Definition at line 370 of file pressureTools.H.
References pressureTools::name_.
|
virtual |
Read the pressureTools data.
Definition at line 246 of file pressureTools.C.
References dict, Foam::endl(), dictionary::lookup(), Foam::mag(), Foam::magSqr(), dictionary::readIfPresent(), Foam::type(), and WarningInFunction.
|
virtual |
Execute, currently does nothing.
Definition at line 313 of file pressureTools.C.
References p, pDyn(), and pRef.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 330 of file pressureTools.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 336 of file pressureTools.C.
|
virtual |
Calculate the pressureTools and write.
Definition at line 342 of file pressureTools.C.
References Foam::endl(), Foam::Info, Foam::nl, and Foam::type().
|
inlinevirtual |
Update for changes of mesh.
Definition at line 391 of file pressureTools.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 395 of file pressureTools.H.
|
private |
Name of this set of pressureTools objects.
Definition at line 269 of file pressureTools.H.
Referenced by pressureTools::name().
|
private |
Reference to the database.
Definition at line 272 of file pressureTools.H.
|
private |
On/off switch.
Definition at line 275 of file pressureTools.H.
|
private |
Name of pressure field, default is "p".
Definition at line 278 of file pressureTools.H.
|
private |
Name of velocity field, default is "U".
Definition at line 281 of file pressureTools.H.
|
private |
Name of density field, default is "rho".
Definition at line 284 of file pressureTools.H.
|
private |
Result name.
Definition at line 287 of file pressureTools.H.
|
private |
Switch to send output to Info as well as to file.
Definition at line 290 of file pressureTools.H.
|
private |
Flag to calculate total pressure.
Definition at line 296 of file pressureTools.H.
Referenced by pressureTools::pRef().
|
private |
Reference pressure level.
Definition at line 299 of file pressureTools.H.
Referenced by pressureTools::pRef().
|
private |
Flag to calculate pressure coefficient.
Definition at line 305 of file pressureTools.H.
|
private |
Freestream pressure.
Definition at line 308 of file pressureTools.H.
|
private |
Freestream velocity.
Definition at line 311 of file pressureTools.H.
|
private |
Freestream density.
Definition at line 314 of file pressureTools.H.
|
private |
Flag to show whether rhoInf has been initialised.
Definition at line 317 of file pressureTools.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.