Challenge

Project 2 - Rankine cycle Simulator

PROJECT 2: RANKINE CYCLE

AIM: Create a Rankine Cycle Simulator .

code should calculate the state points of the Rankine Cycle.

plot the corresponding T-s and h-s plots for the given set of inputs.

THEORY:

Rankine cycle is an idealized yhermodaynamic cycle describing the process by which certain heat engines, such as steam turbines or reciprocating steam engines, allow mechanical work to be extracted from a fluid as it moves between a heat source and heat sink.

Heat energy is supplied to the system via a boiler where the working fluid (typically water) is converted to a high pressure gaseous state (steam) in order to turn a turbine. After passing over the turbine the fluid is allowed to condense back into a liquid state as waste heat energy is rejected before being returned to boiler, completing the cycle. Friction losses throughout the system are often neglected for the purpose of simplifying calculations as such losses are usually much less significant than thermodynamic losses, especially in larger systems.

  • Process 1–2: The working fluid is pumped from low to high pressure. As the fluid is a liquid at this stage, the pump requires little input energy.
  • Process 2–3: The high-pressure liquid enters a boiler, where it is heated at constant pressure by an external heat source to become a dry saturated vapour. T
  • Process 3–4: The dry saturated vapour expands through a turbine, generating power. This decreases the temperature and pressure of the vapour, and some condensation may occur.
  • Process 4–1: The wet vapour then enters a condensor, where it is condensed at a constant pressure to become a saturated liquid.

Explanation:

xsteam data is to extract steam and liquid properties of enthalphy entropy at specific pressure and temperature.

The programm requires an input pressure at inlet of the turbine in bar(p1), temperature at same point in deg c(T1) and pressure at the input of the condensor in bar(p2).

With this input we find all the state points of the cycle.

We can find different values of enthalphy and entropy by using the relation h1 = XSteam(h_pt,p1,T1).

it gives enthalphy of water at point 1at p1 and T1.

By usnig thermodynamic relations we can find other state points.

sf ,sg ,hf ,hg are point at saturated liquid and saturated liquid that can be extract from xsteam.

The work by turbine, work by pump , net work ,therm efficiency ,SSC can be calculated by using standard thermodynamic relations.

T-S curve is plotted at different point and saturation curve is ploted in red color line and used title,legend and xlabel and ylabel to mentioned points.

h-s curve is plotted at different point and saturation curve is ploted in red color line and used title,legend and xlabel and ylabel to mentioned points.

reults are exicuted in the command window .

Main program

clear all 
close all 
clc

disp('Rankine cycle');
disp('process 1-2 is isentropic expansion in turbine');
disp('process 2-3 is constant pressure heat rejection in condensor');
disp('process 3-4 is isentropic compression in pump');
disp('prcoess 4-1 is constant pressure heat addition at boiler');

p1 = input('nvalues of the pressure at turbine,inlet,p1(in bar)=');
T1 = input('nvalues of the temperature at turbine,inlet,T1(in degree celcius) =');
p2 = input('nvalues of the pressure at condensor,inlet,p2(in bar) =');

%Extracting data 
%at state point 1
 
h1 = XSteam('h_pT',p1,T1)
s1 = XSteam('s_pT',p1,T1)

% at state point 2

s2 = s1;                       %isentropic expansion
sf2 = XSteam('sL_p',p2)     %saturated liquid entropy
sg2 = XSteam('sV_p',p2)       %saturated vapour entropy
hf2 = XSteam('hL_p',p2)       %saturated liquid enthalphy
hg2 = XSteam('hV_p',p2)      %saturated vapour enthalphy

x2 = ((s2-sf2)/(sg2-sf2))

h2 = hf2+(x2*(hg2-hf2))

T2 = XSteam('Tsat_p',p2)

% at state 3 
p3 = p2
h3 = XSteam('hL_p',p3)
s3 = XSteam('sL_p',p3)
T3 = XSteam('Tsat_p',p2)
% at state 4
s4 =s3
p4 =p1
Cp4 = XSteam('Cp_ps',p4,s4)
Cv4 = XSteam('Cv_ps',p4,s4)
k = Cp4/Cv4
T4 = T3/((p3/p4)^((k-1)/k))

%work by turbine
Wt = h1-h2
%work done to run pump 
v3 = XSteam('vL_p',p3)
Wp = v3*(p4-p3)*100
h4 = h3+Wp

% net work of the cycle
Wnet = Wt-Wp

% heat added at the boiler
Qin = h1-h4

%heat rejection at condensor
Qout = h2-h3

% thermal energy of the cycle
Ntherm = (Wnet/Qin)*100

%specific steam consumption (S.S.C)

SSC = (3600/Wnet)

% back work ratio
BW =(Wp/Wt)

%calculating  temperature entropy and enthalphy at the vapour liquid line
T6 = XSteam('Tsat_p',p1);
h5 = XSteam('hL_p',p1);
s5 = XSteam('sL_p',p1);

h6 = XSteam('hV_p',p1);
s6 = XSteam('sV_p',p1);

T5 = T6;
%Plotting the saturation curve 
T = linspace(1,400,1000)
for i = 1:length(T)
    sf(i) = XSteam('sL_T',T(i));
    sg(i) = XSteam('sV_T',T(i));
    hf(i) = XSteam('hL_T',T(i));
    hg(i) = XSteam('hV_T',T(i));
end

%plotting T-s diagram
figure(1)
hold on
plot(sf,T,'r','linewidth',1);
plot(sg,T,'r','linewidth',1);
plot([s1 s2],[T1 T2],'b','linewidth',2);
plot([s2 s3],[T2 T3],'b','linewidth',2);
plot([s3 s4],[T3 T4],'b','linewidth',2);
plot([s4 s5],[T4 T5],'b','linewidth',2);
plot([s5 s6],[T5 T6],'b','linewidth',2);
plot([s6 s1],[T6 T1],'b','linewidth',2);

sc1 = linspace(s6,s1,1000)
for i = 1:length(sc1)
    Tc1(1) = XSteam('T_ps',p1,sc1(1));
end
plot(sc1,Tc1,'b','linewidth',2);
text(s1+0.1,T1,'1');
text(s2+0.1,T2,'2');
text(s3,T3-20,'3');
text(s4,T4+20,'4');
title('temperatue vs entropy');
xlabel('entropy');
ylabel('temperature');
legend('saturation curve');

figure(2)
hold on
plot(sf,hf,'r','linewidth',1);
plot(sg,hg,'r','linewidth',1);
plot([s1 s2] ,[h1 h2],'b','linewidth',2);
plot([s2 s3] ,[h2 h3],'b','linewidth',2);
plot([s3 s4] ,[h3 h4],'b','linewidth',2);
hc = linspace(h4,h5,100);
for k = 1:length(hc)
    sch(k)= XSteam('s_ph',p1,hc(k));
end
plot(sch,hc,'b','linewidth',2);
    plot([s5 s6], [h5 h6] ,'b','linewidth',2);
    for j = 1:length(sc1)
        hc1(j) = XSteam('h_ps',p1,sc1(j));
    end
    plot(sc1,hc1,'b','linewidth',2);
    text(s1+0.1,h1,'1');
    text(s2+0.1,h2,'2');
    text(s3,h3-100,'3');
    text(s4,h4+200,'4');
    title('enthalphy vs entropy');
    xlabel('entropy');
    ylabel('enthalpy');
    legend('saturation curve');
    
    
    %printing the output
    disp('results')
    p1 = p1
    T1 = T1
    p2 = p2
    disp('At state point 1')
   n1 = sprintf('P1 is : %.3f Bar',p1)
   disp(n1)
    n2 = sprintf('T1 is : %.3f deg celcius',T1)
    disp(n2)
    n3 = sprintf('H1 is : %.3f kj/kg',h1)
    disp(n3)
    n4 = sprintf('S1 is : %.3f kj/kgk',s1)
    disp(n4)
    
    disp('At state point 2:')
  n5 =  sprintf('P2 is : %f bar',p2)
  disp(n5)
    n6 = sprintf('T2 is : %f deg celcius',T2)
     disp(n6)
    n7 = sprintf('H2 is : %f kj/kg',h2)
     disp(n7)
    n8 = sprintf('S2 is : %f kj/kgk',s2)
     disp(n8)
    n9 = sprintf('X  is : %f r',x2)
     disp(n9)
     disp('At state point 3:')
   n10 = sprintf('P3 is : %f Bar',p3)
    disp(n10) 
    n11 = sprintf('T3 is : %f deg celcius',T3)
    disp(n11) 
    n12 = sprintf('H3 is : %f kj/kg',h3)
    disp(n12) 
    n13 = sprintf('S3 is : %f kj/kgk',s3)
    disp(n13) 
    
     disp('At state point 4:')
    n14 = sprintf('P4 is : %f Bar',p4)
    disp(n14) 
    n15 = sprintf('T4 is : %f deg celcius',T4)
    disp(n15) 
    n16 = sprintf('H4 is : %f kj/kg',h4)
    disp(n16) 
    n17 = sprintf('S4 is : %f kj/kgk',s4)
    disp(n17) 
   
    
   n18 = sprintf('Wt is : %f kj/kg',Wt)
     disp(n18) 
    n19 = sprintf('Wp is : %f kj/kg',Wp)
      disp(n19) 
    n20 = sprintf('Wnet is : %f kj/kg',Wnet)
    disp(20)
    n21 = sprintf('Ntherm is : %f percent',Ntherm)
      disp(n21) 
    n22 = sprintf('S.S.C is : %f kg/kWh',SSC)
      disp(n22) 
    

RESULTS:

1)Wnet is : 1117.851878 kj/kg

2)BW =0.0027

3) Ploted T-S and H-S curve

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.