FINAL INDEPENDENT PROJECT
AIM: Calculate the efficiency of the Rankine Cycle
I have taken rankine cycle as a system and calculate the work done, heat, SSC and efficeiency.
clear all
close all
clc
%step 1
% print discription of all the process
fprintf('rankine cycle simulator');
fprintf('1-2 isentropic expansion in turbine');
fprintf('2-3 constant pressur heat rejection');
fprintf('3-4 isentropic copression in pump');
fprintf('4-1 constant pressure heat addition');
%step 2
%taking all input arguments
p1=input('enter the pressure at turbine inlet');
t1=input('enter the temprature at turbine inlet');
p2=input('enter the pressure at condenser');
fprintf('result');
%%calculation for the general properties
%step 3
%calculation of cp value at p1&p2 for satarated liquid & vapour
cp1_L =xsteam('cpL_P',P1);
cp1_V =xsteam('cpV_P'p1);
cp2_L =xsteam('cpL_P'p2);
cp2_V =xsteam('cpV_P'p2);
%step4
%calculation of saturation temperature at p1 & p2
Tsat_p1=xsteam ('tsat_p',p1);
Tsat_p2=xsteam('tsat-p',p2);
%%calculation of enthalpy and entropy at saturation points
%step5
%calculation of saturation properties at state 1
Hg_1=xsteam ('hV__p',p1);
Sg_1=xsteam ('SV__p',p1);
%step6
%calculation of saturation properties at state 2
Hg_2=xsteam ('hV__p',p2);
Sg_2=xsteam ('SV__p',p2);
%step7
%calculation of saturation properties at state 3
Hf_3=xsteam ('hL__p',p2);
Sf_3=xsteam ('SL__p',p2);
%step8
%calculation of saturation properties at state 4
Hf_4=xsteam ('hL__p',p1);
Sf_4=xsteam ('SL__p',p1);
%step9
%%calculation of process properties at state1
fprintf('At state point 1n');
fprintf('p1 is : %f Barn',p1);
fprintf('T1 is : %f degCn',T1);
H1=xsteam('h_pT',p1,T1);
fprintf('H1 is : %f KJ/Kgn',H1);
S1=xsteam('s_pT',p1,T1);
fprintf('S1 is : %f KJ/KgKn',S1);
%step10
%%calculation of process properties at state2
fprintf('At state point 2n');
fprintf('p2 is : %f Barn',p2);
S2=S1;
fprintf('S2 is : %f KJ/KgKn',S2);
%calculating value of X
if (S2<=Sg_2)
X2=(S2-sf_3)/(sg_2-sf_3);
else
X2=1;
end
fprintf('X2 is : %f n', X2);
%calculating value of T2
if (X2<1)
T2=Tsat_p2;
else
%S2=sg_2+cp2_V*(log(T2/Tsat_p2))
T2=(Tsat_p2+273.15)*exp((S2-sg_2)/cp2_V);
T2=T2-273.15;
end
fprintf('T2 is : % degCn', T2)
if (X2<1)
H2=Hf_3+X2*(Hf_3-Hg_2);
else
H2=xsteam('h_pT',P2,T2);
end
fprintf('H2 is : % KJ/Kgn',H2)
%step11
%%calculation of process properties at state3
fprintf('At state point 3n');
p3=p2;
fprintf('p3 is : %f Barn',p3);
V3=xsteam('VL_P',p3);
T3=Tsat_p2; %No subcooling
fprintf('T3 is : % degCn', T3)
H3=Hf_3;
fprintf('H3 is : %f KJ/Kgn',H3);
S3=Sf_3
fprintf('S3 is : %f KJ/KgKn',S3);
%step12
%%calculation of process properties at state4
fprintf('At state point 4n');
p4=p1;
fprintf('p4 is : %f Barn',p4);
S4=S3
fprintf('S4 is : %f KJ/KgKn',S4);
Wp=V3*(p4-p3)*100;
H4=Wp+H3;
fprintf('H4 is : % KJ/Kgn',H4)
T4=(Tsat_p1+273.15)*exp((Sf_4-S4)/cp1_L);
T4=T4-273.15;
fprintf('T4 is : % degCn', T4)
%%calculation for plotting saturation liquid and vapour lines
%step 13
temp=linspace(1,T1,1000);
for i=1:length(temp)
H_L(i)=xsteam('hL_T',temp(i));
H_V(i)=xsteam('hV_T',temp(i));
S_L(i)=xsteam('SL_T',temp(i));
S_V(i)=xsteam('SV_T',temp(i));
end
%%plotting T-s diagram and H-s diagram
%step14
%plotting T-s diagram
figure(1)
hold on
plot([S1 S2],[T1 T2],'r','linewidth',2)
text(S1,T1,'1')
text(S2,T2,'2')
plot([S1 Sg_2],[T2 Tsat_p2],'r','linewidth',2)
text(Sg_2,Tsat_p2,'2s')
plot([Sg_2 S3],[Tsat_p2 T3],'r','linewidth',2)
text(S3,T3,'3')
plot([S3 S4],[T3 T4],'r','linewidth',2)
text(S4,T4,'4')
plot([S4 Sf_4],[T4 Tsat_p1],'r','linewidth',2)
text(Sf_4,Tsat_p1,'4s')
plot([Sf_4 Sg_1],[Tsat_p4 Tsat_p1],'r','linewidth',2)
text(Sg_1,Tsat_p1,'1s')
plot([Sg_1 S1],[Tsat_p1 T1],'r','linewidth',2)
plot(S_L,temp,'b','linestyle','--','linewidth',1)
plot(S_V,temp,'b','linestyle','--','linewidth',1)
title('T-S diagram of ideal rankine cycle')
xlabel('Specific Entropy(KJ/KgK)')
ylabel('Temeperature(degC)')
%step15
%Plotting H-S Plot
figure(2)
hold on
plot([S1 S2],[H1 H2],'r','linewidth',2)
text(S1,H1,'1')
text(S2,H2,'2')
plot([S2 Sg_2],[H2 Hg_2],'r','linewidth',2)
text(Sg_2,H_g2,'2s')
plot([Sg_2 S3],[Hg_2 H3],'r','linewidth',2)
text(S3,H3,'3')
plot([S3 S4],[H3 H4],'r','linewidth',2)
text(S4,H4,'4')
plot([S4 Sf_4],[H4 Hf_4],'r','linewidth',2)
text(Sf_4,Hf_4,'4s')
plot([Sf_4 Sg_1],[Hf_4 Hg_1],'r','linewidth',2)
text(Sg_1,Hg_1,'1s')
plot([Sg_1 S1],[Hg_1 H1],'r','linewidth',2)
plot(S_L,H_L,'b','linestyle','--','linewidth',1.5)
plot(S_V,H_V,'b','linestyle','--','linewidth',1.5)
title('H-S diagram of ideal rankine cycle')
xlabel('Specific Entropy(KJ/KgK)')
ylabel('Specific enthalpy(KJ/kg)')
%%work done, heat,SSC and efficiency calculation
%step 16
Wt=H1-H2;
fprintf('work by turbine is : %f KJ/Kgn', Wt)
fprintf('work by pump is : %f KJ/Kgn', Wp)
Wnet=Wt-Wp;
fprintf('Net work done is : %f KJ/Kgn', Wnet)
Qin=H1-H4;
eff_thermal=Wnet*100/Qin;
fprintf('Thermal Efficiency is : %f', eff_thermal);
SSC=3600/Wt;
fprintf('S.S.C is : %f KJ/KWh', SSC)
fprintf('S.S.C is : %f KJ/KWh', SSC)