Rankine cycle using Octave
Aim:
To Create a Rankine Cycle Simulator using OCTAVE/MATLAB.
To find:
- Net work output
- Back work ratio
- Efficiency
- Specific Steam consumption
Theory:
The Rankine cycle was named after him and describes the performance of steam turbine systems, though the theoretical principle also applies to reciprocating engines such as steam locomotives. In general, the Rankine cycle is an idealized thermodynamic cycle of a constant pressure heat engine that converts part of heat into mechanical work. In this cycle, the heat is supplied externally to a closed loop, which usually uses water (in a liquid and vapor phase) as the working fluid
- Pump: Compression of the fluid to high pressure using a pump
- Boiler: The compressed fluid is heated to the final temperature (which is at boiling point), therefore, a phase change occurs—from liquid to vapor.
- Turbine: Expansion of the vapor in the turbine.
- Condenser: Condensation of the vapor in the condenser (where the waste heat goes to the final heat sink (the atmosphere or a large body of water.
Working Example for a Rankine cycle:
Formulae:
H1,H2,H3,H4,H5,H6=Enthalpy
S1,S2,S3,S4,S5,S6=Entrophy
T1,T2,T3,T4,T5,T6= Temperature
Work turbine = H1 - H2
Work pump = H4 - H3
Net work = Work turbine-pump work
In flow(q-in) = H1 - H4
Out flow(q-out) = H2 - H3
efficiency = net work/in flow
Percentage efficiency = efficiency*100
Specific steam consumption = 3600/net work
Back work ratio = In flow/Out flow
Inputs:
Turbine Inlet temperature = 400° C
Turbine Inlet Pressure = 30 bars
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure.
Program:
clear all
close all
clc
fprintf ('%50s \n','RANKINE CYCLE SIMULATOR')
fprintf ('1-2 is Isentropic Expansion in Turbine \n')
fprintf ('2-3 is Const Pressure Heat Rejection by the Condenser \n')
fprintf ('3-4 is Isentropic Compression in the Pump \n')
fprintf ('4-1 is Const Pressure Heat Addition by the Boiler \n\n')
% Getting Inputs from User
P1 = input('Enter the Pressure at the Turbine Inlet (in bar) :');
T1 = input('Enter the Temperature at the Turbine Inlet (in Degree Celcius) :');
P2 = input('Enter the Pressure at Condenser (in bar) :');
%Computing Results
fprintf ('\n %45s','"HURRAY RESULTS"')
% Calculating Required Values at all State Points
% At State Point 1
S1 = XSteam ('s_pT',P1,T1);
H1 = XSteam ('h_pT',P1,T1);
% At State Point 2
S2 = S1;
sf2 = XSteam ('sL_p',P2);
sg2 = XSteam ('sV_p',P2);
hf2 = XSteam ('hL_p',P2);
hg2 = XSteam ('hV_p',P2);
T2 = XSteam ('Tsat_p',P2);
x2 = ((S2-sf2)/(sg2-sf2));
H2 = hf2+(x2*(hg2-hf2));
% At State Point 3
P3 = P2;
T3 = XSteam ('Tsat_p',P3);
S3 = XSteam ('sL_p',P3);
H3 = XSteam ('hL_p',P3);
% To calculate Gamma
cp = XSteam('cpL_p',P3);
cv = XSteam('cvL_p',P3);
gamma = (cp/cv);
% At State Point 4
P4 = P1;
S4 = S3;
H4 = XSteam('h_ps',P4,S4);
T4 = T3*((P4/P3)^((gamma-1)/gamma));
% Calculating work done
Wt = H1 - H2;
Wp = H4 - H3;
W_net = Wt-Wp;
q_in = H1 - H4;
q_out = H2 - H3;
efficiency = W_net/q_in;
Percentage_efficiency = efficiency*100;
Specific_steam_consumption = 3600/W_net;
Back_work_ratio = q_in/q_out;
% At State Points 5 and 6
T5 = XSteam('Tsat_p',P1);
T6 = T5;
S5 = XSteam('sL_p',P1);
S6 = XSteam('sV_p',P1);
H5 = XSteam('hL_p',P1);
H6 = XSteam('hV_p',P1);
% Plotting The Required Graphs
% T-S Graph
figure(1)
T_Zone1 = linspace(T5,T1,500);
for i = 1:length(T_Zone1)
S(i) = XSteam('s_pt',P1,T_Zone1(i));
end
hold on
plot([S1 S2 S3 S4 S5 S6 S],[T1 T2 T3 T4 T5 T6 T_Zone1],'linewidth',3,'color','r')
axis ([0 10 0 430])
text (S1,T1,'1','FontSize',15)
text (S2,T2,'2','FontSize',15)
text (S3,T3,'3','FontSize',15,'verticalalignment','top')
text (S4,T4,'4','FontSize',15,'verticalalignment','bottom','horizontalalignment','right')
text (S5,T5,'5','FontSize',15,'verticalalignment','top')
text (S6,T6,'6','FontSize',15,'verticalalignment','top','horizontalalignment','right')
T_Zone2 = linspace(0,T1,500);
for j = 1:length(T_Zone2)
sl(j) = XSteam('sL_T',T_Zone2(j));
sv(j) = XSteam('sV_T',T_Zone2(j));
hl(j) = XSteam('hL_T',T_Zone2(j));
hv(j) = XSteam('hV_T',T_Zone2(j));
end
plot (sl,T_Zone2,'linewidth',1.5,'color','g')
plot (sv,T_Zone2,'linewidth',1.5,'color','g')
xlabel('Entropy')
ylabel('Temperature')
title ('Entropy vs Temperature')
% H-S Graph
figure(2)
hold on
plot([S1 S2 S3 S4 S1],[H1 H2 H3 H4 H1],'linewidth',3,'color','g')
axis ([0 10 -100 3500])
text (S1,H1,'1','FontSize',15)
text (S2,H2,'2','FontSize',15)
text (S3,H3,'3','FontSize',15,'verticalalignment','top','horizontalalignment','left')
text (S4,H4,'4','FontSize',15,'verticalalignment','bottom','horizontalalignment','right')
plot(sv,hv,'linewidth',2,'color','b')
plot(sl,hl,'linewidth',2,'color','b')
xlabel('Entropy')
ylabel('Enthalpy')
title('Entropy vs Enthalpy')
% Displaying The Results
fprintf ('\n At State Point 1 : \n')
fprintf ('P1 is : %f Bar \n',P1)
fprintf ('T1 is : %f Deg Celcius \n',T1)
fprintf ('H1 is : %f kJ/kg \n',H1)
fprintf ('S1 is : %f kJ/kgK \n',S1)
fprintf ('\n At State Point 2 : \n')
fprintf ('P2 is : %f Bar \n',P2)
fprintf ('T2 is : %f Deg Celcius \n',T2)
fprintf ('H2 is : %f kJ/kg \n',H2)
fprintf ('S2 is : %f kJ/kgK \n',S2)
fprintf ('X2 is : %f \n',x2)
fprintf ('\n At State Point 3 : \n')
fprintf ('P3 is : %f Bar \n',P3)
fprintf ('T3 is : %f Deg Celcius \n',T3)
fprintf ('H3 is : %f kJ/kg \n',H3)
fprintf ('S3 is : %f kJ/kgK \n',S3)
fprintf ('\n At State Point 4 : \n')
fprintf ('P4 is : %f Bar \n',P4)
fprintf ('T4 is : %f Deg Celcius \n',T4)
fprintf ('H4 is : %f kJ/kg \n',H4)
fprintf ('S4 is : %f kJ/kgK \n\n',S4)
fprintf ('turbine work : %f kJ/kg \n',Wt)
fprintf ('pump work : %f kJ/kg \n',Wp)
fprintf ('net work : %f kJ/kg \n',W_net)
fprintf ('thermal efficiency : %f percent \n',Percentage_efficiency)
fprintf ('Specific steam consumption: %f kg/kWh\n',Specific_steam_consumption)
fprintf ('back work ratio: %f \n',Back_work_ratio)
fprintf ('%50s \n','sucess')
Plots:
- Command window:
Result:
Thus the required Rankine Superheat cycle has been obtained and plots are shown above.