1D Transient Heat Transfer
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I don't have much matlab knowledge so I was hoping someone can help me finish this conductivity matrix [K]. It is suppose to form a global stiffness matrix. I attached my analysis as to how [K]{T} is represented. I have wrote the code to find the little k(conductivity) but now I need the global stiffness matrix [K]. I am pretty sure I have to create another for loop and add onto the little k to produce the global matrix but I am not sure how. Any help would be great! This is for a 1D model.
Here is what I have so far:
%%Wall_Characteristics
%-------------------------------------------------------------------------%
clear variables
close all
clc
%-------------------------------------------------------------------------%
% define variables
dx = .125; % segment length, Inches
to= 60; % outside air temperature, Fahrenheit
ti= 70; % inside air temperature, Fahrenheit
alpha = 0.25; % wall absorptivity - solar heat gain layer n (last node)
hoa = 3.522; % Outside Air Surface Resistance, Hoa = BTU/(Hr*FT2*F)
hia = 1.761; % Inside Air Surface Resistance, Hia = BTU/(Hr*FT2*F)
l=1; % wall length, ft
h=1; % wall height, ft
t_i=70; % [°F] Temperature, fluid inside
t_o=80; % [°F] Temperature, fluid outside
%-------------------------------------------------------------------------%
% For Each Layer--Start From Outside to Inside
% Outside Layer---
d1 = 120.0; % wall density, lb / ft^3
cp1 = 0.19; % specific heat, Btu/lb-deg F
k1 = 9.907; % thermal conductivity, k BTU-in/(Hr*FT2*F)
n1 = 5; % # of nodes
th1 = dx*n1; % thickness of each layer
% 2nd Layer---Common Brick
d2 = 120.0; % wall density, lb / ft^3
cp2 = 0.19; % specific heat, Btu/lb-deg F
k2 = 0.8; % thermal conductivity, k BTU-in/(Hr*FT2*F)
n2 = 28; % # of nodes
th2 = dx*n2; % thickness of each layer
% 3rd Layer---Insulation
d3 = 5.3; % wall density, lb / ft^3
cp3 = 0.23; % specific heat, Btu/lb-deg F
k3 = 0.333; % thermal conductivity, k BTU-in/(Hr*FT2*F)
n3 = 28; % # of nodes
th3 = dx*n3; % thickness of each layer
% 4th Layer---Inside Layer
d4 = 5.3; % wall density, lb / ft^3
cp4 = 0.23; % specific heat, Btu/lb-deg F
k4 = 0.25; % thermal conductivity, k, BTU-in/(Hr*FT2*F)
n4 = 5; % # of nodes
th4 = dx*n4; % thickness of each layer
%-------------------------------------------------------------------------%
%Generic heat conductivity matrix [K]
% K = [ hoa -hoa 0 0 0 0 0 0 0 0 0 0
% -hoa hoa+k1 -k1 0 0 0 0 0 0 0 0 0
% 0 -k1 k1+k2 -k2 0 0 0 0 0 0 0 0
% 0 0 -k2 k2+k3 -k3 0 0 0 0 0 0 0
% 0 0 0 -k3 k3+k4 -k4 0 0 0 0 0 0
% 0 0 0 0 -k4 k4+k5 -k5 0 0 0 0 0
% 0 0 0 0 0 (-k(n-1)) (k(n-1)+k*n) (-k*n) 0 0 0 0
% 0 0 0 0 0 0 (-k(n-1)) (k(n-4)+k(n-3)) (-k(n-2)) 0 0 0
% 0 0 0 0 0 0 0 (-k(n-3)) (k(n-3)+k(n-2)) (-k(n-2)) 0 0
% 0 0 0 0 0 0 0 0 -k(n-2) (k(n-2)+k(n-1)) (-k(n-1)) 0
% 0 0 0 0 0 0 0 0 0 (-k(n-1)) (k(n-1)+hia) -hia;
% 0 0 0 0 0 0 0 0 0 0 -hia hia ];
%-------------------------------------------------------------------------%
for A = [1:n1+1];
k(A)=k1/dx;
end
for B = [n1+2:n1+n2+1];
k(B) = k2/dx;
end
for C = [n1+n2+2:n1+n2+n3+1];
k(C) = k3/dx;
end
for D = [n1+n2+n3+2:n1+n2+n3+n4+1];
k(D) = k4/dx;
end
% for x = (1:n1+n2+n3+n4)
disp(k)
% 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!