45 extrapolateProfile_(
false)
64 if (dict.
found(
"volumetricFlowRate"))
70 else if (dict.
found(
"massFlowRate"))
81 ) <<
"Please supply either 'volumetricFlowRate' or" 86 if (dict.
found(
"value"))
95 evaluate(Pstream::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_)
165 scalar flowRate = flowRate_->value(t);
166 scalar estimatedFlowRate = -
gSum(rho*(this->patch().Sf() & newValues));
168 if (estimatedFlowRate/flowRate > 0.5)
170 newValues *= (
mag(flowRate)/
mag(estimatedFlowRate));
175 ((flowRate - estimatedFlowRate)/
gSum(rho*patch().magSf()))*
n;
182 const scalar avgU = -flowRate_->value(t)/
gSum(rho*patch().magSf());
195 if (volumetric_ || rhoName_ ==
"none")
202 if (db().foundObject<volScalarField>(rhoName_))
215 <<
"Did not find registered density field " << rhoName_
216 <<
" and no constant density 'rhoInlet' specified" 220 updateValues(rhoInlet_);
224 fixedValueFvPatchVectorField::updateCoeffs();
231 flowRate_->writeData(os);
234 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
235 writeEntryIfDifferent<scalar>(os,
"rhoInlet", -VGREAT, rhoInlet_);
239 writeEntry(
"value", os);
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.
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.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
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.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
This boundary condition provides a velocity boundary condition, derived from the flux (volumetric or ...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
#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 > &)
A class for managing temporary objects.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual void write(Ostream &) const
Write.
A class representing the concept of 1 (scalar(1.0)) used to avoid unnecessary manipulations for objec...