diff --git a/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C b/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C index 6014b623fb..c3f042fe01 100644 --- a/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C +++ b/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C @@ -465,22 +465,15 @@ Foam::rotorDiskSource::~rotorDiskSource() void Foam::rotorDiskSource::calculate ( const vectorField& U, - const scalarField& alphag, + const scalarField& thetag, vectorField& force, const bool divideVolume, const bool output ) const { const scalarField& V = mesh_.V(); - const bool compressible = rhoName_ != "none"; - - tmp trho - ( - compressible - ? mesh_.lookupObject(rhoName_) - : volScalarField::null() - ); - + const bool compressible = this->compressible(); + tmp trho(rho()); // logging info scalar dragEff = 0.0; @@ -518,7 +511,7 @@ void Foam::rotorDiskSource::calculate blade_.interpolate(radius, twist, chord, i1, i2, invDr); // flip geometric angle if blade is spinning in reverse (clockwise) - scalar alphaGeom = alphag[i] + twist; + scalar alphaGeom = thetag[i] + twist; if (omega_ < 0) { alphaGeom = mathematical::pi - alphaGeom; @@ -685,7 +678,7 @@ bool Foam::rotorDiskSource::read(const dictionary& dict) if (debug) { - writeField("alphag", trim_->thetag()(), true); + writeField("thetag", trim_->thetag()(), true); writeField("faceArea", area_, true); } diff --git a/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H b/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H index a2f856988d..7fd7d33964 100644 --- a/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H +++ b/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H @@ -253,7 +253,11 @@ public: // Member Functions // Access - + + //- Return the rotational speed [rad/s] + // Positive anti-clockwise when looking along -ve lift direction + inline scalar omega() const; + //- Return the cell centre positions in local rotor frame // (Cylindrical r, theta, z) inline const List& x() const; @@ -261,6 +265,12 @@ public: //- Return the rotor co-ordinate system (r, theta, z) inline const cylindricalCS& coordSys() const; + //- Return true if solving a compressible case + inline bool compressible() const; + + //- Return the density field [kg/m3] + inline tmp rho() const; + // Evaluation @@ -268,7 +278,7 @@ public: void calculate ( const vectorField& U, - const scalarField& alphag, + const scalarField& thetag, vectorField& force, const bool divideVolume = true, const bool output = true diff --git a/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceI.H b/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceI.H index 23ca3b0e80..7c194e8713 100644 --- a/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceI.H +++ b/src/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceI.H @@ -25,6 +25,13 @@ License #include "rotorDiskSource.H" +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::scalar Foam::rotorDiskSource::omega() const +{ + return omega_; +} + const Foam::List& Foam::rotorDiskSource::x() const { return x_; @@ -37,5 +44,23 @@ const Foam::cylindricalCS& Foam::rotorDiskSource::coordSys() const } +bool Foam::rotorDiskSource::compressible() const +{ + return rhoName_ != "none"; +} + + +Foam::tmp Foam::rotorDiskSource::rho() const +{ + if (compressible()) + { + return mesh_.lookupObject(rhoName_); + } + else + { + return volScalarField::null(); + } +} + // ************************************************************************* //