View Issue Details

IDProjectCategoryView StatusLast Update
0002940OpenFOAMBugpublic2018-05-17 18:17
Reporterjherb Assigned Towill  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformSUSE Linux Enterprise Server 11 OSLinuxOS Version3.0.101
Product Versiondev 
Fixed in Versiondev 
Summary0002940: PIMPLE does not iterate, if in timestep before number of necessary iterations is equal to nOuterCorrectors
DescriptionIf 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 ReproduceUsing OpenFOAM-dev/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.33037e-06, Final residual = 2.08479e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.30926e-06, Final residual = 2.0136e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 9.45506e-05, Final residual = 3.21708e-06, No Iterations 1
smoothSolver: Solving for e, Initial residual = 1.43576e-05, Final residual = 1.31123e-06, No Iterations 1
DICPCG: Solving for p, Initial residual = 3.08693e-06, Final residual = 8.87503e-08, No Iterations 24
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.97541e-05, global = 3.3469e-06, cumulative = 0.00358342
smoothSolver: Solving for epsilon, Initial residual = 9.48373e-07, Final residual = 9.48373e-07, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.55765e-06, Final residual = 7.17866e-07, No Iterations 1
PIMPLE: Converged
        Doing final iteration
PIMPLE: Iteration 2
smoothSolver: Solving for Ux, Initial residual = 4.24171e-06, Final residual = 2.05965e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.23842e-06, Final residual = 1.95878e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 9.22534e-05, Final residual = 6.29434e-07, No Iterations 2
smoothSolver: Solving for e, Initial residual = 1.52115e-05, Final residual = 2.49614e-07, No Iterations 2
DICPCG: Solving for p, Initial residual = 3.07657e-06, Final residual = 9.57752e-08, No Iterations 26
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.44819e-05, global = 1.90759e-05, cumulative = 0.0036025
smoothSolver: Solving for epsilon, Initial residual = 1.07213e-06, Final residual = 1.71639e-07, No Iterations 1
smoothSolver: Solving for k, Initial residual = 3.17391e-06, Final residual = 6.54683e-07, 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.14288e-06, Final residual = 1.98479e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.12589e-06, Final residual = 1.89745e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 8.95432e-05, Final residual = 2.97655e-06, No Iterations 1
smoothSolver: Solving for e, Initial residual = 1.78261e-05, Final residual = 1.75574e-06, No Iterations 1
DICPCG: Solving for p, Initial residual = 2.92131e-06, Final residual = 9.16218e-08, No Iterations 27
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.16892e-05, global = 1.98661e-05, cumulative = 0.00362236
smoothSolver: Solving for epsilon, Initial residual = 7.49049e-07, Final residual = 7.49049e-07, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.00834e-06, Final residual = 6.25409e-07, No Iterations 1
PIMPLE: Converged
        Doing final iteration
PIMPLE: Iteration 2
smoothSolver: Solving for Ux, Initial residual = 4.04031e-06, Final residual = 1.91454e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.03987e-06, Final residual = 1.84729e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 8.70923e-05, Final residual = 5.46896e-07, No Iterations 2
smoothSolver: Solving for e, Initial residual = 1.64377e-05, Final residual = 2.78802e-07, No Iterations 2
DICPCG: Solving for p, Initial residual = 2.90363e-06, Final residual = 9.07084e-08, No Iterations 27
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.10832e-05, global = 1.81893e-05, cumulative = 0.00364055
smoothSolver: Solving for epsilon, Initial residual = 8.44288e-07, Final residual = 8.44288e-07, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.13604e-06, Final residual = 6.45061e-07, 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.94443e-06, Final residual = 1.84849e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 3.94806e-06, Final residual = 1.79024e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 8.51759e-05, Final residual = 2.77371e-06, No Iterations 1
smoothSolver: Solving for e, Initial residual = 1.02609e-05, Final residual = 2.47591e-07, No Iterations 2
DICPCG: Solving for p, Initial residual = 2.81695e-06, Final residual = 8.93614e-08, No Iterations 27
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.01718e-05, global = 1.47119e-05, cumulative = 0.00365527
smoothSolver: Solving for epsilon, Initial residual = 9.50203e-07, Final residual = 9.50203e-07, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.27113e-06, Final residual = 6.67643e-07, No Iterations 1
PIMPLE: Converged
        Doing final iteration
PIMPLE: Iteration 2
smoothSolver: Solving for Ux, Initial residual = 3.85296e-06, Final residual = 1.78797e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 3.86151e-06, Final residual = 1.73941e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 8.32573e-05, Final residual = 5.03187e-07, No Iterations 2
smoothSolver: Solving for e, Initial residual = 8.66523e-06, Final residual = 2.1521e-07, No Iterations 2
DICPCG: Solving for p, Initial residual = 2.75921e-06, Final residual = 8.14953e-08, No Iterations 27
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.48743e-05, global = 9.12916e-06, cumulative = 0.00366439
smoothSolver: Solving for epsilon, Initial residual = 1.06319e-06, Final residual = 1.71247e-07, No Iterations 1
smoothSolver: Solving for k, Initial residual = 2.8671e-06, Final residual = 5.99262e-07, 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.33036e-06, Final residual = 2.08477e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.30974e-06, Final residual = 2.01438e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 9.46642e-05, Final residual = 3.25408e-06, No Iterations 1
smoothSolver: Solving for e, Initial residual = 1.43566e-05, Final residual = 1.31108e-06, No Iterations 1
DICPCG: Solving for p, Initial residual = 3.12325e-06, Final residual = 8.87888e-08, No Iterations 24
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 5.97802e-05, global = 3.34696e-06, cumulative = 3.34696e-06
smoothSolver: Solving for epsilon, Initial residual = 9.49547e-07, Final residual = 9.49547e-07, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.55613e-06, Final residual = 7.17605e-07, No Iterations 1
PIMPLE: Converged
        Doing final iteration
PIMPLE: Iteration 2
smoothSolver: Solving for Ux, Initial residual = 4.24156e-06, Final residual = 2.06003e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.23924e-06, Final residual = 1.96007e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 9.2452e-05, Final residual = 6.41801e-07, No Iterations 2
smoothSolver: Solving for e, Initial residual = 1.51228e-05, Final residual = 2.49621e-07, No Iterations 2
DICPCG: Solving for p, Initial residual = 3.12412e-06, Final residual = 9.79475e-08, No Iterations 26
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.5944e-05, global = 1.90824e-05, cumulative = 2.24294e-05
smoothSolver: Solving for epsilon, Initial residual = 1.0726e-06, Final residual = 1.71641e-07, No Iterations 1
smoothSolver: Solving for k, Initial residual = 3.17538e-06, Final residual = 6.54843e-07, 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.14258e-06, Final residual = 1.98506e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.12611e-06, Final residual = 1.89728e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 8.9668e-05, Final residual = 3.00103e-06, No Iterations 1
smoothSolver: Solving for e, Initial residual = 1.83517e-05, Final residual = 1.76029e-06, No Iterations 1
DICPCG: Solving for p, Initial residual = 2.92582e-06, Final residual = 9.22451e-08, No Iterations 27
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.21077e-05, global = 1.99193e-05, cumulative = 4.23487e-05
smoothSolver: Solving for epsilon, Initial residual = 7.49046e-07, Final residual = 7.49046e-07, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.00869e-06, Final residual = 6.25421e-07, No Iterations 1
PIMPLE: Converged
        Doing final iteration
PIMPLE: Iteration 2
smoothSolver: Solving for Ux, Initial residual = 4.04034e-06, Final residual = 1.91405e-07, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 4.04001e-06, Final residual = 1.8477e-07, No Iterations 1
smoothSolver: Solving for Uz, Initial residual = 8.70832e-05, Final residual = 5.45265e-07, No Iterations 2
smoothSolver: Solving for e, Initial residual = 1.68857e-05, Final residual = 2.77335e-07, No Iterations 2
DICPCG: Solving for p, Initial residual = 2.90348e-06, Final residual = 9.12439e-08, No Iterations 27
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.14449e-05, global = 1.82105e-05, cumulative = 6.05592e-05
smoothSolver: Solving for epsilon, Initial residual = 8.4398e-07, Final residual = 8.4398e-07, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.1359e-06, Final residual = 6.45064e-07, No Iterations 1
PIMPLE: Not converged within 2 iterations
ExecutionTime = 0.52 s ClockTime = 0 s

End

____________________________________________________________________________________
Additional InformationSo 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 OpenFOAM-dev 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 : dev-ab610d20ad58
Exec : rhoPimpleFoam
Date : May 17 2018
Time : 16:15:15


OpenFOAM was compiled with icc (ICC) 18.0.0 20170811



TagspimpleControl

Activities

will

2018-05-17 15:48

manager   ~0009590

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

2018-05-17 16:23

reporter   ~0009592

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

2018-05-17 16:44

manager   ~0009593

It's formally a transient case, so convergence is a per-time-step thing. The first time-step to converge is at 7 seconds, and it happens after 37 iterations. After that, steps 8 to 10 converge immediately.

jherb

2018-05-17 16:53

reporter   ~0009594

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

2018-05-17 17:13

manager   ~0009595

I still don't see the problem.

Can you generate the log with the solution control debug switch set?

will

2018-05-17 17:31

manager   ~0009596

Apologies, I mistyped one of the steps. I can reproduce this now. No need for the Gcc build.

will

2018-05-17 17:41

manager   ~0009597

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

2018-05-17 18:17

manager   ~0009598

Fixed in dev by commit 4bd59d64

Issue History

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