Project 2 - Rankine cycle Simulator
Rankine Cycle Simulator
Aim:
Creation of Rankine cycle simulator from given input and reading the data from a standard thermodynamic library of steam table.
Objective:
- To create a Rankine Cycle simulator in MATLAB.
- To calculate the state point using the function XSteam.
- To plot the T-S and H-S curve for a given input in the Rankine Cycle.
- To get output in the command window for each state point in the cycle.
Description:
The Rankine cycle is one of the vapor-powered cycle. This cycle is somewhat different than gas-powered cycle in which working fluid remains gas throughout the entire cycle. In vapor powered cycle the working fluid is steam because of its many desirable characteristics such as low cost of production, availability, and high enthalpy of vaporization. There are many impracticalities associated with Carnot cycle which can be eliminated by superheating the steam and condense in condenser which makes it best for nuclear power plants and other steam related power generation sources.
The processes in Rankine cycle are given as:
- Isentropic Compression in Pump.
- Constant pressure heat addition in the boiler.
- Isentropic expansion in a turbine.
- Constant pressure heat rejection in condenser.

Water enters the boiler as
a compressed liquid at state 2 and leaves as a superheated vapor at state 3.
The boiler is a large heat exchanger where the heat originating from combustion
gases, nuclear reactors, or other sources is transferred to the water
essentially at constant pressure. The
boiler, together with the section where the steam is superheated (the
superheater), is often called the steam generator.
The superheated vapor at
state 3 enters the turbine, where it expands isentropically and produces work
by rotating the shaft connected to an electric generator. The pressure and the
temperature of steam drop during this process to the values at state 4, where
steam enters the condenser. At this
state, steam is usually a saturated liquid-vapor mixture with a high quality.
Steam is condensed at constant pressure in the condenser, which is a large heat
exchanger, by rejecting heat to a cooling medium such as a lake, a river, or
the atmosphere. Steam leaves the condenser as saturated liquid and enters the
pump, completing the cycle. In areas where water is precious, the power plants
are cooled by air instead of water. This method of cooling, which is also used
in car engines, is called dry cooling.
Remembering that the area under the process curve on a T-s diagram represents the heat transfer for internally reversible processes, we see that the area under process curve 2-3 represents the heat transferred to the water in the boiler, and the area under the process curve 4-1 represents the heat rejected in the condenser. The difference between these two is the net work produced during the cycle.
All the four components of the Rankine cycle are steady flow devices hence the process regarding this device can be evaluated as a steady state process. The steady-state flow energy equation per unit mass of steam reduces to:
(qIn−qout)+(WIn−Wout)=he−h
i
The boiler and condenser are not involved in any mechanical work whereas the pump and turbine are assumed to be isentropic in nature while working throughout the cycle, The conservation of energy relation for each device can be expressed as:

- Code Explanation:-
- 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 turbine, temperature at turbine inlet, and pressure at condenser.
- Then we are using XSteam function file for reading the state point. 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 pressure and temperature point 1.
- The term ‘sg’ and ‘sf’ are referred to saturated liquid and saturated vapor entropy respectively. This value is used to calculate other function according to mathematical relations.
- Similarly, other points are taken from XSteam function file which are necessary to calculate other parameters. After that work done in turbine and pump are calculated for further getting the net work done 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 temperature 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 and H-s graph in the Rankine cycle and each state point value has been put in the command window.
The code for Rankine Cycle Simulator is given as:
clear all
close all
clc
Inference of Plot:
To make the graph more deliberate we are changing some value in the inputs by increasing the inlet pressure and temperature along with condenser pressure also which results in the following graphs.

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

As we can see from the above plot the steam entropy changes during the process with respect to enthalpy. As the heat is added in the system the entropy has been increased and similarly, as the heat is removed from the system the entropy drops at similar rates.
For the parameters given in the challenge, the graph will look like this:


The values for the state point in command windows are given as:
For Inlet pressure in Turbine as = 50 bar
Inlet temperature in Turbine = 500 deg.cel
Pressure in condenser = 5 bar

For Input given in challenge:
For Inlet pressure in Turbine as = 30 bar
Inlet temperature in Turbine = 400 deg.cel
Pressure in condenser = 0.05 bar

From the two different input value it is seen that increasing the pressure and temperature in the turbine results in lowering the efficiency of the Rankine cycle.
Conclusion:
So, we have created the Rankine cycle simulator for the given input, in which we have taken the data from XSteam function file.