Challenge

Project 2 - Rankine cycle Simulator

Aim:

To create a program that simulates the state points of a Rankine cycle from the inputs by the user ad calculates the performance parameters such as thermal efficiency, Back work ratio, turbine and pump work.

Objective:

  1. To collect the inlet turbine pressure, outlet turbine pressure and boiler temperature.
  2. Using the data calculate the state points of the Rankine cycle. state points include enthalpy and entropy of the system.
  3. Then calculate the performance parameters of the given Rankine cycle.
  4. Draw a T-S diagram from data calculated
  5. Draw an H-S diagram from data calculated

Theory:

Rankine Cycle:

  • Rankine cycle is an idealized thermodynamic cycle or heat engine in which fuel is used to produce heat within a boiler, converting water into steam which then expands through a turbine producing useful work. This process was developed in 1859 by Scottish engineer William J.m Rankine. It is a cycle that converts heat into mechanical energy which usually is converted into electrical energy.
  1. The Rankine cycle is derived out of the Carnot cycle. its power depends on the temperature difference between the heat source and a cold source. The more the difference the more mechanical power can be efficiently extracted out of heat energy.
  2. Since ideal cycles are only in theory, the Efficiency of the Rankine cycle is limited by the high heat of vaporization of the working fluid, friction losses etc.
  3. Water is usually the fluid of choice due to its favourable properties, such as its non-toxic and unreactive chemistry, abundance, and low cost, as well as its thermodynamic properties. By condensing the working steam vapour to a liquid the pressure at the turbine outlet is lowered and the energy required by the feed pump consumes only 1% to 3% of the turbine output power and these factors contribute to higher efficiency for the cycle. The benefit of this is offset by the low temperatures of steam admitted to the turbine

Processes and Working :

There are four processes in the Rankine cycle (order may be varied ) :

  1. Process 1-2: Isentropic Expansion in the turbine.
  2. Process 2-3: Constant pressure Heat rejection in the condenser
  3. Process 3-4: Isentropic compression in the pump
  4. Process 4-1: Constant pressure heat addition in the boiler
  • Working of the Rankine cycle simulator
  1. In process 1-2, The dry saturated vapour expands through a turbine, generating power. This decreases the temperature and pressure of the vapour, and some condensation may occur.
  2. Process 2-3, The vapour-liquid mixture leaving the turbine (2) 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. Process 3-4, 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. Process 4-1, High-pressure liquid enters the boiler from the feed pump (4) and is heated to the saturation temperature (on the saturation curve). Further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam (1) or superheated (1).

Main Program for rankine cycle simulator:

clear all
close all
clc

fprintf ('%75s \n\n','RANKINE CYCLE SIMULATOR')
fprintf ('1-2 is Isentropic Expansion in Turbine \n')
fprintf ('2-3 is Const Pressure Heat Rejection by the Condenser \n')
fprintf ('3-4 is Isentropic Compression in the Pump \n')
fprintf ('4-1 is Const Pressure Heat Addition by the Boiler \n\n')

% Getting Inputs from User

P1 = input('Enter the Pressure at the Turbine Inlet (in bar) :');
T1 = input('Enter the Temperature at the Turbine Inlet (in Degree Celcius) :');
P2 = input('Enter the Pressure at Condenser (in bar) :');

%Computing Results

fprintf ('\n %65s','RESULTS')

% Calculating Required Values at all State Points

% At State Point 1
S1 = XSteam ('s_pT',P1,T1);
H1 = XSteam ('h_pT',P1,T1);

% At State Point 2
S2 = S1;
sf2 = XSteam ('sL_p',P2);
sg2 = XSteam ('sV_p',P2);
hf2 = XSteam ('hL_p',P2);
hg2 = XSteam ('hV_p',P2);

T2 = XSteam ('Tsat_p',P2);
x2 = ((S2-sf2)/(sg2-sf2));

H2 = hf2+(x2*(hg2-hf2));

% At State Point 3
P3 = P2;
T3 = XSteam ('Tsat_p',P3);
S3 = XSteam ('sL_p',P3);
H3 = XSteam ('hL_p',P3);

% To calculate Gamma
cp = XSteam('cpL_p',P3);
cv = XSteam('cvL_p',P3);
gamma = (cp/cv);

% At State Point 4

P4 = P1;
S4 = S3;
H4 = XSteam('h_ps',P4,S4);
T4 = T3*((P4/P3)^((gamma-1)/gamma));

% Calculating work done

Wt = H1 - H2;
Wp = H4 - H3;
W_net = Wt-Wp;

q_in = H1 - H4;
q_out = H2 - H3;

n = W_net/q_in;
n_percent = n*100;

SSC = 3600/W_net;

BWR = q_in/q_out;

% At State Points 5 and 6
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);

% Plotting The Required Graphs

% T-S Graph
figure(1) 
T_Zone1 = linspace(T5,T1,500);

for i = 1:length(T_Zone1)
    S(i) = XSteam('s_pt',P1,T_Zone1(i));
end

hold on

plot([S1 S2 S3 S4 S5 S6 S],[T1 T2 T3 T4 T5 T6 T_Zone1],'linewidth',3,'color','k')
axis ([0 10 0 430])
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','horizontalalignment','right')
text (S5,T5,'5','FontSize',15,'verticalalignment','top')
text (S6,T6,'6','FontSize',15,'verticalalignment','top','horizontalalignment','right')

T_Zone2 = linspace(0,T1,500);
for j = 1:length(T_Zone2)
    sl(j) = XSteam('sL_T',T_Zone2(j));
    sv(j) = XSteam('sV_T',T_Zone2(j));
    hl(j) = XSteam('hL_T',T_Zone2(j));
    hv(j) = XSteam('hV_T',T_Zone2(j));
end

plot (sl,T_Zone2,'linewidth',1.5,'color','r')
plot (sv,T_Zone2,'linewidth',1.5,'color','r')
xlabel('Entropy')
ylabel('Temperature')
title ('Entropy vs Temperature')

% H-S Graph
figure(2)
hold  on
plot([S1 S2 S3 S4 S1],[H1 H2 H3 H4 H1],'linewidth',3,'color','k')
axis ([0 10 -100 3500])
text (S1,H1,'1','FontSize',15)
text (S2,H2,'2','FontSize',15)
text (S3,H3,'3','FontSize',15,'verticalalignment','top','horizontalalignment','left')
text (S4,H4,'4','FontSize',15,'verticalalignment','bottom','horizontalalignment','right')

plot(sv,hv,'linewidth',1.5,'color','r')
plot(sl,hl,'linewidth',1.5,'color','r')
xlabel('Entropy')
ylabel('Enthalpy')

% Displaying The Results

fprintf ('\n At State Point 1 : \n')
fprintf ('P1 is : %f Bar \n',P1)
fprintf ('T1 is : %f Deg Celcius \n',T1)
fprintf ('H1 is : %f kJ/kg \n',H1)
fprintf ('S1 is : %f kJ/kgK \n',S1)

fprintf ('\n At State Point 2 : \n')
fprintf ('P2 is : %f Bar \n',P2)
fprintf ('T2 is : %f Deg Celcius \n',T2)
fprintf ('H2 is : %f kJ/kg \n',H2)
fprintf ('S2 is : %f kJ/kgK \n',S2)
fprintf ('X2 is : %f \n',x2)

fprintf ('\n At State Point 3 : \n')
fprintf ('P3 is : %f Bar \n',P3)
fprintf ('T3 is : %f Deg Celcius \n',T3)
fprintf ('H3 is : %f kJ/kg \n',H3)
fprintf ('S3 is : %f kJ/kgK \n',S3)

fprintf ('\n At State Point 4 : \n')
fprintf ('P4 is : %f Bar \n',P4)
fprintf ('T4 is : %f Deg Celcius \n',T4)
fprintf ('H4 is : %f kJ/kg \n',H4)
fprintf ('S4 is : %f kJ/kgK \n\n',S4)

fprintf ('Wt : %f kJ/kg \n',Wt)
fprintf ('Wp : %f kJ/kg \n',Wp)
fprintf ('Wnet : %f kJ/kg \n',W_net)
fprintf ('Ntherm : %f percent \n',n_percent)
fprintf ('SSC : %f kg/kWh\n',SSC)
fprintf ('BWR : %f \n',BWR)

Explanation of program code:

  1. XStream data is used to extract steam and water properties of enthalpy, entropy at a specific pressure and temperatures for sat liquid, sat vapour conditions etc.
  2. The program requires the input of Pressure ( in bar) at state point 1 ( turbine inlet), Temperature at the same point (deg Celcius) and Temp at condenser inlet (point 2).
  3. With the help of these inlets & from Xsteam data, the program calculates all the state points of the Rankine cycle .
  4. The XSteam data works as ,
  5. h1 = XSteam('h_pT' , p1 , T1) ; ( Returns the enthalpy of water at given pressure and temperature in bar and degC resp .)
  6. As we extract the data, we use thermodynamic relation to further find state points and extract their data from XSteam .
  7. Sf and sg, hf and hg, where f and g stand for saturated liquid and saturated vapour respectively.
  8. The network , work done by turbine, work done to run the pump, Heat in and heat out are calculated using standard thermodynamic relation
  9. Efficiency and Specific steam consumption (s.s.c) of the Rankine cycle are calculated.
  10. T, s and h are extracted at vapour and liquid line for plotting purpose , after 4th point for the variation you observe in the plot.
  11. The saturation curve is plotted in red for saturated liquid and saturated gas.
  12. The plot of T vs s and h vs s is created from all the points obtained from the program.
  13. The plot changes as the user input changes for the above-mentioned inputs.
  14. Results are displayed in the command window.

% Plotting

* Since the path of change between the points 5 and 1 is unknown, a temp zone is assumed for the temperatures between the said points and corresponding values of entropy is found using steam table

* Using the plot command, all values are plotted and with the help of text command, the state points are marked.

* The T vs S values at liquid and vapour phases are found from the steam table and plotted alongside

* The same is done for H vs S graph also

% Displaying Results

Finally, using the fprintf command, all the calculated state parameters are displayed onto the command window in required format.

Result:

T-s & h-s plot for Rankine cycle:

T-s Plot

h-s graph

Results in the command window for entire Calculation

Conclusion:

A code to simulate the Rankine cycle is done with calculation for performance parameters along with plots for T-S and H-S diagram.

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.