Contents

Team KAB's Analysis of Lab 5

Programmer: Aaron Klapheck

% Lab #5 The Gas Turbine Engine 10-Oct-08
clear, clc, home
fprintf('The date and time: %s \n', datestr(now))
The date and time: 12-Dec-2008 16:47:46 

Data

% P1 remains constant throughout this experament:

P1 = 14.69;     % P1 is atmospheric pressure in psi.


% The following data changes with time.
% There are a total of 9 variables being measured. The 9 variable are
% being measured by the computer. The computer takes multiple measurements
% at each "steady state" so
% the values being measured are then averaged at each of the four
% steady-states. The data can be distinguished from each other according to
% the different engine loads.
%
% Units:
% Voltage in Volts (V)
% Current in Amps (A)
% Temperature in degrees Fahrenheit (F)
% Pressure in pounds per square inch gauge pressure (psig)
%
% T's and P's:
% T1 is the Temperature of the air entering the compressor
% T2 is the Temperature of the air exiting the compressor
% T3 is the Temperature of the air entering the turbine
% T4 is the Temperature of the air exiting the turbine
% T5 is the Temperature of the air entering the cooling cabin
% T6 is the Temperature of the air exiting the cooling cabin
% P2 is the Pressure of the air exiting the compressor


Load_30 = [ 84.3712	76.1905	107.4481	1040.8212	1487.1918	854.3895	36.5574	270.1465	43.3455
            84.1270	76.0684	107.8144	1039.7559	1485.061	856.5202	36.4353	271.2454	43.5897
            84.3712	76.1905	107.3260    1042.9518	1487.1918	856.5202	36.6184	270.8791	43.4676
            84.3712	76.1905	107.8144	1039.7559	1482.9304	858.6508	36.4963	270.5128	43.1013
            84.1270	76.3126	107.8144	1040.8212	1480.7998	857.5855	36.4353	271.0623	42.9792
            84.1270	76.4347	107.9365	1044.0171	1482.9304	856.5202	36.4353	270.3297	43.2234
            83.7607	76.4347	107.9365	1041.8865	1488.2571	857.5855	36.2521	269.7802	43.4676
            83.6386	76.3126	107.8144	1039.7559	1489.3224	855.4549	36.5574	270.8791	43.2234
            83.7607	76.1905	107.9365	1044.0171	1483.9958	854.3895	36.4353	270.1465	43.5897];

Load_40 = [ 86.5690	77.2894	113.3089	1083.4341	1485.061	903.3944	37.0458	269.7802	56.8987
            86.5690	77.7778	113.5531	1085.5647	1482.9304	901.2638	37.0458	271.0623	57.2650
            86.3248	77.2894	113.7973	1088.7607	1485.061	902.3290    36.8626	269.7802	57.6313
            86.2027	77.7778	113.5531	1085.5647	1481.8651	905.5251	36.8016	270.6960    57.3871
            86.4469	77.7778	113.5531	1086.6301	1486.1265	900.1984	36.9847	269.7802	57.5092
            86.8132	77.4115	113.5531	1084.4994	1481.8651	902.3290    36.8626	269.9634	57.5092
            86.3248	77.4115	113.4310    1088.7607	1483.9958	904.4597	36.6795	270.5128	57.3871
            86.3248	77.7778	113.3089	1087.6953	1488.2571	902.3290    36.8016	269.9634	57.6313
            86.6911	77.6557	113.7973	1085.5647	1482.9304	900.1984	36.9847	270.6960    57.6313];


Load_50 = [ 89.8657	78.3883	119.4139	1150.5494	1519.1514	963.0526	37.4121	270.3297	71.5507
            89.4994	78.6325	119.1697	1148.4188	1523.4127	957.7259	37.0458	269.9634	71.5507
            89.1331	78.5104	119.5360    1152.6802	1523.4127	960.9219	37.0458	270.5128	71.1844
            89.2552	78.8767	119.2918	1150.5494	1522.3474	964.1178	37.1679	270.1465	71.4286
            89.1331	78.8767	119.2918	1153.7455	1512.7595	959.8565	37.1679	270.6960    71.3065
            88.7668	78.6325	119.6581	1150.5494	1514.8901	957.7259	37.3510 270.3297	71.5507
            88.8889	78.6325	119.2918	1151.6149	1518.0862	963.0526	37.2900	269.9634	71.5507];


Load_60 = [ 90.8425	78.0220	122.2222	1230.4489	1564.9603	1023.7759	37.5342	270.3297	85.4701
            90.3541	78.0220	122.2222	1234.7101	1556.4377	1017.3840	37.4121	270.5128	85.4701
            90.4762	78.0220	122.4664	1233.6448	1554.3071	1021.6453	37.5952	270.1465	84.9817
            90.4762	78.3883	122.1001	1232.5795	1560.6991	1023.7759	37.5342	270.5128	85.7143
            90.2320	77.8999	122.5885	1232.5795	1550.0459	1023.7759	37.4731	271.0623	85.9585];




T1 = [mean(Load_30(:,1)); mean(Load_40(:,1)); mean(Load_50(:,1)); mean(Load_60(:,1))];
T5 = [mean(Load_30(:,2)); mean(Load_40(:,2)); mean(Load_50(:,2)); mean(Load_60(:,2))];
T6 = [mean(Load_30(:,3)); mean(Load_40(:,3)); mean(Load_50(:,3)); mean(Load_60(:,3))];
T2 = [mean(Load_30(:,4)); mean(Load_40(:,4)); mean(Load_50(:,4)); mean(Load_60(:,4))];
T3 = [mean(Load_30(:,5)); mean(Load_40(:,5)); mean(Load_50(:,5)); mean(Load_60(:,5))];
T4 = [mean(Load_30(:,6)); mean(Load_40(:,6)); mean(Load_50(:,6)); mean(Load_60(:,6))];
P2 = [mean(Load_30(:,7)); mean(Load_40(:,7)); mean(Load_50(:,7)); mean(Load_60(:,7))];
V = [mean(Load_30(:,8)); mean(Load_40(:,8)); mean(Load_50(:,8)); mean(Load_60(:,8))];
I = [mean(Load_30(:,9)); mean(Load_40(:,9)); mean(Load_50(:,9)); mean(Load_60(:,9))];



% Convert all units to metric

% Kelvin = (Fahrenheit - 32)5/9 + 273.15

Load = [30; 40; 50; 60];            % kW
T1 = (T1 - 32)./1.8 + 273.15;       % K
T2a = (T2 - 32)./1.8 + 273.15;      % K
T3 = (T3 - 32)./1.8 + 273.15;       % K
T4a = (T4 - 32)./1.8 + 273.15;      % K
T5 = (T5 - 32)./1.8 + 273.15;       % K
T6 = (T6 - 32)./1.8 + 273.15;       % K
P2 = (P2 + P1).*6.89;               % kPa
P1 = 101;  % kPa - atmopheric pressure is 101 kPa

Calculations with Constant Specific Heats

% Assume specific heat is constant(k = c_p/c_v).
k = 1.4; % assuming T = 300K is constant (which it is not).
Cp = 1.005; % kJ/(kg*K) Assuming T = 300K is approximately constant.
m_dot = 0.844; % kg/s. This value is assumed.

% 1st. Calculate the isentropic efficiency of the turbine and the
% compresser using the 4 equations below.
%
% For a compressor with constant specific heats:
%   T2s/T1 = (P2/P1)^((k-1)/k) ... (eqn 1).
% Deffinition of isentropic efficiancey of a compressor (n_c):
%   n_c = ((T2s - T1)/(T2a - T1)) ... (eqn 2).
% For a turbine with constant specific heats:
%   T4s/T3 = (P1/P2)^((k-1)/k) ... (eqn 3).
% Deffinition of isentropic efficiancey of a turbine (n_t):
%   n_t = ((T3 - T4a)/(T3 - T4s)) ... (eqn 4).

fprintf('%%%%%% Get n_c using equations 1 and 2 %%%%%% \n')
T2s = T1.*(P2./P1).^((k-1)/k);
n_c = ((T2s - T1)./(T2a - T1));
[num2str(round(100000.*n_c)./1000), ['%';'%';'%';'%']]

fprintf('%%%%%% Get n_t using equations 3 and 4 %%%%%% \n')
T4s = T3.*(P1./P2).^((k-1)/k);
n_t = ((T3 - T4a)./(T3 - T4s));
[num2str(round(100000.*n_t)./1000), ['%';'%';'%';'%']]



% 2nd. Calculate the Thermal efficiency, Back work ratio, and Generator
% efficiency using the 4 equations below. Because n_c and n_t were both
% clearly wrong we make the assumption that n_t and n_c are 75%.
n_c = 0.75; n_t = n_c;
%
% Rearange (eqn 2): T2a = (T2s-T1)/n_c + T1 ... (eqn 5)
% Rearange (eqn 4): T3 = (T4a-n_t*T4s)/(1-n_t) ... (eqn 6)
% Plug (eqn 6) into (eqn 3) and solve for T4s:
%   T4s = 1./(((1-n_t)/((P1/P2)^((k-1)/k)))+n_t/T4a) ... (eqn 7)
% The thermal efficiency of an ideal Brayton cycle:
%   n_th,Brayton = 1 - 1/((P2/P1)^(1-1/k)) ... (eqn 8)

fprintf('%%%%%% Get T2a using equation 5 %%%%%% \n')
T2a = (T2s-T1)./n_c + T1

fprintf('%%%%%% Get T3 using equations 6 and 7 %%%%%% \n')
T4s = 1./((((1-n_t)./((P1./P2).^((k-1)/k)))+n_t)./T4a);
T3 = (T4a-n_t.*T4s)./(1-n_t)


fprintf('%%%%%% The work done by the turbine %%%%%% \n')
w_t = Cp.*(T3-T4a)

fprintf('%%%%%% The work done compressing the air in compresser %%%%%% \n')
w_c = Cp.*(T2a-T1)

fprintf('%%%%%% The heat generated in the burner %%%%%% \n')
q_in = Cp.*(T3-T2a)

fprintf('%%%%%% The net work %%%%%% \n')
w_net = w_t - w_c

fprintf('%%%%%% The ideal thermal efficiency using equation 8 %%%%%% \n')
n_th_ideal = 1-1./((P2./P1).^(1-1/k));
[num2str(round(100000.*n_th_ideal)./1000), ['%';'%';'%';'%']]

fprintf('%%%%%% The actual thermal efficiency %%%%%% \n')
n_th = w_net./q_in;
[num2str(round(100000.*n_th)./1000), ['%';'%';'%';'%']]

fprintf('%%%%%% The back work ratio %%%%%% \n')
r_bw = w_c./w_t

fprintf('%%%%%% The generator efficiency %%%%%% \n')
n_gen = Load./(m_dot.*w_net);
[num2str(round(100000.*n_gen)./1000), ['%';'%';'%';'%']]
%%% Get n_c using equations 1 and 2 %%% 

ans =

24.374%
23.631%
22.489%
21.067%

%%% Get n_t using equations 3 and 4 %%% 

ans =

107.672%
 99.113%
 93.048%
 87.197%

%%% Get T2a using equation 5 %%% 

T2a =

  474.9477
  478.4210
  481.8406
  483.9013

%%% Get T3 using equations 6 and 7 %%% 

T3 =

  1.0e+003 *

    0.9437
    0.9783
    1.0215
    1.0666

%%% The work done by the turbine %%% 

w_t =

  213.6119
  222.6664
  233.4326
  244.6669

%%% The work done compressing the air in compresser %%% 

w_c =

  173.7328
  175.8827
  177.7861
  179.1559

%%% The heat generated in the burner %%% 

q_in =

  471.0962
  502.3689
  542.3466
  585.6516

%%% The net work %%% 

w_net =

   39.8791
   46.7837
   55.6465
   65.5110

%%% The ideal thermal efficiency using equation 8 %%% 

ans =

30.031%
30.197%
30.318%
30.432%

%%% The actual thermal efficiency %%% 

ans =

 8.465%
 9.313%
 10.26%
11.186%

%%% The back work ratio %%% 

r_bw =

    0.8133
    0.7899
    0.7616
    0.7322

%%% The generator efficiency %%% 

ans =

 89.132%
101.303%
106.461%
108.516%

Calculations with Variable Specific Heats Using T1 and T3

% Only use the data from the 30KW load.

T1 = [mean(Load_30(:,1))];
T5 = [mean(Load_30(:,2))];
T6 = [mean(Load_30(:,3))];
T2 = [mean(Load_30(:,4))];
T3 = [mean(Load_30(:,5))];
T4 = [mean(Load_30(:,6))];
P2 = [mean(Load_30(:,7))];
V = [mean(Load_30(:,8))];
I = [mean(Load_30(:,9))];


% Convert all units to metric

% Kelvin = (Fahrenheit - 32)5/9 + 273.15

Load = 30;                          % kW
T1 = (T1 - 32)./1.8 + 273.15       % K
T2a = (T2 - 32)./1.8 + 273.15      % K   Assume wrong, therefore unknown.
T3 = (T3 - 32)./1.8 + 273.15       % K   Assume wrong, therefore unknown.
T4a = (T4 - 32)./1.8 + 273.15      % K
P2 = (P2 + P1).*6.89               % kPa
P1 = 101  % kPa - atmopheric pressure is 101 kPa
% P3 = P2, P4 = P1.

% pressure ratio (r_p)
r_p = 3.4


%%%% Getting the Answer %%%%
% If T1, T3, P1 and P2, as well as the isentropic efficiency for
% compressor n_c and for turbine n_t are known then the thermal efficiency
% can be calculated. This calculation will be done using variable specific
% heats. Becuase variable specific heats will be used the enthalpy's and Pr
% values will have to be looked up at each state.

n_c = 0.75; n_t = n_c; % 75 percent efficiencies.

% Enthalpys and Pr's obtained from Introduction to Thermodynamics text:
h1 = 302.20;                   % Known because T1 is known.
Pr1 = 1.487;
h3 = 1137.98;                  % Known because T3 is known.
Pr3 = 155.5;


% The steps:
% 1. Calculate h2s and h4s (enthalpy's)
% 2. Calculate h2a and h4a
% 3. Calculate the work done by the turbine (w_t)
% 4. Calculate the work done compressing the air in compresser (w_c)
% 5. Calculate the net work done
% 6. Calculate the heat generated in the burner (q_in)
% 7. Calculate the actual thermal efficiency of the cycle (n_th)



% The equations:
%
% For step 1:
%   Pr2 = Pr1*r_p ... (eqn 1)
%   Knowing Pr2 and P2, h2s can be found.
%   Pr4 = Pr3/r_p ... (eqn 2)
%   Knowing Pr4 and P4, h4s can be found.
%
% For step 2:
%   Deffinition of isentropic efficiancey of a compressor (n_c):
%   n_c = (h2s - h1)/(h2a - h1) ... (eqn 3)
%   Rearange equation 3 to get:
%   h2a = (h2s - h1)/n_c + h1 ...(eqn 4)
%   Deffinition of isentropic efficiancey of a turbine (n_t):
%   n_t = (h3 - h4a)/(h3 - h4s) ... (eqn 5)
%   Rearange equation 5 to get:
%   h4a = h3 - (h3 - h4s).*n_c ...(eqn 6)
%
% For step 3:
%   Deffinition of work done by turbine
%   w_t = h3 - h4a ... (eqn 7)
%
% For step 4:
%   Deffinition of work done by compressor
%   w_c = h2a - h1 ... (eqn 8)
%
% For step 5:
%   Deffinition of net work
%   w_net = w_t - w_c ... (eqn 9)
%
% For step 6:
%   Deffinition heat entering the system
%   q_in = h3 - h2a ... (eqn 10)
%
% For step 7:
%   Deffinition of actual thermal efficiency
%   n_th = (w_net)/q_in ... (eqn 11)



fprintf('%%%%%% Get Pr2 using equation 1 %%%%%% \n')
Pr2 = Pr1.*r_p
h2s = (441.61-431.43)*(5.0558-4.915)/(5.332-4.915) + (431.43)

fprintf('%%%%%% Get Pr4 using equation 2 %%%%%% \n')
Pr4 = Pr3./r_p
h4s = (821.95-800.03)*(45.735-43.35)/(47.75-43.35) + (800.03)

fprintf('%%%%%% Get h2a using equation 4 %%%%%% \n')
h2a = (h2s - h1)/n_c + h1


fprintf('%%%%%% Get h4a using equation 6 %%%%%% \n')
h4a = h3 - (h3 - h4s).*n_c


fprintf('%%%%%% Get w_t using equation 7 %%%%%% \n')
w_t = h3 - h4a


fprintf('%%%%%% Get w_c using equation 8 %%%%%% \n')
w_c = h2a - h1


fprintf('%%%%%% Get w_net using equation 9 %%%%%% \n')
w_net = w_t - w_c


fprintf('%%%%%% Get q_in using equation 10 %%%%%% \n')
q_in = h3 - h2a


fprintf('%%%%%% Get n_th using equation 11 %%%%%% \n')
n_th = (w_net)/q_in;
[num2str(round(100000.*n_th)./1000), ['%']]
T1 =

  302.0793


T2a =

  834.0008


T3 =

  1.0805e+003


T4a =

  731.1510


P2 =

  947.1628


P1 =

   101


r_p =

    3.4000

%%% Get Pr2 using equation 1 %%% 

Pr2 =

    5.0558


h2s =

  434.8673

%%% Get Pr4 using equation 2 %%% 

Pr4 =

   45.7353


h4s =

  811.9116

%%% Get h2a using equation 4 %%% 

h2a =

  479.0897

%%% Get h4a using equation 6 %%% 

h4a =

  893.4287

%%% Get w_t using equation 7 %%% 

w_t =

  244.5513

%%% Get w_c using equation 8 %%% 

w_c =

  176.8897

%%% Get w_net using equation 9 %%% 

w_net =

   67.6616

%%% Get q_in using equation 10 %%% 

q_in =

  658.8903

%%% Get n_th using equation 11 %%% 

ans =

10.269%

Calculations with Variable Specific Heats Using T1 and T4a

% pressure ratio (r_p)
r_p = P2/P1 %3.4


%%%% Getting the Answer %%%%
% If T1, T4a, P1 and P2, as well as the isentropic efficiency for
% compressor n_c and for turbine n_t are known then the thermal efficiency
% can be calculated. This calculation will be done using variable specific
% heats. Becuase variable specific heats will be used the enthalpy's and Pr
% values will have to be looked up at each state.

n_c = 0.75; n_t = n_c; % 75 percent efficiencies.

% Enthalpys and Pr's obtained from Introduction to Thermodynamics text:
h1 = 302.20;                    % Known because T1 is known.
Pr1 = 1.487;
h4a = 746.81;                   % Known because T4 is known



% The steps:
% 1. Calculate h2s (enthalpy)
% 2. Calculate h2a
% 3. Perform iterations to find h4a
% 4. Calculate the work done by the turbine (w_t)
% 5. Calculate the work done compressing the air in compresser (w_c)
% 6. Calculate the net work done
% 7. Calculate the heat generated in the burner (q_in)
% 8. Calculate the actual thermal efficiency of the cycle (n_th)



% The equations:
%
% For step 1:
%   Pr2 = Pr1*r_p ... (eqn 1)
%   Knowing Pr2 and P2, h2a can be found.
%
% For step 2:
%   Deffinition of isentropic efficiancey of a compressor (n_c):
%   n_c = (h2s - h1)/(h2a - h1) ... (eqn 2)
%   Rearange equation 2 to get:
%   h2a = (h2s - h1)/n_c + h1 ...(eqn 3)
%
% For step 3:
%   Iteration procedure:
%       1st Assume h3
%       2nd calculate h4s
%           Pr4 = Pr3/r_p ... (eqn 4)
%           Knowing Pr4 and P4, h4s can be found.
%       3rd calculate h4a
%           Deffinition of isentropic efficiancey of a turbine (n_t):
%           n_t = (h3 - h4a)/(h3 - h4s) ... (eqn 5)
%           Rearange equation 5 to get:
%           h4a = h3 - (h3 - h4s).*n_c ...(eqn 6)
%       5th iterate
%           Perform the above opporations untill the calculated value of
%           h4a equals the actual value of h4a.
%
% For step 3:
%   Deffinition of work done by turbine
%   w_t = h3 - h4a ... (eqn 7)
%
% For step 4:
%   Deffinition of work done by compressor
%   w_c = h2a - h1 ... (eqn 8)
%
% For step 5:
%   Deffinition of net work
%   w_net = w_t - w_c ... (eqn 9)
%
% For step 6:
%   Deffinition heat entering the system
%   q_in = h3 - h2a ... (eqn 10)
%
% For step 7:
%   Deffinition of actual thermal efficiency
%   n_th = (w_net)/q_in ... (eqn 11)



fprintf('%%%%%% Get Pr2 using equation 1 %%%%%% \n')
Pr2 = Pr1.*r_p
h2s = (441.61-431.43).*(5.0558-4.915)./(5.332-4.915) + (431.43)


fprintf('%%%%%% Get h2a using equation 3 %%%%%% \n')
h2a = (h2s - h1)/n_c + h1


fprintf('%%%%%% Get h4a %%%%%% \n')

fprintf('%% First iteration %%')
h3_1 = 1137.98
Pr3_1 = 155.5
Pr4_1 = Pr3_1./r_p
h4s_1 = (821.95-800.03).*(45.735-43.35)./(47.75-43.35) + (800.03)
h4a_1 = h3_1 - (h3_1 - h4s_1).*n_c
% Value too high.

fprintf('%% Second iteration %%')
h3_2 = 977.92;
Pr3_2 = 89.28;
Pr4_2 = Pr3_2./r_p;
h4s_2 = 692;
h4a_2 = h3_2 - (h3_2 - h4s_2).*n_c;
% Value too high.

fprintf('%% Third iteration %%')
h3_3 = 932.9
Pr3_3 = 75.29
Pr4_3 = Pr3_3./r_p
h4s_3 = 665
h4a_3 = h3_3 - (h3_3 - h4s_3).*n_c
% Value too low.

fprintf('%% Fourth (Final) iteration %%')
h3_4 = 955.38
Pr3_4 = 82.05
Pr4_4 = Pr3_4./r_p
h4s_4 = (702.52-691.82).*(26.258-25.85)./(27.29-25.85) + (691.82)
h4a_4 = h3_4 - (h3_4 - h4s_4).*n_c
% Value too high.


fprintf('%%%%%% Get w_t using equation 7 %%%%%% \n')
w_t = [h3_3 - h4a_3, h3_4 - h4a_4]


fprintf('%%%%%% Get w_c using equation 8 %%%%%% \n')
w_c = [h2a - h1, h2a - h1]


fprintf('%%%%%% Get w_net using equation 9 %%%%%% \n')
w_net = w_t - w_c


fprintf('%%%%%% Get q_in using equation 10 %%%%%% \n')
q_in = [h3_3 - h2a, h3_4 - h2a]


fprintf('%%%%%% Get n_th using equation 11 %%%%%% \n')
n_th = (w_net)./q_in;
[num2str(round(100000.*n_th)./1000), ['%']]
r_p =

    9.3778

%%% Get Pr2 using equation 1 %%% 

Pr2 =

   13.9449


h2s =

  434.8673

%%% Get h2a using equation 3 %%% 

h2a =

  479.0897

%%% Get h4a %%% 
% First iteration %
h3_1 =

  1.1380e+003


Pr3_1 =

  155.5000


Pr4_1 =

   16.5816


h4s_1 =

  811.9116


h4a_1 =

  893.4287

% Second iteration %% Third iteration %
h3_3 =

  932.9000


Pr3_3 =

   75.2900


Pr4_3 =

    8.0285


h4s_3 =

   665


h4a_3 =

  731.9750

% Fourth (Final) iteration %
h3_4 =

  955.3800


Pr3_4 =

   82.0500


Pr4_4 =

    8.7493


h4s_4 =

  694.8517


h4a_4 =

  759.9837

%%% Get w_t using equation 7 %%% 

w_t =

  200.9250  195.3963

%%% Get w_c using equation 8 %%% 

w_c =

  176.8897  176.8897

%%% Get w_net using equation 9 %%% 

w_net =

   24.0353   18.5065

%%% Get q_in using equation 10 %%% 

q_in =

  453.8103  476.2903

%%% Get n_th using equation 11 %%% 

ans =

5.296       3.886%