Challenge

Project 2 - Rankine cycle Simulator

AIM

To calculate the performance of a steam turbine engine and to plot T-S and H-S diagram of a Rankine Cycle

OBJECTIVE

IS TO

  • Create a Rankine Cycle Simulator using OCTAVE/MATLAB.
  • 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. Title and axes labels are a must, while legends could be used if necessary.

RANKINE CYCLE

The Rankine cycle is the process widely used by power plants such as coal-fired power plants or nuclear reactors. In this mechanism, a 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. This is a thermodynamic cycle which converts heat into mechanical energy—which usually gets transformed into electricity by electrical generation.

The steps in the Rankine Cycle as shown in Figure 1 and the corresponding steps in the pressure volume diagram (figure 2) are outlined below:

  • Pump: Compression of the fluid to high pressure using a pump
  • Boiler: The compressed fluid is heated to the final temperature , therefore, a phase chnage occurs—from liquid to vapor.
  • Turbine: Expansion of the vapor in the turbine.
  • Condenser: Condensation of the vapor in the condenser (where the waste heat goes to the final heat sink (the atmoshphere or a large body of water (ex. lake or river).

The efficiency of the Rankine cycle is limited by the high heat of vaporization by the fluid. The fluid must be cycled through and reused constantly, therefore, water is the most practical fluid for this cycle. This is not why many power plants are located near a body of water—that's for the waste heat.

As the water condenses in the condenser, waste heat is given off in the form of water vapour—which can be seen billowing from a plant's cooling towers. This waste heat is necessary in any thermodynamic cycle. Due to this condensation step, the pressure at the turbine outlet is lowered. This means the pump requires less work to compress the water—resulting in higher overall efficiencies.

MAIN CODE:

%% Rankine Cycle Simulator 

clear all
close all
clc

disp(' RANKINE CYCLE ');                                    % Displaying
disp('1-2 is Isentropic Expansion in the turbine');
disp('2-3 is constant pressure heat removal in the condenser');
disp('3-4 is Isentropic compression in the pump');
disp('4-1 is Constant pressure heat addition in the boiler');

%Obtaining the input data
p1 = input('nValue of pressure at turbine inlet, p1(in bar) = ');
T1 = input('nValue of temperature at turbine inlet, T1(in degree.C) = ');
p2 = input('nValue of temperature at condenser inlet, p2(in bar) = ');

% Extracting data _ defining variables
% State 1
h1 = XSteam('h_pT', p1, T1);        % extracting enthalpy at state pt 1
s1 = XSteam('s_pT', p1, T1);        % similarly

% State 2
s2 = s1;                            % Isentropic expansion                
sf2= XSteam('sL_p', p2);            % Saturated liquid Entropy
sg2 = XSteam('sV_p', p2);           % Saturated Vapour Entropy
x2 = (s2-sf2)/(sg2-sf2);
hf2 = XSteam('hL_p', p2);           
hg2 = XSteam('hV_p', p2);
h2 = hf2 + (x2*(hg2-hf2));

% State 3
p3 = p2;                            % Constant pressure Heat rejection in condenser
s3= XSteam('sL_p', p3);
h3 = XSteam('hL_p', p3);

% State 4
s4 = s3;
p4 = p1;

% Work done by turbine
Wt = h1 - h2;

% Work done to run pump
v3 = XSteam('vL_p', p3);
Wp = v3*(p4 - p3)*100;
h4 = h3 + Wp;

%net work
Wnet = Wt - Wp;

%Heat into the system
Qin = h1 - h4;

%Heat out of the system
Qout = h2 - h3;

%Thermal efficiency
eff = (Wnet/Qin)*100;

%Specific Steam Consumption
%SSC = mass flow rate/power
SSC = (3600/Wnet);


%Calculating temperatures at the state points
T3 = XSteam('Tsat_p', p3);
T2 = T3;
Cp4 = XSteam('Cp_ps', p4, s4);
Cv4 = XSteam('Cv_ps', p4, s4);
k = Cp4/Cv4;
T4 = T3/((p3/p4)^((k-1)/k));

%Calculating temperature, entropy and enthalpy at the vapour and liquid
%line for plotting
T6 = XSteam('Tsat_p', p1);
s5 = XSteam('sL_p', p1);
s6 = XSteam('sV_p', p1);
h5 = XSteam('hL_p', p1);
h6 = XSteam('hV_p', p1);
T5 = T6;


%Plotting the saturation curve
T = linspace(1,375,1000);
for i = 1:length(T)

sf(i) = XSteam('sL_T', T(i));
sg(i) = XSteam('sV_T', T(i));
hf(i) = XSteam('hL_T', T(i));
hg(i) = XSteam('hV_T', T(i));
end

%Plotting T-s diagram
figure(1)
hold on
plot(sf, T, 'r','linewidth',1)
plot(sg, T, 'r','linewidth',1)
plot([s1 s2], [T1 T2], 'k', 'linewidth', 2)
plot([s2 s3], [T2 T3] ,'k', 'linewidth', 2)
plot([s3 s4], [T3 T4], 'k', 'linewidth', 2)
plot([s4 s5], [T4 T5], 'k', 'linewidth', 2)
plot([s5 s6], [T5 T6], 'k', 'linewidth', 2)
sc1 = linspace(s6, s1, 1000);
for l = 1:length(sc1)
 Tc1(l) = XSteam('T_ps', p1, sc1(l));
end
plot(sc1, Tc1, 'k', 'linewidth', 2)
text(s1+0.1, T1, '1')
text(s2+0.1, T2, '2')
text(s3, T3-20, '3')
text(s4, T4+20, '4')
title('Temp vs Entropy plot')
xlabel('Entropy ,S (Kj/kgk')
ylabel('Temperature (degree C) ')
legend('Saturation curve')



%Plotting h-s diagram
figure(2)
hold on
plot(sf, hf, 'r', 'linewidth', 1)
plot(sg, hg, 'r',  'linewidth', 1)
plot([s1 s2], [h1 h2], 'k', 'linewidth', 2)
plot([s2 s3], [h2 h3], 'k', 'linewidth', 2)
plot([s3 s4], [h3 h4], 'k', 'linewidth', 2)
hc = linspace(h4, h5, 100);
for k = 1:length(hc)
sch(k) = XSteam('s_ph', p1, hc(k));
end
plot(sch,hc, 'k', 'linewidth', 2)
plot([s5 s6], [h5 h6], 'k', 'linewidth', 2)
for m = 1:length(sc1)
hc1(m) = XSteam('h_ps', p1, sc1(m));
end
plot(sc1, hc1, 'k', 'linewidth', 2)
text(s1+0.1, h1, '1')
text(s2+0.1, h2, '2')
text(s3, h3-100, '3')
text(s4, h4 +200, '4')
title('Enthalpy vs Entropy plot')
xlabel('Entropy , S (KJ/kgk) ')
ylabel('Enthalpy , H (KJ/kg)')
legend('Saturation curve','location','northwest')



% Displaying Results
disp(' RESULTS');
fprintf('At State Point 1:n');
fprintf('p1: %8.3f barn', p1);
fprintf('T1: %8.3f Cn', T1);
fprintf('h1: %8.3f KJ/kgn', h1);
fprintf('s1: %8.3f KJ/kgKnn', s1);
fprintf('At State Point 2:n');
fprintf('p2: %8.3f barn', p2);
fprintf('T2: %8.3f Cn', T2);
fprintf('h2: %8.3f kJ/kgn', h2);
fprintf('s2: %8.3f kJ/kgKn', s2);
fprintf('x2: %8.3fnn', x2);
fprintf('At State Point 3:n');
fprintf('p3: %8.3f barn', p3);
fprintf('T3: %8.3f Kn', T3);
fprintf('h3: %8.3f kJ/kgn', h3);
fprintf('s3: %8.3f kJ/kgKnn', s3);
fprintf('At State Point 4:n');
fprintf('p4: %8.3f barn', p4);
fprintf('T4: %8.3f Kn', T4);
fprintf('h4: %8.3f KJ/kgn', h4);
fprintf('s4: %8.3f kJ/kgKnn', s4);
fprintf('Turbine Work: %8.3f kJ/kgn', Wt);
fprintf('Pump Work: %8.3f kJ/kgn', Wp);
fprintf('Wnet: %8.3f kJ/kgn', Wnet);
fprintf('Efficiency: %8.3f Percent n ', eff);
fprintf('S.S.C: %8.3f kJ/kWh', SSC);
OUTPUT:

COMMAND WINDOW:

RANKINE CYCLE
1-2 is Isentropic Expansion in the turbine
2-3 is constant pressure heat removal in the condenser
3-4 is Isentropic compression in the pump
4-1 is Constant pressure heat addition in the boiler
nValue of pressure at turbine inlet, p1(in bar) = 44
nValue of temperature at turbine inlet, T1(in degree.C) = 538
nValue of temperature at condenser inlet, p2(in bar) = 5.38
RESULTS
At State Point 1:np1: 44.000 barnT1: 538.000 Cnh1: 3528.829 KJ/kgns1: 7.154 KJ/kgKnnAt State Point 2:np2: 5.380 barnT2: 154.616 Cnh2: 2904.519 kJ/kgns2: 7.154 kJ/kgKnx2: 1.073nnAt State Point 3:np3: 5.380 barnT3: 154.616 Knh3: 652.215 kJ/kgns3: 1.889 kJ/kgKnnAt State Point 4:np4: 44.000 barnT4: 229.552 Knh4: 656.446 KJ/kgns4: 1.889 kJ/kgKnnTurbine Work: 624.309 kJ/kgnPump Work: 4.232 kJ/kgnWnet: 620.078 kJ/kgnEfficiency: 21.588 Percent n S.S.C: 5.806 kJ/kWh>>
>>

REFERENCES

https://energyeducation.ca/encyclopedia/Rankine_cycle

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

https://in.mathworks.com/help/physmod/simscape/ug/rankine-cycle-steam-turbine.html

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.