MATLAB Project - Rankine cycle Simulator
1. AIM: To create Rankine Cycle simulator using MATLAB.
2. THEORY AND GOVERNING EQUATIONS : RANKINE CYCLE
The Rankine cycle is a model used to predict the performance of steam turbine systems. It was also used to study the performance of reciprocating steam engines. The Rankine cycle is an idealized thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing phase change. It is an idealized cycle in which friction losses in each of the four components are neglected. The heat is supplied externally to a closed loop, which usually uses water as the working fluid.
The Rankine cycle or Rankine Vapor 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.
Processes of Rankine Cycle :
The ideal Rankine cycle consists of the following four processes:
1-2 Isentropic expansion in a turbine
2-3 Constant pressure heat rejection in a condenser
3-4 Isentropic work addition in a pump
4-1 Constant pressure heat addition in a boiler
In figure Schematic representation of an ideal Rankine cycle is shown.
Figure : Schematic representation of an ideal Rankine cycle
Figure: T-s diagram of an ideal Rankine cycle
There are four processes in the Rankine cycle. The states are identified by numbers in the T–s diagram.
- Process 1–2: The dry saturated vapour expands through a turbine, generating power. This decreases the temperature and pressure of the vapour, and some condensation may occur. In other words Process 1-2 is [Isentropic expansion]
- Process 2–3: The wet vapour then enters a condenser, where it is condensed at a constant pressure to become a saturated liquid. In other words Process 2-3 is [Constant pressure heat rejection in condenser]
- Process 3–4: The working fluid is pumped from low to high pressure. As the fluid is a liquid at this stage, the pump requires little input energy. In other words Process 3-4 is [Isentropic compression]
- Process 4–1: The high-pressure liquid enters a boiler, where it is heated at constant pressure by an external heat source to become a dry saturated vapour. The input energy required can be easily calculated graphically, using an enthalpy–entropy chart (h–s chart, or Mollier diagram), or numerically, using steam tables. In other words Process 4-1 is [Constant pressure heat addition in boiler]
In an ideal Rankine cycle the pump and turbine would be isentropic, i.e., the pump and turbine would generate no entropy and hence maximize the net work output.
Calculatations
Work done on pump, per kg of water `W_P= h_4-h_3`
Energy added in steam generator, `q_{i n}= h_1-h_4`
Work delivered by turbine, `W_T= h_1-h_2`
Energy rejected in the condenser, `q_{out}= h_2-h_3`
Net work output, `W_{n et} = W_T - W_P`
Back work ratio : Ratio of Pump work required and Turbine work generated.
The thermal efficiency of the Rankine cycle is given by,
`eta = W_{n et}/q_{i n} = frac{W_T - W_P}{q_{i n}}`
`eta = frac{(h_1-h_2)-(h_4-h_3)}{(h_1-h_4)}`
`eta = frac{(h_1-h_4)-(h_2-h_3)}{(h_1-h_4)} = 1 - frac{(h_2-h_3)}{(h_1-h_4)}`
By this equation efficiency of Rankine cycle is calculated.
3.MATLAB code :
% Project : Rankine cycle Simulator
clear all % Clear the Workspace
close all % Clear all figures and plot
clc % Clear the Command Window
% Print Heading
fprintf('\n RANKINE CYCLE SIMULATOR');
fprintf('\n\n1-2 is Isentropic Expansion in the Turbine');
fprintf('\n2-3 is Constant Pressure Heat Rejection by the Condenser');
fprintf('\n3-4 is Isentropic Compression in the Pump');
fprintf('\n4-1 is Constant Pressure Heat Addition by the Boiler\n');
% User Input
p1 = input('\nEnter the Pressure at the Turbine Inlet(in bar) :');
t1 = input('Enter the Temperature at the Turbine Inlet(in Degree Celcius) :');
p2 = input('Enter the Pressure at the Condenser(in bar) :');
% Calculating Various Parameter for Rankine Cycle
% h represent Enthalpy
% s represent Entropy
% t represent Temperature
% p represent Pressure
% v represent Volume
% For state point 1
h1 = XSteam('h_pT',p1,t1);
s1 = XSteam('s_pT',p1,t1);
% For state point 3
p3 = p2;
h3 = XSteam('hL_p',p3);
s3 = XSteam('sL_p',p3);
v3 = XSteam('vL_p',p3);
t3 = XSteam('Tsat_p',p3);
% For state point 2
t2 = t3;
s2 = s1;
sf2 = XSteam('sL_p',p2);
sg2 = XSteam('sV_p',p2);
hf2 = XSteam('hL_p',p2);
hg2 = XSteam('hV_p',p2);
x2 = ((s2-sf2)/(sg2-sf2));
h2 = hf2+(x2*(hg2-hf2));
% For state point 4
p4 = p1;
s4 = s3;
cp4 = XSteam('Cp_ps',p4,s4);
cv4 = XSteam('Cv_ps',p4,s4);
g4 = cp4/cv4;
o = (g4-1)/g4;
t4 = t3*((p4/p3)^o);
% Pump work
Wp = v3*(p4-p3)*100;
% Wp = h4/h3 from this equation
h4=h3+Wp;
% Turbine Work
Wt = h1-h2;
% Net work
Wnet = Wt - Wp ;
% Heat addition at steam generator
Qin = h1 - h4;
% Heat rejection at condenser
Qout = h2 - h4;
% Thermal efficiency of Cycle
Ntherm = (Wnet/Qin)*100;
% Back work ratio : Ratio of Pump work required and Turbine work generated.
BWR = Wp/Wt ;
% Calculating Values of liquid and vapour saturated lines
Pressure_range = 0:0.1:400 ;
for i = 1:length(Pressure_range)
tL_sat(i) = XSteam('Tsat_p',Pressure_range(i));
sL_sat(i) = XSteam('sL_p',Pressure_range(i));
sV_sat(i) = XSteam('sV_p',Pressure_range(i));
hL_sat(i) = XSteam('hL_p',Pressure_range(i));
hV_sat(i) = XSteam('hV_p',Pressure_range(i));
end
% For plot from state 4 to 1 on T-S diagram Different values
tp=XSteam('Tsat_p',p4); % Temperature in between saturated liquid and saturate vapour line for stage 4
s4_L=XSteam('sL_T',tp); % Entropy on liquid saturation point
s4_V=XSteam('sV_T',tp); % Entropy on Vapour saturation point
t_range = linspace(tp,t1,200);
for i=1:length(t_range)
s4V_1(i) = XSteam('s_pT',p4,t_range(i));
end
% Plot the result
% figure(1) contain complete result
% figure(2) contain Enthalpy v/s Entropy Diagram
% figure(3) contain Temperature v/s Entropy Diagram
% Define figure properties
figure('units','normalized','outerposition',[0 0 1 1])
figure(1)
% Compelete Result using subplot
% Plot Heading and process name using subplot
ax = subplot(6,4,[1,2,3,4,5,6,7,8]);
text(0.4,1,'RANKINE CYCLE SIMULATOR','FontSize',12,'FontWeight','bold');
text(0,0.8,'1-2 is Isentropic Expansion in the Turbine');
text(0,0.7,'2-3 is Constant Pressure Heat Rejection by the Condenser');
text(0,0.6,'3-4 is Isentropic Compression in the Pump');
text(0,0.5,'4-1 is Constant Pressure Heat Addition by the Boiler');
text(0,0.3,['Enter the Pressure at the Turbine Inlet(in bar) : ' , num2str(p1)]);
text(0,0.2,['Enter the Temperature at the Turbine Inlet(in Degree Celcius) : ', num2str(t1)]);
text(0,0.1,['Enter the Pressure at the Condenser(in bar) : ', num2str(p2)]);
text(0.47,0,'RESULT','FontWeight','bold');
set(ax,'visible','off')
% Print Stage 1 Values
ax = subplot(6,4,[9,13]);
text(0,1,'At State point 1 :');
text(0,0.8,[' P1 is : ', num2str(p1), ' Bar']);
text(0,0.7,[' T1 is : ', num2str(t1), ' Deg Celcius']);
text(0,0.6,[' H1 is : ', num2str(h1), ' kJ/kg']);
text(0,0.5,[' S1 is : ', num2str(s1), ' kJ/kgK']);
set(ax,'visible','off')
% Print work done and efficiency
text(0,0.3,'Other Results : ');
text(0,0.2,['Wt is : ', num2str(Wt), ' kJ/kg']);
text(0,0.1,['Wp is : ', num2str(Wp), ' kJ/kg']);
text(0,0,['Wnet is : ', num2str(Wnet), ' kJ/kg']);
set(ax,'visible','off')
% Print Stage 2 Values
ax = subplot(6,4,[10,14]);
text(0,1,'At State point 2 :');
text(0,0.8,[' P2 is : ', num2str(p2), ' Bar']);
text(0,0.7,[' T2 is : ', num2str(t2), ' Deg Celcius']);
text(0,0.6,[' H2 is : ', num2str(h2), ' kJ/kg']);
text(0,0.5,[' S2 is : ', num2str(s2), ' kJ/kgK']);
text(0,0.2,['BWR is : ', num2str(BWR)]);
text(0,0.1,['Ntherm is : ', num2str(Ntherm), ' Percent']);
set(ax,'visible','off')
% Print Stage 4 Values
ax = subplot(6,4,[11,15]);
text(0,1,'At State point 3 :');
text(0,0.8,[' P3 is : ', num2str(p3), ' Bar']);
text(0,0.7,[' T3 is : ', num2str(t3), ' Deg Celcius']);
text(0,0.6,[' H3 is : ', num2str(h3), ' kJ/kg']);
text(0,0.5,[' S3 is : ', num2str(s3), ' kJ/kgK']);
set(ax,'visible','off')
% Print Stage 4 Values
ax = subplot(6,4,[12,16]);
text(0,1,'At State point 4 :');
text(0,0.8,[' P4 is : ', num2str(p4), ' Bar']);
text(0,0.7,[' T4 is : ', num2str(t4), ' Deg Celcius']);
text(0,0.6,[' H4 is : ', num2str(h4), ' kJ/kg']);
text(0,0.5,[' S4 is : ', num2str(s4), ' kJ/kgK']);
set(ax,'visible','off')
% Plot of T-S Diagram using subplot
subplot(6,4,[17,18,21,22]);
hold on
plot(sL_sat,tL_sat,'LineStyle','--','linewidth',1,'color','b')
plot(sV_sat,tL_sat,'LineStyle','--','linewidth',1,'color','b')
plot([s1 s2 s3 s4 s4_L s4_V s4V_1],[t1 t2 t3 t4 tp tp t_range],'linewidth',1.5,'color','r')
title('T-S Diagram of Rankine Cycle')
xlabel('Enthaply')
ylabel('Temperature')
% Plot of H-S diagram using subplot
subplot(6,4,[19,20,23,24])
hold on
plot(sL_sat,hL_sat,'LineStyle','--','linewidth',1,'color','b')
plot(sV_sat,hV_sat,'LineStyle','--','linewidth',1,'color','b')
plot([s1 s2],[h1 h2],'linewidth',1.5,'color','r')
plot([s2 s3],[h2 h3],'linewidth',1.5,'color','r')
plot([s3 s4],[h3 h4],'linewidth',1.5,'color','r')
plot([s4 s1],[h4 h1],'linewidth',1.5,'color','r')
title('H-S Diagram of Rankine Cycle')
xlabel('Enthaply')
ylabel('Entropy')
% Create second figure which is individual show T-S Diagram
figure('units','normalized','outerposition',[0 0 1 1])
figure(2)
hold on
plot(sL_sat,tL_sat,'LineStyle','--','linewidth',1,'color','b')
plot(sV_sat,tL_sat,'LineStyle','--','linewidth',1,'color','b')
plot([s1 s2 s3 s4 s4_L s4_V s4V_1],[t1 t2 t3 t4 tp tp t_range],'linewidth',1.5,'color','r')
title('T-S Diagram of Rankine Cycle')
xlabel('Enthaply')
ylabel('Temperature')
% Create Third fgure which is individual show H-S Diagram
figure('units','normalized','outerposition',[0 0 1 1])
figure(3)
hold on
plot(sL_sat,hL_sat,'LineStyle','--','linewidth',1,'color','b')
plot(sV_sat,hV_sat,'LineStyle','--','linewidth',1,'color','b')
plot([s1 s2],[h1 h2],'linewidth',1.5,'color','r')
plot([s2 s3],[h2 h3],'linewidth',1.5,'color','r')
plot([s3 s4],[h3 h4],'linewidth',1.5,'color','r')
plot([s4 s1],[h4 h1],'linewidth',1.5,'color','r')
title('H-S Diagram of Rankine Cycle')
xlabel('Enthaply')
ylabel('Entropy')
5.CONCLUSION:
Result at
Turbine Inlet temperature = 400° C
Turbine Inlet Pressure = 30 bars
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure
Figure 1 : Complete Result
Figure 2 : T-S Diagram
Figure 3 : H-S Diagram
From this project successfully Simulate Rankine Cycle
6. Reference
https://energyeducation.ca/encyclopedia/Rankine_cycle