



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




ME2016, Dr. Ferri Finite-Difference Example
One of the most important types of problems that engineers and scientists need to solve is known as a two-point-boundary-value-problem (TPBVP). A popular solution technique, known as the finite-difference technique, is explored in this problem. (See Section 27.1 of the text)
A cooling fin extends from a hot furnace wall as shown below. Assuming that heat flows only in the x-direction, the thermal equilibrium equation leads to the following governing equation:
2 2 (^ a )^0
d T kA hP T T dx
where k = thermal conductivity, A = cross-sectional area, h = convection heat transfer coefficient, Ta = surrounding or “ambient” temperature, P = perimeter, and T(x) = temperature at
x. The boundary conditions for this problem are:
( ) ( ) (^) a dT L k h T L T dx
− = − (2a, b)
For simplicity, let Y = T - Ta, let k/h = A/P = 1, L=1, and let T0- Ta = 10. Then, the equation
and boundary conditions are:
2 − Y = dx
d Y , Y (0) = T 0 − Ta = 10 and ( 1 )
dx
dY − = (3a, b, c)
T(0) Cooling Fin, T(x)
x L
T∞
Δx
x 0 x 1 x 2
Δx
xN
Δx
xN+
Δx
xN-
L
“virtual node” y 0 y 1 y 2 yN-1 yN
Now, consider a finite-difference solution to this problem. Divide the fin into N equal segments of length Δx = L/N. The temperature difference at each node is denoted yi, i = 1, 2, … N.
The first and second-derivative at each node can be expressed to order O(Δx2) using centered- difference expressions (see page 89 of text):
x
y y y (^) i i i Δ
2
x
y y y y (^) i i i i Δ
′′ (^) = −^ + (4a, b)
At node 1, substitution of (4b) into (3a) yields:
1 2 0
2 2 1
0 1 2 1 1 (^2 )
y x y y y x
y y y y y = ⇒ +Δ − = Δ
where y0 = 10. Similarly, at nodes 2, 3, …, N-1, we would get:
1
2 2 1
′ i ′ (^) = i ⇒ i −^ i i + yi yi − x yi yi + x
y y y y y , i = 2,…,N-1 (6)
The end point requires special treatment because of the convective (or natural ) boundary condition at x = L, (3c). Imagine that there was an (N+1)st “virtual node”, with temperature yN+1. Approximating (3a) at node N yields:
( 2 ) 0
2 1
2 2 1
(^1 1) = ⇒− + +Δ − = Δ
− + ′ N ′ (^) = N ⇒ N −^ N N + yN yN − x yN yN + x
y y y y y (7)
To get a relation for yN+1 , we use the natural boundary condition (3c) at x = L together with the
first centered difference expression (4a) :
N N N N
N N N N y y y xy x
y y y y = ⇒ = − Δ Δ
1 1
Equation (8) can be used to eliminate yN+1 from equation (7) above:
− 2 y (^) N − 1 +( 2 + 2 Δ x +Δ x^2 ) yN = 0 (9)
Equation (5), (6) and (9) constitute N linear algebraic equations in N-unknowns.
It is known that the exact solution to equation (3a) subject to boundary conditions (3b) and (3c)
is Y ( x )= 10 e − x. We will compare this answer to finite-difference solutions using N=2 and
N=5.
Solution
The following function implements the Finite-Difference (FD) method for this problem:
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 3
4
5
6
7
8
9
10
x
Y
Exact solution N= N=
Figure 1. Exact solution vs Finite-Difference solutions using N=2 and N=
The result is shown in Figure 1. The error between the FD solutions and the exact solution is shown in Figure 2. Note that while both approximate results are fairly good, the N=5 solution is better than the N=2 result.
(^00) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x
error
N= N=
Figure 2. Error between exact solution and FD solution
Since the centered-difference approximations of equation (4) are accurate to order O(Δx^2 ), the
ratio of errors is theoretically predicted to be (0.5)^2 /(0.2)^2 = 6.25. This compares very favorably with what we actually found. The ratio of the maximum error in the N=2 solution to the maximum error in the N=5 solution is found to be 6.1242.