60 rhoOutlet_(
dict.getOrDefault<scalar>(
"rhoOutlet", -VGREAT))
62 if (
dict.found(
"volumetricFlowRate"))
69 else if (
dict.found(
"massFlowRate"))
72 flowRate_ = Function1<scalar>::New(
"massFlowRate",
dict, &db());
73 rhoName_ =
dict.getOrDefault<word>(
"rho",
"rho");
78 <<
"Please supply either 'volumetricFlowRate' or" 83 if (
dict.found(
"value"))
100 const flowRateOutletVelocityFvPatchVectorField& ptf,
102 const DimensionedField<vector, volMesh>& iF,
103 const fvPatchFieldMapper& mapper
106 fixedValueFvPatchField<
vector>(ptf,
p, iF, mapper),
107 flowRate_(ptf.flowRate_.clone()),
108 volumetric_(ptf.volumetric_),
109 rhoName_(ptf.rhoName_),
110 rhoOutlet_(ptf.rhoOutlet_)
121 flowRate_(ptf.flowRate_.clone()),
122 volumetric_(ptf.volumetric_),
123 rhoName_(ptf.rhoName_),
124 rhoOutlet_(ptf.rhoOutlet_)
136 flowRate_(ptf.flowRate_.clone()),
137 volumetric_(ptf.volumetric_),
138 rhoName_(ptf.rhoName_),
139 rhoOutlet_(ptf.rhoOutlet_)
145 template<
class RhoType>
146 void Foam::flowRateOutletVelocityFvPatchVectorField::updateValues
151 const scalar t = db().time().timeOutputValue();
165 nUp =
max(nUp, scalar(0));
167 const scalar flowRate = flowRate_->value(t);
168 const scalar estimatedFlowRate =
gSum(
rho*(this->
patch().magSf()*nUp));
170 if (estimatedFlowRate > 0.5*flowRate)
172 nUp *= (
mag(flowRate)/
mag(estimatedFlowRate));
176 nUp += ((flowRate - estimatedFlowRate)/
gSum(
rho*
patch().magSf()));
194 if (volumetric_ || rhoName_ ==
"none")
201 if (db().foundObject<volScalarField>(rhoName_))
203 const fvPatchField<scalar>& rhop =
214 <<
"Did not find registered density field " << rhoName_
215 <<
" and no constant density 'rhoOutlet' specified" 219 updateValues(rhoOutlet_);
223 fixedValueFvPatchVectorField::updateCoeffs();
230 flowRate_->writeData(
os);
236 writeEntry(
"value",
os);
247 flowRateOutletVelocityFvPatchVectorField
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...
"blocking" : (MPI_Bsend, MPI_Recv)
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.
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
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)
#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...
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 > &)
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 ...