mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
PIMPLE: Rationalised loop structure
Automated the caching of "finalIteration".
This commit is contained in:
@ -33,8 +33,8 @@ Description
|
||||
#include "hsCombustionThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "combustionModel.H"
|
||||
|
||||
#include "radiationModel.H"
|
||||
#include "pimpleLoop.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readPISOControls.H"
|
||||
#include "readPIMPLEControls.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
@ -68,14 +68,13 @@ int main(int argc, char *argv[])
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
|
||||
for
|
||||
(
|
||||
pimpleLoop pimpleCorr(mesh, nOuterCorr);
|
||||
pimpleCorr.loop();
|
||||
pimpleCorr++
|
||||
)
|
||||
{
|
||||
bool finalIter = oCorr == nOuterCorr-1;
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::add("finalIteration", true);
|
||||
}
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
#include "ftEqn.H"
|
||||
@ -86,11 +85,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::remove("finalIteration");
|
||||
}
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
@ -33,7 +33,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
p_rgh.select
|
||||
(
|
||||
(
|
||||
finalIter
|
||||
pimpleCorr.finalIter()
|
||||
&& corr == nCorr-1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
|
||||
@ -45,9 +45,9 @@
|
||||
p.select
|
||||
(
|
||||
(
|
||||
finalIter
|
||||
&& corr == nCorr-1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
pimpleCorr.finalIter()
|
||||
&& corr == nCorr-1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -89,9 +89,9 @@
|
||||
p.select
|
||||
(
|
||||
(
|
||||
finalIter
|
||||
&& corr == nCorr-1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
pimpleCorr.finalIter()
|
||||
&& corr == nCorr-1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@ -36,6 +36,7 @@ Description
|
||||
#include "rhoChemistryModel.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "multivariateScheme.H"
|
||||
#include "pimpleLoop.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -69,14 +70,14 @@ int main(int argc, char *argv[])
|
||||
#include "chemistry.H"
|
||||
#include "rhoEqn.H"
|
||||
|
||||
for (label oCorr=1; oCorr <= nOuterCorr; oCorr++)
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
for
|
||||
(
|
||||
pimpleLoop pimpleCorr(mesh, nOuterCorr);
|
||||
pimpleCorr.loop();
|
||||
pimpleCorr++
|
||||
)
|
||||
{
|
||||
bool finalIter = oCorr == nOuterCorr-1;
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::add("finalIteration", true);
|
||||
}
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "hsEqn.H"
|
||||
@ -86,11 +87,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::remove("finalIteration");
|
||||
}
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
Reference in New Issue
Block a user