11.1 Error Analysis and Estimation
331
Any iteration process has to be stopped at some stage. We must therefore
define a convergence criterion to decide when to stop the process. Usually,
iteration is continued until the levels of residual has been reduced by a particular amount; this can be shown t o be equivalent to reducing the error by
an equal amount.
Even if the solution process is convergent and we iterate long enough, we
never obtain the exact solution of the discretized equations; round-off errors
due to finite arithmetic precision of the computer will provide a lower bound
on the error. Fortunately, round-off error does not become an issue until the
solution error becomes close to the arithmetic precision of computer and that
is far more accuracy than is usually necessary.
We define the iteration error as the difference between the exact and the
iterative solutions of the discretized equations. Although this kind of error
has nothing to do with discretization itself, the effort required to reduce the
error to a given size grows as the number of discrete elements is increased. It
is therefore essential to choose an optimum level of iteration error - one that
is small enough compared to the other errors (which could not be assessed
otherwise) but not smaller (because the cost would be larger than necessary).
Programming and User Errors. It is often said that all computer codes
have bugs - which is probably true. It is the responsibility of the code developer to try t o eliminate them; an issue that we shall discuss here. It is
difficult to locate programming errors by studying the code - a better approach is to devise test problems in which errors caused by bugs might show
up. Results of test calculations must be carefully examined before applying
the code to routine applications. One should check that the code converges
at the expected rate, that the errors decrease with the number of discrete
elements in the expected way, and that the solution agrees with accepted
solutions produced either analytically or by another code.
A critical part of the code is the boundary conditions. The results must
be checked to see if the boundary condition applied is really satisfied; it is not
unusual to find that they are not. PeriC (1993) discussed one such problem.
Another common source of problems is the inconsistency in approximations
of terms that are closely coupled; for example, in a stationary bubble the
pressure drop across the free surface must be balanced by the surface tension.
Simple flows for which analytical solutions are known are very useful for the
verification of computer codes. For example, a code using moving grids can
be examined by moving the interior grid while keeping the boundaries fixed
and using stationary fluid as the initial condition; the fluid should remain
stationary and should not be affected by the grid movement.
The accuracy of a solution depends not only on the discretization method
and the code but also on the user of the code; it is easy to obtain bad results
even with a good code! Although most user mistakes lead to errors which
fall into one of the above three categories, it is important t o distinguish
between systematic errors, which are inherently present in the method, and
Précédent

- 341/779

Suivant