In Sec. 5.3 , we established a criterion for convergence of the Gauss-Seidel method. We now need a way to estimate a level of convergence to determine when to stop iterating.
The analysis of convergence centred on the solution error , introduced in Sec. 5.2 . In practice, cannot be determined since the exact solution is unknown. Instead the residual provides a measure of the accuracy of the solution. The residual vector represents the change to the solution of the equation, required to make exact, according to
The vector (of size ) provides one value per matrix row, with both positive and negative values. A measure of residual given by a single value, is deﬁned as
The residual provides a measure of error in the solution of , rather than the absolute error . It is divided by the norms of and to reduce its dependency on the scale of the geometry and solution variable. By reducing its scale-dependency, can be used to compare the level of error equitably between simulations at diﬀerent scales.
The ﬁgure above shows calculated from Eq. (5.11 ) following successive sweeps of the Gauss-Seidel method (starting from the initial ). The graph uses a logarithmic vertical scale since the values of extend over 4 orders of magnitude.
CFD software generally provides the following controls to stop the iterative solver:
Sweeping ceases if either tolerance condition is satisﬁed: ; or , where is the initial residual within the particular solution step. The criterion is often deactivated by setting , especially for transient simulations when suﬃcient accuracy is required at every solution step.