Inside–Out Method for Simulating a Reactive Distillation Process
3. Algorithm 1. Inside–Out Method
The Inside–Out method divides the mathematical model into an inside and outer loop for iterative calculation, and uses two sets of thermodynamic models, a strict thermodynamic model and an approximate thermodynamic model (Kvalue model and enthalpy value model). The simple approximate thermodynamic model was used for frequent inside loop calculations to reduce the time it takes to calculate the thermodynamic properties. The strict thermodynamic model was used for the outer loop calculations, and the parameters of the approximate thermodynamic model were corrected at the outer loop.
Defining the inside loop variables—relative volatilityαi,j, stripping factorsSb,jof the reference components, liquid phase stripping factorsRL,j, and the vapor phase stripping factorsRV,j.
αi,j=Ki,j/Kb,j Sb,j=Kb,jVj/Lj, (6)
RL,j=1+Uj/Lj RV,j=1+Wj/Vj. (7) The inside loop uses the vapor and liquid phase flow rates of each component instead of the composition, for the calculations. Their relationship with the vapor and liquid phase composition and flow is as follows:
yi,j=vi,j/Vj xi,j=li,j/Lj, (8) Vj=
c i=1
vi,j Lj= c i=1
li,j (9)
According to the inside loop variables defined by the mathematical model of the Inside–Out method, the material balance Equation (M) and the phase equilibrium Equation (E) can be rewritten into the following relationship.
Material Balance:
li,j−1−(RL,j+αi,jSb,jRV,j)li,j+
αi,j+1Sb,j+1
li,j+1=−fi,j+
r
υr,iRr,j. (10) Phase balance:
vi,j=αi,jSb,jli,j. (11) 3.1.1. Strict Thermodynamic Model
The strict model is mainly used for the outer loop to correct the parameters in the approximate thermodynamic model, including the calculation of the phase equilibrium constantKvalue, and the vapor-liquid enthalpy difference, as follows:
Ki,j=Ki,j
Tj,Pj,xi,j,yi,j
(12) Hj=Hj
Tj,Pj,yi,j
(13) hj=hj
Tj,Pj,xi,j
(14)
3.1.2. Approximate Thermodynamic Model 1 K-value model
Define a new variable for the Kvalue of the reference component, Kb,j, and the reference component b is an imaginary component.Kb,jwas calculated by the following formula, whereωi,jis a weighting factor.
Kb,j=exp(
i
ωi,jlnKi,j), (15)
ωi,j= yi,j
∂lnKi,j/∂(1/T) yi,j
∂lnKi,j/∂(1/T). (16)
The relationship betweenKb,jand the stage temperatureTjis related using Equation (17),T*is the reference temperature.
lnKb,j=Aj+Bj 1
T− 1 T∗
. (17)
The value of the parameterBjcan be obtained by the differential calculation of1/Tby theKb, and the temperaturesTj−1andTj+1of the two adjacent stages are selected asT1andT2.
Bj= ∂lnKb
∂(1/T)=ln
Kb,T1/Kb,T2
(1/T1−1/T2), (18)
Aj=lnKb,j−Bj 1
T− 1 T∗
. (19)
2 Enthalpy model
The calculation of the enthalpy difference is the main time-consuming part of the entire enthalpy calculation, so the calculation of the enthalpy difference was simplified in the approximate enthalpy model, and a simple linear function was used to fit the calculation of the enthalpy difference.
ΔHj=cj−dj
Tj−T∗
, (20)
Δhj=ej−fj Tj−T∗
. (21)
3.1.3. ImprovedK-Value Model
TheK-value model was improved by simplifying the calculation of the weighting factor. This was derived from the molar fraction summation equation. The derivation process is shown below.
The relationship between theKvalue of the reference componentKb,jand theKvalue of the common component is:
lnKb,j=
i
ωi,jlnKi,j. (22)
The weighting factors need to satisfy:
ωi,j=1. (23)
The stage temperature needs to satisfy the following relationship:
Φ Tj
=
xi,j−1=yi,j
Ki,j−1=0. (24)
The introduction of new variablesui,jwas defined as:
ui,j=ln Ki,j/Kb,j
. (25)
The new relationship is:
Φ Tj
= yi,j
Kb,jeui,j−1. (26)
SinceKb,jwas calculated byKi,jthrough a weighting function, the trend with temperature changes was the same, souj,iis a temperature-independent parameter, so at the stage temperature:
Kb,j Tj
euj,i=Kj,i Tj
, (27)
Φ Tj
=Φ Tj
. (28)
The derivative ofΦ Tj
andΦ Tj
at the stage temperature was equal to:
dΦ dT
Tj =dΦ dT
Tj , (29) yj,i
Kj,i ∂lnKj,i
∂T
Tj =yj,i Kj,i
dlnKb,j
dT
Tj , (30) yj,i
Kj,i ∂lnKj,i
∂T
Tj =yj,i Kj,i
ωj,i
∂lnKj,i
∂T
Tj . (31) The weighting function used the new calculation method:
ωi,j= yi,j/Ki,j
yi,j/Ki,j. (32)
3.2. Initial Value Estimation Method
The system of equations obtained from the modeling of the steady-state reactive distillation process was non-linear and was very difficult to solve. Therefore, it was important to provide good initial estimates, otherwise it would not be possible to reach a solution.
Before providing good initial estimates, all feed streams were mixed to perform chemical reaction equilibrium calculations to obtain a new set of compositions and flow rate, which were used to calculate the initial value of the variable.
Temperature: Calculate the dew and bubble point temperature by flash calculation, which was used as the initial temperature at the top and at the bottom of the tower. The initial temperature of the middle stages was obtained by linear interpolation.
Composition: The composition calculated by isothermal flash calculation was used as the initial value of the vapor-liquid composition of each stage.
Flow: According to the constant molar flow rate assumption and the total material balance calculation, the initial value of the vapor–liquid flow rate of each stage was obtained
Reaction extent: The reaction extent calculated by the chemical reaction equilibrium was taken as the maximum value of the reaction extent in the reaction section. According to the feeding condition of the reaction section, the position with the maximum reaction extent was selected. If there was only one feed in the reaction section, the position of the feed stage was selected. If there were multiple feeds in the reaction section, the position of the feed stage near the reboiler was chosen. If there was no feed in the reaction section, the position of the reaction stage closest to the feed was selected. The initial value of the reaction extent of the other stages were calculated according to the maximum value and a certain proportion of attenuation. The calculation is shown below.
Between the first reaction stage and the stage with the maximum reaction extent:
Rj,r=Rmax× j−j1+1
(jm−j1+1)2. (33)
Between the stage with the maximum reaction extent and the last reaction stage:
Rj,r=Rmax× jn−j+1
(jn−jm+1)2. (34)
whereRmaxis the maximum value of the reaction extent in the reaction section,jmis the stage position where the maximum reaction extent occurs;j1is the first stage position in the reaction section; andjnis the last stage position in the reaction section.
3.3. Calculation Steps and Block Diagram
The reactive distillation column adopts an improved Inside–Out method for calculation. The main working idea is that the the outer loop used a strict thermodynamic model to calculate the phase equilibrium constant and the vapor–liquid phase enthalpy difference, and the results were used to correct the approximate thermodynamic model parameters and update the reaction extents of each stage. The inside loop uses an approximate thermodynamic model to solve the MESHR equation to obtain the stage temperature, flow rate, and composition. After the inside loop calculation converges or reaches the number of iterations, the model returns to the outer loop to continue the calculation.
When the inside and outer loop converges at the same time, the calculation ends.
The calculation steps are shown below:
1. Given initial value
(1) According to the feed, pressure, and operation specifications, the initial values of the temperature, flow rate, composition, and the reaction extent are provided (Section3.2).
2. Outer loop iteration
(2) Calculate the phase equilibrium constantKi,jwith a strict thermodynamic model, and then calculate parametersKb,j, A, and B in theK-value model.
(3) Calculate the vapor–liquid phase enthalpy difference using a strict thermodynamic model, and fit the parameterscj,dj,ej, andfjin the approximate enthalpy model.
(4) Calculate the stripping factorsSb,j, relative volatilityαi,j, liquid phase stripping factorsRL,j, and vapor phase stripping factorsRV,j.
(5) Calculate the reaction extent according to the reaction conditions. The chemical reaction can be a specified conversion rate or a kinetic reaction, and the kinetic reaction rate is calculated by a power law expression.
Power law expression:
T0is not specified:
r=kTne−E/RT
(Ci)αi. (35)
T0is specified:
r=k(T/T0)ne−(E/R)(1/T−1/T0)
(Ci)αi, (36)
Rj,r=rj,r×Ωj. (37)
(6) Outer convergence judgment conditions:
n j
⎛⎜⎜⎜⎜
⎜⎜⎝Knb,j−Kb,jn−1 Knb,j−1
⎞⎟⎟⎟⎟
⎟⎟⎠
2
+ n
j
c i
⎛⎜⎜⎜⎜
⎜⎜⎝αni,j−αn−1i,j αni,j−1
⎞⎟⎟⎟⎟
⎟⎟⎠
2
+ n
j
r
⎛⎜⎜⎜⎜
⎜⎜⎝Rnr,j−Rn−1r,j Rnr,j−1
⎞⎟⎟⎟⎟
⎟⎟⎠
2
< ε. (38)
3. Inside loop iteration
(7) According to the material balance Equation (13), a tridiagonal matrix was constructed, and then the liquid flow rateli,jof each component was obtained by solving the matrix. Using the phase equilibrium Equation (14), the vapor phase flow ratevi,jof each component was obtained.
(8) The vapor–liquid flow ratesVjandLjcan be calculated by Equation (9), the vapor–liquid phase compositionxi,jandyi,jcan be calculated by Equation (8).
(9) Combining the bubble point equation c
i=1Kixi=1
with Equation (9) to obtain Equation (39), a new set ofKvaluesKb,jof the reference components can be calculated.
Kb,j= 1 c i=1
αi,jxi,j. (39)
According to Equation (40), a new set of stage temperature can be calculated using the new Kb,jvalues.
Tj= 1
lnKb,j−Aj
/Bj+1/T∗. (40)
Now, the correction values of the vapor–liquid flow rate, composition, and temperature are obtained. They satisfy the material balance and phase equilibrium equation, but does not satisfy the enthalpy equilibrium equation. In the following, the iterative variable of the inside loop should be modified according to the deviation of the enthalpy balance Equation (10). Select lnSb,jas the inside loop iteration variable. If there are side products, the side stripping factors lnRL,jand lnRV,jshould be added as the inside loop iteration variables. Taking the enthalpy balance equation as the objective function, the enthalpy balance equation of the first and last stage should be deleted and replaced with two operation equations of the reactive distillation column.
(11) Calculate the vapor–liquid phase enthalpy according to the simplified enthalpy model.
(12) Calculate the partial derivative of the objective function to the iterative variable and construct the Jacobian matrix. The Schubert method was used to calculate the modified value of the inside iteration variable [22,23]. Damping factors can be used if necessary.
(13) Using the new inside iteration variable value, repeat steps (7) to (9) to obtain the new stage flow, composition, and temperature, and calculate the error of the objective function. If the error was less than the convergence accuracy of the inside loop, return to the outer loop to continue the calculation, otherwise repeat the calculation from Step (11) to Step (13). The calculation block diagram of the improved Inside–Out method is shown in Figure4.
n
j j
H ε
= <
¦
Figure 4.Calculation of the block diagram of the improved Inside–Out method.