Rankine cycle Simulator
Aim :
- To Develop a basic program that calculates the state points
- To add the thermodynamic relation to get the points inbetween the state variables.
- To plot rankine cycle on T-s and H-s curve.
Theory :
The Rankine cycle is the fundamental operating cycle of all power plants where an operating fluid is continuously evaporated and condensed. The selection of operating fluid depends mainly on the available temperature range. Figure 1 shows the idealized Rankine cycle. The Rankine cycle operates in the following steps:
1-2 Isentropic Expansion. The vapor is expanded in the turbine, thus producing work which may be converted to electricity. In practice, the expansion is limited by the temperature of the cooling medium and by the erosion of the turbine blades by liquid entrainment in the vapor stream as the process moves further into the two-phase region. Exit vapor qualities should be greater than 90% to increase the life of turbine blade.
2-3 Isobaric Heat Rejection. The vapor-liquid mixture leaving the turbine (2) is condensed at low pressure, usually in a surface condenser using cooling water. In well designed and maintained condensers, the pressure of the vapor is well below atmospheric pressure, approaching the saturation pressure of the operating fluid at the cooling water temperature.
3-4 Isentropic Compression. The pressure of the condensate is raised in the feed pump. Because of the low specific volume of liquids, the pump work is relatively small and often neglected in thermodynamic calculations.
4-1 Isobaric Heat Transfer. High pressure liquid enters the boiler from the feed pump (4) and is heated to the saturation temperature . Further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam (1).
Figure1 Idealized Rankine cycle
The efficiency of power cycles is defined as
Standard Xsteam library was used to get the steam table data for water
MATLAB Code:
%Rankine Cycle Simulator
close all
clear all
clc
disp('RANKINE CYCLE SIMULATOR')
disp('1-2 is isentropic expansion in turbine')
disp('2-3 is constant pressure heat rejection in condenser')
disp('3-4 is isentropic compression in pump')
disp('4-1 is constant pressure heat addition in boiler')
p1=input('enter the pressure at the inlet of turbine (in bar)= ');
t1=input('enter the temp at the inlet of turbine (in degree C)= ');
p2=input('enter the pressure at the inlet of condenser (in bar)= ');
%steam condition at the inlet of turbine
h1=XSteam('h_pt',p1,t1);
s1=XSteam('s_pt',p1,t1);
%steam condition at the outlet of turbine
sg2=XSteam('sV_p',p2);
sf2=XSteam('sL_p',p2);
sfg2=sg2-sf2;
x2=(s1-sf2)/sfg2;
s2=sf2+x2*sfg2;
hf2=XSteam('hL_p',p2);
hg2=XSteam('hV_p',p2);
hfg2=hg2-hf2;
h2=hf2+x2*hfg2;
t2=XSteam('Tsat_p',p2);
%workdone by the turbine
W_t=h1-h2;
%steam condition at the outlet of condenser
p3=p2;
t3=XSteam('Tsat_p',p2);
h3=XSteam('hL_p',p2);
s3=XSteam('sL_p',p2);
vf=XSteam('vL_p',p2);
t22=t3;
%calculation of pump work
W_p=vf*(p1-p2)*100;
%steam Condition at state 4
p4=p1;
h4=W_p+h3;
s4=s3;
t4=XSteam('T_ph',p4,h4);
%work net
W_net=W_t-W_p;
%heat supplied
Q_s=h1-h4;
%heat rejected
Q_r=h2-h3;
%efficiency
efficiency=(W_net/Q_s);
%specific steam consumption
SSC=3600/W_net;
tf_sat=XSteam('Tsat_p',p1);
sf_sat=XSteam('sL_p',p1);
hf_sat=XSteam('hL_p',p1);
sg_sat=XSteam('sV_p',p1);
hg_sat=XSteam('hV_p',p1);
%plotting T-S diagram
hold on
%for plottin saturation curve
tsat1=linspace(0,374,1000);
for i=1:length(tsat1)
ss1(i)=XSteam('sL_T',tsat1(i));
end
for j=1:length(tsat1)
ss2(j)=XSteam('sV_T',tsat1(j));
end
plot(ss1,tsat1,'b')
plot(ss2,tsat1,'r')
%for saturation temp at p1
temp=XSteam('Tsat_p',p1);
t=linspace(t4,temp,30);
for i=1:length(t)
S(i)=XSteam('s_pt',p1,t(i));
hold on
end
t0=linspace(temp,t1,300);
for i=1:length(t0)
S0(i)=XSteam('s_pt',p1,t0(i));
end
%for plotting turbine work
plot([s1 s2],[t1 t2],'g')
%for heat rejection in condenser
plot([s2 s3],[t2 t3],'b')
%for pump work
plot([s3 s4],[t3 t4],'r')
%plotting curved line(constant pressure line in wet region) from outlet of
%the pump to the point from where phase change starts
plot(S,t,'y')
%plotting the phase change region
plot([sf_sat sg_sat],[tf_sat tf_sat],'y')
%plotting the curved constant pressure line from where the phase change
%ends to the superheated point
plot(S0,t0,'y')
legend('Saturation Curve L','Saturation Curve V','Turbine','condenser','pump','boiler','location','northwest')
title('T-S Diagram')
xlabel('Entropy')
ylabel('Temperature')
%plotting H-S diagram
figure(2)
hold on
%for plotting the saturation curve
tsat1=linspace(0,374,1000);
for i=1:length(tsat1)
hh1(i)=XSteam('hL_T',tsat1(i));
end
for j=1:length(tsat1)
hh2(j)=XSteam('hV_T',tsat1(j));
end
plot(ss1,hh1,'b')
plot(ss2,hh2,'r')
%for plotting tubine
plot([s1 s2],[h1 h2],'g')
%for condenser
plot([s2 s3],[h2 h3],'b')
%for plotting pump
plot([s3 s4],[h3 h4],'r')
s=linspace(s3,s1,1000);
for i=1:length(s)
h(i)=XSteam('h_ps',p1,s(i));
end
%for plotting boiler
% plot([s4 s1],[h4 h1],'y')
plot(s,h,'y')
legend('Saturation Curve L','Saturation Curve V','Turbine','condenser','pump','boiler','location','northwest')
title('H-S Diagram')
xlabel('Entropy')
ylabel('Enthalpy')
%outputs
%at state 1
fprintf('At State Point 1:rn')
fprintf('P1 is : %f Barrn',p1)
fprintf('T1 is : %f Deg Celciusrn',t1)
fprintf('H1 is : %f KJ/Kgrn',h1)
fprintf('S1 is : %f KJ/KgKrn',s1)
%at state 2
fprintf('At State Point 2:rn')
fprintf('P2 is : %f Barrn',p2)
fprintf('T2 is : %f Deg Celciusrn',t2)
fprintf('H2 is : %f KJ/Kgrn',h2)
fprintf('S2 is : %f KJ/KgKrn',s2)
fprintf('X is : %f rn',x2)
%at state 3
fprintf('At State Point 3:rn')
fprintf('P3 is : %f Barrn',p3)
fprintf('T3 is : %f Deg Celciusrn',t3)
fprintf('H3 is : %f KJ/Kgrn',h3)
fprintf('S3 is : %f KJ/KgKrn',s3)
%state 4
fprintf('At State Point 4:rn')
fprintf('P4 is : %f Barrn',p4)
fprintf('T4 is : %f Deg Celciusrn',t4)
fprintf('H4 is : %f KJ/Kgrn',h4)
fprintf('S4 is : %f KJ/KgKrn',s4)
%calculations
fprintf('Work Done By Turbine : %f kJ/kgrn',W_t)
fprintf('Work Done By Pump : %f kJ/kgrn',W_p)
fprintf('Heat Added in The Boiler: %f KJ/kgrn',Q_s)
fprintf('Heat Rejected in The Condenser: %f KJ/kgrn',Q_r)
fprintf('Thermal Efficiency is : %f %%rn',efficiency*100)
fprintf('Specific Steam Consumption : %f KJ/kWhrn',SSC)
Result :
Conclusion: A Program to Develop a basic comand that calculates the state point and plot rankin cycle on T-s and H-s curve has been written.