solutionControl: Default simpleRho true when steady, and improved log messages

This commit is contained in:
Will Bainbridge
2018-11-19 12:01:46 +00:00
parent ee443e201f
commit f810b87dba
3 changed files with 31 additions and 7 deletions

View File

@ -48,11 +48,19 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh, const word& algorithmName)
{ {
printCorrResidualControls(nCorrPimple_); printCorrResidualControls(nCorrPimple_);
} }
else
Info<< nl << algorithmName << ": Operating solver in "
<< (mesh.steady() ? "steady-state" : mesh.transient() ? "transient" :
"mixed steady-state/transient") << " mode with " << nCorrPimple_
<< " outer corrector" << (nCorrPimple_ == 1 ? "" : "s") << nl;
if (nCorrPimple_ == 1)
{ {
Info<< nl << algorithmName << ": Operating solver in PISO mode" << nl Info<< algorithmName << ": Operating solver in "
<< endl; << (mesh.steady() ? "SIMPLE" : "PISO") << " mode" << nl;
} }
Info<< nl << endl;
} }

View File

@ -78,12 +78,17 @@ Foam::pimpleMultiRegionControl::pimpleMultiRegionControl
pimpleControls_(), pimpleControls_(),
solidControls_() solidControls_()
{ {
bool allSteady = true, allTransient = true;
forAll(pimpleMeshes, i) forAll(pimpleMeshes, i)
{ {
pimpleControls_.append pimpleControls_.append
( (
new pimpleNoLoopControl(pimpleMeshes[i], algorithmName) new pimpleNoLoopControl(pimpleMeshes[i], algorithmName)
); );
allSteady = allSteady && pimpleMeshes[i].steady();
allTransient = allTransient && pimpleMeshes[i].transient();
} }
forAll(solidMeshes, i) forAll(solidMeshes, i)
@ -92,6 +97,9 @@ Foam::pimpleMultiRegionControl::pimpleMultiRegionControl
( (
new solidNoLoopControl(solidMeshes[i], algorithmName) new solidNoLoopControl(solidMeshes[i], algorithmName)
); );
allSteady = allSteady && solidMeshes[i].steady();
allTransient = allTransient && solidMeshes[i].transient();
} }
read(); read();
@ -120,11 +128,18 @@ Foam::pimpleMultiRegionControl::pimpleMultiRegionControl
} }
} }
if (nCorrPimple_ == 1) Info<< nl << algorithmName << ": Operating solver in "
<< (allSteady ? "steady-state" : allTransient ? "transient" :
"mixed steady-state/transient") << " mode with " << nCorrPimple_
<< " outer corrector" << (nCorrPimple_ == 1 ? "" : "s") << nl;
if ((allSteady || allTransient) && nCorrPimple_ == 1)
{ {
Info<< nl << algorithmName << ": Operating solver in PISO mode" << nl Info<< algorithmName << ": Operating solver in "
<< endl; << (allSteady ? "SIMPLE" : "PISO") << " mode" << nl;
} }
Info<< nl << endl;
} }

View File

@ -79,7 +79,8 @@ bool Foam::pimpleNoLoopControl::read()
} }
// The SIMPLErho keyword is maintained here for backwards compatibility // The SIMPLErho keyword is maintained here for backwards compatibility
simpleRho_ = dict().lookupOrDefault<bool>("SIMPLErho", false); simpleRho_ = mesh().steady();
simpleRho_ = dict().lookupOrDefault<bool>("SIMPLErho", simpleRho_);
simpleRho_ = dict().lookupOrDefault<bool>("simpleRho", simpleRho_); simpleRho_ = dict().lookupOrDefault<bool>("simpleRho", simpleRho_);
turbOnFinalIterOnly_ = turbOnFinalIterOnly_ =