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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
| clear
clc
%Simple plate simulation: transient
%General elements
Tair=323; % Température of the air
h=100; % Convection coefficient with the air
TCR=1E-4; % Thermal contact resistance between the 2 matérials
time=30; % Study's lenght
sigma=5.67E-8; % Stefan Boltzman's constant
%For the aluminium part:
thka=0.1; % Thickness of aluminium part
rhoa=2700; % Aluminium density
cpa=897; % Aluminium specific heat
ka=237; % Aluminium conductivity
%For the thermal insulation part:
%Choice of Aerogel
thki=0.001; % Thickness of thermal insulation part
rhoi=3; % thermal insulation density
cpi=838; % thermal insulation specific heat
ki=0.012; % thermal insulation conductivity
%Calculations of diffusivity for the 2 materials
aa=rhoa*cpa/ka; %Aluminium diffusivity
ai=rhoi*cpi/ki; %Thermal insulation diffusivity
%Creation of time and space steps
%For time step:
Nt=50; %Number of time step
dt=time/Nt; %Value of one time step
%For space step:
Na=30; %Number of space step in aluminium part
Ni=30; %Number of space step in thermal insulation part
dya=thka/Na; %Value of space step in aluminium part
dyi=thki/Ni; %Value of space step in thermal insulation part
N=Ni+Na; %Number of total space step
%Initialization of matrix A
for i=1:N
for j=1:N
A(i,j)=0;
end
end
% Fix elements of matrix A
A(1,1)=1;
A(Na,Na-1)=-ka*TCR*dt;
A(Na,Na)=dya*dt+rhoa*cpa*dya*dya*TCR/2+ka*TCR*dt;
A(Na,Na+1)=-dya*dt;
A(Na+1,Na)=-dyi*dt;
A(Na+1,Na+1)=ki*TCR*dt+dyi*dt+rhoi*cpi*dyi*dyi*TCR/2;
A(Na+1,Na+2)=-ki*TCR*dt;
A(N,N-1)=ki*dt;
A(N,N)=h*dyi*dt-ki*dt+rhoi*cpi*dyi*dyi/2;
for i=2:Na-1 % Space element of aluminium part
A(i,i-1)=-aa*dt;
A(i,i)=dya*dya+2*aa*dt;
A(i,i+1)=-aa*dt;
end
for i=Na+2:N-1 % Space elements of thermal insulation part
A(i,i-1)=-ai*dt;
A(i,i)=dyi*dyi+2*ai*dt;
A(i,i+1)=-ai*dt;
end
% Temperature vector initialization: Beginning at 25 K
for i=1:N
T(i,1)=293;
end
for i=1:N-1
Tg(i,1)=0;
end
Tg(N,1)=300;
for k=1:time+1
G=Tg(N,k)-T(N,k);
while (abs(G)<=1) LE PROBLEME EST ICI
% Creation Vector B(k) at time k
B(1)=T(1,k);
for i=2:Na-1
B(i)=T(i,k)*dya*dya;
end
B(Na)=rhoa*cpa*dya*dya*TCR*T(Na,k)/2;
B(Na+1)=rhoi*cpi*dyi*dyi*TCR*T(Na+1,k)/2;
for i=Na+2:N-1
B(i)=T(i,k)*dyi*dyi;
end
B(N)=h*Tair*dyi*dt++rhoi*cpi*dyi*dyi*T(N,k)/2+sigma*Tair*Tair*Tair*Tair*dyi*dt-sigma*dt*dyi*T(N,k)*T(N,k)*T(N,k)*T(N,k);
%Creation of Vector T(k+1)at time k+1
T(:,k+1)=A\B';
%Control of value of Tsurface
end
end
sprintf('value of temperature of surface is right')
%View of 3D result
surf(T)
zlabel('Temperature T (K)');
ylabel('Thickness');
xlabel('Time (s)');
title('Evolution of temperature in function of space and time'); |
Partager