Go to the documentation of this file.
48 extrapolateProfile_(
false)
62 rhoInlet_(
dict.getOrDefault<scalar>(
"rhoInlet", -VGREAT)),
66 dict.getOrDefault<
Switch>(
"extrapolateProfile",
false)
69 if (
dict.found(
"volumetricFlowRate"))
74 else if (
dict.found(
"massFlowRate"))
78 rhoName_ =
dict.getOrDefault<
word>(
"rho",
"rho");
83 <<
"Please supply either 'volumetricFlowRate' or"
84 <<
" 'massFlowRate' and 'rho'" <<
nl
89 if (
dict.found(
"value"))
98 evaluate(Pstream::commsTypes::blocking);
113 flowRate_(ptf.flowRate_.clone()),
114 rhoName_(ptf.rhoName_),
115 rhoInlet_(ptf.rhoInlet_),
116 volumetric_(ptf.volumetric_),
117 extrapolateProfile_(ptf.extrapolateProfile_)
128 flowRate_(ptf.flowRate_.clone()),
129 rhoName_(ptf.rhoName_),
130 rhoInlet_(ptf.rhoInlet_),
131 volumetric_(ptf.volumetric_),
132 extrapolateProfile_(ptf.extrapolateProfile_)
144 flowRate_(ptf.flowRate_.clone()),
145 rhoName_(ptf.rhoName_),
146 rhoInlet_(ptf.rhoInlet_),
147 volumetric_(ptf.volumetric_),
148 extrapolateProfile_(ptf.extrapolateProfile_)
154 template<
class RhoType>
155 void Foam::flowRateInletVelocityFvPatchVectorField::updateValues
160 const scalar t = db().time().timeOutputValue();
164 if (extrapolateProfile_)
175 nUp =
min(nUp, scalar(0));
177 const scalar flowRate = flowRate_->value(t);
178 const scalar estimatedFlowRate = -
gSum(
rho*(this->
patch().magSf()*nUp));
180 if (estimatedFlowRate/flowRate > 0.5)
182 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
186 nUp -= ((flowRate - estimatedFlowRate)/
gSum(
rho*
patch().magSf()));
197 const scalar avgU = -flowRate_->value(t)/
gSum(
rho*
patch().magSf());
210 if (volumetric_ || rhoName_ ==
"none")
217 if (db().foundObject<volScalarField>(rhoName_))
230 <<
"Did not find registered density field " << rhoName_
231 <<
" and no constant density 'rhoInlet' specified"
235 updateValues(rhoInlet_);
239 fixedValueFvPatchVectorField::updateCoeffs();
246 flowRate_->writeData(os);
252 os.
writeEntry(
"extrapolateProfile", extrapolateProfile_);
253 writeEntry(
"value", os);
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
virtual void write(Ostream &) const
Write.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
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...
Type gSum(const FieldField< Field, Type > &f)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
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.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
flowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
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,...
Macros for easy insertion into run-time selection tables.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
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)
Global function forwards to reuseTmpDimensionedField::New.
Velocity inlet boundary condition either correcting the extrapolated velocity or creating a uniform v...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
string evaluate(const std::string &s, size_t pos=0, size_t len=std::string::npos)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...