Go to the documentation of this file.
60 rhoOutlet_(
dict.getOrDefault<scalar>(
"rhoOutlet", -VGREAT))
62 if (
dict.found(
"volumetricFlowRate"))
68 else if (
dict.found(
"massFlowRate"))
72 rhoName_ =
dict.getOrDefault<
word>(
"rho",
"rho");
77 <<
"Please supply either 'volumetricFlowRate' or"
82 if (
dict.found(
"value"))
91 evaluate(Pstream::commsTypes::blocking);
106 flowRate_(ptf.flowRate_.clone()),
107 volumetric_(ptf.volumetric_),
108 rhoName_(ptf.rhoName_),
109 rhoOutlet_(ptf.rhoOutlet_)
120 flowRate_(ptf.flowRate_.clone()),
121 volumetric_(ptf.volumetric_),
122 rhoName_(ptf.rhoName_),
123 rhoOutlet_(ptf.rhoOutlet_)
135 flowRate_(ptf.flowRate_.clone()),
136 volumetric_(ptf.volumetric_),
137 rhoName_(ptf.rhoName_),
138 rhoOutlet_(ptf.rhoOutlet_)
144 template<
class RhoType>
145 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
150 const scalar t = db().time().timeOutputValue();
164 nUp =
max(nUp, scalar(0));
166 const scalar flowRate = flowRate_->value(t);
167 const scalar estimatedFlowRate =
gSum(
rho*(this->
patch().magSf()*nUp));
169 if (estimatedFlowRate/flowRate > 0.5)
171 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
175 nUp += ((flowRate - estimatedFlowRate)/
gSum(
rho*
patch().magSf()));
193 if (volumetric_ || rhoName_ ==
"none")
200 if (db().foundObject<volScalarField>(rhoName_))
213 <<
"Did not find registered density field " << rhoName_
214 <<
" and no constant density 'rhoOutlet' specified"
218 updateValues(rhoOutlet_);
222 fixedValueFvPatchVectorField::updateCoeffs();
229 flowRate_->writeData(os);
235 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,...
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.
string evaluate(const std::string &s, size_t pos=0, size_t len=std::string::npos)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...