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_)
106 inletPatchName_(ptf.inletPatchName_),
107 volumetric_(ptf.volumetric_),
108 rhoName_(ptf.rhoName_)
120 inletPatchName_(ptf.inletPatchName_),
121 volumetric_(ptf.volumetric_),
122 rhoName_(ptf.rhoName_)
128 template<
class RhoType>
129 void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateValues
131 const label inletPatchID,
132 const RhoType& rhoOutlet,
133 const RhoType& rhoInlet
151 nUp =
max(nUp, scalar(0));
156 const_cast<volVectorField&>
158 dynamic_cast<const volVectorField&>(internalField())
169 const scalar flowRate = -
gSum(rhoInlet*(inletPatch.
Sf() & inletPatchU));
172 const scalar estimatedFlowRate =
gSum(rhoOutlet*(patch().magSf()*nUp));
174 if (estimatedFlowRate/flowRate > 0.5)
176 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
180 nUp += ((flowRate - estimatedFlowRate)/
gSum(rhoOutlet*patch().magSf()));
199 const label inletPatchID =
200 patch().patch().boundaryMesh().findPatchID(inletPatchName_);
202 if (inletPatchID < 0)
205 <<
"Unable to find inlet patch " << inletPatchName_
211 updateValues(inletPatchID,
one(),
one());
216 if (db().foundObject<volScalarField>(rhoName_))
237 fixedValueFvPatchVectorField::updateCoeffs();
247 writeEntry(os,
"inletPatch", inletPatchName_);
251 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)
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...