Public Member Functions | Private Attributes
uniformDensityHydrostaticPressureFvPatchScalarField Class Reference

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

Inheritance diagram for uniformDensityHydrostaticPressureFvPatchScalarField:
Inheritance graph
[legend]
Collaboration diagram for uniformDensityHydrostaticPressureFvPatchScalarField:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("uniformDensityHydrostaticPressure")
 Runtime type information. More...
 
 uniformDensityHydrostaticPressureFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &)
 Construct from patch and internal field. 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 fvPatchFieldMapper &)
 Construct by mapping given. More...
 
 uniformDensityHydrostaticPressureFvPatchScalarField (const uniformDensityHydrostaticPressureFvPatchScalarField &)
 Construct as copy. More...
 
virtual tmp< fvPatchScalarFieldclone () const
 Construct and return a clone. More...
 
 uniformDensityHydrostaticPressureFvPatchScalarField (const uniformDensityHydrostaticPressureFvPatchScalarField &, const DimensionedField< scalar, volMesh > &)
 Construct as copy 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 pRefValue () const
 Return the reference pressure. More...
 
scalar & pRefValue ()
 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...
 

Private Attributes

scalar rho_
 Constant density in the far-field. More...
 
scalar pRefValue_
 Reference pressure. More...
 
vector pRefPoint_
 Reference pressure location. More...
 

Detailed Description

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

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

where

$ p_{hyd} $ = hyrostatic pressure [Pa]
$ p_{ref} $ = reference pressure [Pa]
$ x_{ref} $ = reference point in Cartesian co-ordinates
$ \rho $ = density (assumed uniform)
$ g $ = acceleration due to gravity [m/s2]


Patch usage

Property Description Required Default value
rho uniform density [kg/m3] yes
pRefValue reference pressure [Pa] yes
pRefPoint reference pressure location yes

Example of the boundary condition specification:

    myPatch
    {
        type            uniformDensityHydrostaticPressure;
        rho             rho;
        pRefValue       1e5;
        pRefPoint       (0 0 0);
        value           uniform 0; // optional initial value
    }
Source files

Definition at line 126 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

Constructor & Destructor Documentation

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [1/5]

Construct from patch and internal field.

Definition at line 37 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

Referenced by uniformDensityHydrostaticPressureFvPatchScalarField::clone().

Here is the caller graph for this function:

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [2/5]

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

Construct from patch, internal field and dictionary.

Definition at line 51 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

References dict, p, and scalarField().

Here is the call graph for this function:

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [3/5]

Construct by mapping given.

uniformDensityHydrostaticPressureFvPatchScalarField onto a new patch

Definition at line 78 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [4/5]

Construct as copy.

Definition at line 94 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

◆ uniformDensityHydrostaticPressureFvPatchScalarField() [5/5]

Construct as copy setting internal field reference.

Definition at line 107 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

Member Function Documentation

◆ TypeName()

TypeName ( "uniformDensityHydrostaticPressure"  )

Runtime type information.

◆ clone() [1/2]

virtual tmp<fvPatchScalarField> clone ( ) const
inlinevirtual

Construct and return a clone.

Definition at line 182 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

References uniformDensityHydrostaticPressureFvPatchScalarField::uniformDensityHydrostaticPressureFvPatchScalarField().

Here is the call graph for this function:

◆ clone() [2/2]

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

Construct and return a clone setting internal field reference.

Definition at line 199 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ rho() [1/2]

scalar rho ( ) const
inline

Return the constant density in the far-field.

Definition at line 219 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

References uniformDensityHydrostaticPressureFvPatchScalarField::rho_.

◆ rho() [2/2]

scalar& rho ( )
inline

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

to allow adjustment

Definition at line 226 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ pRefValue() [1/2]

scalar pRefValue ( ) const
inline

◆ pRefValue() [2/2]

scalar& pRefValue ( )
inline

Return reference to the reference pressure to allow adjustment.

Definition at line 238 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

References uniformDensityHydrostaticPressureFvPatchScalarField::pRefValue_.

◆ pRefPoint() [1/2]

const vector& pRefPoint ( ) const
inline

Return the pressure reference location.

Definition at line 244 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

References uniformDensityHydrostaticPressureFvPatchScalarField::pRefPoint_.

◆ pRefPoint() [2/2]

vector& pRefPoint ( )
inline

Return reference to the pressure reference location.

to allow adjustment

Definition at line 251 of file uniformDensityHydrostaticPressureFvPatchScalarField.H.

◆ updateCoeffs()

void updateCoeffs ( )
virtual

◆ write()

void write ( Ostream os) const
virtual

Write.

Definition at line 142 of file uniformDensityHydrostaticPressureFvPatchScalarField.C.

References token::END_STATEMENT, Foam::nl, fvPatchField::write(), and Ostream::writeKeyword().

Here is the call graph for this function:

Field Documentation

◆ rho_

scalar rho_
private

◆ pRefValue_

scalar pRefValue_
private

◆ pRefPoint_

vector pRefPoint_
private

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