Go to the documentation of this file.
60 volumetric_(
dict.getOrDefault(
"volumetric", true))
68 rhoName_ =
dict.getOrDefault<word>(
"rho",
"rho");
72 if (
dict.found(
"value"))
89 const matchedFlowRateOutletVelocityFvPatchVectorField& ptf,
91 const DimensionedField<vector, volMesh>& iF,
92 const fvPatchFieldMapper& mapper
95 fixedValueFvPatchField<
vector>(ptf,
p, iF, mapper),
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
139 const fvPatch&
p =
patch();
140 const fvPatch& inletPatch =
p.boundaryMesh()[inletPatchID];
154 nUp =
max(nUp, scalar(0));
169 inletPatchU.updateCoeffs();
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);
267 matchedFlowRateOutletVelocityFvPatchVectorField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
const vectorField & Sf() const
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A class for handling words, derived from Foam::string.
virtual void write(Ostream &) const
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
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.
Generic templated field type.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
matchedFlowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label max(const labelHashSet &set, label maxValue=labelMin)
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.
Vector< scalar > vector
A scalar version of the templated Vector.
virtual void updateCoeffs()
errorManipArg< error, int > exit(error &err, const int errNo=1)
GeometricField< vector, fvPatchField, volMesh > volVectorField
fvPatchField< vector > fvPatchVectorField
#define FatalErrorInFunction
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Ostream & writeEntry(const keyType &key, const T &value)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
virtual void updateCoeffs()
Generic GeometricField class.
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)