Skip to content
Snippets Groups Projects
Commit fd5e0cc7 authored by andy's avatar andy
Browse files

ENH: Added turbCorr flag to pimpleControl

parent 9f35490c
Branches
Tags
No related merge requests found
......@@ -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();
......
......@@ -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
......
......@@ -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())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment