
[Sponsors] 
February 14, 2017, 10:16 
How to use PIMPLE properly?

#1 
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 245
Rep Power: 13 
Background:
I am simulating a rising bubble in OF41 with the interFoam solver. To do so, I am currently using a uniform mesh with cubic cells (aspect ratio 1). There are a total of 90x90x180 cells, which corresponds to 15 cells / bubble diameter. (This is relatively coarse, but should be fine enough to test the below.) This case converges pretty well using only one outer (SIMPLE) iteration and just three inner (PISO) iterations with maxCo=0.5. I decided to check whether using the PIMPLE algorithm  following Tobi's guide  might speed up my simulation. Problem (I mean, challenge): The PIMPLE algorithm slows down my simulation considerably, which is because the solution does not (barely) improve with successive outer iterations. maxCo is only 2. (Which means that each timestep must at most take a factor four longer to be faster than the maxCo=0.5 simulation.) Log file (snippet): Code:
Courant Number mean: 0.000976416 max: 1.44982 Interface Courant Number mean: 0.000135741 max: 1.05712 deltaT = 7.14286e05 Time = 0.0035 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 0.00797562, Final residual = 6.12225e08, No Iterations 3 Phase1 volume fraction = 0.998807 Min(alpha.water) = 2.79909e07 Max(alpha.water) = 1.0002 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.000994 Max(alpha.water) = 1.0002 GAMG: Solving for p_rgh, Initial residual = 0.135337, Final residual = 0.000314987, No Iterations 2 time step continuity errors : sum local = 5.46316e07, global = 1.47295e10, cumulative = 2.1714e07 GAMG: Solving for p_rgh, Initial residual = 0.0940134, Final residual = 0.000266503, No Iterations 2 time step continuity errors : sum local = 4.6467e07, global = 6.43504e10, cumulative = 2.17783e07 GAMG: Solving for p_rgh, Initial residual = 0.0941178, Final residual = 0.00025847, No Iterations 2 time step continuity errors : sum local = 4.50745e07, global = 8.69603e10, cumulative = 2.18653e07 PIMPLE: iteration 2 smoothSolver: Solving for alpha.water, Initial residual = 0.00645469, Final residual = 1.00334e09, No Iterations 3 Phase1 volume fraction = 0.998807 Min(alpha.water) = 2.06368e07 Max(alpha.water) = 1.00028 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.00122852 Max(alpha.water) = 1.00028 GAMG: Solving for p_rgh, Initial residual = 0.086505, Final residual = 0.000338267, No Iterations 2 time step continuity errors : sum local = 7.40111e07, global = 3.00883e10, cumulative = 2.18954e07 GAMG: Solving for p_rgh, Initial residual = 0.0606414, Final residual = 0.000265495, No Iterations 2 time step continuity errors : sum local = 5.8013e07, global = 7.78486e10, cumulative = 2.19732e07 GAMG: Solving for p_rgh, Initial residual = 0.0606601, Final residual = 0.000258879, No Iterations 2 time step continuity errors : sum local = 5.65676e07, global = 8.99989e10, cumulative = 2.20632e07 PIMPLE: iteration 3 smoothSolver: Solving for alpha.water, Initial residual = 0.00582153, Final residual = 2.94448e09, No Iterations 3 Phase1 volume fraction = 0.998807 Min(alpha.water) = 2.78524e07 Max(alpha.water) = 1.00023 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.00139389 Max(alpha.water) = 1.00023 GAMG: Solving for p_rgh, Initial residual = 0.080493, Final residual = 0.000340901, No Iterations 2 time step continuity errors : sum local = 6.77737e07, global = 1.80287e10, cumulative = 2.20813e07 GAMG: Solving for p_rgh, Initial residual = 0.0560016, Final residual = 0.000246158, No Iterations 2 time step continuity errors : sum local = 4.90191e07, global = 1.04078e09, cumulative = 2.21853e07 GAMG: Solving for p_rgh, Initial residual = 0.0560882, Final residual = 0.000241618, No Iterations 2 time step continuity errors : sum local = 4.81123e07, global = 1.22133e09, cumulative = 2.23075e07 PIMPLE: iteration 4 smoothSolver: Solving for alpha.water, Initial residual = 0.00559932, Final residual = 9.83465e10, No Iterations 3 Phase1 volume fraction = 0.998807 Min(alpha.water) = 2.60849e07 Max(alpha.water) = 1.0002 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.000778589 Max(alpha.water) = 1.0002 GAMG: Solving for p_rgh, Initial residual = 0.0612285, Final residual = 0.000199755, No Iterations 2 time step continuity errors : sum local = 4.25689e07, global = 2.24356e09, cumulative = 2.25318e07 GAMG: Solving for p_rgh, Initial residual = 0.0427183, Final residual = 0.000117493, No Iterations 2 time step continuity errors : sum local = 2.50063e07, global = 4.87422e09, cumulative = 2.30193e07 GAMG: Solving for p_rgh, Initial residual = 0.0427806, Final residual = 0.000118101, No Iterations 2 time step continuity errors : sum local = 2.51322e07, global = 4.84618e09, cumulative = 2.35039e07 (...) PIMPLE: iteration 198 smoothSolver: Solving for alpha.water, Initial residual = 0.00473282, Final residual = 8.68777e10, No Iterations 3 Phase1 volume fraction = 0.998807 Min(alpha.water) = 1.54224e07 Max(alpha.water) = 1.0002 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.000778275 Max(alpha.water) = 1.0002 GAMG: Solving for p_rgh, Initial residual = 0.0242179, Final residual = 1.44059e05, No Iterations 2 time step continuity errors : sum local = 3.02184e08, global = 2.22393e10, cumulative = 1.3677e07 GAMG: Solving for p_rgh, Initial residual = 0.0168498, Final residual = 1.09407e05, No Iterations 2 time step continuity errors : sum local = 2.29456e08, global = 2.17156e10, cumulative = 1.36987e07 GAMG: Solving for p_rgh, Initial residual = 0.0168702, Final residual = 1.08204e05, No Iterations 2 time step continuity errors : sum local = 2.26937e08, global = 2.14002e10, cumulative = 1.37201e07 PIMPLE: iteration 199 smoothSolver: Solving for alpha.water, Initial residual = 0.00473242, Final residual = 1.01542e09, No Iterations 3 Phase1 volume fraction = 0.998807 Min(alpha.water) = 1.50747e07 Max(alpha.water) = 1.0002 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.00100276 Max(alpha.water) = 1.0002 GAMG: Solving for p_rgh, Initial residual = 0.0231552, Final residual = 1.27849e05, No Iterations 2 time step continuity errors : sum local = 2.60952e08, global = 7.02594e11, cumulative = 1.37131e07 GAMG: Solving for p_rgh, Initial residual = 0.0160877, Final residual = 9.21079e06, No Iterations 2 time step continuity errors : sum local = 1.8809e08, global = 7.69685e11, cumulative = 1.37054e07 GAMG: Solving for p_rgh, Initial residual = 0.0161063, Final residual = 9.18537e06, No Iterations 2 time step continuity errors : sum local = 1.87572e08, global = 7.68037e11, cumulative = 1.36977e07 PIMPLE: iteration 200 smoothSolver: Solving for alpha.water, Initial residual = 0.00473295, Final residual = 8.68842e10, No Iterations 3 Phase1 volume fraction = 0.998807 Min(alpha.water) = 1.54225e07 Max(alpha.water) = 1.0002 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.0007774 Max(alpha.water) = 1.0002 GAMG: Solving for p_rgh, Initial residual = 0.0384742, Final residual = 4.37332e05, No Iterations 2 time step continuity errors : sum local = 3.03523e07, global = 2.45412e10, cumulative = 1.36732e07 GAMG: Solving for p_rgh, Initial residual = 0.00193055, Final residual = 7.99627e06, No Iterations 2 time step continuity errors : sum local = 5.51445e08, global = 6.02003e10, cumulative = 1.3613e07 GAMG: Solving for p_rgh, Initial residual = 0.000402165, Final residual = 6.91129e09, No Iterations 19 time step continuity errors : sum local = 4.76783e11, global = 1.11926e11, cumulative = 1.36119e07 PIMPLE: not converged within 200 iterations and (2) the solution does not (or barely) improve with successive outer iterations. Then, remarkably, in the very last iteration convergence is great! This is presumably because underrelaxation is disabled. This is something I have seen several times before, but I have never understood. The relevant files are listed below. I should add that changing relTol for p_rgh from 1e02 to 1e03 yields a slightly better result, which still is not close to converging after 200 outer iterations. Reducing the underrelaxation factors from 0.3 to 0.1 is yet much better, allowing PIMPLE to converge in 130 iterations, which ... is still an awful lot of iterations. Furthermore, over time it increased to 180 iterations. Further reducing the underrelaxation factor from 0.1 to 0.01 yields a better residual (~5e3) after 200 iterations, but PIMPLE still did not converge. Question: But then, how can PIMPLE ever yield a better(=faster) result than having only one outer iteration...? In other words, what am I doing incorrectly? Relevant Files: controlDict: Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 4.0   \\ / A nd  Web: www.OpenFOAM.org   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.070; deltaT 1e6; writeControl adjustableRunTime; writeInterval 5e4; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep yes; maxCo 2; maxAlphaCo 2; maxDeltaT 1; libs ( "libsimpleFunctionObjects.so" "libsimpleSwakFunctionObjects.so" "libswakLagrangianParser.so" "libswakFunctionObjects.so" "libsimpleLagrangianFunctionObjects.so" ); functions { #include "bubPositionDict" //Monitors the position of the bubble over time } // ************************************************************************* // Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 4.0   \\ / A nd  Web: www.OpenFOAM.org   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.water.*" { nAlphaCorr 2; nAlphaSubCycles 1; cAlpha 1; MULESCorr yes; nLimiterIter 2; solver smoothSolver; smoother symGaussSeidel; tolerance 1e07; relTol 0; } p_rgh { solver GAMG; tolerance 1e08; relTol 1e02; smoother DIC; //nPreSweeps 0; //nPostSweeps 2; //nFinestSweeps 2; cacheAgglomeration no; //nCellsInCoarsestLevel 10; //agglomerator faceAreaPair; //mergeLevels 1; } p_rghFinal { $p_rgh; relTol 0; } "pcorr.*" { $p_rghFinal; tolerance 1e04; } U { solver smoothSolver; smoother GaussSeidel; tolerance 1e07; // Doesn't do anything with momentumPredictor=no relTol 1e03; // Doesn't do anything with momentumPredictor=no nSweeps 1; } UFinal { $U; relTol 0; } "(kBnuTilda)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e08; relTol 0; } } PIMPLE { momentumPredictor no; nOuterCorrectors 200; nCorrectors 3; nNonOrthogonalCorrectors 0; pRefPoint (0 0 0); pRefValue 0; residualControl { U { tolerance 1e06; relTol 0; } p_rgh { tolerance 1e07; relTol 0; } } } relaxationFactors { fields { p_rgh 0.3; p_rghFinal 1; } equations { "alpha.*Ukepsilon" 0.3; "(alpha.*Ukepsilon)Final" 1; } } // ************************************************************************* // Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 4.0   \\ / A nd  Web: www.OpenFOAM.org   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; // div((muEff*dev(T(grad(U))))) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; } // ************************************************************************* // Thanks in advance. 

February 14, 2017, 12:11 

#2 
Senior Member

Hi,
Couple of questions: 1. Do you really need this tight convergence criterion? I.e. 1e7 is surely nice, yet, not quite sure your will find MUCH difference with 1e4. 2. Using underrelaxation allows you to get "faster" convergence but on final iteration there will be no relaxation and your initial residual become much larger, than your convergence criterion. You can also use underrelaxation factor 0, so you always be using old converged field and number of iterations will be dramatically reduced. 3. Finally Code:
Phase1 volume fraction = 0.998807 Min(alpha.water) = 0.0007774 Max(alpha.water) = 1.0002 

February 14, 2017, 13:16 

#3 
Senior Member
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 313
Rep Power: 4 
Dear Kevin,
the number of outer correctors and therewith the calculation time should be controled with the residuals. Please try first to let nOuterCorrectors to a high value and limit it by let's say Code:
residualControl { U { tolerance 1e03; relTol 0; } p_rgh { tolerance 1e03; relTol 0; } }
__________________
Uwe Pilz  Sie ahnen nicht, wieviel Poesie in der Berechnung einer Logarithmentafel enthalten ist (Carl Friedrich Gauß) 

February 15, 2017, 05:04 

#4  
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 245
Rep Power: 13 
Thank you for your replies.
Quote:
I'll compare with 1e4. Quote:
I understand that using a value 0 implies using the old converged fields. I reckon it will result in small residuals simply because the solution is not changing. However, I don't see how this can be a good thing? I reckon it will result in the first N1 outer iterations doing nothing, and the final iteration (without underrelaxation) doing all the work == PISO. I'm quite sure, yes. The field is behaving appropriately when I used only one outer iteration (i.e. PISO). Furthermore, using settings for which the PIMPLE loop does converge, remains inside its [0,1] bounds. Just for reference, the BCs are: : Bottom/Side (wall): zeroGradient Top (atmosphere): inletOutlet; value 1 = air; : Bottom/Side (wall): zero velocity (uniformFixedValue (0 0 0)) Top (atmosphere): pressureInletOutletVelocity : Bottom/Side (wall): zero gradient (fixedFluxPressure 0) Top (atmosphere): totalPressure Quote:
The problem in the above logfile was that after 200 iterations the solution did not drop below 1e2 yet, meaning setting it to 1e3 wouldn't change anything either. Or do you mean setting it to yet much higher than 200, hoping that in later timesteps the solution does converge much faster?  By chance, a simulation of last night did converge in 100 iterations (to 1e7) [it reached 1e4 after about 35 iterations]. The only difference with the simulation of above logfile is that I reduced underrelaxation of p_rgh from 0.3 to 0.1. Therefore, I'm inclined to conclude that the value 0.3 was highly unfortunate, causing the solution to basically overshoot the solution harmonically, resulting in no convergence. I'll play around with a weaker convergence criterion and lower underrelaxation factors. 

February 20, 2017, 07:58 

#5 
Member
Ricky
Join Date: Jul 2014
Location: Germany
Posts: 52
Rep Power: 5 
Hello FOAMers,
I am also trying to do the same. In my case I have added TEqn (with extra source terms) in interFoam. All I wanted to do at first was to use Pimple loop with max Co. 3 (with adjustable time steps), however the solver crashes (especially alpha) and when I run the case with lower time steps (and by not using adjustable time steps) the solver runs fine and pimple loop converges with few iterations. Boundary Conditions: Code:
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.metal; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { upperWall { type zeroGradient; } leftWall { type constantAlphaContactAngle; theta0 90; limit gradient; value uniform 0; } rightWall { type constantAlphaContactAngle; theta0 90; limit gradient; value uniform 0; } lowerWall { type zeroGradient; } frontAndBack { type empty; } } Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { default Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; div(rhoPhi,U) Gauss limitedLinearV 1; div(phi,thermo:rho.metal) Gauss upwind; div(phi,thermo:rho.air) Gauss upwind; div(rhoPhi,T) Gauss limitedLinear01 1; div(rhoPhi,K) Gauss upwind; div(phi,p) Gauss upwind; div(phi,k) Gauss upwind; div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear uncorrected; } interpolationSchemes { default linear; } snGradSchemes { default uncorrected; } fluxRequired { default no; p_rgh; pcorr; } Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { alpha.metal { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; } ".*(rhorhoFinal)" { solver diagonal; } pcorr { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e05; relTol 0; smoother DICGaussSeidel; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } tolerance 1e05; relTol 0; maxIter 100; } p_rgh { solver GAMG; tolerance 1e07; relTol 0.01; smoother DIC; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } p_rghFinal { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e07; relTol 0; nVcycles 2; smoother DICGaussSeidel; nPreSweeps 2; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } tolerance 1e07; relTol 0; maxIter 20; } "(UT).*" { solver PBiCG; preconditioner DILU; tolerance 1e6; relTol 0.1; } /* U { solver smoothSolver; smoother GaussSeidel; tolerance 1e06; relTol 0; nSweeps 1; } "(TkBnuTilda).*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e7; relTol 0; }*/ } PIMPLE { momentumPredictor no; transonic no; nOuterCorrectors 15; nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0.0; residualControl { U { tolerance 1e5; relTol 0; } T { tolerance 1e5; relTol 0; } p_rgh { tolerance 1e3; relTol 0; } } relaxationFactors { fields { p_rgh 0.3; p_rghFinal 1; } equations { U 0.7; T 0.7; "alpha.*" 0.7; "(UTalpha.*)Final" 1; } } } Code:
Create time Create mesh for time = 0 PIMPLE: max iterations = 15 field U : relTol 0, tolerance 1e05 field T : relTol 0, tolerance 1e05 field p_rgh : relTol 0, tolerance 0.001 Reading field p_rgh Reading field U Reading/calculating face flux field phi Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian Reading marangoniTerms Reading marangoniTerms Selecting turbulence model type laminar Reading g Calculating field g.h No finite volume options present time step continuity errors : sum local = 0, global = 0, cumulative = 0 GAMGPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Courant Number mean: 0 max: 0 Starting time loop Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 deltaT = 0.00011999 Time = 0.00011999 PIMPLE: iteration 1 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 0 Max(alpha1) = 1 DILUPBiCG: Solving for T, Initial residual = 1.52944e05, Final residual = 2.09562e05, No Iterations 5 gammaSolve CONVERGED in 5 Iterations GAMG: Solving for p_rgh, Initial residual = 0.999992, Final residual = 0.000911696, No Iterations 1 time step continuity errors : sum local = 0.18636, global = 1.9992e16, cumulative = 1.9992e16 GAMG: Solving for p_rgh, Initial residual = 0.988129, Final residual = 0.00692632, No Iterations 5 time step continuity errors : sum local = 0.00188921, global = 1.24894e19, cumulative = 2.00045e16 PIMPLE: iteration 2 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 0 Max(alpha1) = 1.27482 DILUPBiCG: Solving for T, Initial residual = 0.15788, Final residual = 1.9161e08, No Iterations 34 gammaSolve CONVERGED in 34 Iterations GAMG: Solving for p_rgh, Initial residual = 0.929794, Final residual = 0.00366765, No Iterations 4 time step continuity errors : sum local = 0.000312566, global = 1.61339e19, cumulative = 1.99884e16 GAMG: Solving for p_rgh, Initial residual = 0.252356, Final residual = 0.00113828, No Iterations 4 time step continuity errors : sum local = 9.30599e06, global = 3.37308e21, cumulative = 1.9988e16 PIMPLE: iteration 3 . . . . . . PIMPLE: iteration 15 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 0.000200768 Max(alpha1) = 1.00016 DILUPBiCG: Solving for T, Initial residual = 0.00123988, Final residual = 8.26378e10, No Iterations 9 gammaSolve CONVERGED in 7 Iterations GAMG: Solving for p_rgh, Initial residual = 0.9994, Final residual = 0.0015772, No Iterations 1 time step continuity errors : sum local = 8.64201e06, global = 3.84479e22, cumulative = 1.99884e16 GAMGPCG: Solving for p_rgh, Initial residual = 0.00329089, Final residual = 1.93664e08, No Iterations 5 time step continuity errors : sum local = 1.1703e10, global = 9.98082e23, cumulative = 1.99884e16 PIMPLE: not converged within 15 iterations ExecutionTime = 0.76 s ClockTime = 1 s Courant Number mean: 8.62149e05 max: 0.019126 Interface Courant Number mean: 4.02458e06 max: 0.019126 deltaT = 0.000143971 Time = 0.000263962 PIMPLE: iteration 1 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 2.26313e06 Max(alpha1) = 1 DILUPBiCG: Solving for T, Initial residual = 0.00384329, Final residual = 1.12649e05, No Iterations 8 gammaSolve CONVERGED in 6 Iterations GAMG: Solving for p_rgh, Initial residual = 0.996876, Final residual = 0.00150053, No Iterations 1 time step continuity errors : sum local = 3.7005e06, global = 1.47312e22, cumulative = 1.99884e16 GAMG: Solving for p_rgh, Initial residual = 0.00505313, Final residual = 4.2576e05, No Iterations 4 time step continuity errors : sum local = 7.26956e08, global = 1.37257e22, cumulative = 1.99884e16 PIMPLE: iteration 2 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 4.47203e05 Max(alpha1) = 1.00002 DILUPBiCG: Solving for T, Initial residual = 0.000983497, Final residual = 6.52094e07, No Iterations 4 gammaSolve CONVERGED in 4 Iterations GAMG: Solving for p_rgh, Initial residual = 0.995449, Final residual = 0.00143503, No Iterations 1 time step continuity errors : sum local = 6.01372e06, global = 1.44792e21, cumulative = 1.99886e16 GAMG: Solving for p_rgh, Initial residual = 0.00266226, Final residual = 9.27126e06, No Iterations 5 time step continuity errors : sum local = 5.09921e08, global = 7.36318e22, cumulative = 1.99886e16 PIMPLE: iteration 3 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 1.09703e06 Max(alpha1) = 1 DILUPBiCG: Solving for T, Initial residual = 0.00163286, Final residual = 9.46957e07, No Iterations 10 gammaSolve CONVERGED in 7 Iterations GAMG: Solving for p_rgh, Initial residual = 0.994572, Final residual = 0.00119417, No Iterations 1 time step continuity errors : sum local = 4.42903e06, global = 1.74449e23, cumulative = 1.99886e16 GAMG: Solving for p_rgh, Initial residual = 0.00406946, Final residual = 3.92242e05, No Iterations 3 time step continuity errors : sum local = 1.86995e07, global = 3.13402e22, cumulative = 1.99887e16 PIMPLE: iteration 4 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 0.000587911 Max(alpha1) = 1.00047 DILUPBiCG: Solving for T, Initial residual = 0.00277735, Final residual = 1.20527e06, No Iterations 9 gammaSolve CONVERGED in 6 Iterations GAMG: Solving for p_rgh, Initial residual = 0.999226, Final residual = 0.00163561, No Iterations 1 time step continuity errors : sum local = 2.22823e05, global = 4.45425e21, cumulative = 1.99891e16 GAMG: Solving for p_rgh, Initial residual = 0.00309879, Final residual = 1.62382e05, No Iterations 5 time step continuity errors : sum local = 2.81532e07, global = 1.87072e21, cumulative = 1.99893e16 . . . . PIMPLE: iteration 12 MULES: Solving for alpha.metal Phase1 volume fraction = 0.806452 Min(alpha1) = 0.120187 Max(alpha1) = 1.03931 DILUPBiCG: Solving for T, Initial residual = 0.0530859, Final residual = 2.93419e07, No Iterations 15 gammaSolve CONVERGED in 15 Iterations #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 in "/lib/x86_64linuxgnu/libc.so.6" #3 double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #4 Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? #5 Foam::GAMGSolver::solveCoarsestLevel(Foam::Field<double>&, Foam::Field<double> const&) const at ??:? #6 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:? #7 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? #8 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:? #9 Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:? #10 at ??:? #11 __libc_start_main in "/lib/x86_64linuxgnu/libc.so.6" #12 at ??:? Floating point exception (core dumped) Thanks in advance. Regards, Ricky
__________________
If it is easy, then something is fishy! Last edited by kera; February 20, 2017 at 09:32. 

February 20, 2017, 08:34 

#6 
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 245
Rep Power: 13 
Euh? You are using a bigger maxCo than me (= more unstable), but far less iterations. I was using 200 PIMPLE loops, and even then it wouldn't converge. So obviously it is not going to converge for you.
For instance, your initial residual for p_rgh is 0.999 in your final iteration... If it were any higher, the simulation would blow up instantly, therefore it blows up in due time. 

February 20, 2017, 09:11 

#7  
Member
Ricky
Join Date: Jul 2014
Location: Germany
Posts: 52
Rep Power: 5 
Quote:
yeah I know the example I shared with you guys was the extreme condition of the case I was trying. I initially started without adjustable time steps and using very small delta_T. I observed that it didn't required too many PIMPLE loops as PIMPLE converges within 10 iterations. so I maxed my PIMPLE Iteration value to 15. Then I started playing around with Co. and max Co. 3 was the extreme I was using. However the solver crashes even setting Co. to 1 (i.e., with adjustable time steps). Later I tried to just increase the time step from 1e5 to 5e5 (without adjustable) it still crashed. It seem that for some reason the solver responds well only to time step 1e5 or lower. So I was wondering, what I was doing wrong and hence shared my simulation settings here,so that maybe someone with experience may figure out the silly things/mistakes I might be probably doing, as I am kinda new to OpenFOAM. Thanks in advance. Regards, Ricky
__________________
If it is easy, then something is fishy! 

February 22, 2017, 13:05 

#8 
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 245
Rep Power: 13 
Regarding my matter, I have played around some more.
residualControl 1e4: As was to be expected, using a lower convergence criterion may result in the PIMPLE loop to be truncated. For instance, using 2x200 iterations (inner x outer), it would truncate after 4060 PIMPLE loops; using 3x200 iterations, it would truncate after 15 PIMPLE loops. Both cases use 1e4 for both velocity and pressure, with a relTol of 1e2. However, sometimes the loop would randomly not converge, and use the maximum of 200 iterations. For example: Code:
Courant Number mean: 5.78162e06 max: 0.0502205 Interface Courant Number mean: 1.85919e06 max: 0.0278548 deltaT = 3.53748e06 Time = 1.53653e05 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 0.000138561, Final residual = 2.42003e08, No Iterations 1 Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99334e05 Max(alpha.water) = 1.0022 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99334e05 Max(alpha.water) = 1.0022 GAMG: Solving for p_rgh, Initial residual = 0.00997852, Final residual = 7.87455e05, No Iterations 1 time step continuity errors : sum local = 6.0439e09, global = 5.59866e12, cumulative = 5.95127e09 GAMG: Solving for p_rgh, Initial residual = 0.00698256, Final residual = 5.85491e05, No Iterations 1 time step continuity errors : sum local = 4.49712e09, global = 5.51211e12, cumulative = 5.94575e09 GAMG: Solving for p_rgh, Initial residual = 0.0069824, Final residual = 5.78619e05, No Iterations 1 time step continuity errors : sum local = 4.44434e09, global = 5.48796e12, cumulative = 5.94027e09 PIMPLE: iteration 2 smoothSolver: Solving for alpha.water, Initial residual = 0.000121902, Final residual = 1.6192e08, No Iterations 1 Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99282e05 Max(alpha.water) = 1.0022 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99282e05 Max(alpha.water) = 1.0022 GAMG: Solving for p_rgh, Initial residual = 0.00811384, Final residual = 6.74661e05, No Iterations 1 time step continuity errors : sum local = 5.17509e09, global = 6.19006e12, cumulative = 5.93408e09 GAMG: Solving for p_rgh, Initial residual = 0.00567394, Final residual = 5.06996e05, No Iterations 1 time step continuity errors : sum local = 3.89126e09, global = 6.66072e12, cumulative = 5.92742e09 GAMG: Solving for p_rgh, Initial residual = 0.0056749, Final residual = 5.00646e05, No Iterations 1 time step continuity errors : sum local = 3.84252e09, global = 6.78585e12, cumulative = 5.92063e09 (...) PIMPLE: iteration 13 smoothSolver: Solving for alpha.water, Initial residual = 0.000127866, Final residual = 1.74908e08, No Iterations 1 Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99321e05 Max(alpha.water) = 1.0022 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99321e05 Max(alpha.water) = 1.0022 GAMG: Solving for p_rgh, Initial residual = 0.000100243, Final residual = 2.09242e06, No Iterations 1 time step continuity errors : sum local = 1.60489e10, global = 5.21436e12, cumulative = 5.867e09 GAMG: Solving for p_rgh, Initial residual = 7.03431e05, Final residual = 7.03431e05, No Iterations 0 time step continuity errors : sum local = 5.39538e09, global = 4.82634e12, cumulative = 5.87182e09 GAMG: Solving for p_rgh, Initial residual = 9.12762e05, Final residual = 9.12762e05, No Iterations 0 time step continuity errors : sum local = 7.00093e09, global = 4.70905e12, cumulative = 5.87653e09 PIMPLE: iteration 14 smoothSolver: Solving for alpha.water, Initial residual = 0.000127844, Final residual = 1.74961e08, No Iterations 1 Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99317e05 Max(alpha.water) = 1.0022 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 3.99317e05 Max(alpha.water) = 1.0022 GAMG: Solving for p_rgh, Initial residual = 0.00833255, Final residual = 7.07639e05, No Iterations 1 time step continuity errors : sum local = 7.73113e09, global = 3.59177e12, cumulative = 5.88012e09 GAMG: Solving for p_rgh, Initial residual = 9.76716e05, Final residual = 9.76716e05, No Iterations 0 time step continuity errors : sum local = 1.06395e08, global = 3.58804e12, cumulative = 5.88371e09 GAMG: Solving for p_rgh, Initial residual = 9.81798e05, Final residual = 9.81798e05, No Iterations 0 time step continuity errors : sum local = 1.06949e08, global = 3.58802e12, cumulative = 5.8873e09 PIMPLE: converged in 14 iterations ExecutionTime = 4910.01 s ClockTime = 4924 s (...) somewhat later (...) Courant Number mean: 0.000306073 max: 0.714215 Interface Courant Number mean: 9.84419e05 max: 0.569494 deltaT = 5.05051e05 Time = 0.00059596 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 0.0074356, Final residual = 3.97399e06, No Iterations 2 Phase1 volume fraction = 0.998806 Min(alpha.water) = 1.23599e05 Max(alpha.water) = 1.00207 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998806 Min(alpha.water) = 4.58158e05 Max(alpha.water) = 1.00207 GAMG: Solving for p_rgh, Initial residual = 0.129127, Final residual = 0.000212159, No Iterations 2 time step continuity errors : sum local = 4.67654e07, global = 7.36887e09, cumulative = 4.99229e06 GAMG: Solving for p_rgh, Initial residual = 0.0877543, Final residual = 0.000138468, No Iterations 2 time step continuity errors : sum local = 3.02863e07, global = 9.61841e09, cumulative = 4.98267e06 GAMG: Solving for p_rgh, Initial residual = 0.0875758, Final residual = 0.000137868, No Iterations 2 time step continuity errors : sum local = 3.0156e07, global = 8.63233e09, cumulative = 4.97404e06 PIMPLE: iteration 2 smoothSolver: Solving for alpha.water, Initial residual = 0.00613058, Final residual = 1.74863e05, No Iterations 1 Phase1 volume fraction = 0.998807 Min(alpha.water) = 1.26977e05 Max(alpha.water) = 1.00212 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 6.83868e05 Max(alpha.water) = 1.00212 GAMG: Solving for p_rgh, Initial residual = 0.0505464, Final residual = 6.68601e05, No Iterations 2 time step continuity errors : sum local = 2.59894e07, global = 3.34174e09, cumulative = 4.9707e06 GAMG: Solving for p_rgh, Initial residual = 0.034465, Final residual = 4.85242e05, No Iterations 2 time step continuity errors : sum local = 1.8928e07, global = 3.36974e09, cumulative = 4.96733e06 GAMG: Solving for p_rgh, Initial residual = 0.0345989, Final residual = 4.83563e05, No Iterations 2 time step continuity errors : sum local = 1.88649e07, global = 3.38312e09, cumulative = 4.96395e06 (...) PIMPLE: iteration 198 smoothSolver: Solving for alpha.water, Initial residual = 0.0113192, Final residual = 6.24306e05, No Iterations 1 Phase1 volume fraction = 0.998807 Min(alpha.water) = 1.2685e05 Max(alpha.water) = 1.00215 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998807 Min(alpha.water) = 4.9255e05 Max(alpha.water) = 1.00215 GAMG: Solving for p_rgh, Initial residual = 0.148674, Final residual = 0.000165971, No Iterations 2 time step continuity errors : sum local = 5.6664e07, global = 8.35275e09, cumulative = 1.04967e05 GAMG: Solving for p_rgh, Initial residual = 0.102286, Final residual = 0.000144952, No Iterations 2 time step continuity errors : sum local = 4.96449e07, global = 8.45179e09, cumulative = 1.05052e05 GAMG: Solving for p_rgh, Initial residual = 0.102577, Final residual = 0.000146689, No Iterations 2 time step continuity errors : sum local = 5.02406e07, global = 8.48205e09, cumulative = 1.05136e05 PIMPLE: iteration 199 smoothSolver: Solving for alpha.water, Initial residual = 0.014228, Final residual = 2.09971e05, No Iterations 2 Phase1 volume fraction = 0.998806 Min(alpha.water) = 8.81257e06 Max(alpha.water) = 1.00188 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998806 Min(alpha.water) = 0.000130558 Max(alpha.water) = 1.00188 GAMG: Solving for p_rgh, Initial residual = 0.151508, Final residual = 0.000260614, No Iterations 2 time step continuity errors : sum local = 4.66009e07, global = 6.80941e09, cumulative = 1.05205e05 GAMG: Solving for p_rgh, Initial residual = 0.098692, Final residual = 0.000171859, No Iterations 2 time step continuity errors : sum local = 3.03629e07, global = 6.87803e09, cumulative = 1.05273e05 GAMG: Solving for p_rgh, Initial residual = 0.0956707, Final residual = 0.000926545, No Iterations 1 time step continuity errors : sum local = 1.63263e06, global = 6.69686e09, cumulative = 1.0534e05 PIMPLE: iteration 200 smoothSolver: Solving for alpha.water, Initial residual = 0.011516, Final residual = 6.20229e05, No Iterations 1 Phase1 volume fraction = 0.998806 Min(alpha.water) = 1.2695e05 Max(alpha.water) = 1.0024 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.998806 Min(alpha.water) = 5.29868e05 Max(alpha.water) = 1.0024 GAMG: Solving for p_rgh, Initial residual = 0.142777, Final residual = 0.000140118, No Iterations 2 time step continuity errors : sum local = 6.68283e07, global = 8.67101e09, cumulative = 1.05427e05 GAMG: Solving for p_rgh, Initial residual = 0.00973426, Final residual = 7.50726e05, No Iterations 2 time step continuity errors : sum local = 3.65385e07, global = 8.56944e09, cumulative = 1.05513e05 GAMG: Solving for p_rgh, Initial residual = 0.00190305, Final residual = 6.0703e05, No Iterations 1 time step continuity errors : sum local = 2.94961e07, global = 8.5669e09, cumulative = 1.05598e05 PIMPLE: not converged within 200 iterations ExecutionTime = 12492.6 s ClockTime = 12544 s Given the number of iterations per pressure iteration (0~3), the trouble is not satisfying the pressure equation, but the combined NavierStokes equations (right?). In fact, it appeared to converge in the first few PIMPLE loops, but at some point during the PIMPLE iteration process the residuals increase again. Question 1: Is it a good thing that p_rgh converges within only 0~3 iterations, or is it to be expected that more work should be done within one iteration? Question 2: In the final PIMPLE iterations, no underrelaxation is used. It is then observed that the residuals do decrease rapidly. Does this imply convergence, despite PIMPLE having wasted 199 iterations doing virtually nothing? This is effectively like PISO, isn't it? underrelaxation: Using the much stricted residualControl of 1e7, I had found that using an underrelaxation factor (urf) of 0.3 for p_rgh resulted in successive iterations doing approximately nothing. Reducing the urf to 0.1, resulted in converge after 130 iterations at first, 180 later, and no convergence (within 200 PIMPLE loops) at later timesteps. An urf of 0.01 is prohibitively low, resulting in effectively no convergence (i.e., too slow for 200 PIMPLE loops). So the situation is similar to above log snippet. momentum predictor: Doesn't appear to do anything (w.r.t. convergence rate).  My net conclusion so far is that using maxCo=0.5 instead of maxCo=2 results in a considerably faster simulation. Perhaps it is just my case..., but I seem unable to get PIMPLE to be advantageous. Question 3: Any further suggestions? Thanks in advance. 

February 22, 2017, 15:17 

#9 
Senior Member
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 313
Rep Power: 4 
I had a problem which may be similar. Te simulation crashes even with maxCo way below 1.
The reason for me was a (for the problem) too high value of delta T which induces instabilities during the first steps. The ode crashes much later however. If your simulations runs for a longer time, say for several minutes, it is nearly impossible to choose a delta T too low. The value rises to normal value fast.
__________________
Uwe Pilz  Sie ahnen nicht, wieviel Poesie in der Berechnung einer Logarithmentafel enthalten ist (Carl Friedrich Gauß) 

Tags 
pimple 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
pimpleDyMFoam computation randomly stops  babapeti  OpenFOAM Running, Solving & CFD  4  February 1, 2017 18:55 
PIMPLE – the value of the final underrelaxation factor  Zbynek  OpenFOAM  5  June 24, 2016 11:12 
error while running modified pimple solver  R_21  OpenFOAM Programming & Development  0  May 28, 2015 06:59 
A question on the PIMPLE algorithm  GerhardHolzinger  OpenFOAM Running, Solving & CFD  4  February 13, 2015 07:49 
Help for the small implementation in turbulence model  shipman  OpenFOAM Programming & Development  25  March 19, 2014 11:08 