Project 2 - Rankine cycle Simulator
AIM:
Creating a Rankine Cycle Simulator & Calculating the state points of the Rankine Cycle based on user inputs, Plotting the corresponding T-S and H-S plots for the given set of inputs
Theory:
Rankine cycle is the most basic thermodynamic cycle for any steam powerplant. It starts with heating of water in boiler at constant pressure to produce steam.
The steam produced is then isentropically expanded in turbine to produce work. After turbine the steam in goes into the condenser where it is cooled and converted into water at constant pressure. The water is then again pumped back to boiler by a pump and cylce continues.
Process 1-2 : Reversible adiabatic expansion in the turbine (or steam engine).
Process 2-3 : Constant-pressure transfer of heat in the condenser.
Process 3-4 : Reversible adiabatic pumping process in the feed pump.
Process 4-1 : Constant-pressure transfer of heat in the boiler.
Required Inputs:
Turbine Inlet temperature = 400° C
Turbine Inlet Pressure = 30 bars
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure
Program:
clc
clear all
close all
disp(' RANKINE CYCLE SIMULATOR ')
disp('1-2 is Isentopic expansion in the turbine')
disp('2-3 is Constant Pressure Heat Rejection by the Condenser')
disp('3-4 is Isentropic Compression in the Pump')
disp('4-1 is Constant Pressure Heat Addition by the boiler')
P1 = input('Enter 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 Condencer (in bar): ');
%n = 1.4;
% value for state poin 1
disp ('At state point 1:')
H1 = XSteam('h_pT',P1,T1);
S1 = XSteam('s_pT',P1,T1);
disp(sprintf('P1 is : %d Bar',P1))
disp(sprintf('T1 is : %7.3f Deg celcius',T1))
disp(sprintf('H1 is : %7.3f KJ/kg',H1))
disp(sprintf('S1 is : %5.3f KJ/kgK',S1))
%value for state point 2
S2 = S1;
Sg2 = XSteam('sV_p',P2);
Sf2 = XSteam('sL_p',P2);
Hf2 = XSteam('hL_p',P2);
Hg2 = XSteam('hV_p',P2);
if any(S2<Sg2)
X2 =((S2-Sf2)/(Sg2-Sf2));
H2 = Hf2 + (X2*(Hg2-Hf2));
else
H2 = XSteam('h_ps',P2,S2);
X2 =((S2-Sf2)/(Sg2-Sf2));
end
T2 = XSteam('T_ps',P2,S2);
%T2 = ((P2/P1)^((n-1)/n))*T1
disp ('At state point 2:')
disp(sprintf('P2 is : %d Bar',P2))
disp(sprintf('T2 is : %7.3f Deg celcius',T2))
disp(sprintf('H2 is : %7.3f KJ/kg',H2))
disp(sprintf('S2 is : %5.3f KJ/kgK',S2))
disp(sprintf('X2 is : %5.3f ',X2))
% value for state point 3
P3 = P2;
H3 = Hf2;
S3 = Sf2;
T3 = XSteam('T_ps',P3,S3);
disp ('At state point 3:')
disp(sprintf('P3 is : %d Bar',P3))
disp(sprintf('T3 is : %7.3f Deg celcius',T3))
disp(sprintf('H3 is : %7.3f KJ/kg',H3))
disp(sprintf('S3 is : %5.3f KJ/kgK',S3))
% value for state point 4
Vf3 = XSteam('vL_p',P2);
P4 = P1;
H4 = H3 + (Vf3*(P1-P2)*100);
S4 = S3;
T4 = XSteam('T_ps',P4,S3);
%T4 = ((P4/P3)^((n-1)/n))*T3
disp ('At state point 4:')
disp(sprintf('P4 is : %d Bar',P4))
disp(sprintf('T4 is : %7.3f Deg celcius',T4))
disp(sprintf('H4 is : %7.3f KJ/kg',H4))
disp(sprintf('S4 is : %5.3f KJ/kgK',S4))
Wt = H1 - H2;
Wp = H4 - H3;
Wnet = Wt - Wp;
Ntherm = (Wnet/(H1-H4))*100;
raw_material_perKWH = 3600/Wnet;
disp(sprintf('Wt is : %7.3f KJ/kg ',Wt))
disp(sprintf('Wp is : %5.3f KJ/kg ',Wp))
disp(sprintf('Wnet is : %7.3f KJ/kg ',Wnet))
disp(sprintf('Ntherm is : %6.3f Percentage ',Ntherm))
disp(sprintf('S.S.C is : %5.3f kg/KWH ',raw_material_perKWH))
%plot of t-s diagram
s5 = XSteam('sL_p',P1);
s6 = XSteam('sV_p',P1);
t5 = XSteam('T_ps',P1,s5);
t6 = XSteam('T_ps',P1,s6);
s7 = XSteam('sV_p',P2);
t7 = XSteam('T_ps',P2,s7);
figure(1)
subplot(2,1,1)
title('T-S diagram')
xlabel('entropy S(KJ/kgK)')
ylabel('temperature (C)')
hold on
plot(S1,T1,'.','color','r') % mark point on the plot
text(S1,T1,num2str(1)) % give the name to point
plot(s5,t5,'.','color','r')
%text(s5,t5,num2str(5))
plot(s6,t6,'.','color','r')
%text(s6,t6,num2str(6))
plot(S2,T2,'.','color','r')
text(S2,T2,num2str(2))
plot(S3,T3,'.','color','r')
text(S3,T3,num2str(3))
plot(S4,T4,'.','color','r')
text(S4,T4,num2str(4))
%to plot dom region
a = linspace(1,373,373);
for i = 1:1:373
s(i) = XSteam('sL_T',i);
s1(i)= XSteam('sV_T',i);
end
hold on
plot(s,a,'color','g')
plot(s1,a,'color','g')
X2 =((S2-Sf2)/(Sg2-Sf2)); % condition for point 2 is super heated or not
if any(X2>1)
plot(s7,t7,'.','color','r')
%text(s7,t7,num2str(7));
plot([S1 s6 s5 S4 S3 s7 S2 S1],[T1 t6 t5 T4 T3 t7 T2 T1],'color','k') %make line which passes through the point
else
plot([S1 s6 s5 S4 S3 S2 S1],[T1 t6 t5 T4 T3 T2 T1],'color','k')
end
%plot of H-S diagram
subplot(2,1,2)
title('H-S diagram')
xlabel('entropy S(KJ/kgK)')
ylabel('enthalpy H(KJ/kg)')
hold on
plot(S1,H1,'.','color','r') % mark point on the plot
text(S1,H1,num2str(1)) % give the name to point
plot(S2,H2,'.','color','r')
text(S2,H2,num2str(2))
plot(S3,H3,'.','color','r')
text(S3,H3,num2str(3))
plot(S4,H4,'.','color','r')
text(S4,H4,num2str(4))
plot([S1 S2 S3 S4 S1],[H1 H2 H3 H4 H1],'color','g')
for i = 1:1:373
s(i) = XSteam('sL_T',i);
s1(i)= XSteam('sV_T',i);
h(i) = XSteam('hL_T',i);
h1(i) = XSteam('hV_T',i);
end
hold on
plot(s,h,'color','k')
plot(s1,h1,'color','k')
Results :
command window
plots
Conclusion:
In this program, we have done the analysis of an ideal Rankine cycle. It is ideal because the processes are reversible. However, in case of real Rankine cycle, the processes are not reversible, i.e, the compression in pump and the expansion in turbine are not isentropic. This increases the power required by the pump and decreases the power generated by the turbine. Hence, the eciency of a real Rankine cycle would be less than that of an ideal Rankine cycle, for same input parameters.