Documentos de Académico
Documentos de Profesional
Documentos de Cultura
2021
1- El flujo a través de medios porosos queda descrito con la ecuación de Laplace
𝜕2ℎ 𝜕2ℎ
+ =0
𝜕𝑥 2 𝜕𝑦 2
Sol:
∆𝑥 = ∆𝑦
𝑃𝑎𝑟𝑎 𝑖 = 1, 𝑗 = 1
𝜕 2 𝑢 2𝑇2,𝑗 − 2𝑇1,𝑗
=
𝜕𝑥 2 ∆𝑥 2
𝜕 2 𝑢 2𝑇𝑖,2 − 2𝑇𝑖,1
=
𝜕𝑦 2 ∆𝑦 2
Para el nodo 𝑖 = 2, 𝑗 = 1
Para el nodo 𝑖 = 1, 𝑗 = 2
P O
B
A
h=20
Para 𝑖 = 3, 𝑗 = 2
2 𝑇𝐴 𝑇𝐵 𝑇𝑃 𝑇𝑄 (𝑎 + 𝑏)𝑇𝑂
[ + + + − ]=0
ℎ2 𝑎(𝑎 + 1) 𝑏(𝑏 + 1) 𝑎 + 1 𝑏 + 1 𝑎. 𝑏
𝑇3,1 𝑇4,2 𝑇2,2 𝑇3,3
+ + + − 2𝑇3,2 = 0
2 2 2 2
𝑇2,2
− 2𝑇3,2 = 0
2
𝑇2,2 − 4𝑇3,2 = 0 … … (5) …
Para 𝑖 = 4, 𝑗 = 2
−2 1 0 1 0 0 𝑇1,1 0
1 −4 0 0 2 0 𝑇2,1 0
1 0 1 −4 2 0 𝑇3,1 0
0 1 0 1 −4 0 𝑇1,2 = 0
0 0 0 0 1 −4 𝑇2,2 0
−1 0 − 1 4 − 2 0 𝑇3,2 0
Elaborando un programa en Matlab en el problema
function y=edplaplace(Ta,Tb,Tc,Td,Te,n,m,maxiter,error)
clear T
for i=1:n+2
T(i,1)=Tc;
T(i,m+2)=Td;
end
for j=1:m+2
T(1,j)=Ta;
T(n+2,j)=Tb;
end
p=(Ta+Tb+Tc+Td)/4;
for i=2:n+1
for j=2:m+1
u(i,j)=p;
end
end
k=0;
conv=0;
while k<maxiter & conv==0
k=k+1;
t=T;
for i=2:n+1
for j=2:m+1
T(i,j)=0.25*(T(i-1,j)+T(i+1,j)+T(i,j+1)+T(i,j-1));
end
end
if norm((T-t),inf)/norm(T,inf)<error
conv=1;
end
end
if conv==1
disp(T)
disp(k)
[x,y]=meshgrid(1:m+2,1:n+2);
surf(x,y,T)
shading flat
else
disp('no converge');
end
2.
2 l i +1 − 2l i + l i −1
=
x 2 x
li +1 − li
=
x x
li +1 − li
=
t t
Reemplazando : b = 1, k = 0.835, x = 2, t = 0.1
( x,0) = 0
Para el nodo i = 2, j = 1
22 = 5.4275
Para el nodo i = 3, j = 1
32 = 0
Para el nodo i = 4, j = 1
24 = 15 (0.070875) + 14 (0.90825) + 13 (0.020875)
24 = 0
Para el nodo i = 5, j = 1
52 = 0
Para el nodo i = 6, j = 1
62 = 0.70875
Programa en Matlab para el método explicito
clear all; close all; clc
fprintf('\n METODO EXPLICITO CONDUCCION DE CALOR EN UNA BARRA
HORIZONTAL\n')
nx=input('Ingrese numero de columnas en la barra: ');
delx=input('Longitud del intervalo en la dimension: ');
delt=input('Intervalo de tiempo: ');
k=input('Ingrese coeficiente de conductividad termica: ');
lam=k*delt/(delx)^2;
tini=input('Ingrese vector x condicion inicial: ');
tizq=input('Ingrese el valor de T para la frontera izquierda: ');
tder=input('Ingrese el valor de T para la frontera derecha: ');
t=zeros(7,7);
for i=1:70
t(1,i)=tizq;
end
for i=1:70
t(6,i)=tder;
end
for l = 1:70
for i = 2:nx
t(i,l+1)=t(i,l)+lam*(t(i+1,l)-2*t(i,l)+t(i-1,l));
end
end
T =t';
fprintf('%6.0f %12.4f %12.4f %12.4f %12.4f %6.0f \n',t)
y1=T(1,:);
y2=T(11,:);
y3=T(21,:);
y4=T(31,:);
y5=T(41,:);
y6=T(51,:);
x =0:2:12;
plot(x,y1,'bs-',x,y2,'rs-',x,y3,'cs-',x,y4,'gs-',x,y5,'rs-',x,y6,'ks-
');
title('Variacion de temperatura en una barra unidimensional para
distintos tiempos');
xlabel('Coordenada X');ylabel('Temperatura T');
legend('t=0','t=0.10','t=0.20','t=0.30','t=0.40','t=0.50',
'location','east');
Aplicando el método implícito
Discretizando cada nodo
( x,0) = 0
Datos:
x = 2, = 0.1, k = 0.835
k T 0.835*0.1
= = = 0.020875
(x) 2 4
li +1 − li
=
t t
li ++11 − li +1
=
x x
li ++11 − 2li +1 + li −+11 li ++11 − li +1 li +1 − li
k +b =
x 2 x t
li +1 − 0.020875(li ++11 − 2li +1 + li −+11 ) − 0.05(li ++11 − li +1 ) = li
Para el nodo i = 2, j = 1
Para el nodo i = 4, j = 1
Para el nodo i = 5, j = 1
Para el nodo i = 6, j = 1
22 = 4.9775741
32 = 0.0954713
24 = 0.0045705
52 = 0.0422843
62 = 0.6499956
Programa en Matlab para el método implícito
clear all;close all;clc
L = 12.; %Longitud de la barra
for t=1:maxk+1
time(t) = (t-1)*dt;
u(1,t) = 260;
u(n+1,t) = 10;
end
aa(1:n-1) = -b;
b1=-b;
bb(1:n-1) = 1.+2.*b;
a1=1.+2.*b;
cc(1:n-1) = -b;
c1=-b;
for t = 2:maxk
uu = u(2:n,t) + dt*(x(2:n)-time(t)).';
v = zeros(n-1,1);
w = a1;
u(2,t) = uu(1)/w;
for i=2:(n-1)
v(i-1) = c1/w;
w = a1 - b1*v(i-1);
u(i+1,t) = (uu(i) - b1*u(i,t))/w;
end
for j=(n-2):-1:1
u(j+1,t) = u(j+1,t) - v(j)*u(j+2,t);
end
end
T=u;
fprintf('%6.2f %10.4f %10.4f %10.4f %10.4f %6.2f \n',u);
y1=T(:,1);
y2=T(:,11);
y3=T(:,21);
y4=T(:,31);
y5=T(:,41);
y6=T(:,51);
x =0:2:12;
plot(x,y1,'bs-',x,y2,'rs-',x,y3,'cs-',x,y4,'gs-',x,y5,'rs-',x,y6,'ks-
');
title('Variacion de temperatura en una barra unidimensional para
distintos tiempos');
xlabel('Coordenada X');ylabel('Temperatura T');
legend('t=0','t=0.10','t=0.20','t=0.30','t=0.40','t=0.50',
'location','east');
Programa de matlab para el método de Crank Nicolson
clear all;close all;clc
La=0.020875;
dx=2;
dt=0.1;
nx=7;
nt=6;
b = La;
c = b;
a = 2*(1+La);
Uo(1)=260; Uo(2:nx-1)=0; Uo(nx)=10;
Un(1)=260; Un(nx)=10;
UUU(1,:)=Uo;
for k=2:nt
for ii=1:nx-2
if ii==1
d(ii)=c*Uo(ii)+2*(1-c)*Uo(ii+1)+b*Uo(ii+2)+c*Un(1);
elseif ii==nx-2
d(ii)=c*Uo(ii)+2*(1-c)*Uo(ii+1)+b*Uo(ii+2)+b*Un(nx);
else
d(ii)=c*Uo(ii)+2*(1-c)*Uo(ii+1)+b*Uo(ii+2);
end
end
bb=b*ones(nx-3,1);
cc=bb;
aa=a*ones(nx-2,1);
AA=diag(aa)+ diag(-bb,1)+ diag(-cc,-1);
UU=AA\d'; %
Un=[Un(1),UU',Un(nx)];
UUU(k,:)=Un;
Uo=Un;
end
UUU
T =Un;
y1=T(1,:);
y2=T(11,:);
y3=T(21,:);
y4=T(31,:);
y5=T(41,:);
y6=T(51,:);
x =0:2:12;
plot(x,y1,'bs-',x,y2,'rs-',x,y3,'cs-',x,y4,'gs-',x,y5,'rs-',x,y6,'ks-
');
title('Variacion de temperatura en una barra unidimensional para
distintos tiempos');
xlabel('Coordenada X');ylabel('Temperatura T');
legend('t=0','t=0.10','t=0.20','t=0.30','t=0.40','t=0.50',
'location','east');