Challenge

Project 2 - Rankine cycle Simulator

Create a Rankine Cycle simulator using MATLAB.

Objectives:-

  1. Calculate the state points of the Rankine Cycle using given input.
  2. Plot the corresponding T-s and h-s plots for the given set of inputs.
  3. All answer are showing in command window through coding.

Introduction:-

It is the theoretically thermodynamic cycle describing the process by which certain heat engines such as steam engines or reciprocating steam engines allow mechanical work to be extracted from a fluid as it moves between a heat source and heat sink. When heat energy is supplied to the system via boiler where the working fluid is converted into high pressure gaseous state 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 then thermodynamic losses especieally in larger system.

Theory:- There are four processes in this cycle.

  • Process 1-2 :- Reversible adiabatic expansion in Turbine.

In this process 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.

  • Process 2-3 :- Constant pressure and heat addition in Condenser.

In this high pressure liquid enters in a boiler where heated at constant pressure by external source to become a dry saturated vapour.

  • Process 3-4 :- Reversible adiabatic pumping in pump.

The dry saturated vapour expands in turbine and generating power this decreases the temperature and pressure of the vapour and some condensation may occur.

  • Process 4-1 :- Constant pressure and heat addition in Boiler.

In this the wet vapour enters into condenser where it is condensed at constant pressure to become a saturated liquid.

Formulaes using in program:-

1] Steady flow energy equation:-

`h1+frac{C1^2}{2}+Z1.g+Q = h2+frac{C2^2}{2}+Z2.g+W`

Where `h = u+pv`

Q = heat supplies of fluid

W = Workdone

C = velocity of fluid

z = height

p = pressure of fluid

u = internal energy

pv = energy require for fluid

Applying SFEE

1} for Boiler (Qin):-

`hf4+Q1 = h1`

`Q1 = h1-hf4`

2} for Turbine (Wt):-

`h1 = Wt+h2`

`Wt = h1-h2`

3} for Condenser (Q2):-

`h2 = Q2+hf3`

`Q2 = h2-hf3`

4} for Feed pump (Wp):-

`hf3+Wp = hf4`

`Wp = hf4-hf3`

2] Efficiency of Rankine Cycle:-

`eta = frac{Output}{Input}``= frac{Wn}{QIn} = frac{Wt-Wp}{QIn}`

`eta = frac{(h1-h2)-(hf4-hf3)}{(h1-hf3)}`

3] Back work ratio:-

`BWR = frac{Wp}{Wt}`

Main program:-

%% clearing all data
clear all
close all
clc

%% Rankine cycle process
disp('         . . . RANKINE CYCLE . . .           ')
disp(' ')
fprintf('Process 1-2: Reversible adiabatic expansion in turbine n')
fprintf('Process 2-3: Constant pressure heat addition in condenser n')
fprintf('Process 3-4: Reversible adiabatic pumping process in feed pump n')
fprintf('process 4-1: Constant pressure heat addition in boiler n')

%% Inputs
disp(' ')
p1 = input('Enter the turbine inlet pressure (in bar): n')
p2 = input('Enter the turbine outlet or condenser inlet pressure (in bar): n')
t1 = input('Enter the turbine inlet temperature (in degree celcius): n')

% p1 = 30;
% p2 = 0.05;
% t1 = 400;

%% state 1 (p1,t1)
p1;  %pressure at point 1
t1;  %temperature at point 1
s1 = XSteam('s_pT',p1,t1);  %specific entropy as func of pressure and temperature
h1 = XSteam('h_pT',p1,t1);  %specific enthalpy as func of pressure and temperature

%% state 2 (p2,s2)
p2;  %pressure at point 2
s2 = s1;  %isentropic expansion (the entropy does not change in this state)
t2 = XSteam('T_ps',p2,s2);  %specific temp as func of pressure and entropy
h2 = XSteam('h_ps',p2,s2);  %specific enthalpy as func of pressure and entropy
v2 = XSteam('vL_p',p2);  %saturated liquid vapour

%% state 3 (p3)
% wet vapour is converted into saturated liquid.
p3 = p2;  %pressure at point 3 (isobaric process)
t3 = XSteam('Tsat_p',p3);  %saturation temperature
s3 = XSteam('sL_p',p3);  %Saturated liquid entropy
h3 = XSteam('hL_p',p3);  %Saturated liquid enthalpy

%% state 4 (p4,s4)
p4 = p1;  %(isobaric process)
s4 = s3;  %(isentropic process)
t4 = XSteam('T_ps',p4,s4);  %specific temp as func of pressure and entropy
h4 = XSteam('h_ps',p4,s4);  %specific enthalpy as func of pressure and entropy

%% Pressure is constant along this path
h5 = XSteam('hL_p',p1);  %saturated liquid enthalpy
h6 = XSteam('hV_p',p1);  %saturated volume enthalpy
s5 = XSteam('sL_p',p1);  %saturated liquid entropy
s6 = XSteam('sV_p',p1);  %saturated volume entropy
t5 = XSteam('Tsat_p',p1);  %saturation temperature
t6 = t5;  %saturation temperature [its equal]

%% state point display in command window
disp('  ')
disp('...............Result............... ')
fprintf(['at STATE point 1: n' ...
         '    P1 is : %2.2f bar n' ...
         '    T1 is : %f C n' ...
         %% 
         '    S1 is : %f Kj/KgK n' ...
         '    H1 is : %f Kj/Kg n'],p1,t1,s1,h1)
     
fprintf(['at STATE point 2: n' ...
         '    P2 is : %2.2f bar n' ...
         '    T2 is : %f C n' ...
         '    S2 is : %f Kj/KgK n' ...
         '    H2 is : %f Kj/Kg n'],p2,t2,s2,h2)

fprintf(['at STATE point 3: n' ...
         '    P3 is : %2.2f bar n' ...
         '    T3 is : %f C n' ...
         '    S3 is : %f Kj/KgK n' ...
         '    H3 is : %f Kj/Kg n'],p3,t3,s3,h3)
     
fprintf(['at STATE point 4: n' ...
         '    P4 is : %2.2f bar n' ...
         '    T4 is : %f C n' ...
         '    S4 is : %f Kj/KgK n' ...
         '    H4 is : %f Kj/Kg n'],p4,t4,s4,h4)
     
%% Calculations of (Qin,Wt,Wp,Efficiency of rankine)
% 1] Computation of (Qin)
Qin = h1-h4;

% 2] computation of the work of the pump
% Wp = -100*v2*(p1-p2)
Wp = h4-h3;

% 3] Computation of the work of the turbine
Wt = h1-h2;

% 4] Efficiency of rankine
% nrank = Wnet/Qin 
Wnet = Wt-Wp;
nrank = (Wnet/Qin)*100;
% 5] back work ratio = pump work/turbine work
BWR = Wp/Wt;

%% display result
disp('  ')
fprintf(['Turbine work is : %2.2f n' ...
         'Pump work is : %f bar n' ...
         'Q_in is : %f C n' ...
         'Net work output is : %f Kj/KgK n' ...
         'Back work Ratio is : %f Kj/Kg n' ...
         'Efficiency of rankine is : %f n'],Wt,Wp,Qin,Wnet,BWR,nrank)
     
%% calculating enthalpy and entropy for saturation curve
%% 
% creating temp 1d array
temp = linspace(0,374,600);
% use for loop 
for i = 1:length(temp);
    %saturated vapour enthalpy
    hV(i) = XSteam('hV_T',temp(i));
    %saturated liquid enthalpy
    hL(i) = XSteam('hL_T',temp(i));
    %saturated vapour entropy
    sV(i) = XSteam('sV_T',temp(i));
    %saturated liquid entropy
    sL(i) = XSteam('sL_T',temp(i));
end

%% plotting
% 1] to draw T-S diagram
figure(1)
plot([s1,s2],[t1,t2],[s2,s3],[t2,t3],[s3,s4],[t3,t4],[s4,s5],[t4,t5],[s5,s6],[t5,t6],[s6,s1],[t6,t1],'marker','o','color','g')
axis([-3,10,0,500])
% giving numbering to state points
text(s1,t1,'   1``')
text(s2,t2,'   2')
text(s3,t3,'   3')
text(s4,t4,' 4')
text(s5,t5,'  1`')
text(s6,t6,'  1')
hold on
%to draw vapour dome
plot(sV,temp,'color','k')
plot(sL,temp,'color','k')
%labels
xlabel('Entropy [Kj/Kg]')
ylabel('Temperature [degree C]')
%title of diagram
title('T-S Diagram of Rankine cycle')

% 2] to draw H-S diagram
figure(2)
plot([s1,s2],[h1,h2],[s2,s3],[h2,h3],[s3,s4],[h3,h4],[s4,s5],[h4,h5],[s5,s6],[h5,h6],[s6,s1],[h6,h1],'marker','o','color','r')
% giving numbering to state points
text(s1,h1,'   1``')
text(s2,h2,'   2')
text(s3,h3,'   3')
text(s4,h4,' 4')
text(s5,h5,'  1`')
text(s6,h6,'  1')

% gtext('1')
% gtext('2')
% gtext('3')
% gtext('4')
% gtext('1`')
% gtext('1``')
hold on
%to draw vapour dome
plot(sV,hV,'color','k')
plot(sL,hL,'color','k')
%labels
xlabel('Entropy [Kj/Kg]')
ylabel('Enthalpy [Kj/KgK]')
%title of diagram
title('H-S Diagram of Rankine cycle')

Explanation of program:-

  1. Starting the program clearing all data using clear,clc command.
  2. To display process of rankine cycle use fprint command and the the each line of process is on new line use n this command.
  3. Take given input as p1,p2,and t1 at state point 1.
  4. Then calculate all state points using steam table. the steam table are in this XSteam file.
  5. then all state point results are have to display in command window give fprint command.
  6. then calculate workdone, efficiency of rankine cycle, back work ratio using formulaes.
  7. then calculating enthalpy and entropy for saturation curve.
  8. then plotting T-S and H-S diagram.

Diagrams from Program:-

1] T-S diagram of rankine Cycle:-

2] H-S diagram of rankine Cycle:-

3] Command window display:-

Result :- The efficiency of rankine cycle is 36.16%.

Conclusion:- As pressure is increased temperature also increased and we get superheated steam.

THANK YOU

Dharmesh Bonde

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.