Sie sind auf Seite 1von 9

Jonathan Wang

Heat Transfer Code - Transient


A flue passing hot exhaust gases has a square cross section, 300 mm to a side. The
walls are constructed of refractory brick 150mm thick with a thermal conductivity of
0.85 W/m-K. The interior surface is exposed to hot gases at 350C with a convection
coefficient of 100 W/m2-K, while the exterior surfaces experiences convection with
air at 25C and a convection coefficient of 5 W/m2-K. Initially with no flue gases
flowing, the walls (=5.5 x 10-7 m2/s) are at a uniform temperature of 25C. Using
the implicit, finite-difference method with a time increment of 1 h, write a computer
program to solve for the temperature distribution in the wall (at the inner surface,
center point, and outer surface) 5, 10, 50, and 100 h after introduction of the flue
gases. Investigate the effect of grid spacing on the solution (use grid spacing of 25,
15, 10, and 5 mm) and time step (use time steps of 0.5, 1, and 2 h).
a) Plot the temperature distribution at the three points as a function of time and
grid spacing
b) Discuss solution results (i.e, effect of grid spacing and choice of time step on
the solution)

350
C

Node
3

Node
2

25
C

Node
1

Figure 1 : Contour plot of the flue after 100 hours for a grid spacing of 5mm

Jonathan Wang
Heat Transfer Code - Transient

Figure 2: Nodal temperature plot of the flue after 100 hours for a grid spacing of 5mm
Table 1: Nodal Temperatures at 100 hours for time step = .5 hours and grid spacing = 5 mm
0
12.0000

1.0000
13.0000

2.0000

3.0000

4.0000

5.0000

6.0000

7.0000

8.0000

9.0000

10.0000

11.0000

1.0000 97.9718 108.7029 119.3973 129.9339 140.1000 149.6006 158.1008 165.3133 171.0905 175.4293 178.4138
180.1502 180.7191
2.0000 108.7029 121.0306 133.3582 145.5505 157.3593 168.4243 178.3183 186.6653 193.2937 198.2284 201.5988
203.5501 204.1879
3.0000 119.3973 133.3582 147.4544 161.5507 175.3623 188.4191 200.0828 209.7358 217.1904 222.5920 226.2027
228.2635 228.9324
4.0000 129.9339 145.5505 161.5507 177.8354 194.1201 209.8071 223.8581 235.0046 243.1402 248.7463 252.3566
254.3689 255.0146
5.0000 140.1000 157.3593 175.3623 194.1201 213.4756 232.8312 250.5377 263.2844 271.6196 276.8965 280.1087
281.8407 282.3882
6.0000 149.6006 168.4243 188.4191 209.8071 232.8312 257.5042 282.1773 295.9756 303.1573 307.1112 309.3409
310.4971 310.8567
7.0000 158.1008 178.3183 200.0828 223.8581 250.5377 282.1773 324.6915 335.2834 337.9227 339.0503 339.6464
339.9503 340.0443
8.0000 165.3133 186.6653 209.7358 235.0046 263.2844 295.9756 335.2834 350.0000 350.0000 350.0000 350.0000
350.0000 350.0000
9.0000 171.0905 193.2937 217.1904 243.1402 271.6196 303.1573 337.9227 350.0000 350.0000 350.0000 350.0000
350.0000 350.0000
10.0000 175.4293 198.2284 222.5920 248.7463 276.8965 307.1112 339.0503 350.0000 350.0000 350.0000 350.0000
350.0000 350.0000

Jonathan Wang
Heat Transfer Code - Transient
11.0000 178.4138 201.5988 226.2027 252.3566 280.1087 309.3409 339.6464 350.0000 350.0000 350.0000 350.0000
350.0000 350.0000
12.0000 180.1502 203.5501 228.2635 254.3689 281.8407 310.4971 339.9503 350.0000 350.0000 350.0000 350.0000
350.0000 350.0000
13.0000 180.7191 204.1879 228.9324 255.0146 282.3882 310.8567 340.0443 350.0000 350.0000 350.0000 350.0000
350.0000 350.0000

Figure 3: Temperature vs Time Step at 100 hours for grid spacing = 5 mm

Jonathan Wang
Heat Transfer Code - Transient
For each of the nodes, the temperature distribution at the smallest time step
reached the final temperature after the fewest number of time steps. The steadystate temperature is reached quickest at the node on the inside wall, followed by
the middle node and then the outside wall node. Since the heat transfer is going out
of the flue, the inner temperature changes more quickly than the outer wall.

Figure 4: Temperature vs Grid Spacing at 100 hours for Time Step = 0.5 hours

Jonathan Wang
Heat Transfer Code - Transient
When changing the grid size, the temperature distribution at the inside wall and
outside wall were not affected. This is because the grid size does not affect the
temperature at the end nodes since they are at the surface. The grid size does
affect the middle node temperature because it is calculated by the temperature of
its neighboring nodes. Since the nodes are closer together for smaller grid spacing,
the calculation for the temperature at that node is more accurate. Figure 3 shows
that for the middle node, as grid spacing decreases, the temperature rises. The
temperature rises as it gets more accurate because the difference in temperature
between the node and the node above it (closer to outer wall) is greater than the
difference in temperature between the node and the node below it (closer to the
inner wall). The calculations for the node assumes that the node is being heated
linearly, so the resulting temperature is lower than the actual one.

Code:
%Jonathan Wang
%Heat Transfer Project 2
%11/14/2014
%% initialize variables
dt = [.5*3600, 1*3600, 2*3600]; %i
dx = [.025, .015, .01, .005]; %j
i = 1;
j = 1;
t = 100*3600;
Ti = 350;
To = 25;
%% Loop for all dt & dx
%for i = 1:3
%for j = 1:4
step = 0;
a = 5.5*10^(-7);
Bii = 100*dx(j)/.85;
Bio = 5*dx(j)/.85;
Fo = dt(i)*a/(dx(j)*dx(j));
w = .3;
n = ceil(w/dx(j));
T2 = To*ones(n+2);
T1 = To*ones(n+2);
Time = zeros(1, ceil(t/dt(i)+1));

Jonathan Wang
Heat Transfer Code - Transient
n1 = zeros(1, ceil(t/dt(i)+1));
n2 = zeros(1, ceil(t/dt(i)+1));
n3 = zeros(1, ceil(t/dt(i)+1));
%% Matrix Formatting
%Hot Air
for rHA = n/2+3:n+2;
for cHA = n/2+3:n+2;
T2(rHA,cHA) = Ti;
T2(rHA,cHA) = Ti;
end
end
%Row and Column Numbering
for rRC = 2:n+2;
T2(rRC,1) = rRC-1;
T2(rRC,1) = rRC-1;
end
for cRC = 2:n+2;
T2(1,cRC) = cRC-1;
T2(1,cRC) = cRC-1;
end
T2(1,1) = 0;
%% Iterate Time Step for Final Temp
for t = 0:dt(i):t
T1 = T2;
time = dt(i)*step/3600;
%% Iterate Gauss-Seidel for Next Time Step
Error = 1;
while max(max(Error))>0.000000001
E = T2;
%% Corners
%Corner 1 (Outside)
T2(2,2) = (T1(2,2)+2*Fo*(T2(3,2)+T2(2,3))+4*Bio*Fo*To)/(1+4*Fo*(1+Bio));
%Corner 2 = (Inside)
T2(n/2+2,n/2+2) =
(T1(n/2+2,n/2+2)+2/3*Fo*(T2(n/2+2,n/2+3)+2*T2(n/2+2,n/2+1)+2*T2(n/2+1,n/2+2)+T
2(n/2+3,n/2+2))+4/3*Bii*Fo*Ti)/(1+4*Fo*(1+1/3*Bii));
%Corner 3 (Insulated Left)
T2(n+2,2) = (T1(n+2,2)+2*Fo*(T2(n+2,3)+T2(n+1,2))+2*Bio*Fo*To)/
(1+4*Fo+2*Bio*Fo);
%Corner 4 (Insulated Right)
T2(n+2,n/2+2) = (T1(n+2,n/2+2)+2*Fo*(T2(n+2,n/2+1)+T2(n+1,n/2+2))
+2*Bii*Fo*Ti)/(1+4*Fo+2*Bii*Fo);
%Corner 5(Insulated Top)
T2(2,n+2) = (T1(2,n+2)+2*Fo*(T2(2,n+1)+T2(3,n+2))+2*Bio*Fo*To)/
(1+4*Fo+2*Bio*Fo);
%Corner 6 (Insulated Bottom)
T2(n/2+2,n+2) = (T1(n/2+2,n+2)+2*Fo*(T2(n/2+2,n+1)+T2(n/2+1,n+2))
+2*Bii*Fo*Ti)/(1+4*Fo+2*Bii*Fo);
%% Sides
%Side 1 (Outside Left)
for r = 3:n+1;
T2(r,2) = (T1(r,2)+Fo*(2*T2(r,3)+T2(r-1,2)+T2(r+1,2))+2*Bio*Fo*To)/
(1+2*Fo*(2+Bio));
end

Jonathan Wang
Heat Transfer Code - Transient
%Side 2 (Outside Top)
for c = 3:n+1;
T2(2,c) = (T1(2,c)+Fo*(2*T2(3,c)+T2(2,c-1)+T2(2,c+1))+2*Bio*Fo*To)/
(1+2*Fo*(2+Bio));
end
%Side 3 (Inside Left)
for r = n/2+3:n+1;
T2(r,n/2+2) = (T1(r,n/2+2)+Fo*(2*T2(r,n/2+1)+T2(r-1,n/2+2)+T2(r+1,n/2+2))
+2*Bii*Fo*Ti)/(1+2*Fo*(2+Bii));
end
%Side 4 (Inside Top)
for c = n/2+3:n+1;
T2(n/2+2,c) = (T1(n/2+2,c)+Fo*(2*T2(n/2+1,c)+T2(n/2+2,c-1)+T2(n/2+2,c+1))
+2*Bii*Fo*Ti)/(1+2*Fo*(2+Bii));
end
%Side 5 (Insulated Side)
for r =3:n/2+1;
T2(r,n+2) = (T1(r,n+2)+Fo*(2*T2(r,n+1)+T2(r-1,n+2)+T2(r+1,n+2)))/(1+4*Fo);
end
%Side 6 (Insulated Bottom)
for c =3:n/2+1;
T2(n+2,c) = (T1(n+2,c)+Fo*(2*T2(n+1,c)+T2(n+2,c-1)+T2(n+2,c+1)))/(1+4*Fo);
end
%% Interior
for r = 3:n+1;
for c = 3:n/2+1;
T2(r,c) = (T1(r,c)+Fo*(T2(r,c+1)+T2(r,c-1)+T2(r+1,c)+T2(r-1,c)))/(1+4*Fo);
end
end
for r = 3:n/2+1;
for c = n/2+1:n+1;
T2(r,c) = (T1(r,c)+Fo*(T2(r,c+1)+T2(r,c-1)+T2(r+1,c)+T2(r-1,c)))/(1+4*Fo);
end
end
Error = abs(T2-E);
end %G-S iteration
%% Collect Data for current time step
step = step + 1;
Time(1,step) = time;
% temp as a function of time
n1(1,step) = T1(n+2,n/2+2);
if dx(j) == 0.01
n2(1,step) = (T1(n+2,n/4+.5)+T1(n+2,n/4+1.5))/2;
else
n2(1,step) = T1(n+2,n/4+1);
end
n3(1,step)= T1(n+2,2);
end %Time iteration
%% Plot Temperature Distribution for dt(i) = .5 hours
% if dt(i) == .5*3600
%
% subplot(3,1,1)

Jonathan Wang
Heat Transfer Code - Transient
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%

hold on
plot(Time,n1)
title('Node 1 (Inner Surface) Temp Vs dx @100 hours dt = 0.5')
xlabel('Hours')
ylabel('Degrees C')
subplot(3,1,2)
hold on
plot(Time,n2)
title('Node 2 (Middle) Temp Vs dx @100 hours dt = 0.5')
xlabel('Hours')
ylabel('Degrees C')
subplot(3,1,3)
hold on
plot(Time,n3)
title('Node 3 (Outer Surface) Temp Vs dx @100 hours dt = 0.5')
xlabel('Hours')
ylabel('Degrees C')
end% dt = .5

%% Plot Temperature Distribution for dx(j) = 5 mm


% if dx(j) == .005
%
%
%
%
%
%

subplot(3,1,1)
hold on
plot(Time,n1)
title('Node 1 (Inner Surface) Temp Vs dt @100 hours dx = 5 mm')
xlabel('Hours')
ylabel('Degrees C')

%
%
%
%
%
%

subplot(3,1,2)
hold on
plot(Time,n2)
title('Node 2 (Middle) Temp Vs dt @100 hours dx = 5 mm')
xlabel('Hours')
ylabel('Degrees C')

%
%
%
%
%
%
%

subplot(3,1,3)
hold on
plot(Time,n3)
title('Node 3 (Outer Surface) Temp Vs dt @100 hours dx = 5 mm')
xlabel('Hours')
ylabel('Degrees C')
end% dx = 5 mm

%
imagesc(T2)
%
colormap hot
% axis square
% xlabel('nodes')
% ylabel('nodes')
% colorbar
%end

Jonathan Wang
Heat Transfer Code - Transient
%
subplot(3,1,1)
%
legend toggle
%
subplot(3,1,2)
%
legend toggle
%
subplot(3,1,3)
%
legend toggle
% disp(Error)
disp(T2)
% disp(T1)

Das könnte Ihnen auch gefallen