% %Heat exchanger sizing 

%This script sizes all the heat exchangers based on the information from
%the main steady state simulation. 
filename='SSresults.mat';
load (filename)

% Desuperheater
% Assumes boiling Ethylene as refrigerant (T= 169.5 K)
Tethylene=169.5; 
[ UA_HA_01 ] = hxsizing( QHA_01, Ts(1), Ts(2), Tethylene, Tethylene )

% HA-02
[ UA_HA_02 ] = hxsizing( QHA_02, Ts(3), Ts(6), Ts(14), Ts(15) )

% HA-04
[ UA_HA_04 ] = hxsizing( QHA_04, Ts(6), Ts(7), Ts(10), Ts(12) )

% HA-07
%BOG Temperatures from BOG.m 
TBOGin = -32 + 273.15; %Inlet temperature [K]
TBOGout = -154 +273.15; %Outlet temperature [K]

[ UA_HA_07 ] = hxsizing( QHA_07, Ts(11), Ts(13), TBOGin, TBOGout )