Project 2 - Rankine cycle Simulator
Aim: Create a Rankine Cycle Simulator using OCTAVE/MATLAB.
Objective :
- The code should calculate the state points of the Rankine Cycle (any type of your choice) based on user inputs.
- Then, plot the corresponding T-s and h-s plots for the given set of inputs. Title and axes labels are a must, while legends could be used if necessary.
- The presentation of your code will be taken into consideration while grading. Labelling sections of your code using comments is appreciated.
- Attach a report explaining the working of a rankine cycle simulator and also the research done by you.
Theory :
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.
Expalanation of the code :
- We start the program by reading about the rankine cycle and the given data of the XSteam.
- First, we need input data of pressure at turbine inlet, the temperature at turbine inlet, the pressure at condenser inlets.
- Now we return the pressure and the temp by using the above given data and XSteam.
- We further simplify using the same data and the study over the rankine cycle.
- By all the study we calculate saturated liquid and saturated vapour through the plots
- Then we claculate the total work, workdone on the turbine and workdone on the pump.
- We also calculate the efficiency and the specific steam consumption
- After the 4th stage of variation, we observe the plot by extracting the temp enthalpy and entropy
- Plotting graph of temp Vs enthalpy, Enthalpy vs Entropy while giving them line color and linewidth
- As the input cjanges the graph change and the results will be displayed on the window command.
Main Code :
plot(sf, T, 'r', 'LineWidth',1)
plot(sg, T, 'r', 'LineWidth',1)
plot([s1 s2],[T1 T2], 'b','LineWidth',2)
plot([s2 s3],[T2 T3], 'b','LineWidth',2)
plot([s3 s4],[T3 T4], 'b','LineWidth',2)
plot([s4 s5],[T4 T5], 'b','LineWidth',2)
plot([s5 s6],[T5 T6], 'b','LineWidth',2)
plot(sc1, Tc1, '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')
plot(sf, hf, 'K','LineWidth',1)
plot(sg, hg, 'K','LineWidth',1)
plot([s1 s2], [h1 h2],'r', 'LineWidth',2)
plot([s2 s3], [h2 h3],'r', 'LineWidth',2)
plot([s3 s4], [h3 h4],'r', 'LineWidth',2)
plot(sch, hc, 'r', 'LineWidth',2)
plot([s5 s6], [h5 h6], 'r', 'LineWidth',2)
plot(sc1, hc1, 'r','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')
Results and Plots :


References :
https://thermopedia.com/content/1072