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_)
120 flowRate_(ptf.flowRate_,
false),
121 volumetric_(ptf.volumetric_),
122 rhoName_(ptf.rhoName_),
123 rhoOutlet_(ptf.rhoOutlet_)
129 template<
class RhoType>
130 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
135 const scalar t = db().time().timeOutputValue();
149 nUp =
max(nUp, scalar(0));
151 const scalar flowRate = flowRate_->
value(t);
152 const scalar estimatedFlowRate =
gSum(rho*(this->patch().magSf()*nUp));
154 if (estimatedFlowRate/flowRate > 0.5)
156 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
160 nUp += ((flowRate - estimatedFlowRate)/
gSum(rho*patch().magSf()));
178 if (volumetric_ || rhoName_ ==
"none")
185 if (db().foundObject<volScalarField>(rhoName_))
198 <<
"Did not find registered density field " << rhoName_
199 <<
" and no constant density 'rhoOutlet' specified" 203 updateValues(rhoOutlet_);
207 fixedValueFvPatchVectorField::updateCoeffs();
217 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
218 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)
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
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.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Type gSum(const FieldField< Field, Type > &f)
virtual Type value(const scalar x) const =0
Return value as a function of scalar x.
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
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...