Page 328 - Computational Fluid Dynamics for Engineers
P. 328
318 10. Inviscid Compressible Flow
and by adding them
= (i?i + R 2)/2
u L
from which the energy e^ can be computed. The flux vector Q is then
QLAN
Q = (10.11.7)
eLA N
10.11.3 Solution Procedure and Sample Calculations
The program is identical to the nozzle flow program, with additional source
terms and far-field boundary conditions. The computer program is given sep-
arately from the shock tube program in Appendix B. First, a 1-D grid with
equidistant spacing is generated (subroutine generate_grid). The flux vari-
ables are then initialized to their incoming freestream values. Then the algo-
rithm marches in pseudo-time, with increments satisfying the stability restric-
tions (subroutine time step). The MacCormack predictor-corrector steps are
computed (subroutine Maccormack) to yield the updated flux values. The pro-
gram ends when the total number of iterations reached a user specified value.
Moreover, a L2-norm of the residual defined as
n+1 n +1 2
\\u - u \\ 2 = / ] T (u] - u^) (10.11.8)
is monitored and written in a separate file (file residuals) which allows printing
of the convergence curve. The residual at the first iteration is stored, and the
residual at every subsequent iteration is then compared to the initial value. The
norm is written typically in a logarithmic scale, such that a Newton iteration
process on a linear equation would reduce the error by two orders of magnitude
in one iteration.
The convergence curve and the Mach number distribution are plotted for
several CFL numbers (0.5, 1, and 1.1) in Fig. 10.16, for a nozzle having an area
distribution of the form
A{x) = 1.398 + 0.347 tanh(0.8x - 4) (10.11.9)
for 0 < x < 10, a back pressure corresponding to 1.931 times the incoming pres-
sure, and an incoming supersonic flow at Mach 1.3. Some 5500 time steps are
needed to achieve convergence to 10 - 1 0 with a CFL number of 1.0, which is half
of those required for the CFL 0.5 case, since the convective waves scale with
the time step calculation. As was the case with the shock tube model problem,
the dispersion errors are more pronounced as the CFL number is reduced below
1.0. The time marching algorithm diverges for CFL numbers greater than 1.1,
which is in close agreement with stability analysis of the linear wave equation
(Section 5.7).