Computational Fluid Dynamics
Lecture 4
Tridiagonal matrices are very efficient to solve computationally using the Thomas algorithm.
Pg
183184 using forward substitution and backward elimination.
1 1
1
2
2
2
2
3
3
3
1
1
1
i
i
i
m
m
m
m
m
b c
u
a b c
u
a b c
a bc
a
b
c
a b
−
−
−
%
%
1
2
3
3
1
1
i
i
m
m
m
m
R
R
u
R
u
R
u
R
u
R
−
−
=
#
#
#
#
Consider the linearized advectiondiffusion equation.
2
2
u
u
C
v
t
x
∂
∂
∂
+
=
∂
∂
∂
u
x
discretized with the backward Euler method, and second order spatial differences.
1
1
1
1
1
1
1
1
1
2
2
2
n
n
n
n
i
i
i
i
n
n
i
i
u
u
u
u
C
t
x
u
u
u
v
1
n
i
x
+
+
+
+
−
+
+
+
−
−
−
= −
∆
∆
−
+
+
∆
+
1
+
There are three unknowns.
1
1
1
1
,
,
n
n
n
i
i
i
u
u
u
+
+
+
−
Write system in the form
[
][ ]
[
]
1
1
1
1
1
n
n
n
i
i
i
i
i
i
i
Au
B u
C u
R
A
u
R
+
+
+
−
+
+
+
=
=
1
1
1
1
1
2
2
Rearranging gives
2
1
2
2
n
n
n
i
i
i
C
t
v t
v t
C
t
v t
u
u
u
x
x
x
x
x
+
+
+
−
+
∆
∆
∆
∆
∆
−
−
+
+
+
−
=
∆
∆
∆
∆
∆
2
n
i
u
special conditions are required near boundaries
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
i.e. when
i
is undefined.
1,
1
i
=
−
Appropriate boundary conditions might be
0 or
0
B
B
u
u
x
∂
=
=
∂
These prescribed B.C.’s take precedence over the governing equation and so the equation at the
boundary is just
2
1
1
0, or
0
u
u
u
x
−
=
=
∆
and with the definitions that
1
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '07
 Slinn
 Numerical differential equations, Numerical ordinary differential equations, ∆t, UIN

Click to edit the document details