Page 148 - Computational Fluid Dynamics for Engineers
P. 148
134 4. Numerical Methods for Model Parabolic and Elliptic Equations
Backward difference
4 {UxxX2
\dx . ~
5
1 d u
= ^ 4 (ui - 4ui-i + Qm-2 - iui-3 + u^ 4) + ZAx-Q^ (P4.3.2)
Central difference
4 u
\ dx j ~ y xxxx)i
2 6
1 Ax d u
= + 2 4Ui+l + 6Ui AUi l + Ui 2 P4 3 3
A?^ ~ ~ ~ ~ ^ 2Td~s ( - - )
4-4. Solve Eq. (4.2.4) subject to the following boundary and initial conditions:
x = 0, T = 0; x = l, T = 0
t = 0, T=100sin7rx, 0 < x < l
with the explicit method discussed in subsection 4.4.1 for values of t = 0.005,
0.01, 0.02, 0.10, with a = 0.2, for three different spacings in t.
(a) At = -J— (b) At = — (c) At = —
v y v J v y
1000 1000 100
Compare your results with the analytical solution
T(t,x) = lOOe-^^sinyrx
at x = 0.3 and determine the percentage error in each case. Discuss the accuracy
of the results, the behavior of the solutions and the importance of the ratio
At/'(Ax) 2 in each case.
4-5. Repeat Problem 4.4 using the Crank-Nicolson method. Compare your
results with those obtained with the explicit method.
4-6. Repeat Problem 4.4 with Keller's box method and compare your solutions
with those obtained with the Crank-Nicolson method.
4-7. Solve Eq. (4.2.4) subject to the following boundary and initial conditions:
x = 0, — = -7rT; X = 1, — = -TTT
ox ox
t = 0, T = sin7r(x-1/4), 0 < x < l
using