distillation matlab code

Upload: saurab-devanandan

Post on 04-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Distillation Matlab Code

    1/8

    4-33

    Chapter 4Example 4.4-3 ----------------------------------------------------------------------------------

    A distillation column receives a feed that is 40 mole % n-pentane and 60 mole % n-hexane.

    Feed flow rate is 2,500 lbmol/hr and feed temperature is 30oC. The column is at 1 atm. A

    distillate that is 97 mole % n-pentane is desired. A total condenser is used. Reflux is a

    saturated liquid. The external reflux ratio isL0/D= 3. Bottoms from the partial reboiler is 98mole % n-hexane. FindD,B, QR, QC, and the number of equilibrium stages.

    Data: Vapor pressure, Psat, data: ln Psat=AB/(T+ C), where Psatis in kPa and Tis in K.

    Compound A B C

    n-pentane (1) 13.9778 2554.6 36.2529

    n-hexane (2) 14.0568 2825.42 42.7089

    Heat of evaporation for n-pentane, C5= 11,369 Btu/lbmol, CpL,C5= 39.7 Btu/lbmoloF

    Heat of evaporation for n-hexane, C6= 13,572 Btu/lbmol, CpL,C6= 51.7 Btu/lbmoloF

    Solution ------------------------------------------------------------------------------------------

    (a)Distillate and bottoms flow rates

    Overall material balance over the entire tower gives

    D + B = 2,500

    Material balance for n-pentane over the entire tower gives

    0.97D + 0.02B= (0.4)(2,500) = 1,0000.97(2,500 B) + 0.02B = 1,000

    Solving forB andDfrom the above equations we have B= 1,500 lbmoles/hrand D= 1000

    lbmoles/hr.

    (b)Heating and cooling loads

    QC= V1(H1hD) V1Hevap= V1(0.97C5+ 0.03C6)

    V1=L0+D= (L0/D+ 1)D= 4D= (4)(1000) = 4000 lbmoles/hr

    QC= (4,000)(0.9711,369 + 0.0313,572) = 4.574107Btu/hr

    The temperatures of the reflux stream and the reboiler must be known to solve for the heat

    load of the reboiler. Since the distillate is almost pure pentane and the bottoms product isalmost pure hexane, the boiling temperatures of pure pentane and hexane at 1 atm are used

    for the temperatures of the reflux stream and the reboiler, respectively. Hence

    TD309 K and TB342 K

  • 8/14/2019 Distillation Matlab Code

    2/8

    4-34

    Figure E-1. Distillation column with total condenser and partial reboiler.

    The equilibrium data for n-pentane and n-hexane at 1 atm are listed in Table 2.4-4. The datawere generated with the Matlab codes listed in Table 4.4-5 assuming ideal solution.

    Table 4.4-4Equilibrium data for n-pentane and n-hexane system at 1 atm.x= mole fraction of n-pentane in the liquid

    y = mole fraction of n-pentane in the vaporx= 0.00000 , y= 0.00000, T(K) = 342.06x= 0.05000 , y= 0.12705, T(K) = 339.40

    x= 0.10000 , y= 0.23699, T(K) = 336.91x= 0.15000 , y= 0.33263, T(K) = 334.58x= 0.20000 , y= 0.41626, T(K) = 332.39x= 0.25000 , y= 0.48975, T(K) = 330.32x= 0.30000 , y= 0.55462, T(K) = 328.38x= 0.35000 , y= 0.61214, T(K) = 326.53x= 0.40000 , y= 0.66335, T(K) = 324.79

    x= 0.45000 , y= 0.70911, T(K) = 323.14x= 0.50000 , y= 0.75016, T(K) = 321.56x= 0.55000 , y= 0.78711, T(K) = 320.07

    x= 0.60000 , y= 0.82048, T(K) = 318.64

    x= 0.65000 , y= 0.85070, T(K) = 317.28x= 0.70000 , y= 0.87816, T(K) = 315.97x= 0.75000 , y= 0.90317, T(K) = 314.72x= 0.80000 , y= 0.92601, T(K) = 313.53x= 0.85000 , y= 0.94692, T(K) = 312.38x= 0.90000 , y= 0.96610, T(K) = 311.28x= 0.95000 , y= 0.98374, T(K) = 310.22x= 1.00000 , y= 1.00000, T(K) = 309.20

    F, xF

    v1 QC

    L0 D, x = 0.97D

    B, x = 0.02BQR

    feed plate

    F = 2,500 lbmol/hrT = 30 CP = 1 atm

    o

    L/D = 30

  • 8/14/2019 Distillation Matlab Code

    3/8

    4-35

    -------Table 4.4-5 Matlab codes for n-pentane and n-hexane system -------%A=[13.9778 14.0568];B =[2554.6 2825.42];C=[-36.2529 -42.7089];dT=.01;Tb=B./(A-pl)-C;x=0:0.05:1;for i=1:21;

    xi=x(i);% Assume a temperature for the buble point calculation

    T=xi*Tb(1)+(1-xi)*Tb(2);% Solve for the bubble point temperature using Newton's method

    for n=1:20;f=xi*exp(A(1)-B(1)/(T+C(1)))+(1-xi)*exp(A(2)-B(2)/(T+C(2)))-P;T1=T+dT;f1=xi*exp(A(1)-B(1)/(T1+C(1)))+(1-xi)*exp(A(2)-B(2)/(T1+C(2)))-P;fp=(f1-f)/dT;eT=f/fp;T=T-eT;if abs(eT)

  • 8/14/2019 Distillation Matlab Code

    4/8

    4-36

    L

    V=

    L

    L D+=

    /

    / 1

    L D

    L D +=

    1

    R

    R +

    D

    V=

    D

    L D+=

    1

    / 1L D +=

    1

    1R +

    The operating line becomes

    yn+1=1

    R

    R +xn +

    1

    1R +xD

    SinceR = 3 andxD= (0.97) we have

    yn+1=3

    3 1+xn +

    1

    3 1+(0.97) = 0.75xn+ 0.2425

    The q-line is determined next. Since feed is subcooled liquid we have

    q= V F

    V L

    H H

    H h

    = V L L F

    V L

    H h h H

    H h

    +

    = 1 +

    ( )pL boil F

    V L

    C T T

    H h

    In this equation

    HVhL= latent heat = 0.4C5+ 0.6C6= (0.4)(11,369) + (0.6)( 13,572)

    HVhL= 12,691 Btu/lbmol

    CpL= 0.4CpL,C5+ 0.6CpL,C6= (0.4)(39.7) + (0.6)(51.7) = 46.9 Btu/lbmolo

    F

    q= 1 +(46.9)(324.79 303.15)

    12,691

    = 1.08

    The q-line (4.4-21) derived in earlier section is

    y =1

    q

    q x

    1

    Fx

    q =

    1.08

    1.08 1x

    0.4

    1.08 1= 13.5x5

    At the intersection of the q-line and the enriching operating liney = yn+1or

    13.5x5 = 0.75x+ 0.2425x= 0.41118,y = 0.55088

    The stripping operating line is

    yN=L

    VxN-1

    B

    VxB

  • 8/14/2019 Distillation Matlab Code

    5/8

    4-37

    AtxN-1=xB,yN=L B

    V

    xB=

    V

    VxB=xB

    The stripping operating line can be plotted by connecting two points (x=xB,y = xB) and (x

    =xq= 0.41118, y = yq= 0.55088). Starting from the bottoms, point (x= xB= 0.02,y = xB),

    the following graphical procedure, illustrated in Figure E-2, will determine the number of

    equilibrium stages

    1) Draw a vertical line to meet the equilibrium curve. This determines the mole fractionof n-pentane in the vapor flow leaving the equilibrium stage.

    2) Draw a horizontal line to meet the (stripping) operating line. This determines themole fraction of n-pentane in the liquid flow entering the equilibrium stage.

    3) Repeat step 1-2 until the mole fraction of n-pentane in the vapor flow exceeds yq(thevapor mole fraction of n-pentane at the intersection of the q-line and the operating

    lines. The horizontal line now will meet the rectifying operating line .

    4) Repeat step1-2 with the stripping operating line replaced by the rectifying operatingline until the mole fraction of n-pentane in the liquid flow entering the equilibrium

    stage exceedsxB.

    The number of equilibrium stages is number of times the vertical line intersect the

    equilibrium curve. From Figure E-2, there are 10 equilibrium stages consisting of 1 partial

    reboiler and 9 equilibrium trays. This graphical method is known as the McCabe-Thiele

    method to determine the number of equilibrium stages.

    Figure E-2Graphical method to determine the number of equilibrium stages.

  • 8/14/2019 Distillation Matlab Code

    6/8

    4-38

    Table 4.4-6 lists the Matlab codes for the number of equilibrium stages. Starting from the

    bottoms, point (x= xB= 0.02,y = xB), a bubble point calculation withx= 0.02 is performed

    to determine the vapor mole fraction of n-pentane leaving the first equilibrium stage (the

    partial reboiler), then the stripping operating line is used to calculate liquid the mole fraction

    of pentane entering the equilibrium stage. A linear interpolation is used between two points

    (x=xB,y = xB) and (x =xq= 0.41118,y = yq= 0.55088).

    B

    B

    x x

    y x

    =

    q B

    q B

    x x

    y y

    Let c1=q B

    q B

    x x

    y y

    thenx=xB+ c1(y xB) and

    When the bubble point calculation using the liquid mole fraction from the stripping operating

    line produces the vapor mole fraction of n-pentane exceeding yq, the liquid mole fraction of

    pentane entering an equilibrium stage is determined from the rectifying operating line.

    yn+1=1

    R

    R +xn +

    1

    1R +xD

    Let slope =1

    R

    R + andyint=

    1

    1R +xDthenx=

    inty y

    slope

    The vapor mole fraction of n-pentane is then determined from the bubble point calculation.

    The process is repeated until the mole fraction of n-pentane in the liquid flow entering the

    equilibrium stage exceedsxB.

    The specification of optimum feed plate requires that the stripping operating line is used forthe materials balance as soon as the vapor mole fraction of n-pentane exceeding yq. We could

    choose to continue with the stripping operating line. However this action will require a

    higher number of equilibrium stages to reach the same separation since the distance from the

    equilibrium curve is closer to the stripping than to the rectifying operating line. A condition

    further away from equilibrium indicates a higher driving force for mass transfer and hence

    requires less equilibrium stages.

    -------Table 4.4-6 Matlab codes for number of equilibrium stages -------% Example 4.4-3

    %A=[13.9778 14.0568];B =[2554.6 2825.42];C=[-36.2529 -42.7089];P=101.325;pl=log(P);dT=.01;Tb=B./(A-pl)-C;xf=0.4;xq=0.41118;yq= 0.55088;xb=.02;c1=(xq-xb)/(yq-xb);xd=.97;R=3;yint=xd/(R+1);slop=R/(R+1);x=0:0.05:1;y=x;for i=1:21;

    xi=x(i);

  • 8/14/2019 Distillation Matlab Code

    7/8

    4-39

    % Assume a temperature for the bubble point calculationT=xi*Tb(1)+(1-xi)*Tb(2);% Solve for the bubble point temperature using Newton's method

    for n=1:20;f=xi*exp(A(1)-B(1)/(T+C(1)))+(1-xi)*exp(A(2)-B(2)/(T+C(2)))-P;T1=T+dT;f1=xi*exp(A(1)-B(1)/(T1+C(1)))+(1-xi)*exp(A(2)-B(2)/(T1+C(2)))-P;fp=(f1-f)/dT;eT=f/fp;T=T-eT;if abs(eT)

  • 8/14/2019 Distillation Matlab Code

    8/8

    4-40

    %line([xi xn],[yi yi])xi=xn;if xi>xd,break, end

    endfprintf('Number of equilibrium stages = %g\n',i)

    >> e2d4d3Number of equilibrium stages = 10

    -------------------------------------------------------------

    The number of equilibrium stages can also be determined from the program bdist4. Theequilibrium data for n-pentane and n-hexane system must first be generated. The Peng-

    Robinson equation of state is used by bdist4 for equilibrium calculation. This program alsocalculates the minimum reflux ratio and the minimum number of equilibrium stages which

    will be discussed in the next section.