uniformDensityHydrostaticPressureFvPatchScalarField Class Reference

This boundary condition provides a hydrostatic pressure condition, calculated as: More...

Inheritance diagram for uniformDensityHydrostaticPressureFvPatchScalarField:
Collaboration diagram for uniformDensityHydrostaticPressureFvPatchScalarField:

Public Member Functions

 TypeName ("uniformDensityHydrostaticPressure")
 Runtime type information. More...
 
 uniformDensityHydrostaticPressureFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
 Construct from patch, internal field and dictionary. More...
 
 uniformDensityHydrostaticPressureFvPatchScalarField (const uniformDensityHydrostaticPressureFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, volMesh > &, const fieldMapper &)
 Construct by mapping given. More...
 
 uniformDensityHydrostaticPressureFvPatchScalarField (const uniformDensityHydrostaticPressureFvPatchScalarField &)=delete
 Disallow copy without setting internal field reference. More...
 
 uniformDensityHydrostaticPressureFvPatchScalarField (const uniformDensityHydrostaticPressureFvPatchScalarField &, const DimensionedField< scalar, volMesh > &)
 Copy constructor setting internal field reference. More...
 
virtual tmp< fvPatchScalarFieldclone (const DimensionedField< scalar, volMesh > &iF) const
 Construct and return a clone setting internal field reference. More...
 
scalar rho () const
 Return the constant density in the far-field. More...
 
scalar & rho ()
 Return reference to the constant density in the far-field. More...
 
scalar pRef () const
 Return the reference pressure. More...
 
scalar & pRef ()
 Return reference to the reference pressure to allow adjustment. More...
 
const vectorpRefPoint () const
 Return the pressure reference location. More...
 
vectorpRefPoint ()
 Return reference to the pressure reference location. More...
 
virtual void updateCoeffs ()
 Update the coefficients associated with the patch field. More...
 
virtual void write (Ostream &) const
 Write. More...
 

Detailed Description

This boundary condition provides a hydrostatic pressure condition, calculated as:

\[ p_{hyd} = p_{ref} + \rho_{ref} g (x - x_{ref}) \]

where

$ p_{hyd} $ = Hydrostatic pressure [Pa]
$ p_{ref} $ = Reference pressure [Pa]
$ x_{ref} $ = Reference point in Cartesian co-ordinates
$ \rho_{ref} $ = Density (assumed uniform)
$ g $ = Acceleration due to gravity [m/s^2]
Usage
Property Description Required Default value
rhoRef Uniform density [kg/m^3] yes
pRef Reference pressure [Pa] yes
pRefPoint Reference pressure location no hRef
value Initial value no pRef

Example of the boundary condition specification:

    <patchName>
    {
        type            uniformDensityHydrostaticPressure;
        rhoRef          1000;
        pRef            1e5;
        pRefPoint       (0 0 0);
    }
Source files

Definition at line 127 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

Constructor & Destructor Documentation

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [1/4]

uniformDensityHydrostaticPressureFvPatchScalarField ( const fvPatch p,
const DimensionedField< scalar, volMesh > &  iF,
const dictionary dict 
)

Construct from patch, internal field and dictionary.

Definition at line 35 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

References dict, DimensionedField< Type, GeoMesh >::dimensions(), fvPatchField< Type >::operator, fvPatchField< Type >::operator=(), and p.

Here is the call graph for this function:

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [2/4]

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [3/4]

Disallow copy without setting internal field reference.

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [4/4]

Copy constructor setting internal field reference.

Definition at line 80 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

Member Function Documentation

◆ TypeName()

TypeName ( "uniformDensityHydrostaticPressure"  )

Runtime type information.

◆ clone()

virtual tmp<fvPatchScalarField> clone ( const DimensionedField< scalar, volMesh > &  iF) const
inlinevirtual

Construct and return a clone setting internal field reference.

Definition at line 186 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ rho() [1/2]

scalar rho ( ) const
inline

Return the constant density in the far-field.

Definition at line 207 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ rho() [2/2]

scalar& rho ( )
inline

Return reference to the constant density in the far-field.

to allow adjustment

Definition at line 214 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ pRef() [1/2]

scalar pRef ( ) const
inline

Return the reference pressure.

Definition at line 220 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ pRef() [2/2]

scalar& pRef ( )
inline

Return reference to the reference pressure to allow adjustment.

Definition at line 226 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ pRefPoint() [1/2]

const vector& pRefPoint ( ) const
inline

Return the pressure reference location.

Definition at line 232 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ pRefPoint() [2/2]

vector& pRefPoint ( )
inline

Return reference to the pressure reference location.

to allow adjustment

Definition at line 239 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ updateCoeffs()

void updateCoeffs ( )
virtual

Update the coefficients associated with the patch field.

Definition at line 97 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

References Foam::mag(), and UniformDimensionedField< Type >::value().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Definition at line 127 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

References fvPatchField< Type >::write(), and Foam::writeEntry().

Here is the call graph for this function:

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