exiting program

Hi Dear All,
I used the tolerance for exiting the program. I want to know which tolerance i need to use.
[1] #define TOL 5.0e-6 // tolerance for exiting program
when i used this one. The program stopped so quickly and no lift data i found.

[2] #define TOL 1.0e-6 // tolerance for exiting program
for this one it run little longer than the first one but still have no lift data.

[3]#define TOL 1.0e-9 // tolerance for exiting program
when i used this one the program run for long time and the lift data also start after some time but the program run and not stopped even it run for long enough time.

so i want to know can the TOL effect the simulations, which TOL is better for LBM, especially dealing with single circular cylinder.

I’m not sure I understand your question. Is this tolerance a value to detect the convergence for steady flows?

If it is then it depends on what value you are looking at. And how it is computed.

I would need more information to give a more accurate answer… But anyway, when you are dealing with convergence, then no one can give an “absolute” answer since it is usually problem dependent.

But usually people using LBM are not interested in more than 3 significant digits.

I hope it helps a bit.

Hi Dear malaspin,
Yeah you are right this tolerance detect the convergence for steady flows. I used this for flows past a single circular cylinder.
What’s the reason that people using LBM are only interested upto 3 significant digits.
Thanks for reply and waiting for your reply again.
Best Regards

Khan, you still have not explained how you compute your steady state condition. What is the formula?


Hi Dear Timm,
Hi dear this is the formula that i used for the convergence test. One thing more my friends malaspin and Timm i developed recently codes for single circular cylinder and for cylinders in tandem arrangement. I need some one help to check it for me and tell me some thing that the code is ok or not and need to modify something or not. My codes written in c++. I send my code to one of my friend he told me he will help but once he recived the code then he even not reply of single email.

simulation is terminated when a convergence test is satisfied as follows:

where i, j are the sub indexes.

double ux[NX][NY], ux_old[NX][NY];

// convergence check
error_square = 0.0;
ux_square = 0.0;
for(i=1;i<=NX-2;i++) {
for(j=1;j<=NY-2;j++) {
error_square = error_square + (ux[i][j]-ux_old[i][j])*(ux[i][j]-ux_old[i][j]);
ux_square = ux_square + ux[i][j]*ux[i][j];
ux_old[i][j] = ux[i][j];

Dear Khan,

I did not find a problem with this piece of code, but it is incomplete. Could you send me the entire checking routine? How often do you check? Every time step?
I have a similar exit condition and can send it to you tomorrow, when I am back in my office.


Hi Dear Timm,
Thanks for response, please check your PM.
Best Regards

Khan, please read your new pm.

Hi Dear Timm,
Thanks for response. Dear Timm if you have time can i send my code to you that i make for single circular cylinder and can you check it for me that every subroutine is correct or have some problems in implementations (like streaming, collision, inlet/outlet and wall boundary conditions and forces). If you want then send me your email address through PM so i will send code to you.
Thanks and best regards