37template<
class RhoFieldType>
40 const RhoFieldType&
rho,
44 const bool divideVolume,
53 scalar AOAmin = GREAT;
54 scalar AOAmax = -GREAT;
57 const bool hasCache = bool(
Rcyl_);
61 if (
area_[i] > ROOTVSMALL)
63 const label celli =
cells_[i];
65 const scalar radius =
x_[i].x();
93 blade_.interpolate(radius, twist, chord, i1, i2, invDr);
96 scalar alphaGeom = thetag[i] + twist;
117 const label profile1 =
blade_.profileID()[i1];
118 const label profile2 =
blade_.profileID()[i2];
128 scalar Cd = invDr*(Cd2 - Cd1) + Cd1;
129 scalar Cl = invDr*(Cl2 - Cl1) + Cl1;
148 force[celli] =
transform(Rcyl, localForce);
152 force[celli] /=
V[celli];
165 <<
" min/max(AOA) = " <<
radToDeg(AOAmin) <<
", "
167 <<
" Effective drag = " << dragEff <<
nl
168 <<
" Effective lift = " << liftEff <<
endl;
181 if (mesh_.time().writeTime() || writeNow)
183 if (cells_.size() != values.size())
186 <<
"Size mismatch. Number of cells "
187 << cells_.size() <<
" != number of values "
188 << values.size() <<
nl
200 auto&
field = tfield.ref().primitiveFieldRef();
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
@ NO_REGISTER
Do not request registration (bool: false).
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A List with indirect addressing. Like IndirectList but does not store addressing.
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
Generic dimensioned Type class.
scalar V() const noexcept
Return const access to the total cell volume.
labelList cells_
Set of cells to apply source to.
const word & name() const noexcept
Return const access to the source name.
const fvMesh & mesh_
Reference to the mesh database.
scalar omega_
Rotational speed [rad/s].
void calculate(const RhoFieldType &rho, const vectorField &U, const scalarField &thetag, vectorField &force, const bool divideVolume=true, const bool output=true) const
Calculate forces.
scalar rhoRef_
Reference density for incompressible case.
List< scalar > area_
Area [m2].
scalar tipEffect_
Tip effect [0-1].
void writeField(const word &name, const List< Type > &values, const bool writeNow=false) const
Helper function to write rotor values.
coordSystem::cylindrical coordSys_
Rotor local cylindrical coordinate system (r-theta-z).
scalar rMax_
Maximum radius.
List< point > x_
Cell centre positions in local rotor frame.
bladeModel blade_
Blade data.
List< tensor > Rcone_
Rotation tensor for flap angle.
label nBlades_
Number of blades.
autoPtr< tensorField > Rcyl_
Cached rotation tensors for cylindrical coordinates.
profileModelList profiles_
Profile data.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
constexpr scalar pi(M_PI)
constexpr scalar twoPi(2 *M_PI)
Different types of constants.
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar radToDeg() noexcept
Multiplication factor for radians to degrees conversion.
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensionedScalar neg(const dimensionedScalar &ds)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a).
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimPressure, Zero))
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.