View Issue Details [ Jump to Notes ]  [ Issue History ] [ Print ]  
ID  Project  Category  View Status  Date Submitted  Last Update  

0002940  OpenFOAM  [All Projects] Bug  public  20180517 15:32  20180517 18:17  
Reporter  jherb  
Assigned To  will  
Priority  normal  Severity  minor  Reproducibility  always  
Status  resolved  Resolution  fixed  
Platform  SUSE Linux Enterprise Server 11  OS  Linux  OS Version  3.0.101  
Product Version  dev  
Target Version  Fixed in Version  dev  
Summary  0002940: PIMPLE does not iterate, if in timestep before number of necessary iterations is equal to nOuterCorrectors  
Description  If the number of PIMPLE iterations need to fulfill the residual requirements set in outerCorrectorResidualControl is equal to nOuterCorrectors (all set in fvSolution), then in the next time step PIMPLE does not iterate but outputs: PIMPLE: Converged in 0 iterations  
Steps To Reproduce  Using OpenFOAMdev/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct First change the system/controlDict. New values (to get identical restart run results): writeInterval 1; writeFormat binary; Execute ./Allrun Then change system/controlDict again. New value: startTime 7; Change system/fvSolution. New value: nOuterCorrectors 2; mv log.rhoPimpleFoam old.log.rhoPimpleFoam ./Allrun In the first run, this is the output in the log file for timesteps 8 s and later: ____________________________________________________________________________________ Time = 8 PIMPLE: Iteration 1 smoothSolver: Solving for Ux, Initial residual = 4.33037e06, Final residual = 2.08479e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.30926e06, Final residual = 2.0136e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 9.45506e05, Final residual = 3.21708e06, No Iterations 1 smoothSolver: Solving for e, Initial residual = 1.43576e05, Final residual = 1.31123e06, No Iterations 1 DICPCG: Solving for p, Initial residual = 3.08693e06, Final residual = 8.87503e08, No Iterations 24 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 5.97541e05, global = 3.3469e06, cumulative = 0.00358342 smoothSolver: Solving for epsilon, Initial residual = 9.48373e07, Final residual = 9.48373e07, No Iterations 0 smoothSolver: Solving for k, Initial residual = 3.55765e06, Final residual = 7.17866e07, No Iterations 1 PIMPLE: Converged Doing final iteration PIMPLE: Iteration 2 smoothSolver: Solving for Ux, Initial residual = 4.24171e06, Final residual = 2.05965e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.23842e06, Final residual = 1.95878e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 9.22534e05, Final residual = 6.29434e07, No Iterations 2 smoothSolver: Solving for e, Initial residual = 1.52115e05, Final residual = 2.49614e07, No Iterations 2 DICPCG: Solving for p, Initial residual = 3.07657e06, Final residual = 9.57752e08, No Iterations 26 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 6.44819e05, global = 1.90759e05, cumulative = 0.0036025 smoothSolver: Solving for epsilon, Initial residual = 1.07213e06, Final residual = 1.71639e07, No Iterations 1 smoothSolver: Solving for k, Initial residual = 3.17391e06, Final residual = 6.54683e07, No Iterations 1 PIMPLE: Converged in 2 iterations ExecutionTime = 38.82 s ClockTime = 39 s Courant Number mean: 6525.72 max: 11819.3 Time = 9 PIMPLE: Iteration 1 smoothSolver: Solving for Ux, Initial residual = 4.14288e06, Final residual = 1.98479e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.12589e06, Final residual = 1.89745e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 8.95432e05, Final residual = 2.97655e06, No Iterations 1 smoothSolver: Solving for e, Initial residual = 1.78261e05, Final residual = 1.75574e06, No Iterations 1 DICPCG: Solving for p, Initial residual = 2.92131e06, Final residual = 9.16218e08, No Iterations 27 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 6.16892e05, global = 1.98661e05, cumulative = 0.00362236 smoothSolver: Solving for epsilon, Initial residual = 7.49049e07, Final residual = 7.49049e07, No Iterations 0 smoothSolver: Solving for k, Initial residual = 3.00834e06, Final residual = 6.25409e07, No Iterations 1 PIMPLE: Converged Doing final iteration PIMPLE: Iteration 2 smoothSolver: Solving for Ux, Initial residual = 4.04031e06, Final residual = 1.91454e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.03987e06, Final residual = 1.84729e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 8.70923e05, Final residual = 5.46896e07, No Iterations 2 smoothSolver: Solving for e, Initial residual = 1.64377e05, Final residual = 2.78802e07, No Iterations 2 DICPCG: Solving for p, Initial residual = 2.90363e06, Final residual = 9.07084e08, No Iterations 27 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 6.10832e05, global = 1.81893e05, cumulative = 0.00364055 smoothSolver: Solving for epsilon, Initial residual = 8.44288e07, Final residual = 8.44288e07, No Iterations 0 smoothSolver: Solving for k, Initial residual = 3.13604e06, Final residual = 6.45061e07, No Iterations 1 PIMPLE: Converged in 2 iterations ExecutionTime = 38.96 s ClockTime = 39 s Courant Number mean: 6525.72 max: 11819.3 Time = 10 PIMPLE: Iteration 1 smoothSolver: Solving for Ux, Initial residual = 3.94443e06, Final residual = 1.84849e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 3.94806e06, Final residual = 1.79024e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 8.51759e05, Final residual = 2.77371e06, No Iterations 1 smoothSolver: Solving for e, Initial residual = 1.02609e05, Final residual = 2.47591e07, No Iterations 2 DICPCG: Solving for p, Initial residual = 2.81695e06, Final residual = 8.93614e08, No Iterations 27 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 6.01718e05, global = 1.47119e05, cumulative = 0.00365527 smoothSolver: Solving for epsilon, Initial residual = 9.50203e07, Final residual = 9.50203e07, No Iterations 0 smoothSolver: Solving for k, Initial residual = 3.27113e06, Final residual = 6.67643e07, No Iterations 1 PIMPLE: Converged Doing final iteration PIMPLE: Iteration 2 smoothSolver: Solving for Ux, Initial residual = 3.85296e06, Final residual = 1.78797e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 3.86151e06, Final residual = 1.73941e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 8.32573e05, Final residual = 5.03187e07, No Iterations 2 smoothSolver: Solving for e, Initial residual = 8.66523e06, Final residual = 2.1521e07, No Iterations 2 DICPCG: Solving for p, Initial residual = 2.75921e06, Final residual = 8.14953e08, No Iterations 27 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 5.48743e05, global = 9.12916e06, cumulative = 0.00366439 smoothSolver: Solving for epsilon, Initial residual = 1.06319e06, Final residual = 1.71247e07, No Iterations 1 smoothSolver: Solving for k, Initial residual = 2.8671e06, Final residual = 5.99262e07, No Iterations 1 PIMPLE: Converged in 2 iterations ExecutionTime = 39.11 s ClockTime = 39 s End ____________________________________________________________________________________ In the second run, this is the output in the log file for timesteps 8 s and later: ____________________________________________________________________________________ Time = 8 PIMPLE: Iteration 1 smoothSolver: Solving for Ux, Initial residual = 4.33036e06, Final residual = 2.08477e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.30974e06, Final residual = 2.01438e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 9.46642e05, Final residual = 3.25408e06, No Iterations 1 smoothSolver: Solving for e, Initial residual = 1.43566e05, Final residual = 1.31108e06, No Iterations 1 DICPCG: Solving for p, Initial residual = 3.12325e06, Final residual = 8.87888e08, No Iterations 24 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 5.97802e05, global = 3.34696e06, cumulative = 3.34696e06 smoothSolver: Solving for epsilon, Initial residual = 9.49547e07, Final residual = 9.49547e07, No Iterations 0 smoothSolver: Solving for k, Initial residual = 3.55613e06, Final residual = 7.17605e07, No Iterations 1 PIMPLE: Converged Doing final iteration PIMPLE: Iteration 2 smoothSolver: Solving for Ux, Initial residual = 4.24156e06, Final residual = 2.06003e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.23924e06, Final residual = 1.96007e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 9.2452e05, Final residual = 6.41801e07, No Iterations 2 smoothSolver: Solving for e, Initial residual = 1.51228e05, Final residual = 2.49621e07, No Iterations 2 DICPCG: Solving for p, Initial residual = 3.12412e06, Final residual = 9.79475e08, No Iterations 26 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 6.5944e05, global = 1.90824e05, cumulative = 2.24294e05 smoothSolver: Solving for epsilon, Initial residual = 1.0726e06, Final residual = 1.71641e07, No Iterations 1 smoothSolver: Solving for k, Initial residual = 3.17538e06, Final residual = 6.54843e07, No Iterations 1 PIMPLE: Not converged within 2 iterations ExecutionTime = 0.34 s ClockTime = 0 s Courant Number mean: 6525.72 max: 11819.3 Time = 9 PIMPLE: Converged in 0 iterations ExecutionTime = 0.35 s ClockTime = 0 s Courant Number mean: 6525.72 max: 11819.3 Time = 10 PIMPLE: Iteration 1 smoothSolver: Solving for Ux, Initial residual = 4.14258e06, Final residual = 1.98506e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.12611e06, Final residual = 1.89728e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 8.9668e05, Final residual = 3.00103e06, No Iterations 1 smoothSolver: Solving for e, Initial residual = 1.83517e05, Final residual = 1.76029e06, No Iterations 1 DICPCG: Solving for p, Initial residual = 2.92582e06, Final residual = 9.22451e08, No Iterations 27 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 6.21077e05, global = 1.99193e05, cumulative = 4.23487e05 smoothSolver: Solving for epsilon, Initial residual = 7.49046e07, Final residual = 7.49046e07, No Iterations 0 smoothSolver: Solving for k, Initial residual = 3.00869e06, Final residual = 6.25421e07, No Iterations 1 PIMPLE: Converged Doing final iteration PIMPLE: Iteration 2 smoothSolver: Solving for Ux, Initial residual = 4.04034e06, Final residual = 1.91405e07, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 4.04001e06, Final residual = 1.8477e07, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 8.70832e05, Final residual = 5.45265e07, No Iterations 2 smoothSolver: Solving for e, Initial residual = 1.68857e05, Final residual = 2.77335e07, No Iterations 2 DICPCG: Solving for p, Initial residual = 2.90348e06, Final residual = 9.12439e08, No Iterations 27 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 6.14449e05, global = 1.82105e05, cumulative = 6.05592e05 smoothSolver: Solving for epsilon, Initial residual = 8.4398e07, Final residual = 8.4398e07, No Iterations 0 smoothSolver: Solving for k, Initial residual = 3.1359e06, Final residual = 6.45064e07, No Iterations 1 PIMPLE: Not converged within 2 iterations ExecutionTime = 0.52 s ClockTime = 0 s End ____________________________________________________________________________________  
Additional Information  So there seems to be a bug, if the needed number of outer iterations is equal to the maximal number set in fvSolution. Also, these outputs are inconsistent: Time = 8 ... PIMPLE: Converged Doing final iteration PIMPLE: Iteration 2 ... PIMPLE: Not converged within 2 iterations ... Time = 9 PIMPLE: Converged in 0 iterations ExecutionTime = 0.35 s ClockTime = 0 s Courant Number mean: 6525.72 max: 11819.3 Time = 10 PIMPLE: Iteration 1 ... This bug also appears using other solvers (I just use the tutorial, because it should be reproducible elsewhere and is the only one with outerCorrectorResidualControl setup), e.g. chtMultiRegionFoam. Last checkout of OpenFOAMdev is: commit ab610d20ad5833dd051f50b4e8a215488875468d Author: Will Bainbridge <http://cfd.direct> Date: Wed May 16 13:16:46 2018 +0100 The solver log header: /**\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: dev   \\ / A nd  Web: www.OpenFOAM.org   \\/ M anipulation   \**/ Build : devab610d20ad58 Exec : rhoPimpleFoam Date : May 17 2018 Time : 16:15:15 OpenFOAM was compiled with icc (ICC) 18.0.0 20170811  
Tags  pimpleControl  
Attached Files 

Notes  
will (manager) 20180517 15:48 
I cannot reproduce this. My build (Gcc 7.3) runs the modified case with two iterations at each of times 8, 9 and 10, none of which are detected as converged. This is the behaviour that I would expect. Can you do a run with the following addition to the controlDict and upload the log, please? DebugSwitches { solutionControl 1; } Are you able to try a build with Gcc to confirm whether or not it is an issue with Icc? 
jherb (reporter) 20180517 16:23 
I can also check it with gcc. What is the number of iterations needed for convergence during the first run with nOuterCorrectors set to (the original) 50? 
will (manager) 20180517 16:44 
It's formally a transient case, so convergence is a pertimestep thing. The first timestep to converge is at 7 seconds, and it happens after 37 iterations. After that, steps 8 to 10 converge immediately. 
jherb (reporter) 20180517 16:53 
So what happens, if you change the value of nOuterCorrectors for the second run not to 2 but to the number of iterations, it takes for Time = 8 s to converge (during the first run)? (I am building the gcc version and report tomorrow, what I get with it). 
will (manager) 20180517 17:13 
I still don't see the problem. Can you generate the log with the solution control debug switch set? 
will (manager) 20180517 17:31 
Apologies, I mistyped one of the steps. I can reproduce this now. No need for the Gcc build. 
will (manager) 20180517 17:41 
I think it's just a matter of swapping the order of the two quit conditions in pimpleControl.C. Logically we should be checking the converged flag and reporting success before checking the iteration counter and reporting failure. This is what's causing the inconsistent logging. The failure to do any iterations at step 9 is due to the converged flag not being reset in the iteration counter exit condition. 
will (manager) 20180517 18:17 
Fixed in dev by commit 4bd59d64 
Issue History  
Date Modified  Username  Field  Change 

20180517 15:32  jherb  New Issue  
20180517 15:32  jherb  Tag Attached: pimpleControl  
20180517 15:48  will  Note Added: 0009590  
20180517 16:23  jherb  Note Added: 0009592  
20180517 16:44  will  Note Added: 0009593  
20180517 16:53  jherb  Note Added: 0009594  
20180517 17:13  will  Note Added: 0009595  
20180517 17:31  will  Note Added: 0009596  
20180517 17:41  will  Note Added: 0009597  
20180517 18:17  will  Assigned To  => will 
20180517 18:17  will  Status  new => resolved 
20180517 18:17  will  Resolution  open => fixed 
20180517 18:17  will  Fixed in Version  => dev 
20180517 18:17  will  Note Added: 0009598 