Challenge

Project 2 - Rankine cycle Simulator

Title: Detailed report on Rankine cycle simulator

Aim: Create Rankine cycle simulator and calculate the state points, Net work output and back work ratio.

Objective:

  1. Create a Rankine cycle simulator.
  2. Calculate the state points of the Rankine cycle.
  3. Plot the graph of entropy and enthalpy with corresponding values.
  4. Calculating Net work output and back work ratio.

Rankine cycle description:

“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.”

Processes in Rankine cycle:

  1. 1-2 Isentropic compression.
  2. 2-3 Constant pressure heat addition.
  3. 3-4 Isentropic expansion.
  4. 4-1 Constant pressure heat rejection.

Inputs taken from user:

  1. Enter turbine inlet temperature in degree Celsius: 400
  2. Enter turbine inlet pressure in bar: 30
  3. Enter turbine outlet pressure in bar: 005

Procedure:

  1. Take inputs from user.
  2. Calculate entropy, enthalpy, work out at turbine, pressure, volume, quality of steam, specific volume, work consumed by pump, total work output, heat input, efficiency cycle, back work ratio, properties at all 4 points and intermediate points.
  3. Print all the outputs by using command fprintf.
  4. Plot T-S and H-S plot also plot saturation lines.
  5. Use for loop to store temperature array of 2000 values.
  6. Plot figure 1 for Temperature vs Entropy, figure 2 for Enthalpy vs Entropy.
  7. Plot Rankine cycle simulator in figure 1 and figure 2.
  8. Here is the detailed code for Rankine cycle simulator: -
1.	         % Project for Rankine cycle simulator

2.	clear 
3.	close all
4.	clc

5.	% Taking inputs from user
6.	T3 = input('Enter turbine inlet temperature in degree celcius: ');
7.	P3 = input('Enter turbine inlet pressure in bar: ');
8.	P4 = input('Enter turbine outlet pressure in bar: ');

9.	% There are total 4 processes 
10.	% Isentropic compression from 1-2
11.	% Constant pressure heat addition from 2-3
12.	% Isentropic expansion from 3-4
13.	% Constant pressure heat rejection from 4-1

14.	% Calculate Enthalpy at point 1
15.	Hf1 = XSteam('hL_p', P4);

16.	% Calculate Enthaly at point 3
17.	H3 = XSteam('h_pT',P3,T3);

18.	% Calculate Entropy at point 1
19.	Sf1 = XSteam('sL_p',P4);

20.	% Calculate Entropy at point 3
21.	S3 = XSteam('s_pT',P3,T3);

22.	% As line 3-4 is isentropic
23.	S4 = S3;

24.	% Calculating Entropy different at 0.005 bar
25.	SG4 = XSteam('sV_p', P4)-XSteam('sL_p',P4);

26.	% Calculating quality of steam at point 4
27.	X = (S4-Sf1)/SG4;

28.	% Calculating Enthalpy different at 0.005 bar
29.	HG4 = XSteam('hv_p',P4)-XSteam('hL_p',P4);

30.	% Calculating Enthalpy at point 4
31.	H4 = Hf1 + (X*HG4);

32.	% Calculating work out at turbine
33.	WT = H3-H4;

34.	% Specific volume at point 1
35.	Sp_V = XSteam('vL_p' ,P4);

36.	% Work consmed by pump
37.	WP = Sp_V*(P3-P4);

38.	% Total work output 
39.	Total_work = WT-WP;

40.	% Enthalpy at saturation liquid at point 2
41.	H2 = WP+Hf1;

42.	% Heat input to boiler
43.	Inp_Heat = H3-H2;

44.	% Efficiency of cycle
45.	eff = (Total_work/Inp_Heat);

46.	% Back work ratio
47.	Bck = WP/WT;

48.	% Properties at point 1
49.	T1 = XSteam('Tsat_p',P4); % XSteam function used
50.	P1 = P4;
51.	H1 = Hf1;
52.	S1 = Sf1;

53.	% Properties at point 2
54.	T2 = XSteam('T_ps',P3,S1);
55.	P2 = P3;
56.	H2 = XSteam('h_ps',P3,S1);
57.	S2 = S1;

58.	% Properties at point 3
59.	T3;
60.	P3;
61.	H3;
62.	S3;

63.	%  Properties at point 4
64.	T4 = XSteam('T_ph',P4,H4);
65.	P4;
66.	H4;
67.	S4;

68.	% Properties of intermidiate points
69.	T5 = XSteam('Tsat_p',P3);
70.	P5 = P3;
71.	H5 = XSteam('hL_p',P3);
72.	S5 = XSteam('sL_p',P3);

73.	T6 = XSteam('Tsat_p',P3);
74.	P6 = P3;
75.	H6 = XSteam('hV_p',P3);
76.	S6 = XSteam('sV_p',P3);

77.	% outputs
78.	fprintf('Process 1-2 isentropic compression\n' );
79.	fprintf('Process 2-3 Constant pressure heat addition\n' );
80.	fprintf('Process 3-4 Isentropic expanssion\n' );
81.	fprintf('Process 4-1 Constant pressure heat rejection\n\n' );

82.	fprintf('Properties at point 1:\n');
83.	fprintf('T1 = %f Celcius\n', T1);
84.	fprintf('P1 = %f bar\n', P1);
85.	fprintf('H1 = %f kj/kg\n',H1);
86.	fprintf('S1 = %f kj/kg\n',H1);
87.	fprintf('S1 = %f kj/kg \n\n',S1);

88.	fprintf('Properties at point 2:\n');
89.	fprintf('T2 = %f Celcius\n' , T2);
90.	fprintf('P2 = %f bar\n' ,P2);
91.	fprintf('H2 = %f kj/kg\n' ,H2);
92.	fprintf('S2 = %f kj/kg \n\n' ,S2);

93.	fprintf('Properties at point 3:\n');
94.	fprintf('T3 = %f Celcius\n' , T3);
95.	fprintf('P3 = %f bar\n' , P3);
96.	fprintf('H3 = %f kj/kg\n' , H3);
97.	fprintf('S3 = %f kj/kg \n\n' ,S3);

98.	fprintf('Properties at point 4:\n');
99.	fprintf('T4 = %f Celcius\n' , T4);
100.	fprintf('P4 = %f bar\n' , P4);
101.	fprintf('H4 = %f kj/kg\n' , H4);
102.	fprintf('S4 = %f kj/kg \n\n' , S4);

103.	fprintf('          RESULTS          \n');
104.	fprintf('Net work output is %f kj\n' ,Total_work);
105.	fprintf('Efficiency of cycle is %f %\n' , eff);
106.	fprintf('Back work ratio is %f\n' ,Bck);

107.	% Plotting T-S and H-S plot
108.	% Plotting saturation lines 
109.	T = (1:2000);                          % Array stores temperature values
110.	for i = 1:1:2000                       % Loop for stoaring values...
111.	SL(1,i) = XSteam('sL_T',i);  
112.	SV(1,i) = XSteam('sV_T',i);   
113.	HL(1,i) = XSteam('hL_T',i);
114.	HV(1,i) = XSteam('hV_T',i);
115.	end

116.	figure(1)                        
117.	plot(SL,T,'r','linewidth',2);           % Plots liquid saturation line
118.	hold on;                                % Holds figure 1
119.	plot(SV,T,'r','linewidth',2);           % Plots vapour saturation line
120.	xlabel('Entropy(kJ/kg C)');             % X axis label
121.	ylabel('Temperature (C)');              % Y axis label
122.	title('Temperature v/s Entropy plot');  % title of plot

123.	figure(2)                               % Makes figure 2 active
124.	plot(SL,HL,'r','linewidth',2);          % Plots liquid saturation line
125.	hold on;                                % Holds figure 2 
126.	plot(SV,HV,'r','linewidth',2);          % Plots vapour saturation line
127.	xlabel('Entropy (kj/kg C)');            % X axis label
128.	ylabel('Enthaly (kj/kg)');              % Y axis label
129.	title('Enthaly v/s Entropy plot');      % Title of plot

130.	% Plotting the rankine cycle
131.	figure(1)                               % Makes figure 1 active
132.	plot([S1,S2,S5,S6,S3,S4,S1],[T1,T2,T5,T6,T3,T4,T1],'k','linewidth',2);
133.	figure(2)                               % Makes figure 2 active
134.	plot([S1,S2,S5,S6,S3,S4,S1],[H1,H2,H5,H6,H3,H4,H1],'k','linewidth',2);


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.