next up previous contents
Next: Flow chart Up: The 2-D Burgers Equation Previous: Evolution of v velocity   Contents


The Thomas Algorithm

We explain here in the general case how are treated the inversion of the systems resulting from implicit schemes with three space points (i-1, i, i+1). We can write them form :


\begin{displaymath}a_i u_{i-1}^{n+1}+b_i u_i^{n+1}+c_i u_{i+1}^{n+1}=f_i(u^n) \ \ \ \
\forall i=1,\cdots,N_x-1\end{displaymath}

With boundary conditions : $u_{i=0}^n= U_0$ and $u_{i=N_x}^n=U_{N_x}$

What results in the following matric system :

\begin{displaymath}\left(
\begin{array}{ccccccc}
1 & 0 & 0 & . & . & . & . \\
a...
.... \\
. \\
. \\
f_{N_x-1} \\
U_{N_x} \\
\end{array}\right)
\end{displaymath}


The boundary conditions can be gathered in the second member :


\begin{displaymath}\left(
\begin{array}{cccccc}
\par b_1 & c_1 & 0 & . & . &. \\...
...\\
. \\
. \\
F_{N_x-2} \\
F_{N_x-1} \\
\end{array}\right) \end{displaymath}


The matrix obtained possesses three diagonals, then the inversion of the system is done by the Thomas Algorithm. It is done in two distinct times :

$\bullet$ The first consists to forward sweep the matrix in order to obtain a matrix with two diagonals in "removing" the coefficients $a_i$ :


\begin{displaymath}\left(
\begin{array}{cccccc}
\par b'_1 & c'_1 & 0 & . & . &. ...
...
. \\
. \\
F'_{N_x-2} \\
F'_{N_x-1} \\
\end{array}\right)
\end{displaymath}


And we have a new algebraic system defined by :

$b'_i u_i^{n+1}+c'_i u_{i+1}^{n+1}$ = $F'_i(u^n)$ $ \ \ \ \ \forall \
i=1,\cdots,N_x-2$
       
$b'_{N_x-1}u_{N_x-1}^{n+1}$ = ${F'}_{N_x-1}^n$ $ \ \ \ \ for \ i=N_x-1$

With the new coefficients :


\begin{displaymath}b'_1=b_1 \ \ \ , \ \ \ F'_1=F_1\end{displaymath}


\begin{displaymath}c'_i=c_i \ \ \ \ \forall \ i=1, \cdots ,N_x-1\end{displaymath}


\begin{displaymath}b'_i=b_i-c'_{i-1}\frac{a_i}{b'_{i-1}} \ \ \ \ \forall i=2 \cdots N_x-1\end{displaymath}


\begin{displaymath}F'_i=F_i-F'_{i-1}\frac{a_i}{b'_{i-1}} \ \ \ \ \forall i=2 \cdots N_x-1\end{displaymath}

$\bullet$ The second time consists to backward sweep the new matrix in order to calculate the solution :

We obtain initially


\begin{displaymath}u_{N_x-1}^{n+1}=\frac{{F'}_{N_x-1}^n}{b'_{N_x-1}}\end{displaymath}

then, we calculate the solutions for any x, with the time step n+1 :


\begin{displaymath}u_i^{n+1}=\frac{F'_i-c'_i u_{i+1}^{n+1}}{b'_i}\ \ \ \ \forall \
i=N_x-2,\cdots,1\end{displaymath}


* * * * *


next up previous contents
Next: Flow chart Up: The 2-D Burgers Equation Previous: Evolution of v velocity   Contents
Alban Depoutre
2000-11-21