Rankine Cycle Simulator
The rankine cycle is a model used for steam turbine systems commonly found in thermal power generation plants. The processes in boiler and condenser are isobaric. The processes in turbine and pump are assumed to be isentropic (this is not the case in reality).
Standard Xsteam library was used to get the steam table data for water. The link is
https://drive.google.com/open?id=1RK_fvrOj38CIaQvmLT1S3daqHnxKCGU-
%The turbine and pump are considered ideal i.e. the compression by the
%pump and the expansion in the turbine are isentropic
%This cycle does not has reheat and regeneration
%Point 1 (Turbine entry)
%Enter pressure in turbine inlet (bar)
P1=44;
%Enter temperature in turbine inlet (deg C)
T1=538;
H1=XSteam(\'h_pT\',P1,T1);
S1=XSteam(\'s_pT\',P1,T1);
%Point 2 (Condenser)
%Enter pressure in condenser (bar)
P2=5.83;
S2=S1;
T2=XSteam(\'T_ps\',P2,S2);
H2=XSteam(\'h_ps\',P2,S2);
%if water is both liquid and vapor form
if S2<=XSteam(\'sV_p\',P2)
x2=XSteam(\'x_ps\',P2,S2)
end
%Point 3 (Pump entry)
P3=P2;
S3=XSteam(\'sL_p\',P3);
T3=XSteam(\'T_ps\',P3,S3);
H3=XSteam(\'h_ps\',P3,S3);
%Point 4 (Boiler entry)
P4=P1;
S4=S3;
T4=XSteam(\'T_ps\',P4,S4);
H4=XSteam(\'h_pT\',P4,T4);
%T-S Diagram
figure (1)
plot(S1,T1,\'-.or\',S2,T2,\'-.or\',S3,T3,\'-.or\',S4,T4,\'-.or\')
hold on
text(S1,T1,\'\\leftarrow Point 1\')
text(S2,T2,\'\\leftarrow Point 2\')
text(S3,T3,\'\\leftarrow Point 3\')
text(S4,T4,\'\\leftarrow Point 4\')
%plotting the contour from point 4 till saturated liquid point in boiler
S_41=linspace(S4,XSteam(\'sL_p\',P4),20);
for i=1:length(S_41)
T_41(i)=XSteam(\'T_ps\',P4,S_41(i));
H_41(i)=XSteam(\'H_ps\',P4,S_41(i));
end
plot(S_41,T_41,\'b\')
%plotting the contour from saturated vapor till superheated vapor in boiler
S_42=linspace(XSteam(\'sV_p\',P4),S1,50);
for i=1:length(S_42)
T_42(i)=XSteam(\'T_ps\',P4,S_42(i));
H_42(i)=XSteam(\'H_ps\',P4,S_42(i));
end
plot(S_42,T_42,\'b\')
%plotting isentropic paths
plot([S1,S2],[T1,T2],\'b\',[S3,S4],[T3,T4],\'b\')
plot([XSteam(\'sV_p\',P4),XSteam(\'sL_p\',P4)],[XSteam(\'Tsat_p\',P4),XSteam(\'Tsat_p\',P4)],\'b\')
%plotting the fluid in the condensor
S_21=linspace(XSteam(\'sL_p\',P2),S2,100);
for i=1:length(S_21)
T_21(i)=XSteam(\'T_ps\',P2,S_21(i));
H_21(i)=XSteam(\'H_ps\',P2,S_21(i));
end
plot(S_21,T_21,\'b\')
%plotting water phase boundary in T-S graph in red colour
P=linspace(0.001,224,500);
for i=1:length(P)
sL(i)=XSteam(\'sL_p\',P(i));
sV(i)=XSteam(\'sV_p\',P(i));
T(i)=XSteam(\'Tsat_p\',P(i));
end
plot(sL,T,\'r\',sV,T,\'r\')
xlabel(\'Entropy (S)\');
ylabel(\'Temperature (K)\');
%H-S curve
figure (2)
%plotting water phase boundary in H-S graph in red colour
P=linspace(0.001,224,500);
for i=1:length(P)
hL(i)=XSteam(\'hL_p\',P(i));
hV(i)=XSteam(\'hV_p\',P(i));
end
plot(sL,hL,\'r\',sV,hV,\'r\')
hold on
xlabel(\'Entropy (S)\');
ylabel(\'Enthalpy (H)\');
plot(S1,H1,\'-.or\',S2,H2,\'-.or\',S3,H3,\'-.or\',S4,H4,\'-.or\')
text(S1,H1,\'\\leftarrow Point 1\')
text(S2,H2,\'\\leftarrow Point 2\')
text(S3,H3,\'\\leftarrow Point 3\')
text(S4,H4,\'\\leftarrow Point 4\')
%plotting isentropic paths
plot([S1,S2],[H1,H2],\'b\',[S3,S4],[H3,H4],\'b\')
plot(S_41,H_41,\'b\',S_21,H_21,\'b\',S_42,H_42,\'b\')
%plotting isothermal path in boiler (dual phase of water)
S_4LV=linspace(XSteam(\'sL_p\',P4),XSteam(\'sV_p\',P4),100);
for i=1:length(S_4LV)
H_4LV(i)=XSteam(\'h_ps\',P4,S_4LV(i));
end
plot(S_4LV,H_4LV,\'b\')
%plotting path in condensor
S_2LV=linspace(XSteam(\'sL_p\',P2),S2,100);
for i=1:length(S_2LV)
H_2LV(i)=XSteam(\'h_ps\',P2,S_2LV(i));
end
plot(S_2LV,H_2LV,\'b\')
wt=H1-H2; %Work done by turbine
Work_Turbine=wt
SSC=3600/((H1-H4)-(H2-H3)) %specific steam consumption
wp=H4-H3; %Work done by pump
Work_Pump=wp
Qin=H1-H4; %Heat provided in boiler
Qout=H2-H3; %Heat lost in condensor
Efficiency=(wt-wp)*100/Qin %Efficiency
%The points 3 and 4 are so close that they overwrite each other
T vs S graph
H vs S graph
The resuts of this cycle: