Challenge

Project 2 - Rankine cycle Simulator

AIM:

To simulate the Rankine Cycle using MATLAB.

OBJECTIVE:

  1. Calculate the state points of the Rankine cycle based on user inputs.
  2. Plot the corresponding T-S and H-S plots for the given set of inputs.
  3. Calculate cycle efficiency and back work ratio.

THEORY:

The Rankine cycle or Rankine Vapor Cycle is the process widely used by power plants such as coal-fired power plants or nuclear reactors. In this mechanism, a fuel is used to produce heat within a boiler, converting water into steam which then expands through a turbine producing useful work. This process was developed in 1859 by Scottish engineer William J.M. Rankine. This is a thermodynamic cycle which converts heat into mechanical energy—which usually gets transformed into electricity by electrical generation.

Plots for Rankine cycle:

  1. P-V plot
  2. T-S plot
  3. H-S plot

There are four processes in the Rankine cycle. The states are identified by numbers (in brown) in the T–s diagram.

Process 1–2: The dry saturated vapour expands through a turbine, generating power. This decreases the temperature and pressure of the vapour, and some condensation may occur. The output in this process can be easily calculated using the chart or tables noted above.

In other words Process 1-2 is, Isentropic expansion.

Process 2–3: The wet vapour then enters a condenser, where it is condensed at a constant pressure to become a saturated liquid.

In other words Process 2-3 is, Constant pressure heat rejection in condenser.

Process 3–4: 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.

In other words Process 3-4 is, Isentropic compression.

Process 4–1: 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. The input energy required can be easily calculated graphically, using an enthalpy–entropy chart (h–s chart, or Mollier diagram), or numerically, using steam tables.

In other words Process 4-1 is, Constant pressure heat addition in boiler.

In an ideal Rankine cycle the pump and turbine would be isentropic, i.e., the pump and turbine would generate no entropy and hence maximize the net work output. Processes 1–2 and 3–4 are represented by vertical lines on the T–S diagram.

The efficiency of the Rankine cycle is limited by the high heat of vaporization by the fluid. The fluid must be cycled through and reused constantly, therefore, water is the most practical fluid for this cycle. This is not why many power plants are located near a body of water—that's for the waste heat.

As the water condenses in the condenser, waste heat is given off in the form of water vapour—which can be seen billowing from a plant's cooling towers. This waste heat is necessary in any thermodynamic cycle. Due to this condensation step, the pressure at the turbine outlet is lowered. This means the pump requires less work to compress the water—resulting in higher overall efficiencies.

GOVERNING EQUATIONS:

  1. Work turbine,out = h1 – h2 : Work done (Output work) by turbine in process 1-2.
  2. Q in = h1 – h4 : Heat given to the system in boiler, process 4-1.
  3. Work pump,in = h4 – h3 : Work done by pump (Input work) in process 3-4.
  4. Q out = h2 – h3 : Heat released by the system in condenser, process 2-3.
  5. Work Shaft = Work net = Work turbine,out - Work pump,in : Net work done which is the work done by shaft.
  6. The thermal efficiency of the Rankine cycle is determined from:

7.

Main Program:

Programming language used is MATLAB.

Program for simulating the Rankine cycle.

% Rankine Cycle Simulator 
clear all 
close all 
clc 

while (1)
    clear all 
    close all 
    clc 
    % Printing Introduction 
    fprintf('RANKINE CYCLE SIMULATOR \n') 
    disp('Process 1-2: Reversible Adibatic Expansion in Turbine') 
    disp('Process 2-3: Constant Pressure Heat Rejection in Condenser') 
    disp('Process 3-4: Reversible Adiabatic Compression in Pump')   
    disp('Process 4-1: Constant Pressure Heat Addition in Boiler') 
 
 
    % Taking initial inputs  from then user 
    % P1 = Inlet pressure of turbine(bar) 
    % P2 = Outlet pressure of turbine(bar)
    % T1 = Inlet temperature of turbine(°C) 
    
    fprintf('\n') 
    P1 = input('Enter Pressure at Turbine Inlet(in Bar):  '); 
    T1 = input('Enter Temperature at Turbine Inlet(in °C):  ');
    P2 = input('Enter Pressure at Turbine Outlet(in Bar):  '); 
 
    % Calculating state variables at point 1
    H1 = XSteam('h_pt',P1,T1);  % Enthalpy at point 1
    S1 = XSteam('s_pt',P1,T1);  % Entropy at point 1
    Hf1 = XSteam('hL_p',P1);    % Enthalpy of saturated liquid 
    Hg1 = XSteam('hV_p',P1);    % Enthaply of saturated vapour 
    Ts1 = XSteam('Tsat_p',P1);  % Saturation Temprature 
    Sf1 = XSteam('sL_p',P1);    % Entropy of saturated liquid 
    Sg1 = XSteam('sV_p',P1);    % Entropy of saturated vapour 
 
    % Calculating state variables at point 2
    S2 = S1;                    % Process 1-2 is isentropic process
    Sf2 = XSteam('sL_p',P2);    % Entropy of saturated liquid  
    Sg2 = XSteam('sV_p',P2);    % Entropy of saturated vapour
    x = (S2-Sf2)/(Sg2-Sf2);     % Dryness fraction
    Hf2 = XSteam('hL_p',P2);    % Enthalpy of saturated liquid
    Hg2 = XSteam('hV_p',P2);    % Enthalpy of saturated vapour
    H2 = Hf2 + x*(Hg2-Hf2);     % Enthalpy at point 2 
    T2 = XSteam('T_ph',P2,H2);  % Temperature at point 2
    Ts2 = XSteam('Tsat_p',P2);  % Saturation temperatue    
 
    % Calculating state variables at point 3
    H3 = Hf2;       % Enthalpy at point 3        
    S3 = Sf2;       % Entropy at point 3  
    T3 = T2;        % Temperature at point 3
    P3 = P2;        % Pressure at point 3 
 
    % Calculating state variables at point 4 
    P4 = P1;                        % Process 4-1 is isobaric process
    S4 = S3;                        % Process 3-4 is isentropic process
    H4 = XSteam('h_ps',P4,S4);      % Enthalpy at point 4
    T4 = XSteam('T_ps',P4,S4);      % Temperatue at point 4 
 
    t = linspace(0,374,500);    % temp space for plotting saturation cutves 
 
    %Plot T-S Diagram 
    figure(1)
    hold on 
    % Plotting the Saturation Curve 
    for i = 1 : length(t)    
        plot(XSteam('sL_T',t(i)),t(i),'.','color','r')   
        plot(XSteam('sV_T',t(i)),t(i),'.','color','r') 
    end

    % Plotting the Rankine Cycle
    b1 = plot([S1 S2],[T1 T2],'linewidth',1,'color','b');
    if x>1   
        T3 = Ts2; 
        b2 =plot([S2 Sg2 S3],[T2 Ts2 T3],'linewidth',1,'color','m') ;
        T2 = Ts2;
    else 
        b2 =plot([S2 S3],[T2 T3],'linewidth',1,'color','m') ;
    end
       
    b3=plot([S3,S4],[T3,T4],'color','k'); 
    
    b4=plot([S4 Sf1 Sg1 S1],[T4 Ts1 Ts1 T1],'linewidth',1,'color','g');
    
    axis([0 15 -5 (T1+200)])
    xlabel('Specific Entropy[KJ/Kg-K]')
    ylabel('Temprature[K]') 
    legend([b1,b2,b3,b4],{'Isentropic Expansion in Turbine','Isobaric Heat Rejection in Condenser','Reversible Adiabatic Compression in Pump ','Isobaric Heat Addition in Boiler'},'location','northeast');
    title('Temperature v/s Specific Entropy (T-S Diagram)')
    hold off
 
    % Plotting the H-S Diagram
    figure(2) 
    hold on 
    % Plotting the Saturation Curve 
    for i = 1 : length(t)
        plot(XSteam('sL_T',t(i)),XSteam('hL_T',t(i)),'.','color','r') 
        plot(XSteam('sV_T',t(i)),XSteam('hV_T',t(i)),'.','color','r')
    end

    % Plotting the Rankine Cycle  
    a1=plot([S1,S2],[H1,H2],'color','b');  
    a2=plot([S2,S3],[H2,H3],'color','g');  
    a3=plot([S3,S4],[H3,H4],'color','k'); 
    a4=plot([S4,S1],[H4,H1],'color','m');
    xlabel('Specific Entropy [KJ/Kg-K]')
    ylabel('Specific Enthalpy [KJ/Kg]')
    title('Specific Enthalpy v/s Specific Entropy (H-S Diagram)')
    legend([a1,a2,a3,a4],{'Isentropic Expansion in Turbine','Isobaric Heat Rejection in Condenser','Isentropic Compression in Pump','Isobaric Heat Addition in Boiler'},'location','southeast')  
    hold off
 
    % Calculations 
 
    % Turbine Work 
    Wt = H1-H2; 
 
    % Pump Work
    Wp = H4-H3; 
 
    % Heat Addition 
    Qin = H1-H4; 
 
    % Heat Rejection
    Qout = H2-H3; 
 
    % Net Work
    Wnet = Wt-Wp; 
 
    % Efficiency
    Ntherm = (Wnet/Qin)*100; 
 
    % Specific steam consumption 
    SSC = 3600/Wnet; 
 
    % Back Work Ratio 
    BWR = Wp/Wt; 
 
    % Printing Results 
    fprintf('\n\nResults\n')
    fprintf('Parameters at State Point 1:\n')
    fprintf('P1 is : %.2f bar\n',P1)
    fprintf('T1 is : %.2f Deg Celcius\n',T1)
    fprintf('H1 is : %.2f KJ/Kg\n',H1)
    fprintf('S1 is : %.2f KJ/Kg-K\n',S1) 
 
    fprintf('\nParameters at State Point 2:\n')
    fprintf('P2 is : %.2f bar\n',P2)
    fprintf('T2 is : %.2f Deg Celcius\n',T2)
    fprintf('H2 is : %.2f KJ/Kg\n',H2)
    fprintf('S2 is : %.2f KJ/Kg-K\n',S2) 
    fprintf('Compression ratio x is : %.2f \n',x) 
 
    fprintf('\nParameters at State Point 3:\n')
    fprintf('P3 is : %.2f bar\n',P3) 
    fprintf('T3 is : %.2f Deg Celcius\n',T3)
    fprintf('H3 is : %.2f KJ/Kg\n',H3) 
    fprintf('S3 is : %.2f KJ/Kg-K\n',S3) 
 
    fprintf('\nParameters at State Point 4:\n') 
    fprintf('P4 is : %.2f bar\n',P4) 
    fprintf('T4 is : %.2f Deg Celcius\n',T4) 
    fprintf('H4 is : %.2f KJ/Kg\n',H4) 
    fprintf('S4 is : %.2f KJ/Kg-K\n',S4) 
 
    fprintf('\nTurbine Work is : %.2f KJ/Kg\n',Wt) 
    fprintf('Pump Work is : %.2f KJ/Kg\n',Wp) 
    fprintf('Work net (Shaft Work)  is : %.2f KJ/Kg\n',Wnet) 
    fprintf('Thermal Efficiency is : %.2f percent\n',Ntherm) 
    fprintf('Specific steam consumption is : %.2f Kg/KWh\n',SSC)  
    fprintf('Back Work Ratio is : %.5f \n',BWR)
    
    % Asking if the user wants to continue
    fprintf('\n') 
    x = input('Do You want to continue? [Y/N]: ','s'); 
    x = upper(x);  
    if x == 'N'       
        disp('\n End for the rankine cycle simulator')     
        break;  
    else
        continue;    
    end
end

EXPLANATION OF THE PROGRAM:

  1. We start with displaying some lines in the command window.
  2. Then we ask user for the inputs. Function input() is used to provide the user input. User input includes temperature and pressure before entry to turbine and pressure after exit to turbine.
  3. Now based on user inputs parameters at 4 state points are calculated. Thermodynamic parameters include enthalpy H, entropy S, temperature T, pressure P, and dryness factor X at state point 2.
  4. For calculating these parameters XSteam()e. steam table MATLAB program is used. This program consists of functions for all thermodynamic properties. After calling these functions in the main script gives us thermodynamic properties based on other properties like temperature and pressure.
  5. After calculating all parameters, the next objective is to calculate pump work, turbine work, net work output, back ratio, and thermal efficiency.
  6. Now, we need to display all these results in the command window which is done by using command 'fprintf()'.
  7. The next objective is to plot the graph for H-S and T-S. The firrst step in plotting this graph is to plot the saturation curve which is calculated using 'for' loop. Under 'for' loop, values for entropy and enthalpy are calculated over a temperature range. Plotting these calculated values, the plot of a saturation curve can is obtained. Other processes are plotted by plotting respective values of H, S, T.
  8. To facilitate users to continue or end the program, we have introduced a while statement at the start of the script. Then at the end we ask the user if he wants to continue, if he chooses “Y” then the program runs again, if he chooses “N” the program stops.

RESULT:

These results are for the following user inputs:

Turbine Inlet temperature = 400° C

Turbine Inlet Pressure = 30 bars

Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure

1 . Command window displaying all the results:

2 . Plot of Temperature v/s Specific Entropy (T-S Diagram):

3 . Plot of Specific Enthalpy v/s Specific Entropy (H-S Diagram):

CONCLUSION:

  1. For our inputs we got:

Net work output = 1117.87 KJ/Kg

Back work ratio = 0.00267

  1. Rankine cycle was successfully simulated by MATLAB program. For the given set of inputs we could plot the corresponding T-S and h-S plots.

REFERENCE:

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

https://en.wikipedia.org/wiki/Rankine_cycle

https://energyeducation.ca/encyclopedia/Rankine_cycle

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.