6.4 Examples
153
The convergence of r ,
b at x = 0.95 for t = 0.01 as the time step size is reduced
is shown in Fig. 6.3. The implicit Euler and the three level method underpredict, while the explicit Euler and the Crank-Nicolson method over-predict
the correct value. All schemes show monotonic convergence towards the time
step independent solution.
- Crank-Nicolson
- \.
Implicit 3 Level
I ,
Implicit Euler
\.
Explicit Euler
\. - Exact
\%
\,
-
' . \. \. \.
x.
\ -
-/ /
/-------- -/-/ /
/ '
/ '
/
/
I /
- /
I
I
5
10
20
50
I
.2
.5
1
Number of steps
A t
Fig. 6.3. Convergence of q5 at x = 0.95 and t = 0.01 as the time step size is reduced
(left) and temporal discretization errors (right) for various time integration schemes
Since we do not have an exact solution to compare with, we obtained an
accurate reference solution at time t = 0.01 using the Crank-Nicolson scheme
(the most accurate method) with At = 0.0001 (100 time steps). This solution
is much more accurate than any of the above solutions so it can be treated
as an exact solution for error estimation purposes. By subtracting solutions
mentioned above from this reference solution, we obtained estimates of the
temporal discretization error for each scheme and time step size. The spatial
discretization error is the same in all cases and plays no role here. The errors
thus obtained are plotted against time step size in Fig. 6.3.
The two Euler methods show the expected first order behavior: the error
is reduced by one order of magnitude when the time step is reduced by the
same amount. The two second order schemes show also the expected error
reduction rate, which closely follow the ideal slope. However, the CrankNicolson method gives a more accurate solution since its initial error is much
smaller. The three level scheme is started by the implicit Euler method, which
resulted in a large initial error. Since, in this problem, the temporal variation
is monotonic from the initial towards steady state, the initial error remains
important throughout the solution. The error reduction rate is the same in
153
The convergence of r ,
b at x = 0.95 for t = 0.01 as the time step size is reduced
is shown in Fig. 6.3. The implicit Euler and the three level method underpredict, while the explicit Euler and the Crank-Nicolson method over-predict
the correct value. All schemes show monotonic convergence towards the time
step independent solution.
- Crank-Nicolson
- \.
Implicit 3 Level
I ,
Implicit Euler
\.
Explicit Euler
\. - Exact
\%
\,
-
' . \. \. \.
x.
\ -
-/ /
/-------- -/-/ /
/ '
/ '
/
/
I /
- /
I
I
5
10
20
50
I
.2
.5
1
Number of steps
A t
Fig. 6.3. Convergence of q5 at x = 0.95 and t = 0.01 as the time step size is reduced
(left) and temporal discretization errors (right) for various time integration schemes
Since we do not have an exact solution to compare with, we obtained an
accurate reference solution at time t = 0.01 using the Crank-Nicolson scheme
(the most accurate method) with At = 0.0001 (100 time steps). This solution
is much more accurate than any of the above solutions so it can be treated
as an exact solution for error estimation purposes. By subtracting solutions
mentioned above from this reference solution, we obtained estimates of the
temporal discretization error for each scheme and time step size. The spatial
discretization error is the same in all cases and plays no role here. The errors
thus obtained are plotted against time step size in Fig. 6.3.
The two Euler methods show the expected first order behavior: the error
is reduced by one order of magnitude when the time step is reduced by the
same amount. The two second order schemes show also the expected error
reduction rate, which closely follow the ideal slope. However, the CrankNicolson method gives a more accurate solution since its initial error is much
smaller. The three level scheme is started by the implicit Euler method, which
resulted in a large initial error. Since, in this problem, the temporal variation
is monotonic from the initial towards steady state, the initial error remains
important throughout the solution. The error reduction rate is the same in