Commit b5491165 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'code-review.saf' into 'develop'

Adding PIMPLE option finalOnLastPimpleIterOnly

See merge request !365
parents 95c67542 775fe1d5
......@@ -50,6 +50,8 @@ bool Foam::pimpleControl::read()
SIMPLErho_ = pimpleDict.getOrDefault("SIMPLErho", false);
turbOnFinalIterOnly_ =
pimpleDict.getOrDefault("turbOnFinalIterOnly", true);
finalOnLastPimpleIterOnly_ =
pimpleDict.getOrDefault("finalOnLastPimpleIterOnly", false);
return true;
}
......@@ -153,7 +155,8 @@ Foam::pimpleControl::pimpleControl
corrPISO_(0),
SIMPLErho_(false),
turbOnFinalIterOnly_(true),
converged_(false)
converged_(false),
finalOnLastPimpleIterOnly_(false)
{
read();
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -94,6 +94,10 @@ protected:
//- Converged flag
bool converged_;
//- Flag to indicate wheter the final solver is used only on the
// final pimple iter
bool finalOnLastPimpleIterOnly_;
// Protected Member Functions
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -96,9 +97,18 @@ inline bool Foam::pimpleControl::finalIter() const
inline bool Foam::pimpleControl::finalInnerIter() const
{
return
corrPISO_ == nCorrPISO_
&& corrNonOrtho_ == nNonOrthCorr_ + 1;
bool finalInnerIter =
corrPISO_ == nCorrPISO_
&& corrNonOrtho_ == nNonOrthCorr_ + 1;
if (finalOnLastPimpleIterOnly_)
{
return finalInnerIter && finalIter();
}
else
{
return finalInnerIter;
}
}
......
......@@ -58,6 +58,7 @@ PIMPLE
momentumPredictor yes;
nOuterCorrectors 1;
nCorrectors 2;
finalOnLastPimpleIterOnly true;
nNonOrthogonalCorrectors 0;
pMax 1.2e5;
......
Markdown is supported
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