Project 2 - Rankine cycle Simulator
Rankine cycle :
The Rankine cycle is a model used to predict the performance of steam turbine systems. It was also used to study the performance of reciprocating steam engines. The Rankine cycle is an idealized thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing phase change. It is an idealized cycle in which friction losses in each of the four components are neglected. The heat is supplied externally to a closed loop, which usually uses water as the working fluid.
There are basically four processes in the Rankine cycle.
1. 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. In other words Process 1-2 is [Isentropic compression]
2. 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 vapour. 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. In other words Process 2-3 is [Constant pressure heat addition in boiler]
3. Process 3–4: The dry saturated vapour expands through a turbine, generating power. This decreases the temperature and pressure of the vapour, and some condensation may occur. The output in this process can be easily calculated using the chart or tables noted above. In other words Process 3-4 is [Isentropic expansion]
4. Process 4–1: The wet vapour then enters a condenser, where it is condensed at a constant pressure to become a saturated liquid. In other words Process 4-1 is [Constant pressure heat rejection in condenser]
In general, the efficiency of a simple rankine cycle can be written as
Actaul PV, TS and HS diag. of Rankine Cycle :
Matlab program to create a Rankine Cycle Simulator with explaination :
%The program begins with the commands given below;
clc
clear all
close all
%A series of information of rankine cycle is processed to command window using fprintf command.
fprintf('n RANKINE CYCLE STIMULATOR ');
fprintf('nn1-2 Isentropic Expansion in turbine');
fprintf('n2-3 Constant Pressure Heat Rejection in the Condenser');
fprintf('n3-4 Isentropic Compression in the Pump');
fprintf('n4-1 Constant Pressure Heat Addition in the Boiler');
%Inputs to the program which we would need to difine while executing the program in the command window
p1 = input(' Pressure at the Turbine inlet (bar): ');
t1 = input(' temp at the Turbine inlet (celsius): ');
p2 = input(' Pressure at the condenser: ');
%@stage1 Turbine Inlet
%p1 and t1 are given and variables h_pT and s_pT are the default variables whose value is obtained from the XSteam file.
h1 = XSteam('h_pT',p1,t1);
s1 = XSteam('s_pT',p1,t1);
%@stage2 Condenser Inlet
%p2 is given
s2 = s1;
sf2 = XSteam('sL_p',p2);
sg2 = XSteam('sV_p',p2);
hf2 = XSteam('hL_p',p2);
hg2 = XSteam('hV_p',p2);
x2 = (s2 - sf2)/(sg2 - sf2);
h2 = hf2 + (x2*(hg2 - hf2));
%@stage3 Pump Inlet
p3 = p2;
h3 = XSteam('hL_p',p3);
s3 = XSteam('sL_p',p3);
t3 = XSteam('Tsat_p',p3);
t2 = t3;
%@stage4 Boiler Inlet
p4 = p1;
s4 = s3;
h4 = XSteam('h_ps',p4,s4);
cp4 = XSteam('Cp_ps',p4,s4);
cv4 = XSteam('Cv_ps',p4,s4);
lambda = cp4/cv4;
t4 = t3/((p3/p4)^((lambda-1)/lambda));
t5 = XSteam('Tsat_p',p1);
t6 = t5;
s5 = XSteam('sL_p',p1);
s6 = XSteam('sV_p',p1);
h5 = XSteam('hL_p',p1);
h6 = XSteam('hV_p',p1);
%The formulaes of the state variables and other depending factors are referred from a standard reference book by PK Nag.
%Turbine Work
Wt = h1-h2;
%Pump Work
Wp = h4-h3;
%Net Work
W = Wt-Wp;
%Heat in and out of the system
Q_in = h1-h4;
Q_out = h2-h3;
%Thermal Efficiency
ntherm = (W/Q_in)*100;
%Steam Rate (kg/kWh)
SSC = 3600/W;
%Back Work Ratio
BWR = (h1-h4)/(h2-h3);
%To plot Saturation Curve
T = linspace(1,400,500);
for i = 1:length(T)
h_l(i) = XSteam('hL_T',T(i));
h_v(i) = XSteam('hV_T',T(i));
s_l(i) = XSteam('sL_T',T(i));
s_v(i) = XSteam('sV_T',T(i));
end
%Plotting TS Diag
figure(1)
hold on
title('T-S Diagram')
plot([s1 s2],[t1 t2],'linewidth',3,'color','b')
plot([s2 s3],[t2 t3],'linewidth',3,'color','b')
plot([s3 s4],[t3 t4],'linewidth',3,'color','b')
plot([s4 s5],[t4 t5],'linewidth',3,'color','b')
plot([s5 s6],[t5 t6],'linewidth',3,'color','b')
xlabel('Entropy (kJ/KgK)');
ylabel('Temperature (deg C)');
s_1 = linspace(s6,s1,500);
for j = 1:length(s_1)
t_1(j) = XSteam('T_ps',p1,s_1(j));
end
plot(s_1,t_1,'linewidth',3,'color','b')
plot(s_l,T,'linewidth',1.5,'color','r')
plot(s_v,T,'linewidth',1.5,'color','r')
%Annotations
text(s1,t1,'1','fontsize',15);
text(s2,t2,'2','fontsize',15);
text(s3,t3,'3','fontsize',15,'verticalalignment','top');
text(s4,t4,'4','fontsize',15,'verticalalignment','bottom');
text(s5,t5,'5','fontsize',15,'verticalalignment','bottom');
text(s6,t6,'6','fontsize',15,'verticalalignment','bottom');
figure(2)
hold on
title('H-S Diagram')
plot([s1 s2],[h1 h2],'linewidth',2,'color','b')
plot([s2 s3],[h2 h3],'linewidth',2,'color','b')
plot([s3 s4],[h3 h4],'linewidth',2,'color','b')
h_4 = linspace(h4,h5,500);
for k = 1:length(h_4)
s_4(k) = XSteam('s_ph',p1,h_4(k));
end
h_6 = linspace(h6,h1,500);
for m = 1:length(h_6)
s_6(m) = XSteam('s_ph',p1,h_6(m));
end
plot(s_4,h_4,'linewidth',2,'color','b')
plot([s5 s6],[h5 h6],'linewidth',2,'color','b')
plot(s_6,h_6,'linewidth',2,'color','b')
xlabel('Specific Entropy (kJ/KgK)');
ylabel('Specific Enthalpy (kJ/Kg)');
plot(s_l,h_l,'linewidth',1.5,'color','r')
plot(s_v,h_v,'linewidth',1.5,'color','r')
%Annotations
text(s1,h1,'1','fontsize',15);
text(s2,h2,'2','fontsize',15);
text(s3,h3,'3','fontsize',15,'verticalalignment','top');
text(s4,h4,'4','fontsize',15,'verticalalignment','bottom');
text(s5,h5,'5','fontsize',15,'verticalalignment','bottom');
text(s6,h6,'6','fontsize',15,'verticalalignment','bottom');
%Results Window
fprintf('nRESULTSnn');
fprintf('At Stage Point 1 :n');
fprintf('T1=%f Deg Celsisus',t1);
fprintf('P1=%f Barn',p1);
fprintf('H1=%f kJ/Kgn',h1);
fprintf('S1=%f kJ/KgKnn',s1);
fprintf('At Stage Point 2 :n');
fprintf('T2=%f Deg Celsisus',t2);
fprintf('P2=%f Barn',p2);
fprintf('H2=%f kJ/Kgn',h2);
fprintf('S2=%f kJ/KgKnn',s2);
fprintf('At Stage Point 3 :n');
fprintf('T3=%f Deg Celsisus',t3);
fprintf('P3=%f Barn',p3);
fprintf('H3=%f kJ/Kgn',h3);
fprintf('S3=%f kJ/KgKnn',s3);
fprintf('At Stage Point 4 :n');
fprintf('T4=%f Deg Celsisus',t4);
fprintf('P4=%f Barn',p4);
fprintf('H4=%f kJ/Kgn',h4);
fprintf('S4=%f kJ/KgKnn',s4);
fprintf('Work done by Turbine is : %f kJ/Kgn',Wt);
fprintf('Work done by Pump is : %f kJ/Kgn',Wp);
fprintf('Net Work done on the system : %f kJ/Kgn',W);
fprintf('Specific Steam Consumption is : %f Kg/kWhn',SSC);
%Calculating the net thermal efficiency and the BWR
fprintf('Net Thermal Efficiency of the System is : %fn',ntherm);
fprintf('The BWR is found to be : %fn',BWR);
Output Plots of T-S and H-S Diagram :
Screenshot of the output command window screen :
Required Output values from the program :
- Net Work Output = 1117.865709 kJ/Kg
- Back Work Ratio = 1.566598
- Net Thermal Efficiency = 36.167417%
References :
1. https://en.wikipedia.org/wiki/Rankine_cycle
2. https://energyeducation.ca/encyclopedia/Rankine_cycle
3. https://www.sciencedirect.com/topics/earth-and-planetary-sciences/rankine-cycle