CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

judging convergence through residuals

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 4 Post By cdegroot
  • 1 Post By FMDenaro
  • 1 Post By Rami

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2012, 23:59
Default judging convergence through residuals
  #1
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 14
MachZero is on a distinguished road
I am using Fluent, and as many users do, I often monitor convergence (at least partially) by monitoring the residuals. I think that many CFD users can get confused about exactly what the residuals mean. I am occasionally one of those users.

In theory, residuals are just the change from one iteration to the next. As a solution converges one would expect the residuals to drop such that there is no change from iteration n to n+1. But that can be misleading. For example, as you drop the under-relaxation factors, residuals drop. At first glance one could say "it is converging better!" without that being the case. Taking this to the extreme... If UR factors are dropped to 0.001, the solution simply isnt progressing, almost at all. Therefore the residuals will drop to approx. machine precision.

My ultimate point is that, residuals can mean many things, from "the solution is converged" to "the solution is not progressing". Or, when the residuals are constant at a higher value, that "the solution is changing consistently or oscillating".

So my ultimate question is, are there any good ways to weed out some of these issues? Yes, I like most people set surface monitors and judge those for convergence, but I want this conversation to remain about residuals. Are there any experts out there with some insight into this matter? I would be interested in having some discussion.
MachZero is offline   Reply With Quote

Old   December 24, 2012, 04:31
Default
  #2
Senior Member
 
cdegroot's Avatar
 
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 414
Rep Power: 17
cdegroot is on a distinguished road
Residuals actually aren't a measure of change from one iteration to the next, they are a local measure of how well the current solution satisfies the governing equations, typically normalized in some way. For example, you have the equation at a control volume P with neighbors NB:

a_P \phi_P =\sum_{NB}a_{NB}\phi_{NB} +b_P

Then the residual at that control volume is:

R_P = a_P \phi_P -\sum_{NB}a_{NB}\phi_{NB} -b_P

Which is then normalized by some global scale such as the average magnitude of a_P \phi_P in the domain. The residual reported by CFD codes is usually the RMS average of the residuals in the domain or sometimes the maximum. Note that the "a" coefficients and the source "b" depend on the current solution, so after the solution comes from the linear solver the residual will be very small (depending on solver tolerance) but then the coefficients are updated based on that solution which is when the residual is actually checked. So it is a measure of how well your linearized problem is converged to the solution of the nonlinear problem. If your coefficients don't change much between iterations the residual will be small.

To judge convergence the residual is important because it tells you how well your linearized problem is approximated. If the residual is small it is telling you that your coefficients are not changing much between iterations and the nonlinear problem is well approximated. However, you are right, high levels of relaxation will make this number misleading because it causes the solution, and as a result the coefficients, to change less between iterations.

I think the best thing to do is also report all global quantities you are interested in and make sure they are also not changing. If you have to use a lot of relaxation in the beginning for stability reasons, try backing this of later in the calculation to get a better idea of convergence.
cdegroot is offline   Reply With Quote

Old   December 24, 2012, 04:58
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Good issue!

Assuming for example a system in the form A.x = q, x is the exact solution, at a generic iteration k you have:

rk = A . xk - q

while you can see that xk+1 - xk = A^-1 . (rk+1 - rk )

Therefore, the conclusion is that one must never use the difference xk+1 - xk ...
cdegroot likes this.
FMDenaro is offline   Reply With Quote

Old   December 24, 2012, 09:21
Default
  #4
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 14
MachZero is on a distinguished road
Thank you both so much for your replies! They both help clarify this issue quite a bit for me. I have used CFD for some time, and now I am really trying to get back into understanding the mathematics as I think that will really help my quality of results. Thanks again!
MachZero is offline   Reply With Quote

Old   December 25, 2012, 04:52
Default
  #5
Senior Member
 
Rami Ben-Zvi
Join Date: Mar 2009
Posts: 155
Rep Power: 17
Rami is on a distinguished road
I suggest that in addition the residual monitoring you'll also check global balances (e.g., mass, momentum and energy over the entire domain). This will help you to see if your solution is reasonable and not just frozen due to low relaxation. Another measure is indeed the change between subsequent iterations.
MachZero likes this.
Rami is offline   Reply With Quote

Old   December 25, 2012, 08:35
Default
  #6
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 14
MachZero is on a distinguished road
So that is what I was looking for, additional checks to deterine whether it is converged or not progressing. When you say check global mass balance and energy etc, is there a good way to do that? Is it simple checking mass flow at inlet and outlet? Or is there some sort of volume integral. As well, is there a way to check difference in flow solution between iterations? I know Fluent is doing some normalization, would it be beneficial to stop it from doing this? I have run into slight issues where *I thought* I was not getting a good convergence on residuals, but it was just that I had used an fmg initialization, so my initial condition was very good.

Thanks again for your help, this has been extremely informative.
Merry Christmas!
MachZero is offline   Reply With Quote

Old   December 25, 2012, 09:01
Default
  #7
Senior Member
 
cdegroot's Avatar
 
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 414
Rep Power: 17
cdegroot is on a distinguished road
In Fluent you can report the net mass flow through all inlets and outlets, which should sum to something near zero. Look for this under the monitors menu. You can also get it not to normalize residuals under the same menu by opening up the residuals panel. In general the normalization is good, otherwise residual levels are completely problem dependent. When they are normalized they are only somewhat problem dependent.
cdegroot is offline   Reply With Quote

Old   December 25, 2012, 12:18
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I am not an expert in Fluent ... but for me the balance between inlet and outlet is of lesser meaning in checking the real convergence ..
FMDenaro is offline   Reply With Quote

Reply

Tags
convergence, fluent, residuals, residuals fluent


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
Convergence Centurion2011 FLUENT 48 June 14, 2022 23:29
Convergence issue- residuals of continuity s.garg FLUENT 4 November 7, 2016 11:39
Force can not converge colopolo CFX 13 October 4, 2011 22:03
convergence and residuals ebm CFX 2 February 2, 2009 17:55
Convergence - scaled vs unscaled residuals HS FLUENT 1 November 7, 2005 05:45


All times are GMT -4. The time now is 18:13.