42 rhoOutlet_(
dict.lookupOrDefault<scalar>(
"rhoOutlet", -vGreat))
44 if (
dict.found(
"volumetricFlowRate"))
50 else if (
dict.found(
"massFlowRate"))
54 rhoName_ =
word(
dict.lookupOrDefault<
word>(
"rho",
"rho"));
61 ) <<
"Please supply either 'volumetricFlowRate' or"
66 if (
dict.found(
"value"))
90 flowRate_(ptf.flowRate_, false),
91 volumetric_(ptf.volumetric_),
92 rhoName_(ptf.rhoName_),
93 rhoOutlet_(ptf.rhoOutlet_)
105 flowRate_(ptf.flowRate_, false),
106 volumetric_(ptf.volumetric_),
107 rhoName_(ptf.rhoName_),
108 rhoOutlet_(ptf.rhoOutlet_)
114 template<
class RhoType>
115 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
120 const scalar t = db().time().userTimeValue();
134 nUp =
max(nUp, scalar(0));
136 const scalar flowRate = flowRate_->value(t);
137 const scalar estimatedFlowRate =
gSum(
rho*(this->patch().magSf()*nUp));
139 if (estimatedFlowRate/flowRate > 0.5)
141 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
145 nUp += ((flowRate - estimatedFlowRate)/
gSum(
rho*patch().magSf()));
163 if (volumetric_ || rhoName_ ==
"none")
170 if (db().foundObject<volScalarField>(rhoName_))
183 <<
"Did not find registered density field " << rhoName_
184 <<
" and no constant density 'rhoOutlet' specified"
188 updateValues(rhoOutlet_);
192 fixedValueFvPatchVectorField::updateCoeffs();
202 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
203 writeEntryIfDifferent<scalar>(os,
"rhoOutlet", -vGreat, rhoOutlet_);
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static autoPtr< Function1< Type > > New(const word &name, const dictionary &dict)
Selector.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Velocity outlet boundary condition which corrects the extrapolated velocity to match the specified fl...
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
flowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(const FieldField< Field, Type > &f)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
VolField< scalar > volScalarField
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Field< vector > vectorField
Specialisation of Field<T> for vector.
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)