writing a code for Heat transfer in a steady state but unable to obtain true results
2 ビュー (過去 30 日間)
古いコメントを表示
%columns=M
%rows=N
%Ttop=500 % top boundary
%Tleft=500 % left boundary
%Tright=500 % right boundary
%interior node= T(m,n) = 1/4*(T(m+1,n)+T(m-1,n)+T(m,n+1)+T(m,n-1));
% bottom convection equation= T(m,n)= 2*T(m-1,n)+T(m,n-1)+T(m,n+1)+1500-9*T(m,n);
N=5; % Number of columns
M=5; % Number of rows
error_T=ones(5,5);
T_amb = 300;
T=ones(5,5)*T_amb;
T_old=zeros(5,5);
T(:,1)=500;% boundary condition at the left
T(:,5)=500;% boundary condition at the right
T(1,:)=500;% boundary condition at the top
for n=2:4; % convection at the bottom
for m=5:5;
T(m,n)= 2*T(m-1,n)+T(m,n-1)+T(m,n+1)+1500-9*T(m,n);
end
end
for m=2:M-1; % all interior nodes
for n=2:N-1;
T(m,n) = 1/4*(T(m+1,n)+T(m-1,n)+T(m,n+1)+T(m,n-1));
end
end
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Thermal Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!