% =========================================================================
% Parameters for the Simulink model of Brobekk incineration plant. The
% controllers are adjusted in the model itself.
% 
% Helge Smedsrud
% IKP, NTNU
% 2008
% =========================================================================
%
clc
clear all
%
% =========================================================================
%                                CONSTANTS
% =========================================================================
%
% Pressures [Pa]
dp_f = 1000;                        % AC fan pressure difference
%
% Densities [kg/m3]
rho_h = 912.892;                    % Hot water (p = 1500000 Pa, T = 155 °C)
rho_c = 959.049;                    % Cold water (p = 1500000 Pa, T = 100 °C)
rho_air_c = 1.161;                  % Cold air (p = 100000 Pa, T = 26.85 °C)
rho_air_h = 0.9285;                 % Hot air (p = 100000 Pa, T = 126.85 °C)
%
% Specific heat capacities [J/kg*K]
cph = 4321.56;                      % Hot water (p = 1500000 Pa, T = 155 °C)
cpc = 4213.84;                      % Cold water (p = 1500000 Pa, T = 100 °C)
cp_air = 1018.5;                    % Air (p = 100000 Pa, T = 126.85 °C)
%
% UA numbers [W/K]
UA_F = 52250.59846095464;           % Furnace
%
% Flow coefficients [m3/h*bar]
Kv_HB = 83.302787347224381;         % Brobekk side bypass valve
Kv_AC = 260.3212104600763;          % Brobekk side air cooler valve
Kv_HE = 260.3212104600763;          % Brobekk side heat exchanger valve
%
% Temperatures [°C]
Thi_F = 1000;                       % Furnace flue gas inlet
Tci_F = 126;                        % Furnace water inlet temperature
Tco_F = 180;                        % Furnace water outlet temperature
Tci_AC = 10;                        % AC air inlet
%
% Flow rates [kg/s]
w_fg = 19.889359351988219;          % Furnace flue gas
wh = 250000/3600;                   % Hot water flow rate
%
% Cross-section areas [m2]
A_f = pi;                           % Fan duct
%
% Efficiencies [-]
z = 0.6;                            % Fraction of air velocity remaining in
                                    % diffusor area of AC fan
eta_p = 0.9;                        % Pump
eta_f = 0.9;                        % Fan
%
% Other parameters
g = 9.80665;                        % Standard gravity [m/s2]
%
% =========================================================================
%                          MAIN HEAT EXCHANGERS
% =========================================================================
% General data
A = 74.6;               % Heat transfer area [m2]
Vh_tot = 3*0.0889;      % Hot side volume [m3]
Vc_tot = 3*0.1164;      % Cold side volume [m3]
N = 10;                 % Number of cells (NB! Fixed)
%
% Heat transfer coefficients [W/m2*K]
h_h	= 9796.0889611035;  % Hot side
h_c = h_h;              % Cold side
%
% Hot side
V_i_h = Vh_tot/N;	% Hot side cell volume [m3]
A_i_h = A/N;        % Hot side cell area [m2]
%
% Cold side
V_i_c = Vc_tot/N;	% Cold side cell volume [m3]
A_i_c = A/N;		% Cold side cell area [m2]
%
% Wall
V_w = A*0.005;      % Wall volume [m3] (assuming 5 mm thickness)
rho_w = 8030;       % Wall density [kg/m3] (AISI 304)
cp_w = 5030;        % Wall heat capacity [J/kg*K] (AISI 304)
V_i_w = V_w/N;		% Volume of a single wall segment [m3]
A_i_w = A/N;		% Area of a single wall segment [m2]
%
% =========================================================================
%                               AIR COOLERS
% =========================================================================
% General data
A_ut = A;               % Heat transfer area [m2]
Vh_tot_ut = Vh_tot;     % Hot side volume [m3]
Vc_tot_ut = Vc_tot;     % Cold side volume [m3]
%
% Heat transfer coefficients [W/m2*K]
h_h_ut = h_h;           % Hot side
h_c_ut = h_c;           % Cold side
%
% Hot side
V_i_h_ut = Vh_tot_ut/N; % Hot side cell volume [m3]
A_i_h_ut = A_ut/N;      % Hot side cell area [m2]
%
% Cold side
V_i_c_ut = Vc_tot_ut/N; % Cold side cell volume [m3]
A_i_c_ut = A_ut/N;      % Cold side cell area [m2]
%
% Wall
V_w_ut = A_ut*0.005;    % Wall volume [m3] (assuming 5 mm thickness)
rho_w_ut = rho_w;       % Wall density [kg/m3] (AISI 304)
cp_w_ut = cp_w;         % Wall heat capacity [J/kg*K] (AISI 304)
V_i_w_ut = V_w_ut/N;    % Volume of a single wall segment [m3]
A_i_w_ut = A_ut/N;      % Area of a single wall segment [m2]
%
% =========================================================================
%                           INITIAL CONDITIONS
% =========================================================================
% Heat exchangers - Initial temperatures [°C]
% Th0 = [171.7135847374620;
%        163.9017078916399;
%        156.3398100754702;
%        149.0198919930301;
%        141.9342103247931;
%        135.0752695364265;
%        128.4358139496780;
%        122.0088200670465;
%        115.7874891420054;
%        109.7652399870253];
% Tw0 = [146.1476192693418;
%        139.1538499493617;
%        132.3838803263291;
%        125.8305488394514;
%        119.4869230969248;
%        113.3462925425807;
%        107.4021613570891;
%        101.6482415865674;
%        96.0784464907539;
%        90.6868841043359];
% Tc0 = [120.5816538038821;
%        114.4059920110131;
%        108.4279505820106;
%        102.6412056912625;
%        97.0396358747369;
%        91.6173155544396;
%        86.3685087700828;
%        81.2876631113599;
%        76.3694038443505;
%        71.6085282259154];
%
Th0 = [173.6885732758040;
       167.5993073191141;
       161.7243821220666;
       156.0562529392732;
       150.5876405986464;
       145.3115221532798;
       140.2211218623815;
       135.3099024896751;
       130.5715569080961;
       126.0000000000004];
Tc0 = [122.7617948438068;
       118.4651397622025;
       114.3197259501801;
       110.3202297498732;
       106.4615148949465;
       102.7386259144569;
       99.1467817688979;
       95.6813697102523;
       92.3379393581716;
       89.1121969846704];
Tw0 = [148.2251840598054;
       143.0322235406583;
       138.0220540361234;
       133.1882413445732;
       128.5245777467964;
       124.0250740338684;
       119.6839518156397;
       115.4956360999637;
       111.4547481331338;
       107.5560984923354];
%
% Cold utilities - Initial temperatures [°C]
Th0_ut = [179.9973926777466;
          179.9898908488501;
          179.9683064679021;
          179.9062035450895;
          179.7275200317115;
          179.2134089962367;
          177.7342005801898;
          173.4781986912452;
          161.2327626308405;
          126.0000000000135];
Tc0_ut = [179.9970164483557;
          179.9888083556863;
          179.9651919014217;
          179.8972422650698;
          179.7017364948703;
          179.1392241955629;
          177.5207548964218;
          172.8640693884038;
          159.4657800713867;
          120.9160097866022];
Tw0_ut = [179.9972045630511;
          179.9893496022682;
          179.9667491846619;
          179.9017229050796;
          179.7146282632909;
          179.1763165958998;
          177.6274777383057;
          173.1711340398244;
          160.3492713511135;
          123.4580048933077];