Project

RANKINE CYCLE SIMULATOR

AIM: TO CREATE A RANKINE CYCLE SIMULATOR USING MATLAB/OCTAVE.

OBJECTIVE:

  • To understand the concept of Rankine cycle and its parameters.
  • To calculate the state points of Rankine cycle.
  • To calculate the Work output, thermal efficiency, specific steam consumption.
  • To plot the T-s diagram and h-s diagram.

OVERVIEW:

The Rankine cycle is the fundamental operating cycle of all power plants where an operating fluid is continuously evaporated and condensed. The selection of operating fluid depends mainly on the available temperature range.

Steam (gas-phase H2O) is very commonly used as the working fluid for external-combustion heat engines because of its many desirable characteristics, such as low cost, availability and high enthalpy of vaporization.

Idealized Rankine cycle:

T-s Diagram and h-s Diagram -

All processes-

  • 1-2: Isentropic Compression - The pressure of the condensate is raised in the feed pump. Because of the low specific volume of liquids, the pump work is relatively small and often neglected in thermodynamic calculations.
  • 2-3: Constant pressure Heat addition - High pressure liquid enters the boiler from the feed pump and is heated to the saturation temperature. Further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam.
  • 3-4: Isentropic Expansion. The vapor is expanded in the turbine, thus producing work which may be converted to electricity.
  • 4-5: Constant pressure Heat rejection – The working fluid leaving the turbine is condensed at low pressure.

Parameters:

WT = Turbine work = h3 – h4

Wp = Pump work = h1 – h2

Qin = Heat added by boiler = h3 – h2

Qout = Heat rejected by condenser = h1 – h4

Wnet = WT - Wp

Thermal efficiency (ƞtherm) = Wnet / Qin

Specific steam consumption (SSC) = 3600 / Wnet

BODY OF CONTENT:

Firstly, for steam table the following function is to be saved in the working dictionary –

(For Xsteam library )

https://drive.google.com/file/d/1RK_fvrOj38CIaQvmLT1S3daqHnxKCGU-/view

here, given that –

Turbine inlet temperature [degree celcius] = 400

Turbine inlet pressure [bar] = 30

Turbine outlet pressure or Condenser inlet pressure [bar] = 0.05

CODE:

% Program for Rankine cycle simulator
clear all
close all
clc


printf("\n            RANKINE CYCLE SIMULATOR           ")
printf("\n ...........All Processes.............")
printf("\n 1-2 is Isentropic Compression in the Pump")
printf("\n 2-3 is Constant Pressure Heat addition by the boiler")
printf("\n 3-4 is Isentopic Expansion in the turbine")
printf("\n 4-1 is Constant Pressure Heat rejection by the Condenser\n")
printf("-------------------------------------------------------")

p3 = input("\n Enter the Pressure at the Turbine inlet(in bar) : ");
T3 = input("Enter the Temperature at the Turbine inlet(in degree celcius) :");
p4 = input("Enter the Pressure at the Condenser (in bar): ");

 
 % Calculations for state point '1' 

 p1=p4;
 p2=p3;
 
 
 h1=XSteam('hL_p',p1);       %hL is	Saturated liquid enthalpy
 s1=XSteam('sL_p',p1);       %sL is Saturated liquid entropy
 v1=XSteam('vL_p',p1);       %vL is	Saturated liquid volume
 T1=XSteam('Tsat_p',p1);     %Tsat is Saturation temperature
 
printf("\n At state point 1:")
 
fprintf('\n p1 is : %.2f Bar',p1)
fprintf('\n T1 is : %.2f Deg celcius',T1)
fprintf('\n h1 is : %.2f KJ/kg',h1)
fprintf('\n s1 is : %.2f KJ/kgK \n\n',s1)
 
 % Calculations for state point '2'
 
 T4=T1;
 s2=s1;
 
 cp2=XSteam('cp_ps',p2,s2);   %Cp_ps is Specific isobaric heat capacity as a function of pressure and entropy
 cv2=XSteam('cv_ps',p2,s2);   %Cv_ps is	Specific isochoric heat capacity as a function of pressure and entropy
 
 g2=cp2/cv2 ;
 r=(g2-1)/g2 ;
 
 T2=T1*((p2/p1)^r);
 wp=v1*(p2-p1)*100 ;         % wp is work done by pump
 h2=h1+wp ;
 
 printf("At state point 2:")
 
fprintf('\n p2 is : %.2f Bar',p2)
fprintf('\n T2 is : %.2f Deg celcius',T2)
fprintf('\n h2 is : %.2f KJ/kg',h2)
fprintf('\n s2 is : %.2f KJ/kgK \n\n',s2)

 % Calculation for state point '3'
 h3=XSteam('h_pT',p3,T3);    %h_pT is	Enthalpy as a function of pressure and temperature
 s3=XSteam('s_pT',p3,T3);    %s_pT is Entropy as a function of pressure and temperature
 
 
 printf("At state point 3:")
 
fprintf('\n p3 is : %.2f Bar',p3)
fprintf('\n T3 is : %.2f Deg celcius',T3)
fprintf('\n h3 is : %.2f KJ/kg',h3)
fprintf('\n s3 is : %.2f KJ/kgK \n\n',s3)


 % Calculations for state point '4'
 s4=s3;
 
 sf4=XSteam('sL_p',p4);     %sL_p is Saturated liquid entropy
 sg4=XSteam('sV_p',p4);     %sV_p is Saturated vapour entropy
 hf4=XSteam('hL_p',p4);     %hL_p is Saturated liquid enthalpy
 hg4=XSteam('hV_p',p4);     %hV_p is Saturated vapour enthalpy
 
 x4=((s4-sf4)/(sg4-sf4));
 h4=hf4+(x4*(hg4-hf4));
 
 printf("At state point 4:")
 
fprintf('\n p4 is : %.2f Bar',p4)
fprintf('\n T4 is : %.2f Deg celcius',T4)
fprintf('\n h4 is : %.2f KJ/kg',h4)
fprintf('\n s4 is : %.2f KJ/kgK \n\n',s4)


 % Other calculations
 wt=h3-h4;          %wt is work done by turbine
 Wnet=wt-wp;        %Wnet is net work output
 Qin=h3-h2;         %Qin is heat added by boiler
 Qout=h4-h1;        %Qout is heat rejected by condensor
 ntherm=(Wnet/Qin)*100 ;   %ntherm is thermal efficiency in percentage
 SSC=3600/Wnet ;      %S.S.C. is specific steam consumption
 
 
 
 printf("-----------------------------------------------")
 printf("\nFinal Results:")
fprintf('\n wt is : %.2f KJ/kg',wt)
fprintf('\n wp is : %.2f KJ/kg',wp)
fprintf('\n Wnet is : %.2f KJ/kg',Wnet)
fprintf('\n ntherm is : %.2f Percentage',ntherm)
fprintf('\n SSC is : %.2f Kg/KWH',SSC)
 
 
 % To mark point 'a' and 'b'
 sa=XSteam('sL_p',p2);
 ha=XSteam('hL_p',p2);
 Ta=XSteam('T_ps',p2,sa);
 
 sb=XSteam('sV_p',p2);
 hb=XSteam('hV_p',p2);
 Tb=XSteam('T_ps',p2,sb);
 

 % T-s diagram
 
 
figure(1)
plot(s1,T1,'*','color','r')
plot(s2,T2,'*','color','r')
plot(s3,T3,'*','color','r')
plot(s4,T4,'*','color','r')

line([s1 s2],[T1 T2],'linewidth',3,'color','b')
text(s1,T1,' 1','FontSize',20,'color','g')
text(s2,T2,' 2','FontSize',20,'color','g')

line([s2 sa],[T2 Ta],'linewidth',3,'color','b')
text(sa,Ta,' a','FontSize',20,'color','g')

line([sa sb],[Ta Tb],'linewidth',3,'color','b')
text(sb,Tb,' b','FontSize',20,'color','g')

line([sb s3],[Tb T3],'linewidth',3,'color','b')
text(s3,T3,' 3','FontSize',20,'color','g')

line([s3 s4],[T3 T4],'linewidth',3,'color','b')
text(s4,T4,' 4','FontSize',20,'color','g')

line([s4 s1],[T4 T1],'linewidth',3,'color','b')

title('T-s Diagram')
xlabel('Entropy(s), [KJ/Kg.k] ')
ylabel('Temperature(T), [Degree celcius] ')

% for saturation curve
z=linspace(1,373,373);            % z is for temperature range
 for i = 1:1:373
     s(i) = XSteam('sL_T',i);
     s3(i)= XSteam('sV_T',i);
end
hold on
plot(s,z,'color','k')
plot(s3,z,'color','k')


 % h-s diagram
 

figure(2)
plot(s1,h1,'*','color','r')
plot(s2,h2,'*','color','r')
plot(s3,h3,'*','color','r')
plot(s4,h4,'*','color','r')

line([s1 s2],[h1 h2],'linewidth',3,'color','b')
text(s1,h1,' 1','FontSize',20,'color','g')
text(s2,h2,' 2','FontSize',20,'color','g')

line([s2 sa],[h2 ha],'linewidth',3,'color','b')
text(sa,ha,' a','FontSize',20,'color','g')

line([sa sb],[ha hb],'linewidth',3,'color','b')
text(sb,hb,' b','FontSize',20,'color','g')

line([sb s3],[hb h3],'linewidth',3,'color','b')
text(s3,h3,' 3','FontSize',20,'color','g')

line([s3 s4],[h3 h4],'linewidth',3,'color','b')
text(s4,h4,' 4','FontSize',20,'color','g')

line([s4 s1],[h4 h1],'linewidth',3,'color','b')

title('h-s Diagram')
xlabel('Entropy(s), [KJ/Kg.k] ')
ylabel('Enthalpy(h), [KJ/Kg] ')

% for saturation curve

for i = 1:1:373
s(i) = XSteam('sL_T',i);
s3(i)= XSteam('sV_T',i);
h(i) = XSteam('hL_T',i);
h3(i) = XSteam('hV_T',i);
end
hold on
plot(s,h,'color','k')
plot(s3,h3,'color','k')

EXPLANATION OF CODE:

  • Clear all, close all, clc command is used to clear all previous commands and plots.
  • ‘printf’ is used to display the processes name in the command window.
  • ‘input’ command is to enter the input parameters which are given.
  • ‘hV_p’ is for Saturated vapour enthalpy.
  • ‘hL_p’ is for Saturated liquid enthalpy.
  • ‘hV_T’ is for Saturated vapour enthalpy.
  • ‘hL_T’ is for Saturated liquid enthalpy.
  • ‘h_pT’ is for Enthalpy as a function of pressure and temperature.
  • ‘h_ps’ is fpr Enthalpy as a function of pressure and entropy.
  • ‘sV_p’ is for Saturated vapour entropy.
  • ‘sL_p’ is for Saturated liquid entropy.
  • ‘sV_T’ is for Saturated vapour entropy.
  • ‘sL_T’ is for Saturated liquid entropy.
  • ‘s_pT’ is for Specific entropy as a function of pressure and temperature.
  • ‘s_ph’ is for Specific entropy as a function of pressure and enthalpy.
  • ‘Cp_pT’ is for Specific isobaric heat capacity as a function of pressure and temperature.
  • ‘Cp_ph’ is for Specific isobaric heat capacity as a function of pressure and enthalpy.
  • ‘Cp_ps’ is for Specific isobaric heat capacity as a function of pressure and entropy.
  • ‘fprintf’ command is used to print the values of all calculation parameters.
  • ‘for-loop’ is used to plot the saturation curve.
  • ‘line’ command is to plot a line with given two points.
  • ‘title’ is to entitle the graph.
  • ‘xlabel’ and ‘ylabel’ is for labeling the axis.

ERRORS:

1. Error in line command –

2. Error in plot –

RESULTS:

PARAMETERS -

PLOTS -

T-s Diagram –

h-s Diagram –

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.