From dfe7b86e703823a941e32eaf8033d41b148d702b Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 26 May 2019 12:11:33 +0100 Subject: [PATCH] rotorDiskSource: Added output of rotor power Patch contributed by Robert Lee Resolves patch request https://bugs.openfoam.org/view.php?id=3262 --- .../sources/derived/rotorDiskSource/rotorDiskSource.C | 4 ++-- .../derived/rotorDiskSource/rotorDiskSourceTemplates.C | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C index b409ecb16a..ead9f25f94 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -384,7 +384,7 @@ void Foam::fv::rotorDiskSource::createCoordinateSystem() const scalar sumArea = gSum(area_); const scalar diameter = Foam::sqrt(4.0*sumArea/mathematical::pi); - Info<< " Rotor gometry:" << nl + Info<< " Rotor geometry:" << nl << " - disk diameter = " << diameter << nl << " - disk area = " << sumArea << nl << " - origin = " << coordSys_.origin() << nl diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSourceTemplates.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSourceTemplates.C index a0f27a150c..694913aee8 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSourceTemplates.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,6 +49,7 @@ void Foam::fv::rotorDiskSource::calculate scalar liftEff = 0.0; scalar AOAmin = great; scalar AOAmax = -great; + scalar powerEff = 0.0; forAll(cells_, i) { @@ -127,6 +128,7 @@ void Foam::fv::rotorDiskSource::calculate // Accumulate forces dragEff += rhoRef_*localForce.y(); liftEff += rhoRef_*localForce.z(); + powerEff += rhoRef_ * localForce.y() * radius * omega_; // Transform force from local coning system into rotor cylindrical localForce = invR_[i] & localForce; @@ -151,6 +153,7 @@ void Foam::fv::rotorDiskSource::calculate Info<< type() << " output:" << nl << " min/max(AOA) = " << radToDeg(AOAmin) << ", " << radToDeg(AOAmax) << nl + << " Effective power = " << powerEff << nl << " Effective drag = " << dragEff << nl << " Effective lift = " << liftEff << endl; }