diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C index 367c09f716cf4ec62cc24af163cd9a9185928ef5..cd5d46c824ecd6f230afe3b93f75ae9f7efa9225 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "pimpleControl.H" +#include "Switch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -43,6 +44,8 @@ void Foam::pimpleControl::read() const dictionary& pimpleDict = dict(); nOuterCorr_ = pimpleDict.lookupOrDefault<label>("nOuterCorrectors", 1); nCorr_ = pimpleDict.lookupOrDefault<label>("nCorrectors", 1); + turbOnFinalIterOnly_ = + pimpleDict.lookupOrDefault<Switch>("turbOnFinalIterOnly", true); } @@ -118,7 +121,8 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh) solutionControl(mesh, "PIMPLE"), nOuterCorr_(0), nCorr_(0), - corr_(0) + corr_(0), + turbOnFinalIterOnly_(true) { read(); diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H index a7007bd0ff8b4ff16b65f41d00616bb1c3142ca0..fe8be71ec4407733d4ee628fab9a71eb662d89da 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H @@ -63,6 +63,9 @@ protected: //- Current PIMPLE corrector label corr_; + //- Flag to indicate whether to only solve turbulence on final iter + bool turbOnFinalIterOnly_; + // Protected Member Functions @@ -130,6 +133,9 @@ public: const label nonOrth ) const; + //- Helper function to identify whether to solve for turbulence + inline bool turbCorr() const; + // Member Operators diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H index 4c761dfe236ae27a0d713a6b4628bd7c6c93d528..62c30f845294c17e6a693bf8995f2b67910b7653 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H @@ -110,6 +110,12 @@ inline bool Foam::pimpleControl::finalInnerIter } +inline bool Foam::pimpleControl::turbCorr() const +{ + return !turbOnFinalIterOnly_ || finalIter(); +} + + inline void Foam::pimpleControl::operator++(int) { if (finalIter())