RANKINE CYCLE
AIM: Write a code to calculate the state points of the Rankine Cycle (any type of your choice) based on user inputs.
OBJECTIVE:
- 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.
- Attach a report explaining the working of a rankine cycle simulator.
- Calculate Net work output
- Calculate Back work ratio
THEORY:
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. The Rankine cycle is named after William John Macquorn Rankine, a Scottish polymath professor at Glasgow University.
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) in order 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 boiler, completing the cycle. Friction losses throughout the system are often neglected for the purpose of simplifying calculations as such losses are usually much less significant than thermodynamic losses, especially in larger systems.

1 - 2 : Iscentropic Expansion in Turbine
2 - 3 : Constant Pressure Heat Rejection in Condensor
3 - 4 : Isentropic Compression in Pump
4 - 1 : Constant Pressure Heat Addition in Boiler
In process 1 - 2 Iscentropic Expansion happens in the turbine where the steam from the boiler is converted into mechanical energy, In process 2 - 3 Constant pressure heat rejection takes place where the vapour is converted to liquid inside a condensor. In process 3 - 4 Iscentropic Compression happens in the Pump where the pressure increases and the liquid is fed to the boiler. In process 4 - 1 Constant Pressure Heat addition takes place inside the boiler from where the superheated steam is fed to the Turbine.
THERMODYNAMIC EQUATIONS AND FORMULAE:
For Iscentropic Expansion:

For Net Work(W_net) and Back Work Ratio(Bw_ratio):
For Thermal Efficiency(ηth)

DESCRIPTION OF PROGRAM:
1) The given Inputs are entered.
2) Using the Xsteam table and the thermodynamic equations, the various state variables such as Pressure,Temperature, Enthalpy, Entropy are calculated at state points.
3) The Net work done (W_net), Back work ratio and Thermal efficiency of the system are calculated.
4) Graphs are plotted to get T - S and H - S diagram of the rankine cycle.
MAIN CODE:
%RANKINE CYCLE
clear all
close all
clc
%Initializing Variables
gamma = 1.4;
disp(' RANKINE CYCLE ')
disp('1-2 is Isentropic Expansion in the Turbine');
disp('2-3 is Constant Pressure Heat rejection by the Condensor');
disp('3-4 is Isentropic Expansion in the Pump');
disp('4-1 is Constant Pressure Heat addition to the Boiler');
%Inputs
fprintf('\n');
disp(' INPUTS ')
P1 = input('Enter the Pressure at Turbine Inlet(bar):');
T1 = input('Enter the Temperature at the turbine inlet(degree C):');
P2 = input('Enter the Pressure at the Condensor(bar):');
fprintf('\n');
%Using the XSteam functions, the enthalpy and entropy at various points can be calculated:
%Calculating Enthalpy(h) and Entropy(s) at point 1.
H1 = XSteam('h_pt',P1,T1);
S1 = XSteam('s_pt',P1,T1);
%Calculating Pressure(P),Enthalpy(h) and Entropy(s) at point 2:
%Since Isentropic Expansion Entropies are same:
S2 = S1;
%For Isentropic Expansion (T2/T1) = (P2/P1)^(1-(1/gamma)):
T2 = T1*(P2/P1)^(1-(1/gamma));
H2 = XSteam('h_pt',P2,T2);
%Calculating Pressure(P),Enthalpy(h) and Entropy(s) at point 3:
%Since Constant Pressure Heat Removal:
P3 = P2;
T3 = T2;
H3 = XSteam('hL_T',T3);
S3 = XSteam('sL_T',T3);
%Calculating Pressure(P),Enthalpy(h) and Entropy(s) at point 4:
%Since Isentropic Compression Entropies are same:
S4 = S3;
%Since Constant Pressure Process:
P4 = P1;
T4 = XSteam('T_ps',P4,S4);
H4 = XSteam('h_pT',P4,T4);
H41 = XSteam('hL_p',P4);
S41 = XSteam('sL_p',P4);
H42 = XSteam('hV_p',P4);
S42 = XSteam('sV_p',P4);
T41 = XSteam('T_hs',H41,S41);
T42 = XSteam('T_hs',H42,S42);
%Calculating the Entropy and Enthalpy at the saturation curve:
temp = linspace(0,500,600);
for i = 1:length(temp)
sv(i) = XSteam('sV_T',temp(i));
sl(i) = XSteam('sL_T',temp(i));
hv(i) = XSteam('hV_T',temp(i));
hl(i) = XSteam('hL_T',temp(i));
end
%Calculating Net Work Output(W_net):
W_t = H1 - H2;
W_p = H4 - H3;
W_net = W_t - W_p;
%Calculating Back Work Ratio:
Bw_ratio = (W_p/W_t)*100;
%Calculating the Thermal efficiency:
Q_in = H1 - H4;
eff_thermal = (W_net/Q_in)*100;
%Calculating Specific Steam Consumption:
%1J = 3600Kg/s
SSC = 3600/W_net;
%Displaying Results in the command window:
disp(' RESULTS ');
P1 = P1;
T1 = T1;
P2 = P2;
disp('At Stage Point 1');
N1 = sprintf('Pressure at 1 is %.3f bar',P1);
disp(N1);
N2 = sprintf('Temperature at 1 is %.3f C',T1);
disp(N2);
N3 = sprintf('Enthalpy at 1 is %.3f KJ/Kg',H1);
disp(N3);
N4 = sprintf('Entropy at 1 is %.3f KJ/Kg K',S1);
disp(N4);
fprintf('\n')
disp('At Stage Point 2');
N11 = sprintf('Pressure at 2 is %.3f bar', P2);
disp(N11);
N21 = sprintf('Temperature at 2 is %.3f C',T2);
disp(N21);
N31 = sprintf('Enthalpy at 2 is %.3f KJ/Kg',H2);
disp(N31);
N41 = sprintf('Entropy at 2 is %.3f KJ/Kg K',S1);
disp(N41);
fprintf('\n')
disp('At Stage Point 3');
N12 = sprintf('Pressure at 3 is %.3f bar', P3);
disp(N12);
N22 = sprintf('Temperature at 3 is %.3f C',T3);
disp(N22);
N32 = sprintf('Enthaply at 3 is %.3f KJ/Kg',H3);
disp(N32);
N42 = sprintf('Entropy at 3 is %.3f KJ/Kg K',S3);
disp(N42);
fprintf('\n')
disp('At Stage Point 4');
N13 = sprintf('Pressure at 4 is %.3f bar', P4);
disp(N13);
N23 = sprintf('Temperature at 4 is %.3f C',T4);
disp(N23);
N33 = sprintf('Enthaply at 4 is %.3f KJ/Kg',H4);
disp(N33);
N43 = sprintf('Entropy at 4 is %.3f KJ/Kg K',S4);
disp(N43);
fprintf('\n')
N14 = sprintf('Work og turbine is %.3f KJ/Kg',W_t);
disp(N14);
N15 = sprintf('Work of pump is %.3f KJ/Kg',W_p);
disp(N15);
N16 = sprintf('Net Work done is %.3f KJ/Kg',W_net);
disp(N16);
N17 = sprintf('Thermal Efficiency is %.2f percent',eff_thermal);
disp(N17);
N18 = sprintf('Specific Steam Consumption is %.2f Kg/KWh',SSC);
disp(N18);
N19 = sprintf('Back Work Ratio is %.2f percent',Bw_ratio);
disp(N19);
%Plotting the graph between TEMPERATURE V/S ENTROPY
figure(1)
plot([S1 S2],[T1 T2],[S2 S3],[T2 T3],[S3 S4],[T3 T4],[S4 S41],[T4 T41],[S41 S42],[T41 T42],[S42 S1],[T42 T1],'marker','*','color','r')
hold on
plot(sv,temp)
plot(sl,temp)
grid on
axis([0 10 0 400])
title('T - S DIAGRAM');
xlabel('Entropy (S) [KJ/Kg K]')
ylabel('Temperature (T) [K]')
%Plotting the graph between ENTHALPY V/S ENTROPY
figure(2)
plot([S1 S2],[H1 H2],[S2 S3],[H2 H3],[S3 S4],[H3 H4],[S4 S1],[H4 H1],'marker','*','color','g')
hold on
plot(sv,hv)
plot(sl,hl)
grid on
title('H - S DIAGRAM');
xlabel('Entropy (S) [KJ/Kg K]')
ylabel('Enthalpy [KJ]')
COMMENTS THROWN IN COMMAND WINDOW:
RANKINE CYCLE
1-2 is Isentropic Expansion in the Turbine
2-3 is Constant Pressure Heat rejection by the Condensor
3-4 is Isentropic Expansion in the Pump
4-1 is Constant Pressure Heat addition to the Boiler
INPUTS
Enter the Pressure at Turbine Inlet(bar):30
Enter the Temperature at the turbine inlet(degree C):400
Enter the Pressure at the Condensor(bar):0.05
RESULTS
At Stage Point 1
Pressure at 1 is 30.000 bar
Temperature at 1 is 400.000 C
Enthalpy at 1 is 3231.571 KJ/Kg
Entropy at 1 is 6.923 KJ/Kg K
At Stage Point 2
Pressure at 2 is 0.050 bar
Temperature at 2 is 64.314 C
Enthalpy at 2 is 2620.455 KJ/Kg
Entropy at 2 is 6.923 KJ/Kg K
At Stage Point 3
Pressure at 3 is 0.050 bar
Temperature at 3 is 64.314 C
Enthaply at 3 is 269.206 KJ/Kg
Entropy at 3 is 0.885 KJ/Kg K
At Stage Point 4
Pressure at 4 is 30.000 bar
Temperature at 4 is 64.446 C
Enthaply at 4 is 272.229 KJ/Kg
Entropy at 4 is 0.885 KJ/Kg K
Work og turbine is 611.116 KJ/Kg
Work of pump is 3.023 KJ/Kg
Net Work done is 608.093 KJ/Kg
Thermal Efficiency is 20.55 percent
Specific Steam Consumption is 5.92 Kg/KWh
Back Work Ratio is 0.49 percent
RESULTS:
- The Performance of Heat engine was calculated and following Observation were made:
1) Net Work = 608.093 KJ/Kg
2) Thermal Efficiency is 20.55 %
3) Back Work Ratio is 0.49 %
- The T - S and H - S performance curves of the Rankine cycle were plotted.
PLOTS:
Plot of T - S Diagram:

Plot of H - S Diagram:
