CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   SIMPLE: Difference between initial and final residuals (https://www.cfd-online.com/Forums/openfoam-solving/173964-simple-difference-between-initial-final-residuals.html)

Jack001 June 30, 2016 15:17

SIMPLE: Difference between initial and final residuals
 
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?

Zbynek July 1, 2016 05:07

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.

Jack001 July 4, 2016 19:42

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?

akidess July 5, 2016 03:10

Because you want to know if the coupled system converged, not a single equation (e.g. Ux on its own).

jnanabrao July 11, 2021 09:33

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."


All times are GMT -4. The time now is 01:35.