36Foam::matchedFlowRateOutletVelocityFvPatchVectorField::
37matchedFlowRateOutletVelocityFvPatchVectorField
50Foam::matchedFlowRateOutletVelocityFvPatchVectorField::
51matchedFlowRateOutletVelocityFvPatchVectorField
59 inletPatchName_(
dict.get<
word>(
"inletPatch")),
60 volumetric_(
dict.getOrDefault(
"volumetric", true))
86Foam::matchedFlowRateOutletVelocityFvPatchVectorField::
87matchedFlowRateOutletVelocityFvPatchVectorField
96 inletPatchName_(ptf.inletPatchName_),
97 volumetric_(ptf.volumetric_),
98 rhoName_(ptf.rhoName_)
102Foam::matchedFlowRateOutletVelocityFvPatchVectorField::
103matchedFlowRateOutletVelocityFvPatchVectorField
109 inletPatchName_(ptf.inletPatchName_),
110 volumetric_(ptf.volumetric_),
111 rhoName_(ptf.rhoName_)
115Foam::matchedFlowRateOutletVelocityFvPatchVectorField::
116matchedFlowRateOutletVelocityFvPatchVectorField
123 inletPatchName_(ptf.inletPatchName_),
124 volumetric_(ptf.volumetric_),
125 rhoName_(ptf.rhoName_)
131template<
class RhoType>
132void 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);
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const vectorField & Sf() const
Return face area vectors.
Velocity outlet boundary condition which corrects the extrapolated velocity to match the flow rate of...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)