ABSTRACT

Output 11.2. Solution of the convection equation by the Lax-Wendroff method

Convection equation solver (Lax-Wendroff method), C = 0.50

o 0.0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 20.00 40.00 60.00 80.00100.00 80.00 60.00 40.00 20.00 0.00

0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

4 1.0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -0.05 -0.75 1.98 20.00 40.00 60.11 81.50 96.04 80.00 60.00 39.95 19.25 1.98 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

8 2.0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -0.01 -0.09 0.47 -1.87 2.6620.0840.1859.05 83.74 94.67 79.85 59.91 40.47 18.13 2.66 0.07 0.00 0.00 0.00 0.00 0.00 0.00 0.00

20 5.0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -0.01 0.06 -0.20 0.49 -0.27 -3.02 3.68 20.80 39.04 60.54 86.08 92.45 78.99 60.45 39.73 16.95 3.80 0.41 0.02 0.00 0.00 0.00

40 10.0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -0.01 -0.01 0.10 -0.33 0.35 0.93 -2.32 -3.62 5.56

20.23 38.28 64.68 86.92 89.88 78.47 60.68 37.64 16.48 0.00

11.10.3 The MacCormack Method The MacCormack approximation of the convection equation is given by Eqs. (11.47) and (11.49):

(11.127)

A FORTRAN subroutine, subroutine mac, for implementing Eqs. (11.126) and (11.127) is presented in Program 11.3. Only the statements which are different from the statements in program main and program lax in Section 11.10.1 are presented. Program main defines the data set and prints it, calls subroutine mac to implement the solution, and prints the solution.