Programming Assignment Report
Programming Assignment Report
GROUP 40:
ANSY JENA:22B2513
T
ASHUTOSH GANDHE:22B2409
PRATHAMESH YEOLE:22B2541
PROBLEM 4:
onsidertwoplates,AandB,thatareeachinitiallyisothermalandeachofthicknessL=5mm.The
C
faces of the plates are suddenly brought into contact in a joining process. Material A is acrylic,
initiallyatTi,A=20oCwithρA =1990kg/m3,cA =1470J/kg.KandkA =0.21W/m.K.MaterialBissteelinitially
atTi,B =300oCwithρB =7800kg/m3, cB =500J/kg.KandkB =45W/m.K.Theexternal(back)surfacesof
the acrylic and steel are insulated. Neglecting the thermal contact resistancebetweentheplates,
determine how long it will take for the external surface of the acrylic to reach its softening
temperature, Tsoft = 90oC. Plot the acrylic’s external surface temperature as well as the average
temperatures of both materials over the time span . Use 20 equally spaced nodal points.
MATLAB CODE
%we can set delt = 0.0001 seconds (Using the stablility condition)
%3000000 starting from t = 0.0 and the 1 extra for when we reach t=300
T= zeros(3000001, 20);
%Constants
delt = 0.0001;
delx = 5 * 10^(-3)/9.5;
%For A
ka = 0.21;
ca = 1470;
pa = 1990;
%For B
kb = 45;
cb = 500;
pb = 7800;
R = delx/(2*ka) + delx/(2*kb);
z=0;
for
L = 1:300000
0
%now to
column by column to perform gauss seidel
for
i=1:20
%for node 1
if
i ==1
end
%for nodes 2 to 9
if
i >1 && i<10
end
if
i == 10
end
if
i == 11
end
if
i >11 && i<20
end
end
end
if
(abs(T(L, 1) - (90+273)) < 0.001 && z == 0)
fprintf(
"The time at which temperature is 90 degrees = %9.9f seconds \n"
,
L * 0.0001);
z=1;
end
end
for
j = 1:3000001
sum_a = 0;
sum_b = 0;
for
k = 1: 20
%for material A
if
(k<11)
if
(k == 1)
else
end
end
if
k>10
if
k == 20
else
end
end
T_a_avg(j) = sum_a/9.5;
T_b_avg(j) = sum_b/9.5;
end
time_range = x*0.0001;
xlabel(
'time in seconds'
);
ylabel(
'Temperature (K)'
);
title(
'External Temperature of Acrylic'
);
grid
on
;
print(
'External Temp of Acrylic'
,
'-dpng'
);
figure;
%now to plot the average surface temperatures
%for material A
plot(time_range(1:3000000), T_a_avg(1:3000000));
hold
on
;
%for material B
plot(time_range(1:3000000), T_b_avg(1:3000000));
xlabel(
'Time in seconds'
);
ylabel(
'Temperature of Surfaces (K)'
);
legend(
'Material A'
,
'Material B'
);
title(
'Average Temperatures of Materials'
)
grid
on
;
print(
'Average Surface Temp'
,
'-dpng'
);