62 rhoOutlet_(
dict.getOrDefault<scalar>(
"rhoOutlet", -VGREAT)),
74 dict.readIfPresent(
"rho", rhoName_);
82 <<
"Please supply either 'volumetricFlowRate' or" 83 <<
" 'massFlowRate' (optional: with 'rho')" <<
nl 88 if (!this->readValueEntry(
dict))
98 const flowRateOutletVelocityFvPatchVectorField& ptf,
100 const DimensionedField<vector, volMesh>& iF,
101 const fvPatchFieldMapper& mapper
104 fixedValueFvPatchField<
vector>(ptf,
p, iF, mapper),
105 flowRate_(ptf.flowRate_.clone()),
106 rhoName_(ptf.rhoName_),
107 rhoOutlet_(ptf.rhoOutlet_),
108 volumetric_(ptf.volumetric_)
119 flowRate_(ptf.flowRate_.clone()),
120 rhoName_(ptf.rhoName_),
121 rhoOutlet_(ptf.rhoOutlet_),
122 volumetric_(ptf.volumetric_)
134 flowRate_(ptf.flowRate_.clone()),
135 rhoName_(ptf.rhoName_),
136 rhoOutlet_(ptf.rhoOutlet_),
137 volumetric_(ptf.volumetric_)
143 template<
class RhoType>
144 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
149 const scalar t = db().time().timeOutputValue();
163 nUp =
max(nUp, scalar(0));
165 const scalar flowRate = flowRate_->value(t);
166 const scalar estimatedFlowRate =
gSum(
rho*(this->
patch().magSf()*nUp));
168 if (estimatedFlowRate > 0.5*flowRate)
170 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
174 nUp += ((flowRate - estimatedFlowRate)/
gSum(
rho*
patch().magSf()));
192 if (volumetric_ || rhoName_ ==
"none")
199 if (db().foundObject<volScalarField>(rhoName_))
212 <<
"Did not find registered density field " << rhoName_
213 <<
" and no constant density 'rhoOutlet' specified" 217 updateValues(rhoOutlet_);
221 fixedValueFvPatchVectorField::updateCoeffs();
228 flowRate_->writeData(
os);
245 flowRateOutletVelocityFvPatchVectorField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fvPatchField< vector > fvPatchVectorField
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
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 void write(Ostream &) const
Write.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
static autoPtr< Function1< Type > > NewIfPresent(const word &entryName, const dictionary &dict, const word &redirectType, const objectRegistry *obrPtr=nullptr)
An optional selector, with fallback redirection.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
Velocity outlet boundary condition which corrects the extrapolated velocity to match the specified fl...
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
"buffered" : (MPI_Bsend, MPI_Recv)
flowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...