Challenge

Project 2 - Rankine cycle Simulator

Aim:

Creating a rankine cycele simulator using OCTAVE/MATLAB. Calculating the state points of the rankine cycle based on user inputs.then, plotting the corresponding T-S & h-s plots the given set of inputs.

Objective:

It’s the fundamental operating cycle of all power plants where an operating fluid is continuously evaporating and condensed. Selection of operating fluid depends mainly on the available temperature range.

That process of:

1-2: isentropic expansion in the turbine

Wt =h1-h2

Wt-work done by the turbine

2-3: isobaric heat rejection by the condenser

Qr=h2-h3

Qr-heat rejection

H2,3- enthalpy stage 2,3

3-4: isentropic compression in the pump

Wp=h4-h2

Wp-work taken by the turbine

4-1: isobaric heat addition by the boiler

Qa=h1-h4

Qa-hear addition

H1,4 are enthalphy 1&4 stage .

Ntherm=h1-h2-h4+h3/h1-h4

Net work output: Wn=Wt-Wp

Back work ratio: BWR=Wp/Wt

Specification steam consumption:

SSC=3600/Wn

Condenser:

Its condenses a gaseous chemical elements into liquid from with help to cooling.

Pump:

Its used to moves liquid,gasses,slurries from one place to another place or lower heat to upper heat or vice visa.

Boiler:

It used to generate steam by heating water with the help of provided thermal engrgy.

Turbine:

Its used to generated mechanical work / energy from moving fluid water,steam,air etc,.

Given input values are:

Turbine Inlet temperature = 400° C

Turbine Inlet Pressure = 30 bars

Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure

main code:

%basic rankine cycle
clear all
close all
clc
%%the processes undergoing in the cycle

%1-2:isentropic expansion in the turbine
%2-3:isobaric heat rejection by the condenser
%3-4:isentropic compression in the pump
%4-1:isobaric heat addition by the boiler

%initialization input values of the variables

P1=input('enter the pressure at the inlet of the turbine(in bar):');
T1=input('enter the temperature at the inlet of the turbine (in degree C):');
P2=input('enter the pressure at the inlet of condenser(in bar):');
t=linspace(0,400,200);
disp(' ')

%calculating and display the values of P,T,h,s for state using 'XSteam'library

%at state point 1
h1=Xsteam('h_pT',P1);      
s1=Xsteam('s_pT',P1);
hl1=Xsteam('hL_p',P1);
hg1=Xsteam('hv_p',P1);
sl1=Xsteam('sL_p',P1);
sg1=Xsteam('sV-p',P1);
Tsat1=Xsteam('Tsat_p',P1);

%at state point 2
s2=s1;
sl2=Xsteam('sL_p',P2);
sg2=Xsteam('sV_p',P2);
d=(s2-s1)/(sg2-sl2);
hl2=steam('hl_p',P2);
hg2=Xsteam('hV_p',P2);
h2=hl2+d*(hg2-hl2);
T2=Xsteam('T_ph',P2,h2);
Tsat2=xsteam('Tsat_p',P2);

%at state 3
h3=hl2;
s3=sl2;
P3=P2;
T3=T2;

%at state 4
s4=s3;
P4=P1;
h4=Xsteam('h_ps',P4,s4);
T4=Xsteam('T_ps',P4,s4);

%work and efficiency calculation
%work done by turbin
W_turbine=h1-h2;
%work done by pump
W_pump=h4-h3;
%net work done
W_net=w_turbine-w_pump;
%thermal efficiency
therm_eff=(1-((h2-h3)/(h1-h4))*100);

%back work ratio
back_wr=W_pump/W_turbine;

%specified steam conductivity
ssc=3600/W_turbine;
%%plotting of diferent curves
%plotting T-s graph 
fig(1),clf
hold on 
%saturation curve
for i=1:length(t)
plot(Xsteam('sL_T',t(i)),t(i),'g')
plot(Xstyeam('sV_T',t(i)),t(i),'g')
end

%cycle
plot([s1 s2],[T1 T2],'linewidth',2)
text(s1,T1,'1','fontsize',15)
if d>1
    T3= Tsat2;
    plot([s2 sg2 s3 s4],[T2 Tsat2 T3 T4],'linewidth',2)
    T2Tsat2;
    text(s2,T2,'2','fontsize',15)
    text(s3,T3,'3','fontsize',15)
else
    plot([s2 s3 s4],[T2 T3 T4],'linewidth',2)
     text(s2,T2,'2','fontsize',15)
    text(s3,T3,'3','fontsize',15)
end
n=linespace(T1,T2,500);
for i =1:length(n)
plot(Xsteam('s_pT',P1,n(i)),n(i),'.','linewidth',2)
end
plot([sl1 sg1],[Tsat1 Tsat1],'linewidth',2)
text(sl1,Tsat1,'4','fontsize',15)
xlabel('entropy)kj/kg-k')
ylabel('temperature(k)')
title('T-s graph')

%h-s graph
fig(2),clf
hold on
%saturation curve
for i=1:length(t)
    plot(Xsteam('sL_T',t(i)),Xsteam('hL_T',t(i)),'r.')
    plot(Xsteam('sV_T',t(i)),Xsteam('hV_T',t(i)),'r.')
end
%cycle
plot([s1 s2 s3 s4 s1],[h1 h2 h3 h4 h1],'linewidh',2)
text(s1,h1,'1','fontsize',15)
text(s2,h2,'2','fontsize',15)
text(s3,h3,'3','fontsize',15)
text(s4,h4+90,'4','fontsize',15)

xlabel('entropy)kj/kg-k')
ylabel('temperature(k)')
title('h-s graph')
 %displaying the result in the command window
 
   %At state point 1:
   disp('at state point 1:')
   fprintf('P1=%.2f bar \n',P1)
   fprintf ['T1=%.2f' char(176)'C \n'],T1
   fprintf('h1=%.2f kj/kg \n',h1)
   fprintf('s1=%.2f kj/kgk \n',s1)
   disp(' ')
   
     %At state point 2:
   disp('at state point 2:')
   fprintf('P2=%.2f bar \n',P2)
   fprintf ['T2=%.2f'char(176)'C \n'],T2
   fprintf('h2=%.2f kj/kg \n',h2)
   fprintf('s2=%.2f kj/kgk \n',s2)
   disp(' ')
    
    %At state point 3:
   disp('at state point 3:')
   fprintf('P3=%.2f bar \n',P3)
   fprintf ['T3=%.2f' char(176)'C \n'],T3
   fprintf('h3=%.2f kj/kg \n',h3)
   fprintf('s3=%.2f kj/kgk \n',s3)
   disp(' ')
   
    %At state point 4:
   disp('at state point 4:')
   fprintf('P4=%.2f bar \n',P4)
   fprintf ['T4=%.2f' char(176)'C \n'],T4
   fprintf('h4=%.2f kj/kg \n',h4)
   fprintf('s4=%.2f kj/kgk \n',s4)
   disp(' ')
   
   fprintf('Work done by tirbine =%.2f kj/kg n',W_turbine)
   fprintf('work done by pump =%.2f kj/kg n',W_pump)
   fprintf('net work done =%.2f %% n",therm_eff')
   fprintf('thermal efficiency =%.2f %%n',therm_eff)
   fprintf('bacl work ratio =%f n',back_wr)
   fprintt ('specification steam conductivity =%.2 kg/kWh \n',ssc)
   

Explanation

P1,T1,P2 are given input and the temperature value array “t” was created using ‘linspace’.

Xsteam is library values of various physical parameters. Enthalpy,entropy, saturated liquid/vapour-enthalpy/entropy,saturation temperature at 4 state point . similarly state points 3&4 same calculated.

Basic relation between work and physical parameter and Basic mathematical operation in octave w_net,bacl_wr .T-s curve Xsteam library function to plot T-s curve at diff temperature array values.

Reference:

https://skill-lync.com/student-projects/basic-rankine-cycle-simulator

http://www.ecourses.ou.edu/cgi-bin/ebook.cgi?topic=th&chap_sec=10.1&page=theory

reference from Xsteam function

https://www.nuclear-power.com/nuclear-engineering/thermodynamics/thermodynamic-cycles/rankine-cycle-steam-turbine-cycle/theory-of-rankine-cycle-equations-and-calculation/

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.