All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Aim: To calculate all the state variables of a rankine cycle and plot t-s and h-s diagram. Introduction: Rankine cycle: Rankine cycle is a thermodynamic cycle which is used to evaluate the performance of a steam turbine systems. Previously, it was used to study the performance of reciprocating steam engines. It…
Tanmay Pathak
updated on 13 May 2021
Aim: To calculate all the state variables of a rankine cycle and plot t-s and h-s diagram.
Introduction:
Rankine cycle: Rankine cycle is a thermodynamic cycle which is used to evaluate the performance of a steam turbine systems. Previously, it was used to study the performance of reciprocating steam engines. It is an idealized thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing phase change.
As we know, steam turbine system has four basic components. Those are boiler, steam turbine, condenser/heat exchanger and feed water pump.
Following is the simple representation of steam turbine power plant working and t-s diagram of the cycle.
As we know that a simple rankine cycle consists of four thermodynamic processes.
Process 1-2: Isentropic expansion in the turbine.
Process 2-3: Constant pressure heat rejection by the condenser.
Process 3-4: Isentropic compression in the feed water pump.
Process 4-1: Constant pressure heat addition by the boiler.
Objectives:
1. To calculate all the state points and performance evaluating parameters.
2. To plot t-s and h-s diagram of rankine cycle
Formulae to evaluate performance of the rankine cycle:
1. Isentropic expansion:
T2/T1 = (P2/P1)^1-(1/gamma)
2. Workdone by the pump(W_p):
W_p = Specific volume*(P1-p2)*100
3. Workdone by the turbine(W_t):
W_t = h1 - h2
4. Net workdone(W_net):
W_net = W_t - W_p
5. Back work ratio(W_back):
W_back = W_p/W_t
6. Heat supplied in the boiler(Q_in):
Q_in = h1 - h4
7. Heat rejected in the condenser(Q_out):
Q_out = h2 - h3
8. Thermal efficiency of a rankine cycle (therm_eff) is given by,
therm_eff = W_net/Q_in
9. Specific steam consumption (SSC):
SSC = 3600/W_net
10. Dryness fraction (X):
X = (S - Sf)/Sfg
Procedure and Description of the MATLAB code:
Note: We have a function file named as "XSteam", which contains sub-functions i.e.(formulae) required to calculate various thermodynamic properties of steam and water at various stages.
MATLAB CODE:
clear all
close all
clc
fprintf(' RANKINE CYCLE SIMULATORrn')
fprintf(' 1-2 : Isentropic expansion in the turbinern')
fprintf(' 2-3 : Constant pressure heat rejection by the condenserrn')
fprintf(' 3-4 : Isentropic compression in the pumprn')
fprintf(' 4-1 : Constant pressure heat addition by the boilerrn')
% Inputs
p1 = input('Enter the pressure at Turbine inlet (in Bar) = ');
t1 = input('Enter the temperature at the Turbine inlet (in Degree Celsius) = ');
p2 = input('Enter the pressure at the condenser (in Bar) = ');
% Variables at the inlet of steam turbine.
% State 1 calculations
h1 = XSteam('h_pt',p1,t1);
s1 = XSteam('s_pt',p1,t1);
tsat = XSteam('tsat_p',p1);
% Variables at the inlet of the condenser.
% State 2 calculations
s2 = s1; %(Since it is isentropic process)
% Enthalpy in superheated region
sg2 = XSteam('sv_p',p2);
% Enthaply in subcooled region
sf2 = XSteam('sl_p',p2);
% Enthalpy in wet region.
sfg2 = sg2 - sf2;
% To calculate dryness fraction
X2 = (s2 - sf2)/sfg2;
% To calculate the entalpy
hf2 = XSteam('hl_p',p2);
hg2 = XSteam('hv_p',p2);
hfg2 = hg2 - hf2;
h2 = hf2 + (X2*hfg2);
% To calculate the temperature.
t2 = XSteam('tsat_p',p2);
% Variables at the inlet of feed water pump.
% State 3 calculations
% To calculate the temperature.
t3 = t2; % (As the temperature is constant from process 2-3).
% To calculate the enthalpy.
p3 = p2; % (As it is constant pressure heat rejection in the condenser).
% To calculate the enthalpy.
h3 = XSteam('hl_p',p3);
% To calculate the entropy.
s3 = XSteam('sl_p',p3);
% To calculate the specific volume
sp_v = XSteam('vl_p',p3);
% To calculate the workdone by the pump.
W_p = sp_v*(p1 - p2)*100;
% To calculate the workdone by the turbine.
W_t = h1-h2;
% Variables at the inlet of boiler.
% State 4 calculations
% To calculate the pressure
p4 = p1; % (As there is constant pressure heat addition in the boiler.)
% To calculate the enthalpy
% (W_p = h4 - h3)
h4 = W_p + h3;
% To calculate the entropy
s4 = s3;
% To calculate the heat capacity at constant pressure
Cp = XSteam('cp_ps',p4,s4);
% To calculate the heat capacity at constant volume.
Cv = XSteam('cv_ps',p4,s4);
% To calculate the heat capacity ratio
gamma = Cp/Cv;
% To calculate the temperature
t4 = t3*((p4/p3)^(gamma - 1)/gamma);
% State 5 calculations (Sensible heating)
t5 = tsat;
h5 = XSteam('hL_p',p1);
s5 = XSteam('sL_p',p1);
% State 6 calculations (Latent heating)
t6 = t1;
h6 = XSteam('hV_p',p1);
s6 = XSteam('sV_p',p1);
% To calculate the net work produced in the cycle.
W_net = W_t - W_p;
% To calculate the back work ratio
W_back = W_p/W_t;
% To calculate the heat supplied by the boiler.
Q_in = h1 - h4;
% To calculate the heat rejected by the condenser.
Q_out = h2 - h3;
% To calculate the thermal efficiency of the cycle.
therm_eff = (W_net/Q_in);
% To calculate the specific steam consumption.
SSC = 3600/W_net;
% Calculations for T-S diagram
% To calculate saturation curve points.
t = linspace(0,374,1000);
for i = 1:length(t)
sf(i) = XSteam('sL_t',t(i));
hf(i)= XSteam('hL_t',t(i));
sg(i)= XSteam('sV_t',t(i));
hg(i)= XSteam('hV_t',t(i));
end
% Plotting T-S diagram
figure(1)
hold on
grid on
% Plotting the saturation curve
% Saturated liquid curve
plot(sf,t,'b');
% Saturated vapour curve
plot(sg,t,'r');
% Plotting work obtained in the turbine
plot([s1 s2],[t1 t2],'color','g');
text(s1,t1,'state 1')
text(s2,t2,'state 2')
% Plotting heat rejection in the condenser
plot([s2 s3],[t2 t3],'color','c');
text(s3,t3,'state 3')
% Plotting workdone by the pump.
plot([s3 s4],[t3 t4],'color','k');
text(s4,t4,'state 4')
% Plotting the sensible heating process (Increament in temperature but no
% phase change)
plot([s4 s5],[t4 t5],'color','r');
text(s5,t5,'state 5')
% Plotting latent heating process (phase changing process)
plot([s5 s6],[t5 tsat],'color','m');
text(s6,tsat,'state 6')
% Plotting the superheating process of steam.
plot([s6 s1],[tsat,t1],'color','c');
% Defining axis and labelling
axis([0 8 10 500])
xlabel('Enthalpy (KJ/Kg)')
ylabel('Temperature (Degree celsius)')
title ('Temperature vs Enthalpy (t-s) diagram')
legend('Saturated liquid curve','Saturated vapour curve','Turbine work', 'Const. pressure heat rejection in the condenser','Pump work','Sensible heating in the boiler','Latent heating in the boiler','Superheating in the boiler','location','northwest')
% Calculations for H-S diagram.
% Temperature for obtaining saturation curve of water.
% Plotting H-S diagram
figure(2)
hold on
grid on
% Plotting saturation curve
% Saturated liquid curve
plot(sf,hf,'b');
% Saturated vapour curve
plot(sg,hg,'r');
% Plotting all the state variables.
% Process 1-2
plot([s1 s2],[h1,h2],'g');
text(s1,h1,'state 1')
text(s2,h2,'state 2')
% Process 2-3
plot([s2 s3],[h2 h3],'y');
text(s3,h3,'state 3')
% Process 3-4
plot([s3 s4],[h3 h4],'m');
text(s4,h4,'state 4')
% Process 4-1
plot([s4 s1],[h4 h1],'c');
% Defining axis and labelling
axis([0 8 0 4000])
xlabel('Entropy (KJ/Kg K)')
ylabel('Enthalpy (KJ/Kg)')
title ('Enthalpy vs Entropy (h-s) diagram')
legend('Saturated liquid curve','saturated vapour curve','Isentropic Expansion','Heat Rejection at p = constant','Isentropic Compression','Heat Addition at p = constant','location','northwest')
% To print output
% State 1
fprintf('At state point 1:rn')
fprintf('Pressure at turbine inlet (p1) = %f barrn',p1)
fprintf('Temperature of steam at the turbine inlet (t1) = %f Deg.celsiusrn',t1)
fprintf('Enthalpy of steam at the turbine inlet (h1) = %f KJ/Kgrn',h1)
fprintf('Entropy of steam at the turbine inlet (s1) = %f KJ/Kg Krn',s1)
% State 2
fprintf('At state point 2:rn')
fprintf('Pressure at condenser inlet (p2) = %f barrn',p2)
fprintf('Temperature of steam at condenser inlet (t2) = %f Deg.celsiusrn',t2)
fprintf('Enthalpy of steam at condenser inlet (h2) = %f KJ/Kgrn',h2)
fprintf('Entropy of steam at condenser inlet (s2) = %f KJ/Kg Krn',s2)
fprintf('Dryness fraction of steam (X2) = %frn',X2)
% State 3
fprintf('At state point 3:rn')
fprintf('Pressure at the feed water pump inlet (p3) = %f barrn',p3)
fprintf('Temperature at the feed water pump inlet (t3) = %f Deg.celsiusrn',t3)
fprintf('Enthalpy of water at feed pump inlet (h3) = %f KJ/Kgrn',h3)
fprintf('Entropy of water at feed pump inlet (s3) = %f KJ/Kg Krn',s3)
% State 4
fprintf('At state point 4:rn')
fprintf('Pressure of water at the boiler inlet (p4) = %f barrn',p4)
fprintf('Temperature of water at the boiler inlet (t4) = %f Deg.celsiusrn',t4)
fprintf('Enthalpy of water at the boiler inlet (h4) = %f KJ/Kgrn',h4)
fprintf('Entropy of water at the boiler inlet (s4) = %f KJ/Kg Krn',s4)
% Outputs
fprintf('Thermal efficiency = %frn',therm_eff)
fprintf('Net work output (W_net) = %f KJ/Kgrn',W_net)
fprintf('Back work ratio = %frn',W_back)
fprintf('Specific steam consumption = %f Kg/KJrn',SSC)
Results:
A] T-S diagram of the rankine cycle.
B] H-S diagram of the rankine cycle:
C] Detailed results in the command window:
Performance evaluation:
Errors encountered:
Mostly I faced errors related to invalid calculation results or mismatched results. However, errors pertaining to MATLAB tools and commands were few.
Still I will share one of them.
1. Error due to invalid expression:
Actually, while scripting I forgot to call the function and still gave my inputs.
Command window:
Editor window:
Solution:
I called the "XSteam" function and gave my inputs then the program executed my inputs. After facing this error I carefully called function everytime when I calculated state variables.
Conclusion: In this project, all the thermodynamic properties pertaining to the rankine cycle were successfully calculated and their respective plots were resulted. The approach used in this project is to initially comprehend the basics of rankine cycle, its t-s and h-s diagram and to understand the variables that are used for evaluation. After that, start with MATLAB coding in step by step manner and run the code at specific intervals to validate working of the code. By using the given input conditions, we evaluated the efficiency of the cycle and work obtained. However, we can calculate the actual cycle efficiency and work by modifying code and accounting for loss at various stages.
References:
2. http://www.thermopedia.com/content/1072/
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 10 - Simulating Combustion of Natural Gas.
Aim: To perform and study combustion simulation of a non-premixed model. Introduction and Theory: Combustion or burning is a high-temperature exothermic redox chemical reaction between a fuel(the reductant) and an oxidant, usually, atmospheric oxygen. Complete combustion is stoichiometric concerning the…
05 Aug 2021 12:02 PM IST
Numerical Analysis of Steady and Transient Two-Dimensional Heat Conduction Problem using MATLAB.
Aim: To solve steady and unsteady two dimensional heat conduction equation using implicit and explicit methods. Objectives: 1. Write a MATLAB code to solve steady state two dimensional heat conduction equation using implicit method. 2. Write a MATLAB code to solve unsteady (transient) state two dimensional…
14 Jul 2021 10:52 AM IST
Analysis and Validation of Quasi One Dimensional De Laval Nozzle using MacCormack Method.
Aim: Simulation of quasi 1D subsonic-supersonic nozzle flow using MacCormack method. Objectives: The objective of this project is to simulate an isentropic flow through a quasi 1D subsonic-supersonic nozzle using MacCormack method for conservative and non-conservative form of governing equations. Theory:…
14 Jul 2021 09:55 AM IST
Simulation of Flow Through a Pipe in OPENFOAM and Validation with the Analytical Results.
Aim: To simulate flow through a pipe in OPENFOAM and validate the results. Objectives: 1. To validate of hydrodynamic length with the numerical result. 2. Validate the fully developed flow velocity profile with its analytical profile. 3. Validate maximum velocity and pressure drop for fully developed…
14 Jul 2021 09:33 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.