Commit fb11f37e authored by andy's avatar andy
Browse files

ENH: Propagating pimpleControl across pimple-based solvers

parent 9185d746
......@@ -34,7 +34,7 @@ Description
#include "turbulenceModel.H"
#include "combustionModel.H"
#include "radiationModel.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -51,6 +51,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -61,6 +63,7 @@ int main(int argc, char *argv[])
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
......@@ -68,12 +71,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H"
......
......@@ -32,11 +32,9 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
(
p_rgh.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......
......@@ -44,11 +44,9 @@
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......@@ -88,11 +86,9 @@
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......
......@@ -36,7 +36,7 @@ Description
#include "rhoChemistryModel.H"
#include "chemistrySolver.H"
#include "multivariateScheme.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -53,6 +53,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -60,9 +62,10 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
......@@ -71,12 +74,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H"
#include "YEqn.H"
......
......@@ -37,7 +37,7 @@ if (transonic)
(
p.select
(
pimpleCorr.finalIter()
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
......@@ -75,7 +75,7 @@ else
(
p.select
(
pimpleCorr.finalIter()
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
......
......@@ -37,7 +37,7 @@ Description
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "bound.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -49,6 +49,8 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
......@@ -57,6 +59,7 @@ int main(int argc, char *argv[])
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
......@@ -65,12 +68,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
{
......
......@@ -40,7 +40,7 @@ Description
#include "MRFZones.H"
#include "porousZones.H"
#include "fvcSmooth.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
#include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -56,6 +56,10 @@ int main(int argc, char *argv[])
#include "createZones.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
......@@ -64,6 +68,7 @@ int main(int argc, char *argv[])
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
......@@ -74,12 +79,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
{
......
scalar maxDeltaT
(
pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT)
pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT
......
{
scalar maxCo
(
pimple.lookupOrDefault<scalar>("maxCo", 0.8)
pimpleDict.lookupOrDefault<scalar>("maxCo", 0.8)
);
scalar rDeltaTSmoothingCoeff
(
pimple.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
);
scalar rDeltaTDampingCoeff
(
pimple.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
);
scalar maxDeltaT
(
pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT)
pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
......
......@@ -39,11 +39,9 @@ if (transonic)
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......@@ -80,11 +78,9 @@ else
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......
......@@ -39,7 +39,7 @@ Description
#include "bound.H"
#include "MRFZones.H"
#include "porousZones.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -52,6 +52,8 @@ int main(int argc, char *argv[])
#include "createZones.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -62,6 +64,7 @@ int main(int argc, char *argv[])
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
......@@ -70,12 +73,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
{
......
......@@ -48,7 +48,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -64,6 +64,8 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -76,14 +78,10 @@ int main(int argc, char *argv[])
#include "readPIMPLEControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
pimple.read();
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
{
......
......@@ -25,11 +25,9 @@
(
p_rgh.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......
......@@ -37,7 +37,7 @@ Description
#include "basicRhoThermo.H"
#include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -53,6 +53,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -63,6 +65,7 @@ int main(int argc, char *argv[])
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
......@@ -71,12 +74,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
{
......
......@@ -39,11 +39,9 @@
(
p_rgh.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......
......@@ -27,7 +27,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
(
p.select
(
pimpleCorr.finalIter()
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
......
......@@ -29,11 +29,9 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
(
p.select
(
(
pimpleCorr.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
......
......@@ -36,7 +36,7 @@ Description
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"
#include "dynamicFvMesh.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -46,11 +46,12 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readPIMPLEControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -59,6 +60,7 @@ int main(int argc, char *argv[])
{
#include "readControls.H"
#include "CourantNo.H"
pimple.read();
// Make the fluxes absolute
fvc::makeAbsolute(phi, U);
......@@ -85,12 +87,7 @@ int main(int argc, char *argv[])
}
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
{
......
......@@ -2,8 +2,8 @@
#include "readPIMPLEControls.H"
const bool correctPhi =
pimple.lookupOrDefault("correctPhi", false);
pimpleDict.lookupOrDefault("correctPhi", false);
const bool checkMeshCourantNo =
pimple.lookupOrDefault("checkMeshCourantNo", false);
pimpleDict.lookupOrDefault("checkMeshCourantNo", false);
......@@ -35,7 +35,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"
#include "pimpleLoop.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -47,6 +47,10 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
......@@ -55,18 +59,14 @@ int main(int argc, char *argv[])
#include "readPIMPLEControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop
for
(
pimpleLoop pimpleCorr(mesh, nOuterCorr);
pimpleCorr.loop();
pimpleCorr++
)
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
{
......
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