CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

SIMPLE: Difference between initial and final residuals

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree18Likes
  • 2 Post By Jack001
  • 10 Post By Zbynek
  • 5 Post By akidess
  • 1 Post By jnanabrao

LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2016, 14:17
Default SIMPLE: Difference between initial and final residuals
Join Date: May 2015
Posts: 98
Rep Power: 9
Jack001 is on a distinguished road
In the context of the simpleFoam solver (steady solver) I am trying to understand the significance of the initial residual vs. the final residual that is reported in the output of simpleFoam. As far as I understand the initial residual is the value of the residual (i.e the error in saying LHS = RHS of the relevant equation for a particular variable) before the particular equation (pressure or momentum equation) is solved. The final residual is a mystery to me. Since we are iterating forward per false time step, shouldn't the final residual become the new initial residual for the next iteration step? This is definitely not the case as I monitor my residuals. So I think I am missing something fundamental here concerning the solution algorithm of SIMPLE.

Also which residual is it that matters in terms of indicating convergence (I know there are other metrics one should look at as well) and why?
granzer and Fahime like this.
Jack001 is offline   Reply With Quote

Old   July 1, 2016, 04:07
Join Date: Jun 2016
Posts: 66
Rep Power: 9
Zbynek is on a distinguished road
The discretized equations (N-S, continuity, turbulence, etc.) are written in the form of a matrix A and vectors x and b, Ax=b. During the solution of the equation system defined by the matrix and vectors, you perform several iterations (called inner iterations). After each iteration, the computed residuals measure imbalance in the conservation equations. This should be getting smaller after each iteration. So you get from an initial residual value to a final residual value. During this whole process, you only solve for the vector x and do not update the matrix A. When your final residual is low enough, you update the matrix and repeat the whole process I just described (called outer iteration). Voila, you get a new initial residual that has naturally a larger value than the previous final residual.

The residuals should gradually decrease as you move from the initial to the final residual. That's the main requirement. But monitoring just residuals is not enough, you should monitor also forces, moments, integral quantities etc. You can find many discussions about this.
amandeepp, serles, okhao and 7 others like this.

Last edited by Zbynek; July 5, 2016 at 06:33.
Zbynek is offline   Reply With Quote

Old   July 4, 2016, 18:42
Join Date: May 2015
Posts: 98
Rep Power: 9
Jack001 is on a distinguished road
Thanks for your response.

What I don't understand is why do we take the initial residual (before the so called inner iterations take place) as an indicator for convergence? Shouldn't it be the final residuals after all the inner iterations take place?
Jack001 is offline   Reply With Quote

Old   July 5, 2016, 02:10
Senior Member
akidess's Avatar
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 28
akidess will become famous soon enough
Because you want to know if the coupled system converged, not a single equation (e.g. Ux on its own).
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   July 11, 2021, 08:33
Jnana Bhaskar Rao
Join Date: Mar 2020
Posts: 46
Rep Power: 5
jnanabrao is on a distinguished road
How is the residual calculated from the matrix equation? I just need to understand how do we get a single value from a matrix inequality equation? Does it represent the correction in the determinant or does it actually indicate how much average change is needed in the solved variable? Can I say something like "if the initial residual is 1e-4 in the U equation, on average the cell values need to be varied by 1e-4 to balance the U equation."
divyaa likes this.
jnanabrao is offline   Reply With Quote


convergence, openfoam, residual, simple

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20
Unstabil Simulation with chtMultiRegionFoam mbay101 OpenFOAM Running, Solving & CFD 13 December 28, 2013 13:12
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 08:35
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 06:37
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24

All times are GMT -4. The time now is 22:37.