%% 2015_DP_LAGA_ONDREJ 
% ESTIMATING PARALLEL PLATE-FIN HEAT SINK THERMAL RESISTANCE
clc, clear all;

%% parametry
W = 0.12;               % sirka chladice (m)
H = 0.07;               % vyska chladice (m)
L = 0.5;                % uriznuta delka chladice (m)
Hf = 0.0595;            % vyska zeber (m)
tfin = 0.0035;          % tloustka zebra (m)
Nfin = 12;              % pocet zeber (-)
Gflow = 500;            % katalogovy objemovy max prutok (airflow)(l/min)
G = Gflow/1000/60;      % prepocitany objemovy prutok na (m3/s)
k = 0.0262;             % tepelna vodivost vzduchu pri 25°C (W/m.K)
kfluid = k;             % tepelna vodivost chladiciho media (vzduchu) (W/m.K)
kfin = 237;             % tepelna vodivost hliniku pri 25°C (W/m.K)
kbase = kfin;           % tepelna vodivost hliniku pri 25°C (W/m.K)
mi = 1.85e-5;           % dynamicka viskozita vzduchu pri 25°C (Pa.s)
cp = 1011;              % merna tepelna kapacita vzduchu pri 25°C (J/kg.K)
ro = 1.1845;            % hustota vzduchu pri 25°C (kg/m3)

%% vypoctene hodnoty
b = (W - Nfin*tfin)/(Nfin - 1);             % sirka mezery mezi zebry (m)
Abase = (Nfin - 1)*b*L;                     % plocha mezi zebry (m2)
Afin = 2*L*(Hf+tfin/2);                     % plocha jednoho zebra (m2)
S = b*Hf*(Nfin - 1);                        % plocha prurezu proudoveho vlakna (m2)
V = G/(Nfin*b*Hf);                          % rychlost proudeni vzduchu v miste prurezu (m/s)
Pr = mi*cp/k;                               % Prandtlovo cislo
Re = (ro*V*b*b)/(mi*L);                     % Reynoldsovo cislo
% Nusseltovo cislo:
Nu = ((1/((Re*Pr/2)^3)) + (1/(sqrt(1+(3.65/sqrt(Re)))*Pr^0.33*sqrt(Re)*0.664)^3))^-0.33;
h = Nu*kfluid/b;                            % koeficient prenosu tepla W/m2.K
m = sqrt((2*h)/(kfin*tfin));                % koeficient m
eff_fin = (tanh(m*(Hf+tfin/2)))/(m*(Hf+tfin/2));% ucinnost zeber chladice

Rhs = 1/((h*(Abase+Nfin*eff_fin*Afin)));    % tepelny odpor zeber(°C/W)
Rtot = Rhs + ((H-Hf)/(kbase*W*L));          % Rhs + tepelny odpor zakladny (°C/W)

%% zobrazeni hodnot
disp(['Rychlost proudeni vzduchu v miste prurezu -              v = ',num2str(V),' m/s'])
disp(['Prandtlovo cislo -                                       Pr = ',num2str(Pr),''])
disp(['Reynoldsovo cislo -                                      Re = ',num2str(Re),''])
disp(['Nusseltovo cislo -                                       Nu = ',num2str(Nu),''])
disp(['Koeficient prenosu tepla -                               h = ',num2str(h),' W/m2.K'])
disp(['Ucinnost zeber chladice -                                eff_fin = ',num2str(eff_fin),''])
disp(['Tepelny odpor zeber -                                    Rhs = ',num2str(Rhs),' °C/W'])
disp(['Tepelny odpor zeber + zakladny (CELKOVY) -               Rtot = ',num2str(Rtot),' °C/W'])
