32 template<
class RhoType>
33 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
50 nUp =
max(nUp, scalar(0));
52 const scalar flowRate = flowRate_->value(db().time().value());
53 const scalar estimatedFlowRate =
gSum(
rho*(this->patch().magSf()*nUp));
55 if (estimatedFlowRate/flowRate > 0.5)
57 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
61 nUp += ((flowRate - estimatedFlowRate)/
gSum(
rho*patch().magSf()));
86 rhoOutlet_(
dict.lookupOrDefault<scalar>(
"rhoOutlet",
dimDensity, -vGreat))
88 if (
dict.found(
"volumetricFlowRate"))
94 db().time().userUnits(),
100 else if (
dict.found(
"massFlowRate"))
106 db().time().userUnits(),
111 rhoName_ =
word(
dict.lookupOrDefault<
word>(
"rho",
"rho"));
116 <<
"Please supply either 'volumetricFlowRate' or"
121 if (
dict.found(
"value"))
145 flowRate_(ptf.flowRate_, false),
146 volumetric_(ptf.volumetric_),
147 rhoName_(ptf.rhoName_),
148 rhoOutlet_(ptf.rhoOutlet_)
160 flowRate_(ptf.flowRate_, false),
161 volumetric_(ptf.volumetric_),
162 rhoName_(ptf.rhoName_),
163 rhoOutlet_(ptf.rhoOutlet_)
176 if (volumetric_ || rhoName_ ==
"none")
183 if (db().foundObject<volScalarField>(rhoName_))
196 <<
"Did not find registered density field " << rhoName_
197 <<
" and no constant density 'rhoOutlet' specified"
201 updateValues(rhoOutlet_);
205 fixedValueFvPatchVectorField::updateCoeffs();
215 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
216 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...
const dimensionSet & dimensions() const
Return dimensions.
static autoPtr< Function1< Type > > New(const word &name, const Function1s::unitConversions &units, const dictionary &dict)
Select from dictionary.
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....
Abstract base class for field mapping.
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.
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)
const unitConversion unitAny
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
const dimensionSet dimMassFlux
const dimensionSet dimVolumetricFlux
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
const dimensionSet dimDensity
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)