Loading...
Searching...
No Matches
phaseHydrostaticPressureFvPatchScalarField Class Reference

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

#include <phaseHydrostaticPressureFvPatchScalarField.H>

Inheritance diagram for phaseHydrostaticPressureFvPatchScalarField:
Collaboration diagram for phaseHydrostaticPressureFvPatchScalarField:

Public Member Functions

 TypeName ("phaseHydrostaticPressure")
 Runtime type information.
 phaseHydrostaticPressureFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &)
 Construct from patch and internal field.
 phaseHydrostaticPressureFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
 Construct from patch, internal field and dictionary.
 phaseHydrostaticPressureFvPatchScalarField (const phaseHydrostaticPressureFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, volMesh > &, const fvPatchFieldMapper &)
 Construct by mapping given.
 phaseHydrostaticPressureFvPatchScalarField (const phaseHydrostaticPressureFvPatchScalarField &)
 Construct as copy.
 phaseHydrostaticPressureFvPatchScalarField (const phaseHydrostaticPressureFvPatchScalarField &, const DimensionedField< scalar, volMesh > &)
 Construct as copy setting internal field reference.
virtual tmp< fvPatchField< scalar > > clone () const
 Return a clone.
virtual tmp< fvPatchField< scalar > > clone (const DimensionedField< scalar, volMesh > &iF) const
 Clone with an internal field reference.
virtual bool assignable () const
 True: this patch field is altered by assignment.
const wordphaseFraction () const
 Return the phaseFraction.
wordphaseFraction ()
 Return reference to the phaseFraction to allow adjustment.
scalar rho () const
 Return the constant density in the far-field.
scalar & rho ()
 Return reference to the constant density in the far-field.
scalar pRefValue () const
 Return the reference pressure.
scalar & pRefValue ()
 Return reference to the reference pressure to allow adjustment.
const vectorpRefPoint () const
 Return the pressure reference location.
vectorpRefPoint ()
 Return reference to the pressure reference location.
virtual void updateCoeffs ()
 Update the coefficients associated with the patch field.
virtual void write (Ostream &) const
 Write.
virtual void operator= (const fvPatchScalarField &pvf)

Protected Attributes

word phaseFraction_
 Name of phase-fraction field.
scalar rho_
 Constant density in the far-field.
scalar pRefValue_
 Reference pressure.
vector pRefPoint_
 Reference pressure location.

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 137 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 31 of file phaseHydrostaticPressureFvPatchScalarField.C.

References p, phaseFraction_, pRefPoint_, pRefValue_, rho_, and Foam::Zero.

Referenced by phaseHydrostaticPressureFvPatchScalarField(), phaseHydrostaticPressureFvPatchScalarField(), phaseHydrostaticPressureFvPatchScalarField(), and TypeName().

Here is the caller graph for this function:

◆ 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 50 of file phaseHydrostaticPressureFvPatchScalarField.C.

References dict, fvPatchField< scalar >::operator=(), p, phaseFraction_, pRefPoint_, pRefValue_, fvPatchFieldBase::readDict(), and rho_.

Here is the call graph for this function:

◆ phaseHydrostaticPressureFvPatchScalarField() [3/5]

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

Construct by mapping given.

phaseHydrostaticPressureFvPatchScalarField onto a new patch

Definition at line 78 of file phaseHydrostaticPressureFvPatchScalarField.C.

References p, phaseFraction_, phaseHydrostaticPressureFvPatchScalarField(), pRefPoint_, pRefValue_, and rho_.

Here is the call graph for this function:

◆ phaseHydrostaticPressureFvPatchScalarField() [4/5]

phaseHydrostaticPressureFvPatchScalarField ( const phaseHydrostaticPressureFvPatchScalarField & ptf)

Construct as copy.

Definition at line 95 of file phaseHydrostaticPressureFvPatchScalarField.C.

References phaseFraction_, and phaseHydrostaticPressureFvPatchScalarField().

Here is the call graph for this function:

◆ phaseHydrostaticPressureFvPatchScalarField() [5/5]

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

Construct as copy setting internal field reference.

Definition at line 106 of file phaseHydrostaticPressureFvPatchScalarField.C.

References phaseFraction_, phaseHydrostaticPressureFvPatchScalarField(), pRefPoint_, pRefValue_, and rho_.

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "phaseHydrostaticPressure" )

Runtime type information.

References phaseHydrostaticPressureFvPatchScalarField().

Here is the call graph for this function:

◆ clone() [1/2]

virtual tmp< fvPatchField< scalar > > clone ( ) const
inlinevirtual

Return a clone.

Definition at line 229 of file phaseHydrostaticPressureFvPatchScalarField.H.

References fvPatchField< Type >::Clone().

Here is the call graph for this function:

◆ clone() [2/2]

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

Clone with an internal field reference.

Definition at line 237 of file phaseHydrostaticPressureFvPatchScalarField.H.

References fvPatchField< Type >::Clone().

Here is the call graph for this function:

◆ assignable()

virtual bool assignable ( ) const
inlinevirtual

True: this patch field is altered by assignment.

Definition at line 251 of file phaseHydrostaticPressureFvPatchScalarField.H.

◆ phaseFraction() [1/2]

const word & phaseFraction ( ) const
inline

Return the phaseFraction.

Definition at line 259 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseFraction_.

◆ phaseFraction() [2/2]

word & phaseFraction ( )
inline

Return reference to the phaseFraction to allow adjustment.

Definition at line 267 of file phaseHydrostaticPressureFvPatchScalarField.H.

References phaseFraction_.

◆ rho() [1/2]

scalar rho ( ) const
inline

Return the constant density in the far-field.

Definition at line 275 of file phaseHydrostaticPressureFvPatchScalarField.H.

References rho_.

◆ rho() [2/2]

scalar & rho ( )
inline

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

to allow adjustment

Definition at line 285 of file phaseHydrostaticPressureFvPatchScalarField.H.

References rho_.

◆ pRefValue() [1/2]

scalar pRefValue ( ) const
inline

Return the reference pressure.

Definition at line 293 of file phaseHydrostaticPressureFvPatchScalarField.H.

References pRefValue_.

◆ pRefValue() [2/2]

scalar & pRefValue ( )
inline

Return reference to the reference pressure to allow adjustment.

Definition at line 301 of file phaseHydrostaticPressureFvPatchScalarField.H.

References pRefValue_.

◆ pRefPoint() [1/2]

const vector & pRefPoint ( ) const
inline

Return the pressure reference location.

Definition at line 309 of file phaseHydrostaticPressureFvPatchScalarField.H.

References pRefPoint_.

◆ pRefPoint() [2/2]

vector & pRefPoint ( )
inline

Return reference to the pressure reference location.

to allow adjustment

Definition at line 319 of file phaseHydrostaticPressureFvPatchScalarField.H.

References pRefPoint_.

◆ updateCoeffs()

void updateCoeffs ( )
virtual

Update the coefficients associated with the patch field.

Definition at line 123 of file phaseHydrostaticPressureFvPatchScalarField.C.

References Foam::clamp(), g, gravity::New(), phaseFraction_, pRefPoint_, pRefValue_, and rho_.

Here is the call graph for this function:

◆ write()

void write ( Ostream & os) const
virtual

Write.

Definition at line 149 of file phaseHydrostaticPressureFvPatchScalarField.C.

References os(), phaseFraction_, pRefPoint_, pRefValue_, rho_, fvPatchField< Type >::write(), and fvPatchField< Type >::writeValueEntry().

Here is the call graph for this function:

◆ operator=()

void operator= ( const fvPatchScalarField & pvf)
virtual

Definition at line 162 of file phaseHydrostaticPressureFvPatchScalarField.C.

References Foam::lerp().

Here is the call graph for this function:

Member Data Documentation

◆ phaseFraction_

◆ rho_

◆ pRefValue_

◆ pRefPoint_


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