zeroDimensionalFixedPressureConstraint Class Reference

Zero-dimensional fixed pressure constraint. Should be used in conjunction with the zeroDimensionalFixedPressureModel. More...

Inheritance diagram for zeroDimensionalFixedPressureConstraint:
Collaboration diagram for zeroDimensionalFixedPressureConstraint:

Public Member Functions

 TypeName ("zeroDimensionalFixedPressure")
 Runtime type information. More...
 
 zeroDimensionalFixedPressureConstraint (const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
 Construct from dictionary. More...
 
virtual ~zeroDimensionalFixedPressureConstraint ()
 Destructor. More...
 
const wordpName () const
 Pressure field name. More...
 
const wordrhoName () const
 Density field name. More...
 
virtual wordList constrainedFields () const
 Return the list of fields constrained by the fvConstraint. More...
 
tmp< volScalarField::InternalpEqnSource (const volScalarField &rho, fvMatrix< scalar > &pEqn) const
 Return the mass or volume source for the pressure equation. More...
 
tmp< volScalarField::InternalmassSource (const volScalarField::Internal &rho) const
 Return the mass source. More...
 
tmp< volScalarField::InternalmassSource (const volScalarField::Internal &alpha, const volScalarField::Internal &rho) const
 Return the mass source for a given phase. More...
 
virtual bool constrain (fvMatrix< scalar > &pEqn, const word &fieldName) const
 Apply the constraint to the pressure equation. More...
 
virtual bool movePoints ()
 Update for mesh motion. More...
 
virtual void topoChange (const polyTopoChangeMap &)
 Update topology using the given map. More...
 
virtual void mapMesh (const polyMeshMap &)
 Update from another mesh using the given map. More...
 
virtual void distribute (const polyDistributionMap &)
 Redistribute or update using the given distribution map. More...
 
virtual bool read (const dictionary &dict)
 Read dictionary. More...
 
template<class AlphaFieldType >
Foam::tmp< Foam::volScalarField::InternalmassSource (const AlphaFieldType &alpha, const volScalarField::Internal &rho) const
 
- Public Member Functions inherited from fvConstraint
 TypeName ("fvConstraint")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, fvConstraint, dictionary,(const word &name, const word &constraintType, const fvMesh &mesh, const dictionary &dict),(name, constraintType, mesh, dict))
 
 fvConstraint (const word &name, const word &constraintType, const fvMesh &mesh, const dictionary &dict)
 Construct from components. More...
 
autoPtr< fvConstraintclone () const
 Return clone. More...
 
virtual ~fvConstraint ()
 Destructor. More...
 
const wordname () const
 Return const access to the source name. More...
 
const fvMeshmesh () const
 Return const access to the mesh database. More...
 
const dictionarycoeffs () const
 Return dictionary. More...
 
virtual bool constrainsField (const word &fieldName) const
 Return true if the given field is constrained. More...
 
 FOR_ALL_FIELD_TYPES (DEFINE_FV_CONSTRAINT_CONSTRAIN)
 Apply a constraint to an equation. More...
 
 FOR_ALL_FIELD_TYPES (DEFINE_FV_CONSTRAINT_CONSTRAIN_FIELD)
 Apply constraint to a field. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from fvConstraint
static autoPtr< fvConstraintNew (const word &name, const fvMesh &mesh, const dictionary &dict)
 Return a reference to the selected fvConstraint. More...
 

Detailed Description

Zero-dimensional fixed pressure constraint. Should be used in conjunction with the zeroDimensionalFixedPressureModel.

This constraint and model facilitates specification of a constant or time-varying pressure. It adds mass source terms proportional to the error that remains when the pressure equation is evaluated at the desired pressure. Iteration may be necessary to converge the constraint in the case of non-linear equations of state.

Properties are added or removed with their current value. The model therefore represents a uniform expansion or contraction in infinite space.

Usage
Example usage:
{
    type            zeroDimensionalFixedPressure;

    // Name of the pressure field, default = p
    //p               p;

    // Name of the density field, default = rho
    //rho             rho;

    // Pressure value
    pressure        1e5;
}

Definition at line 78 of file zeroDimensionalFixedPressureConstraint.H.

Constructor & Destructor Documentation

◆ zeroDimensionalFixedPressureConstraint()

zeroDimensionalFixedPressureConstraint ( const word name,
const word modelType,
const fvMesh mesh,
const dictionary dict 
)

Construct from dictionary.

Definition at line 137 of file zeroDimensionalFixedPressureConstraint.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, fvConstraint::mesh(), and polyMesh::nGeometricD().

Here is the call graph for this function:

◆ ~zeroDimensionalFixedPressureConstraint()

Destructor.

Definition at line 166 of file zeroDimensionalFixedPressureConstraint.C.

Member Function Documentation

◆ TypeName()

TypeName ( "zeroDimensionalFixedPressure"  )

Runtime type information.

◆ pName()

const word& pName ( ) const
inline

Pressure field name.

Definition at line 141 of file zeroDimensionalFixedPressureConstraint.H.

◆ rhoName()

const word& rhoName ( ) const
inline

Density field name.

Definition at line 147 of file zeroDimensionalFixedPressureConstraint.H.

◆ constrainedFields()

Foam::wordList constrainedFields ( ) const
virtual

Return the list of fields constrained by the fvConstraint.

Reimplemented from fvConstraint.

Definition at line 174 of file zeroDimensionalFixedPressureConstraint.C.

◆ pEqnSource()

Foam::tmp< Foam::volScalarField::Internal > pEqnSource ( const volScalarField rho,
fvMatrix< scalar > &  pEqn 
) const

Return the mass or volume source for the pressure equation.

Definition at line 181 of file zeroDimensionalFixedPressureConstraint.C.

References fvMatrix< Type >::dimensions(), Foam::dimMass, Foam::dimVolume, Foam::exit(), Foam::FatalError, FatalErrorInFunction, DimensionedField< Type, GeoMesh >::New(), fvMatrix< Type >::psi(), rho, and Foam::typedName().

Here is the call graph for this function:

◆ massSource() [1/3]

Return the mass source.

Definition at line 224 of file zeroDimensionalFixedPressureConstraint.C.

References rho.

◆ massSource() [2/3]

Return the mass source for a given phase.

Definition at line 234 of file zeroDimensionalFixedPressureConstraint.C.

References alpha(), and rho.

Here is the call graph for this function:

◆ constrain()

bool constrain ( fvMatrix< scalar > &  pEqn,
const word fieldName 
) const
virtual

Apply the constraint to the pressure equation.

Definition at line 244 of file zeroDimensionalFixedPressureConstraint.C.

References IOobject::AUTO_WRITE, fvMatrix< Type >::dimensions(), Foam::dimPressure, Foam::dimVolume, Foam::name(), DimensionedField< Type, GeoMesh >::New(), IOobject::READ_IF_PRESENT, and Foam::typedName().

Here is the call graph for this function:

◆ movePoints()

bool movePoints ( )
virtual

Update for mesh motion.

Implements fvConstraint.

Definition at line 297 of file zeroDimensionalFixedPressureConstraint.C.

◆ topoChange()

void topoChange ( const polyTopoChangeMap map)
virtual

Update topology using the given map.

Implements fvConstraint.

Definition at line 303 of file zeroDimensionalFixedPressureConstraint.C.

◆ mapMesh()

void mapMesh ( const polyMeshMap map)
virtual

Update from another mesh using the given map.

Implements fvConstraint.

Definition at line 310 of file zeroDimensionalFixedPressureConstraint.C.

◆ distribute()

void distribute ( const polyDistributionMap map)
virtual

Redistribute or update using the given distribution map.

Implements fvConstraint.

Definition at line 317 of file zeroDimensionalFixedPressureConstraint.C.

◆ read()

bool read ( const dictionary dict)
virtual

Read dictionary.

Reimplemented from fvConstraint.

Definition at line 324 of file zeroDimensionalFixedPressureConstraint.C.

References dict, and fvConstraint::read().

Here is the call graph for this function:

◆ massSource() [3/3]


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