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)
60 const label celli = cells[i];
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
169 if (
mesh().time().writeTime() || writeNow)
199 field[cells[i]] = values[i];
dimensionedScalar sign(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
#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.
const dimensionSet dimless
Generic dimensioned Type class.
dimensionedScalar neg(const dimensionedScalar &ds)
A class for handling words, derived from string.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
errorManip< error > abort(error &err)
const scalar twoPi(2 *pi)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
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...