Project 2 - Rankine cycle Simulator
Rankine cycle involves the operating fluid continously evaporated and condenssed ,the compoments in the Rankine cycle are
1.Boliller- In which steam is generates at constant pressure and in this heat is addded.
2.Turbine-In which steam will exapnd at constant enthropy and the work is done
3.condenser_In which heat is removed from the exhaust staem and its comptely converted in to water at constant pressure and here heat is rejected.
4.Pump-which raises the preesure of the liquid water to the boiller pressure and pump back in to boiller for convervation in to steam.
It consists of the four cycles they are such follows
1.1-2 isentropic compression -which involves the increasing the pressure from low pressure to the high preesure.
2.2-3 constant pressure heat addation-in this process we get dry saturated steam by heating the high pressure liquid entering in to boiller. the input engery can easily calculkated using the moiller digram or by steam table numerically.
3.3-4Isoentropic Expansion-the pressure and the temperature of the dry steam decreases as it expands in the turbine to generate the power and the output can be calculated using the steam tables.
4.4-1 constant pressure haet rejection-The wet vapour then enters a condenser where its condensed at aconstant preesure to become the satyrated liquid.
our main intetion in this program is used to calculate the enthlapy and the enthropy for the different states
1.the h1 and s1 is calculated from the steam table which are the function of temperature and the pressure which are the inputs .
2.for calculating the h2 we have the formula h2=hf+X*hfg where hf is enthlapy of the fluid which is found by using the steam the table which is function of the pressure.and X is the dryness fraction which is calculated as s2=sf+Xsfg s2=s1 hence X=(s2-sf)/(sfg) where sf and sfg are the entropy of the fluid which are calculated by using the steam table which are function of pressure p2.
3.since p3=p2 and we can t3 from the steam table which is function of the pressure p3 we can claculate the h3 and s3 from the steam table which are function of p3 and t3.
4.the h4 is calculated from the steam table which is the function of the presure and the entropy since p4=p1 and s4=s3 and and the another method to calculate h4 is wp=h1-h4 but wp is the flow work which is given by v3(p4-p3)/1000 =h4-h1 and v3=t3/p3 and tthe heat supplied and net workdone is calculated by using wnet=wt-wp where wt work obtained from the turbine and wp is the work done on the pump.
fprintf('1-2 isoberic heat addation\n')
fprintf('2-3 Isoentropic Expansion \n')
fprintf('3-4 isoberic heat rejection\n')
fprintf('4-1Isoentropic compression \n')
p1=input('Enter the presssure at the inlet of the turbine\n')
t1=input('Enter the temperature at the inlet of the turbine\n')
p2=input('Enter the pressure at condenser\n')
t=XSteam('Tsat_p',p1')
if t1>=t
h1=XSteam('h_pT',p1,t1)
s1=XSteam('s_pT',p1,t1)
p4=p1
p3=p2
h3=XSteam('hL_p',p3)
s3=XSteam('sL_p',p3)
t3=XSteam('Tsat_p',p3)
s2=s1
t2=t3
sf2=XSteam('sL_p',p2)
sg2=XSteam('sV_p',p2)
X2=(s2-sf2)/(sg2-sf2)
hf2=XSteam('hL_p',p2)
hg2=XSteam('hV_p',p2)
h2=hf2+X2*(hg2-hf2)
s4=s3
h4=XSteam('Cp_ps',p4,s4)
cp4=XSteam('Cp_ps',p4,s4)
cv4=XSteam('Cv_ps',p4,s4)
g4=cp4/cv4
o=(g4-1)/g4
t4=t3*((p4/p3)^o)
wt=h1-h2
wp=h4-h3
wnet=wt-wp
qs=h1-h4
n_per=(wnet/qs)*100
stm_rate=3600/(wt-wp)
t5=XSteam('Tsat_p',p1)
s5=XSteam('sL_p',p1)
s6=XSteam('sV_p',p1)
fprintf('\n\tResult\n')
fprintf('At state point 1:\np1 is :%4.2f Bar\nT1 is :%4.2f Degree Celcius\nH1 is :%4.2f Kj/kg\nS1 is :%4.2f Kj/kgk\n\n',p1,t1,h1,s1)
fprintf('At state point 2:\np2 is :%4.2f Bar\nT2 is :%4.2f Degree Celcius\nH2 is :%4.2f Kj/kg\nS2 is :%4.2f Kj/kgk\n\n',p2,t2,h2,s2)
fprintf('At state point 3:\np3 is :%4.2f Bar\nT3 is :%4.2f Degree Celcius\nH3 is :%4.2f Kj/kg\nS3 is :%4.2f Kj/kgk\n\n',p3,t3,h3,s3)
fprintf('At state point 4:\np4 is :%4.2f Bar\nT4 is :%4.2f Degree Celcius\nH4 is :%4.2f Kj/kg\nS4 is :%4.2f Kj/kgk\n\n',p4,t4,h4,s4)
temp=linspace(1,400,100)
for i=1:length(temp)
ent_1(i)=XSteam('sL_T',temp(i))
ent_v(i)=XSteam('sV_T',temp(i))
enth_1(i)=XSteam('hL_T',temp(i))
enth_v(i)=XSteam('hV_T',temp(i))
end
subplot(1,2,1)
plot([s1 s2 s3 s4 s5 s6 s1],[t1 t2 t3 t4 t5 t5 t1],'color','k','linewidth',2,'marker','o','markersize',2,'markerfacecolor','b','markeredgecolor','b')
hold on
plot(ent_1,temp,'color','r')
plot(ent_v,temp,'color','r')
axis([0 10 0 700])
text(s1,t1,'1','FontSize',15)
text(s2,t2,'2','FontSize',15)
text(s3,t3,'3','FontSize',15,'HorizontalAlignment','right')
text(s4,t4,'4','FontSize',15,'HorizontalAlignment','right')
xlabel('Enthropy')
ylabel('Temperature')
subplot(1,2,2)
plot([s1 s2 s3 s4 s1],[h1 h2 h3 h4 h1],'color','k','linewidth',2,'marker','o','markersize',2,'markerfacecolor','b','markeredgecolor','b')
hold on
plot(ent_v,ent_v,'color','r')
plot(ent_1,enth_1,'color','r')
axis([0 10 300 5000])
text(s1,h1,'1','FontSize',15)
text(s2,h2,'2','FontSize',15)
text(s3,h3,'3','FontSize',15,'HorizontalAlignment','right')
text(s4,h4,'4','FontSize',15,'HorizontalAlignment','right')
xlabel('Enthropy')
ylabel('Enthlapy')
else
fprintf('Enter the temperature greater than the saturarion tempearture')
end

