38Foam::swirlFlowRateInletVelocityFvPatchVectorField::
39swirlFlowRateInletVelocityFvPatchVectorField
55Foam::swirlFlowRateInletVelocityFvPatchVectorField::
56swirlFlowRateInletVelocityFvPatchVectorField
64 phiName_(
dict.getOrDefault<
word>(
"phi",
"phi")),
65 rhoName_(
dict.getOrDefault<
word>(
"rho",
"rho")),
72 ?
gSum(patch().Cf()*patch().magSf())/
gSum(patch().magSf())
82 ? -
gSum(patch().Sf())/
gSum(patch().magSf())
91Foam::swirlFlowRateInletVelocityFvPatchVectorField::
92swirlFlowRateInletVelocityFvPatchVectorField
101 phiName_(ptf.phiName_),
102 rhoName_(ptf.rhoName_),
103 origin_(ptf.origin_),
105 flowRate_(ptf.flowRate_.clone()),
106 rpm_(ptf.rpm_.clone())
110Foam::swirlFlowRateInletVelocityFvPatchVectorField::
111swirlFlowRateInletVelocityFvPatchVectorField
117 phiName_(ptf.phiName_),
118 rhoName_(ptf.rhoName_),
119 origin_(ptf.origin_),
121 flowRate_(ptf.flowRate_.clone()),
122 rpm_(ptf.rpm_.clone())
126Foam::swirlFlowRateInletVelocityFvPatchVectorField::
127swirlFlowRateInletVelocityFvPatchVectorField
134 phiName_(ptf.phiName_),
135 rhoName_(ptf.rhoName_),
136 origin_(ptf.origin_),
138 flowRate_(ptf.flowRate_.clone()),
139 rpm_(ptf.rpm_.clone())
151 const scalar totArea =
gSum(patch().magSf());
153 if (totArea > ROOTVSMALL && axis_ !=
vector(
Zero))
155 const scalar t = this->db().time().timeOutputValue();
156 const scalar flowRate = flowRate_->value(t);
157 const scalar omega =
rpmToRads(rpm_->value(t));
159 const scalar avgU = -flowRate/totArea;
166 axisHat ^ omega*(patch().Cf() - origin_)
190 <<
"dimensions of " << phiName_ <<
" are incorrect" <<
nl
191 <<
" on patch " << this->patch().name()
192 <<
" of field " << this->internalField().name()
193 <<
" in file " << this->internalField().objectPath()
212 flowRate_->writeData(
os);
214 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...
const dimensionSet & dimensions() const
Return dimensions.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
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.
This boundary condition provides a volumetric- OR mass-flow normal vector boundary condition by its m...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Type gSum(const FieldField< Field, Type > &f)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
constexpr scalar rpmToRads() noexcept
Multiplication factor for revolutions/minute to radians/sec.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
const dimensionSet dimDensity
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
Unit conversion functions.