Challenge

Project 2 - Rankine cycle Simulator

Aim:-

We have been given input parameters of some points of the rankine cycle, our aim is to simulate the rankine cycle using the matlab programing while calculating:

  1. Net work output.
  2. Back work ratio.

Background:-

A rankine cycle is a model which is used to give different properties of a steam turbine systems, such as efficiency, point wise properties at different locations of the model, etc. By using rankine cycle, approximate analysis can be done on an steam turbine systems.

Rankine cycle mainly consists of four processes:

  1. Isentropic compression (1-2)
  2. Constant pressure heat addition (2-3)
  3. Isentropic expansion (3-4)
  4. Constant pressure heat rejection (4-1)

Assumptions made:-

  1. Compression and expansion process is considered to be an isentropic process but in actual conditions it is not a perfect isentropic process.
  2. Heat addition and heat rejection process are considered to be isobaric processes while in actual condition the pressure may vary with some amount.
  3. Due to this conditions we can say that the rankine cycle we will simulate can be considered to be an ideal rankine cycle.

Method used:-

  1. The user inputs are taken.
  2. Properties such as temperature 'T' (celcius), Pressure 'p' (bar), enthalpy 'h' (kJ/kg) and entropy 's' (kJ/kg C) is found out at each points of the cycle using some relations and XSteam library in matlab.
  3. As process 2-3 is isobaric so p2=p3.
  4. As process 4-1 is also isobaric so p4=p1.
  5. As process 3-4 is isentropic so s3=s4.
  6. As process 1-2 is also isentropic so s1=s2.
  7. In steam table if the point is in between liquid and vapour saturation lines then s(n)=sL(n)+XsV(n)
    1. Here, 'n' is the point number
    2. 's' is entropy but we can use for any property
    3. sL(n) is liquid saturation entropy at point 'n'
    4. sV(n) is the vapour saturation entropy at point 'n' and 'X' is quality of steam at point 'n'.
  8. Similarly the method can be also used for enthalpy 'h'.
  9. Then we calculate the required output properties.
  10. Wnet(Net work output)=Wturbine-Wpump
  11. Wturbine= h3-h4.
  12. Wpump= Vf(p1-p2) ,Vf= Specific volume of fluid at pt.1
  13. Qh (heat added to boiler)= h3-hf2
  14. Efficiency= (Wnet/Qh)*100
  15. B.W.R (Back work ratio)= Wpump/Wturbine
  16. After calculating required outputs, the results are displayed.
  17. Then T-s and h-s plots are plotted using plot function.

Program:-

%Program to claculate the net work output and work back ratio..
%..for an rankine cycle and simulate the t-s and h-s plot.

%Take user inputs
T3=input('Enter turbine inlet temperature in (Celcius)n'); 
p3=input('Enter turbine inlet pressure in (bar)n');
p4=input('Enter turbine outlet pressure in (bar)n');

%Processes are
%1-2 Isentropic compression
%2-3 Constant prsssure heat addition
%3-4 Isentropic expansion
%4-1 Constant pressure heat rejection

%Calculate enthalpy at pt.3
h3=XSteam('h_pT',p3,T3);

%Calculate enthalpy at pt.1
hf1=XSteam('hL_p',p4);

%Calculate entropy at pt.3
s3=XSteam('s_pT',p3,T3);

%As line 3-4 is isentropic
s4=s3;

%Calculate entropy at pt.1
sf1=XSteam('sL_p',p4);

%Calculating entropy diff at 0.005 bar
sfg4=XSteam('sV_p',p4)-XSteam('sL_p',p4);

%Calculating quality of steam at pt.4
X=(s4-sf1)/sfg4;

%Enthaply diff at 0.005 bar
hfg4=XSteam('hV_p',p4)-XSteam('hL_p',p4);

%Enthaply at pt.4
h4=hf1+(X*hfg4);

%Work out at turbine
Wt=h3-h4;

%Specific volume at pt.1
vf=XSteam('vL_p',p4);

%Work consumed by pump
Wp=vf*(p3-p4);

%Total work output
Wnet=Wt-Wp;

%Enthalpy at saturation liquid of pt.2
hf2=Wp+hf1;

%Heat input to boiler
Qh=h3-hf2;

%Efficiency of cycle
eff=(Wnet/Qh)*100;

%Back work ratio
bac=Wp/Wt;

%Properties at pt.1
T1=XSteam('Tsat_p',p4);                             %XSteam function used
p1=p4;
h1=hf1;
s1=sf1;

%Properties at pt.2
T2=XSteam('T_ps',p3,s1);
p2=p3;
h2=XSteam('h_ps',p3,s1);
s2=s1;

%Properties at pt.3
T3;
p3;
h3;
s3;

%Properties at pt.4
T4=XSteam('T_ph',p4,h4);
p4;
h4;
s4;

%Properties of intermidiate pts. b/w process 2-3
T5=XSteam('Tsat_p',p3);
p5=p3;
h5=XSteam('hL_p',p3);
s5=XSteam('sL_p',p3);

T6=XSteam('Tsat_p',p3);
p6=p3;
h6=XSteam('hV_p',p3);
s6=XSteam('sV_p',p3);

%% Outputs
fprintf('Process 1-2 isentropic compressionn');
fprintf('Process 2-3 Constant prsssure heat additionn');
fprintf('Process 3-4 Isentropic expansionn');
fprintf('Process 4-1 Constant pressure heat rejectionnn');

fprintf('Properties at point 1:n');
fprintf('T1= %f Celciusn',T1);
fprintf('P1= %f barn',p1);
fprintf('h1= %f kJ/kgn',h1);
fprintf('s1= %f kJ/kg Cnn',s1);

fprintf('Properties at point 2:n');
fprintf('T2= %f Celciusn',T2);
fprintf('P2= %f barn',p2);
fprintf('h2= %f kJ/kgn',h2);
fprintf('s2= %f kJ/kg Cnn',s2);

fprintf('Properties at point 3:n');
fprintf('T3= %f Celciusn',T3);
fprintf('P3= %f barn',p3);
fprintf('h3= %f kJ/kgn',h3);
fprintf('s3= %f kJ/kg Cnn',s3);

fprintf('Properties at point 4:n');
fprintf('T4= %f Celciusn',T4);
fprintf('P4= %f barn',p4);
fprintf('h4= %f kJ/kgn',h4);
fprintf('s4= %f kJ/kg Cnn',s4);

fprintf('---------------RESULTS---------------n');
fprintf('Net work output is %f kJn',Wnet);
fprintf('Efficiency of cycle is %f %%n',eff);
fprintf('Back work ratio is %fn',bac);

%% Plotting t-s and h-s plot
%Ploting saturation lines
T=(1:2000);                                                  %Array stores temp. values
for i=1:1:2000                                             %loop for storing values...
    sL(1,i)=XSteam('sL_T',i);                       %..of entropy and enthalpy..
    sV(1,i)=XSteam('sV_T',i);                      % w.r.t to temperature
    hL(1,i)=XSteam('hL_T',i);
    hV(1,i)=XSteam('hV_T',i);
end
figure(1)
plot(sL,T,'b','linewidth',1);                    %Plots liquid saturation line
hold on;                                                %holds figure 1
plot(sV,T,'b','linewidth',1);                    %Plots vapour saturation line
xlabel('Entropy (kJ/kg C)');               %x axis label
ylabel('Temperature (C)');                 %y axis label
title('Temperature v/s entropy plot');       %title of plot
figure(2)                                               %makes figure 2 active
plot(sL,hL,'b','linewidth',1);                 %plots liquid saturation line
hold on;                                               %holds the figure
plot(sV,hV,'b','linewidth',1);                %plots vapour saturation line
xlabel('Entropy (kJ/kg C)');              %x axis label
ylabel('Enthalpy (kJ/kg)');                %y axis label
title('Enthalpy v/s entropy plot');          %title of plot

%Ploting the rankine cycle
figure(1)                                              %makes figure 1 active
plot([s1,s2,s5,s6,s3,s4,s1],[T1,T2,T5,T6,T3,T4,T1],'k','linewidth',1);
figure(2)                                              %makes figure 2 active
plot([s1,s2,s5,s6,s3,s4,s1],[h1,h2,h5,h6,h3,h4,h1],'k','linewidth',1);

Possible errors:-

  1. You may get error that 'XSteam function not defined'. This is because the XSteam is not an in built function and has to be added externally into matlab library.
  2. To add CSteam library goto Add-Ons in home tab and search for XSteam. You will see an library with name "

    Modelling of Rankine cycles using Spencer, Cotton and Cannon

    " just click and press installed and the program will work just fine.

Outputs:-

  1. We get the Net work output as 1120.83 kJ.
  2. Efficiency of cycle as 36.22 %.
  3. Back work ratio as 0.000027.
  4. Temperature v/s entropy plot.
  5. Enthalpy v/s entropy plot.

Output images:-




Conclusion:-

  1. We can simulate different plots for different input parameters which the analysis more easier.
  2. The more the number of assumptions, the more the plot deviates from orignal conditions.
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.