mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Added turbCorr flag to pimpleControl
This commit is contained in:
@ -24,6 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "Switch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -43,6 +44,8 @@ void Foam::pimpleControl::read()
|
|||||||
const dictionary& pimpleDict = dict();
|
const dictionary& pimpleDict = dict();
|
||||||
nOuterCorr_ = pimpleDict.lookupOrDefault<label>("nOuterCorrectors", 1);
|
nOuterCorr_ = pimpleDict.lookupOrDefault<label>("nOuterCorrectors", 1);
|
||||||
nCorr_ = pimpleDict.lookupOrDefault<label>("nCorrectors", 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"),
|
solutionControl(mesh, "PIMPLE"),
|
||||||
nOuterCorr_(0),
|
nOuterCorr_(0),
|
||||||
nCorr_(0),
|
nCorr_(0),
|
||||||
corr_(0)
|
corr_(0),
|
||||||
|
turbOnFinalIterOnly_(true)
|
||||||
{
|
{
|
||||||
read();
|
read();
|
||||||
|
|
||||||
|
|||||||
@ -63,6 +63,9 @@ protected:
|
|||||||
//- Current PIMPLE corrector
|
//- Current PIMPLE corrector
|
||||||
label corr_;
|
label corr_;
|
||||||
|
|
||||||
|
//- Flag to indicate whether to only solve turbulence on final iter
|
||||||
|
bool turbOnFinalIterOnly_;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
@ -130,6 +133,9 @@ public:
|
|||||||
const label nonOrth
|
const label nonOrth
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Helper function to identify whether to solve for turbulence
|
||||||
|
inline bool turbCorr() const;
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// 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)
|
inline void Foam::pimpleControl::operator++(int)
|
||||||
{
|
{
|
||||||
if (finalIter())
|
if (finalIter())
|
||||||
|
|||||||
Reference in New Issue
Block a user