34 template<
class RhoFieldType>
37 const RhoFieldType&
rho,
41 const bool divideVolume,
50 scalar AOAmin = great;
51 scalar AOAmax = -great;
58 if (area_[i] > rootVSmall)
62 const scalar radius = x_[i].x();
65 vector Uc = cylindrical_->invTransform(
U[celli], i);
77 Uc.
y() = radius*omega_ - Uc.
y();
86 blade_.interpolate(radius, twist, chord, i1, i2, invDr);
88 const scalar alphaGeom = thetag[i] + twist;
91 const int rotationSign =
sign(omega_);
92 const scalar alphaEff =
93 alphaGeom -
atan2(-Uc.
z(), rotationSign*Uc.
y());
95 AOAmin =
min(AOAmin, alphaEff);
96 AOAmax =
max(AOAmax, alphaEff);
99 const label profile1 = blade_.profileID()[i1];
100 const label profile2 = blade_.profileID()[i2];
104 profiles_[profile1].Cdl(alphaEff, Cd1, Cl1);
108 profiles_[profile2].Cdl(alphaEff, Cd2, Cl2);
110 const scalar Cd = invDr*(Cd2 - Cd1) + Cd1;
111 const scalar Cl = invDr*(Cl2 - Cl1) + Cl1;
114 const scalar tipFactor =
neg(radius/rMax_ - tipEffect_);
117 const scalar pDyn = 0.5*
rho[celli]*
magSqr(Uc);
122 vector localForce =
vector(0, rotationSign*-
f*Cd, tipFactor*
f*Cl);
125 dragEff += rhoRef_*localForce.
y();
126 liftEff += rhoRef_*localForce.
z();
127 powerEff += rhoRef_*localForce.
y()*radius*omega_;
130 localForce = invR_[i] & localForce;
133 force[celli] = cylindrical_->transform(localForce, i);
137 force[celli] /= V[celli];
150 <<
" min/max(AOA) = " <<
radToDeg(AOAmin) <<
", "
152 <<
" Effective power = " << powerEff <<
nl
153 <<
" Effective drag = " << dragEff <<
nl
154 <<
" Effective lift = " << liftEff <<
endl;
160 void Foam::fv::rotorDiskSource::writeField
167 if (mesh().time().writeTime() || writeNow)
176 mesh().time().
name(),
186 Field<Type>& field = tfield.ref().primitiveFieldRef();
197 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)
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.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
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)
word name(const complex &)
Return a string representation of a complex.
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.
Unit conversion functions.