Go to the documentation of this file.
49 extrapolateProfile_(false)
63 rhoInlet_(
dict.getOrDefault<scalar>(
"rhoInlet", -VGREAT)),
67 dict.getOrDefault<
Switch>(
"extrapolateProfile", false)
70 if (
dict.found(
"volumetricFlowRate"))
76 else if (
dict.found(
"massFlowRate"))
79 flowRate_ = Function1<scalar>::New(
"massFlowRate",
dict, &db());
80 rhoName_ =
dict.getOrDefault<word>(
"rho",
"rho");
85 <<
"Please supply either 'volumetricFlowRate' or"
86 <<
" 'massFlowRate' and 'rho'" <<
nl
91 if (
dict.found(
"value"))
108 const flowRateInletVelocityFvPatchVectorField& ptf,
110 const DimensionedField<vector, volMesh>& iF,
111 const fvPatchFieldMapper& mapper
114 fixedValueFvPatchField<
vector>(ptf,
p, iF, mapper),
115 flowRate_(ptf.flowRate_.clone()),
116 rhoName_(ptf.rhoName_),
117 rhoInlet_(ptf.rhoInlet_),
118 volumetric_(ptf.volumetric_),
119 extrapolateProfile_(ptf.extrapolateProfile_)
130 flowRate_(ptf.flowRate_.clone()),
131 rhoName_(ptf.rhoName_),
132 rhoInlet_(ptf.rhoInlet_),
133 volumetric_(ptf.volumetric_),
134 extrapolateProfile_(ptf.extrapolateProfile_)
146 flowRate_(ptf.flowRate_.clone()),
147 rhoName_(ptf.rhoName_),
148 rhoInlet_(ptf.rhoInlet_),
149 volumetric_(ptf.volumetric_),
150 extrapolateProfile_(ptf.extrapolateProfile_)
156 template<
class RhoType>
157 void Foam::flowRateInletVelocityFvPatchVectorField::updateValues
162 const scalar t = db().time().timeOutputValue();
166 if (extrapolateProfile_)
177 nUp =
min(nUp, scalar(0));
179 const scalar flowRate = flowRate_->value(t);
180 const scalar estimatedFlowRate = -
gSum(
rho*(this->
patch().magSf()*nUp));
182 if (estimatedFlowRate > 0.5*flowRate)
184 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
188 nUp -= ((flowRate - estimatedFlowRate)/
gSum(
rho*
patch().magSf()));
199 const scalar avgU = -flowRate_->value(t)/
gSum(
rho*
patch().magSf());
212 if (volumetric_ || rhoName_ ==
"none")
219 if (db().foundObject<volScalarField>(rhoName_))
221 const fvPatchField<scalar>& rhop =
232 <<
"Did not find registered density field " << rhoName_
233 <<
" and no constant density 'rhoInlet' specified"
237 updateValues(rhoInlet_);
241 fixedValueFvPatchVectorField::updateCoeffs();
248 flowRate_->writeData(
os);
254 if (extrapolateProfile_)
256 os.
writeEntry(
"extrapolateProfile", extrapolateProfile_);
258 writeEntry(
"value",
os);
269 flowRateInletVelocityFvPatchVectorField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
virtual void write(Ostream &) const
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A class for handling words, derived from Foam::string.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
Type gSum(const FieldField< Field, Type > &f)
label min(const labelHashSet &set, label minValue=labelMax)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Field< vector > vectorField
Specialisation of Field<T> for vector.
Generic templated field type.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
flowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
Vector< scalar > vector
A scalar version of the templated Vector.
virtual void updateCoeffs()
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Velocity inlet boundary condition either correcting the extrapolated velocity or creating a uniform v...
fvPatchField< vector > fvPatchVectorField
#define FatalErrorInFunction
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Ostream & writeEntry(const keyType &key, const T &value)
#define FatalIOErrorInFunction(ios)
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)