57 rhoOutlet_(dict.lookupOrDefault<scalar>(
"rhoOutlet", -vGreat))
59 if (dict.found(
"volumetricFlowRate"))
65 else if (dict.found(
"massFlowRate"))
69 rhoName_ =
word(dict.lookupOrDefault<
word>(
"rho",
"rho"));
76 ) <<
"Please supply either 'volumetricFlowRate' or" 81 if (dict.found(
"value"))
90 evaluate(Pstream::commsTypes::blocking);
105 flowRate_(ptf.flowRate_,
false),
106 volumetric_(ptf.volumetric_),
107 rhoName_(ptf.rhoName_),
108 rhoOutlet_(ptf.rhoOutlet_)
119 flowRate_(ptf.flowRate_,
false),
120 volumetric_(ptf.volumetric_),
121 rhoName_(ptf.rhoName_),
122 rhoOutlet_(ptf.rhoOutlet_)
134 flowRate_(ptf.flowRate_,
false),
135 volumetric_(ptf.volumetric_),
136 rhoName_(ptf.rhoName_),
137 rhoOutlet_(ptf.rhoOutlet_)
143 template<
class RhoType>
144 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
149 const scalar t = db().time().timeOutputValue();
163 nUp =
max(nUp, scalar(0));
165 const scalar flowRate = flowRate_->value(t);
166 const scalar estimatedFlowRate =
gSum(rho*(this->patch().magSf()*nUp));
168 if (estimatedFlowRate/flowRate > 0.5)
170 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
174 nUp += ((flowRate - estimatedFlowRate)/
gSum(rho*patch().magSf()));
192 if (volumetric_ || rhoName_ ==
"none")
199 if (db().foundObject<volScalarField>(rhoName_))
212 <<
"Did not find registered density field " << rhoName_
213 <<
" and no constant density 'rhoOutlet' specified" 217 updateValues(rhoOutlet_);
221 fixedValueFvPatchVectorField::updateCoeffs();
231 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
232 writeEntryIfDifferent<scalar>(os,
"rhoOutlet", -vGreat, rhoOutlet_);
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
volVectorField vectorField(fieldObject, mesh)
virtual void write(Ostream &) const
Write.
Macros for easy insertion into run-time selection tables.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Type gSum(const FieldField< Field, Type > &f)
virtual void write(Ostream &) const
Write.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
Velocity outlet boundary condition which corrects the extrapolated velocity to match the specified fl...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
flowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...