Professional Documents
Culture Documents
Partial Differential Equations: Solution by Finite Difference Method
Partial Differential Equations: Solution by Finite Difference Method
2008
Introduction
What is discretization? Process by which a closed-form mathematical expression is approximated by analogous (but dierent) expressions which prescribe values at only a nite number of discrete points or volumes in the domain Recall Navier-Stokes equations derived in Chapter 2. They are PDEs governing the uid motion and as derived, they are of the closed-form mathematical expression, see next.
2008
Introduction
D + V = 0 Dt Du p xx yx zx = + + + + fx Dt x x y z (1)
(2)
Dv p xy yy zy = + + + + fy Dt y x y z Dw p xz yz zz = + + + + fz Dt z x y z
Abu Hasan Abdullah 2008
(3)
(4)
2
Introduction
D V2 e+ Dt 2 T k x x T k y y T k z z
= q +
(uxy ) (vyy ) (wzy ) (uxz ) (vyz ) (wzz ) + + + + + + x y z x y z (5) Discretization will transform the partial derivatives in these PDEs into approximate algebraic dierence quotients
Abu Hasan Abdullah 2008 3
2008
2008
2008
2008
2u x2
(x)2 + i,j 2!
3u x3
2008
i,j
(x) 2! i,j
3u x3
(7)
truncation error
i,j
2008
ij
2008
10
2u x2
(x)2 + 2! i,j 3u x3
3u x3
x +
i,j
2u x2
(x)2 i,j 2!
i,j
(11)
11
2008
12
i,j
Second-order central rst dierence with respect to y is obtained, through similar construction, and written as u y =
i,j
(14)
2008
13
(15)
(16)
2008
14
2008
15
2008
16
(a) Structured
(b) Unstructured
Figure 1: Grid.
2008
17
(18)
(19)
2008
18
2008
19
Tin
(x)2
(20)
Tin
(21)
2008
24
Eq. (22) represents one form of the Crank-Nicolson dierencing and is ONE n+1 n+1 equation with THREE unknownsTi+1 , Tin+1, Ti1 Eq. (22) applied at a grid point does not stand alone, i.e. it cannot solve for Tin+1
Abu Hasan Abdullah 2008 25
t t t n+1 n+1 n+1 Ti1 1 + Ti+1 + Ti 2(x)2 (x)2 2(x)2 = Tin t n n Ti+1 2Tin + Ti1 2(x)2 (23)
2008
26
(24)
2008
27
2008
28
Solution of the system of equations denoted by Eq. (30) involves manipulation of the known coecient matrix (notice the tridiagonal)
Abu Hasan Abdullah 2008 30
Homeworks
Read through Chapter 4 of Computational Fluid Dynamics (1995), Anderson, J.D. and discuss briey the meaning of 1. structured grids 2. unstructured grids 3. rst-order-accurate nite-dierence expression 4. second-order-accurate nite-dierence expression 5. truncation error and its inuence on your CFD calculation
2008
31
Homeworks
Using central-dierence approximations, nd the solution of the wave equation, represented by a second-order hyperbolic equation:
2 2 = , x t2
subject to the boundary conditions
0x1
(0, t) = 0 (1, t) = 0
and initial conditions
t>0 t>0
0x1 0x1
2008
32
2008
33