From 656bbf5308d539ce33a4fee7b54554dfe7adb356 Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Thu, 14 Apr 2011 17:45:20 +0100 Subject: [PATCH] ENH: Updated solvers to use simpleControl and pimpleControl --- .../basic/laplacianFoam/laplacianFoam.C | 11 ++++--- .../scalarTransportFoam/scalarTransportFoam.C | 24 +++++++------- .../solvers/combustion/fireFoam/fireFoam.C | 4 +-- .../solvers/combustion/fireFoam/pEqn.H | 14 ++------ .../solvers/combustion/rhoReactingFoam/UEqn.H | 2 +- .../solvers/combustion/rhoReactingFoam/pEqn.H | 30 ++++------------- .../rhoReactingFoam/rhoReactingFoam.C | 4 +-- .../solvers/compressible/rhoPimpleFoam/UEqn.H | 2 +- .../solvers/compressible/rhoPimpleFoam/pEqn.H | 32 +++++-------------- .../rhoPimpleFoam/rhoPimpleFoam.C | 6 ++-- .../rhoPorousMRFLTSPimpleFoam.C | 12 +++---- .../setInitialrDeltaT.H | 2 +- .../rhoPorousMRFLTSPimpleFoam/setrDeltaT.H | 4 ++- .../rhoPorousMRFPimpleFoam/UEqn.H | 2 +- .../rhoPorousMRFPimpleFoam/pEqn.H | 32 +++++-------------- .../rhoPorousMRFPimpleFoam.C | 6 ++-- .../solvers/compressible/rhoSimpleFoam/pEqn.H | 10 +++--- .../rhoPorousMRFSimpleFoam/pEqn.H | 10 +++--- .../rhoPorousMRFSimpleFoam.C | 7 ++-- .../rhoSimpleFoam/rhoSimpleFoam.C | 9 +++--- .../compressible/rhoSimplecFoam/pEqn.H | 12 +++---- .../rhoSimplecFoam/rhoSimplecFoam.C | 9 +++--- .../magneticFoam/magneticFoam.C | 8 +++-- .../buoyantBoussinesqPimpleFoam/UEqn.H | 2 +- .../buoyantBoussinesqPimpleFoam.C | 6 ++-- .../buoyantBoussinesqPimpleFoam/pEqn.H | 14 ++------ .../buoyantBoussinesqSimpleFoam/UEqn.H | 2 +- .../buoyantBoussinesqSimpleFoam.C | 9 +++--- .../buoyantBoussinesqSimpleFoam/pEqn.H | 4 +-- .../heatTransfer/buoyantPimpleFoam/UEqn.H | 2 +- .../buoyantPimpleFoam/buoyantPimpleFoam.C | 6 ++-- .../heatTransfer/buoyantPimpleFoam/pEqn.H | 14 ++------ .../heatTransfer/buoyantSimpleFoam/UEqn.H | 2 +- .../buoyantSimpleFoam/buoyantSimpleFoam.C | 9 +++--- .../heatTransfer/buoyantSimpleFoam/pEqn.H | 4 +-- .../buoyantSimpleRadiationFoam.C | 9 +++--- .../adjointShapeOptimizationFoam.C | 15 +++++---- .../solvers/incompressible/pimpleFoam/UEqn.H | 2 +- .../solvers/incompressible/pimpleFoam/pEqn.H | 16 +++------- .../pimpleFoam/pimpleDyMFoam/UEqn.H | 2 +- .../pimpleFoam/pimpleDyMFoam/correctPhi.H | 4 +-- .../pimpleFoam/pimpleDyMFoam/pEqn.H | 16 +++------- .../pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C | 5 ++- .../pimpleFoam/pimpleDyMFoam/readControls.H | 3 +- .../incompressible/pimpleFoam/pimpleFoam.C | 6 ++-- .../incompressible/simpleFoam/createFields.H | 3 +- .../solvers/incompressible/simpleFoam/pEqn.H | 4 +-- .../porousSimpleFoam/createPorousZones.H | 8 +---- .../simpleFoam/porousSimpleFoam/pEqn.H | 4 +-- .../porousSimpleFoam/porousSimpleFoam.C | 8 +++-- .../incompressible/simpleFoam/simpleFoam.C | 9 +++--- .../LTSReactingParcelFoam.C | 6 ++-- .../lagrangian/LTSReactingParcelFoam/UEqn.H | 2 +- .../lagrangian/LTSReactingParcelFoam/pEqn.H | 14 ++------ .../lagrangian/coalChemistryFoam/UEqn.H | 2 +- .../coalChemistryFoam/coalChemistryFoam.C | 4 +-- .../lagrangian/coalChemistryFoam/pEqn.H | 30 ++++------------- .../lagrangian/reactingParcelFilmFoam/UEqn.H | 2 +- .../lagrangian/reactingParcelFilmFoam/pEqn.H | 14 ++------ .../reactingParcelFilmFoam.C | 4 +-- .../lagrangian/reactingParcelFoam/UEqn.H | 2 +- .../lagrangian/reactingParcelFoam/pEqn.H | 30 ++++------------- .../reactingParcelFoam/reactingParcelFoam.C | 4 +-- .../solvers/multiphase/cavitatingFoam/UEqn.H | 2 +- .../cavitatingFoam/cavitatingFoam.C | 7 ++-- .../solvers/multiphase/cavitatingFoam/pEqn.H | 22 ++++++------- .../multiphase/cavitatingFoam/readControls.H | 2 -- .../multiphase/compressibleInterFoam/UEqn.H | 2 +- .../compressibleInterDyMFoam.C | 7 ++-- .../compressibleInterDyMFoam/pEqn.H | 16 +++------- .../compressibleInterDyMFoam/readControls.H | 27 ++++------------ .../compressibleInterFoam.C | 7 ++-- .../multiphase/compressibleInterFoam/pEqn.H | 14 ++------ .../compressibleInterFoam/readControls.H | 5 ++- .../interFoam/LTSInterFoam/LTSInterFoam.C | 23 ++++++++----- .../interFoam/LTSInterFoam/alphaEqnSubCycle.H | 6 ++-- .../LTSInterFoam/setInitialrDeltaT.H | 2 +- .../interFoam/LTSInterFoam/setrDeltaT.H | 24 +++++++------- .../interFoam/MRFInterFoam/MRFInterFoam.C | 22 ++++++++----- .../multiphase/interFoam/MRFInterFoam/UEqn.H | 2 +- .../multiphase/interFoam/MRFInterFoam/pEqn.H | 9 ++---- .../solvers/multiphase/interFoam/UEqn.H | 2 +- .../multiphase/interFoam/alphaEqnSubCycle.H | 14 +++----- .../solvers/multiphase/interFoam/correctPhi.H | 4 +-- .../multiphase/interFoam/createFields.H | 2 +- .../interFoam/interDyMFoam/interDyMFoam.C | 21 ++++++++---- .../multiphase/interFoam/interDyMFoam/pEqn.H | 9 ++---- .../interFoam/interDyMFoam/readControls.H | 18 +++-------- .../solvers/multiphase/interFoam/interFoam.C | 24 +++++++++----- .../solvers/multiphase/interFoam/pEqn.H | 9 ++---- .../interFoam/porousInterFoam/UEqn.H | 2 +- .../porousInterFoam/porousInterFoam.C | 22 ++++++++----- .../interMixingFoam/alphaEqnsSubCycle.H | 16 +++------- .../multiphase/interMixingFoam/createFields.H | 2 +- .../interMixingFoam/interMixingFoam.C | 21 ++++++++---- .../multiphase/interPhaseChangeFoam/UEqn.H | 2 +- .../interPhaseChangeFoam/alphaEqnSubCycle.H | 14 +++----- .../interPhaseChangeFoam/createFields.H | 2 +- .../interPhaseChangeFoam.C | 10 +++--- .../multiphase/interPhaseChangeFoam/pEqn.H | 14 ++------ .../MRFMultiphaseInterFoam.C | 22 ++++++++----- .../MRFMultiphaseInterFoam/UEqn.H | 2 +- .../MRFMultiphaseInterFoam/pEqn.H | 9 ++---- .../multiphase/multiphaseInterFoam/UEqn.H | 2 +- .../multiphaseInterFoam/createFields.H | 2 +- .../multiphaseInterFoam/multiphaseInterFoam.C | 22 ++++++++----- .../multiphaseMixture/multiphaseMixture.C | 25 ++++----------- .../multiphase/multiphaseInterFoam/pEqn.H | 9 ++---- .../solvers/multiphase/settlingFoam/UEqn.H | 2 +- .../solvers/multiphase/settlingFoam/pEqn.H | 4 +-- .../multiphase/settlingFoam/settlingFoam.C | 12 ++++--- .../multiphase/twoLiquidMixingFoam/UEqn.H | 2 +- .../multiphase/twoLiquidMixingFoam/pEqn.H | 14 ++------ .../twoLiquidMixingFoam/twoLiquidMixingFoam.C | 5 +-- .../twoPhaseEulerFoam/createFields.H | 2 +- .../readTwoPhaseEulerFoamControls.H | 7 ++-- .../MRFSimpleFoam/MRFSimpleFoam.C | 13 ++++---- 117 files changed, 460 insertions(+), 655 deletions(-) diff --git a/applications/solvers/basic/laplacianFoam/laplacianFoam.C b/applications/solvers/basic/laplacianFoam/laplacianFoam.C index b498db2d972..e2efee8f458 100644 --- a/applications/solvers/basic/laplacianFoam/laplacianFoam.C +++ b/applications/solvers/basic/laplacianFoam/laplacianFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,6 +30,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -41,17 +42,17 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createFields.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating temperature distribution\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { solve ( diff --git a/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C b/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C index ce5580d50bf..3c0c0f3b14d 100644 --- a/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C +++ b/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,32 +30,30 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" -# include "setRootCase.H" + simpleControl simple(mesh); -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating scalar transport\n" << endl; -# include "CourantNo.H" + #include "CourantNo.H" - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readSIMPLEControls.H" - - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { solve ( diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index d2ef427e48b..4bef0f80eac 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -59,11 +59,9 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPIMPLEControls.H" #include "readTimeControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; @@ -79,7 +77,7 @@ int main(int argc, char *argv[]) #include "fuhsEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 64ebb1a9704..6813950e19e 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -15,7 +15,7 @@ surfaceScalarField phiU phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); -for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { surfaceScalarField rhorAUf(fvc::interpolate(rho*rAU)); @@ -28,18 +28,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += p_rghEqn.flux(); } diff --git a/applications/solvers/combustion/rhoReactingFoam/UEqn.H b/applications/solvers/combustion/rhoReactingFoam/UEqn.H index 9697c6e1ed2..1e626d75b85 100644 --- a/applications/solvers/combustion/rhoReactingFoam/UEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/UEqn.H @@ -9,7 +9,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); } diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H index 7c227676eb6..724f45e1894 100644 --- a/applications/solvers/combustion/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -8,7 +8,7 @@ volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); - if (transonic) + if (pimple.transonic()) { surfaceScalarField phiv ( @@ -30,7 +30,7 @@ + correction(fvm::ddt(psi, p) + fvm::div(phid, p)) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -40,18 +40,10 @@ pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += pEqn.flux(); } @@ -72,7 +64,7 @@ + fvc::div(phi) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -82,18 +74,10 @@ pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += pEqn.flux(); } diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C index 36329f1215e..539fe9d9386 100644 --- a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C @@ -62,10 +62,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; @@ -81,7 +79,7 @@ int main(int argc, char *argv[]) #include "hsEqn.H" // --- PISO loop - for (int corr=1; corr<=nCorr; corr++) + for (int corr=1; corr<=pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H index 27b06029b88..03bc6e76e71 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H @@ -11,7 +11,7 @@ UEqn().relax(); volScalarField rAU(1.0/UEqn().A()); -if (momentumPredictor) +if (pimple.momentumPredictor()) { solve(UEqn() == -fvc::grad(p)); } diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index b665c8fc624..eea0ea9bff8 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -5,12 +5,12 @@ rho.relax(); U = rAU*UEqn().H(); -if (nCorr <= 1) +if (pimple.nCorr() <= 1) { UEqn.clear(); } -if (transonic) +if (pimple.transonic()) { surfaceScalarField phid ( @@ -22,7 +22,7 @@ if (transonic) ) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -33,18 +33,10 @@ if (transonic) pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi == pEqn.flux(); } @@ -59,7 +51,7 @@ else + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { // Pressure corrector fvScalarMatrix pEqn @@ -71,18 +63,10 @@ else pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += pEqn.flux(); } diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 6db691f5edd..746fb1224f4 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -56,10 +56,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -70,7 +68,7 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p.storePrevIter(); rho.storePrevIter(); @@ -80,7 +78,7 @@ int main(int argc, char *argv[]) #include "hEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C index 1ee1ed665ef..97cc2cc2560 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C @@ -50,14 +50,14 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readPIMPLEControls.H" + + pimpleControl pimple(mesh); + #include "setInitialrDeltaT.H" #include "createFields.H" #include "createZones.H" #include "initContinuityErrs.H" - pimpleControl pimple(mesh); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -65,10 +65,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -81,7 +79,7 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p.storePrevIter(); rho.storePrevIter(); @@ -93,7 +91,7 @@ int main(int argc, char *argv[]) #include "hEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setInitialrDeltaT.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setInitialrDeltaT.H index 54652dd8edf..353abc83a34 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setInitialrDeltaT.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setInitialrDeltaT.H @@ -1,6 +1,6 @@ scalar maxDeltaT ( - pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT) + pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT) ); volScalarField rDeltaT diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setrDeltaT.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setrDeltaT.H index 7cad4d26790..d56283d13f5 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setrDeltaT.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/setrDeltaT.H @@ -1,4 +1,6 @@ { + const dictionary& pimpleDict = pimple.dict(); + scalar maxCo ( pimpleDict.lookupOrDefault<scalar>("maxCo", 0.8) @@ -29,7 +31,7 @@ /((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) ); - if (transonic) + if (pimple.transonic()) { surfaceScalarField phid ( diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H index 4efb76bd45b..f3b115d0da6 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H @@ -15,7 +15,7 @@ pZones.addResistance(UEqn()); volScalarField rAU(1.0/UEqn().A()); -if (momentumPredictor) +if (pimple.momentumPredictor()) { solve(UEqn() == -fvc::grad(p)); } diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H index 32058ffa9e9..5e54f970cd5 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H @@ -6,12 +6,12 @@ rho.relax(); volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); -if (nCorr <= 1) +if (pimple.nCorr() <= 1) { UEqn.clear(); } -if (transonic) +if (pimple.transonic()) { surfaceScalarField phid ( @@ -24,7 +24,7 @@ if (transonic) ); mrfZones.relativeFlux(fvc::interpolate(psi), phid); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -35,18 +35,10 @@ if (transonic) pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi == pEqn.flux(); } @@ -62,7 +54,7 @@ else ); mrfZones.relativeFlux(fvc::interpolate(rho), phi); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { // Pressure corrector fvScalarMatrix pEqn @@ -74,18 +66,10 @@ else pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += pEqn.flux(); } diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C index 0bce64d7a34..5195655a339 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C @@ -61,10 +61,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -75,7 +73,7 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p.storePrevIter(); rho.storePrevIter(); @@ -85,7 +83,7 @@ int main(int argc, char *argv[]) #include "hEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 4574a096efe..54af64c003e 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -9,7 +9,7 @@ UEqn.clear(); bool closedVolume = false; -if (transonic) +if (simple.transonic()) { surfaceScalarField phid ( @@ -17,7 +17,7 @@ if (transonic) fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf()) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -32,7 +32,7 @@ if (transonic) pEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi == pEqn.flux(); } @@ -43,7 +43,7 @@ else phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); closedVolume = adjustPhi(phi, U, p); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -54,7 +54,7 @@ else pEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi -= pEqn.flux(); } diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H index 44b391a7b55..4fc258870b9 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H @@ -11,7 +11,7 @@ UEqn.clear(); bool closedVolume = false; -if (transonic) +if (simple.transonic()) { surfaceScalarField phid ( @@ -20,7 +20,7 @@ if (transonic) ); mrfZones.relativeFlux(fvc::interpolate(psi), phid); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { tmp<fvScalarMatrix> tpEqn; @@ -37,7 +37,7 @@ if (transonic) tpEqn().solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi == tpEqn().flux(); } @@ -50,7 +50,7 @@ else closedVolume = adjustPhi(phi, U, p); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { tmp<fvScalarMatrix> tpEqn; @@ -67,7 +67,7 @@ else tpEqn().solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi -= tpEqn().flux(); } diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C index 83898240ffc..e210e971ca9 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C @@ -36,6 +36,7 @@ Description #include "RASModel.H" #include "MRFZones.H" #include "thermalPorousZones.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,16 +49,16 @@ int main(int argc, char *argv[]) #include "createZones.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p.storePrevIter(); rho.storePrevIter(); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C index a8ddcbeb6cd..63b6586cb40 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,7 @@ Description #include "fvCFD.H" #include "basicPsiThermo.H" #include "RASModel.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,16 +45,16 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p.storePrevIter(); rho.storePrevIter(); diff --git a/applications/solvers/compressible/rhoSimplecFoam/pEqn.H b/applications/solvers/compressible/rhoSimplecFoam/pEqn.H index 36b77f03995..9eb783feca8 100644 --- a/applications/solvers/compressible/rhoSimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimplecFoam/pEqn.H @@ -12,9 +12,9 @@ UEqn.clear(); bool closedVolume = false; -if (transonic) +if (simple.transonic()) { - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { surfaceScalarField phid ( @@ -54,7 +54,7 @@ if (transonic) pEqn.solve(); } - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi == phic + pEqn.flux(); } @@ -62,7 +62,7 @@ if (transonic) } else { - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { phi = fvc::interpolate(rho*U) & mesh.Sf(); closedVolume = adjustPhi(phi, U, p); @@ -88,7 +88,7 @@ else } - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi += pEqn.flux(); } @@ -119,7 +119,7 @@ rho = thermo.rho(); rho = max(rho, rhoMin); rho = min(rho, rhoMax); -if (!transonic) +if (!simple.transonic()) { rho.relax(); } diff --git a/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C b/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C index c804e4e45d8..13b8ebddc48 100644 --- a/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C +++ b/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C @@ -35,6 +35,7 @@ Description #include "RASModel.H" #include "mixedFvPatchFields.H" #include "bound.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,20 +47,20 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p.storePrevIter(); rho.storePrevIter(); - if (!transonic) + if (!simple.transonic()) { rho.storePrevIter(); } diff --git a/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C b/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C index 151d17a398e..1ec8b860220 100644 --- a/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C +++ b/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,6 +38,7 @@ Description #include "OSspecific.H" #include "magnet.H" #include "electromagneticConstants.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -65,7 +66,8 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "createFields.H" - #include "readSIMPLEControls.H" + + simpleControl simple(mesh); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,7 +75,7 @@ int main(int argc, char *argv[]) runTime++; - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { solve(fvm::laplacian(murf, psi) + fvc::div(murf*Mrf)); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H index df6f90ac029..07f46ec9982 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H @@ -9,7 +9,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C index f5cd55daca6..adb08c1ee5b 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C @@ -75,15 +75,13 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "CourantNo.H" #include "setDeltaT.H" - pimple.read(); // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p_rgh.storePrevIter(); } @@ -92,7 +90,7 @@ int main(int argc, char *argv[]) #include "TEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H index 31c4f484e0f..8ac13dc93ee 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H @@ -10,7 +10,7 @@ surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); phi -= buoyancyPhi; - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -21,18 +21,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { // Calculate the conservative fluxes phi -= p_rghEqn.flux(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H index 9a53619af50..cbe464fc023 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H @@ -8,7 +8,7 @@ UEqn().relax(); - if (momentumPredictor) + if (simple.momentumPredictor()) { solve ( diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index 1a5086e130d..06d0f2df385 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,6 +48,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "RASModel.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,16 +61,16 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p_rgh.storePrevIter(); // Pressure-velocity SIMPLE corrector diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H index 0e8ae4e7933..5d643837ffc 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H @@ -11,7 +11,7 @@ surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); phi -= buoyancyPhi; - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -22,7 +22,7 @@ p_rghEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { // Calculate the conservative fluxes phi -= p_rghEqn.flux(); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H index c8b9f13180b..7dff741e663 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H @@ -9,7 +9,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index f2deb2e2d52..ca7724f101e 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -62,10 +62,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -76,7 +74,7 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p_rgh.storePrevIter(); } @@ -85,7 +83,7 @@ int main(int argc, char *argv[]) #include "hEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 963b4df5483..b47d65b842a 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -25,7 +25,7 @@ + fvc::div(phi) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -35,18 +35,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { // Calculate the conservative fluxes phi += p_rghEqn.flux(); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H index 5fbfb3f7643..ca28910aaf3 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H @@ -8,7 +8,7 @@ UEqn().relax(); - if (momentumPredictor) + if (simple.momentumPredictor()) { solve ( diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 5891efcbf8d..d70b03a45b6 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,7 @@ Description #include "basicPsiThermo.H" #include "RASModel.H" #include "fixedGradientFvPatchFields.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,16 +46,16 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p_rgh.storePrevIter(); rho.storePrevIter(); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 6f39aff1c14..17bf590f295 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -14,7 +14,7 @@ surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); phi -= buoyancyPhi; - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -24,7 +24,7 @@ p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); p_rghEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { // Calculate the conservative fluxes phi -= p_rghEqn.flux(); diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C index 51aaaadae37..70fc2900883 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ Description #include "RASModel.H" #include "fixedGradientFvPatchFields.H" #include "radiationModel.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,16 +49,16 @@ int main(int argc, char *argv[]) #include "createRadiationModel.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p_rgh.storePrevIter(); rho.storePrevIter(); diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C index e25669e04ad..1c7863c2ff5 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C @@ -48,6 +48,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "RASModel.H" +#include "simpleControl.H" template<class Type> void zeroCells @@ -74,16 +75,16 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p.storePrevIter(); laminarTransport.lookup("lambda") >> lambda; @@ -121,7 +122,7 @@ int main(int argc, char *argv[]) adjustPhi(phi, U, p); // Non-orthogonal pressure corrector loop - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -131,7 +132,7 @@ int main(int argc, char *argv[]) pEqn.setReference(pRefCell, pRefValue); pEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi -= pEqn.flux(); } @@ -184,7 +185,7 @@ int main(int argc, char *argv[]) adjustPhi(phia, Ua, pa); // Non-orthogonal pressure corrector loop - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix paEqn ( @@ -194,7 +195,7 @@ int main(int argc, char *argv[]) paEqn.setReference(paRefCell, paRefValue); paEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phia -= paEqn.flux(); } diff --git a/applications/solvers/incompressible/pimpleFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/UEqn.H index b897eec4b59..08c06d3f461 100644 --- a/applications/solvers/incompressible/pimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/UEqn.H @@ -11,7 +11,7 @@ UEqn().relax(); volScalarField rAU(1.0/UEqn().A()); -if (momentumPredictor) +if (pimple.momentumPredictor()) { solve(UEqn() == -fvc::grad(p)); } diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index 0a4e6b1aaa4..da9b7581bfc 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -1,6 +1,6 @@ U = rAU*UEqn().H(); -if (nCorr <= 1) +if (pimple.nCorr() <= 1) { UEqn.clear(); } @@ -11,7 +11,7 @@ phi = (fvc::interpolate(U) & mesh.Sf()) adjustPhi(phi, U, p); // Non-orthogonal pressure corrector loop -for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { // Pressure corrector fvScalarMatrix pEqn @@ -23,18 +23,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= pEqn.flux(); } diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H index 652773fea7b..e43a40b94b2 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H @@ -11,7 +11,7 @@ UEqn().relax(); rAU = 1.0/UEqn().A(); -if (momentumPredictor) +if (pimple.momentumPredictor()) { solve(UEqn() == -fvc::grad(p)); } diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H index f137c0027fa..e112db4621f 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H @@ -50,7 +50,7 @@ pcorrTypes ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pcorrEqn ( @@ -60,7 +60,7 @@ pcorrEqn.setReference(pRefCell, pRefValue); pcorrEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= pcorrEqn.flux(); } diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H index 81a46f227b2..7e84ef50fe6 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H @@ -1,6 +1,6 @@ U = rAU*UEqn().H(); -if (nCorr <= 1) +if (pimple.nCorr() <= 1) { UEqn.clear(); } @@ -14,7 +14,7 @@ if (p.needReference()) fvc::makeAbsolute(phi, U); } -for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -25,18 +25,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= pEqn.flux(); } diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C index 14c7c6fdc7e..6b5901eac86 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C @@ -60,7 +60,6 @@ int main(int argc, char *argv[]) { #include "readControls.H" #include "CourantNo.H" - pimple.read(); // Make the fluxes absolute fvc::makeAbsolute(phi, U); @@ -89,7 +88,7 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p.storePrevIter(); } @@ -97,7 +96,7 @@ int main(int argc, char *argv[]) #include "UEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H index 8835bb6b482..8f48f5d7d43 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H @@ -1,5 +1,6 @@ #include "readTimeControls.H" - #include "readPIMPLEControls.H" + + const dictionary& pimpleDict = pimple.dict(); const bool correctPhi = pimpleDict.lookupOrDefault("correctPhi", false); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index 6e2683d69c7..215947c1e85 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -56,10 +56,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "CourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -68,7 +66,7 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p.storePrevIter(); } @@ -76,7 +74,7 @@ int main(int argc, char *argv[]) #include "UEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/incompressible/simpleFoam/createFields.H b/applications/solvers/incompressible/simpleFoam/createFields.H index b957c726505..947da10c9d3 100644 --- a/applications/solvers/incompressible/simpleFoam/createFields.H +++ b/applications/solvers/incompressible/simpleFoam/createFields.H @@ -26,14 +26,13 @@ mesh ); -# include "createPhi.H" + #include "createPhi.H" label pRefCell = 0; scalar pRefValue = 0.0; setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); - singlePhaseTransportModel laminarTransport(U, phi); autoPtr<incompressible::RASModel> turbulence diff --git a/applications/solvers/incompressible/simpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/pEqn.H index 0b1500213a7..4bd84f59c43 100644 --- a/applications/solvers/incompressible/simpleFoam/pEqn.H +++ b/applications/solvers/incompressible/simpleFoam/pEqn.H @@ -7,7 +7,7 @@ adjustPhi(phi, U, p); // Non-orthogonal pressure corrector loop - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -18,7 +18,7 @@ pEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi -= pEqn.flux(); } diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H index d14adbb493d..e4614b70634 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createPorousZones.H @@ -6,13 +6,7 @@ if (pZones.size()) { // nUCorrectors for pressureImplicitPorosity - if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors")) - { - nUCorr = readInt - ( - mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors") - ); - } + nUCorr = simple.dict().lookupOrDefault<int>("nUCorrectors", 0); if (nUCorr > 0) { diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H index a97ff3983cd..5908396d187 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H @@ -11,7 +11,7 @@ UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); adjustPhi(phi, U, p); -for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { tmp<fvScalarMatrix> tpEqn; @@ -35,7 +35,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) tpEqn().solve(); } - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi -= tpEqn().flux(); } diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C index 3507fded850..123fd811ea2 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C @@ -34,6 +34,7 @@ Description #include "singlePhaseTransportModel.H" #include "RASModel.H" #include "porousZones.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,6 +43,9 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" + + simpleControl simple(mesh); + #include "createFields.H" #include "createPorousZones.H" #include "initContinuityErrs.H" @@ -50,12 +54,10 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p.storePrevIter(); // Pressure-velocity SIMPLE corrector diff --git a/applications/solvers/incompressible/simpleFoam/simpleFoam.C b/applications/solvers/incompressible/simpleFoam/simpleFoam.C index fdb5fe0a9dc..af2a9136152 100644 --- a/applications/solvers/incompressible/simpleFoam/simpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/simpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "RASModel.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,16 +44,16 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p.storePrevIter(); // Pressure-velocity SIMPLE corrector diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index 7b8d04206dd..23c30d4561b 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -74,11 +74,9 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPIMPLEControls.H" #include "readChemistryProperties.H" #include "readAdditionalSolutionControls.H" #include "readTimeControls.H" - pimple.read(); runTime++; @@ -94,7 +92,7 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (nOuterCorr != 1) + if (pimple.nOuterCorr() != 1) { p.storePrevIter(); } @@ -106,7 +104,7 @@ int main(int argc, char *argv[]) #include "hsEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H index 35394576f88..e52431f1e88 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H @@ -12,7 +12,7 @@ pZones.addResistance(UEqn); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); } diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H index 4accc5dad90..fcbfad3efb2 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H @@ -32,7 +32,7 @@ + massSource.SuTot() ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -42,18 +42,10 @@ pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += pEqn.flux(); } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H index d58b74ab9c5..e7f242fa5fa 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H @@ -11,7 +11,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index ab9c56dccd0..ac0cfb7cf8d 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -74,10 +74,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPISOControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -101,7 +99,7 @@ int main(int argc, char *argv[]) #include "hsEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 2e9099624ca..de0c04577a0 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -3,7 +3,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); -if (transonic) +if (pimple.transonic()) { surfaceScalarField phid ( @@ -15,7 +15,7 @@ if (transonic) ) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -28,18 +28,10 @@ if (transonic) pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi == pEqn.flux(); } @@ -54,7 +46,7 @@ else + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -67,18 +59,10 @@ else pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += pEqn.flux(); } diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H index 61d805e01df..a64e50a2d24 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H @@ -9,7 +9,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H index 8178c40af52..bbfb5be051c 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H @@ -15,7 +15,7 @@ surfaceScalarField phiU phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); -for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -30,18 +30,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += p_rghEqn.flux(); } diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C index 5ab5dfb8d89..6d0a023ef03 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C @@ -69,11 +69,9 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "compressibleCourantNo.H" #include "setMultiRegionDeltaT.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -96,7 +94,7 @@ int main(int argc, char *argv[]) #include "hsEqn.H" // --- PISO loop - for (int corr=1; corr<=nCorr; corr++) + for (int corr=1; corr<=pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H index 2e8f979be41..31e00d8f35a 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H @@ -10,7 +10,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 0e7e36f0efb..3bf304ceccf 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -3,7 +3,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); -if (transonic) +if (pimple.transonic()) { surfaceScalarField phid ( @@ -15,7 +15,7 @@ if (transonic) ) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -28,18 +28,10 @@ if (transonic) pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi == pEqn.flux(); } @@ -54,7 +46,7 @@ else + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -67,18 +59,10 @@ else pEqn.solve ( - mesh.solver - ( - p.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += pEqn.flux(); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index fd5599736a8..0525585c171 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -67,10 +67,8 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readPIMPLEControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -89,7 +87,7 @@ int main(int argc, char *argv[]) #include "hsEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/multiphase/cavitatingFoam/UEqn.H b/applications/solvers/multiphase/cavitatingFoam/UEqn.H index 01911faaa3d..9a5761b59f3 100644 --- a/applications/solvers/multiphase/cavitatingFoam/UEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/UEqn.H @@ -16,7 +16,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); } diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index 2e35e0bfc38..0c6129ebe7d 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -36,6 +36,7 @@ Description #include "barotropicCompressibilityModel.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,6 +53,8 @@ int main(int argc, char *argv[]) #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" + pimpleControl pimple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -65,13 +68,13 @@ int main(int argc, char *argv[]) runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; - for (int outerCorr=0; outerCorr<nOuterCorr; outerCorr++) + for (int outerCorr=0; outerCorr<pimple.nOuterCorr(); outerCorr++) { #include "rhoEqn.H" #include "gammaPsi.H" #include "UEqn.H" - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index 6b6fc73eb9e..c604539cde3 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -1,5 +1,5 @@ { - if (nOuterCorr == 1) + if (pimple.nOuterCorr() == 1) { p = ( @@ -26,7 +26,7 @@ #include "resetPhivPatches.H" - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -37,16 +37,12 @@ - fvm::laplacian(rAUf, p) ); - if (corr == nCorr-1 && nonOrth == nNonOrthCorr) - { - pEqn.solve(mesh.solver(p.name() + "Final")); - } - else - { - pEqn.solve(mesh.solver(p.name())); - } + pEqn.solve + ( + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) + ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phiv += (phiGradp + pEqn.flux())/rhof; } @@ -82,9 +78,9 @@ U = HbyA - rAU*fvc::grad(p); // Remove the swirl component of velocity for "wedge" cases - if (piso.found("removeSwirl")) + if (pimple.dict().found("removeSwirl")) { - label swirlCmpt(readLabel(piso.lookup("removeSwirl"))); + label swirlCmpt(readLabel(pimple.dict().lookup("removeSwirl"))); Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl; U.field().replace(swirlCmpt, 0.0); diff --git a/applications/solvers/multiphase/cavitatingFoam/readControls.H b/applications/solvers/multiphase/cavitatingFoam/readControls.H index f53e7b9eb1c..0dd2b777807 100644 --- a/applications/solvers/multiphase/cavitatingFoam/readControls.H +++ b/applications/solvers/multiphase/cavitatingFoam/readControls.H @@ -5,5 +5,3 @@ scalar maxAcousticCo readScalar(runTime.controlDict().lookup("maxAcousticCo")) ); - -#include "readPISOControls.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H index 320953ab6fb..257f6d48b53 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H @@ -16,7 +16,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index a6fe17ee9b4..161d30f8a67 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -44,6 +44,7 @@ Description #include "interfaceProperties.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,6 +61,8 @@ int main(int argc, char *argv[]) #include "CourantNo.H" #include "setInitialDeltaT.H" + pimpleControl pimple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -113,7 +116,7 @@ int main(int argc, char *argv[]) turbulence->correct(); // --- Outer-corrector loop - for (int oCorr=0; oCorr<nOuterCorr; oCorr++) + for (int oCorr=0; oCorr<pimple.nOuterCorr(); oCorr++) { #include "alphaEqnsSubCycle.H" @@ -122,7 +125,7 @@ int main(int argc, char *argv[]) #include "UEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<oimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H index 0c1ad0192d0..cdc541f0cd9 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H @@ -4,7 +4,7 @@ tmp<fvScalarMatrix> p_rghEqnComp; - if (transonic) + if (pimple.transonic()) { p_rghEqnComp = ( @@ -39,7 +39,7 @@ - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf(); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqnIncomp ( @@ -55,18 +55,10 @@ ) *p_rghEqnComp() + p_rghEqnIncomp, - mesh.solver - ( - p_rgh.select - ( - oCorr == nOuterCorr-1 - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { dgdt = (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1)) diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/readControls.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/readControls.H index a2e4ef3747f..c93b1c0bfa6 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/readControls.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/readControls.H @@ -1,15 +1,8 @@ - #include "readPISOControls.H" - #include "readTimeControls.H" + #include "readTimeControls.H" - label nAlphaCorr - ( - readLabel(piso.lookup("nAlphaCorr")) - ); + label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); - label nAlphaSubCycles - ( - readLabel(piso.lookup("nAlphaSubCycles")) - ); + label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); if (nAlphaSubCycles > 1 && nOuterCorr != 1) { @@ -19,14 +12,8 @@ << exit(FatalError); } - bool correctPhi = true; - if (piso.found("correctPhi")) - { - correctPhi = Switch(piso.lookup("correctPhi")); - } + bool correctPhi = + pimple.dict().lookupOrDefault<Switch>("correctPhi", true); - bool checkMeshCourantNo = false; - if (piso.found("checkMeshCourantNo")) - { - checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo")); - } + bool checkMeshCourantNo = + pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 4aed5e9c07d..fda51d85467 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -41,6 +41,7 @@ Description #include "interfaceProperties.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,6 +57,8 @@ int main(int argc, char *argv[]) #include "CourantNo.H" #include "setInitialDeltaT.H" + pimpleControl pimple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -71,7 +74,7 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; // --- Outer-corrector loop - for (int oCorr=0; oCorr<nOuterCorr; oCorr++) + for (int oCorr=0; oCorr<pimple.nOuterCorr(); oCorr++) { #include "alphaEqnsSubCycle.H" @@ -80,7 +83,7 @@ int main(int argc, char *argv[]) #include "UEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 047f2f3c4c4..3378fe4b5dc 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -39,7 +39,7 @@ - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf(); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqnIncomp ( @@ -55,18 +55,10 @@ ) *p_rghEqnComp() + p_rghEqnIncomp, - mesh.solver - ( - p_rgh.select - ( - oCorr == nOuterCorr-1 - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { dgdt = (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1)) diff --git a/applications/solvers/multiphase/compressibleInterFoam/readControls.H b/applications/solvers/multiphase/compressibleInterFoam/readControls.H index 7e23354f47f..f66da8e5f9f 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/readControls.H +++ b/applications/solvers/multiphase/compressibleInterFoam/readControls.H @@ -1,14 +1,13 @@ - #include "readPISOControls.H" #include "readTimeControls.H" label nAlphaCorr ( - readLabel(piso.lookup("nAlphaCorr")) + readLabel(pimple.dict().lookup("nAlphaCorr")) ); label nAlphaSubCycles ( - readLabel(piso.lookup("nAlphaSubCycles")) + readLabel(pimple.dict().lookup("nAlphaSubCycles")) ); if (nAlphaSubCycles > 1 && nOuterCorr != 1) diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index 7f28e63e946..74cffd74953 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,6 +44,7 @@ Description #include "twoPhaseMixture.H" #include "turbulenceModel.H" #include "fvcSmooth.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,9 +53,11 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readPISOControls.H" #include "initContinuityErrs.H" #include "createFields.H" + + pimpleControl pimple(mesh); + #include "correctPhi.H" #include "CourantNo.H" #include "setInitialrDeltaT.H" @@ -65,8 +68,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" - runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; @@ -76,13 +77,19 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + turbulence->correct(); - #include "UEqn.H" - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } runTime.write(); diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H index 593b3503e18..b59b0ae5fe2 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H @@ -1,6 +1,8 @@ -label nAlphaCorr(readLabel(piso.lookup("nAlphaCorr"))); +const dictionary& pimpleDict = pimple.dict(); -label nAlphaSubCycles(readLabel(piso.lookup("nAlphaSubCycles"))); +label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr"))); + +label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); if (nAlphaSubCycles > 1) { diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/setInitialrDeltaT.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/setInitialrDeltaT.H index 210c65627d4..c7ac1758481 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/setInitialrDeltaT.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/setInitialrDeltaT.H @@ -1,6 +1,6 @@ scalar maxDeltaT ( - piso.lookupOrDefault<scalar>("maxDeltaT", GREAT) + pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT) ); volScalarField rDeltaT diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H index 208d01b4847..8525a8bf673 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H @@ -1,52 +1,54 @@ { + const dictionary& pimpleDict = pimple.dict(); + scalar maxCo ( - piso.lookupOrDefault<scalar>("maxCo", 0.9) + pimpleDict.lookupOrDefault<scalar>("maxCo", 0.9) ); scalar maxAlphaCo ( - piso.lookupOrDefault<scalar>("maxAlphaCo", 0.2) + pimpleDict.lookupOrDefault<scalar>("maxAlphaCo", 0.2) ); scalar rDeltaTSmoothingCoeff ( - piso.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1) + pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1) ); label nAlphaSpreadIter ( - piso.lookupOrDefault<label>("nAlphaSpreadIter", 1) + pimpleDict.lookupOrDefault<label>("nAlphaSpreadIter", 1) ); scalar alphaSpreadDiff ( - piso.lookupOrDefault<scalar>("alphaSpreadDiff", 0.2) + pimpleDict.lookupOrDefault<scalar>("alphaSpreadDiff", 0.2) ); scalar alphaSpreadMax ( - piso.lookupOrDefault<scalar>("alphaSpreadMax", 0.99) + pimpleDict.lookupOrDefault<scalar>("alphaSpreadMax", 0.99) ); scalar alphaSpreadMin ( - piso.lookupOrDefault<scalar>("alphaSpreadMin", 0.01) + pimpleDict.lookupOrDefault<scalar>("alphaSpreadMin", 0.01) ); label nAlphaSweepIter ( - piso.lookupOrDefault<label>("nAlphaSweepIter", 5) + pimpleDict.lookupOrDefault<label>("nAlphaSweepIter", 5) ); scalar rDeltaTDampingCoeff ( - piso.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0) + pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0) ); scalar maxDeltaT ( - piso.lookupOrDefault<scalar>("maxDeltaT", GREAT) + pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT) ); volScalarField rDeltaT0("rDeltaT0", rDeltaT); @@ -130,7 +132,7 @@ label nAlphaSubCycles ( - readLabel(piso.lookup("nAlphaSubCycles")) + readLabel(pimpleDict.lookup("nAlphaSubCycles")) ); rSubDeltaT = rDeltaT*nAlphaSubCycles; diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C index 4c0d33eeb20..8eff1637e24 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,7 @@ Description #include "twoPhaseMixture.H" #include "turbulenceModel.H" #include "MRFZones.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,11 +52,13 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readPISOControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createMRFZones.H" #include "readTimeControls.H" + + pimpleControl pimple(mesh); + #include "correctPhi.H" #include "CourantNo.H" #include "setInitialDeltaT.H" @@ -66,7 +69,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" #include "readTimeControls.H" #include "CourantNo.H" #include "alphaCourantNo.H" @@ -81,12 +83,16 @@ int main(int argc, char *argv[]) #include "alphaEqnSubCycle.H" #include "zonePhaseVolumes.H" - #include "UEqn.H" - - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } turbulence->correct(); diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/UEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/UEqn.H index 80e9d09b3b5..c26df020198 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/UEqn.H +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/UEqn.H @@ -17,7 +17,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H index e4f8247bac6..d281e177c8e 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H @@ -19,7 +19,7 @@ - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf(); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -30,13 +30,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/interFoam/UEqn.H b/applications/solvers/multiphase/interFoam/UEqn.H index 320953ab6fb..257f6d48b53 100644 --- a/applications/solvers/multiphase/interFoam/UEqn.H +++ b/applications/solvers/multiphase/interFoam/UEqn.H @@ -16,7 +16,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H index 073d058bfa0..8dbb489c8d2 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H @@ -1,12 +1,6 @@ -label nAlphaCorr -( - readLabel(piso.lookup("nAlphaCorr")) -); +label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); -label nAlphaSubCycles -( - readLabel(piso.lookup("nAlphaSubCycles")) -); +label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); if (nAlphaSubCycles > 1) { @@ -19,7 +13,7 @@ if (nAlphaSubCycles > 1) !(++alphaSubCycle).end(); ) { -# include "alphaEqn.H" + #include "alphaEqn.H" rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; } @@ -27,7 +21,7 @@ if (nAlphaSubCycles > 1) } else { -# include "alphaEqn.H" + #include "alphaEqn.H" } interface.correct(); diff --git a/applications/solvers/multiphase/interFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/correctPhi.H index e08d3702e87..cb3503e7b8d 100644 --- a/applications/solvers/multiphase/interFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/correctPhi.H @@ -34,7 +34,7 @@ adjustPhi(phi, U, pcorr); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pcorrEqn ( @@ -44,7 +44,7 @@ pcorrEqn.setReference(pRefCell, pRefValue); pcorrEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= pcorrEqn.flux(); } diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index 174cba3e1a2..34dea334e8f 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -128,7 +128,7 @@ ( p, p_rgh, - mesh.solutionDict().subDict("PISO"), + mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue ); diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index d5259138116..5bda42694bb 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,6 +39,7 @@ Description #include "interfaceProperties.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,10 +48,12 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createDynamicFvMesh.H" - #include "readPISOControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "readTimeControls.H" + + pimpleControl pimple(mesh); + #include "correctPhi.H" #include "CourantNo.H" #include "setInitialDeltaT.H" @@ -105,12 +108,16 @@ int main(int argc, char *argv[]) #include "alphaEqnSubCycle.H" - #include "UEqn.H" - - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } turbulence->correct(); diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H index 5bf3ca9418b..84c1fe45b6a 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H @@ -18,7 +18,7 @@ - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf(); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -29,13 +29,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H b/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H index 3640d73adc6..d4e332ff38e 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H @@ -1,14 +1,6 @@ -# include "readTimeControls.H" -# include "readPISOControls.H" + #include "readTimeControls.H" - bool correctPhi = true; - if (piso.found("correctPhi")) - { - correctPhi = Switch(piso.lookup("correctPhi")); - } - - bool checkMeshCourantNo = false; - if (piso.found("checkMeshCourantNo")) - { - checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo")); - } + bool correctPhi = + pimple.dict().lookupOrDefault<Switch>("correctPhi", true); + bool checkMeshCourantNo = + pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false); diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 98cd759b4f5..a297b5fcab0 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ Description The momentum and other fluid properties are of the "mixture" and a single momentum equation is solved. - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. For a two-fluid approach see twoPhaseEulerFoam. @@ -44,6 +44,7 @@ Description #include "twoPhaseMixture.H" #include "turbulenceModel.H" #include "interpolationTable.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,7 +53,9 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readPISOControls.H" + + pimpleControl pimple(mesh); + #include "initContinuityErrs.H" #include "createFields.H" #include "readTimeControls.H" @@ -60,6 +63,7 @@ int main(int argc, char *argv[]) #include "CourantNo.H" #include "setInitialDeltaT.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -80,12 +84,16 @@ int main(int argc, char *argv[]) #include "alphaEqnSubCycle.H" - #include "UEqn.H" - - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } turbulence->correct(); diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index db1eccc5a53..d75a76766ab 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -18,7 +18,7 @@ - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf(); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -29,13 +29,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/UEqn.H b/applications/solvers/multiphase/interFoam/porousInterFoam/UEqn.H index 72ae38ba068..155c0527b73 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/UEqn.H +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/UEqn.H @@ -22,7 +22,7 @@ pZones.addResistance(UEqn); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C index f0949e290e7..5059e559733 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,6 +45,7 @@ Description #include "twoPhaseMixture.H" #include "turbulenceModel.H" #include "porousZones.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,11 +54,13 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readPISOControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createPorousZones.H" #include "readTimeControls.H" + + pimpleControl pimple(mesh); + #include "correctPhi.H" #include "CourantNo.H" #include "setInitialDeltaT.H" @@ -68,7 +71,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" #include "readTimeControls.H" #include "CourantNo.H" #include "alphaCourantNo.H" @@ -82,12 +84,16 @@ int main(int argc, char *argv[]) #include "alphaEqnSubCycle.H" - #include "UEqn.H" - - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } turbulence->correct(); diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H index 81e09f9b900..d816f8acedf 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H @@ -1,12 +1,6 @@ -label nAlphaCorr -( - readLabel(piso.lookup("nAlphaCorr")) -); - -label nAlphaSubCycles -( - readLabel(piso.lookup("nAlphaSubCycles")) -); +const dictionary& pimpleDict = pimple.dict(); +label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr"))); +label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); if (nAlphaSubCycles > 1) { @@ -19,7 +13,7 @@ if (nAlphaSubCycles > 1) !(++alphaSubCycle).end(); ) { -# include "alphaEqns.H" + #include "alphaEqns.H" rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; } @@ -27,7 +21,7 @@ if (nAlphaSubCycles > 1) } else { -# include "alphaEqns.H" + #include "alphaEqns.H" } interface.correct(); diff --git a/applications/solvers/multiphase/interMixingFoam/createFields.H b/applications/solvers/multiphase/interMixingFoam/createFields.H index 8ef77a5546d..60543dc8262 100644 --- a/applications/solvers/multiphase/interMixingFoam/createFields.H +++ b/applications/solvers/multiphase/interMixingFoam/createFields.H @@ -150,7 +150,7 @@ ( p, p_rgh, - mesh.solutionDict().subDict("PISO"), + mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue ); diff --git a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C index 5da002283a9..496e2772ea8 100644 --- a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C +++ b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,7 @@ Description #include "threePhaseMixture.H" #include "threePhaseInterfaceProperties.H" #include "turbulenceModel.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,12 +46,14 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "readGravitationalAcceleration.H" - #include "readPISOControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "readTimeControls.H" #include "CourantNo.H" #include "setInitialDeltaT.H" + + pimpleControl pimple(mesh); + #include "correctPhi.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,7 +62,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" #include "readTimeControls.H" #include "CourantNo.H" #include "alphaCourantNo.H" @@ -74,12 +76,17 @@ int main(int argc, char *argv[]) #include "alphaEqnsSubCycle.H" #define twoPhaseProperties threePhaseProperties - #include "UEqn.H" - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } #include "continuityErrs.H" diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H index 042f6f18a11..b8fe82ff142 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H @@ -17,7 +17,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index eea578e6e58..b68160e62d4 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -11,15 +11,11 @@ surfaceScalarField rhoPhi ); { - label nAlphaCorr - ( - readLabel(piso.lookup("nAlphaCorr")) - ); + const dictionary& pimpleDict = pimple.dict(); - label nAlphaSubCycles - ( - readLabel(piso.lookup("nAlphaSubCycles")) - ); + label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr"))); + + label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); @@ -44,7 +40,7 @@ surfaceScalarField rhoPhi #include "alphaEqn.H" } - if (nOuterCorr == 1) + if (pimple.nOuterCorr() == 1) { interface.correct(); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H index 381e80b8816..60f15ab553b 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H @@ -98,7 +98,7 @@ ( p, p_rgh, - mesh.solutionDict().subDict("PISO"), + mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue ); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index eb03daea93e..2e94017da2a 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -56,27 +56,25 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "readGravitationalAcceleration.H" - #include "readPISOControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "readTimeControls.H" + + pimpleControl pimple(mesh); + #include "../interFoam/correctPhi.H" #include "CourantNo.H" #include "setInitialDeltaT.H" - pimpleControl pimple(mesh); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { - #include "readPIMPLEControls.H" #include "readTimeControls.H" #include "CourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -92,7 +90,7 @@ int main(int argc, char *argv[]) #include "UEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index c15d76312c8..6cfa59cc7c8 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -23,7 +23,7 @@ const volScalarField& vDotcP = vDotP[0](); const volScalarField& vDotvP = vDotP[1](); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -35,18 +35,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi += p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/MRFMultiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/MRFMultiphaseInterFoam.C index 9c1e97eae3f..85198665c6d 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/MRFMultiphaseInterFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/MRFMultiphaseInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,7 @@ Description #include "multiphaseMixture.H" #include "turbulenceModel.H" #include "MRFZones.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,7 +45,9 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readPISOControls.H" + + pimpleControl pimple(mesh); + #include "initContinuityErrs.H" #include "createFields.H" #include "createMRFZones.H" @@ -59,7 +62,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" #include "readTimeControls.H" #include "CourantNo.H" #include "alphaCourantNo.H" @@ -73,12 +75,16 @@ int main(int argc, char *argv[]) rho = mixture.rho(); #include "zonePhaseVolumes.H" - #include "UEqn.H" - - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } turbulence->correct(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/UEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/UEqn.H index b47e7111922..3b860b975a7 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/UEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/UEqn.H @@ -17,7 +17,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H index 8be2e12bf6a..9975ebac832 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H @@ -20,7 +20,7 @@ - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf(); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -31,13 +31,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H index a2145bc0a2d..43ee1e3eb94 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H @@ -16,7 +16,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H index e3ebd107437..78fa0ec3098 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H @@ -76,7 +76,7 @@ ( p, p_rgh, - mesh.solutionDict().subDict("PISO"), + mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue ); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C index feb3bf00a4e..f9d92768eca 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ Description #include "fvCFD.H" #include "multiphaseMixture.H" #include "turbulenceModel.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,10 +44,12 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readPISOControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "readTimeControls.H" + + pimpleControl pimple(mesh); + #include "correctPhi.H" #include "CourantNo.H" #include "setInitialDeltaT.H" @@ -57,7 +60,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" #include "readTimeControls.H" #include "CourantNo.H" #include "alphaCourantNo.H" @@ -70,12 +72,16 @@ int main(int argc, char *argv[]) mixture.solve(); rho = mixture.rho(); - #include "UEqn.H" - - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) { - #include "pEqn.H" + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } } turbulence->correct(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index eecec78206d..3e78c97ab3b 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -245,28 +245,15 @@ void Foam::multiphaseMixture::solve() const Time& runTime = mesh_.time(); - label nAlphaSubCycles - ( - readLabel - ( - mesh_.solutionDict().subDict("PISO").lookup("nAlphaSubCycles") - ) - ); + const dictionary& pimpleDict = mesh_.solutionDict().subDict("PIMPLE"); - label nAlphaCorr - ( - readLabel(mesh_.solutionDict().subDict("PISO").lookup("nAlphaCorr")) - ); + label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); - bool cycleAlpha - ( - Switch(mesh_.solutionDict().subDict("PISO").lookup("cycleAlpha")) - ); + label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr"))); - scalar cAlpha - ( - readScalar(mesh_.solutionDict().subDict("PISO").lookup("cAlpha")) - ); + bool cycleAlpha(Switch(pimpleDict.lookup("cycleAlpha"))); + + scalar cAlpha(readScalar(pimpleDict.lookup("cAlpha"))); volScalarField& alpha = phases_.first(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H index 712fcfc9a1e..78bfc89bb47 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H @@ -19,7 +19,7 @@ - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf(); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -30,13 +30,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/settlingFoam/UEqn.H b/applications/solvers/multiphase/settlingFoam/UEqn.H index cd3985b364d..fc750765b72 100644 --- a/applications/solvers/multiphase/settlingFoam/UEqn.H +++ b/applications/solvers/multiphase/settlingFoam/UEqn.H @@ -14,7 +14,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index f359e952542..7b62411d2d1 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -17,7 +17,7 @@ phi = surfaceScalarField phiU("phiU", phi); phi -= ghf*fvc::snGrad(rho)*rAUf*mesh.magSf(); -for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -27,7 +27,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); p_rghEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/settlingFoam/settlingFoam.C b/applications/solvers/multiphase/settlingFoam/settlingFoam.C index c91229abd78..c588ee44c3f 100644 --- a/applications/solvers/multiphase/settlingFoam/settlingFoam.C +++ b/applications/solvers/multiphase/settlingFoam/settlingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,6 +37,7 @@ Description #include "Switch.H" #include "plasticViscosity.H" #include "yieldStress.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,20 +51,21 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + pimpleControl pimple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (pimple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readPISOControls.H" #include "compressibleCourantNo.H" #include "rhoEqn.H" - for (int oCorr=0; oCorr<nOuterCorr; oCorr++) + for (int oCorr=0; oCorr<pimple.nOuterCorr(); oCorr++) { #include "calcVdj.H" @@ -74,7 +76,7 @@ int main(int argc, char *argv[]) #include "correctViscosity.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H index 5d9a317e086..3dbb3747743 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H @@ -16,7 +16,7 @@ UEqn.relax(); - if (momentumPredictor) + if (pimple.momentumPredictor()) { solve ( diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index 42e85e1db9e..01b6442e9df 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -14,7 +14,7 @@ phi = phiU - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf(); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix p_rghEqn ( @@ -25,18 +25,10 @@ p_rghEqn.solve ( - mesh.solver - ( - p_rgh.select - ( - pimple.finalIter() - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - ) + mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth))) ); - if (nonOrth == nNonOrthCorr) + if (nonOrth == pimple.nNonOrthCorr()) { phi -= p_rghEqn.flux(); } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index fb06b7fed3b..89ab5aebb3f 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -44,7 +44,6 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "readGravitationalAcceleration.H" - #include "readPIMPLEControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "readTimeControls.H" @@ -59,11 +58,9 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPIMPLEControls.H" #include "readTimeControls.H" #include "CourantNo.H" #include "setDeltaT.H" - pimple.read(); runTime++; @@ -79,7 +76,7 @@ int main(int argc, char *argv[]) #include "UEqn.H" // --- PISO loop - for (int corr=0; corr<nCorr; corr++) + for (int corr=0; corr<pimple.nCorr(); corr++) { #include "pEqn.H" } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H index 00581cd3024..95395d97d4b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H @@ -234,4 +234,4 @@ label pRefCell = 0; scalar pRefValue = 0.0; - setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); + setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H b/applications/solvers/multiphase/twoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H index b9563363897..a345c4e53bc 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H @@ -1,6 +1,5 @@ -# include "readTimeControls.H" -# include "readPISOControls.H" + #include "readTimeControls.H" - int nAlphaCorr(readInt(piso.lookup("nAlphaCorr"))); + int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr"))); - Switch correctAlpha(piso.lookup("correctAlpha")); + Switch correctAlpha(pimple.dict().lookup("correctAlpha")); diff --git a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C index 6366738579e..0e5b8c3776a 100644 --- a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C +++ b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,7 @@ Description #include "singlePhaseTransportModel.H" #include "RASModel.H" #include "MRFZones.H" +#include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,16 +47,16 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "initContinuityErrs.H" + simpleControl simple(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "readSIMPLEControls.H" - p.storePrevIter(); // Pressure-velocity SIMPLE corrector @@ -82,7 +83,7 @@ int main(int argc, char *argv[]) adjustPhi(phi, U, p); // Non-orthogonal pressure corrector loop - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) { fvScalarMatrix pEqn ( @@ -92,7 +93,7 @@ int main(int argc, char *argv[]) pEqn.setReference(pRefCell, pRefValue); pEqn.solve(); - if (nonOrth == nNonOrthCorr) + if (nonOrth == simple.nNonOrthCorr()) { phi -= pEqn.flux(); } -- GitLab