Project 2 - Rankine cycle Simulator
AIM;
To calculate the performance os a steam turbine engine and plot th T-S and H-S diagram of a rankine cycle
objective;
- to calculate the performance of a steam turbine engine
- to plot the T-S and H-S diagram of a rankine cycle
what is rankine cycle?
The Rankine cycle or Rankine Vapor Cycle is the process widely used by power plants such as coal-fired power plants or nuclear reactors. In this mechanism, a fuel is used to produce heat within a boiler, converting water into steam which then expands through a turbine producing useful work. This process was developed in 1859 by Scottish engineer William J.M. Rankine.This is a thermodynamic cycle which converts heat into mechanical energy—which usually gets transformed into electricity by electrical generation.

The steps in the Rankine Cycle as shown in Figure 1 and the corresponding steps in the pressure volume diagram
- Pump: Compression of the fluid to high pressure using a pump (this takes work)
- 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 (ex. lake or river).
The efficiency of the Rankine cycle is limited by the high heat of vaporization by the fluid. The fluid must be cycled through and reused constantly, therefore, water is the most practical fluid for this cycle. This is not why many power plants are located near a body of water—that's for the waste heat.
As the water condenses in the condenser, waste heat is given off in the form of water vapour—which can be seen billowing from a plant's cooling towers. This waste heat is necessary in any thermodynamic cycle. Due to this condensation step, the pressure at the turbine outlet is lowered. This means the pump requires less work to compress the water—resulting in higher overall efficiencies.
- Process 1–2: The working fluid is pumped from low to high pressure. As the fluid is a liquid at this stage, the pump requires little input energy. Process 1-2 is isentropic compression.
- Process 2–3: The high-pressure liquid enters a boiler, where it is heated at constant pressure by an external heat source to become a dry saturated vapour. The input energy required can be easily calculated graphically, using an enthalpy–entropy chart (h–s chart, or Mollier diagram), or numerically, using steam tables or software. Process 2-3 is constant pressure heat addition in boiler.
- Process 3–4: The dry saturated vapour expands through a turbine, generating power. This decreases the temperature and pressure of the vapour, and some condensation may occur. The output in this process can be easily calculated using the chart or tables noted above. Process 3-4 is isentropic expansion.
- Process 4–1: The wet vapour then enters a condenser, where it is condensed at a constant pressure to become a saturated liquid. Process 4-1 is constant pressure heat rejection in condenser.
The thermal efficiency of Rankine cycle is given as:
clear all
close all
clc
%display
disp(' rankine cycle simulator ');
disp('1-2 isentropic expansion in the turbine')
disp('2-3 constant pressure heat rejection by condensor')
disp('3-4 isentropic compression in the pump')
disp('4-1 constant pressure heat addition the boiler')
%required inputs
disp(' inputs ');
P1 = input('enter the pressure at turbine inlet(bar):');
T1 = input('enter the temperature at the turbine inlet(degree c):');
P2 = input('enter the pressure at the condensor(bar):');
%using the XSteam function, the enthalpy and entropy at various
%points can be calculated:
h1 = XSteam('h_pT',P1,T1);
s1 = XSteam('s_pT',P1,T1);
%calculating pressure(P),enthalpy(h) end entropy(s) at point 2:
%since isentropic expansion:
s2=s1;
%for iscentropic expansion:
30;
% wkt (T2/T1)=(P2/P1)^(1-(1/g))
g = 1.4;
power = 1-(1/g);
%hence (T2/T1)= (P2/P1)^power:
T2 = T1*((P2/P1)^power);
h2 = XSteam('h_pT',P2,T2);
% since constant pressure heat removal:
P3 = P2;
T3 = T2;
h3 = XSteam('hL_T',T3);
s3 = XSteam('sL_T',T3);
%calculating pressure(P),enthalpy(h) and entropy(s) at point 4:
s4 = s3;
%since constant pressure process:
P4 = P1;
T4 = XSteam('T_ps',P4,s4);
h4 = XSteam('h_pT',P4,T4);
h41 = XSteam('hL_p',P4);
s41 = XSteam('sL_p',P4);
h42 = XSteam('hV_p',P4);
s42 = XSteam('sV_p',P4);
T41 = XSteam('T_hs',h41,s41);
T42 = XSteam('T_hs',h42,s42);
%calculating the entropy and enthalpy at saturation curve:
Temp = linspace(0,500,600);
for i = 1:length(Temp)
sv(i) = XSteam('sV_T',Temp(i));
sl(i) = XSteam('sL_T',Temp(i));
hv(i) = XSteam('hV_T',Temp(i));
hl(i) = XSteam('hL_T',Temp(i));
end
%calculating net work output(w_net):
W_t = h1-h2;
W_p = h4-h3;
W_net = W_t-W_p;
%calculating back work ratio:
Bw_ratio = W_p/W_t;
%calculating specific steam consumption:
%wkt 1J = 3600kg/s
SSC = 3600/W_net;
%displaying results in the command window:
disp(' results ');
P1 = P1;
T1 = T1;
P2 = P2;
disp('at stage point 1');
n1 = sprintf('P1 is %.3f bar',P1);
disp(n1);
n2 = sprintf('T1 is %.3f c',T1);
disp(n2);
n3 = sprintf('h1 is %.3f kj/kg',h1);
disp(n3);
n4 = sprintf('s1 is %.3f kj/kgk',s1);
disp(n4);
disp('at stage point 2');
n11 = sprintf('P2 is %.3f bar',P2);
disp(n11);
n21 = sprintf('T2 is %.3f c',T2);
disp(n21);
n31 = sprintf('h2 is %.3f kj/kg',h2);
disp(n31);
n41 = sprintf('s2 is %.3f kj/kgk',s2);
disp(n41);
disp('at stage point 3');
n12 = sprintf('P3 is %.3f bar',P3);
disp(n12);
n22 = sprintf('T3 is %.3f c',T3);
disp(n22);
n32 = sprintf('h3 is %.3f kj/kg',h3);
disp(n32);
n42= sprintf('s3 is %.3f kj/kgk',s3);
disp(n42);
disp('at stage point 4');
n13= sprintf('P4 is %.3f bar',P4);
disp(n13);
n23= sprintf('T4 is %.3f c',T4);
disp(n23);
n33= sprintf('h4 is %.3f kj/kg',h4);
disp(n33);
n43= sprintf('s4 is %.3f kj/kgk',s4);
disp(n43);
n14= sprintf('W_t is %.3f kj/kg',W_t);
disp(n14);
n15= sprintf('W_p is %.3f kj/kg',W_p);
disp(n15);
n16= sprintf('W_net is %.3f kj/kg',W_net);
disp(n16);
n18 = sprintf('SSC is %.2f kg/kwh',SSC);
disp(n18);
figure(1)
plot([s1 s2],[T1 T2],[s2 s3],[T2 T3],[s3 s4],[T3 T4],[s4 s41],[T4 T41],[s41 s42],[T41 T42],[s42 s1],[T42 T1],'marker','*','color','r')
hold on
plot(sv,Temp)
plot(sl,Temp)
xlabel('entropy-s(kj/kgk');
ylabel('Temperature-T(K)');
title('H-S diagram');
figure(2)
plot([s1 s2],[h1 h2],[s2 s3],[h2 h3],[s3 s4],[h3 h4],[s4 s1],[h4 h1],'Marker','*','Color','g')
hold on
plot(sv,hv)
plot(sl,hl)
xlabel('entropy-s(kj/kgk');
ylabel('enthalpy-h(kj/k)');
title('T-S diagram');

