Lecture 2
Lecture 2
q q q q + A + B +C =0 t x y z In general A, B, C are 5x5 matrixes and q is a column vector of 5 elements. The mathematical character of the equation is dictated by the eigenvalues of A, B, C. For simplicity we examine the 1-D inviscid flow (Euler) equation. continuity: ( u ) + =0 t x
2 u u + p momentum: + =0 t x
energy:
e ( ue + pu ) + =0 t x
In vector form,
q f + =0 t x
u 2 q = u , f = u + p . Let m = u, = e. e ue + pu
2
m , f = m2 / + p then q = m m( + p ) To express p in terms of , m, . Use the equations of state,
2 p = RT and e = ei + 1 2 u 2 = CvT + 1 2 u
Cv =
R R = Cv ( 1) 1
p = RT = ( 1)CvT = ( 1) ei
2 = e = ( ei + 1 2u ) 2 ei = 1 2 u 2 p = ( 1) 1 2 u
2 2 1 u = ( 1) 2 m2 p = ( 1) 1 2
m f1 , f = f = m 2 / + ( 1)( m 2 / 2 ) Let q = m 2 f3 m + ( 1) m 2 / 2
f1 f f2 = A= q f 3
f1 m f 2 m f 3 m
f 2 f 3
f1
3
f f1 m f m m = = 0, 1 = = 1, 1 = =0 m m
m2 m2 3 u 2 f 2 m 2 = 2 + ( 1) 2 = 2 = ( 3) 2 2 2 2
0 1 0 2 A = ( 3) u / 2 1 (3 )u 3 2 3 + u ue u e u ( 1) ( 1) 2
HW #1. Derive the rest of jacobian A. The eigenvalues of A are found from
A I = 0 ,
1
3 2
(3 )u 1 = 0 2 ( 1)u ue ( 1)u + e u
3
( 3) u 2 / 2
Figure of t-x.
Features of Hyperbolic Equation
Riemann invariants ( u
Take wave equation as an example, u u +c =0 t x Using central differencing, the difference equation for the above becomes
1 uin +1 uin u n +1 uin+ 1 + c i +1 =0 t 2x
t 1 n +1 uin++ 1 ui 1 = 0 2x
t 2x
1 n +1 1 n auin+ + auin++ 1 + ui 1 = ui
n +1 n * u2 a + au1 1 u2 n +1 a 1 n a u3 u3 n +1 n u4 = u4 a a 1 n +1 n a 1 a u u 5 5 n +1 n * a 1 u6 u6 au7
) =0
For implicit method the terms in the derivatives will be evaluated at time level n+1 and are unknowns. These unknowns involve the dependent variables ( and u , which are also evaluated at n+1 and again unknowns) in a nonlinear fashion. This will make the solution of the resulting difference equations practically impossible. Therefore, we need to linearize (freeze some coefficients at the old time level) the difference equation. Beam and Warming (1976) proposed a linearization that is widely used. Again, we use the 1-D Euler equation for discussion. q f + = 0 , where f = f (q) . t x Use first-order time differencing for
t
n +1 n +1 qin +1 qin f i + fi 1 + 1 =0 t 2x
(0.1)
(0.2)
This is a nonlinear difference equation because f n +1 is an unknown that contains the n +1 n +1 nonlinear terms of , u , e . Apply Taylor expansion to fi + 1 and f i 1 and ignore the high order terms, we have
f
n +1 i +1
= f
n i +1
f f 1 n n +1 n n +1 n + qin++ qi 1 qi 1 1 qi +1 , f i 1 = f i 1 + q i +1 q i 1
qin +1 = qin
t n 1 n n n n +1 n fi +1 + Ain+1 qin++ 1 qi +1 f i 1 Ai 1 qi 1 qi 1 2
(0.3)
(0.4)
1 n +1 1 Eq. (0.4) contains three unknowns qin+ , qin++ 1 , qi 1 on the LHS and can form a tri-diagonal matrix when apply to all nodes in the I-direction.
Through the use of Taylor expansion, we now linearize the nonlinear difference equation (0.2) so that the unknowns contains only the linear terms of , u , e .
Again we use the first-order time differencing and the second-order space differencing in a 2-D grid. In this case we use a 5-point stencil as shown in
(i,j+1)
(i-1,j)
(i,j)
(i+1,j)
(i,j-1)
n +1 n +1 fi + 1, j f i 1, j
2x
1 n +1 gin, + j +1 g i , j 1
2 y
=0
(0.5)
This is a nonlinear difference equation, it can be linearized using the same procedure described above. f
n +1
f g = f + q n +1 q n , g n +1 = g n + q n +1 q n q q
n
g f A and B n q q
n
t n n +1 t n n +1 t n n +1 t n n +1 1 Ai 1, j qi 1, j Bi , j 1qi , j 1 + qin, + Ai +1, j qi +1, j + Bi , j +1qi , j +1 = j + 2 2 2 2 t n t n n n qin, j f i +1, j fi Ai +1, j qi +1, j Ain1, j qin1, j 1, j + 2 2
)
(0.6)
8
1 n +1 n +1 n +1 n +1 Eq. (0.6) contains five unknowns qin+ 1, j , qi +1, j , qi , j , qi , j 1 , qi , j +1 on the LHS and forms a
penta-diagonal matrix when apply to all grid points in both I and J directions. This destroys the efficiency of the tri-diagonal and make the matrix inversion much difficult. To correct this deficiency, the idea of approximate factorization is developed. This concept is based on the classic ADI method. If we rewrite the LHS of Eq. (0.6) in operator form, Eq. (0.6) becomes
I + t i Ai+t j Bi q = RHS
where i Aiq Ai +1, j qi +1, j Ai 1, j qi 1, j
(0.7)
I + t i Ai I + t j Bi q = RHS
Eq. (0.8) can be solved in two steps first in the I direction then in the J direction
(0.8)
[ I + t i Ai] q* = RHS
* I + t j Bi q = q
Each of the two steps employs a tri-diagonal matrix. If we expand Eq. (0.8), it is not exactly same as Eq. (0.7). There will be an extra term equivalent to O( t 2 ). This error is the same as the linearization of the nonlinear difference equation. So the approximate factorization does not bring in extra errors.