From f5fd050293258e43d9309fc0d86fb73e7cc48453 Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Wed, 30 Oct 2013 12:50:12 +0000 Subject: [PATCH] VoF solvers: phase-fraction equation and move mesh motion into PIMPLE loop --- .../compressibleInterFoam/createFields.H | 2 +- .../multiphaseMixtureThermo.C | 4 +- .../interFoam/LTSInterFoam/LTSInterFoam.C | 25 +++--- .../interFoam/MRFInterFoam/MRFInterFoam.C | 17 +++-- .../solvers/multiphase/interFoam/Make/options | 2 +- .../solvers/multiphase/interFoam/alphaEqn.H | 4 +- .../multiphase/interFoam/alphaEqnSubCycle.H | 2 - .../multiphase/interFoam/createFields.H | 5 +- .../interFoam/interDyMFoam/interDyMFoam.C | 68 ++++++++++------- .../interFoam/interDyMFoam/readControls.H | 20 +++-- .../solvers/multiphase/interFoam/interFoam.C | 15 +++- .../interFoam/interMixingFoam/createFields.H | 2 +- .../interMixingFoam/interMixingFoam.C | 19 +++-- .../porousInterFoam/porousInterFoam.C | 15 +++- .../interPhaseChangeFoam/alphaEqnSubCycle.H | 14 ---- .../interPhaseChangeDyMFoam.C | 76 ++++++++++++------- .../interPhaseChangeFoam.C | 27 +++++-- .../multiphaseMixture/multiphaseMixture.C | 4 +- .../twoLiquidMixingFoam/createFields.H | 2 +- .../cfdTools/general/include/alphaControls.H | 10 ++- .../pimpleControl/pimpleControl.C | 2 +- .../pimpleControl/pimpleControl.H | 3 + .../pimpleControl/pimpleControlI.H | 12 ++- .../laminar/damBreak/system/controlDict | 4 +- .../laminar/damBreak/system/fvSolution | 36 +++++++-- .../constant/polyMesh/boundary | 2 +- 26 files changed, 252 insertions(+), 140 deletions(-) diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index c7289b23f90..c4edc961d88 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -70,7 +70,7 @@ ( IOobject ( - "rho*phi", + "rhoPhi", runTime.timeName(), mesh, IOobject::NO_READ, diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index 602affd4e00..12dc93795c2 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -83,14 +83,14 @@ Foam::multiphaseMixtureThermo::multiphaseMixtureThermo ( IOobject ( - "rho*phi", + "rhoPhi", mesh_.time().timeName(), mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), mesh_, - dimensionedScalar("rho*phi", dimMass/dimTime, 0.0) + dimensionedScalar("rhoPhi", dimMass/dimTime, 0.0) ), alphas_ diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index 317a18120c1..e9aa9fb9b9e 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C @@ -77,19 +77,26 @@ int main(int argc, char *argv[]) #include "setrDeltaT.H" - twoPhaseProperties.correct(); - - #define LTSSOLVE - #include "alphaEqnSubCycle.H" - #undef LTSSOLVE - - interface.correct(); - - turbulence->correct(); + tmp<surfaceScalarField> tphiAlpha; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + #include "alphaControls.H" + + if (pimple.firstIter() || alphaOuterCorrectors) + { + twoPhaseProperties.correct(); + + #define LTSSOLVE + #include "alphaEqnSubCycle.H" + #undef LTSSOLVE + + interface.correct(); + } + + turbulence->correct(); + #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C index 0fa1a50ee2f..56527781a25 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C @@ -81,15 +81,22 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - twoPhaseProperties.correct(); - - #include "alphaEqnSubCycle.H" - interface.correct(); - #include "zonePhaseVolumes.H" + tmp<surfaceScalarField> tphiAlpha; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + #include "alphaControls.H" + + if (pimple.firstIter() || alphaOuterCorrectors) + { + twoPhaseProperties.correct(); + + #include "alphaEqnSubCycle.H" + interface.correct(); + #include "zonePhaseVolumes.H" + } + #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options index b1cfcac9bd8..8811a53df65 100644 --- a/applications/solvers/multiphase/interFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -ggdb3 \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index b0dd8ebef2a..f6e57df771d 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -6,9 +6,7 @@ phic = min(interface.cAlpha()*phic, max(phic)); surfaceScalarField phir(phic*interface.nHatf()); - tmp<surfaceScalarField> tphiAlpha; - - if (MULESCorr) + if (pimple.firstIter() && MULESCorr) { fvScalarMatrix alpha1Eqn ( diff --git a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H index 81c65c1caf7..5db9f165461 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H @@ -1,5 +1,3 @@ -#include "alphaControls.H" - if (nAlphaSubCycles > 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index f0d18098483..3039171f77a 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -62,13 +62,14 @@ ( IOobject ( - "rho*phi", + "rhoPhi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), - rho1*phi + mesh, + dimensionedScalar("0", dimMass/dimTime, 0) ); diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 4a673c6a3f3..d56e300581d 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -77,46 +77,56 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + tmp<surfaceScalarField> tphiAlpha; - mesh.update(); - - if (mesh.changing()) + // --- Pressure-velocity PIMPLE corrector loop + while (pimple.loop()) { - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - gh = g & mesh.C(); - ghf = g & mesh.Cf(); - } + mesh.update(); - if (mesh.changing() && correctPhi) - { - // Calculate absolute flux from the mapped surface velocity - phi = mesh.Sf() & Uf; + if (mesh.changing()) + { + Info<< "Execution time for mesh.update() = " + << runTime.elapsedCpuTime() - timeBeforeMeshUpdate + << " s" << endl; - #include "correctPhi.H" + gh = g & mesh.C(); + ghf = g & mesh.Cf(); + } - // Make the flux relative to the mesh motion - fvc::makeRelative(phi, U); + if (mesh.changing() && correctPhi) + { + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & Uf; - interface.correct(); - } + #include "correctPhi.H" - if (mesh.changing() && checkMeshCourantNo) - { - #include "meshCourantNo.H" - } + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); - twoPhaseProperties.correct(); + interface.correct(); + } - #include "alphaEqnSubCycle.H" - interface.correct(); + if (mesh.changing() && checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + + #include "alphaControls.H" + + if (pimple.firstIter() || alphaOuterCorrectors) + { + twoPhaseProperties.correct(); + + #include "alphaEqnSubCycle.H" + interface.correct(); + } - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H b/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H index d4e332ff38e..bf8b38f4261 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H @@ -1,6 +1,16 @@ - #include "readTimeControls.H" +#include "readTimeControls.H" - bool correctPhi = - pimple.dict().lookupOrDefault<Switch>("correctPhi", true); - bool checkMeshCourantNo = - pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false); +bool correctPhi +( + pimple.dict().lookupOrDefault<Switch>("correctPhi", true) +); + +bool checkMeshCourantNo +( + pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false) +); + +bool moveMeshOuterCorrectors +( + pimple.dict().lookupOrDefault<Switch>("moveMeshOuterCorrectors", false) +); diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 4ce08d27db0..0ddfed50396 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -80,14 +80,21 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - twoPhaseProperties.correct(); - - #include "alphaEqnSubCycle.H" - interface.correct(); + tmp<surfaceScalarField> tphiAlpha; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + #include "alphaControls.H" + + if (pimple.firstIter() || alphaOuterCorrectors) + { + twoPhaseProperties.correct(); + + #include "alphaEqnSubCycle.H" + interface.correct(); + } + #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H index 196c82194c9..3fd5874d5b4 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H @@ -63,7 +63,7 @@ ( IOobject ( - "rho*phi", + "rhoPhi", runTime.timeName(), mesh, IOobject::NO_READ, diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C index 12bc57d785f..3321da57f9d 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C @@ -74,16 +74,23 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - threePhaseProperties.correct(); - - #include "alphaEqnsSubCycle.H" - interface.correct(); - - #define twoPhaseProperties threePhaseProperties + tmp<surfaceScalarField> tphiAlpha; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + #include "alphaControls.H" + + if (pimple.firstIter() || alphaOuterCorrectors) + { + threePhaseProperties.correct(); + + #include "alphaEqnsSubCycle.H" + interface.correct(); + + #define twoPhaseProperties threePhaseProperties + } + #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C index 3423a4654af..15b44392208 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C @@ -83,14 +83,21 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - twoPhaseProperties.correct(); - - #include "alphaEqnSubCycle.H" - interface.correct(); + tmp<surfaceScalarField> tphiAlpha; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + #include "alphaControls.H" + + if (pimple.firstIter() || alphaOuterCorrectors) + { + twoPhaseProperties.correct(); + + #include "alphaEqnSubCycle.H" + interface.correct(); + } + #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index a4338b907f8..077738ccb29 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -1,18 +1,4 @@ -surfaceScalarField rhoPhi -( - IOobject - ( - "rhoPhi", - runTime.timeName(), - mesh - ), - mesh, - dimensionedScalar("0", dimMass/dimTime, 0) -); - { - #include "alphaControls.H" - surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C index 31fa619754e..0bfd8ad56ea 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C @@ -86,44 +86,64 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + // --- Pressure-velocity PIMPLE corrector loop + while (pimple.loop()) + { + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - mesh.update(); + mesh.update(); - if (mesh.changing()) - { - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; + if (mesh.changing()) + { + Info<< "Execution time for mesh.update() = " + << runTime.elapsedCpuTime() - timeBeforeMeshUpdate + << " s" << endl; - gh = g & mesh.C(); - ghf = g & mesh.Cf(); - } + gh = g & mesh.C(); + ghf = g & mesh.Cf(); + } - if (mesh.changing() && correctPhi) - { - // Calculate absolute flux from the mapped surface velocity - phi = mesh.Sf() & Uf; + if (mesh.changing() && correctPhi) + { + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & Uf; - #include "../interFoam/interDyMFoam/correctPhi.H" + #include "../interFoam/interDyMFoam/correctPhi.H" - // Make the flux relative to the mesh motion - fvc::makeRelative(phi, U); - } + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); + } - if (mesh.changing() && checkMeshCourantNo) - { - #include "meshCourantNo.H" - } + if (mesh.changing() && checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } - twoPhaseProperties->correct(); + #include "alphaControls.H" + + surfaceScalarField rhoPhi + ( + IOobject + ( + "rhoPhi", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("0", dimMass/dimTime, 0) + ); + + if (pimple.firstIter() || alphaOuterCorrectors) + { + twoPhaseProperties->correct(); - #include "alphaEqnSubCycle.H" - interface.correct(); + #include "alphaEqnSubCycle.H" + interface.correct(); + } - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index 28ef7f0a691..2a653dcf37f 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -83,14 +83,31 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - twoPhaseProperties->correct(); - - #include "alphaEqnSubCycle.H" - interface.correct(); - // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + #include "alphaControls.H" + + surfaceScalarField rhoPhi + ( + IOobject + ( + "rhoPhi", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("0", dimMass/dimTime, 0) + ); + + if (pimple.firstIter() || alphaOuterCorrectors) + { + twoPhaseProperties->correct(); + + #include "alphaEqnSubCycle.H" + interface.correct(); + } + #include "UEqn.H" // --- Pressure corrector loop diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 20afd1f72ff..e41b0128603 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -87,14 +87,14 @@ Foam::multiphaseMixture::multiphaseMixture ( IOobject ( - "rho*phi", + "rhoPhi", mesh_.time().timeName(), mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), mesh_, - dimensionedScalar("rho*phi", dimMass/dimTime, 0.0) + dimensionedScalar("rhoPhi", dimMass/dimTime, 0.0) ), alphas_ diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index 18b686f4f8a..31e1e61d5d3 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -54,7 +54,7 @@ ( IOobject ( - "rho*phi", + "rhoPhi", runTime.timeName(), mesh, IOobject::NO_READ, diff --git a/src/finiteVolume/cfdTools/general/include/alphaControls.H b/src/finiteVolume/cfdTools/general/include/alphaControls.H index e7b3cf7794c..e57869309aa 100644 --- a/src/finiteVolume/cfdTools/general/include/alphaControls.H +++ b/src/finiteVolume/cfdTools/general/include/alphaControls.H @@ -1,4 +1,12 @@ const dictionary& alphaControls = mesh.solverDict(alpha1.name()); + label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); + label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); -Switch MULESCorr(alphaControls.lookupOrDefault<Switch>("MULESCorr", false)); + +bool MULESCorr(alphaControls.lookupOrDefault<Switch>("MULESCorr", false)); + +bool alphaOuterCorrectors +( + alphaControls.lookupOrDefault<Switch>("alphaOuterCorrectors", false) +); diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C index 2c89cc4cae0..8329580bffb 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H index 6cb9d3a21f6..43ac8d94f7d 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H @@ -129,6 +129,9 @@ public: //- Helper function to identify when to store the intial residuals inline bool storeInitialResiduals() const; + //- Helper function to identify first PIMPLE (outer) iteration + inline bool firstIter() const; + //- Helper function to identify final PIMPLE (outer) iteration inline bool finalIter() const; diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H index 1d8917de89b..8ac86bdfa88 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,14 +66,20 @@ inline bool Foam::pimpleControl::correct() inline bool Foam::pimpleControl::storeInitialResiduals() const { - // start from second PIMPLE iteration + // Start from second PIMPLE iteration return (corr_ == 2) && (corrPISO_ == 0) && (corrNonOrtho_ == 0); } +inline bool Foam::pimpleControl::firstIter() const +{ + return corr_ == 1; +} + + inline bool Foam::pimpleControl::finalIter() const { - return converged_ || (corr_ == nCorrPIMPLE_); + return converged_ || (corr_ == corrPISO_); } diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict b/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict index bae61318bbd..77ec4eba875 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict +++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict @@ -47,8 +47,8 @@ runTimeModifiable yes; adjustTimeStep yes; -maxCo 0.5; -maxAlphaCo 0.5; +maxCo 1; +maxAlphaCo 1; maxDeltaT 1; diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution index 36156e86145..9e473a78650 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution +++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution @@ -19,16 +19,25 @@ solvers { alpha.water { - nAlphaCorr 1; - nAlphaSubCycles 2; + nAlphaCorr 2; + nAlphaSubCycles 1; + alphaOuterCorrectors yes; cAlpha 1; + + MULESCorr yes; + nLimiterIter 3; + + solver PBiCG; + preconditioner DILU; + tolerance 1e-8; + relTol 0; } pcorr { solver PCG; preconditioner DIC; - tolerance 1e-10; + tolerance 1e-5; relTol 0; } @@ -43,14 +52,13 @@ solvers p_rghFinal { $p_rgh; - tolerance 1e-07; relTol 0; } U { - solver PBiCG; - preconditioner DILU; + solver smoothSolver; + smoother symGaussSeidel; tolerance 1e-06; relTol 0; } @@ -58,10 +66,22 @@ solvers PIMPLE { - momentumPredictor no; - nCorrectors 3; + momentumPredictor no; + nOuterCorrectors 1; + nCorrectors 3; nNonOrthogonalCorrectors 0; } +relaxationFactors +{ + fields + { + } + equations + { + ".*" 1; + } +} + // ************************************************************************* // diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary index 8b9ef8e6450..17c34d0093b 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary @@ -39,7 +39,7 @@ FoamFile bullet { type wall; - nFaces 37752; + nFaces 37743; startFace 1133431; } ) -- GitLab