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;
100 AOAmin =
min(AOAmin, alphaEff);
101 AOAmax =
max(AOAmax, alphaEff);
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().writeTime() || writeNow)
179 mesh_.time().timeName(),
191 if (cells_.size() != values.
size())
199 const label celli = cells_[i];
200 field[celli] = values[i];
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Unit conversion functions.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic GeometricField class.
Vector< scalar > vector
A scalar version of the templated Vector.
Generic dimensioned Type class.
dimensionedScalar neg(const dimensionedScalar &ds)
A class for handling words, derived from string.
errorManip< error > abort(error &err)
const scalar twoPi(2 *pi)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void calculate(const RhoFieldType &rho, const vectorField &U, const scalarField &thetag, vectorField &force, const bool divideVolume=true, const bool output=true) const
Calculate forces.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimPressure, 0.0))
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void writeField(const word &name, const List< Type > &values, const bool writeNow=false) const
Helper function to write rotor values.