5 A Brief Overview of Code and Solution Verification in Numerical Simulation 43 accuracy of the numerical method. For example, a finite element calculation that uses linear shell elements should exhibit the rate of p D1. Likewise the second-order accurate Gudonov scheme of a fluid dynamics solver should feature p D2 for a laminar-like flow that does not develop a discontinuity (or shock). The last region of Fig. 5.2 shown in grey is a limiting case for asymptotic convergence due to the fact that, with finite arithmetic implemented in a computer code, round-off errors eventually start to grow as x ➔0. Round-off could then accumulate to the point where it supplants truncation as the dominant mechanism that produces numerical error. Understanding asymptotic convergence is important for two reasons. First, the formulae discussed in this manuscript, which provide the foundation of verification, are valid only within the regime of asymptotic convergence. Second, verifying that a discretization used in a calculation leads to a discrete solution in the asymptotic regime provides a strategy to reduce truncation error. If the error is too large for the application and needs to be reduced, performing the simulation with a smaller element or cell size automatically reduces it. This is, however, true only within the regime of asymptotic convergence. 5.4 State-of-the-Practice of Code and Solution Verification This section summarizes the formalism and main equations used to study the convergence of discrete solutions. The discussion focuses on the state-of-the-practice in computational engineering and physics without paying tribute to some of the more advanced techniques. References [5, 9, 10] to list only a few, discuss issues that extend beyond the limited scope of this section. The distinction needs to be emphasized between code verification, where the exact solution yExact of the continuous Eq. (5.1) is known analytically, or provided by an approximate yet highly accurate solution procedure, and solution verification where yExact is unknown. In the case of code verification, the error "( x) in the left-hand side of Eq. (5.4) can be computed given knowledge of the exact solution yExact and a discrete solution y k n( x) obtained with the discretization size x. These exact and discrete solutions can be any scalar quantities, curves, or multi-dimensional fields. The unknowns of Eq. (5.4) are the parameters (ˇ; p). Two discrete solutions, one obtained with a “coarse” mesh of size xC and another one obtained with a “fine” mesh of size xF, where xC DR xF (and R> 1), suffice to estimate ˇand p. We now proceed to discuss the general case of solution verification where the difficulty is that the exact solution yExact of the continuous Eq. (5.1) is unknown. The challenge is that the procedure described in the previous paragraph cannot be implemented since the error "( x) cannot be explicitly computed. The starting point is to postulate an equation, referred to as an Ansatz model of numerical error, which describes how the error behaves in the regime of asymptotic convergence. The state-of-the-practice is to specialize Eq. (5.4) to scalar quantities such that is can be written as: ". x/ Dy Reference yn k . x/ ˇ x p ; (5.5) where the unknown is the triplet of quantities (yReference; ˇ; p). The main difference with code verification defined in Eq. (5.4) is that the exact-but-unknown solutionyExact is replaced by a reference yReference that becomes a third unknown of the Ansatz model. Equation (5.5) also assumes that, first, the convergence of discrete solutions yk n( x) towards the reference solution is monotonic and, second, the higher-order terms of the modified equation can be neglected. References [9, 10] address the case of non-monotonic convergence. Because the formulation (5.5) features three unknowns, a minimum of three equations is required to solve it. These are provided by discrete solutions obtained from a coarse-mesh calculation (with element or cell size xC), a medium-mesh calculation ( xM), and a fine-mesh calculation ( xF). These are written as: yReference yn k . xC/ Dˇ x p C yReference yn k . xM/ Dˇ x p M: yReference yn k . xF/ Dˇ x p F (5.6) The system of Eq. (5.6) can be solved for the triplet of unknowns (yReference; ˇ; p) by combining the equations to eliminate two of the three unknowns. The value of the rate-of-convergence p, for example, is obtained by solving the following nonlinear equation: p log.RMF/ Clog 1 R p CM log 1 R p MF Dlog yn k . xM/ y n k . xC/ yn k . xF/ y n k . xM/ ; (5.7)
RkJQdWJsaXNoZXIy MTMzNzEzMQ==