1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
clc;
clear;
printf("\t\t\tChapter4_example3\n\n\n");
hc=30;
L=0.24;
k=1.25;
c=890;
rou=550;
Bi=hc*L/k;
alpha=k/(rou*c);
printf("The value of diffusivity is %.2e sq.m/s",alpha);
Tc=150;
T_inf=600;
T_i=50;
printf("\nThe Biot number is %.2f,",Bi);
if Bi<0.1 then
n=0;
else if Bi>0.1 then
n=1;
end
end
select n
case 0 then
disp('The Lumped capacity approach is applicable');
case 1 then
disp('Since value of Biot number is greater than 0.1, Lumped capacity approach would not give accurate results, so figure 4.6 is to be used');
reciprocal_Bi=1/Bi;
dimensionless_temp=(Tc-T_inf)/(T_i-T_inf);
Fo=0.4; //the value of Fourier Number from figure 4.6(a)
t=L^2*Fo/alpha;
printf("The required time is %d s = %.1f hr",t,t/3600);
end
// reading values of dimensionless temperature from figure 4.6(b) using reciprocal of Biot number
x_per_L=[0 0.2 0.4 0.6 0.8 0.9 1.0];
[n,m]=size(x_per_L);
printf("\nThe choosen values of x/L are: \n");
disp(x_per_L);
printf("\n Values for dimensionless temperature for corresponding values of x/L:")
dim_T=[1.0 .97 .86 .68 .48 .36 .24]; // value for dimensionless temperature for corresponding value of x/L
disp(dim_T);
printf("the temperature profile with distance is\n");
printf("\tx/L\t\t");
for j=1:m
printf("%.2f\t",x_per_L(1,j));
end
printf("\n");
printf("(T-T_inf)/T_i-T_inf)\t");
for i=1:m
printf("%.2f\t",dim_T(i));
end
T=zeros(1,m);
x=zeros(1,m);
for i=1:m
T(1,i)=dim_T(1,i)*dimensionless_temp*(T_i-T_inf)+T_inf;
x(1,i)=x_per_L(1,i)*L;
end
printf("\n\tx,cm\t\t");
for i=1:m
X(1,i)=x(1,i)*100;
printf("%.1f\t",X(1,i));
end
printf("\nT, degree celsius\t");
for i=1:m
printf("%d\t",T(1,i));
end
plot2d(X,T,rect=[0,0,24,600]);
a=gca();
newticks=a.x_ticks;
newticks(2)=[0;4;8;12;16;20;24];
newticks(3)=['0';'4';'8';'12';'16';'20';'24'];
a.x_ticks=newticks;
newticks1=a.y_ticks;
newticks1(2)=[0;100;200;300;400;500;600];
newticks1(3)=['0';'100';'200';'300';'400';'500';'600'];
a.y_ticks=newticks1;
xlabel('x,cm');
ylabel('t,degree celsius');
title('Temperature profile in the 24-cm slab after 2.5 hr.');
filename='Temperature profile in the 24-cm slab after 2.5 hr.';
xgrid(1);
xs2jpg(0,filename);
|