52 Foam::fv::zeroDimensionalFixedPressureConstraint::model()
const
58 if (isA<zeroDimensionalFixedPressureModel>(models[i]))
60 return refCast<const zeroDimensionalFixedPressureModel>
68 <<
"The " <<
typeName <<
" fvConstraint requires a corresponding "
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
121 pName_ =
dict.lookupOrDefault<
word>(
"p",
"p");
123 rhoName_ =
dict.lookupOrDefault<
word>(
"rho",
"rho");
144 const word& modelType,
151 rhoName_(
word::null),
158 <<
"Zero-dimensional fvConstraint applied to a "
194 if (!sourcePtr_.valid())
212 return rho()*sourcePtr_();
217 <<
"Dimensions of equation for pressure "
218 << pEqn.
psi().name() <<
" not recognised"
227 Foam::fv::zeroDimensionalFixedPressureConstraint::massSource
237 Foam::fv::zeroDimensionalFixedPressureConstraint::massSource
250 const word& fieldName
254 if (!sourcePtr_.valid())
275 pEqn += sourcePtr_();
294 pEqn -= sourcePtr_();
334 readCoeffs(coeffs(
dict));
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
static fvModels & New(const word &name, const fvMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const GeoMesh &mesh, const dimensionSet &, const PrimitiveField< 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...
const unitSet & userUnits() const
Return the user-time unit conversion.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Finite volume options abstract base class.
virtual bool read(const dictionary &dict)
Read source dictionary.
const dictionary & coeffs(const dictionary &) const
Return the coefficients sub-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.
const Time & time() const
Return the top-level database.
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.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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 & dimless
const dimensionSet & dimMass
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
const dimensionSet & dimVolume
const dimensionSet & dimTime
word typedName(Name name)
Return the name of the object within the given type.
const dimensionSet & dimPressure
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.