You are on page 1of 2

Finite Difference Schemes

Computational Fluid Dynamics SG2212 (20100123)

1 Finite differences for the integration of ODEs


Ordinary differential equation:
du
= f (u, t), un = u(tn ), f n = (un , tn ), tn = n∆t (1)
dt
Explicit Euler scheme, order O(∆t):
un+1 = un + ∆t · f n (2)
Implicit Euler scheme, order O(∆t):
un+1 = un + ∆t · f n+1 (3)
(Generalised) Crank-Nicolson scheme:

un+1 = un + ∆t([1 − θ] · f n + [θ] · f n+1 ) , 0 ≤ θ ≤ 1 (4)

The standard Crank-Nicolson scheme is given by θ = 0.5 with order O(∆t2 ); the explicit and
implict Euler schemes are obtained with θ = 0 and θ = 1, respectively.
Standard Runge-Kutta scheme (RK4), order O(∆t4 ):
∆t n
un+1 = un + (f + 2k1 + 2k2 + k3 ) (5)
6

∆t n 1 1 ∆t
with : u1 = un + f , k1 = f (u1 , tn+ 2 ), tn+ 2 = tn + (6)
2 2
n ∆t n+ 12
u2 = u + k1 , k2 = f (u2 , t ) (7)
2
u3 = un + ∆tk2 , k3 = f (u3 , tn+1 ) (8)

2 Finite difference formulas for first derivatives


Left-sided finite differece scheme first order:
∆x ∂ 2 u

∂u ui − ui−1
= + + ... (9)
∂x xi ∆x 2 ∂x2 xi

Left-sided finite differece scheme second order:


∆x2 ∂ 3 u

∂u 3ui − 4ui−1 + ui−2
= + + ... (10)
∂x xi 2∆x 3 ∂x3 xi

Right-sided finite differece scheme first order:


∆x ∂ 2 u

∂u ui+1 − ui
= − + ... (11)
∂x xi ∆x 2 ∂x2 xi

Right-sided finite differece scheme second order:


∆x2 ∂ 3 u

∂u −3ui + 4ui+1 − ui+2
= + + ... (12)
∂x xi 2∆x 3 ∂x3 xi

1
Central finite differece scheme second order:
∆x2 ∂ 3 u

∂u ui+1 − ui−1
= − + ... (13)
∂x xi 2∆x 6 ∂x3 xi
Central finite differece scheme fourth order:
∆x4 ∂ 5 u

∂u −ui+2 + 8ui+1 − 8ui−1 + ui−2
= + + ... (14)
∂x xi 12∆x 30 ∂x5 xi

3 Finite difference formulas for second derivatives


Left-sided finite differece scheme first order:
∂ 2 u ∂ 3 u

ui − 2ui−1 + ui−2
= + ∆x + ... (15)
∂x2 xi ∆x2 ∂x3 xi
Left-sided finite differece scheme second order:
∂ 2 u 11∆x2 ∂ 4 u

2ui − 5ui−1 + 4ui−2 − ui−3
= − + ... (16)
∂x2 xi ∆x2 12 ∂x4 xi
Right-sided finite differece scheme first order:
∂ 2 u ∂ 3 u

ui+2 − 2ui+1 + ui
= − ∆x + ... (17)
∂x2 xi ∆x2 ∂x3 xi
Right-sided finite differece scheme second order:
∂ 2 u 11∆x2 ∂ 4 u

2ui − 5ui+1 + 4ui+2 − ui+3
= + + ... (18)
∂x2 xi ∆x2 12 ∂x4 xi
Central finite differece scheme second order:
∂ 2 u ∆x2 ∂ 4 u

ui+1 − 2ui + ui−1
= − + ... (19)
∂x2 xi ∆x2 12 ∂x4 xi
Central finite differece scheme fourth order:
∂ 2 u ∆x4 ∂ 6 u

−ui+2 + 16ui+1 − 30ui + 16ui−1 − ui−2
= + + ... (20)
∂x2 xi 12∆x2 90 ∂x6 xi

4 Finite difference formulas for third derivatives


Central finite differece scheme second order:
∂ 3 u ∆x2 ∂ 5 u

ui+2 − 2ui+1 + 2ui−1 − ui−2
= − + ... (21)
∂x3 xi 2∆x3 4 ∂x5 xi
Central finite differece scheme fourth order:
∂ 3 u 7∆x4 ∂ 7 u

−ui+3 + 8ui+2 − 13ui+1 + 13ui−1 − 8ui−2 + ui−3
= + + ... (22)
∂x3 xi 8∆x3 120 ∂x7 xi

5 Finite difference formulas for fourth derivatives


Central finite differece scheme second order:
∂ 4 u ∆x2 ∂ 6 u

ui+2 − 4ui+1 + 6ui − 4ui−1 + ui−2
= − + ... (23)
∂x4 xi ∆x4 6 ∂x6 xi

You might also like