phaseHydrostaticPressureFvPatchScalarField Class Reference

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

Inheritance diagram for phaseHydrostaticPressureFvPatchScalarField:
[legend]
Collaboration diagram for phaseHydrostaticPressureFvPatchScalarField:
[legend]

Public Member Functions

 TypeName ("phaseHydrostaticPressure")
 Runtime type information. More...
 
 phaseHydrostaticPressureFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &)
 Construct from patch and internal field. More...
 
 phaseHydrostaticPressureFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
 Construct from patch, internal field and dictionary. More...
 
 phaseHydrostaticPressureFvPatchScalarField (const phaseHydrostaticPressureFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, volMesh > &, const fvPatchFieldMapper &)
 Construct by mapping given. More...
 
 phaseHydrostaticPressureFvPatchScalarField (const phaseHydrostaticPressureFvPatchScalarField &)
 Construct as copy. More...
 
virtual tmp< fvPatchScalarFieldclone () const
 Construct and return a clone. More...
 
 phaseHydrostaticPressureFvPatchScalarField (const phaseHydrostaticPressureFvPatchScalarField &, 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...
 
virtual bool assignable () const
 Return true: this patch field is altered by assignment. More...
 
const wordphaseFraction () const
 Return the phaseFraction. More...
 
wordphaseFraction ()
 Return reference to the phaseFraction to allow adjustment. 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...
 
virtual void operator= (const fvPatchScalarField &pvf)
 

Protected Attributes

word phaseFraction_
 Name of phase-fraction field. More...
 
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 phase-based 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 coordinates
\( \rho \) = density (assumed uniform)
\( g \) = acceleration due to gravity [m/s2]

The values are assigned according to the phase-fraction field:

  • 1: apply \(p_{hyd}\)
  • 0: apply a zero-gradient condition
Usage
Property Description Required Default value
phaseFraction phase-fraction field name no alpha
rho density field name no rho
pRefValue reference pressure [Pa] yes
pRefPoint reference pressure location yes

Example of the boundary condition specification:

    <patchName>
    {
        type            phaseHydrostaticPressure;
        phaseFraction   alpha1;
        rho             rho;
        pRefValue       1e5;
        pRefPoint       (0 0 0);
        value           uniform 0; // optional initial value
    }
See also
Foam::mixedFvPatchScalarField
Source files

Definition at line 141 of file phaseHydrostaticPressureFvPatchScalarField.H.

Constructor & Destructor Documentation

◆ phaseHydrostaticPressureFvPatchScalarField() [1/5]

phaseHydrostaticPressureFvPatchScalarField ( const fvPatch p,
const DimensionedField< scalar, volMesh > &  iF 
)

Construct from patch and internal field.

Definition at line 38 of file phaseHydrostaticPressureFvPatchScalarField.C.

◆ phaseHydrostaticPressureFvPatchScalarField() [2/5]

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

Construct from patch, internal field and dictionary.

Definition at line 57 of file phaseHydrostaticPressureFvPatchScalarField.C.

References dict, dictionary::found(), dictionary::getOrDefault(), word::null, fvPatchField< scalar >::operator, fvPatchField< scalar >::operator=(), p, phaseHydrostaticPressureFvPatchScalarField::pRefValue_, and UList< T >::size().

Here is the call graph for this function:

◆ phaseHydrostaticPressureFvPatchScalarField() [3/5]

Construct by mapping given.

phaseHydrostaticPressureFvPatchScalarField onto a new patch

Definition at line 92 of file phaseHydrostaticPressureFvPatchScalarField.C.

◆ phaseHydrostaticPressureFvPatchScalarField() [4/5]

◆ phaseHydrostaticPressureFvPatchScalarField() [5/5]

Construct as copy setting internal field reference.

Definition at line 120 of file phaseHydrostaticPressureFvPatchScalarField.C.

Member Function Documentation

◆ TypeName()

TypeName ( "phaseHydrostaticPressure"  )

Runtime type information.

◆ clone() [1/2]

virtual tmp< fvPatchScalarField > clone ( ) const
inlinevirtual

Construct and return a clone.

Definition at line 203 of file phaseHydrostaticPressureFvPatchScalarField.H.

◆ 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 219 of file phaseHydrostaticPressureFvPatchScalarField.H.

◆ assignable()

virtual bool assignable ( ) const
inlinevirtual

Return true: this patch field is altered by assignment.

Definition at line 236 of file phaseHydrostaticPressureFvPatchScalarField.H.

◆ phaseFraction() [1/2]

const word & phaseFraction ( ) const
inline

Return the phaseFraction.

Definition at line 245 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseHydrostaticPressureFvPatchScalarField::phaseFraction_.

◆ phaseFraction() [2/2]

word & phaseFraction ( )
inline

Return reference to the phaseFraction to allow adjustment.

Definition at line 251 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseHydrostaticPressureFvPatchScalarField::phaseFraction_.

◆ rho() [1/2]

scalar rho ( ) const
inline

Return the constant density in the far-field.

Definition at line 257 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseHydrostaticPressureFvPatchScalarField::rho_.

◆ rho() [2/2]

scalar & rho ( )
inline

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

to allow adjustment

Definition at line 264 of file phaseHydrostaticPressureFvPatchScalarField.H.

◆ pRefValue() [1/2]

scalar pRefValue ( ) const
inline

Return the reference pressure.

Definition at line 270 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseHydrostaticPressureFvPatchScalarField::pRefValue_.

◆ pRefValue() [2/2]

scalar & pRefValue ( )
inline

Return reference to the reference pressure to allow adjustment.

Definition at line 276 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseHydrostaticPressureFvPatchScalarField::pRefValue_.

◆ pRefPoint() [1/2]

const vector & pRefPoint ( ) const
inline

Return the pressure reference location.

Definition at line 282 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseHydrostaticPressureFvPatchScalarField::pRefPoint_.

◆ pRefPoint() [2/2]

vector & pRefPoint ( )
inline

Return reference to the pressure reference location.

to allow adjustment

Definition at line 289 of file phaseHydrostaticPressureFvPatchScalarField.H.

◆ updateCoeffs()

void updateCoeffs ( )
virtual

Update the coefficients associated with the patch field.

Definition at line 137 of file phaseHydrostaticPressureFvPatchScalarField.C.

References g, Foam::max(), Foam::min(), Time::New(), and dimensioned< Type >::value().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Definition at line 166 of file phaseHydrostaticPressureFvPatchScalarField.C.

References os(), ObukhovLength::write(), Ostream::writeEntry(), and Ostream::writeEntryIfDifferent().

Here is the call graph for this function:

◆ operator=()

void operator= ( const fvPatchScalarField pvf)
virtual

Member Data Documentation

◆ phaseFraction_

word phaseFraction_
protected

Name of phase-fraction field.

Definition at line 151 of file phaseHydrostaticPressureFvPatchScalarField.H.

Referenced by phaseHydrostaticPressureFvPatchScalarField::phaseFraction().

◆ rho_

scalar rho_
protected

Constant density in the far-field.

Definition at line 154 of file phaseHydrostaticPressureFvPatchScalarField.H.

Referenced by phaseHydrostaticPressureFvPatchScalarField::rho().

◆ pRefValue_

◆ pRefPoint_

vector pRefPoint_
protected

Reference pressure location.

Definition at line 160 of file phaseHydrostaticPressureFvPatchScalarField.H.

Referenced by phaseHydrostaticPressureFvPatchScalarField::pRefPoint().


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