56 inletPatchName_(dict.lookup(
"inletPatch")),
57 volumetric_(dict.lookupOrDefault(
"volumetric",
true))
65 rhoName_ =
word(dict.lookupOrDefault<
word>(
"rho",
"rho"));
69 if (dict.found(
"value"))
78 evaluate(Pstream::commsTypes::blocking);
93 inletPatchName_(ptf.inletPatchName_),
94 volumetric_(ptf.volumetric_),
95 rhoName_(ptf.rhoName_)
107 inletPatchName_(ptf.inletPatchName_),
108 volumetric_(ptf.volumetric_),
109 rhoName_(ptf.rhoName_)
115 template<
class RhoType>
116 void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateValues
118 const label inletPatchID,
119 const RhoType& rhoOutlet,
120 const RhoType& rhoInlet
138 nUp =
max(nUp, scalar(0));
143 const_cast<volVectorField&>
145 dynamic_cast<const volVectorField&>(internalField())
156 const scalar flowRate = -
gSum(rhoInlet*(inletPatch.
Sf() & inletPatchU));
159 const scalar estimatedFlowRate =
gSum(rhoOutlet*(patch().magSf()*nUp));
161 if (estimatedFlowRate/flowRate > 0.5)
163 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
167 nUp += ((flowRate - estimatedFlowRate)/
gSum(rhoOutlet*patch().magSf()));
186 const label inletPatchID =
187 patch().patch().boundaryMesh().findPatchID(inletPatchName_);
189 if (inletPatchID < 0)
192 <<
"Unable to find inlet patch " << inletPatchName_
198 updateValues(inletPatchID,
one(),
one());
203 if (db().foundObject<volScalarField>(rhoName_))
224 fixedValueFvPatchVectorField::updateCoeffs();
234 writeEntry(os,
"inletPatch", inletPatchName_);
238 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
tmp< vectorField > nf() const
Return face normals.
void size(const label)
Override size to be inconsistent with allocated storage.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
matchedFlowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
volVectorField vectorField(fieldObject, mesh)
Velocity outlet boundary condition which corrects the extrapolated velocity to match the flow rate of...
virtual void write(Ostream &) const
Write.
Macros for easy insertion into run-time selection tables.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Type gSum(const FieldField< Field, Type > &f)
virtual void write(Ostream &) const
Write.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
const vectorField & Sf() const
Return face area vectors.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...