# SIMPLE: Difference between initial and final residuals

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

 June 30, 2016, 14:17 SIMPLE: Difference between initial and final residuals #1 Member   Jack Join Date: May 2015 Posts: 98 Rep Power: 9 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.

 July 1, 2016, 04:07 #2 Member   Join Date: Jun 2016 Posts: 66 Rep Power: 9 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.

 July 4, 2016, 18:42 #3 Member   Jack Join Date: May 2015 Posts: 98 Rep Power: 9 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?

 July 5, 2016, 02:10 #4 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,377 Rep Power: 28 Because you want to know if the coupled system converged, not a single equation (e.g. Ux on its own). mickbatti, shujaut, jeanpinto24| and 2 others like this. __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer.

 July 11, 2021, 08:33 #5 Member   Jnana Bhaskar Rao Join Date: Mar 2020 Posts: 46 Rep Power: 5 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.

 Tags convergence, openfoam, residual, simple