Page 160 - Computational Fluid Dynamics for Engineers
P. 160
5.2 Explicit Methods: Two-Step Lax-Wendroff Method 147
With the values of u known at n + 1/2 time steps for all i + 1/2 values, in
step 2, Eq. (5.2.2) is then written as
. -, ra+1/2 n+1/2
v n+1 - v? ^ _ L I /o _ ^ i to
U% U
* + c ' A x ' = 0 (5.2.3a)
so that u? +1 can be calculated from
2
u ^ = «? - a ^ 2 - ^ / Z ) (5.2.3b)
subject to initial and boundary conditions.
We shall postpone the discussion of initial and boundary conditions for the
vector equation (5.1.4) to Chapter 7 and examine only the boundary conditions
of the scalar equation (5.1.1) with the initial condition
t = 0, u = f(x) (5.2.4)
in the region a < x < b.
As discussed by Kreiss [2], for a well-posed problem one must specify an
analytical boundary condition at the right boundary (x = b) if c is negative or
at the left boundary (x = a) if c is positive. Hence, in addition to Eq. (5.1.1)
and the initial data, Eq. (5.2.4), the analytical boundary conditions must be
specified as either
x = 6, u = gi(t), c < 0 (5.2.5a)
or
x = a, u = g 2{t), c>0 (5.2.5b)
If du/dx in Eq. (5.1.1) is replaced by a central finite-difference approximation,
Eq. (4.3.7), one needs a numerical boundary condition at x = b (called outflow
boundary) if c > 0 or at x — a (called inflow boundary) if c < 0. Therefore, a
procedure is needed to specify the numerical boundary condition. While there
are several approaches for implementing the numerical boundary conditions,
see Hirsch [1], approaches based on extrapolation techniques are popular due to
their simplicity and are used in Example problems 5.2 and 5.3.
Example 5.2. Use the two-step Lax-Wendroff method to solve Eq. (5.1.1) subject to the
following initial and boundary conditions
f sin 2TTX 0 < x < 1
t = 0, u= < n . . . . _
I 0 1 < x < 5 (E5.2.1)
x = 0, u = 0
at t = 4 for Ax = 0.01 and, At = 0.001, 0.01, and 0.02, c = 1. Compare your solution with
J sir ^(x-t) t< X<t+l
w =
\ o otherwise