Finite difference temperature distribution with TDMA
68 次查看(过去 30 天)
显示 更早的评论
A stainless steel (thermal conductivity, k = 20 W/mK) fin has a circular cross-sectional area (diameter, D=4 cm) and length L=16 cm. The wing is attached to a wall with a temperature of 200C. The ambient temperature of the fluid surrounding the fin is 20C and the heat transfer coefficient is h=10 W/m2K. Fin tip is insulated. Determine the following by applying finite differences with TDMA.
1. Temperatures inside the fin and the amount of heat radiated from the fin. Plot the temperature distribution.
2. Discuss the effect of the number of element dimensions for N = 5, 10, 50, and 100. Plot the temperature distribution.
The temperature distribution from the analitic solution is like this: T1=150.54, T2=111.107, T3=78.671, T4=50.741, T5=25.172, my code does not give these values.
clc
clear all
L=0.16; %lenght
N=6; %number of nodes
dx=L/(N-1); %lenght between nodes
T=zeros(N+1,1);
Tb=200; %the wall temperature (boundary condition)
k=6; %number of iterations
for j=1:1:k
T(1,1)=Tb;
T(5,1)=T(7,1); %the second boundary condition due to the isulation on the tip of the fin
for i=2:1:N
T(i,1)=(T(i+1,1)+T(i-1,1)+1.536)/2.0768; %FDE narrowed down
end
T(N,1)=T(N-1,1);
plot(T);
hold on
end
hold off
If I can get some help with my code.
采纳的回答
Torsten
2022-11-30
移动:Torsten
2022-11-30
You solve the system iteratively. But you were told to solve it with the Thomas-Algorithm. So apply this algorithm to the matrix A below.
k = 20;
T_inf = 20;
h = 10;
D = 0.04;
L = 0.16;
T_at_wall = 200;
N = 6;
dL = L/(N-1);
A = zeros(N+1);
b = zeros(N+1,1);
A(1,1) = 1.0;
b(1) = T_at_wall;
for i = 2:N
A(i,i-1) = k/dL^2;
A(i,i) = -(2*k/dL^2 + 4/D*h);
A(i,i+1) = k/dL^2;
b(i) = -4/D*h*T_inf;
end
A(N+1,N-1) = -1.0;
A(N+1,N+1) = 1.0;
b(N+1) = 0;
T = A\b;
T = T(1:N)
2 个评论
EGE
2023-3-7
can you please explain the line after "end"? I could not figure out what it is. Thanks in advance.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!