Go to the documentation of this file.
34 template<
class RhoFieldType>
37 const RhoFieldType&
rho,
41 const bool divideVolume,
50 scalar AOAmin = GREAT;
51 scalar AOAmax = -GREAT;
55 if (area_[i] > ROOTVSMALL)
57 const label cellI = cells_[i];
59 const scalar radius = x_[i].x();
62 vector Uc = cylindrical_->invTransform(
U[cellI], i);
71 Uc.y() = radius*omega_ - Uc.y();
80 blade_.interpolate(radius, twist, chord, i1, i2, invDr);
83 scalar alphaGeom = thetag[i] + twist;
104 const label profile1 = blade_.profileID()[i1];
105 const label profile2 = blade_.profileID()[i2];
109 profiles_[profile1].Cdl(
alphaEff, Cd1, Cl1);
113 profiles_[profile2].Cdl(
alphaEff, Cd2, Cl2);
115 scalar Cd = invDr*(Cd2 - Cd1) + Cd1;
116 scalar Cl = invDr*(Cl2 - Cl1) + Cl1;
119 scalar tipFactor =
neg(radius/rMax_ - tipEffect_);
128 dragEff += rhoRef_*localForce.
y();
129 liftEff += rhoRef_*localForce.
z();
132 localForce = invR_[i] & localForce;
135 force[cellI] = cylindrical_->transform(localForce, i);
139 force[cellI] /= V[cellI];
152 <<
" min/max(AOA) = " <<
radToDeg(AOAmin) <<
", "
154 <<
" Effective drag = " << dragEff <<
nl
155 <<
" Effective lift = " << liftEff <<
endl;
170 if (mesh_.time().outputTime() || writeNow)
179 mesh_.time().timeName(),
191 if (cells_.size() != values.
size())
199 const label cellI = cells_[i];
200 field[cellI] = values[i];
void calculate(const RhoFieldType &rho, const vectorField &U, const scalarField &thetag, vectorField &force, const bool divideVolume=true, const bool output=true) const
Calculate forces.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
A class for handling words, derived from string.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
Unit conversion functions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const scalar twoPi(2 *pi)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimPressure, 0.0))
void writeField(const word &name, const List< Type > &values, const bool writeNow=false) const
Helper function to write rotor values.
errorManip< error > abort(error &err)
Vector< scalar > vector
A scalar version of the templated Vector.
const volScalarField & alphaEff
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Traits class for primitives.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
void size(const label)
Override size to be inconsistent with allocated storage.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Generic GeometricField class.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedScalar neg(const dimensionedScalar &ds)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.