Volumen Finito
Volumen Finito
Volumen Finito
Reporte de Prácticas
clear
clc;
D=0.02 %m de diametro
k=1000 %W/mk
a_Pi=(3*k*A)/dx;
a_Ei=-(k*A)/dx;
a_Wi=0;
Sui=((2*k*A)/dx)*T_a;
a_Pd=(3*k*A)/dx;
a_Ed=0;
a_Wd=-(k*A)/dx;
Sud=((2*k*A)/dx)*T_b;
%Celda central
a_Pc=(2*k*A)/dx;
a_Ec=-(k*A)/dx;
a_Wc=-(k*A)/dx;
Suc=0;
%Vector de constantes
for(i=1:1:nc)
if(i==1)
Su(i,1)=Sui;
elseif(i==nc)
Su(i,1)=Sud;
else
Su(i,1)=Suc;
endif
endfor
%Matriz de coeficientes
C=zeros(nc,nc)
for(i=1:1:nc)
for(j=1:1:nc)
if(i==1)
if(j==i)
C(i,j)=a_Pi;
elseif(j==i+1)
C(i,j)=a_Ei;
endif
elseif(i==nc)
if(j==i)
C(i,j)=a_Pd;
elseif(j==i-1)
C(i,j)=a_Wd;
endif
else
if(i==j)
C(i,j)=a_Pc;
elseif(j==i+1)
C(i,j)=a_Ec;
elseif(j==i-1)
C(i,j)=a_Wc;
endif
endif
end
end
T=C\Su
Tt=T'
T2=[T_a,Tt,T_b]
dx2=dx/2;
dy=D/2;
y=[0;dy;D]
for i=1:1:nc
x(1,i)=(i*dx)-dx2;
endfor
x2=[0,x,L]
x3=[x2;x2;x2]
T3=[T2;T2;T2]
for (i=1:1:(nc+2))
y3(:,i)=y
endfor
figure 1
clf
colormap(hot)
contourf(x3,y3,T3,nc)
figure 2
clf
plot(x2,T2)
Now we discuss a problema that includes sources other that those arising from boundary conditions.
Figure 4.6 shows a large plate of thickness L)2 cm with constant thermal conductivity K = 0.5 W/m k
and uniform heat generation q = 1000 kW/m´3. The faces A and B are temperatures of 100 ºC and
200 ºC respectively. Assuming that the dimensions in the y and z directions are so large that
temperature gradients are significant in the x-direcion only calculate the steady state temperature
gradients are significant in the x-direction only calculate the steady state temperature distribution.
Compare the numerical result with the analytical solution.
Clear
clc;
L=1 %metros
L2=0.02 %metros
k=0.5 %W/m*k
T_a=100 %ºC
T_b=200 %ºC
q=1000 %kW/m^2
nc=25
dx=L/nc
a_Pi=(3*k*A)/dx
a_Ei=-(k*A)/dx
a_Wi=0
Sui=(q*A*dx)+(2*k*A*T_a)/dx
Spi=(-2*k*A)/dx
a_Pd=(3*k*A)/dx
a_Ed=0
a_Wd=-(k*A)/dx
Sud=(q*A*dx)+(2*k*A*T_b)/dx
Spd=(-2*k*A)/dx
%Celda central
a_Pc=(2*k*A)/dx
a_Ec=-(k*A)/dx
a_Wc=-(k*A)/dx
Suc=q*A*dx
Spc=0
%Vector de constantes
for(i=1:1:nc)
if(i==1)
Su(i,1)=Sui;
elseif(i==nc)
Su(i,1)=Sud;
else
Su(i,1)=Suc;
endif
endfor
%Matriz de coeficientes
C=zeros(nc,nc)
for(i=1:1:nc)
for(j=1:1:nc)
if(i==1)
if(j==i)
C(i,j)=a_Pi;
elseif(j==i+1)
C(i,j)=a_Ei;
endif
elseif(i==nc)
if(j==i)
C(i,j)=a_Pd;
elseif(j==i-1)
C(i,j)=a_Wd;
endif
else
if(i==j)
C(i,j)=a_Pc;
elseif(j==i+1)
C(i,j)=a_Ec;
elseif(j==i-1)
C(i,j)=a_Wc;
endif
endif
end
end
T=C\Su
Tt=T'
T2=[T_a,Tt,T_b]
dx2=dx/2;
dy=L2/2;
y=[0;dy;L2]
for i=1:1:nc
x(1,i)=(i*dx)-dx2;
endfor
x2=[0,x,L2]
x3=[x2;x2;x2]
T3=[T2;T2;T2]
for (i=1:1:(nc+2))
y3(:,i)=y
endfor
figure 1
clf
colormap(hot)
contourf(x3,y3,T3,nc)
figure 2
clf
plot(x2,T2)