Page 215 - Separation process engineering
P. 215

Range("A8", "G108").Clear
                         Dim i, feedstage As Integer
                         Dim D, B, xd, xb, F, z, q, LoverD, LoverV, x, y, xint, yint, yeq
                         As Single
                         Dim a6, a5, a4, a3, a2, a1, a0, L, V, LbaroverVbar As Single
                         '   Input values from spread sheet
                             xd = Cells(1, 2).Value
                             xb = Cells(1, 4).Value
                             F = Cells(1, 6).Value

                             z = Cells(1, 8).Value
                             LoverD = Cells(2, 2).Value
                             q = Cells(2, 4).Value
                             feedstage = Cells(2, 8).Value
                         '   Fit VLE data to 6th order polynomial to find y.  a6 is
                         coefficient of x to the 6th.
                             a6 = Cells(5, 1).Value
                             a5 = Cells(5, 2).Value
                             a4 = Cells(5, 3).Value
                             a3 = Cells(5, 4).Value
                             a2 = Cells(5, 5).Value
                             a1 = Cells(5, 6).Value
                             a0 = Cells(5, 7).Value

                         '   Calculate flow rates and ratios.
                             D = ((z - xb) / (xd - xb)) * F
                             L = LoverD * D
                             V = L + D
                             LoverV = LoverD / (1 + LoverD)
                             LbaroverVbar = (LoverV + (q * F / V)) / (1 - ((1 - q) * F /
                         V))
                         '   Calculate intersection point of operating lines. If yeq < yint
                         reflux ratio too low.
                             xint = ((-(q - 1) * (1 - LoverV) * xd) - z) / (((q - 1) *
                         LoverV) - q)
                             x = xint
                             yint = LoverV * xint + (1 - LoverV) * xd
                         '   Equilibrium y at value of x intersection. When yint=yeq, have
                         minimum L/D.
                             yeq = a6 * x ^ 6 + a5 * x ^ 5 + a4 * x ^ 4 + a3 * x ^ 3 + a2 *

                         x ^ 2 + a1 * x + a0
                         'Record intersection and equilibrium values on spreadsheet.
                             Cells(6, 2).Value = yeq
                             Cells(6, 4).Value = yint
                             Cells(6, 6).Value = xint
                         '   Step off stages from bottom up.  Stage 1 is partial
                         reboiler.  Initialize
                             x = xb
                             i = 1
   210   211   212   213   214   215   216   217   218   219   220