Go to the documentation of this file.
61 outletPatchName_(
dict.get<
word>(
"outletPatch")),
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_),
131 this->internalField()
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];
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)
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);
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
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...
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const scalarField & magSf() const
Return face area magnitudes.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...