32 template<
class RhoType>
33 void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateValues
38 const scalar t = db().time().value();
49 const scalar axialVelocity = flowRate_->value(t)/
gSum(
rho*patch().magSf());
50 const scalarField radialVelocity(radialVelocity_->value(ts, magR));
51 tmp<scalarField> tangentialVelocity;
54 tangentialVelocity = omega_->value(t)*magR;
58 tangentialVelocity = tangentialVelocity_->value(ts, magR);
66 + tangentialVelocity*(axisHat ^ rHat)
89 ?
gSum(patch().Cf()*patch().magSf())/
gSum(patch().magSf())
100 ? -
gSum(patch().Sf())/
gSum(patch().magSf())
107 rhoInlet_(
dict.lookupOrDefault<scalar>(
"rhoInlet",
dimDensity, -vGreat)),
113 db().time().userUnits(),
120 tangentialVelocity_(nullptr)
122 if (
dict.found(
"volumetricFlowRate"))
127 "volumetricFlowRate",
128 db().time().userUnits(),
134 else if (
dict.found(
"massFlowRate"))
140 db().time().userUnits(),
145 rhoName_ =
word(
dict.lookupOrDefault<
word>(
"rho",
"rho"));
150 <<
"Please supply either 'volumetricFlowRate' or"
154 if (
dict.found(
"omega") ||
dict.found(
"rpm"))
158 else if (
dict.found(
"tangentialVelocity"))
160 tangentialVelocity_ =
163 "tangentialVelocity",
164 db().time().userUnits(),
173 <<
"Please supply either 'omega' or 'rpm' or"
177 if (
dict.found(
"value"))
201 origin_(ptf.origin_),
203 flowRate_(ptf.flowRate_, false),
204 volumetric_(ptf.volumetric_),
205 rhoName_(ptf.rhoName_),
206 rhoInlet_(ptf.rhoInlet_),
207 radialVelocity_(ptf.radialVelocity_, false),
208 omega_(ptf.omega_, false),
209 tangentialVelocity_(ptf.tangentialVelocity_, false)
221 origin_(ptf.origin_),
223 flowRate_(ptf.flowRate_, false),
224 volumetric_(ptf.volumetric_),
225 rhoName_(ptf.rhoName_),
226 rhoInlet_(ptf.rhoInlet_),
227 radialVelocity_(ptf.radialVelocity_, false),
228 omega_(ptf.omega_, false),
229 tangentialVelocity_(ptf.tangentialVelocity_, false)
242 if (volumetric_ || rhoName_ ==
"none")
249 if (db().foundObject<volScalarField>(rhoName_))
262 <<
"Did not find registered density field " << rhoName_
263 <<
" and no constant density 'rhoInlet' specified"
267 updateValues(rhoInlet_);
286 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
287 writeEntryIfDifferent<scalar>(os,
"rhoInlet", -vGreat, rhoInlet_);
292 db().time().userUnits(),
306 db().time().userUnits(),
309 tangentialVelocity_()
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...
const dimensionSet & dimensions() const
Return dimensions.
static autoPtr< Function1< Type > > New(const word &name, const Function1s::unitConversions &units, const dictionary &dict)
Select from dictionary.
Run-time selectable function of two variables.
static autoPtr< Function2< Type > > New(const word &name, const Function2s::unitConversions &units, const dictionary &dict)
Select from dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for field mapping.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
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 updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...
Velocity inlet boundary condition creating a normal velocity field to match the specified mass or vol...
swirlFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(const FieldField< Field, Type > &f)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const unitConversion unitAny
const dimensionSet dimMassFlux
const dimensionSet dimVolumetricFlux
const dimensionSet dimless
const dimensionSet dimLength
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Vector< scalar > vector
A scalar version of the templated Vector.
const dimensionSet dimDensity
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
VolField< scalar > volScalarField
dimensionSet normalised(const dimensionSet &)
dimensioned< scalar > mag(const dimensioned< Type > &)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const dimensionSet dimVelocity
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)