You are on page 1of 13

ME 114 Heat Transfer

Computational Project A

April 2, 2015
Rafael Silva
ID: 010068565

Schematic

Figure 1: Schematic and grid

Assumptions
1.
2.
3.
4.
5.
6.

Two-dimensional heat transfer;


Steady-state;
Thin rectangular plate;
Constant k and h;
Internal heat generation;
For the corners, no heat flux coming from the side where the temperature of the border are constant;

Equations
We have defined: = =
General equation: + = 0
Internal nodes, i.e., for m = 2 to M-1 and n = 2 to N-1:

, =

(1, + +1, + ,1 + ,+1 +


4

For m = 1 and n = 2 to N -1: (constant temperature)


, = 300
For m = 2 to M-1 and n = N: (constant temperature)
, = 350

2
)

For m = 2 to M-1 and n = 1: (adiabatic)

, =

2 ,+1 + +1, + 1, +

For m = M and n = 2 to N: (natural convection)

, =

2 2
+
)

2(2 +
)

(2 1, + ,1 + ,+1 +

Corners:
1, =

(2, + 1,1 +

1,1 =

,1 =

,1 =

, =

Temperatures profiles:

2
)
2

2
(2,1 + 1,2 +

2
)
2

2
2
+
)
4
2

(2 +
)
2

(1,1 + ,2 +

2
+
)
2

(2 +
)

(1,1 + ,2 +

2
+
)
2

(2 +
)

(,1 + 1, +

Figure 2: Temperature profile at x = 0cm

Figure 3: Temperature profile at x = 5cm

Figure 4: Temperature profile at x = 10cm

Figure 5: Temperature profile at x = 20cm

Figure 6: Temperature profile at x = 30cm

Figure 7: Temperature profile at x = 40cm

Figure 8: Temperature profile at y = 0cm

Figure 9: Temperature profile at y = 5cm

Figure 10: Temperature profile at y = 10cm

Figure 11: Temperature profile at y = 20cm

Heat flux throughout the borders


The heat flux can be found by applying the discrete Fouriers law and natural convection equations. Vide the code
on appendix for more details about we achieved the following values:
At x = 0, q = -9.327 kW/m2 (going in)
At x = Lx, q = -2.682 kW/m2 (going in)
At y = 0, q = 105.8 W/m2 (going out the plate)
At y = Ly, q = 98.1 W/m2 (going out the plate)

Finding the equations proved itself to be the most challenging part of this whole assignment the numerical method
itself if relativity easy. Particularly, the corners equations were hard to obtain. As can be noticed in the figures 2 and
11, the corners introduce a discontinuity into the temperature function T(m,n). This phenomenon can explain why
the heat flux at y = 0 is not null, differently of what is expected. Since the boundary condition has stated this border
is adiabatic. So, we conclude that the heat is escaping through the corners.
This heat transfer problem has 201x101 equations and took 1172 iterations to converge for a 0.1 tolerance, which is
quite big when comparing with the ones that in fact used in numerical methods, however 0.1 tolerance served well
for our propose. These numbers point out that is humanly impossible to achieve a solution for this problem with
such precision as we got.

Appendix
Matlab code:
% ME-114 Heat Transfer
% Computational Project - Part A
% Student: Rafael Silva
% email: rafaelggustavo@gmail.com
clear all
close all
Lx = 0.4;
Ly = 0.2;
egen = 10;
k = 5;
Tinf = 400;
h = 10;
% Drawing the schematic:
plot([0 0], [0 Ly]);
hold on
plot([Lx Lx], [0 Ly]);
plot([0 Lx], [0 0]);
plot([0 Lx], [Ly Ly]);
xlabel('x');
ylabel('y');
% Show the numerical grids on the schematic
delta = 0.002; % deltax = deltay = delta
% Plotting the vertical lines of the grid:
control = 0;
for m = 0: Lx/delta
control = (m)*delta;
plot([control control], [0 Ly], 'k');
end
% Plotting the horizontal lines of the grid:
for m = 0: Ly/delta
control = (m)*delta;
plot([0 Lx], [control control], 'k');
end
title('Schematic - Grids')
% Gauss-Seidel Numerical Method
M = Lx/delta + 1; % Number of elements in x axis
N = Ly/delta + 1; % Number of elements in y axis
T = ones(M, N); % Temperature Matrix
count = 0; % Gives the number of iterations done
error = 1;
while (error > 0.1) % Tolerance of 0.1
Tpre = T; %Temperature matrix one iteration behind
for m = 1: M
for n = 1:N
if((m > 1)&(m < M)&(n == N)) % At n = N;
T(m,n) = 350;
end
if ((n > 1)&(n < N)&(m == 1)) % At m = 1;
T(m,n) = 300;
end
if ((m > 1)&(m < M)&(n == 1)) % At n = 1;

T(m,n) = (2*T(m,n+1) + T(m+1,n) + T(m-1, n) + egen*delta*delta/k)/4;


end
if ((n > 1)&(n < N)&(m == M)) % AT m = M;
T(m,n) = (2*T(m-1,n) + T(m,n-1) + T(m,n+1) + 2*h*delta*Tinf/k + egen*delta*delta/k)/(2*(h*delta/k +
2));
end
% Corners
T(1,1) = (T(2,1) + T(1,2) + egen*delta*delta/(2*k))/2;
T(1,N) = (T(2,N) + T(1,N-1) + egen*delta*delta/(2*k))/2;
T(M,1) = (T(M-1,1) + T(M,2) + h*delta*Tinf/k + egen*delta*delta/(2*k))/(2 + h*delta/k);
T(M,N) = (T(M,N-1) + T(M-1,N) + h*delta*Tinf/k + egen*delta*delta/(2*k))/(2 + h*delta/k);
if((m > 1)&(m < M)&(n > 1)&(n < N)) % Internal nodes
T(m,n) = (T(m-1,n) + T(m+1,n) + T(m,n-1) + T(m,n+1) + egen*delta*delta/k)/4;
end
end
end
error = max(max(abs(T - Tpre)));
count = count + 1;
disp(error); % Control variable that allow us to see if the method is converging or not
end
y = 0: delta: Ly;
x = 0: delta: Lx;
% Plotting T at x = 0, 5, 10, 20, 30 and 40cm
figure
plot(y, T(1,:))
title('T for x = 0cm')
xlabel('y (m)')
ylabel('Temperature (K)')
grid on
figure
plot(y, T(0.05/delta + 1,:))
title('T for x = 5cm')
xlabel('y (m)')
ylabel('Temperature (K)')
grid on
figure
plot(y, T(0.1/delta + 1,:))
title('T for x = 10cm')
xlabel('y (m)')
ylabel('Temperature (K)')
grid on
figure
plot(y, T(0.2/delta + 1,:))
title('T for x = 20cm')
xlabel('y (m)')
ylabel('Temperature (K)')
grid on
figure
plot(y, T(0.3/delta + 1,:))
title('T for x = 30cm')
xlabel('y (m)')
ylabel('Temperature (K)')
grid on
figure
plot(y, T(0.4/delta + 1,:))
title('T for x = 40cm')

xlabel('y (m)')
ylabel('Temperature (K)')
grid on
figure
%Plotting T at y = 0, 5, 10 and 20cm
plot(x, T(:, 1))
title('T for y = 0cm')
xlabel('x (m)')
ylabel('Temperature (K)')
grid on
figure
plot(x, T(:, 0.05/delta + 1))
title('T for y = 5cm')
xlabel('x (m)')
ylabel('Temperature (K)')
grid on
figure
plot(x, T(:, 0.1/delta + 1))
title('T for y = 10cm')
xlabel('x (m)')
ylabel('Temperature (K)')
grid on
figure
plot(x, T(:, 0.2/delta + 1))
title('T for y = 20cm')
xlabel('x (m)')
ylabel('Temperature (K)')
grid on
% Heat flux throughout the borders:
heat_m_M = 0; % Heat flux at x = Lx
for i = 1: N
if (i == 1 | i == N)
heat_m_M = heat_m_M - k*(T(M, i) - T(M - 1, i))/2;
else
heat_m_M = heat_m_M - k*(T(M, i) - T(M - 1, i));
end
end
heat_m_M = heat_m_M/Ly;
heat_m_1 = 0; % Heat flux at x = 0
for i = 1: N
if (i == 1 | i == N)
heat_m_1 = heat_m_1 - k*(T(1, i) - T(2, i))/2;
else
heat_m_1 = heat_m_1 - k*(T(1, i) - T(2, i));
end
end
heat_m_1 = heat_m_1/Ly;
heat_n_1 = 0; % Heat flux at y = 0
for i = 1: M
if (i == 1 | i == N)
heat_n_1 = heat_n_1 - k*(T(i, 1) - T(i, 2))/2;
else
heat_n_1 = heat_n_1 - k*(T(i, 1) - T(i, 2));
end
end
heat_n_1 = heat_n_1 + h*delta*(Tinf - T(M,1))/2; % Heat coming through convection in the corner

heat_n_1 = heat_n_1/Lx;
heat_n_N = 0; % Heat flux at y = Ly
for i = 1: M
if (i == 1 | i == N)
heat_n_N = heat_n_N - k*(T(i, 1) - T(i, 2))/2;
else
heat_n_N = heat_n_N - k*(T(i, 1) - T(i, 2));
end
end
heat_n_N = heat_n_N + h*delta*(Tinf - T(M,N))/2; % Heat coming through convection in the corner
heat_n_N = heat_n_N/Lx;
% End of the code

You might also like