Project

Rankine Cycle

Rankine Cycle

Aim :- 1. To develop a basic program thet calculates the state points.

2. To add the thermodynamics relation to get the points in between the state variables.

3. To plot Rankine Cycle on T-S & H-S curve.

Introduction :-

The Rankine Cycle is a model used to predict the preformance of steam turbine systems. it was also used to study the performance of reciprocating steam engines. the Rankine Cycle is an idealized thermodynamic cycle of heat engine that convrts heat into mechanical work while undergoing phase change. it is an idealised cicle in which friction losses in each of the four components are neglected. the heat is supplied externally to closed loop, which usually uses water as working fluid. it is named after john macquorn rankine , a scottish polymath an glasgow university professor.

1-2 = Isenteropic expansion in the turbine.

2-3 = Constant pressure heat rejection by the condenser.

3-4 = Isentropic compression in pump.

4-1 = Constant pressure heat addition in the boiler.

clear all
close all
clc

fprintf(\'      RANKINE CYCLE SIMULATOR /N/N\')
fprintf(\'1-2   isentropic expansion in the turbine/n\')
fprintf(\'2-3   constant pressure heat rejection by the condenser/n\')
fprintf(\'3-4   isentropic compression in the pump/n\')
fprintf(\'4-1   constant pressure heat addition by the boiler/n/n\')

%inputs

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 condenser (in bar): \');
disp(\' RESULTS\')

% getting cp & cv values from xsteam
% CP & CV assumed to not change with temperature to make problem simple
% for vapour

high_cpv=xsteam(\'cpv_p\',p1);
low_cpv=xsteam(\'cpv_p\',p2);
high_cvv=xsteam(\'cvv_p\',p1);
low_cvv=xsteam(\'cvv_p\',p2);


% for liquid
 
high_cpl=xsteam(\'cpl_p\',p1);
low_cpl=xsteam(\'cpl_p\',p2);
high_cvl=xsteam(\'cvl_p\',p1);
low_cvl=xsteam(\'cvl_p\',p2);


% getting important parameters from xsteam
% for high pressure
t1s=xsteam(\'tsat_p\'p1);
s1g=xsteam(\'sv_p\',p1);
s1f=xsteam(\'sl_p\',p1);
s1fg=s1g-s1f;
h1f=xsteam(\'hl_p\',p1);
h1g=xsteam(\'hv_p\',p1);
hifg=hig-h1f;

% for low pressure
s2g=xsteam(\'sv_p\',p2);
s2f=xsteam(\'sl_p\',p2);
s2fg=s2g-s2f;
t2s=xsteam(\'tsat_p\',p2);
h2f=xsteam(\'hl_p\',p2);
h2g=xsteam(\'hv_p\',p2);
h2fg=h2g-h2f;


% state point 1
disp(\'at state point 1:\')
fprintf(\'p1 is : %f deg celcius/n\',t1)
h1=xsteam(\'h_pt\',p1,t1);
fprintf(\'h1 is : %f kj/kg/n\',h1)
s1=xsteam(\'s_pt\',p1,t1);
fprintf(\'s1 is : %f kj/n/n\',s1)

% state point 2
disp(\'at state point 2 :\')
fprintf(\'p2 is : %f kj/kgk/n\',s2)

% predicting location of point 2 in t-s
      if (s2<=s2g)
        X2=(s2-s2f)/(s2fg);  % dryness fraction at state point 2
      else
        X2=1;
        end
fprintf(\'X2 is :%f /n\',X2)

% calculating t2 for superheat or wet or dry wherever it lies
    if (x2<1)
      t2=t2s;
    else
       %t2 cal by s2=s2g+low_cpv*(log(t2/t2s))
       t2=(t2s+273.15)*exp((s2-s2g)/low_cpv); %2 in superheated region
       t2=t2-273.15;
     end
     fprintf(\'t2 is : %f deg celcius / n\',t2)
      if (x2<1)
        h2=h2f+x2*h2fg;
      else
        h2=h2g+low_cpv*(t2-t2s);
      end
      fprintf(\'h2 is %f kj/kg/n\',h2)
      
  % state point 3
  % assuming no subcooling in condenser 
  disp(\' at state point 3 :\')

p3= p2;
fprintf(\'p3 is : %f bar/n\',p3)

v3= xsteam (\'vl_p\', p3);
  
t3=t2s; % no subcooling assumed
fprintf(\'t3 is : %f deg celcius/n\' ,t3)

h3=h2f;
fprintf(\'h3 is %f kj/kg/n\',h3)

s3=s2f;
fprintf(\'s3 is : %f kj/kgk/n/n\',s3)


% state point 4
disp(\'at state point 4:\')

p4 = p1 ;
fprintf(\'p4 is : %f bar/n\' ,p4)

s4=s3;
fprintf(\'s4 is %f kj/kgk/n\',s4)

wp=v3*(p4-p3)*100;
h4=wp+h3;
fprintf(\'h4 is : %f kj/kg/n\',h4)


% to cal t4 s4=s3=sf1-high_cpl8ln(t1s/t4)
 term=exp((s1f-s4)/high_cpl0;  % use exp instead of exp to take input as double
t4=t1s/term;
fprintf(\'t4 is : %f deg celcius /n/n\',t4)


% work done , heat , ssc and efficiency calculations
wt=h1-h2;
fprintf(\'work by turbine is ; %f kj/kg/n\',wt)
fprintf(\'work by compressor is : %f kj/kg/n\',wp)
 wnet=wt-wp;
 fprintf(\'net work done is : %f kj/kg/n\',wnet)
 qin=h1-h4;
 eff_thermal=wnet/qin ; % efficiency
 fprintf(\'thermal efficincy is : %f\', eff_thermal):disp(\'%\')
 ssc=3600/wt;  %specific steam consumtion
 fprintf(\'s.s.c  is : %f kg/kwh \',ssc)
 
 
 % calculation for plotting liquid and vapour lines 
 %
 % <>
 %
 temp=linspace(1,373,500);
 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 and h -s diagrams
 
figure(1) % t-s
hold on 
plot([s1 s2 ], [t1 t2 ],\'r\', \'linewidth\',1) 
text(s1,t1,\' 1\')
text(s2,t2,\' 2\')
plot([s2 s2g],[t2 t2s],\'r\',\'linewidth\',1)
text(s2g,t2s,\' 2s\')
plot([s2g s3],[t2s t3],\'r\',\'linewidth\',1)
text(s3,t3,\' 3\')     
plot([s3 s4],[t3 t4],\'r\',\'linewidth\',1)
text(s4,t4,\' 4\')
plot([s4 s1f],[t4 t1s],\'r\',\'linewidth\',1)
text(s1g,t1s,\' 1s\')
plot([s1g s1],[t1s t1],\'r\',\'linewidth\',1)
plot(s_l,temp,\'b\',\'linestyle\',\'--\',\'linewidth\',1)
plot(s_v,temp,\'b\',\'linestyle\',\'--\',\'linewidth\',1)


%marking direction

text(s1,(t1+t2)/2,\'/vee\',\'horizontal allignment\',\'center\',\'color\',\'r\')
text((s2g+s2f)/2,t3,\'/langle\',\'r\')
text(s3,(t3+t4)/2,\'/wedge\',\'horizontal allignment\',\'center\',\'color\',\'r\')
text((s1f+s1g)/2,t1s,\'/rangle\',\'color\',\'r\')
title(\'t-s diagram of ideal rankine cycle)
ylabel(\'temperature(degc)\')
xlabel(\'specific entropy (kj/kgk)\')

 
figure(2) % h-s 
hold on 
plot([si s2],[h1 h2],\'r\',\'linewidth\',1);
text(s1,h1,\' 1\')
plot([s2 s3],[h2 h3],\'r\',\'linewidth\',1);
text(s2,h2,\' 2\')
plot([s3 s4],[h3 h4],\'r\',\'linewidth\',1);
text(s3,h3,\' 3\')
plot([s4 s1],[h4 h1],\'r\',\'linewidth\',1);
text(s4,h4,\' 4\')
plot(s_l,h_l,\'b\',\'linestyle\',\'--\',\'linewidth\',1.5)
plot(s_v,h_v,\'b\',\'linestyle\',\'--\',\'linewidth\',1.5)
tittle(\'h-s diagram\',\'fontsize\',15)
ylabel(\'specific enthalpy (kj/kg)\')
xlabel(\'specific entropy (kj/kgk)\')

projects.skill-lync.com/projects/Rankine-Cycle-60473

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.