Public Member Functions | Private Member Functions | Private Attributes
pressureTools Class Reference

This function object includes tools to manipulate the pressure into different forms. These currently include: More...

Collaboration diagram for pressureTools:
Collaboration graph
[legend]

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 wordname () 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< volScalarFieldrho (const volScalarField &p) const
 Return the density field. More...
 
dimensionedScalar pRef () const
 Return the reference pressure. More...
 
tmp< volScalarFieldpDyn (const volScalarField &p) const
 Calculate and return the dynamic pressure. More...
 
tmp< volScalarFieldconvertToCoeff (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 objectRegistryobr_
 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...
 

Detailed Description

This function object includes tools to manipulate the pressure into different forms. These currently include:

- static pressure

\[ p_s = \rho p_k \]

where

$ \rho $ = density [kg/m3]
$ U $ = velocity [m/s]
$ \rho_{\inf} $ = freestream density [kg/m3]
$ p_{\inf} $ = freestream pressure [Pa]
$ U_{\inf} $ = freestream velocity [m/s]
$ p_k $ = kinematic pressure (p/rho)[m2/s2]
$ p_s $ = pressure [Pa]
$ p_T $ = total pressure [Pa]
$ p_{ref} $ = reference pressure level [Pa]
$ Cp_{s} $ = pressure coefficient
$ Cp_{T} $ = total pressure coefficient

The function object will operate on both kinematic ( $ p_k $) and static pressure ( $ p_s $) 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
Source files

Definition at line 264 of file pressureTools.H.

Constructor & Destructor Documentation

◆ pressureTools() [1/2]

pressureTools ( const pressureTools )
private

Disallow default bitwise copy construct.

◆ pressureTools() [2/2]

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.

Here is the call graph for this function:

◆ ~pressureTools()

~pressureTools ( )
virtual

Destructor.

Definition at line 240 of file pressureTools.C.

Member Function Documentation

◆ rhoScale()

Foam::dimensionedScalar rhoScale ( const volScalarField p) const
private

Return the density scale.

Definition at line 41 of file pressureTools.C.

References Foam::dimDensity, Foam::dimless, Foam::dimPressure, and p.

◆ rho()

Foam::tmp< Foam::volScalarField > rho ( const volScalarField p) const
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().

Here is the call graph for this function:

◆ pRef()

Foam::dimensionedScalar pRef ( ) const
private

Return the reference pressure.

Definition at line 98 of file pressureTools.C.

References pressureTools::calcTotal_, Foam::dimPressure, pressureTools::pRef_, and dimensioned::value().

Here is the call graph for this function:

◆ pDyn()

Foam::tmp< Foam::volScalarField > pDyn ( const volScalarField p) const
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.

Here is the call graph for this function:

◆ convertToCoeff()

Foam::tmp< Foam::volScalarField > convertToCoeff ( const volScalarField p) const
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.

Here is the call graph for this function:

◆ operator=()

void operator= ( const pressureTools )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "pressureTools"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of pressureTools.

Definition at line 370 of file pressureTools.H.

References pressureTools::name_.

◆ read()

void read ( const dictionary dict)
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.

Here is the call graph for this function:

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 313 of file pressureTools.C.

References p, pDyn(), and pRef.

Here is the call graph for this function:

◆ end()

void end ( )
virtual

Execute at the final time-loop, currently does nothing.

Definition at line 330 of file pressureTools.C.

◆ timeSet()

void timeSet ( )
virtual

Called when time was set at the end of the Time::operator++.

Definition at line 336 of file pressureTools.C.

◆ write()

void write ( )
virtual

Calculate the pressureTools and write.

Definition at line 342 of file pressureTools.C.

References Foam::endl(), Foam::Info, Foam::nl, and Foam::type().

Here is the call graph for this function:

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 391 of file pressureTools.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 395 of file pressureTools.H.

Field Documentation

◆ name_

word name_
private

Name of this set of pressureTools objects.

Definition at line 269 of file pressureTools.H.

Referenced by pressureTools::name().

◆ obr_

const objectRegistry& obr_
private

Reference to the database.

Definition at line 272 of file pressureTools.H.

◆ active_

bool active_
private

On/off switch.

Definition at line 275 of file pressureTools.H.

◆ pName_

word pName_
private

Name of pressure field, default is "p".

Definition at line 278 of file pressureTools.H.

◆ UName_

word UName_
private

Name of velocity field, default is "U".

Definition at line 281 of file pressureTools.H.

◆ rhoName_

word rhoName_
private

Name of density field, default is "rho".

Definition at line 284 of file pressureTools.H.

◆ resultName_

word resultName_
private

Result name.

Definition at line 287 of file pressureTools.H.

◆ log_

Switch log_
private

Switch to send output to Info as well as to file.

Definition at line 290 of file pressureTools.H.

◆ calcTotal_

bool calcTotal_
private

Flag to calculate total pressure.

Definition at line 296 of file pressureTools.H.

Referenced by pressureTools::pRef().

◆ pRef_

scalar pRef_
private

Reference pressure level.

Definition at line 299 of file pressureTools.H.

Referenced by pressureTools::pRef().

◆ calcCoeff_

bool calcCoeff_
private

Flag to calculate pressure coefficient.

Definition at line 305 of file pressureTools.H.

◆ pInf_

scalar pInf_
private

Freestream pressure.

Definition at line 308 of file pressureTools.H.

◆ UInf_

vector UInf_
private

Freestream velocity.

Definition at line 311 of file pressureTools.H.

◆ rhoInf_

scalar rhoInf_
private

Freestream density.

Definition at line 314 of file pressureTools.H.

◆ rhoInfInitialised_

bool rhoInfInitialised_
private

Flag to show whether rhoInf has been initialised.

Definition at line 317 of file pressureTools.H.


The documentation for this class was generated from the following files: