Go to the documentation of this file.
60 rhoOutlet_(
dict.getOrDefault<scalar>(
"rhoOutlet", -VGREAT))
62 if (
dict.found(
"volumetricFlowRate"))
69 else if (
dict.found(
"massFlowRate"))
73 rhoName_ =
dict.getOrDefault<
word>(
"rho",
"rho");
78 <<
"Please supply either 'volumetricFlowRate' or"
83 if (
dict.found(
"value"))
92 evaluate(Pstream::commsTypes::blocking);
107 flowRate_(ptf.flowRate_.clone()),
108 volumetric_(ptf.volumetric_),
109 rhoName_(ptf.rhoName_),
110 rhoOutlet_(ptf.rhoOutlet_)
121 flowRate_(ptf.flowRate_.clone()),
122 volumetric_(ptf.volumetric_),
123 rhoName_(ptf.rhoName_),
124 rhoOutlet_(ptf.rhoOutlet_)
136 flowRate_(ptf.flowRate_.clone()),
137 volumetric_(ptf.volumetric_),
138 rhoName_(ptf.rhoName_),
139 rhoOutlet_(ptf.rhoOutlet_)
145 template<
class RhoType>
146 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
151 const scalar t = db().time().timeOutputValue();
165 nUp =
max(nUp, scalar(0));
167 const scalar flowRate = flowRate_->value(t);
168 const scalar estimatedFlowRate =
gSum(
rho*(this->
patch().magSf()*nUp));
170 if (estimatedFlowRate > 0.5*flowRate)
172 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
176 nUp += ((flowRate - estimatedFlowRate)/
gSum(
rho*
patch().magSf()));
194 if (volumetric_ || rhoName_ ==
"none")
201 if (db().foundObject<volScalarField>(rhoName_))
214 <<
"Did not find registered density field " << rhoName_
215 <<
" and no constant density 'rhoOutlet' specified"
219 updateValues(rhoOutlet_);
223 fixedValueFvPatchVectorField::updateCoeffs();
230 flowRate_->writeData(
os);
236 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.
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.
Velocity outlet boundary condition which corrects the extrapolated velocity to match the specified fl...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
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.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
flowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#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)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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.
virtual void write(Ostream &) const
Write.
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)
String evaluation with specified (positive, non-zero) field width.