42 inletPatchName_(
dict.lookup(
"inletPatch")),
43 volumetric_(
dict.lookupOrDefault(
"volumetric", true))
51 rhoName_ =
word(
dict.lookupOrDefault<
word>(
"rho",
"rho"));
55 if (
dict.found(
"value"))
79 inletPatchName_(ptf.inletPatchName_),
80 volumetric_(ptf.volumetric_),
81 rhoName_(ptf.rhoName_)
93 inletPatchName_(ptf.inletPatchName_),
94 volumetric_(ptf.volumetric_),
95 rhoName_(ptf.rhoName_)
101 template<
class RhoType>
102 void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateValues
104 const label inletPatchID,
105 const RhoType& rhoOutlet,
106 const RhoType& rhoInlet
110 const fvPatch& inletPatch =
p.boundaryMesh()[inletPatchID];
124 nUp =
max(nUp, scalar(0));
142 const scalar flowRate = -
gSum(rhoInlet*(inletPatch.
Sf() & inletPatchU));
145 const scalar estimatedFlowRate =
gSum(rhoOutlet*(patch().magSf()*nUp));
147 if (estimatedFlowRate/flowRate > 0.5)
149 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
153 nUp += ((flowRate - estimatedFlowRate)/
gSum(rhoOutlet*patch().magSf()));
172 const label inletPatchID =
173 patch().patch().boundaryMesh().findIndex(inletPatchName_);
175 if (inletPatchID < 0)
178 <<
"Unable to find inlet patch " << inletPatchName_
184 updateValues(inletPatchID,
one(),
one());
189 if (db().foundObject<volScalarField>(rhoName_))
199 rho.boundaryField()[patch().index()],
200 rho.boundaryField()[inletPatchID]
210 fixedValueFvPatchVectorField::updateCoeffs();
220 writeEntry(os,
"inletPatch", inletPatchName_);
224 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
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...
const dimensionSet & dimensions() const
Return dimensions.
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for field mapping.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const vectorField & Sf() const
Return face area vectors.
Velocity outlet boundary condition which corrects the extrapolated velocity to match the flow rate of...
virtual void write(Ostream &) const
Write.
matchedFlowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(const FieldField< Field, Type > &f)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Field< vector > vectorField
Specialisation of Field<T> for vector.
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)