52 Foam::fv::zeroDimensionalFixedPressureConstraint::model()
const
58 if (isA<zeroDimensionalFixedPressureModel>(models[i]))
60 return refCast<const zeroDimensionalFixedPressureModel>
68 <<
"The " << typeName <<
" fvConstraint requires a corresponding "
69 << zeroDimensionalFixedPressureModel::typeName <<
" fvModel"
72 return NullObjectRef<zeroDimensionalFixedPressureModel>();
76 template<
class AlphaFieldType>
78 Foam::fv::zeroDimensionalFixedPressureConstraint::massSource
80 const AlphaFieldType&
alpha,
85 if (!sourcePtr_.valid())
99 return alpha*sourcePtr_();
109 <<
"Pressure equation dimensions not recognised"
116 void Foam::fv::zeroDimensionalFixedPressureConstraint::readCoeffs()
118 pName_ = coeffs().lookupOrDefault<
word>(
"p",
"p");
120 rhoName_ = coeffs().lookupOrDefault<
word>(
"rho",
"rho");
127 mesh().time().userUnits(),
141 const word& modelType,
148 rhoName_(
word::null),
155 <<
"Zero-dimensional fvConstraint applied to a "
191 if (!sourcePtr_.valid())
209 return rho()*sourcePtr_();
214 <<
"Dimensions of equation for pressure "
215 << pEqn.
psi().name() <<
" not recognised"
224 Foam::fv::zeroDimensionalFixedPressureConstraint::massSource
234 Foam::fv::zeroDimensionalFixedPressureConstraint::massSource
247 const word& fieldName
251 if (!sourcePtr_.valid())
260 mesh().time().
name(),
272 pEqn += sourcePtr_();
285 p_->value(mesh().time().value())
291 pEqn -= sourcePtr_();
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &, const Field< Type > &)
Return a temporary field constructed from name, mesh,.
Run-time selectable general function of one variable.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A list of keyword definitions, which are a keyword followed by any number of values (e....
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Finite volume options abstract base class.
virtual bool read(const dictionary &dict)
Read source dictionary.
const fvMesh & mesh() const
Return const access to the mesh database.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const dimensionSet & dimensions() const
Mesh data needed to do the Finite Volume discretisation.
This fvModel applies a mass source to the continuity equation and to all field equations....
Zero-dimensional fixed pressure constraint. Should be used in conjunction with the zeroDimensionalFix...
virtual bool movePoints()
Update for mesh motion.
tmp< volScalarField::Internal > pEqnSource(const volScalarField &rho, fvMatrix< scalar > &pEqn) const
Return the mass or volume source for the pressure equation.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
virtual ~zeroDimensionalFixedPressureConstraint()
Destructor.
virtual bool constrain(fvMatrix< scalar > &pEqn, const word &fieldName) const
Apply the constraint to the pressure equation.
zeroDimensionalFixedPressureConstraint(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from dictionary.
Zero-dimensional fixed pressure source. Should be used in conjunction with the zeroDimensionalFixedPr...
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
A class for handling words, derived from string.
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
const dimensionSet dimPressure
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimless
const dimensionSet dimTime
const dimensionSet dimVolume
word typedName(Name name)
Return the name of the object within the given type.
const dimensionSet dimMass
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.