Challenge

Project 2 - Rankine cycle Simulator

AIM: Create a Rankine Cycle Simulator using MATLAB.

OBJECTIVE:

  • Calculate each state point of the Rankine Cycle based on user inputs.
  • Plot the T-S diagram from data collected.
  • Plot the H-S diagram from data collected.
  • Calculate Efficiency.

THEORY:

The Rankine cycle is an idealized thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing a 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, using water as the working fluid.

Four components of the Rankine cycle:

  1. Pump: Compression of fluid to high pressure.
  2. Boiler: High-pressure liquid to vapor at high temperature and pressure
  3. Turbine: Expansion of high pressure and high-temperature steam to generate work.
  4. Condenser: Condensation or cooling of expanded vapor.

Four processes of the Rankine cycle:

1-2: Isentropic Expansion

Turbine (1-2): Superheated steam enters the Turbine and expands isentropically, resulting in work production. The shaft of the turbine is connected to the generator. This results in the production of electricity that is Mechanical energy gets converted into electric energy. Work produced by the turbine,

`W_T=m(h_1-h_2)K`

2-3: Constant Pressure Heat Rejection

Condenser (2-3): The expanded vapor is then passed through a condenser, where it gets condensed and converts into liquid again. This liquid is again pumped to the boiler.

`Q_r=m(h_2-h_3)K`

3-4: Isentropic Compression by the Pump

Pump (3-4): The water enters the pump in a saturated state. Then the liquid is compressed isentropically until it meets the boiler pressure. Work done by the pump is,

`W_p=m(h_3-h_4)K`

4-1: Constant Pressure Heat Addition

Boiler (4-1): The water enters the boiler as compressed and leaves superheated from the boiler. Thus the phase changes from liquid to vapor. The heat supplied by the boiler is

`Q_b = m(h_1-h_4)K`

  • The efficiency of the Steam Cycle is given by `eta = (W_n/Q_1) = (W_T-W_P)/Q_1`
  • Applying the Steady Flow Energy Equation (SFEE) to all the processes, neglecting the Friction losses and changes in Kinetic & Potential Energy,
  1. `Q_1=h_1-h_4` @Boiler
  2. `W_t=h_1-h_2` @Turbine
  3. `Q_2=h_2-h_3` @Condenser
  4. `W_p=h_4-h_3` @Pump
  • The Capacity of the Steam Plant is often expressed in terms of Steam Rate (SR) or Specific Steam Consumption (SSC)

`S. S. C. = 3600/W_n (kg)/(kWh)`

Required Inputs:

  1. Turbine Inlet Pressure = 30 bars.
  2. Turbine Inlet temperature = 400°C.
  3. Turbine Outlet Pressure = 0.05 bars Condenser Inlet Pressure.

PROGRAM:

% Rankine Cycle Simulator
%Objective of this program is to simulate the rankine cycle
%plotting t-s and h-s diagram using data from Xsteam date 
%Water and steam properties according to IAPWS IF-97
clear all
close all
clc

%%
% Print Process Description
fprintf('1-2 Isobaric heat Transfer\n')
fprintf('2-3 Isentropic Expansion\n')
fprintf('3-4 Isobaric heat Rejection\n')
fprintf('4-1 Isentropic Compression\n')

%%
%Enter Inputs
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 the condensor(in bar):');

%%
% Calculate each state point values
% State point 1
h1 = XSteam('h_pt',p1,T1);
s1 = XSteam('s_pt',p1,T1);

%%
% 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);
s2 = sg2;
h2 = hg2;
T2=XSteam('T_hs', h2,s2);

%%
% State point 3
T3 = T2;
p3 = p2;
s3 = XSteam('sL_T',T3);
h3 = XSteam('hL_T',T3);
v3 = XSteam('vL_p', p2);

%%
% State point 4
p4 =p1;
s4= s3;
Cp4 = XSteam('Cp_ps',p4,s4);
Cv4 = XSteam('Cv_ps',p4, s4);
gamma = Cp4/Cv4;
r = (gamma-1)/gamma;
T4 = T3 *(p4/p3)^r;

%%
% Calculate other output values
% Turbine work
Wt = h1-h2;

% Pump Work
Wp = v3*(p1-p2)*100;
h4 = Wp + h3;

% Net Work unit in Kj/Kg
W_net = Wt-Wp;

% Heat supplied
Qs = h1-h4;

% Efficiency
N_per = (W_net/Qs)*100;

% Steam rate per second
steam_rate = 3600/(Wt-Wp);

%%
% State point 5 and 6 which help in plotting 
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);

%%
% Print all state point values to show
fprintf('\n-----RESULT-----\n')
fprintf('At State point 1:\nP1 is:%4.2f Bar\nT1 is: %4.25f Degree Celcius\nH1 is: %4.2f Kj/kg\nS1 is: %4.2f Kj/kgk\n\n',p1,T1,h1,s1)
fprintf('At State point 2:\nP2 is:%4.2f Bar\nT2 is: %4.25f Degree Celcius\nH2 is: %4.2f Kj/kg\nS2 is: %4.2f Kj/kgk\n\n',p2,T2,h2,s2)
fprintf('At State point 3:\nP3 is:%4.2f Bar\nT3 is: %4.25f Degree Celcius\nH3 is: %4.2f Kj/kg\nS3 is: %4.2f Kj/kgk\n\n',p3,T3,h3,s3)
fprintf('At State point 4:\nP4 is:%4.2f Bar\nT4 is: %4.25f Degree Celcius\nH4 is: %4.2f Kj/kg\nS4 is: %4.2f Kj/kgk\n\n',p4,T4,h4,s4)
fprintf('Wt is :%4.2f kJ/kg\nWp is: %4.2f KJ/kg\nWnet is: %4.2f Kj/kg\nNtherm is: %4.2f percent\nS.S.C is: %4.2f Kg/KWh',Wt,Wp,W_net,N_per,steam_rate)

%%
% Plot T-S Diagram
subplot(1,2,1)
T_rankine = linspace(T5,T1,5000);

for i = 1:length(T_rankine)
    s_rankine(i) = XSteam('s_pT',p1,T_rankine(i));
end

plot([s1 s2 s3 s4 s5 s6 s_rankine],[T1 T2 T3 T4 T5 T6 T_rankine],'LineWidth',1.5);
hold on
T_curve = linspace(1,400,500);

for j=1:length(T_curve)
    s_l(j) = XSteam('sL_T',T_curve(j));
    s_v(j) = XSteam('sV_T',T_curve(j));
    h_l(j) = XSteam('hL_T',T_curve(j));
    h_v(j) = XSteam('hV_T',T_curve(j));
end

plot(s_l,T_curve,'Color','r');
plot(s_v,T_curve,'Color','r');
text(s1,T1,'1','FontSize',15)
text(s2,T2,'2','FontSize',15)
text(s3,T3,'3','FontSize',15,'HorizontalAlignment','right','VerticalAlignment','top')
text(s4,T4,'4','FontSize',15,'HorizontalAlignment','right','VerticalAlignment','bottom')
text(s5,T5,'5','FontSize',15)
text(s6,T6,'6','FontSize',15)
xlabel('Entropy in kJ/KgK');
ylabel('Temperature in Degree Celcius')
title('Temperature and Entropy Diagram (T-S)')

%%
% Plot H-S diagram
subplot(1,2,2)
plot([s1 s2 s3 s4 s1], [h1 h2 h3 h4 h1], 'Linewidth',2)
hold on
plot(s_v,h_v,'Color','r')
plot(s_l,h_l,'Color','r')
text(s1,h1,'1','FontSize',15)
text(s2,h2,'2','FontSize',15)
text(s3,h3,'3','FontSize',15,'HorizontalAlignment','right','VerticalAlignment','top')
text(s4,h4,'4','FontSize',15,'HorizontalAlignment','right','VerticalAlignment','bottom')
xlabel('Entropy in kJ/KgK')
ylabel('Enthalpy in kJ/kg')
title('Enthalpy and Entropy Diagram (H-S)')

EXPLANATION:

  1. The Program begins with clear all, close all, clc to erase the workspace and plots.\
  2. Input variables p1, T1, p2 are given by the input command whose values are entered in the command window while executing the Program.
  3. State-1, Values for Enthalpy & Entropy are extracted as a function of Pressure & Temperature.
  4. h_pT, s_pT, hL_p, SV_p, etc..... are the default variables whose value is stored in the XStream file.
  5. Similarly, all the variables for all states are extracted using a suitable format.[The Formulae for the State Variables and other depending factors are referred from Power Plant Reference Books.]
  6. Pressure, Temperature, Enthalpy, Entropy for all the State Variables are Extracted as a dependent variable from the XSteam File.
  7. State 2 is a Condenser inlet where the High-Pressure Steam is converted into Low-Pressure Water. Hence, Dryness Fraction, Enthalpy & Entropy for Saturated Vapour & Saturated Water are considered to Calculate the Specific Enthalpy.
  8. State-3 The water is condensed back to its Saturation Temperature and fed to the Pump; this temperature of water at the exit of the Condenser and entry of the Pump is the same.
  9. State-4 This is Constant Pressure Heat addition. Hence pressure is equal to p1, but the temperature increases on heating at Constant Pressure & Constant Volume as our Entropy remains the same. Therefore Cp/Cv=gamma is considered to find temperature T4.
  10. Define two more points, 5 and 6, to plot the cycle in detail.
  11. Finally, Work done and Basic formulae calculate heat Evolved & SSC.
  12. To plot the Saturation Curve, a Temperature range is defined using the linspace command. For the overall length of this, Temperature values of Enthalpy and Entropy are calculated at every temperature point. The Break in the Saturation Curve separates the Liquid Phase & Vapour Phase.
  13. All the necessary data is found; plotting is done for both T-S & H-S curves using the plot commands. Annotations are assigned using the text command.
  14. Cycle Simulation results are displayed over the Comand window using the fprintf command.

RESULT:

The Rankine cycle plots have been generated by calculating the state points, efficiency and the output is printed in the command window.

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.