Skip to main content

pressure

Description

The pressure function object provides several methods to convert an input pressure field into derived forms, including:

  • Static pressure, pp:
p=ρpkp = \rho \, p_k
  • Total pressure, ptp_t:
pt=pref+p+0.5ρu2p_t = p_{\ref} + p + 0.5 \rho |\u|^2
  • Pressure coefficient, static or total, CpC_p:
Cp=p0.5ρu2C_p = \frac{p}{0.5 \rho_{\infty} \mag{\u_{\infty}}^2}
  • Isentropic pressure, pip_i:
pi=p[1+γ12M2]γγ1p_i = p \left[1 + \frac{\gamma-1}{2} M^2 \right]^{\frac{\gamma}{\gamma-1}}

where:

ρ\rho : Density [kg/m3]

u\u : Velocity [m/s]

ρinf\rho_{\inf} : Freestream density [kg/m3]

pinfp_{\inf} : Freestream pressure [Pa]

uinf\u_{\inf} : Freestream velocity [m/s]

pkp_k : Kinematic pressure (p/rho) [m2/s2]

psp_s : Static pressure [Pa]

p0p_0 : Total pressure [Pa]

prefp_{\ref} : Reference pressure level [Pa]

pip_i : Total isentropic pressure

CpC_p : Pressure coefficient

Cp0C_{p_0} : Total pressure coefficient

γ\gamma : Specific heat ratio

For incompressible cases, the kinematic pressure (pressure divided by density) can be converted to pressure via a user-specified reference density.

Operands

OperandTypeLocation
inputvolScalarField$FOAM_CASE/<time>/<inpField>
output file--
output fieldvolScalarField$FOAM_CASE/<time>/<outField>

Usage

Example of the pressure function object by using functions sub-dictionary in system/controlDict file:

pressure1
{
// Mandatory entries (unmodifiable)
type pressure;
libs (fieldFunctionObjects);

// Mandatory entries (runtime modifiable)
mode <option>;

// Optional entries (runtime modifiable)
p <pName>;
U <UName>;
rho <rhoName>;
rhoInf 1.0; // enabled if rho=rhoInf
pRef 0.0;
hydroStaticMode none;
g (0 -9.81 0); // enabled if hydroStaticMode != none
hRef 0.0; // enabled if hydroStaticMode != none
pInf 0.0;
UInf (1 0 0);
}

where the entries mean:

PropertyDescriptionTypeRequiredDefault
typeType name: pressurewordyes-
libsLibrary name: fieldFunctionObjectswordyes-
modeCalculation mode (see below)wordyes-
pName of the pressure fieldwordnop
UName of the velocity fieldwordnoU
rhoName of the density fieldwordnorho
rhoInfFreestream density for coefficient calculationscalarconditional-
pRefReference pressure for total pressurescalarno0
hydrostaticModeHydrostatic contributions (see below)wordnonone
gGravity vector (see below)vectorno-
hRefReference height (see below)scalarno-
pInfFreestream pressure for coefficient calculationscalarno-
UInfFreestream velocity for coefficient calculationvectorno-

Options for the mode entry:

static | static pressure
total | total pressure
isentropic | isentropic pressure
staticCoeff | static pressure coefficient
totalCoeff | total pressure coefficient

The hydrostaticMode entry provides handling for the term ρ(gh)\rho (\vec{g} \cdot \vec{h}) where options include

none | not included
add | add the term, e.g. to convert from p_rgh to p
subtract | subtract the term, e.g. to convert from p to p_rgh

If the hydrostaticMode is active, values are also required for gravity, g, and reference height, hRef. By default these will be retrieved from the database. When these values are not available the user must provide them, e.g.

g (0 -9.81 0);
hRef 0;

Default behaviour assumes that the case is compressible. For incompressible cases, i.e. solved using the kinematic pressure:

pk=pρ[m2s2]p_k = \frac{p}{\rho} \qquad [\mathrm{m}^2 \mathrm{s}^{-2}]

The rho entry can be used to set the freestream density:

rho rhoInf;
rhoInf 100000;

The inherited entries are elaborated in:

Usage by the postProcess utility is not available.

Stored properties

Fields

The derived pressure is stored on the mesh database, using the default name:

  • static pressure: static(p)
  • static pressure coefficient: static(p)_coeff
  • total pressure: total(p)
  • total pressure coefficient: total(p)_coeff

This can be overridden using the result entry.

Further information

Tutorial:

Source code:

API:

History: Introduced in version 2.2.0