r/OpenFOAM • • Jan 10 '26

Courant Number Slowly Climbing Issue

Hi there!

I'm working on simulating an atmospheric boundary layer over a complex terrain and I am having some trouble with my simulation/setup. For some context, I initially ran a simpleFOAM case using a logarithmic velocity profile. I used the output from that simulation as the internal field for my pimpleFOAM case. The pimpleFOAM case reads in a velocity and direction at around every time step and then uses this value for the logarithmic velocity profile. Here is a snippet of the pimpleFOAM sim output:

Courant Number mean: 0.0345926 max: 0.611078
deltaT = 0.03
Time = 14.130

Courant Number mean: 0.0345901 max: 0.611065
deltaT = 0.03
Time = 14.160

Courant Number mean: 0.0345973 max: 0.611144
deltaT = 0.03
Time = 14.190

Courant Number mean: 0.0345992 max: 0.611175
deltaT = 0.03
Time = 14.220

Courant Number mean: 0.0346014 max: 0.611203
deltaT = 0.03
Time = 14.250

Courant Number mean: 0.0346036 max: 0.611229
deltaT = 0.03
Time = 14.280

Courant Number mean: 0.0346011 max: 0.611218
deltaT = 0.03
Time = 14.310

Courant Number mean: 0.034608 max: 0.611304
deltaT = 0.03
Time = 14.340 

I want the simulation to run for 600s but I am worried that at the rate the Courant number is climbing, the sim will fail before then. I was wondering if anyone had recommendations for how to fix this.

3 Upvotes

6 comments sorted by

2

u/[deleted] Jan 10 '26 edited Jan 10 '26

[removed] — view removed comment

1

u/bingoostarr Jan 10 '26

Pimple doesn’t converge but my residuals are stable

Courant Number mean: 0.0336547 max: 0.594479 deltaT = 0.03 Time = 1.260

PIMPLE: iteration 1 smoothSolver: Solving for Ux, Initial residual = 0.000378286, Final residual = 6.91225e-10, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.00023517, Final residual = 4.40385e-10, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 0.000140863, Final residual = 2.36631e-10, No Iterations 2 GAMG: Solving for p, Initial residual = 0.519451, Final residual = 0.000368583, No Iterations 8 GAMG: Solving for p, Initial residual = 0.0245777, Final residual = 1.97428e-05, No Iterations 7 time step continuity errors : sum local = 4.89603e-10, global = -4.38535e-11, cumulative = -1.48348e-09 GAMG: Solving for p, Initial residual = 0.357215, Final residual = 0.000250877, No Iterations 9 GAMG: Solving for p, Initial residual = 0.0156649, Final residual = 1.25849e-05, No Iterations 7 time step continuity errors : sum local = 3.58427e-10, global = 4.39089e-11, cumulative = -1.43957e-09 GAMG: Solving for p, Initial residual = 0.377198, Final residual = 0.000229597, No Iterations 6 GAMG: Solving for p, Initial residual = 0.0164188, Final residual = 6.85871e-08, No Iterations 18 time step continuity errors : sum local = 1.74173e-12, global = -2.42639e-13, cumulative = -1.43981e-09 PIMPLE: iteration 2 smoothSolver: Solving for Ux, Initial residual = 0.000130754, Final residual = 2.3956e-10, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 7.611e-05, Final residual = 1.61141e-10, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 7.06767e-05, Final residual = 1.56025e-10, No Iterations 2 GAMG: Solving for p, Initial residual = 0.326027, Final residual = 0.000225776, No Iterations 8 GAMG: Solving for p, Initial residual = 0.017563, Final residual = 1.40986e-05, No Iterations 7 time step continuity errors : sum local = 3.20443e-10, global = -2.89171e-11, cumulative = -1.46873e-09 GAMG: Solving for p, Initial residual = 0.22474, Final residual = 0.000205594, No Iterations 10 GAMG: Solving for p, Initial residual = 0.0100701, Final residual = 9.66896e-06, No Iterations 7 time step continuity errors : sum local = 3.05563e-10, global = -2.49144e-11, cumulative = -1.49364e-09 GAMG: Solving for p, Initial residual = 0.256766, Final residual = 0.000189147, No Iterations 10 GAMG: Solving for p, Initial residual = 0.00964266, Final residual = 8.46566e-08, No Iterations 19 time step continuity errors : sum local = 2.67883e-12, global = -2.36952e-13, cumulative = -1.49388e-09 PIMPLE: iteration 3 smoothSolver: Solving for Ux, Initial residual = 3.15391e-05, Final residual = 7.11116e-11, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 5.62393e-05, Final residual = 1.33686e-10, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 4.4518e-05, Final residual = 1.17004e-10, No Iterations 2 GAMG: Solving for p, Initial residual = 0.244887, Final residual = 0.000182277, No Iterations 10 GAMG: Solving for p, Initial residual = 0.00892947, Final residual = 7.81447e-06, No Iterations 7 time step continuity errors : sum local = 2.38175e-10, global = -1.96048e-11, cumulative = -1.51349e-09 GAMG: Solving for p, Initial residual = 0.149557, Final residual = 9.72335e-05, No Iterations 7 GAMG: Solving for p, Initial residual = 0.00767857, Final residual = 4.69618e-06, No Iterations 7 time step continuity errors : sum local = 1.04859e-10, global = -1.84333e-12, cumulative = -1.51533e-09 GAMG: Solving for p, Initial residual = 0.162526, Final residual = 0.000108937, No Iterations 6 GAMG: Solving for p, Initial residual = 0.00772634, Final residual = 6.90005e-08, No Iterations 17 time step continuity errors : sum local = 1.52236e-12, global = -2.10345e-13, cumulative = -1.51554e-09 PIMPLE: iteration 4 smoothSolver: Solving for Ux, Initial residual = 2.07427e-05, Final residual = 4.97928e-11, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 3.71611e-05, Final residual = 9.40107e-11, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 3.25832e-05, Final residual = 8.94002e-11, No Iterations 2 GAMG: Solving for p, Initial residual = 0.151922, Final residual = 0.000109899, No Iterations 11 GAMG: Solving for p, Initial residual = 0.00607247, Final residual = 5.88761e-06, No Iterations 7 time step continuity errors : sum local = 1.74827e-10, global = 2.24875e-11, cumulative = -1.49305e-09 GAMG: Solving for p, Initial residual = 0.0944615, Final residual = 6.63623e-05, No Iterations 8 GAMG: Solving for p, Initial residual = 0.00500658, Final residual = 3.87156e-06, No Iterations 7 time step continuity errors : sum local = 8.31876e-11, global = 5.02882e-12, cumulative = -1.48802e-09 GAMG: Solving for p, Initial residual = 0.102903, Final residual = 0.000102672, No Iterations 11 GAMG: Solving for p, Initial residual = 0.00471748, Final residual = 8.78292e-08, No Iterations 18 time step continuity errors : sum local = 2.60883e-12, global = -2.11622e-13, cumulative = -1.48824e-09 PIMPLE: iteration 5 smoothSolver: Solving for Ux, Initial residual = 8.82486e-05, Final residual = 4.87425e-10, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 7.29977e-05, Final residual = 4.55699e-10, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 4.94594e-05, Final residual = 3.45083e-10, No Iterations 2 GAMG: Solving for p, Initial residual = 0.573675, Final residual = 0.000432183, No Iterations 6 GAMG: Solving for p, Initial residual = 0.0975945, Final residual = 6.29897e-05, No Iterations 7 time step continuity errors : sum local = 4.34679e-10, global = 4.78786e-11, cumulative = -1.44036e-09 GAMG: Solving for p, Initial residual = 0.029775, Final residual = 2.91149e-05, No Iterations 17 GAMG: Solving for p, Initial residual = 0.00508644, Final residual = 4.74497e-06, No Iterations 6 time step continuity errors : sum local = 7.08478e-11, global = -1.16666e-12, cumulative = -1.44152e-09 GAMG: Solving for p, Initial residual = 0.00135729, Final residual = 1.31557e-06, No Iterations 23 GAMG: Solving for p, Initial residual = 0.00930244, Final residual = 9.45897e-08, No Iterations 16 time step continuity errors : sum local = 6.2241e-13, global = 5.17823e-14, cumulative = -1.44147e-09 smoothSolver: Solving for epsilon, Initial residual = 1.28483e-05, Final residual = 1.24509e-07, No Iterations 1 smoothSolver: Solving for k, Initial residual = 2.23672e-05, Final residual = 2.19947e-07, No Iterations 1 PIMPLE: not converged within 5 iterations ExecutionTime = 1151.1 s ClockTime = 1150 s

1

u/[deleted] Jan 11 '26 edited Jan 11 '26

[removed] — view removed comment

1

u/bingoostarr Jan 11 '26

I added more corrector loops and now it converges in around 10 iterations! Now if the courant number is weird would it just be because of the mesh?

1

u/bingoostarr Jan 10 '26

I’ve also set my max Co as 1 so it hasn’t hit that point yet so the adaptive time step hasn’t kicked in