Challenge

Project 2 - Rankine cycle Simulator

Aim:

Creation of Rankine Cycle Simulator from given input and reading the data from the standard thermodynamic library of steam table.

Objective:

  1. To create a Rankine cycle simulator in MATLAB.
  2. To calculate the state point using function XSteam.
  3. To plot the T-s diagram & h-s diagram curve for the given input in the Rankine cycle.
  4. To get output in the command window for each state point in the cycle.

Introduction:

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 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) 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 to simplify calculations as such losses are usually much less significant than thermodynamic losses, especially in larger systems.

The Rankine cycle closely describes the process by which steam engines commonly found in thermal power generation plants harness the thermal energy of a fuel or other heat source to generate electricity. Possible heat sources include the combustion of fossil fuels such as coal, natural gas, or oil, renewable fuels like biomass or ethanol, nuclear fission, and concentrated solar power. Common heat sinks include ambient air above or around a facility and bodies of water such as rivers, ponds, and oceans.

The ability of a Rankine engine to harness energy depends on the relative temperature difference between the heat source and heat sink. The greater the differential, the more mechanical power can be efficiently extracted out of heat energy, as per Carnot's theorem.

The efficiency of the Rankine cycle is limited by the high heat of vaporization of the working fluid. Unless the pressure and temperature reach supercritical levels in the boiler, the temperature range that the cycle can operate over is quite small: Steam turbine entry temperatures are typically around 565 °C and condenser temperatures are around 30 °C.[citation needed] This gives a theoretical maximum Carnot efficiency for the turbine alone of about 63.8% compared with an actual overall thermal efficiency of less than 50% for typical power stations. This low steam turbine entry temperature (compared to a gas turbine) is why the Rankine (steam) cycle is often used as a bottoming cycle to recover otherwise rejected heat in combined-cycle gas turbine power stations.

Rankine engines generally operate in a closed-loop where the working fluid is reused. The water vapor with condensed droplets often seen billowing from power stations is created by the cooling systems (not directly from the closed-loop Rankine power cycle). This 'exhaust' heat is represented by the "Qout" flowing out of the lower side of the cycle shown in the T–s diagram below. Cooling towers operate as large heat exchangers by absorbing the latent heat of vaporization of the working fluid and simultaneously evaporating cooling water into the atmosphere.

While many substances can be used as the working fluid, water is usually chosen for its simple chemistry, relative abundance, low cost, and thermodynamic properties. By condensing the working steam vapor to a liquid the pressure at the turbine outlet is lowered and the energy required by the feed pump consumes only 1% to 3% of the turbine output power these factors contribute to higher efficiency for the cycle. The benefit of this is offset by the low temperatures of steam admitted to the turbine(s). Gas turbines, for instance, have turbine entry temperatures approaching 1500 °C. However, the thermal efficiency of actual large steam power stations and large modern gas turbine stations are similar.

Processes:

There are four processes in the Rankine cycle. The states are identified by numbers (in brown) in the T–s diagram.

  • 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 vapor. 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 vapor expands through a turbine, generating power. This decreases the temperature and pressure of the vapor, 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 vapor 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.

In an ideal Rankine cycle, the pump and turbine would be isentropic, i.e., the pump and turbine would generate no entropy and hence maximize the network output. Processes 1–2 and 3–4 would be represented by vertical lines on the T–s diagram and more closely resemble that of the Carnot cycle. The Rankine cycle shown here prevents the state of the working fluid from ending up in the superheated vapor region after the expansion in the turbine, which reduces the energy removed by the condensers.

The actual vapor power cycle differs from the ideal Rankine cycle because of irreversibilities in the inherent components caused by fluid friction and heat loss to the surroundings; fluid friction causes pressure drops in the boiler, the condenser, and the piping between the components, and as a result, the steam leaves the boiler at a lower pressure; heat loss reduces the network output, thus heat addition to the steam in the boiler is required to maintain the same level of network output.

Variables:

Heat flow rate to or from the system (energy per unit time)
Mass flow rate (mass per unit time)
Mechanical power consumed by or provided to the system (energy per unit time)
Thermodynamic efficiency of the process (net power output per heat input, dimensionless)
Isentropic efficiency of the compression (feed pump) and expansion (turbine) processes, dimensionless
The "specific enthalpies" at indicated points on the T–s diagram
The final "specific enthalpy" of the fluid if the turbine were isentropic
The pressures before and after the compression process

Equations:

In general, the efficiency of a simple rankine cycle can be written as

Each of the next four equations is derived from the energy and mass balance for a control volume. {\displaystyle \eta _{\text{therm}}} defines the thermodynamic efficiency of the cycle as the ratio of net power output to heat input. As the work required by the pump is often around 1% of the turbine work output, it can be simplified.

When dealing with the efficiencies of the turbines and pumps, an adjustment to the work terms must be made:

Sample output of a Basic Rankine cycle simulator:

  • Type: Basic Rankine-

Main Program:

% Rankine Cycle Simulator
% Objective of this program is to simulate the rankine cycle
% Plotting T-s and h-s diagram using data from XSteam cycle
                                                   
clear all
close all
clc                                

% Displaying
disp('Rankine Cycle')
disp('1-2 Isentropic Expansion in Turbine')
disp('2-3 Constant Pressure heat rejection')
disp('3-4 Isentropic Compression in Pump')
disp('4-1 Constant Pressure heat addition')

% Entering the input data for calculation of state points
p1 = 50;  % Pressure at Turbine inlet
T1 = 500; % Temperature at Turbine inlet
p2 = 5;  % Pressure at Condenser

% Taking data from XSteam file for state point 1
h1 = XSteam('h_pT',p1,T1);  % Enthalpy at Pressure & Temperature
s1 = XSteam('s_pT',p1,T1);  % Entropy at Pressure & Temperature

% Taking data from XSteam file for State point 2
s2 = s1; % Isentropic Expansion process
sf2 = XSteam('sV_p',p2); % Saturated liquid entropy at pres 2
sg2 = XSteam('sV_p',p2); % Saturated Vapour entropy at pres 2
x2 = (s2-sf2)/(sg2-sf2); % Vapour friction at state point 2
hf2 = XSteam('hL_p',p2); % Saturated liquid enthalpy at pres2
hg2 = XSteam('hV_p',p2); % Saturated vapour enthalpy at pres 2
h2 = hf2 + (x2*(hg2-hf2)); % Enthalpy at State point 2

% TAking data from XSteam file for state point 3
p3 = p2; % % Constant Pressure heat removal process
s3 = XSteam('sL_p',p3); % Saturated liquid entropy at pres 3
h3 = XSteam('hL_p',p3); % Saturated liquid enthalpy at pres 3

% Taking data from XSteam file dor state point 4
s4 =s3; % Isentropic Compression process
p4 = p1; % Constant Pressure heat rejection

% Work done in Turbine for the Rankine Cycle
W_T = h1-h2;

% Work done required for Pump
v3 = XSteam('vL_p',p3); % Saturated liquid vapour at pres 3
W_P = v3*(p4-p3)*100; % Work done for pump
h4 = h3-W_P; % Enthalpy at state point 4

% Net work done for Rankine cycle
W_net = W_T - W_P; 

% Heat Addition to system
Q_in = h1-h4;

%  Heat Rejection to system 
Q_out = h2-h3; 

% Thermal Efficiency of Rankine cycle
T_eff = (W_net/Q_in)*100; 

% Specific steam consumption = (Mass flow rate/Net work done)
Sp_s = (3600/W_net);

% Calculation of Temperature at all state points 2,3, & 4
T3 = XSteam('Tsat_p',p3); % Saturation Temperature at Pres 3
T2 = T3; % Constant Pressure heat addition
Cp4 = XSteam('Cp_ps',p4,s4); %Specific isobaric heat capacity
Cv4 = XSteam('Cv_ps',p4,s4);  % Specific ischoric heat capacity
k = Cp4/Cv4;
T4 = T3/((p3/p4)^((k-1)/k)); % Temperature at state point 4

% Calculation of other constanmt for Saturated liquid and vapour
T6 = XSteam('Tsat_p',p1); % Saturated temp at pres 1
s5 = XSteam('sL_p',p1); % Saturated liquid entropy at pres 1
s6 = XSteam('sV_p',p1); % Saturated vapour entropy at pres 1
h5 = XSteam('hL_p',p1); % Saturated liquid enthalpy at pres 1
h6 = XSteam('hV_p',p1); % Saturated vapour enthalpy at pres 1
T5 = T6;

% Plotting for Saturation Line
T = linspace(1,560,1000);
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 lipquid enthalpy
    hg(i) = XSteam('hV_T',T(i)); % Saturated vapour enthalpy
end

%Plotting T-s diagram for Rankine cycle
figure(1)
hold on
plot(sf,T,'Color','b','LineWidth',3)
plot(sg,T,'Color','b','LineWidth',3)
plot([s1 s2],[T1 T2],'Color','r','Linewidth',3)
plot([s2 s3],[T2 T3],'Color','r','Linewidth',3)
plot([s3 s4],[T3 T4],'Color','r','Linewidth',3)
plot([s4 s5],[T4 T5],'Color','r','Linewidth',3)
plot([s5 s6],[T5 T6],'Color','r','Linewidth',3)
s_1 = linspace(s6,s1,1000);
for j = 1:length(s_1)
    Tc(j) = XSteam('T_ps',p1,s_1(j));
end
plot(s_1,Tc,'Color','r','LineWidth',3)
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')
xlabel('Entropy(KJ/kg-K)')
ylabel('Temperature(Deg.Celcius)')
legend('Saturation Curve')

% Plotting h-s Diagram for Rankine cycle
figure(2)
hold on
plot(sf,hf,'Color','b','LineWidth',3)
plot(sg,hg,'Color','b','LineWidth',3)
plot([s1 s2],[h1 h2],'Color','r','LineWidth',3)
plot([s2 s3],[h2 h3],'Color','r','LineWidth',3)
plot([s3 s4],[h3 h4],'Color','r','LineWidth',3)
hc = linspace(h4,h5,100);
for k = 1:length(hc)
    s_c(k) = XSteam('s_ph',p1,hc(k));
end
plot(s_c,hc,'Color','r','LineWidth',3)
plot([s5 s6],[h5 h6],'Color','r','LineWidth',3)
for l = 1:length(s_1)
    h_c(l) = XSteam('h_ps',p1,s_1(l));
end
plot(s_1,h_c,'color','r','LineWidth',3)
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')
xlabel('Entropy(KJ/kg-K)')
ylabel('Enthalpy(KJ/kg)')
legend('Saturation Curve')

% Displaying Results in Command Window
disp('Results');
disp('At State point 1:n');
fprintf('p1 = %8.3f bar',p1);
fprintf('T1 = %8.3f Deg.C',T1);
fprintf('h1 = %8.3 KJ/kg',h1);
fprintf('s1 = %8.3f KJ/kg-K',s1);
fprintf('At State point 2:n');
fprintf('p2 = %8.3f bar',p2);
fprintf('T2 = %8.3f Deg.C',T2);
fprintf('h2 = %8.3 KJ/kg',h2);
fprintf('s2 = %8.3f KJ/kg-K',s2);
fprintf('At State point 3:n');
fprintf('p3 = %8.3f bar',p3);
fprintf('T3 = %8.3f Deg.C',T3);
fprintf('h3 = %8.3 KJ/kg',h3);
fprintf('s3 = %8.3f KJ/kg-K',s3);
fprintf('At State point 4:n');
fprintf('p4 = %8.3f bar',p4);
fprintf('T4 = %8.3f Deg.C',T4);
fprintf('h4 = %8.3 KJ/kg',h4);
fprintf('s4 = %8.3f KJ/kg-K',s4);
fprintf('Turbine Work: %8.3f KJ/kg',W_T);
fprintf('Pump Work: %8.3f KJ/kg',W_P);
fprintf('Nwet Work: %8.3f KJ/kg',W_net);
fprintf('Thermal Efficiency: %8.3f percentage',T_eff);
fprintf('S.S.C: %8.3f KJ/KW',Sp_s);


From the above diagram as we can see along with the saturation curve point 1 start with a turbine from which heat rejection is started which is again an isentropic process. The steam is get cooled in a condenser & in form of saturated liquid as it is under the curve. Then it was pumped to enter in the boiler where its temperature is increased to change it from saturated liquid to saturated vapor form.

Steps Taken:

  • The creation of the Rankine cycle simulator starts with some input values which are required to calculate the other state point in the cycle eventually.
  • The Rankine cycle process is displayed in the command window and then inputs are entered which are inlet pressure for the turbine, temp at turbine inlet & pres at the condenser.
  • Then we are using XSteam function file for reading state points. First, we get the value of enthalpy and entropy at state point 1 from the XSteam function file.
  • As process from 1-2 is isentropic compression the entropy at point 1 is equal to point 2. The term (s_pT, p1, T1) refers to entropy at pres and temp of point 1.
  • The term 'sg' and 'sf' are referred to saturated liquid and saturated vapor entropy respectively. This value is used to calculate other functions according to mathematical relations.
  • Similarly, other points are taken from XSteam function file which is necessary to calculate other parameters. After that work done in the turbine and pump is calculated for further getting the net work done of the Rankine cycle.
  • After calculating the net work done the efficiency of the Rankine cycle is calculated along with specific steam consumption which is steam consumed by a locomotive cylinder per unit of output of work done.
  • Then temperature at each point of the cycle is calculated using input taken from the start of the program and data taken from XSteam file. For a given temp range from lower to higher entropy points are calculated to create the T-s plot. Similarly, another for loop is used to create the saturation curve in each plot.
  • Then plotting is done respectively for T-s & h-s graph in the Rankine cycle and each state point value has been put in the command window.

Conclusion:

So, we have created the Rankine cycle simulator for the given input, which we have taken from the data from XSteam function file.

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.

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.