Challenge

Project 2 - Rankine cycle Simulator

RANKINE CYCLE SIMULATOR

AIM:-

Create a Rankine Cycle Simulator using OCTAVE/MATLAB.

OBJECTIVE :-

  • Calculate the state points of the Rankine Cycle (any type of your choice) based on user inputs.
  • Plot the corresponding T-s and h-s plots for the given set of inputs.
  • Calculate Net work output and Back work ratio

THEORY:-

Rankine cycle

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.

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.

The four processes in rankine cycle

  • 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. The output in this process can be easily calculated using the chart or tables noted above. Process 1-2 is isentropic expansion.
  • Process 2–3: The wet vapour then enters a condenser, where it is condensed at a constant pressure to become a saturated liquid. Process 2-3 is constant pressure heat rejection in condenser.
  • Process 3–4: 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 3-4 is isentropic compression.
  • Process 4–1: The high-pressure liquid enters a boiler, where it is heated at constant pressure by an external heat source to become a dry saturated vapour. The input energy required can be easily calculated graphically, using an enthalpy–entropy chart (h–s chart, or Mollier diagram), or numerically, using steam tables or software. Process 2-3 is constant pressure heat addition in boiler.

In an ideal Rankine cycle the pump and turbine would be isentropic, i.e., the pump and turbine would generate no entropy and hence maximize the net work output. Processes 3–4 and 1–2 would be represented by vertical lines on the T–s diagram and more closely resemble that of the Carnot cycle. The Rankine cycle shown here prevents the state of the working fluid from ending up in the superheated vapor region after the expansion in the turbine, which reduces the energy removed by the condensers.

The actual vapor power cycle differs from the ideal Rankine cycle because of irreversibilities in the inherent components caused by fluid friction and heat loss to the surroundings; fluid friction causes pressure drops in the boiler, the condenser, and the piping between the components, and as a result the steam leaves the boiler at a lower pressure; heat loss reduces the net work output, thus heat addition to the steam in the boiler is required to maintain the same level of net work output.

GOVERNING EQUATIONS :-

  • Work transferred from the working fluid (kJ/kg) |W_turbine = h1 − h2
  • Heat rejected from the working fluid (kJ/kg) |Q_condenser = h2 − h3
  • Work transferred into the working fluid (kJ/kg) |W_pump = h4 − h3
  • Heat transferred to the working fluid (kJ/kg) |Q_boiler = h1 − h4
  • Net work on the working fluid (kJ/kg) |W_net = W_turbine − W_pump
  • Rankine Cycle Efficiency |E =W_net/Q_boiler
  • Back Work Ratio | BWR= W_turbine/W_pump

CODE:-

Main program:

% program to simulate rankine cycle

close all
clear all
clc

%% inputs 
t1 = 400;     % turbine inlet temperature in celcius 
p1 = 30 ;     % turbine inlet pressure bars
p2 = 0.05;    % condenser inlet pressure in bars

% h = enthalpy in kJ/kg
% s = specific entropy in kJ/kg.K
% v = specific volume in m^3/kg
% p = pressure in bar 
% t = temperature in celcius 
% x = vapour fraction

%% variables at state 1 - Turbine
h1 = XSteam('h_pT',p1,t1);  
s1 = XSteam('s_pT',p1,t1); 
v1 = XSteam('v_pT',p1,t1);  

%% variables at state 2 - Condender
s2 = s1;     
h2 = XSteam('h_ps',p2,s2);
t2 = XSteam('T_ps',p2,s2);
v2 = XSteam('v_ps',p2,s2);

%% variables at state 3 - Pump
p3 = p2;
x3 = 0; % The quality of the fluid changes from a liquid-vapor mixture to a saturated liquid. so x=0 ; 
h3 = XSteam('h_px',p3,x3);
t3 = XSteam('T_ph',p3,h3);
s3 = XSteam('s_ph',p3,h3);
v3 = XSteam('v_ph',p3,h3);

%% variables at state 4 - Boiler
s4 = s3;
p4 = p1;
h4 = XSteam('h_ps',p4,s4);
v4 = XSteam('v_ps',p4,s4);
t4 = XSteam('T_ps',p4,s4);

%% 

T = linspace(t4,t1,100);
for i = 1:length(T)
   S(i)= XSteam('s_pT',p1,T(i)) ; 
   H_41(i) = XSteam('h_ps',p1,S(i));
end


%% T-S diagram plotting

figure(1)

hold on

plot([s1 s2],[t1 t2],'color','r','linewidth',3)
plot([s2 s3],[t2 t3],'color','g','linewidth',3)
plot([s3 s4],[t3 t4],'color','y','linewidth',3)
plot(S,T,'color','b','linewidth',3)

text(s1,t1,'1')
text(s2,t2,'2')
text(s3,t3,'3')
text(s4,t4,'4')

grid on

title('T-S Diagram of RANKINE CYCLE')
ylabel('Temperature in [degree C]')
xlabel('Specific entropy in [kJ/kg K]')

%% H-S diagram plotting

figure(2)

hold on

plot([s1 s2],[h1 h2],'color','r','linewidth',3)
plot([s2,s3],[h2,h3],'color','g','linewidth',3)
plot([s3,s4],[h3,h4],'color','b','linewidth',3)
plot(S,H_41,'color','y','linewidth',3)

text(s1,h1,'1')
text(s2,h2,'2')
text(s3,h3,'3')
text(s4,h4,'4')

grid on

title('h-s Diagram of RANKINE CYCLE')
ylabel('Enthalpy in [kJ/kg]')
xlabel('Specific entropy in [kJ/kg K]')

%% Ploting T vs s Diagram for saturation curve

t_range = linspace(0,374,100); % Temperature from 0 to critical point of water in [degree C]
figure(1)

hold on
for i = 1:length(t_range)
    plot(XSteam('sL_t',t_range(i)),t_range(i),'.','color','black')
    plot(XSteam('sV_t',t_range(i)),t_range(i),'.','color','black')
end


%% Ploting h vs s Diagram for saturation curve 

figure(2)
hold on

for i = 1:length(t_range)
    plot(XSteam('sL_t',t_range(i)),XSteam('hL_t',t_range(i)),'.','color','black')
    plot(XSteam('sV_t',t_range(i)),XSteam('hV_t',t_range(i)),'.','color','black')
end



%% Calculating Work and Efficiency

W_Turbine = h1 - h2;       % work done by turbine 
W_pump = h4 - h3;          % work done by pump
BWR = W_Turbine / W_pump;  % Back Work Ratio
W_net = W_Turbine - W_pump; % Net work

Q_condenser = h2 - h3; % heat rejected from condensor
Q_boiler = h1 - h4; % heat entered into system
E = W_net/Q_boiler; % Rankine Cycle Efficiency



%% Results

fprintf('**********Program to simulate Ideal Rankine cycle**********\n\n');
fprintf('Process 1-2: Reversible adiabatic expansion process in the steam turbine\n');
fprintf('Process 2-3: Constant pressure heat transfer process in the condenser\n');
fprintf('Process 3-4: Reversible adiabatic compression process in the pump\n');
fprintf('Process 4-1: Constant pressure heat transfer process in the boiler\n\n');
fprintf('----------State variable at state point 1----------\n');
fprintf('Turbine Inlet Temperature T1 = %.4f in [degree C]\n',t1);
fprintf('Turbine Inlet Pressure p1 = %.4f in [bar]\n',p1);
fprintf('Turbine Inlet Enthalpy h1 = %.4f in [kJ/kg]\n',h1);
fprintf('Turbine Inlet Specific entropy s1 = %.4f in [kJ/kg K]\n',s1);
fprintf('Turbine Inlet Specific volume v1 = %.4f in [m3/kg]\n\n',v1);
fprintf('----------State variable at state point 2----------\n');
fprintf('Conderser Inlet Temperature T2 = %.4f in [degree C]\n',t2);
fprintf('Conderser Inlet Pressure p2 = %.4f in [bar]\n',p2);
fprintf('Conderser Inlet Enthalpy h2 = %.4f in [kJ/kg]\n',h2);
fprintf('Conderser Inlet Specific entropy s2 = %.4f in [kJ/kg K]\n',s2);
fprintf('Conderser Inlet Specific volume v2 = %.4f in [m3/kg]\n \n',v2);
fprintf('----------State variable at state point 3----------\n');
fprintf('Pump Inlet Temperature T3 = %.4f in [degree C]\n',t3);
fprintf('Pump Inlet Pressure p3 = %.4f in [bar]\n',p3);
fprintf('Pump Inlet Enthalpy h3 = %.4f in [kJ/kg]\n',h3);
fprintf('Pump Inlet Specific entropy s3 = %.4f in [kJ/kg K]\n',s3);
fprintf('Pump Inlet Specific volume v3 = %.4f in [m3/kg]\n \n',v3);
fprintf('----------State variable at state point 4----------\n');
fprintf('Boiler Inlet Temperature T4 = %.4f in [degree C]\n',t4);
fprintf('Boiler Inlet Pressure p4 = %.4f in [bar]\n',p4);
fprintf('Boiler Inlet Enthalpy h4 = %.4f in [kJ/kg]\n',h4);
fprintf('Boiler Inlet Specific entropy s4 = %.4f in [kJ/kg K]\n',s4);
fprintf('Boiler Inlet Specific volume v4 = %.4f in [m3/kg]\n \n\n',v4);
fprintf('--------Back work ratio and  Efficiency----------\n');
fprintf('Work done by turbine W_turbine = %.4f in [kJ/kg]\n',W_Turbine);
fprintf('Heat removed from condender Q_condenser = %.4f in [kJ/kg]\n',Q_condenser);
fprintf('Work done by pump W_pump = %.4f in [kJ/kg]\n',W_pump);
fprintf('Heat entered into the system Q_boiler = %.4f in [kJ/kg]\n \n',Q_boiler);
fprintf('Back Work Ratio BWR = %.4f \n',BWR);
fprintf('Net work  W_net = %.4f in [kJ/kg] \n',W_net);
fprintf('Rankine Cycle Efficiency E = %.4f %% \n\n',E*100);
fprintf('n******************************END******************************\n');


%% END

STEPS :-

1. Save XSteam function in the same folder of the program .

2. enter the inputs given

3. now using XSteam function we calculate the state points for turbine , condenser , pump and boiler

4. using linspace command we create values for temperature

5. using for loop we create array values for specific entropy and enthalpy .

6. using plot command we create t-s and h-s plots along with saturation curves

7. we calculate the efficiency of rankine cycle , back work ratio , net work using the formula given in equation section.

8. using fprintf() command we print the results in the command section .

RESULTS:-

command window :

**********Program to simulate Ideal Rankine cycle**********

Process 1-2: Reversible adiabatic expansion process in the steam turbine
Process 2-3: Constant pressure heat transfer process in the condenser
Process 3-4: Reversible adiabatic compression process in the pump
Process 4-1: Constant pressure heat transfer process in the boiler

----------State variable at state point 1----------
Turbine Inlet Temperature T1 = 400.0000 in [degree C]
Turbine Inlet Pressure p1 = 30.0000 in [bar]
Turbine Inlet Enthalpy h1 = 3231.5710 in [kJ/kg]
Turbine Inlet Specific entropy s1 = 6.9233 in [kJ/kg K]
Turbine Inlet Specific volume v1 = 0.0994 in [m3/kg]

----------State variable at state point 2----------
Conderser Inlet Temperature T2 = 32.8755 in [degree C]
Conderser Inlet Pressure p2 = 0.0500 in [bar]
Conderser Inlet Enthalpy h2 = 2110.7082 in [kJ/kg]
Conderser Inlet Specific entropy s2 = 6.9233 in [kJ/kg K]
Conderser Inlet Specific volume v2 = 22.9511 in [m3/kg]
 
----------State variable at state point 3----------
Pump Inlet Temperature T3 = 32.8956 in [degree C]
Pump Inlet Pressure p3 = 0.0500 in [bar]
Pump Inlet Enthalpy h3 = 137.7651 in [kJ/kg]
Pump Inlet Specific entropy s3 = 0.4765 in [kJ/kg K]
Pump Inlet Specific volume v3 = 0.0010 in [m3/kg]
 
----------State variable at state point 4----------
Boiler Inlet Temperature T4 = 32.9653 in [degree C]
Boiler Inlet Pressure p4 = 30.0000 in [bar]
Boiler Inlet Enthalpy h4 = 140.8462 in [kJ/kg]
Boiler Inlet Specific entropy s4 = 0.4765 in [kJ/kg K]
Boiler Inlet Specific volume v4 = 0.0010 in [m3/kg]
 

--------Back work ratio and  Efficiency----------
Work done by turbine W_turbine = 1120.8628 in [kJ/kg]
Heat removed from condender Q_condenser = 1972.9431 in [kJ/kg]
Work done by pump W_pump = 3.0811 in [kJ/kg]
Heat entered into the system Q_boiler = 3090.7248 in [kJ/kg]
 
Back Work Ratio BWR = 363.7878 
Net work  W_net = 1117.7817 in [kJ/kg] 
Rankine Cycle Efficiency E = 36.1657 % 

n******************************END******************************
>> rankine_cycle

command window screenshot :

T vs S plot :

H vs S plot :

CONCLUSION:-

The state points of the Rankine Cycle are calculated . T-s , h-s plots of the Rankine Cycle are plotted . the work and effciency of the Rankine Cycle are calculated successfully .

REFERENCE:-

https://en.wikipedia.org/wiki/Rankine_cycle

https://www.instructables.com/Simple-Rankine-Cycle-Thermodynamics/

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.