33 template<
class RhoFieldType>
36 const RhoFieldType&
rho,
40 const bool divideVolume,
49 scalar AOAmin = great;
50 scalar AOAmax = -great;
57 if (area_[i] > rootVSmall)
61 const scalar radius = x_[i].x();
64 vector Uc = cylindrical_->invTransform(
U[celli], i);
76 Uc.
y() = radius*omega_ - Uc.
y();
85 blade_.interpolate(radius, twist, chord, i1, i2, invDr);
87 const scalar alphaGeom = thetag[i] + twist;
90 const int rotationSign =
sign(omega_);
91 const scalar alphaEff =
92 alphaGeom -
atan2(-Uc.
z(), rotationSign*Uc.
y());
94 AOAmin =
min(AOAmin, alphaEff);
95 AOAmax =
max(AOAmax, alphaEff);
98 const label profile1 = blade_.profileIndex()[i1];
99 const label profile2 = blade_.profileIndex()[i2];
103 profiles_[profile1].Cdl(alphaEff, Cd1, Cl1);
107 profiles_[profile2].Cdl(alphaEff, Cd2, Cl2);
109 const scalar Cd = invDr*(Cd2 - Cd1) + Cd1;
110 const scalar Cl = invDr*(Cl2 - Cl1) + Cl1;
113 const scalar tipFactor =
neg(radius/rMax_ - tipEffect_);
116 const scalar pDyn = 0.5*
rho[celli]*
magSqr(Uc);
121 vector localForce =
vector(0, rotationSign*-
f*Cd, tipFactor*
f*Cl);
124 dragEff += rhoRef_*localForce.
y();
125 liftEff += rhoRef_*localForce.
z();
126 powerEff += rhoRef_*localForce.
y()*radius*omega_;
129 localForce = invR_[i] & localForce;
132 force[celli] = cylindrical_->transform(localForce, i);
136 force[celli] /= V[celli];
149 <<
" min/max(AOA) = " <<
radToDeg(AOAmin) <<
", "
151 <<
" Effective power = " << powerEff <<
nl
152 <<
" Effective drag = " << dragEff <<
nl
153 <<
" Effective lift = " << liftEff <<
endl;
159 void Foam::fv::rotorDisk::writeField
172 mesh().time().
name(),
193 field[
cells[i]] = values[i];
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void size(const label)
Override size to be inconsistent with allocated storage.
Generic dimensioned Type class.
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.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const scalar twoPi(2 *pi)
scalar radToDeg(const scalar rad)
Convert radians to degrees.
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
const dimensionSet dimless
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar neg(const dimensionedScalar &ds)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.