Challenge

Project 2 - Rankine cycle Simulator

Rankine Cycle Simulator


Aim:
Creation of Rankine cycle simulator from given input and reading the data from standard thermodynamic library of steam table.

Objective :

1. To Simulate a Rankine cycle using matlab.
2. Extracting Steam and water properties from XSteam data (IAPWS IF - 97 standard)
3. Calculating all the state points of the cycle based on User inputs.
4. Plotting the T vs s and H vs s plot for the given input

A rankine cycle is an idealised Thermodynamic cycle which governs the working of a Heat Engine.In Rankine cycle,the friction losses of a heat engine are neglected.Heat is supplied externally in a loop where the working fluid is water.There are four components in this cycle which work on four different processes.The four components are turbine,Condensor,Pump and Boiler.

The rankine cycle is as shown in the figure.

Four processes of the Rankine cycle:

1-2 : Iscentropic Expansion in the Turbine
2-3 : Constant Pressure Heat Rejection in the Condensor
3-4 : Iscentropic Expansion in the Pump
4-1 : Constant Pressure Heat Addition in the Boiler

1 2: Isentropic Expansion

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


2-3: Constant Pressure Heat Rejection

WT = m(h1 − h2)K Condenser (2-3): The expanded vapour is then passed through a condenser, where it gets condensed and converts into liquid again. This liquid is again pumped to the boiler.


3-4: Isentropic Compression

The water enters into the pump in a saturated state. Then the liquid is compressed isentropically until it meets the boiler pressure.

4-1:Constant Pressure Heat Addition

The water enters into the boiler as compressed and leaves as superheated from the boiler. Thus the phase changes from liquid to vapour.

Required Inputs:
Turbine Inlet temperature = 400° C
Turbine Inlet Pressure = 30 bars
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure

clc,clear,close all 
disp('           RANKINE CYCLE SIMULATOR        ');
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');
disp(' ');
p1 = input('Enter the pressure at the turbine inlet, p1(in bar)     = ');
T1 = input('Enter the temperature at turbine inlet, T1(in degree.C) = ');
p2 = input('Enter the pressure at the condenser inlet, p2(in bar)   = ');
% At turbine inlet
h1 = XSteam('h_pT', p1, T1); % Extracting Enthalpy at state pt 1
s1 = XSteam('s_pT', p1, T1); % Similarly
% At condensor inlet
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));
% At condensor outlet
p3 = p2; % Constant pressure Heat rejection in Condenser
s3= XSteam('sL_p', p3);
h3 = XSteam('hL_p', p3);
% At boiler inlet
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
thermal_eff = (Wnet/Qin)*100;
%Specific Steam Consumption
%SSC = mass flow rate/power
SSC = (3600/Wnet);
% Back Work ratio
BW = (Wp/Wt);
% Calculation of 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], 'b', 'linewidth', 2)
plot([s2 s3], [T2 T3] ,'b', 'linewidth', 2)
plot([s3 s4], [T3 T4], 'b', 'linewidth', 2)
plot([s4 s5], [T4 T5], 'b', 'linewidth', 2)
plot([s5 s6], [T5 T6], 'b', 'linewidth', 2)
sc1 = linspace(s6, s1, 1000);
for l = 1:length(sc1)
 Tc1(l) = XSteam('T_ps', p1, sc1(l));
end
plot(sc1, Tc1, 'b', '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, 'k', 'linewidth', 1)
plot(sg, hg, 'k', 'linewidth', 1)
plot([s1 s2], [h1 h2], 'r', 'linewidth', 2)
plot([s2 s3], [h2 h3], 'r', 'linewidth', 2)
plot([s3 s4], [h3 h4], 'r', 'linewidth', 2)
hc = linspace(h4, h5, 100);
for r = 1:length(hc)
sch(r) = XSteam('s_ph', p1, hc(r));
end
plot(sch,hc, 'r', 'linewidth', 2)
plot([s5 s6], [h5 h6], 'r', 'linewidth', 2)
for m = 1:length(sc1)
hc1(m) = XSteam('h_ps', p1, sc1(m));
end
plot(sc1, hc1, 'r', '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 the Results in the Command Window:
disp('     Results    ');
disp('At stage point 1');
n1 = sprintf('P1 is : %.3f bar',p1);
disp(n1);
n2 = sprintf('T1 is : %.3f C',T1);
disp(n2);
n3 = sprintf('h1 is : %.3f kJ/kg',h1);
disp(n3);
n4 = sprintf('s1 is : %.3f kJ/kgK',s1);
disp(n4);
disp(' ');
disp('At stage point 2');
n11 = sprintf('P2 is : %.3f bar',p2);
disp(n11);
n21 = sprintf('T2 is : %.3f C',T2);
disp(n21);
n31 = sprintf('h2 is : %.3f kJ/kg',h2);
disp(n31);
n41 = sprintf('s2 is : %.3f kJ/kgK',s2);
disp(n41);
disp(' ');
disp('At stage point 3');
n12 = sprintf('P3 is : %.3f bar',p3);
disp(n12);
n22 = sprintf('T3 is : %.3f C',T3);
disp(n22);
n32 = sprintf('h3 is : %.3f kJ/kg',h3);
disp(n32);
n42 = sprintf('s3 is : %.3f kJ/kgK',s3);
disp(n42);
disp(' ');
disp('At stage point 4');
n13 = sprintf('P4 is : %.3f bar',p4);
disp(n13);
n23 = sprintf('T4 is : %.3f C',T4);
disp(n23);
n33 = sprintf('h4 is : %.3f kJ/kg',h4);
disp(n33);
n43 = sprintf('s4 is : %.3f kJ/kgK',s4);
disp(n43);
disp(' ');
n14 = sprintf('Wt is : %.3f kJ/kg',Wt);
disp(n14);
n15 = sprintf('Wp is : %.3f kJ/kg',Wp);
disp(n15);
n16 = sprintf('Wnet is : %.3f kJ/kg',Wnet);
disp(n16);
n17 = sprintf('NThermal is : %.2f Percent',thermal_eff);
disp(n17);
n18 = sprintf('S.S.C is : %.2f kg/kWh',SSC);
disp(n18);
n19 = sprintf('Back work ratio is : %.3f ',BW);
disp(n19);

EXPLANATION:

  • The Program begins with clear all, close all, clc to erase the workspace and plots..
    Input variables p1,T1,p2 are given by input command whose values are entered in command window while executing the
    Program.
  • @State-1, Values for Enthalpy & Entropy are extracted as a function of Pressure & Temperature. h_pT, s_pT, hL_p, sV_p etc.... are the default variables whose value is stored in XSteam file. 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.] Pressure, Temperature, Enthalpy, Entropy for all the State Variables are Extracted as a function of the dependent variable from the XSteam File.
  • @State 2 is a Condenser inlet where the High-Pressure Steam is converted into Low-Pressure Water and hence Dryness Fraction,Enthalpy & Entropy for Saturated Vapour & Saturated Water are considered to Calculate the Specific Enthalpy.
  • @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 Pump is the same.
  • @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 same and hence Cp/Cv=gamma is considered to find temperature T4.
  • define two more points 5 and 6 to plot cycle in detail
  • Finally Work done and Heat Evolved & SSC are calculated by basic formulae.
  • To plot the Saturation Curve, a Temperature range is defined using linspace command and 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.
  • Now all the necessary data is found out, Plotting is done for both T-S & H-S curves using the plot commands. Annotations are assigned using text command.
  • Results of the Cycle Simulation is displayed over Comand window using sprintf and disp command.

written code in matlab is shown below.

the command window output is shown below

workspace window output is shown below

the plots of temperature vs entropy and enthalpy vs temperature is shown below respectively

Results and Conclusion:
The performance of the Heat Engine was calculated and the following Observations were made:
1. Net Work = Wnet is : 1117.852 kJ/kg
2. Thermal Efficiency = 36.17 %
3. Back Work Ratio = 0.003
The T-S and H-S performance curves of the Rankine Cycle were plotted

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.