Challenge

Project 2 - Rankine cycle Simulator

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.


Rankine Cycle :
Rankine cycle is an idealized thermodynamic cycle or heat engine in which a fuel is used to produce heat within a boiler converting water into steam which then expands through a turbine producing useful wok . This process was developed in 1859 by scottish engineer william J.m Rankine . It is a cycle which converts heat into mechanical energy which usually is converted into electrical energy .


i.In this project an idealized cycle is simulated . Hence neglecting losses.


ii. Rankine cycle is derived out of carnot cycle. its power depends on the temperature difference between the heat source and a cold source. The more the difference the more mechanical power can be efficiently extracted out of heat energy .


iii. Since ideal cycles are only in theory , Efficiency of rankine cycle is limited by high heat of vaporization of the working fluid,friction losses etc.


iv. Water is usually the fluid of choice due to its favorable properties, such as its non-toxic and unreactive chemistry, abundance, and low cost, as well as its thermodynamic properties. By condensing the working steam vapor to a liquid the pressure at the turbine outlet is lowered and the energy required by the feed pump consumes only 1% to 3% of the turbine output power and these factors contribute to a higher efficiency for the cycle. The benefit of this is offset by the low temperatures of steam admitted to the turbine.


Processes and Working :


There are four processes in the rankine cycle :


1. Process 1-2 : Isentropic Expansion in the turbine .
2. Process 2-3 : Constant pressure Heat rejection in condenser
3. Process 3-4 : Isentropic compression in the pump
4. Process 4-1 : Constant pressure heat addition in the boiler

Four components of the Rankine cycle are :


1. Pump
2. Boiler
3. Turbine
4. Condenser


Working of the Rankine cycle:


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. Work is produced by the turbine.

Wt=h1-h2


2-3: Constant Pressure Heat Rejection 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.

Q2=h2-h3


3-4: Isentropic Compression by the Pump Pump (3-4): The water enters into the pump in a saturated state. Then the liquid is compressed isentropically until it meets the boiler pressure. Work done by the pump is calculated as.

Wp=h4-h3

4-1: Constant Pressure Heat AdditionBoiler (4-1): The water enters into the boiler as compressed and leaves as superheated from the boiler. Thus the phase changes from liquid to vapour. The heat supplied by the boiler is calculated as .

Q1=h1-h4

Image (GIF) showing the complete working of thermal powerplant working on rankine cycle

Here we take mass flow rate m = 1 for this code.

The efficiency of the Steam Cycle is given by

Applying the Steady Flow Energy Equation (SFEE) to all the process, neglecting the Friction losses and changs in Kinetic & Potential Energy,
Q1=h1-h4 @Boiler Wt=h1-h2 @Turbine Q2=h2-h3 @Condenser Wp=h4-h3 @Pump
The Capacity of the Steam Plant is often expressed interms of Steam Rate (SR) or Specific Steam Consumption (SSC)


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

Matab code -


%Rankine Cycle Simulator
% this program is to simulate the rankine cycle
% Plotting t-s and h-s diagram using data from XSteam data
% Water and steam properties according to IAPWS IF-97
clear all
close all
clc
% Displaying the process details
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 pt1
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);
r= Cp4/Cv4;
T4 = T3/((p3/p4)^((r-1)/r));
%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,5000);
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)
5/8
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 bar\n', p1);
fprintf('T1: %8.3f C\n', T1);
fprintf('h1: %8.3f KJ/kg\n', h1);
fprintf('s1: %8.3f KJ/kgK\n', s1);
fprintf('At State Point 2:\n');
fprintf('p2: %8.3f bar\n', p2);
fprintf('T2: %8.3f C\n', T2);
fprintf('h2: %8.3f kJ/kg\n', h2);
fprintf('s2: %8.3f kJ/kgK\n', s2);
fprintf('x2: %8.3fn\n', x2);
fprintf('At State Point 3:\n');
fprintf('p3: %8.3f bar\n', p3);
fprintf('T3: %8.3f K\n', T3);
fprintf('h3: %8.3f kJ/kg\n', h3);
fprintf('s3: %8.3f kJ/kgK\n', s3);
fprintf('At State Point 4:\n');
fprintf('p4: %8.3f bar\n', p4);
fprintf('T4: %8.3f K\n', T4);
fprintf('h4: %8.3f KJ/kg\n', h4);
fprintf('s4: %8.3f kJ/kgK\n', s4);
fprintf('Turbine Work: %8.3f kJ/kg\n', Wt);
fprintf('Pump Work: %8.3f kJ/kg\n', Wp);
fprintf('Wnet: %8.3f kJ/kg\n', Wnet);
fprintf('Efficiency: %8.3f Percent\n ', eff);
fprintf('S.S.C: %8.3f kJ/kWh', SSC);

Code Explanation-

i. Xsteam data is used to extract steam and water properties of enthaly , entropy at specific pressure and temperatures for sat liquid, sat vapour conditions etc .


ii. The program requires the input of Pressure ( in bar) at state point 1 ( turbine inlet) , Temperature at same point (deg celcius) and Temp at condenser inlet (point 2).


iii. With the help of these inlets & from Xsteam data, the program calculates all the state points of the Rankine cycle .


iv. The xsteam data works as , v. h1 = XSteam('h_pT' , p1 , T1) ; ( Returns the enthalpy of water at given pressure and temperature in bar and degC resp.)


vi. As we extract the data , we use thermodynamic relation to further find state points and extract their data from XSteam.


vii. Sf and sg , hf and hg , where f and g stands for saturated liquid and saturated vapour respectively.


viii. The net work , work done by turbine , work done to run the pump , Heat in and heat out are calculated using standard
thermodynamic relation.


ix. Efficiency and Specific steam consumption (s.s.c) of the Rankine cycle is calculated.


x. T , s and h are extracted at vapour and liquid line for plotting purpose , after 4th point for the variation you observe in the plot.


xi. Saturation curve is plotted in red for saturated liquid and saturated gas.


xii. Plot of T vs s and h vs s is created from all the points obtained from the program.


xiii. The plot changes as the user input changes for the above mentioned inputs.


xiv. Results are displayed in the command window.

Plot of Rankine Cycle In Temperature Entropy diagram.

Plot of Rankine Cycle In Enthalpy Entropy diagram.

Screenshot of the command window displaying result and input

1-

2-

Conclusion-

The plot for both T-S and H-S diagram of rankine cycle has succesfully plotted and attached. All the properties at all state point has been calculated with the help of XSTEAM file provided with the question and all the data points has been displayed in the screen and as the complete code was written carefully so no major error was found while writing the code. All the plot and screenshot are attached above, and it was observed that as the input parameter are changing values and plots are also changing so the simulator code is working properly.

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.