Go to the documentation of this file.
59 inletPatchName_(
dict.get<
word>(
"inletPatch")),
60 volumetric_(
dict.getOrDefault(
"volumetric",
true))
68 rhoName_ =
dict.getOrDefault<
word>(
"rho",
"rho");
72 if (
dict.found(
"value"))
81 evaluate(Pstream::commsTypes::blocking);
96 inletPatchName_(ptf.inletPatchName_),
97 volumetric_(ptf.volumetric_),
98 rhoName_(ptf.rhoName_)
109 inletPatchName_(ptf.inletPatchName_),
110 volumetric_(ptf.volumetric_),
111 rhoName_(ptf.rhoName_)
123 inletPatchName_(ptf.inletPatchName_),
124 volumetric_(ptf.volumetric_),
125 rhoName_(ptf.rhoName_)
131 template<
class RhoType>
132 void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateValues
134 const label inletPatchID,
135 const RhoType& rhoOutlet,
136 const RhoType& rhoInlet
140 const fvPatch& inletPatch =
p.boundaryMesh()[inletPatchID];
154 nUp =
max(nUp, scalar(0));
172 const scalar flowRate = -
gSum(rhoInlet*(inletPatch.
Sf() & inletPatchU));
175 const scalar estimatedFlowRate =
gSum(rhoOutlet*(
patch().magSf()*nUp));
177 if (estimatedFlowRate > 0.5*flowRate)
179 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
183 nUp += ((flowRate - estimatedFlowRate)/
gSum(rhoOutlet*
patch().magSf()));
202 const label inletPatchID =
203 patch().patch().boundaryMesh().findPatchID(inletPatchName_);
205 if (inletPatchID < 0)
208 <<
"Unable to find inlet patch " << inletPatchName_
214 updateValues(inletPatchID,
one{},
one{});
219 if (db().foundObject<volScalarField>(rhoName_))
229 rho.boundaryField()[
patch().index()],
230 rho.boundaryField()[inletPatchID]
240 fixedValueFvPatchVectorField::updateCoeffs();
256 writeEntry(
"value",
os);
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
const vectorField & Sf() const
Return face area vectors.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
A class for handling words, derived from Foam::string.
virtual void write(Ostream &) const
Write.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Type gSum(const FieldField< Field, Type > &f)
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Field< vector > vectorField
Specialisation of Field<T> for vector.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
matchedFlowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Velocity outlet boundary condition which corrects the extrapolated velocity to match the flow rate of...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
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...
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.