Challenge

Project 2 - Rankine cycle Simulator

Title : Matlab program for simulation of rinkine cycle.

Explanation:

  • The Rankine cycle is an idealized thermodymanic cycle describeing the entire process by which the heat engines do the work in mechanical form when the liquid or steam power is forced onto it.
  • Thermal efficiency of the rankine cycle is given to be one third of the entire cycle.
  • Rankine cycle converts heat energy or thermal energy into effective work.
  • The processes for rankine cycle are named as:
  • isentropic compression.
  • constant pressure heat addition
  • isentropic expansion
  • constant pressure heat rejection.
  • Rankine cycle is generally used for rating the performance of steam power plants.

Process Explanation:

  • Process 1-2 is the isentropic compression in which the working fluid is given heat as work and it is converted from low pressure to high pressure.
  • Process 2-3 The high pressure liquid in the boiler from first process is converted to high pressure saturated vapour with the help of heat addition by the boiler.
  • Process 3-4 in this process the high pressure dry saturated vapour is used for generation of power by moving the turbine which reduces the pressure and temperature of the steam.
  • Process 4-1 the wet vapour further enters into the condensor where the vapour is converted back into low pressure liquid which can be used for another cycle process.

Code Explaination :

  • The code begins with clear all, close all, and clc as always.
  • t3,p3,p4 are inlet pressure ,temperature and output pressure of turbine.
  • sf1 is the entropy of the fluid at point 1 which is given in by the steam table represented as xsteam.
  • hf1 is given in the name of enthalpy at point1 and so is done with enthalpy and entropy at point 3 as well.
  • as the process from 3-4 is isentropic which gives s3=s4.
  • entropy difference is given by the difference between the entropies between two state points.
  • Next the quality of steam is calculated and so is enthalpy is calculated as entropy.
  • Enthalpy at point 4 is calculated by the addition to the entalpy at point 1 to the product of steam and the enthalpy difference at perticular pressure.
  • The turbien qwork is given by the diffrence between the enthalpy of point 3 and 4.
  • Further specific volume of the cycle is calculated and the workdone by the pump is given by the formula which is used to calculate.
  • Total work done of the cycle is by the difference between turbine work and work done by the pump.
  • Further the saturation enthalpy of liquid is calculated which will be the difference between the total work and the enthalpy at 1.
  • Heat addition to the fluid by the boiler is given by the difference between entropy at point 3 and saturation liquid enthalpy at 2.
  • Efficieny of the rankine cycle is given by the ratio of total work done to total heat supplied.
  • further back work rario gives by the ratio between work done by turbine and pump and the diffrence of the same can be used to define the loss of power.
  • Lastly the point variables are assigned as shown in the code which gives the proper cordinates of each point input variables.
  • The output are assigned with reference to the input variables of the along with proper labelling.
  • clear all
    close all
    clc
    %program for rankine cycle
    t3 = input('inlet temp of turbine')
    p3 = input('inlet pressure of turbine')
    p4 = input('outlet pr of turbine')
    %entropy at 1
    sf1 = Xsteam('sL_p',p4);
    %enthalpy at 1
    hf1 = Xsteam('hL_p',p4);
    %enthalpy at 3
    h3 = Xsteam('h_pT',p3,T3);
    %entropy at 3
    s3 = Xsteam('s_pT',p3,T3);
    %isentropic process
    s3 = s4;
    %entropy diff. at 0.005 pr.
    sfg4 = Xsteam('sV_p',p4)-Xsteam('sL_p',p4);
    %steam
    q = (s4-sf1)/sfg4;
    %enthalpy diff at 0.005 pr.
    hfg4 = Xsteam('hV_p',p4)-Xsteam('hL_p',p4);
    %enthalpy at point 4
    h4 = hf1+(q*hfg4);
    %turbine work
    wt = h3-h4;
    %specific vol at 1
    sv = Xsteam('vL_p',p4);
    %work by pump
    wp = sv(p3-p4);
    %total work done
    w_t = wt-wp;
    %saturated liquid enthalpy at 2
    hf2 = wp+hf1;
    %boiler heat input
    qi = h3 -hf2;
    %efficiency
    eff = (w_t/qi)*100;
    %back work ratio
    Back_w = wp/wt;
    
    %point 1
    T1 = Xsteam('Tsat_p',p4);
    p1 = p4;
    h1 = hf1;
    s1 = sf1;
    
    %point 2
    T2 = Xsteam('T_ps',p3,s1);
    p2 = p3;
    h2 = Xsteam('h_ps',p3,s1);
    s2 = s1;
    
    %point 3
    T3;
    p3;
    h3;
    s3;
    
    %point4
    T4 = Xsteam('T_ph',p4,h4);
    p4;
    h4;
    s4;
    %mid properties
    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);
    
    %output cal
    fprintf('1-2 isentropic compression n');
    fprintf('properties at point 1:n');
    fprintf('T1=%f Celcius n',T1);
    fprintf('P1=%f bar n',p1);
    fprintf('h1=%f KJ/Kg n',h1);
    fprintf('s1=%f KJ/Kg n',s1);
    disp(' ');
    
    fprintf('2-3 isobaric heat addition n');
    fprintf('properties at point 2:n');
    fprintf('T2=%f Celcius n',T2);
    fprintf('P2=%f bar n',p2);
    fprintf('h2=%f KJ/Kg n',h2);
    fprintf('s2=%f KJ/Kg n',s2);
    disp(' ');
    
    fprintf('3-4 isentropic expansion n');
    fprintf('properties at point 3:n');
    fprintf('T3=%f Celcius n',T3);
    fprintf('P3=%f bar n',p3);
    fprintf('h3=%f KJ/Kg n',h3);
    fprintf('s3=%f KJ/Kg n',s3);
    disp(' ');
    
    fprintf('4-1 isobaric heat rejection n');
    fprintf('properties at point 4:n');
    fprintf('T4=%f Celcius n',T4);
    fprintf('P4=%f bar n',p4);
    fprintf('h4=%f KJ/Kg n',h4);
    fprintf('s4=%f KJ/Kg n',s4);
    disp(' ');
    
    fprintf('work output is %f Kj n',w_t);
    fprintf('efficiency %f %%n',eff);
    fprintf('back work ratio %f n',Back_w);
    
    

Error :

  • Some minor errors were faced while writing the program but not something specific stuck,just minor mistyping.
  • Later the program was quite run for some moment but the further error faced wasnt able to resolve by me.
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.