Rankine cycle Simulator
Rankine cycle consists of 4 stages:
Process 1-2: Isentropic compression in pump
Process 2-3: Constant pressure Heat addition in Boiler
Process 3-4: Isentropic expansion in Turbine
Process 4-1: Constant pressure Heat rejection in Condenser
At inlet of the steam turbine, steam is either in superheated state or in saturated condition.
At exit of steam turbine, steam is either in saturated state or in wet state.
These assumptions were considered while coding the Rankine cycle Simulator.
clear all
close all
clc
display('Process 1-2: Isentropic compression in pump')
display('Process 2-3: Constant pressure Heat addition in Boiler')
display('Process 3-4: Isentropic expansion in Turbine')
display('Process 4-1: Constant pressure Heat rejection in Condenser')
fprintf('\n')
P3=input('Enter pressure at Turbine Inlet (in bar)= P3 = ');
T3=input('Enter temperature at Turbine Inlet (in degree celcius)= T3 = ');
P4=input('Enter pressure at Condenser (in bar)= P4 = ');
fprintf('\n')
%At Point 3 (Turbine Inlet)
Tsat=XSteam('Tsat_p',P3);
if T3>Tsat
Tsup=T3;
s3=XSteam('s_pT',P3,Tsup);
h3=XSteam('h_pT',P3,Tsup);
elseif T3==Tsat
s3=XSteam('sV_p',P3);
h3=XSteam('hV_p',P3);
else
display('Enter Temperature at Turbine inlet greater than or equal to saturation temperature')
end
%At Point 3'
Tsup=T3;
Tsat=XSteam('Tsat_p',P3);
s_3=XSteam('sV_p',P3);
h_3=XSteam('hV_p',P3);
%At Point 4 (Condenser Inlet)
ssat_4=XSteam('sV_p',P4);
s4=s3;
if s4>ssat_4
display('Enter Lower value of Condenser inlet pressure as exit condition of steam from turbine should not be superheated')
elseif s4==ssat_4
T4=XSteam('T_ps',P4,s4);
h4=XSteam('hV_p',P4);
x=1;
else
T4=XSteam('T_ps',P4,s4);
h4=XSteam('h_ps',P4,s4);
hf=XSteam('hL_p',P4);
hg=XSteam('hV_p',P4);
hfg=hg-hf;
x=(h4-hf)/hfg;
end
%At Point 1 (Pump Inlet)
P1=P4;
T1=XSteam('Tsat_p',P1);
h1=XSteam('hL_p',P1);
s1=XSteam('sL_p',P1);
vf=XSteam('vL_p',P1);
%At Point 2 (Boiler Entry)
s2=s1;
P2=P3;
Wp=vf*(P2-P1)*100;
h2=h1+Wp;
T2=XSteam('T_ph',P2,h2);
%At Point 2'
T_2=Tsat;
s_2=XSteam('sL_p',P2);
%Turbine work
Wt=h3-h4;
%Pump work
Wp;
%Net work
Wnet=Wt-Wp;
%Thermodynamic efficiency
nthem=(Wnet*100)/(h3-h2);
%Specific steam consumption
ssc=3600/Wnet;
%Plotting of Graph
%Saturation dome T-S diagram
figure(1)
hold on
globalT=linspace(0,374,1000);
for i=1:length(globalT)
global_sf(i)=XSteam('sL_T',globalT(i));
global_sg(i)=XSteam('sV_T',globalT(i));
plot(global_sf(i),globalT(i))
plot(global_sg(i),globalT(i))
axis([0 10 0 1000])
xlabel('Entropy (kJ/kgK)');
ylabel('Temperature (Degree Celcius)');
end
%Plotting of Isobaric processes
hold on
Tiso1=linspace(T2,T_2,1000);
for i=1:length(Tiso1)
siso1(i)=XSteam('s_pT',P2,Tiso1(i));
plot(siso1(i),Tiso1(i),'-g')
end
hold on
Tiso2=linspace(Tsat,Tsup,1000);
for i=1:length(Tiso2)
siso2(i)=XSteam('s_pT',P2,Tiso2(i));
plot(siso2(i),Tiso2(i),'-g')
end
%Plotting of Points
plot(s1,T1,'go')
plot(s2,T2,'go')
plot(s3,T3,'go')
plot(s4,T4,'go')
plot(s_3,Tsat,'go')
plot(s_2,T_2,'go')
plot([s1 s2],[T1 T2],'color','g')
plot([s3 s4],[T3 T4],'color','g')
plot([s1 s4],[T1 T4],'color','g')
plot([s_2 s_3],[T_2 Tsat],'color','g')
hold off
%Plotting of graph
%Saturation curve H-S diagram
figure(2)
hold on
for i=1:length(globalT)
global_hf(i)=XSteam('hL_T',globalT(i));
global_hg(i)=XSteam('hV_T',globalT(i));
plot(global_sf(i),global_hf(i))
plot(global_sg(i),global_hg(i))
axis([0 10 0 5000])
xlabel('Entropy (kJ/kgK)');
ylabel('Enthalpy()kJ/kg');
end
%Plotting of Points
plot(s1,h1,'ro')
plot(s2,h2,'ro')
plot(s3,h3,'ro')
plot(s4,h4,'ro')
plot([s1 s2],[h1 h2],'color','r')
plot([s2 s3],[h2 h3],'color','r')
plot([s3 s4],[h3 h4],'color','r')
plot([s1 s4],[h1 h4],'color','r')
hold off
%RESULTS
disp('RESULTS')
fprintf('\n At Point 1:')
fprintf('\nTemperature at point 1 : %f degree celcius',T1);
fprintf('\n Pressure at point 1 : %f bar',P1);
fprintf('\n Entropy at point 1 : %f kJ/kgK',s1);
fprintf('\n Enthalpy at point 1 : %f kJ/kg',h1);
fprintf('\n')
fprintf('\n At Point 2')
fprintf('\n Temperature at point 2 : %f degree celcius ',T2);
fprintf('\n Pressure at point 2 : %f bar',P2);
fprintf('\n Entropy at point 2 : %f kJ/kgK',s2);
fprintf('\n Enthalpy at point 2 : %f kJ/kg',h2);
fprintf('\n')
fprintf('\n At Point 3')
fprintf('\n Temperature at point 3 : %f degree celcius',T3);
fprintf('\n Pressure at point 3 : %f bar',P3);
fprintf('\n Entropy at point 3 : %f kJ/kgK',s3);
fprintf('\n Enthalpy at point 3 : %f kJ/kg',h3);
fprintf('\n')
fprintf('\n At Point 4')
fprintf('\n Temperature at point 4 : %f degree celcius',T4);
fprintf('\n Pressure at point 4 : %f bar',P4);
fprintf('\n Entropy at point 4 : %f kJ/kgK',s4);
fprintf('\n Enthalpy at point 4 : %f kJ/kg',h4);
fprintf('\n')
fprintf('\n Work done by Turbine = %f kJ/kg',Wt);
fprintf('\n')
fprintf('\n Work done by Pump = %f kJ/kg',Wp);
fprintf('\n')
fprintf('\n Work done by Steam power plant = %f kJ/kg',Wnet);
fprintf('\n')
fprintf('\n Thermal efficiency = %f percent',nthem);
fprintf('\n')
fprintf('\n Specific Steam consumption = %f kg/kWhr',ssc);
Results:
1) At inlet of turbine, steam is satured:
Output window:
2) At inlet of turbine, steam is superheated:
Output window: