Challenge

Project 2 - Rankine cycle Simulator

AIM:

To create a Rankine Cycle Simulator from the given input and read the data from the standard thermodynamic library of steam table.

OBJECTIVE:

  • To create a Rankine Cycle simulator in MATLAB.
  • To calculate the state points of the Rankine Cycle based on user inputs and data from Xsteam.
  • Plotting the corresponding T-s and h-s plots for the given inputs.
  • To get output in the command window for each state point in cycle.

Basic Rankine Cycle -

The Rankine cycle is the fundamental operating cycle of all power plants where an operating fluid is continuously evaporated and condensed. The selection of operating fluid depends mainly on the available temperature range. Figure 1 shows the idealized Rankine cycle.

The pressure-enthalpy (p-h) and temperature-entropy (T-s) diagrams of this cycle are given in Figure 2. The Rankine cycle operates in the following steps:

  • 1-2-3 Isobaric Heat Transfer. High pressure liquid enters the boiler from the feed pump (1) and is heated to the saturation temperature (2). Further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam (3).
  • 3-4 Isentropic Expansion. The vapor is expanded in the turbine, thus producing work which may be converted to electricity. In practice, the expansion is limited by the temperature of the cooling medium and by the erosion of the turbine blades by liquid entrainment in the vapor stream as the process moves further into the two-phase region. Exit vapor qualities should be greater than 90%.
  • 4-5 Isobaric Heat Rejection. The vapor-liquid mixture leaving the turbine (4) is condensed at low pressure, usually in a surface condenser using cooling water. In well designed and maintained condensers, the pressure of the vapor is well below atmospheric pressure, approaching the saturation pressure of the operating fluid at the cooling water temperature.
  • 5-1 Isentropic Compression. The pressure of the condensate is raised in the feed pump. Because of the low specific volume of liquids, the pump work is relatively small and often neglected in thermodynamic calculations.

Figure -1 - Rankine cycle.

Figure - 2 - T-s and p-h diagrams.

The efficiency of power cycles is defined as


MATLAB CODE -

%% Rankine cycle simulator

clear all

close all

clc

% Display of States in Rankine cycle
disp(' RANKINE CYCLE SIMULATOR ');
disp('1-2 is Isentropic Expansion in the turbine');
disp('2-3 is constant pressure heat removal in the condenser');
disp('3-4 is Isentropic compression in the pump');
disp('4-1 is Constant pressure heat addition in the boiler');
% Obtaining the input data
p1 = input('\nValue of pressure at turbine inlet, p1(in bar) = ');
T1 = input('\nValue of temperature at turbine inlet, T1(in degree.C) = ');
p2 = input('\nValue of temperature at condenser inlet, p2(in bar) = ');
% Extracting data _ defining variables from steam Data
% State 1
h1 = XSteam('h_pT', p1, T1); % extracting enthalpy at state point 1
s1 = XSteam('s_pT', p1, T1); % extracting entropy at state point 1
% State 2
s2 = s1; % Entropy is same at both point, Isentropic expansion
sf2= XSteam('sL_p', p2); % Saturated liquid Entropy
sg2 = XSteam('sV_p', p2); % Saturated Vapour Entropy
x2 = (s2-sf2)/(sg2-sf2); % Vapour Fraction
hf2 = XSteam('hL_p', p2); % Saturated liquid Enthalpy
hg2 = XSteam('hV_p', p2); % Saturated vapour Enthalpy
h2 = hf2 + (x2*(hg2-hf2)); % Enthalpy at state 2
% State 3
p3 = p2; % Constant pressure Heat rejection in condenser
s3= XSteam('sL_p', p3); % Enthalpy at state 3
h3 = XSteam('hL_p', p3); % Entropy at state 3
% State 4
s4 = s3; % Entropy is same at both point, Isentropic expansion
p4 = p1; % Constant Pressure Heat Rejection
% Work done by turbine
Wt = h1 - h2;
% Work done to run pump
v3 = XSteam('vL_p', p3); % Specific volume at state 3
Wp = v3*(p4 - p3)*100; % Work done to run the pump
h4 = h3 + Wp; % Enthalpy at state 4
%net work
Wnet = Wt - Wp;
%Heat into the system
Qin = h1 - h4;
%Heat out of the system
Qout = h2 - h3;
%Thermal efficiency
eff = (Wnet/Qin)*100;
%Specific Steam Consumption
%SSC = mass flow rate/power
SSC = (3600/Wnet);
% Back work ratio
BWR = Wp/Wt;
%Calculating temperatures at the state points
T3 = XSteam('Tsat_p', p3); % Saturation Temperature at state 3
T2 = T3; % Temperature at state 2 & 3 are equal, Constant Pressure Heat addition
Cp4 = XSteam('Cp_ps', p4, s4); % Specific Isobaric Heat Capacity
Cv4 = XSteam('Cv_ps', p4, s4); % Specific Isochoric Heat Capacity
k = Cp4/Cv4;
T4 = T3/((p3/p4)^((k-1)/k)); % Temperature at State 4
%Calculating temperature, entropy and enthalpy at the vapour and liquid
%line for plotting
T6 = XSteam('Tsat_p', p1); % Saturated Temperature at Pressure 1
s5 = XSteam('sL_p', p1); % Saturated Liquid Entropy at Pressure 1
s6 = XSteam('sV_p', p1); % Saturated Vapour Entropy at Pressure 1
h5 = XSteam('hL_p', p1); % Saturated Liquid Enthalpy at Pressure 1
h6 = XSteam('hV_p', p1); % Saturated Vapour Enthalpy at Pressure 1
T5 = T6; % Temperature at state 5 & 6 are equal,
%Plotting the saturation curve
T = linspace(1,375,100); % temp space for plotting saturation curves
for i = 1:length(T)
sf(i) = XSteam('sL_T', T(i)); % Saturated Liquid Entropy
sg(i) = XSteam('sV_T', T(i)); % Saturated Vapour Entropy
hf(i) = XSteam('hL_T', T(i)); % Saturated Liquid Enthalpy
hg(i) = XSteam('hV_T', T(i)); % Saturated Vapour Enthalpy
end
%Plotting T-s diagram
figure(1)
hold on
plot(sf, T,'color','c','linewidth',1)
plot(sg, T,'color','c','linewidth',1)
plot([s1 s2], [T1 T2],'color', 'b', 'linewidth', 2)
plot([s2 s3], [T2 T3],'color', 'b', 'linewidth', 2)
plot([s3 s4], [T3 T4],'color', 'b', 'linewidth', 2)
plot([s4 s5], [T4 T5],'color', 'b', 'linewidth', 2)
plot([s5 s6], [T5 T6],'color', 'b', 'linewidth', 2)
sc1 = linspace(s6, s1, 100);
for j = 1:length(sc1)
Tc1(j) = XSteam('T_ps', p1, sc1(j));
end
plot(sc1, Tc1,'color', 'b', 'linewidth', 2)
text(s1 + 0.1, T1, '1')
text(s2 + 0.1, T2, '2')
text(s3, T3 - 20, '3')
text(s4, T4 + 20, '4')
title('Temperature Vs Entropy plot')
xlabel('Entropy ,S (Kj/kgk')
ylabel('Temperature (degree C) ')
legend('Saturation curve')
%Plotting h-s diagram
figure(2)
hold on
plot(sf, hf,'color','c', 'linewidth', 1)
plot(sg, hg,'color','c', 'linewidth', 1)
plot([s1 s2], [h1 h2],'color', 'b', 'linewidth', 2)
plot([s2 s3], [h2 h3],'color', 'b', 'linewidth', 2)
plot([s3 s4], [h3 h4],'color', 'b', 'linewidth', 2)
hc = linspace(h4, h5, 100);
for k = 1:length(hc)
sch(k) = XSteam('s_ph', p1, hc(k));
end
plot(sch,hc,'color','b', 'linewidth', 2)
plot([s5 s6], [h5 h6],'color','b', 'linewidth', 2)
for m = 1:length(sc1)
hc1(m) = XSteam('h_ps', p1, sc1(m));
end
plot(sc1, hc1, 'color','b', 'linewidth', 2)
text(s1+0.1, h1, '1')
text(s2+0.1, h2, '2')
text(s3, h3-100, '3')
text(s4, h4 +200, '4')
title('Enthalpy vs Entropy plot')
xlabel('Entropy , S (KJ/kgk) ')
ylabel('Enthalpy , H (KJ/kg)')
legend('Saturation curve','location','northwest')
% Displaying Results of Rankine cycle
disp('RESULTS OF IDEAL RANKINE CYCLE');
fprintf('At State Point 1:\n');
fprintf('p1: %f bar\n', p1);
fprintf('T1: %f C\n', T1);
fprintf('h1: %f KJ/kg\n', h1);
fprintf('s1: %f KJ/kgK\n\n', s1);
fprintf('At State Point 2:\n');
fprintf('p2: %f bar\n', p2);
fprintf('T2: %f C\n', T2);
fprintf('h2: %f kJ/kg\n', h2);
fprintf('s2: %f kJ/kgK\n', s2);
fprintf('x2: %f \n', x2);
fprintf('At State Point 3:\n');
fprintf('p3: %f bar\n', p3);
fprintf('T3: %f K\n', T3);
fprintf('h3: %f kJ/kg\n', h3);
fprintf('s3: %f kJ/kgK\n\n', s3);
fprintf('At State Point 4:\n');
fprintf('p4: %f bar\n', p4);
fprintf('T4: %f K\n', T4);
fprintf('h4: %f KJ/kg\n', h4);
fprintf('s4: %f kJ/kgK\n\n', s4);
fprintf('Turbine Work: %f kJ/kg\n', Wt);
fprintf('Pump Work: %f kJ/kg\n', Wp);
fprintf('Wnet: %f kJ/kg\n', Wnet);
fprintf('Efficiency: %f % \n ', eff);
fprintf('S.S.C: %f kJ/kWh', SSC);
fprintf('Back Work Ratio: %f ', BWR);

Explanation of Code -

  • The XSteam data is used to extract vapour and liquid properties of enthalpy, entropy at specific pressure and temperatures for saturated liquid, saturated vapour conditions
  • The program requires the input pressure (p1 in bar) at state 1 (Turbine Inlet), temperature at same point (in degree celcius) and pressure at Condenser Inlet (point 2).
  • With the help of these inputs & from XSteam data, the program calculates all the 4 states of the Rankine cycle.
  • The XSteam data works as, h1 = XSteam('h_pT' , p1 , T1) it returns the enthalpy of water at given pressure and temperature.
  • Thermodynamic relation used to find the state points and extract their data from XSteam which are mentioned after studying the Rankine cycle.
  • saturated liquid and saturated vapour are calculated after studying the plots of the Rankine Cycle and extracting data from XSteam file.
  • Further, the network, work done by turbine, work done to run the pump, heat in and heat out are calculated using standard thermodynamic relations
  • The thermal efficiency, specific steam consumption and back work ratio of the Rankine cycle is calculated from thermodynamic relations and mentioning them in program using relations.
  • T, s and h are extracted at vapour and liquid line for plotting purpose, after 4th point for the variation you observe in the plot.
  • Saturation curve is plotted in red for saturated liquid and saturated gas in T-s diagram and h-s diagram.
  • Plots of T vs s and h vs s are created from all the points obtained from the program using the plot command and mentioning all the lables, linewidth, color and the title to the plots.
  • Results are displayed in the command window by using printf command.

Code Output -



Command Window Output -

RANKINE CYCLE SIMULATOR

1-2 is Isentropic Expansion in the turbine

2-3 is constant pressure heat removal in the condenser

3-4 is Isentropic compression in the pump

4-1 is Constant pressure heat addition in the boiler

Value of pressure at turbine inlet, p1(in bar) = 30

Value of temperature at turbine inlet, T1(in degree.C) = 400

Value of temperature at condenser inlet, p2(in bar) = 0.05

RESULTS OF IDEAL RANKINE CYCLE

At State Point 1:

p1: 30.000000 bar

T1: 400.000000 C

h1: 3231.571027 KJ/kg

s1: 6.923259 KJ/kgK

At State Point 2:

p2: 0.050000 bar

T2: 32.875490 C

h2: 2110.708212 kJ/kg

s2: 6.923259 kJ/kgK

x2: 0.814256

At State Point 3:

p3: 0.050000 bar

T3: 32.875490 K

h3: 137.765119 kJ/kg

s3: 0.476254 kJ/kgK

At State Point 4:

p4: 30.000000 bar

T4: 36.935287 K

h4: 140.776056 KJ/kg

s4: 0.476254 kJ/kgK

Turbine Work: 1120.862815 kJ/kg

Pump Work: 3.010937 kJ/kg

Wnet: 1117.851878 kJ/kg

Efficiency: 36.167131

S.S.C: 3.220462 kJ/kWh

Back Work Ratio: 0.002686

Conclusion –

Rankine cycle simulator is obtained where the values are extracted from 'XSteam' data file and following results were obtained

  • Net work done is 1117.851 KJ/KG.
  • Thermal efficiency is 36.167 %.
  • Back work ratio is 0.003

References -

  • https://www.thermopedia.com/content/1072/
  • Engineering Thermodynamics by PK Nag

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.