62 phiName_(
dict.getOrDefault<
word>(
"phi",
"phi")),
63 fraction_(
dict.getOrDefault<scalar>(
"fraction", 1)),
64 offset_(
dict.getOrDefault<Type>(
"offset",
Zero))
79 outletPatchName_(ptf.outletPatchName_),
80 phiName_(ptf.phiName_),
81 fraction_(ptf.fraction_),
94 outletPatchName_(ptf.outletPatchName_),
95 phiName_(ptf.phiName_),
96 fraction_(ptf.fraction_),
110 outletPatchName_(ptf.outletPatchName_),
111 phiName_(ptf.phiName_),
112 fraction_(ptf.fraction_),
127 const GeometricField<Type, fvPatchField, volMesh>&
f
129 dynamic_cast<const GeometricField<Type, fvPatchField, volMesh>&
>
131 this->internalField()
135 const fvPatch&
p = this->
patch();
136 const label outletPatchID =
137 p.patch().boundaryMesh().findPatchID(outletPatchName_);
139 if (outletPatchID < 0)
142 <<
"Unable to find outlet patch " << outletPatchName_
146 const fvPatch& outletPatch =
p.boundaryMesh()[outletPatchID];
148 const fvPatchField<Type>& outletPatchField =
149 f.boundaryField()[outletPatchID];
152 this->db().objectRegistry::template lookupObject<surfaceScalarField>
155 const scalarField& outletPatchPhi =
phi.boundaryField()[outletPatchID];
156 const scalar sumOutletPatchPhi =
gSum(outletPatchPhi);
158 if (sumOutletPatchPhi > SMALL)
160 Type averageOutletField =
161 gSum(outletPatchPhi*outletPatchField)
164 this->
operator==(averageOutletField*fraction_ + offset_);
168 Type averageOutletField =
169 gSum(outletPatch.magSf()*outletPatchField)
170 /
gSum(outletPatch.magSf());
183 os.writeEntry(
"outletPatch", outletPatchName_);
184 os.writeEntryIfDifferent<word>(
"phi",
"phi", phiName_);
185 os.writeEntry(
"fraction", fraction_);
186 os.writeEntry(
"offset", offset_);
187 this->writeEntry(
"value",
os);