0% found this document useful (0 votes)
19 views5 pages

One Dimensional Finite Difference Technique Explanations and Problems

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

One Dimensional Finite Difference Technique Explanations and Problems

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Integration and Differential Evaluation and Ordinary Differential Equations Solution Method

ONE DIMENSIONAL FINITE DIFFERENCE TECHNIQUE

1.1. Numerical Investigation-Finite Difference Method (FDM)


Numerical solutions are generally more computationally complex and are not unconditionally
accurate. The most powerful technique in numerical investigation is the finite difference. The
domain should be discretized in several nodes/grids as shown:

i = Nx
i=0 i−1 𝑖 i+1

Fig.1.3. A domain discretization analysis


1.1.1. Forward Difference Scheme (FDS) For one Dimensional(1D)
FDS can be applied to connect the side boundary condition at i= 0 (Left BCs) to the next nodes
inside the studied domain.
Table 1.2. Forward Difference Scheme
FDM- FDS Truncation
error
1st 𝐝𝐓 4T(i + 1) − T(i + 2) − 3T(i) 2nd order
derivative =
𝐝𝐱 2∆x
2nd 𝐝𝟐 𝐓 −T(i + 3) + 4T(i + 2) − 5T(i + 1) + 2T(i) 2nd order
derivative =
𝐝𝐱 𝟐 ∆x 2

3rd 𝐝𝟑 𝐓 −3T(i + 4) + 14T(i + 3) − 24T(i + 2) + 18T(i + 1) − 5T(i) 2nd order


=
derivative 𝐝𝐱 𝟑 2∆x 3

1.1.2. Central Difference Scheme (CDS)


The solution of the central nodes which locate inside the domain. The nodes should be connected
to the side wall nodes.
Table 1.3. Central Difference Scheme
FDM- CDS Truncation
error
1st derivative 𝐝𝐓 T(i + 1) − T(i − 1) 2nd order
=
𝐝𝐱 2∆x
2nd derivative 𝐝𝟐 𝐓 T(i + 1) − 2T(i) + T(i − 1) 2nd order
=
𝐝𝐱 𝟐 ∆x 2
Integration and Differential Evaluation and Ordinary Differential Equations Solution Method

3rd derivative 𝐝𝟑 𝐓 T(i + 2) − 2T(i + 1) + 2T(i − 1) − T(i − 1) 2nd order


=
𝐝𝐱 𝟑 2∆x 3

1.1.3. Backward Difference Scheme (BDS)


Table1.4. Backward Difference Scheme
FDM- BDS Truncation
error
1st 𝐝𝐓 3T(i) − 4T(i − 1) + T(i − 2) 2nd order
derivative =
𝐝𝐱 2∆x
2nd 𝐝𝟐 𝐓 2T(i) − 5T(i − 1) + 4T(i − 2) − T(i − 3) 2nd order
derivative =
𝐝𝐱 𝟐 ∆x 2

3rd 𝐝𝟑 𝐓 5T(i) − 18T(i − 1) + 24T(i − 2) − 14T(i − 3) + 3T(i − 4) 2nd order


derivative =
𝐝𝐱 𝟑 2∆x 3

PROBLEM 1.2 STATEMENT (Heat Transfer Applications-Steady State)


Solve the one dimensional ODE using Finite difference method and specify the temperature
values at each points (grids).
d2 T h
+ (T − T) = 0
dx 2 k f

Fig.1.2. Rectangular Fin


The boundary conditions should be defined first:
T(1) = 80o C Left Boundray condition
Integration and Differential Evaluation and Ordinary Differential Equations Solution Method

T(5) = Tf = 20o C Right Boundray condition


The internal nodes as 2, 3, and 4
2≤i≥4
Central Finite Difference Scheme (CFDS)
For 2nd order differential equation:
dT 2 T(i + 1) − 2T(i) + T(i − 1)
= Plug this into the given governing equation leads to:
dx 2 ∆x 2
T(i + 1) − 2T(i) + T(i − 1) h
+ (Tf − T(i)) = 0
∆x 2 k
1 T(i + 1) + T(i − 1) h
T(i) = [ + Tf ]
h 2 ∆x 2 k
+
k ∆x 2
clear all
clc
L=8; % the length of the fin in cm
Nx=5; % the number of points (grids)
T(1:5)=0; % Initialization of the domain
T(1)=80; % Left BCs
T(5)=20; % Right BCs
Niter=10000;
h=0.1; % Convective heat transfer coefficient W/m^2-K
k=3; % Thermal conductivity in W/m-K
dx=L/(Nx-1); % distance between two adjacent nodes
Tinf=20; % Fluid and Tip temperature of the fin
for kk = 1:Niter
for i=2:4
T(i)=(1/(h/k+2/dx^2))*((T(i+1)+T(i-1))/dx^2+h/k*Tinf);
end
end
T'

T= 80 59.19 43.519 31.024 20


Problem Statement (1.3): Solve the one dimensional ODE using Finite difference method and
specify the temperature values at each points (grids).
d2 T ̅
2Wh 𝑔′′′
− (T − T∞ ) = −
dx2 Ac k k
Integration and Differential Evaluation and Ordinary Differential Equations Solution Method

10 m

Fig.1.2 Fin with heat generation


Fig.1.2 illustrates a rectangular, has a thickness (H) that has constant in its value at base to the tip
of the fin. The fin is surrounded by the fluid at (T∞ = 22oC) with average convective heat
W
transfer h̅ = 11 m2 −K . The fin material has thermal conductivity (k =3W/m-k) and the base
temperature of the fin is kept at (Tb = 150 oC).The tip of the fin is insulated. The width of fin is W
and its length is L. The width (W) is much larger than the thickness of the fin; therefore the
convection from the edge of the fin was neglected. The heat is generated inside the fin by electrical
current (g ′′′ = 105 w/m3 ).The cross section area of the straight triangular fin, as shown in Fig1.2,
is
Ac = HW
Assume Nx =100 and the number of iteration is Niter =10000.
Plot the temperature distribution vs the position x?
The boundary conditions should be defined first:
T(1) = 150o C Left Boundray condition
T(Nx) = T∞ = 22o C Right Boundray condition
The internal nodes as 2, 3, and 4
2 ≤ i ≥ Nx − 1
Central Finite Difference Scheme (CFDS)
For 2nd order differential equation:
dT 2 T(i + 1) − 2T(i) + T(i − 1)
= Plug this into the given governing equation leads to:
dx 2 ∆x 2
T(i + 1) − 2T(i) + T(i − 1) 2Wh g ′′′
+ (T − T(i)) = −
∆x 2 Ac k f k
Integration and Differential Evaluation and Ordinary Differential Equations Solution Method

2 2W h T(i + 1) + T(i − 1) g ′′′ 2W h


T(i)[ + ] = [ + + T ]
∆x 2 Ac k ∆x 2 k Ac k ∞
T(i + 1) + T(i − 1) g ′′′ 2W h
[ + + A T∞ ]
∆x 2 k c k
T(i) =
2 2W h
( 2+ A )
∆x c k

Start coding yields:


clear all
clc
L=10; % The length of the fin in cm
W=0.1; % Width of the fin
H=0.01; % Fin's Height
Nx=100; % The number of points (grids)
T(1:Nx)=0; % Initilaization of the domain
T(1)=150; % Left BCs
T(Nx)=22; % Right BCs
Niter=10000;
h=11; % Convective hea transfer coefficient W/m^2-K
k=1; % Thermal conductivity in W/m-K
dx=L/(Nx-1); % distance between two adjacent nodes
Tinf=22; % Fluid and Tip temperature of the fin
G=1e5; % Heat Generation
Ac=W*H;
for kK = 1:Niter
for i=2:Nx-1
T(i)=(1/(((2*W)/Ac)*(h/k)+2/dx^2))*((T(i+1)+T(i-
1))/dx^2+(2*W)/Ac*(h/k)*Tinf+G/k);
end
end
x=0:dx:L;
plot (x,T)
grid on
xlabel('x');ylabel('T')
160

140

120

100
T

80

60

40

20
0 1 2 3 4 5 6 7 8 9 10
x

You might also like