Zero-dimensional fixed pressure constraint. Should be used in conjunction with the zeroDimensionalFixedPressureModel. More...
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 word & | pName () const |
Pressure field name. More... | |
const word & | rhoName () const |
Density field name. More... | |
virtual wordList | constrainedFields () const |
Return the list of fields constrained by the fvConstraint. More... | |
tmp< volScalarField::Internal > | pEqnSource (const volScalarField &rho, fvMatrix< scalar > &pEqn) const |
Return the mass or volume source for the pressure equation. More... | |
tmp< volScalarField::Internal > | massSource (const volScalarField::Internal &rho) const |
Return the mass source. More... | |
tmp< volScalarField::Internal > | massSource (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::Internal > | massSource (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< fvConstraint > | clone () const |
Return clone. More... | |
virtual | ~fvConstraint () |
Destructor. More... | |
const word & | name () const |
Return const access to the source name. More... | |
const fvMesh & | mesh () const |
Return const access to the mesh database. More... | |
const dictionary & | coeffs () 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< fvConstraint > | New (const word &name, const fvMesh &mesh, const dictionary &dict) |
Return a reference to the selected fvConstraint. More... | |
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.
{ 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.
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().
|
virtual |
Destructor.
Definition at line 166 of file zeroDimensionalFixedPressureConstraint.C.
TypeName | ( | "zeroDimensionalFixedPressure" | ) |
Runtime type information.
|
inline |
Pressure field name.
Definition at line 141 of file zeroDimensionalFixedPressureConstraint.H.
|
inline |
Density field name.
Definition at line 147 of file zeroDimensionalFixedPressureConstraint.H.
|
virtual |
Return the list of fields constrained by the fvConstraint.
Reimplemented from fvConstraint.
Definition at line 174 of file zeroDimensionalFixedPressureConstraint.C.
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().
Foam::tmp< Foam::volScalarField::Internal > massSource | ( | const volScalarField::Internal & | rho | ) | const |
Return the mass source.
Definition at line 224 of file zeroDimensionalFixedPressureConstraint.C.
References rho.
Foam::tmp< Foam::volScalarField::Internal > massSource | ( | const volScalarField::Internal & | alpha, |
const volScalarField::Internal & | rho | ||
) | const |
Return the mass source for a given phase.
Definition at line 234 of file zeroDimensionalFixedPressureConstraint.C.
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().
|
virtual |
Update for mesh motion.
Implements fvConstraint.
Definition at line 297 of file zeroDimensionalFixedPressureConstraint.C.
|
virtual |
Update topology using the given map.
Implements fvConstraint.
Definition at line 303 of file zeroDimensionalFixedPressureConstraint.C.
|
virtual |
Update from another mesh using the given map.
Implements fvConstraint.
Definition at line 310 of file zeroDimensionalFixedPressureConstraint.C.
|
virtual |
Redistribute or update using the given distribution map.
Implements fvConstraint.
Definition at line 317 of file zeroDimensionalFixedPressureConstraint.C.
|
virtual |
Read dictionary.
Reimplemented from fvConstraint.
Definition at line 324 of file zeroDimensionalFixedPressureConstraint.C.
References dict, and fvConstraint::read().
Foam::tmp<Foam::volScalarField::Internal> massSource | ( | const AlphaFieldType & | alpha, |
const volScalarField::Internal & | rho | ||
) | const |
Definition at line 78 of file zeroDimensionalFixedPressureConstraint.C.
References alpha(), Foam::dimless, Foam::dimMass, Foam::dimTime, Foam::dimVolume, Foam::exit(), Foam::FatalError, FatalErrorInFunction, DimensionedField< Type, GeoMesh >::New(), rho, and Foam::typedName().