Analytical solution of 1-D transient heat transfer
3 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to solve a 1D transient heat equation using the analytical solution for radii from 0 to 5 cm, with a convective bounday conditions as shown in the picture. I have attached my discretization method as well to give a better insight into my problem. I have already coded the solution with out including convenction boundary condition but with a constant T_inf= 298 K.
Can you please help me edit my code to include the convection part?
-- Governing equation used
-- Convection boundary condition to be included
clc
clear all;
%-----------------------------Input----------------------------------------
% Inputs
r0=0.05; % wall thickness(m)
k=0.1; % conductivity(W/m-K)
rho=821.42; % density(kg/m^3)
cp=1399; % specific heat capacity(J/kg-K)
T_ini=353; % initial temperature(K)
T_inf=298; % external temperature(K)
h=5; % heat transfer coefficient(w/m^2-K)
t_f=1000
lampda1=1.694 % Eigen root
C1=1.3787 % constant
R=0.05;
T_i=353;
T_inf=298;
r=linspace(0,0.05,50);
t=linspace(0,100,t_f);
%-----------------------------Main parameters -----------------------------
% Parameters
Bi=(h*r0)/k % Biot number
alpha=k/(rho*cp) % Thermal diffusivity
F0=(alpha*t)/(r0*r0) % Fourier number
r_div=50;
epsilon=1.694;
C_1=1.3787;
T=zeros(1,r_div);
u=zeros(1,r_div);
t=480;
%-----------------------------Temperature calculation ---------------------
for j=1:5
for i=1:50
u(i)=epsilon*r(i) /R;
T(i)=T_inf+(T_i-T_inf)*C_1*exp(-epsilon^2*alpha*t/R^2)*besselj(0,u(i));
end
6 个评论
Torsten
2024-4-13
编辑:Torsten
2024-4-13
I don't understand your code from above.
T is a vector - so you only compute the r-profile for one give time t (in your case t = 50000) ?
And if you plot the temperature profile for smaller times (e.g. t = 100) , the temperature at r = R_i does not equal T_w = 298 K for all times t as you claim.
Or is the code you posted an attempt to implement the convective boundary condition ?
回答(1 个)
Torsten
2024-4-13
编辑:Torsten
2024-4-14
I'd compare with the solution from "pdepe":
m = 1;
Ri = 0.05;
nd = 20;
r = linspace(0,Ri,nd);
t = [0 100 600 1800 3600 50000];
sol = pdepe(m,@heatcyl,@heatic,@heatbc,r,t);
u = sol(:,:,1);
plot(r,u(1:6,:),'LineWidth',2)
grid on
function [c,f,s] = heatcyl(x,t,u,dudx)
rho = 821.42;
cp = 1399;
k = 0.1;
c = rho*cp;
f = k*dudx;
s = 0;
end
%----------------------------------------------
function u0 = heatic(x)
u0 = 400;
end
%----------------------------------------------
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t)
pl = 0; %ignored by solver since m=1
ql = 0; %ignored by solver since m=1
alpha = 5;
Ta = 298.0;
pr = alpha*(ur-Ta);
qr = 1;
end
%----------------------------------------------
But your results look ok at a quick glance.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Heat and Mass Transfer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!