Challenge

Project 2 - Rankine cycle Simulator

Aim :- To create a Rankine Cycle Simulator using matlab.

Objective :- Calculate the state points of the rankine cycle and plot for the corresponding inputs.

Theory :-

Basic Cycle :- The Rankine cycle is the fundamental operating cycle of all power plants where an operating fluid is continuously evaporated and condensed. The selection of operating fluid depends mainly on the available temperature range.

The Rankine cycle operates in the following steps :-

1-2-3 Isobaric Heat Transfer :- High pressure liquid enters the boiler from the feed pump (1) and is heated to the saturation temperature (2). Further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam (3)

3-4 Isentropic Expansion :- The vapor is expanded in the turbine, thus producing work which 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%.

4-5 Isobaric Heat Rejection :- The vapor-liquid mixture leaving the turbine (4) 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.

5-1 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.

Figure shows the idealized Rankine cycle.

Figure shows The pressure-enthalpy (p-h) and temperature-entropy (T-s) diagrams of this cycle

Calculations :-

Given Inputs :- Turbine inlet temp = 400 Oc

Turbine inlet pressure = 30 bars

Turbine outlet pressure = 0.05 bars

Condenser inlet pressure = 0.05 bars

Steady Flow Energy Equation

(u1 + p1.v1 + Z1 .g + C1^2/2) + Q = (u2 + p2.v2 + Z2 .g + C2^2/2) + W

Where,

W = Work done by fluid.

Q = Heat supplied per kg of fluid.

C = Velocity of fluid.

Z= Height above datum.

p = Pressure of the fluid.

u = Internal energy of per kg of fluid.

pv = Energy required for 1 kg of fluid.

Applying steady flow energy equation to boiler,turbine,pump,condenser.

For boiler = Q1 = h1-hf4

For turbine = Wt = h1-h2

For condenser = Q2 = h2-hf3

For feed pump = Wp = hf4-hf3

Back Work Ratio :- The ratio of pump work to turbine work

bwr = Wp/Wt

Main code :-

close all
clear 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')

% step 1 : 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 = 0.05

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

% step 3 : state point 2
s2 = s1;
sf1 = 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);

% step 4 : state point 3
T3 = T2;
p3 = 0.05;
s3 = XSteam('sL_T',T3);
h3 = XSteam('hL_T',T3);
v3 = XSteam('vL_p',p2);

% step 5 : 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;

% step 6 : calculate other output values
% Turbine work
Wt = h1-h2;
% Pump work
Wp = v3*(p1-p2)*100;
h4 = Wp + h3;
W_net = Wt - Wp;
Qs = h1 - h4;
% Efficiency
N_per = (W_net/Qs)*100;
% steam rate per second 
steam_rate = 3600/(Wt - Wp);

% step 7 : 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);

% step 8 : print all state point values to show
fprintf('\n ------------ RESULT ------------ \n');
fprintf('At statepoint 1 : \np1 is : %4.2f Bar\nT1 is : %4.2f Degree Celcius\nH1 is : 4.2f KJ/Kg\nS1 is : %4.2f KJ/KgK\n\n',p1,T1,h1,s1);
fprintf('At statepoint 2 : \np2 is : %4.2f Bar\nT2 is : %4.2f Degree Celcius\nH2 is : 4.2f KJ/Kg\nS2 is : %4.2f KJ/KgK\n\n',p2,T2,h2,s2);
fprintf('At statepoint 3 : \np3 is : %4.2f Bar\nT3 is : %4.2f Degree Celcius\nH3 is : 4.2f KJ/Kg\nS3 is : %4.2f KJ/KgK\n\n',p3,T3,h3,s3);
fprintf('At statepoint 4 : \np4 is : %4.2f Bar\nT4 is : %4.2f 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);

% step 9 : 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 i = 1:length(T_curve)
    s_l(i) = XSteam('sL_T',T_curve(i));
    s_v(i) = XSteam('sV_T',T_curve(i));
    h_l(i) = XSteam('hL_T',T_curve(i));
    h_v(i) = XSteam('hV_T',T_curve(i));
end

plot(s_l,T_curve);
plot(s_v,T_curve);
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');

% step 10 : 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,T3,'3','FontSize',15,'HorizontalAlignment','right','verticalAlignment','top')
text(s4,T4,'4','FontSize',15,'HorizontalAlignment','right','verticalAlignment','bottom')
xlabel('Entropy in KJ/KgK')
ylabel('Enthalpy in KJ/Kg')

Output :-

Graphs that shows rankine cycle Simulator :-

Command Window :- It shows calculated output of each state,

Workspace :-

Conclusion :-

Upto complition of the challenge i able to learn concept of rankine cycle using standard thermal engineering book.

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.