45 extrapolateProfile_(
false)
58 rhoInlet_(dict.lookupOrDefault<scalar>(
"rhoInlet", -vGreat)),
61 dict.lookupOrDefault<
Switch>(
"extrapolateProfile",
false)
64 if (dict.found(
"volumetricFlowRate"))
70 else if (dict.found(
"massFlowRate"))
74 rhoName_ =
word(dict.lookupOrDefault<
word>(
"rho",
"rho"));
81 ) <<
"Please supply either 'volumetricFlowRate' or" 86 if (dict.found(
"value"))
95 evaluate(Pstream::commsTypes::blocking);
110 flowRate_(ptf.flowRate_,
false),
111 volumetric_(ptf.volumetric_),
112 rhoName_(ptf.rhoName_),
113 rhoInlet_(ptf.rhoInlet_),
114 extrapolateProfile_(ptf.extrapolateProfile_)
125 flowRate_(ptf.flowRate_,
false),
126 volumetric_(ptf.volumetric_),
127 rhoName_(ptf.rhoName_),
128 rhoInlet_(ptf.rhoInlet_),
129 extrapolateProfile_(ptf.extrapolateProfile_)
141 flowRate_(ptf.flowRate_,
false),
142 volumetric_(ptf.volumetric_),
143 rhoName_(ptf.rhoName_),
144 rhoInlet_(ptf.rhoInlet_),
145 extrapolateProfile_(ptf.extrapolateProfile_)
151 template<
class RhoType>
152 void Foam::flowRateInletVelocityFvPatchVectorField::updateValues
157 const scalar t = db().time().timeOutputValue();
161 if (extrapolateProfile_)
172 nUp =
min(nUp, scalar(0));
174 const scalar flowRate = flowRate_->value(t);
175 const scalar estimatedFlowRate = -
gSum(rho*(this->patch().magSf()*nUp));
177 if (estimatedFlowRate/flowRate > 0.5)
179 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
183 nUp -= ((flowRate - estimatedFlowRate)/
gSum(rho*patch().magSf()));
194 const scalar avgU = -flowRate_->value(t)/
gSum(rho*patch().magSf());
207 if (volumetric_ || rhoName_ ==
"none")
214 if (db().foundObject<volScalarField>(rhoName_))
227 <<
"Did not find registered density field " << rhoName_
228 <<
" and no constant density 'rhoInlet' specified" 232 updateValues(rhoInlet_);
236 fixedValueFvPatchVectorField::updateCoeffs();
246 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
247 writeEntryIfDifferent<scalar>(os,
"rhoInlet", -vGreat, rhoInlet_);
249 writeEntry(os,
"extrapolateProfile", extrapolateProfile_);
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...
#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.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
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.
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)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
flowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Foam::fvPatchFieldMapper.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Velocity inlet boundary condition either correcting the extrapolated velocity or creating a uniform v...
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)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#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 > &)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...