Challenge

Rankine Cycle Simulator

1.AIM:

  • Create a Rankine Cycle Simulator to solve it according to User Inputs.

2. OBJECTIVES OF THE PROJECT:

  • The program should work according to user inputs.
  • Plot T-S & H-S diagram of Rankine Cycle for given Inputs.
  • To calculate State Points of Rankine Cycle.
  • To Calculate:
    • NetWork Output
    • Back Work Ratio
  • For this Report, the Inputs were taken as:
    • Turbine Inlet temperature = 400° C (673.15° K)
    • Turbine Inlet Pressure = 30 bars (3 MPa)
    • Turbine Outlet Pressure = 0.05 bars (5 KPa) = Condenser Inlet Pressure


3. THEORY & GOVERNING EQUATIONS:

  • The Rankine cycle is the basis of all large steam power plants. In coal-fired power plants, high-temperature, high-pressure steam is produced by converting the chemical energy stored in the coal into thermal energy and transferring the energy to the working fluid (e.g., water), which passes through the boiler to produce the steam. The steam from the boiler is expanded in a series of high- and low-pressure steam turbines, which convert the energy into mechanical shaft work to drive an electric generator and to produce electricity. After the last turbine stage, the steam is routed to a condenser, and the condensate is then pumped back into the boiler, repeating the cycle.
  • For the designed program the Rankine Cycle operates in the following steps:
  • 1-2 Isentropic Expansion - The vapor is expanded in the turbine thus producing work that 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%.
  • 2-3 Isobaric Heat Rejection - The vapor-liquid mixture leaving the turbine 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.
  • 3-4 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.
  • 4-1 Isobaric Heat Transfer - High-pressure liquid enters the boiler from the feed pump and is heated to saturation temperature. Further addition of energy causes evaporation of the liquid until it is fully converted to supersaturated steam.
  • Types of Rankine Cycles:
    • Standard Rankine Cycle.
    • Superheated Rankine Cycle.
    • Reheated Rankine Cycle.
    • Regenerative Rankine Cycle.
  • Formulas related to Rankine cycle –
    • Heat Addition`( q_a ) = h1-h4`
    • Heat Rejection `( q_r ) = h2-h3`
    • Work done by Turbine `(w_t ) = h1-h2`
    • Work taken by Pump `( w_p ) = h4-h3`
    • Thermal Efficiency `η_(thermal)=(w_t -w_p)/q_a`
    • NetWork Output `( w_n ) = w_t -w_p`
    • Back Work Ratio`( BWR ) = w_p/w_t`
    • Specific Steam Consumption
      • `h1` = Enthalpy at Turbine Inlet
      • `h2` = Enthalpy at Turbine Outlet
      • `h3` = Enthalpy at Pump Inlet
      • `h4` = Enthalpy at Pump Outlet
      • `w_t` = Work done by Turbine
      • `w_p` = Work taken by Pump

  • T-S Diagram for Water (Working Fluid used for the program)
  • H-S Diagram for Water (Working Fluid used for the program)

4. BODY OF THE CONTENT:

  • MATLAB Programming language is used.
  • Main Program/Code
    • File Name : Rankine_Cycle.m
close all
clear all
clc

%Displaying Rankine Cycle Process.
fprintf(   '                    Rankine Cycle Simulator                    ');
fprintf('n Process 1-2 is Isentropic Expansion in the Turbine');
fprintf('n Process 2-3 is Constant Pressure Heat Rejection by the Condenser');
fprintf('n Process 3-4 is Isentropic Compression in the Pump');
fprintf('n Process 4-1 is Constant Pressure Heat Addition by the Boiler nn');

%Taking Inputs from User.
p1=input(' Enter the Pressure at Turbine Inlet(in bar)    : '); %Collecting P1 value from user.
T1=input(' Enter the Temperature at Turbine Inlet(in degC): '); %Collecting T1 value from user.
p2=input(' Enter the Pressure at Turbine Outlet(in bar)   : '); %Collecting P2 value from user.

%Creating T-S curve & H-S curve.
for i=1:1000 %Defining No. of points on the curve.
    temp=linspace(0,1.5*T1,1000); %Defining temperature range and total data points between them.
    S_L(i)=XSteam('sL_T',temp(i)); %Collecting Saturated Fluid Entropy values within temperature range.
    S_V(i)=XSteam('sV_T',temp(i)); %Collecting Saturated Gas Entropy values within temperature range.
    H_L(i)=XSteam('hL_T',temp(i)); %Collecting Saturated Fluid Enthalppy values within temperature range.
    H_V(i)=XSteam('hV_T',temp(i)); %Collecting Saturated Gas Enthalpy values within temperature range.
end %Ending FOR function.


%Calculating State Values at State Point 1.
s1=XSteam('s_pT',p1,T1); %Collecting Entropy value at P1.
s_l1=XSteam('sL_p',p1); %Collecting Saturated Fluid Entropy value at P1.
s_v1=XSteam('sV_p',p1); %Collecting Saturated Gas Entropy value at P1.
h_l1=XSteam('hL_p',p1); %Collecting Saturated Fluid Enthalpy value at P1.
h_v1=XSteam('hV_p',p1); %Collecting Saturated Gas Enthalpy value at P1.
T_sat1=XSteam('Tsat_p',p1); %Collecting Saturated Temperature value at P1.
X1=((s1-s_l1)/(s_v1-s_l1)); %Calculating Dryness Fraction Value.
h1=(h_l1+(X1*(h_v1-h_l1))); %Calculating Enthalpy Value at P1.
if X1>1 %Using IF condition to calculate enthalpy for dryness fraction greater than 1.
    h1=XSteam('h_ps',p1,s1); %Collecting Enthalpy value by using P1 and S1 values.
end %Ending IF function.

%Calculating State Values at State Point 2.
s2=s1; %Collecting Entropy value at P2.
s_l2=XSteam('sL_p',p2); %Collecting Saturated Fluid Entropy value at P2.
s_v2=XSteam('sV_p',p2); %Collecting Saturated Gas Entropy value at P2.
h_l2=XSteam('hL_p',p2); %Collecting Saturated Fluid Enthalpy value at P2.
h_v2=XSteam('hV_p',p2); %Collecting Saturated Gas Enthalpy value at P2.
T_sat2=XSteam('Tsat_p',p2); %Collecting Saturated Temperature value at P2.
T2=XSteam('T_ps',p2,s2); %Collecting Temperature value by using P2 and S2 values.
X2=((s2-s_l2)/(s_v2-s_l2)); %Calculating Dryness Fraction Value.
h2=(h_l2+(X2*(h_v2-h_l2))); %Calculating Enthalpy Value at P2.
if X2>1 %Using IF condition to calculate enthalpy for dryness fraction greater than 1.
    h2=XSteam('h_ps',p2,s2); %Collecting Enthalpy value by using P2 and S2 values.
end %Ending IF function.

%Calculating State Values at State Point 3.
p3=p2; %Collecting Pressure value at P3.
s3=XSteam('sL_p',p3); %Collecting Saturated Fluid Entropy value at P3.
T3=XSteam('Tsat_p',p3); %Collecting Saturated Temperature value at P3.
h3=XSteam('hL_p',p3); %Collecting Saturated Fluid Enthalpy value at P3.
X3=((s3-s_l2)/(s_v2-s_l2)); %Calculating Dryness Fraction Value.

%Calculating State Values at State Point 4.
p4=p1; %Collecting Pressure value at P4.
s4=s3; %Collecting Entropy value at P4.
T4=XSteam('T_ps',p4,s4); %Collecting Temperature value by using P4 and S4 values.
h4=XSteam('h_ps',p4,s4); %Collecting Enthalpy value by using P4 and S4 values.
X4=((s4-s_l1)/(s_v1-s_l1)); %Calculating Dryness Fraction Value.

%Calculating State Values at State Point 1'.
p1d=p1; %Collecting Pressure value at P1'.
T1d=T_sat1; %Collecting Temperature value at P1'.
s1d=s_v1; %Collecting Entropy value at P1'.
h1d=h_v1; %Collecting Enthalpy value at P1'.
X1d=((s1d-s_l1)/(s_v1-s_l1)); %Calculating Dryness Fraction Value.

%Calculating State Values at State Point 2'.
if X2>1 %Using IF condition to verify point lies beyond Vapour Saturated Line.
    p2d=p2; %Collecting Pressure value at P2'.
    T2d=T_sat2; %Collecting Temperature value at P2'.
    s2d=s_v2; %Collecting Entropy value at P2'.
    h2d=h_v2; %Collecting Enthalpy value at P2'.
    X2d=((s2'-s_l2)/(s_v2-s_l2)); %Calculating Dryness Fraction Value.
end %Ending IF function.

%Calculating State Values at State Point 4'.
p4d=p1; %Collecting Pressure value at P4'.
T4d=T_sat1; %Collecting Temperature value at P4'.
s4d=s_l1; %Collecting Entropy value at P4'.
h4d=h_l1; %Collecting Enthalpy value at P4'.
X4d=((s4d-s_l1)/(s_v1-s_l1)); %Calculating Dryness Fraction Value.

%Calculating Rankine Cycle Results/Outputs.
H_add=h1-h4; %Calculating Heat added by the Boiler.
H_rej=h2-h3; %Calculating Heat removed by the Condenser.
W_turbine=h1-h2; %Calculating Work Output by the Turbine.
W_pump=h4-h3; %Calculating Work Input to the Pump.
N_thermal=(W_turbine-W_pump)/H_add; %Calculating Thermal Efficiency.
W_net=W_turbine-W_pump; %Calculating Net Work Output.
BWR=W_pump/W_turbine; %Calculating Back Work Ratio.
SSC=3600/W_net; %Calculating Specific Steam Consumption.

%Collecting data points to plot Process 4-1 on the graph.
for i=1:1000 %Using FOR loop to create 1000 data points.
    s_4to1=linspace(s4,s1,1000); %Creating 1000 data points between S4 & S1.
    t_4to1(i)=XSteam('T_ps',p4,s_4to1(i)); %Calculating 1000 data points between T4 & T1.
    h_4to1(i)=XSteam('h_ps',p4,s_4to1(i)); %Calculating 1000 data points between H4 & H1.
end %Ending FOR function.

%Collecting data points to plot Process 2-3 on the graph.
for i=1:1000 %Using FOR loop to create 1000 data points.
    s_2to3=linspace(s2,s3,1000); %Creating 1000 data points between S2 & S3.
    t_2to3(i)=XSteam('T_ps',p3,s_2to3(i)); %Calculating 1000 data points between T2 & T3.
    h_2to3(i)=XSteam('h_ps',p3,s_2to3(i)); %Calculating 1000 data points between H2 & H3.
end %Ending FOR function.

figure(1) %Plotting T-S Diagram of the Rankine Cycle.
hold on %Using hold on command to add multiple plots in a single figure.
title('T-S Diagram of the Rankine Cycle') %Adding Title to the figure
axis([0 10 0 1.25*T1]) %Defining the axis limits of the figure.
xlabel('Entropy (S) [KJ/Kg*K]') %Adding label to X-Axis.
ylabel('Temperature (T) [Deg. C]') %Adding label to Y-Axis.
plot(S_L,temp,'-','color','m') %Plotting Saturated Fluid Line.
plot(S_V,temp,'-','color','m') %Plotting Saturated Gas Line.
plot([s1 s2],[T1 T2],'linewidth',2,'color','b')  %Plotting Process 1-2.
plot(s_2to3,t_2to3,'-','linewidth',2,'color','g')  %Plotting Process 2-3.
plot([s3 s4],[T3 T4],'linewidth',2,'color','r')  %Plotting Process 3-4.
plot(s_4to1,t_4to1,'-','linewidth',2,'color','g')  %Plotting Process 4-1.
plot(s1,T1,'O','markersize',5,'markerfacecolor','r','markeredgecolor','r') %Plotting State 1 on T-S Diagram.
plot(s2,T2,'O','markersize',5,'markerfacecolor','r','markeredgecolor','b') %Plotting State 2 on T-S Diagram.
plot(s3,T3,'O','markersize',5,'markerfacecolor','b','markeredgecolor','b') %Plotting State 3 on T-S Diagram.
plot(s4,T4,'O','markersize',5,'markerfacecolor','b','markeredgecolor','r') %Plotting State 4 on T-S Diagram.
plot(s_v1,T_sat1,'O','markersize',5,'markerfacecolor','m','markeredgecolor','k') %Plotting State 1' on T-S Diagram.
plot(s_l1,T_sat1,'O','markersize',5,'markerfacecolor','m','markeredgecolor','k') %Plotting State 4' on T-S Diagram.
text(s1,T1,' 1') %Adding text on plot.
text(s2,T2,' 2') %Adding text on plot.
text(s3,T3,' 3') %Adding text on plot.
text(s4,T4,' 4') %Adding text on plot.
text(s_v1,T_sat1," 1'") %Adding text on plot.
text(s_l1,T_sat1," 4'") %Adding text on plot.
if X2>1 %Using IF condition to verify point lies beyond Vapour Saturated Line.
    plot(s_v2,T_sat2,'O','markersize',5,'markerfacecolor','m','markeredgecolor','k') %Plotting State 2' on T-S Diagram.
    text(s_v2,T_sat2," 2'") %Adding text on plot.
end %Ending IF function.

figure(2) %Plotting H-S Diagram of the Rankine Cycle.
hold on %Using hold on command to add multiple plots in a single figure.
title('H-S Diagram of the Rankine Cycle') %Adding Title to the figure
axis([0 10 0 1.25*h1]) %Defining the axis limits of the figure.
xlabel('Entropy (S) [KJ/Kg*K]') %Adding label to X-Axis.
ylabel('Enthalpy (H) [KJ/Kg]') %Adding label to Y-Axis.
plot(S_L,H_L,'-','color','m') %Plotting Saturated Fluid Line.
plot(S_V,H_V,'-','color','m') %Plotting Saturated Gas Line.
plot([s1 s2],[h1 h2],'linewidth',2,'color','b')  %Plotting Process 1-2.
plot(s_2to3,h_2to3,'-','linewidth',2,'color','g')  %Plotting Process 2-3.
plot([s3 s4],[h3 h4],'linewidth',2,'color','r')  %Plotting Process 3-4.
plot(s_4to1,h_4to1,'-','linewidth',2,'color','g')  %Plotting Process 4-1.
plot(s1,h1,'O','markersize',5,'markerfacecolor','r','markeredgecolor','r') %Plotting State 1 on H-S Diagram.
plot(s2,h2,'O','markersize',5,'markerfacecolor','r','markeredgecolor','b') %Plotting State 2 on H-S Diagram.
plot(s3,h3,'O','markersize',5,'markerfacecolor','b','markeredgecolor','b') %Plotting State 3 on H-S Diagram.
plot(s4,h4,'O','markersize',5,'markerfacecolor','b','markeredgecolor','r') %Plotting State 4 on H-S Diagram.
plot(s_v1,h_v1,'O','markersize',5,'markerfacecolor','m','markeredgecolor','k') %Plotting State 1' on H-S Diagram.
plot(s_l1,h_l1,'O','markersize',5,'markerfacecolor','m','markeredgecolor','k') %Plotting State 4' on H-S Diagram.
text(s1,h1,' 1') %Adding text on plot.
text(s2,h2,' 2') %Adding text on plot.
text(s3,h3,' 3') %Adding text on plot.
text(s4,h4,' 4') %Adding text on plot.
text(s_v1,h_v1," 1'") %Adding text on plot.
text(s_l1,h_l1," 4'") %Adding text on plot.
if X2>1 %Using IF condition to verify point lies beyond Vapour Saturated Line.
    plot(s_v2,h_v2,'O','markersize',5,'markerfacecolor','m','markeredgecolor','k') %Plotting State 2' on H-S Diagram.
    text(s_v2,h_v2," 2'") %Adding text on plot.
end %Ending IF function.

%Displaying the Results/Outputs of the given Rankine Cycle in the Command Window.
fprintf("n                                                  Results                                                  ")
fprintf("n     At State point 1      |     At State point 2      |     At State point 3      |     At State point 4     ")
fprintf("n P1 = %6.2f bar           | P2 = %6.2f bar           | P3 = %6.2f bar           | P4 = %6.2f bar          ",p1,p2,p3,p4)
fprintf("n T1 = %6.2f Deg. Celsius  | T2 = %6.2f Deg. Celsius  | T3 = %6.2f Deg. Celsius  | T4 = %6.2f Deg. Celsius ",T1,T2,T3,T4)
fprintf("n H1 = %6.2f KJ/Kg        | H2 = %6.2f KJ/Kg        | H3 = %6.2f KJ/Kg         | H4 = %6.2f KJ/Kg        ",h1,h2,h3,h4)
fprintf("n S1 = %6.4f KJ/Kg*K       | S2 = %6.4f KJ/Kg*K       | S3 = %6.4f KJ/Kg*K       | S4 = %6.4f KJ/Kg*K      ",s1,s2,s3,s4)
fprintf("n X1 = %6.4f               | X2 = %6.4f               | X3 = %6.4f               | X4 = %6.4f              ",X1,X2,X3,X4)
fprintf("n")
if X2>1
    fprintf("n     At State point 1'     |     At State point 2'     |     At State point 4'     ")
    fprintf("n P1' = %6.2f bar          | P2' = %6.2f bar          | P4' = %6.2f bar          ",p1d,p2d,p4d)
    fprintf("n T1' = %6.2f Deg. Celsius | T2' = %6.2f Deg. Celsius | T4' = %6.2f Deg. Celsius ",T1d,T2d,T4d)
    fprintf("n H1' = %6.2f KJ/Kg       | H2' = %6.2f KJ/Kg       | H4' = %6.2f KJ/Kg        ",h1d,h2d,h4d)
    fprintf("n S1' = %6.4f KJ/Kg*K      | S2' = %6.4f KJ/Kg*K      | S4' = %6.4f KJ/Kg*K      ",s1d,s2d,s4d)
    fprintf("n X1' = %6.4f              | X2' = %6.4f              | X4' = %6.4f              ",X1d,X2d,X4d)
    fprintf("n")
else
    fprintf("n     At State point 1'     |     At State point 4'     ")
    fprintf("n P1' = %6.2f bar          | P4' = %6.2f bar          ",p1d,p4d)
    fprintf("n T1' = %6.2f Deg. Celsius | T4' = %6.2f Deg. Celsius ",T1d,T4d)
    fprintf("n H1' = %6.2f KJ/Kg       | H4' = %6.2f KJ/Kg        ",h1d,h4d)
    fprintf("n S1' = %6.4f KJ/Kg*K      | S4' = %6.4f KJ/Kg*K      ",s1d,s4d)
    fprintf("n X1' = %6.4f              | X4' = %6.4f              ",X1d,X4d)
    fprintf("n")
end
fprintf("n                  Rankine Cycle Results                    ")
fprintf("n Heat Addition through Boiler                =  %4.2f KJ/Kg",H_add)
fprintf("n Heat Rejection through Condenser            =  %4.2f KJ/Kg",H_rej)
fprintf("n Work output by Turbine                      =  %4.2f KJ/Kg",W_turbine)
fprintf("n Work input by Pump                          =  %4.2f KJ/Kg",W_pump)
fprintf("n Thermal Efficiency of Rankine Cycle         =  %4.2f Percent",N_thermal*100)
fprintf("n Net Work Output of Rankine Cycle            =  %4.2f KJ/Kg",W_net)
fprintf("n Back Work Ratio of Rankine Cycle            =  %4.2f Percent",BWR*100)
fprintf("n Specific Steam Consumption of Rankine Cycle =  %4.2f KJ/KWh",SSC)
fprintf("n")
  • Explanation/Workflow for Performing Curve Fitting.
    1. We initially display the Title (Rankine Cycle) and then displays the process involved in Rankine Cycle in the command window.
    2. Pressures of State Point 1 & State Point 2 and Temperature of State Point 1 are collected from the user through the command window.
    3. Next, we use the XSteam library to collect the data points of the liquid saturation curve and vapor saturation curve for both the T-S diagram & H-S diagram.
    4. Then by using the XSteam library and the formulas we calculate the State point values at each state point.
    5. Then by using formulas which are mentioned earlier, we calculated the results of the Rankine Cycle for given user inputs.
    6. Since Process 4-1 & Process 2-3 are not isentropic, they are not a straight line while plotting the T-S diagram & H-S diagram.
    7. So, we collect data points to plot Process 4-1 & Process 2-3 on the T-S diagram & H-S diagram.
    8. Until now we have collected every data required to plot the T-S diagram & H-S diagram, hence we now plot the T-S diagram & H-S diagram of the Rankine Cycle for given user inputs.
    9. Now, we display each state point value in the command window.
    10. Then at the end, we display the results of the Rankine Cycle for given user inputs in the command window.
  • Results
  • If we see both the plots, we can't see the work done by the pump because it is very small compared to other values it will be visible if you zoom in the process 3-4.

5. CONCLUSION:

  • The program is successfully designed to create a Rankine Cycle Simulator & to solve it according to User Inputs.
  • According to the outputs of the program, the type of Rankine cycle for given inputs is Superheated Rankine Cycle.
  • Rankine Cycle Results
    • Heat Addition through Boiler = 3090.81 KJ/Kg.
    • Heat Rejection through Condenser = 1972.94 KJ/Kg.
    • Work output by Turbine = 1120.86 KJ/Kg.
    • Work input by Pump = 3.00 KJ/Kg.
    • Thermal Efficiency of Rankine Cycle = 36.17 %.
    • NetWork Output of Rankine Cycle = 1117.87 KJ/Kg.
    • Back Work Ratio of Rankine Cycle = 0.27 %.
    • Specific Steam Consumption of Rankine Cycle = 3.22 KJ/KWh.

6. REFERENCES:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.