CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Residuals

Register Blogs Community New Posts Updated Threads Search

Like Tree40Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 11, 2000, 02:15
Default Residuals
  #1
Rakib
Guest
 
Posts: n/a
What does convergence mean with reference to residual plotting of Velocity, Continuity and Pressure?
Vinay Nandurdikar likes this.
  Reply With Quote

Old   November 11, 2000, 04:14
Default Re: Residuals
  #2
Chetan Kadakia
Guest
 
Posts: n/a
The residuals are the error magnitudes for equations as iterations progress. The equations include the governing equations; I.e. the Navier-Stokes momentum equations for each direction (x, y, and z if 3d, or just x and y if 2d), the continuity equation (conservation of mass), and if heat transfer is applicable, the energy equation. The equations may also include equations of the turbulence model defined under models-viscous. The residual is the difference between the previous result and the current result. As these errors are decreasing the equation results are reaching values that are changing less and less. This is what is known as convergence. That is the solutions are converging. If these errors begin to increase, the solution is then said to be diverging. Let me give a simplified example of convergence: Initial value = 2, 1st iteration value = 1.5 (residual value is equal to 2 - 1.5 = .5), 2nd iteration value = 1.2 (residual value = 1.5 - 1.2 = .3), 3rd iteration value = 1.05 (residual value = 1.2 - 1.05 = .15),... 1000th iteration value = 1.00001, and 1001th iteration value = 1.000005 (residual value = .00001 - .000005 = .000005). Perhaps the solution is converging to a value of 1. An opposite trend could be given as an example of divergence. A solution can converge and then diverge or vica versa. Does this help? Is my explanation clear and accurate?
baineteo, faw, s.m and 27 others like this.
  Reply With Quote

Old   November 11, 2000, 05:30
Default Re: Residuals
  #3
Rakib
Guest
 
Posts: n/a
Thanks.
  Reply With Quote

Old   November 11, 2000, 09:53
Default Re: Residuals
  #4
Patchawat
Guest
 
Posts: n/a
HELLO CHETAN, SO..IF THE RESIDUAL PLOT LINE IS CONSTANT(SLOPE=0,NOT DECREASING(CONVERGING),NOT INCREASING(DIVERGING)),WHAT DOES IT MEAN? SORRY THAT I AM NOT CLEAR ABOUT THIS STUFF. DOES IT MEAN THAT THE ITERATION ARE STILL ON THE WAY BUT NOT CLOSE YET TO THE SOLUTION?

THANK YOU,

PATCHAWAT
patxisharma likes this.
  Reply With Quote

Old   November 11, 2000, 13:12
Default Re: Residuals
  #5
Petr
Guest
 
Posts: n/a
Hello Patchawat,

I think that the problem is in fact that you see summed "pointwise" residual for each equation you are solving. That means, that even low residual cannot quarantee small changes of solution everywhere. There could be regions with well settled solution, but also regions with quite considerable changes between iterations even with almost constant residual (the locations of such "problem" regions could change during the solution process). Moreover, when you solve sequentially more than one equation, you have changing coefficients which could also complicate the situation. It would be useful to see also the maximum "pointwise" residual for each equation beeing solved.

Petr
srsel6 likes this.
  Reply With Quote

Old   November 11, 2000, 13:38
Default Thank you
  #6
Patchawat
Guest
 
Posts: n/a
  Reply With Quote

Old   November 11, 2000, 18:13
Default Re: Residuals
  #7
Chetan Kadakia
Guest
 
Posts: n/a
If the solution is not converging and not diverging, you have to decide for your solution if it is good enough. That is also why we can set a convergence criterion. Instead of me giving you some examples, why don't you tell us what you are working on. It's hard to say what is the right convergence criterion, it varies for every problem. You can also monitor forces/surfaces. If you are considering a steady state airfoil problem, you may monitor coefficient of lift (you should also look at moment and drag in this case also), and when the lift force appears to be constant that is a sign of convergence. But note: convergence does not necessarily mean accuracy. If you are solving for a heat transfer problem, you may want to have a higher criterion for the energy equation, perhaps 1e-6 or 1e-9. If you are not satisfied with your solution, you should change your solution controls. If you gradually reduce your under-relaxation factors (try not to change all the relaxation factors at once, change only one or two at a time), or maybe even change the discretization schemes, then when you solve the problem your residuals could eventually minimize even further. Also don't be hasty, convergence may take several hundred or thousands of iterations (and the slope could appear flat when it is not completely flat). Tell us your exact problem if allowed, and whoever has experience with a similar situation should hopefully reply with some more help. Also see chapter 17 of the Fluent manual.
  Reply With Quote

Old   November 11, 2000, 18:19
Default Re: Residuals
  #8
Chetan Kadakia
Guest
 
Posts: n/a
Petr,

Your idea of seeing the maximum pointwise residual makes sense if I understand it correctly. I'm guessing each equation solves for several values, each with its own residual. Instead of looking at the average residual for each equation, we should look a the maximum reisdual. Do I understand this correctly? The term "pointwise residual" is new to me. If I am incorrect please correct me. If I am correct, please tell me how to change my view to that of the maximum pointwise residual.

Thanks, Chetan K.
  Reply With Quote

Old   November 12, 2000, 02:36
Default Re: Residuals
  #9
Petr
Guest
 
Posts: n/a
Chetan,

I used the term "pointwise residual" in order to distinguish the quantity that FLUENT produces from contributions of the individual computational cells (which are the "pointwise residuals" as I termed it). Both quantities are useful in my opinion, and the possibility to see also the maximum of the cell residuals (this is maybe a better term) could eliminate one possible source of user effects. In the present situation, when you have satisfactory low and slowly varying residuals, you nevertheless should check the places, where your solution still changes considerably. To find such place is not easy: you must select the variable you should check, judge which should be the right values at various places, etc. If you know beforehand that eg. turbulence energy still has high residual somewhere, you can concentrate yourself to this quantity. Of course, this only ensures that you have converged solution, but from this situation it is easier to check physical correctness of your solution.

Regards.

Petr
  Reply With Quote

Old   November 14, 2000, 08:26
Default Re: Residuals
  #10
Patchawat
Guest
 
Posts: n/a
Thank Chetan, You and Petr seem to be helpful to me. Now I am facing the divergence problem when I try to do simulation of 2-phase(solid-water) stirred tank without baffle.....the divergence happen all the time eventhough I set the very small time step and quite low underrelaxation. I have to take time to check what's wrong with my model's parameters,etc...(i use mixsim and fluent4.5) During this time,soon, I will post my problem again in this discussion forum....please check it and take a look if you can suggest me anything or not.

Thanks

  Reply With Quote

Old   November 17, 2000, 01:46
Default Re: Residuals
  #11
Max
Guest
 
Posts: n/a
i'm doing the simulation on 2 phase(water & air) flow in a horizontal pipe.if my residual graph is going up(diverge),is that means i'm wrong?why my residual graph finally become constant but not zero?doesn't it in steady state,the velocity & pressure should converge to a constant value(residual value=0)? an additional question is the k-epsilon model can be used for steady state?

Max
  Reply With Quote

Old   November 17, 2000, 07:59
Default Re: Residuals
  #12
Patchawat
Guest
 
Posts: n/a
Hi Max, I also am having the same problem as you. I am simulating the system of "2D","one phase",no baffle, stirred tank. At first I though that the solution will converge easily but,in fact, I have the problem that all equation's residual plot have been narrowly oscillating forever(i mean very large number of iteration).....they oscillate in the range of about 1e-3 to 1e-4 except for pressure that oscillate in the range of 0 to 1e-1. I try to reduce underelaxation on pressure,increse its no. of sweep to 20,or turn on multigrid, but nothing improve. Regarding k-epsilon model....i am not sure about this but I think it can.....why not? So..let wait for the other to answer us for more accuate information.
  Reply With Quote

Old   November 17, 2000, 09:39
Default Re: Residuals
  #13
Max
Guest
 
Posts: n/a
hi,Patchawat,my residual plot also shows narrowly oscillating forever during the very large number of iteration(500). my doubt is why the residual value is not converge to zero?(residual value=iteration 1- iteration 2,e.g. iteration 1-iteration 2=0.0001,iteration 2-iteration 3=0.00001, iteration 3-iteration 4=0.000001, iteration 4-iteration 5=0.0000001,.........iteration n-iteration n+1=0.000000........1=0(because the velocity value & pressure is converge to a constant value)). k-epsilon is only used for turbulent model.
  Reply With Quote

Old   December 16, 2000, 01:32
Default Re: Residuals
  #14
Dan Williams
Guest
 
Posts: n/a
Hmm, funny how peoples understanding of residuals seem to be totally incorrect. Like many other CFD codes, Fluent uses a finite volume discretisation. For each finite volume a "control volume" or finite volume equation is assembled in the form:

App*PHI + SUM(Anb*PHInb) = Residual

So, when trying to converge to a steady state solution the residual is the amount by which the a local finite volume is out of balance. i.e., flow of stuff in - flow of stuff out = residual. When some of the people in this thread say look at the pointwise maximum residual they are simply asking "Which finite volume is most out of balance?".

There are two things that the various codes do differently:

1) Normalise the local residuals. 2) Use a global RMS or Maximum residual to determine convergence.

I'm not sure what exactly Fluent does, but on many problems, with a proper residual normalisation you should be able to obtain near round-off convergence given enough iterations (1.0E-7 RMS in single precision). The RMS value is simply the RMS average of all the residuals on the right hand side of your equations.

Dan.

  Reply With Quote

Old   December 18, 2000, 09:09
Default Re: Residuals
  #15
Petr
Guest
 
Posts: n/a
Hi Dan,

you are of course right that I ask "which CV is most out of balance" in situation, when the residuals produced by FLUENT (which are sums, either unscaled or scaled or normalized, of residuals of the individual CVs over all control volumes) demonstrate a problem. Even when these "global" residuals are quite low, there could be regions with out-of-balance control volumes and I would like to know, where they are. The developers of FLUENT are aware of such difficulties, judging from the number of pages in User's Guide devoted to monitoring and judging convergence.

Best regards

Petr
  Reply With Quote

Old   December 18, 2000, 23:35
Default Re: Residuals
  #16
Dan Williams
Guest
 
Posts: n/a
Seems to me that you just output the residuals and plot them in the post-processor? Can you do this with Fluent?

Dan.

  Reply With Quote

Old   December 19, 2000, 04:31
Default Re: Residuals
  #17
Petr
Guest
 
Posts: n/a
Dan,

I can see the summed ("global") residuals during calculation or plot them in post-processing. When using coupled solver, the residuals are in fact changes in the variables between the current and previous iterations. When using the segregated solver, the residuals are the summed imbalances of the individual control volumes, as we have discussed. As to the value for an individual control volume, I can see in post-processing only mass imbalance as a histogram plot. I would like to have something similar to the tool for check of grid available in the GAMBIT (a preprocessor for FLUENT)where I can go through the solution domain eg. with a moving plane and see some parameters of the individual cells displayed in colours according to the ranges of their values.

Petr
  Reply With Quote

Old   December 20, 2000, 00:37
Default Re: Residuals
  #18
Dan Williams
Guest
 
Posts: n/a
What you mention about the residuals for the coupled solver seems odd. I'd be suprised if that were the case. A finite volume discretisation is what it is and a residual for a control volume is how much that control volume is out of balance, that's it. If Fluent is defining the residuals as the change in solution variables between iterations then this has nothing to do with the conservation balance, and in fact is a poor technique for defining a residual.

This does not instill confidence, for me, in their coupled solver if they are using this approach. Another good example, mentioned elsewhere on this discussion group, is that they have to put all these damn Multigrid controls into their GUI because they can't figure out how to use the thing properly. Who cares how many smoother sweeps a you need on the coarse grid levels and so on.

What exactly do you mean by a histogram plot of mass imbalance. What does this tell you. Surely the only numbers that matter are 1) The global conservation balance (which is what you mention you can get) and 2) Localised imbalances, or maximum residuals, that are large. If you can deal with a small localised regions of imbalance, then your solution is likely going to be fine if you've met a decent global conservation target. This is problem dependent of course. I'm very suprised that you cannot write the residuals out for post-processing. This can be very useful for diagnosing convergence problems.

Later, Dan.

  Reply With Quote

Old   December 20, 2000, 03:33
Default Re: Residuals
  #19
Petr
Guest
 
Posts: n/a
Dan,

as to the definition of residuals for the coupled solver, I only cited the User's Guide, but it is possible that I misundersood it (I do not thnk so). I have used only the segregated solver so far.

The plot of mass imbalance gives me information how much cells from the total number of cells have mass imbalance in a defined range.

I wrote, that I can plot the (global)residuals in post-processing. That means, that they are written in the data file. Sorry that I did not mention it explicitly.

Petr
  Reply With Quote

Old   January 19, 2001, 15:57
Default Re: Residuals
  #20
cfd
Guest
 
Posts: n/a
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorials] Tutorial of how to plot residuals ! wolle1982 OpenFOAM Community Contributions 171 February 20, 2024 02:55
what to monitor besides residuals? franzdrs FLUENT 5 March 21, 2013 03:59
Mesh size and solver residuals... Scott CFX 5 December 15, 2008 17:10
Convergence - scaled vs unscaled residuals HS FLUENT 1 November 7, 2005 05:45
residuals Karl CFX 2 June 24, 2003 23:13


All times are GMT -4. The time now is 19:04.