34 template<
class RhoFieldType>
37 const RhoFieldType& rho,
41 const bool divideVolume,
50 scalar AOAmin = great;
51 scalar AOAmax = -great;
56 if (area_[i] > rootVSmall)
58 const label celli = cells_[i];
60 const scalar radius = x_[i].x();
63 vector Uc = cylindrical_->invTransform(U[celli], i);
75 Uc.y() = radius*omega_ - Uc.y();
84 blade_.interpolate(radius, twist, chord, i1, i2, invDr);
86 const scalar alphaGeom = thetag[i] + twist;
89 const int rotationSign =
sign(omega_);
90 const scalar alphaEff =
91 alphaGeom -
atan2(-Uc.z(), rotationSign*Uc.y());
93 AOAmin =
min(AOAmin, alphaEff);
94 AOAmax =
max(AOAmax, alphaEff);
97 const label profile1 = blade_.profileID()[i1];
98 const label profile2 = blade_.profileID()[i2];
102 profiles_[profile1].Cdl(alphaEff, Cd1, Cl1);
106 profiles_[profile2].Cdl(alphaEff, Cd2, Cl2);
108 const scalar Cd = invDr*(Cd2 - Cd1) + Cd1;
109 const scalar Cl = invDr*(Cl2 - Cl1) + Cl1;
112 const scalar tipFactor =
neg(radius/rMax_ - tipEffect_);
115 const scalar
pDyn = 0.5*rho[celli]*
magSqr(Uc);
120 vector localForce =
vector(0, rotationSign*-f*Cd, tipFactor*f*Cl);
123 dragEff += rhoRef_*localForce.
y();
124 liftEff += rhoRef_*localForce.
z();
125 powerEff += rhoRef_*localForce.
y()*radius*omega_;
128 localForce = invR_[i] & localForce;
131 force[celli] = cylindrical_->transform(localForce, i);
135 force[celli] /= V[celli];
148 <<
" min/max(AOA) = " <<
radToDeg(AOAmin) <<
", " 150 <<
" Effective power = " << powerEff <<
nl 151 <<
" Effective drag = " << dragEff <<
nl 152 <<
" Effective lift = " << liftEff <<
endl;
167 if (mesh_.time().writeTime() || writeNow)
176 mesh_.time().timeName(),
188 if (cells_.size() != values.
size())
195 const label celli = cells_[i];
196 field[celli] = values[i];
dimensionedScalar sign(const dimensionedScalar &ds)
#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.
T & ref() const
Return non-const reference or generate a fatal error.
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.
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimPressure, 0))
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)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
void writeField(const word &name, const List< Type > &values, const bool writeNow=false) const
Helper function to write rotor values.
void calculate(const RhoFieldType &rho, const vectorField &U, const scalarField &thetag, vectorField &force, const bool divideVolume=true, const bool output=true) const
Calculate forces.
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...