Project 2 - Rankine cycle Simulator
AIM: Create a Rankine Cycle Simulator using OCTAVE/MATLAB.
DESCRIPTION
RANKINE CYCLE
The steam engine and steam turbines in which steam is used as working medium follow Rankine
cycle.
The ideal Rankine cycle does not involve any internal irreversibilities
and consists of the following four processes:
- 1-2 Isentropic compression in a pump
- 2-3 Constant pressure heat addition in a boiler
- 3-4 Isentropic expansion in a turbine
- 4-1 Constant pressure heat rejection in a condenser
Figure 1: Basic layout of the simple ideal Rankine cycle.
Figure 2: T-S diagram of the simple ideal Rankine cycle.
Energy Analysis of the Ideal Rankine Cycle
All four components associated with the Rankine cycle (the pump, boiler, turbine, and condenser) are steady-flow devices, and thus all four processes that make up the Rankine cycle can be analyzed as steady-flow processes. The kinetic and potential energy changes of the steam are usually small relative
to the work and heat transfer terms and are therefore usually neglected. Then the steady-flow energy equation per unit mass of steam reduces to
qin - qout =win -wout = he - hi (kJ/Kg)
The boiler and the condenser do not involve any work, and the pump and the turbine are assumed to be isentropic. Then the conservation of energy relation for each device can be expressed as follows:
Pump (q = 0): wpump,in = h2 -h1
or,
wpump,in =v (P2 -P1 )
Boiler (w = 0): qin = h3 -h2
Turbine (q =0): wturb,out = h3- h4
Condenser (w =0): qout = h4 - h1
The thermal efficiency of the Rankine cycle is determined from
Where, wnet = qin - qout = wturb.out - wpump.in
Back work Ratio:
The ratio of the pump work to the turbine work called the back-work ratio.
OBJECTIVE:
Required Inputs:
Turbine Inlet temperature = 400° C
Turbine Inlet Pressure = 30 bars
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure
Calculate the followings,
- Net work output
- Back work ratio
Figure 3: Flow of the project.
CODE
% Rankine Cycle Simulator
clear all;
close all;
clc;
%% processes in the cycle
disp('PROCESSES IN A IDEAL RANKINE CYCLE : ')
disp('1-2 : Isentropic Compression in the pump ')
disp('2-3 : Isobaric Heat Addition by the boiler ')
disp('3-4 : Isentropic Expansion in the turbine ')
disp('4-1 : Isobaric Heat Rejection by the condenser ')
disp(' ')
%% Initialization
t = linspace(0,373.15,400);
P3 = input('Enter the pressure of the Turbine at inlet(in Bar) : ');
T3 = input(['Enter the temperature of the Turbine at inlet(in ' char(176) 'C) : ']);
P4 = input('Enter the pressure of the Condenser(in bar) : ');
disp(' ')
%% Assigning the values of P,T,h,s for each state using 'XSteam' library
% State 3
h3 = XSteam('h_pT',P3,T3); % Enthalpy
s3 = XSteam('s_pT',P3,T3); % Entropy
hl3 = XSteam('hL_p',P3); % Saturated liquid enthalpy
hg3 = XSteam('hV_p',P3); % Saturated vapour enthalpy
sl3 = XSteam('sL_p',P3); % Saturated liquid entropy
sg3 = XSteam('sV_p',P3); % Saturated vapour entropy
Tsat3 = XSteam('Tsat_p',P3); % Saturation temperature
% State 4
s4 = s3;
sl4 = XSteam('sL_p',P4);
sg4 = XSteam('sV_p',P4);
x = (s4-sl4)/(sg4-sl4); % dryness fraction
hl4 = XSteam('hL_p',P4);
hg4 = XSteam('hV_p',P4);
h4 = hl4 + x*(hg4-hl4);
T4 = XSteam('T_ph',P4,h4);
Tsat4 = XSteam('Tsat_p',P4);
% State 1
h1 = hl4;
s1 = sl4;
P1 = P4;
T1 = T4;
% State 2
s2 = s1;
P2 = P3;
h2 = XSteam('h_ps',P2,s2);
T2 = XSteam('T_ps',P2,s2);
%% Plotting
% T-s Diagram
figure(1), clf
hold on
% Saturation Curve
for i = 1:length(t)
plot(XSteam('sL_T',t(i)),t(i),'r.')
plot(XSteam('sV_T',t(i)),t(i),'r.')
end
% main Cycle
plot([s3 s4],[T3 T4],'linew',2)
text(s3,T3,'3','FontSize',15)
if x > 1
T1 = Tsat4;
plot([s4 sg4 s1 s2],[T4 Tsat4 T1 T2],'linew',2)
T4 = Tsat4;
text(s4,T4,'4','FontSize',15)
text(s1,T1,'1','FontSize',15)
else
plot([s4 s1 s2],[T4 T1 T2],'linew',2)
text(s4,T4,'4','FontSize',15)
text(s1,T1,'1','FontSize',15)
end
n = linspace(T3,T4,500);
for i = 1:length(n)
plot(XSteam('s_pT',P3,n(i)),n(i),'.','linew',2)
end
plot([sl3 sg3],[Tsat3 Tsat3],'linew',2)
text(sl3,Tsat3,'2','FontSize',15)
xlabel('Entropy(kJ/kg-K)')
ylabel('Temperature(k)')
title('T-s Diagram')
% h-s Diagram
figure(2), clf
hold on
% Saturation curve
for i = 1:length(t)
plot(XSteam('sL_T',t(i)),XSteam('hL_T',t(i)),'r.')
plot(XSteam('sV_T',t(i)),XSteam('hV_T',t(i)),'r.')
end
% Main Cycle
plot([s3 s4 s1 s2 s3],[h3 h4 h1 h2 h3],'linew',2)
text(s3,h3,'3','FontSize',15)
text(s4,h4,'4','FontSize',15)
text(s1,h1,'1','FontSize',15)
text(s2,h2+90,'2','FontSize',15)
xlabel('Entropy(kJ/kg-K)')
ylabel('Enthalpy(kJ/kg)')
title('h-s Diagram')
% Work done by turbine(positive work)
W_turbine = h3 - h4;
% Work given to pump(negative work)
W_pump = h2 - h1;
% Net work dome
W_net = W_turbine - W_pump;
% Thermal efficiency
thermal_efficiency = (1 - ((h4 - h1)/(h3 - h2)))*100;
% Back work ratio
BWR = W_pump/W_turbine;
% Specific Steam Conductivity
S.S.C = 3600/W_turbine;
%% Displaying in the command window
disp('RESULTS :')
disp('At state point 1: ')
fprintf('P1 = %.2f bar \n',P1)
fprintf(['T1 = %.2f' char(176) 'C \n'],T1)
fprintf('h1 = %.2f kJ/kg \n',h1)
fprintf('s1 = %.2f kJ/kgK \n',s1)
disp(' ')
disp('At state point 2: ')
fprintf('P2 = %.2f bar \n',P2)
fprintf(['T2 = %.2f' char(176) 'C \n'],T2)
fprintf('h2 = %.2f kJ/kg \n',h2)
fprintf('s2 = %.2f kJ/kgK \n',s2)
disp(' ')
disp('At state point 3: ')
fprintf('P3 = %.2f bar \n',P3)
fprintf(['T3 = %.2f' char(176) 'C n'],T3)
fprintf('h3 = %.2f kJ/kg \n',h3)
fprintf('s3 = %.2f kJ/kgK \n',s3)
disp(' ')
disp('At state point 4: ')
fprintf('P4 = %.2f bar \n',P4)
fprintf(['T4 = %.2f' char(176) 'C \n'],T4)
fprintf('h4 = %.2f kJ/kg \n',h4)
fprintf('s4 = %.2f kJ/kgK \n',s4)
disp(' ')
fprintf('Work done by turbine = %.2f kJ/kg \n', W_turbine)
fprintf('Work done by pump = %.2f kJ/kg \n', W_pump)
fprintf('Net work done = %.2f kJ/kg \n', W_net)
fprintf('Thermal efficiency = %.2f %% \n', thermal_efficiency)
fprintf('Back-work ratio = %f \n', BWR)
fprintf('Specific Steam Conductivity = %.2f kg/kWh \n', S.S.C)
EXPLANATION OF THE CODE
- Take inputs of as given the question by using input command.
- Assign values from the Xsteam file by providing other arguments (Temperature and Pressure).
- Calculate the dryness fraction for calculating the missing data.
- Plot the saturation curves by using for loops and by using the values at saturated state.
- Plot the state points by using the state variables (h,s, t, s).
- Calculate the Wnet and Back work ratio by using suitable formulas.
- Display the results using disp command
Inputs
Figure 4: Inputs
OUTPUT
Figure 5: Results in the command window.
Figure 6: Net work output, Thermal efficiency, Back work ratio, and Specific Steam Conductivity.
Figure 7: T-S diagram.
Figure 8: H-S diagram.
REFERENCES
Thermodynamics: An Engineering Approach
Book by Michael A. Boles and Yungus A. Cengel