Go to the documentation of this file.
58 inletPatchName_(
dict.lookup(
"inletPatch")),
59 volumetric_(
dict.lookupOrDefault(
"volumetric",
true))
67 rhoName_ =
dict.lookupOrDefault<
word>(
"rho",
"rho");
71 if (
dict.found(
"value"))
80 evaluate(Pstream::commsTypes::blocking);
95 inletPatchName_(ptf.inletPatchName_),
96 volumetric_(ptf.volumetric_),
97 rhoName_(ptf.rhoName_)
108 inletPatchName_(ptf.inletPatchName_),
109 volumetric_(ptf.volumetric_),
110 rhoName_(ptf.rhoName_)
122 inletPatchName_(ptf.inletPatchName_),
123 volumetric_(ptf.volumetric_),
124 rhoName_(ptf.rhoName_)
130 template<
class RhoType>
131 void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateValues
133 const label inletPatchID,
134 const RhoType& rhoOutlet,
135 const RhoType& rhoInlet
139 const fvPatch& inletPatch =
p.boundaryMesh()[inletPatchID];
153 nUp =
max(nUp, scalar(0));
171 const scalar flowRate = -
gSum(rhoInlet*(inletPatch.
Sf() & inletPatchU));
174 const scalar estimatedFlowRate =
gSum(rhoOutlet*(
patch().magSf()*nUp));
176 if (estimatedFlowRate/flowRate > 0.5)
178 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
182 nUp += ((flowRate - estimatedFlowRate)/
gSum(rhoOutlet*
patch().magSf()));
201 const label inletPatchID =
202 patch().patch().boundaryMesh().findPatchID(inletPatchName_);
204 if (inletPatchID < 0)
207 <<
"Unable to find inlet patch " << inletPatchName_
213 updateValues(inletPatchID,
one(),
one());
218 if (db().foundObject<volScalarField>(rhoName_))
228 rho.boundaryField()[
patch().index()],
229 rho.boundaryField()[inletPatchID]
239 fixedValueFvPatchVectorField::updateCoeffs();
255 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), which can be used to avoid manipulating objects that are...
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.
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< 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,...
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.
string evaluate(const std::string &s, size_t pos=0, size_t len=std::string::npos)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...