36Foam::flowRateOutletVelocityFvPatchVectorField::
37flowRateOutletVelocityFvPatchVectorField
51Foam::flowRateOutletVelocityFvPatchVectorField::
52flowRateOutletVelocityFvPatchVectorField
60 rhoOutlet_(
dict.getOrDefault<scalar>(
"rhoOutlet", -VGREAT))
78 <<
"Please supply either 'volumetricFlowRate' or"
97Foam::flowRateOutletVelocityFvPatchVectorField::
98flowRateOutletVelocityFvPatchVectorField
107 flowRate_(ptf.flowRate_.clone()),
108 volumetric_(ptf.volumetric_),
109 rhoName_(ptf.rhoName_),
110 rhoOutlet_(ptf.rhoOutlet_)
114Foam::flowRateOutletVelocityFvPatchVectorField::
115flowRateOutletVelocityFvPatchVectorField
121 flowRate_(ptf.flowRate_.clone()),
122 volumetric_(ptf.volumetric_),
123 rhoName_(ptf.rhoName_),
124 rhoOutlet_(ptf.rhoOutlet_)
128Foam::flowRateOutletVelocityFvPatchVectorField::
129flowRateOutletVelocityFvPatchVectorField
136 flowRate_(ptf.flowRate_.clone()),
137 volumetric_(ptf.volumetric_),
138 rhoName_(ptf.rhoName_),
139 rhoOutlet_(ptf.rhoOutlet_)
145template<
class RhoType>
146void 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_))
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);
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Velocity outlet boundary condition which corrects the extrapolated velocity to match the specified fl...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)