Challenge

Project 2 - Rankine cycle Simulator

AIM

Rankine cycle Simulator

THEORY

The Rankine cycle is an idealized thermodynamic cycle describing the process by which certain heat engines, such as steam turbines or reciprocating steam engines, allow mechanical work to be extracted from a fluid as it moves between a heat source and a heat sink.

Heat energy is supplied to the system via a boiler where the working fluid (typically water) is converted to a high-pressure gaseous state (steam) in order to turn a turbine. After passing over the turbine the fluid is allowed to condense back into a liquid state as waste heat energy is rejected before being returned to the boiler, completing the cycle. Friction losses throughout the system are often neglected for the purpose of simplifying calculations as such losses are usually much less significant than thermodynamic losses, especially in larger systems.

The physical layout of the Rankine cycle:

  1. Pump
  2. Boiler
  3. Turbine
  4. Condenser

Four processes in the Rankine cycle

There are four processes in the Rankine cycle. The states are identified by numbers 1-2-3-4 in the T-s diagram.

  • Process 1-2:

The working fluid is pumped from low to high pressure. As the fluid is 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 the 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 the condenser.

XSteam Library

XSteam provides accurate steam and water properties from 0 – 1000 bar and from 0 – 2000 deg C according to the standard IAPWS IF-97. XSteam takes 2 or 3 arguments. The first argument must always be the steam table function you want to use. The other arguments are the inputs to that function.

Nomenclature:

First, the wanted property comes then the wanted input properties. For example, T_ph is the temperature as a function of pressure and enthalpy. For a list of valid functions see below

  • T – Temperature (deg C)
  • p – Pressure (bar)
  • h – Enthalpy (kJ/kg)
  • v – Specific volume (m3/kg)
  • s – Specific entropy
  • Q – Heat flow rate to/from the system
  • W – Mechanical power consumed by or provided to the system

Note: Make sure the Xsteam is present in the working directory of the current program.

Equations Used

MATLAB CODE

clear all
close all
clc

% Rankine cycle detail for user to understand
disp('RANKINE CYCLE SIMULATOR');
disp('1-2 Isentropic compression in the pump');
disp('2-3 Constant pressure heat addition by the boiler');
disp('3-4 Isentropic expansion in the turbine');
disp('4-1 Constant pressure heat rejection by the condenser');

% Asking user for inputs
p3 = input('Enter pressure at the Turbine inlet(bar): ');
t3 = input('Enter temperature at the Turbine inlet(deg C): ');
p4 = input('Enter the pressure at the condenser(bar): ');

% Point 3
% Turbine
tsat = XSteam('Tsat_p',p3);
sf3 = XSteam('sL_p',p3);
sg3 = XSteam('sV_p',p3);
if t3 > tsat
    tsup = t3;
    h3 = XSteam('h_pT',p3,tsup);
    s3 = XSteam('s_pT',p3,tsup);
elseif t3 == tsat
    h3 = XSteam('hL_p',p3);
    s3 = XSteam('sL_p',p3);
else 
    disp('Temperature entered must be greater than or equal to saturation temperature');
end

% Point 4
% Condenser
t4 = XSteam('Tsat_p',p4);
hf4 = XSteam('hL_p',p4);
hg4 = XSteam('hV_p',p4);
s4 = s3;
sg4 = XSteam('sV_p',p4);
sf4 = XSteam('sL_p',p4);
x4 = (s4-sf4)/(sg4-sf4);
h4 = hf4 + (x4*(hg4 - hf4));

% Point 1
% Pump
p1 = p4;
t1 = t4;
h1 = hf4;
s1 = sf4;

% Point 2
% Boiler
p2 = p3;
s2 = s1;
cp2 = XSteam('Cp_ps',p2,s2);
cv2 = XSteam('Cv_ps',p2,s2);
gamma = cp2/cv2;
t2 = t1*(p2/p1)^((gamma - 1)/gamma);
vf = XSteam('vL_p',p1);
% Power input to pump
wp = vf*(p3-p4)*100;
h2 = wp + h1;

% work output from turbine
wt = h3 - h4;

% heat input
Qin = h3 - h2;

% heat output
Qout = h4 - h1;

% net work
wnet = wt - wp;

% thermal efficiency
Ntherm = (wnet/Qin)*100;

% specific fuel consumption 
ssc = 3600/wnet;

% plotting of t-s and h-s diagram

% t-s diagram
figure(1)
hold on
% plotting saturation lines
temp = linspace(1,373,500);

for i = 1:length(temp)
    hl(i) = XSteam('hL_T', temp(i));
    hv(i) = XSteam('hV_T', temp(i));
    sl(i) = XSteam('sL_T', temp(i));
    sv(i) = XSteam('sV_T', temp(i));
end

plot(sl,temp,'k','LineWidth',1.5);
plot(sv,temp,'k','LineWidth',1.5);
xlabel('Specific Entropy (KJ/kgK)')
ylabel('Temperature (deg C)')
grid on
title('T-S graph')
plot([s1 s2 sf3],[t1 t2 tsat],'Color', 'b','LineWidth',1.5);
plot([sf3 sg3],[tsat tsat],'Color', 'b','LineWidth',1.5);
plot([s3 s4 s1],[t3 t4 t1],'Color', 'b','LineWidth',1.5);
text(s1,t1-10,'1');
text(s2,t2+10,'2');
text(s3,t3,'3');
text(s4,t4,'4');

t = linspace(tsat,tsup,1000);
for j = 1:length(t)
    sinst(j) = XSteam('s_pT',p3,t(j));
end

plot(sinst,t,'Color','b','LineWidth',1.5)

% h-s diagram
figure(2)
hold on
grid on
plot(sl,hl,'k','LineWidth',1.5)
plot(sv,hv,'k','LineWidth',1.5)
plot([s1 s2 s3 s4 s1],[h1 h2 h3 h4 h1],'Color','b','LineWidth',1.5)
text(s1,h1-100,'1');
text(s2,h2+100,'2');
text(s3,h3,'3');
text(s4,h4,'4');
xlabel('Specific Enthalpy (KJ/kg)')
ylabel('Specific Entropy (KJ/kgK')
title('H-S graph')

% Ouputs

fprintf('\nRESULTS\n');

% State 1
fprintf('At State Point 1 \n');
fprintf('P1 - %.2f bar\n',p1);
fprintf('T1 - %.2f deg C \n', t1);
fprintf('H1 - %.2f KJ/kg \n',h1);
fprintf('S1 - %.2f KJ/kgK \n\n',s1);

% State 2
fprintf('At State Point 2 \n');
fprintf('P2 - %.2f bar\n',p2);
fprintf('T2 - %.2f deg C \n', t2);
fprintf('H2 - %.2f KJ/kg \n',h2);
fprintf('S2 - %.2f KJ/kgK \n\n',s2);

% State 3
fprintf('At State Point 3 \n');
fprintf('P3 - %.2f bar\n',p3);
fprintf('T3 - %.2f deg C \n', t3);
fprintf('H3 - %.2f KJ/kg \n',h3);
fprintf('S3 - %.2f KJ/kgK \n\n',s3);

% State 4
fprintf('At State Point 4 \n');
fprintf('P4 - %.2f bar\n',p4);
fprintf('T4 - %.2f deg C \n', t4);
fprintf('H4 - %.2f KJ/kg \n',h4);
fprintf('S4 - %.2f KJ/kgK \n\n',s4);

fprintf('Turbine Work Output - %.2f KJ/kg \n', wt);
fprintf('Pump Power Input - %.2f KJ/kg \n', wp);
fprintf('Net Work - %.2f KJ/kg \n',wnet);
fprintf('Thermal Efficiency - %.2f percent \n',Ntherm);
fprintf('Specific Fuel Consumption - %.2f kg/KWh \n',ssc);

Code Description

  • Rankine Cycle Simulator
  • The code calculates the state points of the Rankine Cycle based on user inputs along with network output and back work ratio.
  • XSteam library is used to get the steam table data for water and calculate the points between the state variables.
  • The corresponding plots for T-s and h-s graphs are plotted for the given set of inputs.
  • Print the state points value as output.

OUTPUT

Plots

T-s graph

h-s graph

Command Window Output

CONCLUSION

  • The state points of the Rankine Cycle are calculated using the steam table data for water from the standard MATLAB XSteam library.
  • Programs to compute property values of water at three regions are developed using MATLAB. Those programs are then employed with another program simulating a Rankine cycle.
  • T-s and h-s plots of the Rankine cycle are plotted and therefore the work and efficiency of the Rankine cycle are calculated.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.