Convergence criterion
Hi,
I'm developping a small code in order to resolve incompressible viscous bidimentionnal steady flows. Everything seems Ok apart the convergence criterion, for now, i'm just giving the number of iteration to be sure that the code will stop. I tried the relative convergence criterion: abs((Un+1  Un)/Un+1)<eps but it doesn't work.... I want to apply the residual but I still don't know how. I'm working on navierstokes equations using the primitive variable formulation. Thanks in advance 
Re: Convergence criterion
HI, For applying residual convergence criterion, you should find the root mean square(RMS) value of the differences of u or v velocity at all the mesh nodes and put it to be less than 0.001(for steady state criterion in time, lets say). Try it out. hope it helps.

Re: Convergence criterion
I must confess that i don't really understand what do u mean by : RMS value of the DIFFERENCES of u or v...

Re: Convergence criterion
for u it's Sigma[(u_new(i)u_old(i)]^2/Sigma[u_new(i)]^2 or similar.

Re: Convergence criterion
or better: Sigma{[(u_new(i)u_old(i)]^2/[u_new(i)]^2}

Re: Convergence criterion
Is the 'sum' computing necessary ?

Re: Convergence criterion
it highly depends on you. What I use is a "norm". If you don't use a sum, then you need to check the convergence for "all" the nodes. It's up to the programmer.

Re: Convergence criterion
How about relapce 'Sigma' by 'Max' function ?

Re: Convergence criterion
Although its widely used you need to be a little careful with this criteria as it is dependent upon the rate of convergence. As it uses the solution rather than the residual as the convergence criteria it can be satisfied in two ways: by a converged solution or by a calculation that is converging very slowly.

Re: Convergence criterion
This is a very good point. I have a slowly converging code and this problem has made me busy thinking about it. What other category of convergence criteria can I consider?

Re: Convergence criterion
"If you don't succeed at first, ... redefine success!"
:D Are you seriously suggesting that you can fix your convergence problems by choosing a more nicely looking convergence criterium? The rootmeansquare of the velocity residual is a good convergence criterium for incompressible flow, and to answer a previous question: Yes, it is necessary to obtain the sum (otherwise it wouldn't be a "mean" value). This criterium gives you the average convergence over the flow field. The maximum is also useful. Usually we monitor both values, maximum and R.M.S., but we don't use any of them to determine the number of iterations, because that wouldn't be robust. There is no guarantee that you'll ever get down to the residual value you specified, and also there is no absolute (or even relative) residual level that defines a "good" convergence for all cases. That very much depends on the type of flow, the equations you're solving, the initial conditions, and other things... Simply specify the number of iterations, monitor the convergence (R.M.S. and max), and use human intelligence and experience to decide if you need to run more iterations or if you could do with less... 
Re: Convergence criterion
What you think of "residual" is not precise. I hope residual is different from RMS of error. Imagine we want to solve the problem:
Au=f e =uu_sol RMS is of the following "fashion": = {sum[u_newu_old]^2/u_new^2}^0.5 but residual is: r = f Au_sol where u_sol is the present solution from the current iteration. I can use this criterion but I it takes more cpu time. anyway. Please read "AnotherCFDUser" explanation. Please all let me know if you have a better idea. 
Re: Convergence criterion
The R.M.S. value that you mention is only one of many possible values. You are right that u_newu_old is not a residual in the classical sense, but if you use the "precise" residual, you can (and should) still make use of the rootmeansquare. There are really two questions, here:
a) How to define the local residual, e.g. (f Au_sol), or (u_newu_old), or something else. In either case, let's call it r(u). b) How to obtain one or two parameters to describe the convergence of the whole flow field. If you locally define your residual as r(u), then you can obtain the maximum in the flow field as max(r(u)), and you can also obtain the R.M.S. value of your residual as sqrt(average(r(u)*r(u))). For the average you have to use summation, and divide by the number of nodes (and reference scales of your choice). 
Re: Convergence criterion
I see what you mean. Now, can you imagine a situation in which terporarily error increses by iteration, but residual decreses? I can. I guess this is the main difference of the error and residual. I was talking about this. Your RMS discussion is correct in that we need to sum, average and sqrt.

Re: Convergence criterion
>can you imagine a situation in which terporarily error >increses by iteration, but residual decreses
It depends on the numerical scheme. Some schemes use the residual more or less directly to obtain the update (delta u) of a solution and in that case you may see the error (delta u) and residual behave similarly. Of course, that's not the case for all schemes. However, regardless of the scheme, both terms will approach zero as the solution converges, even though their convergence histories might be different. You cannot have one term diverge and the other converge indefinitely... unless there is something wrong with the scheme. 
All times are GMT 4. The time now is 02:45. 