cae.22411
cae.22411
DOI: 10.1002/cae.22411
RESEARCH ARTICLE
1
Chemical Engineering Department,
National Institute of Applied Sciences & Abstract
Technology, University of Carthage, The present paper describes a numerical technique to compute phase
Tunis, Tunisia
2
equilibria of ternary liquid systems. First, particle swarm optimization is
Energy Engineering Department, Ecole
Nationale d'Ingénieurs de Monastir— used to estimate the binary interaction parameters of the NRTL (Non‐
ENIM, University of Monastir, Monastir, Random Two Liquid) and UNIQUAC (Universal Quasi‐Chemical) models.
Tunisia
We show how the arc‐length continuation method allows the calculation
Correspondence of the liquid–liquid equilibrium diagram for any ternary system. A
Housam Binous, Chemical Engineering total of seven case studies of industrially important mixtures are
Department, National Institute of Applied
described. Both Type I systems (oleic acid–water–ethanol, water–1‐
Sciences & Technology, University of
Carthage, BP 676 ‐ 1080 Tunis, Tunisia. propanol–toluene, DEC–ethanol–water, water–propionic acid–n‐hexane,
Email: [email protected] and water–TMA–benzene) and Type II mixtures (water–1‐butanol–n‐
hexane) are discussed. In addition, a system with temperature‐dependent
behavior (n‐hexane–methyl cyclopentane–aniline) is studied. The nu-
merical techniques and the thermodynamic problem involved in this pa-
per are suitable for a first‐year graduate‐level course in chemical
engineering. All computer coding is based either on MATHEMATICA © or
MATLAB ®.
This is an ideal opportunity to introduce graduate students to
advanced commands and programming syntax of state‐of‐the‐art mathe-
matical software.
KEYWORDS
arc‐length continuation, graduate chemical engineering thermodynamics, liquid–liquid
equilibrium data, MATHEMATICA© and MATLAB®, NRTL and UNIQUAC models
models, such as Non‐Random Two Liquid (NRTL) or relevant mixtures that have been successfully bench-
Universal Quasi‐Chemical (UNIQUAC), which will be marked against corresponding experimental data. The
discussed below. Prediction of new LLE data for tern- benefits that mathematical software and numerical
ary mixtures requires solving a set of iso‐activity techniques bring to chemical engineering education is
equations under mass/mole balance constraints. made clear throughout the paper and build on an edu-
However, and whenever possible, the results obtained cational theme that has been advocated in the past by
by the application of such models are to be validated by many authors [6,11,12,14,14,15,18,18,26,29,32,40]. The
comparison with experimental data. version of MATHEMATICA© and MATLAB®, adopted in the
For ternary mixtures, isobaric‐isothermal LLE are present study, is v.12 and R2017b, respectively. Note that
represented graphically on a triangular diagram, where the various Mathematica notebooks and m‐files used in
the apexes represent the pure components, the sides of this study are compatible with prior versions of these two
the corresponding binary mixtures, the area inside the technical computing environments.
triangle, and the composition range of the ternary
mixture.
Bimodal curves are classified into three types based 2 | THERMODYNAMIC MODELS
on the number of miscible pairs. Mixtures, which exhibit
closed miscibility gaps, are termed Type 0 systems. These Thermodynamic equilibrium at fixed temperature T and
mixtures form an immiscible island. In such cases, a pressure P of a heterogeneous two‐phase liquid mixture
heterogeneous region of two immiscible or partially involving three chemical species (a solvent, a diluent,
miscible liquids is enclosed by a homogeneous liquid and a solute) imply the iso‐activity condition ai = x i γi for
region. The island type or Type 0 systems have two plait any component i present in both phases (′, ″),
points, which limit the tie lines on both sides of the is-
x i′ γi′ = x i″ γi″ for i = 1…3, (1)
land [35,39,42]. At a plait point, the composition of the
two phases become identical and hence further separa- where x i is the mole fraction of component i and γi , is its
tion is impossible. Mixtures labeled as Type I are systems activity coefficient.
where the solvent and diluent show partial miscibility The choice of a thermodynamic model or fluid
while the solvent and the component to be extracted are package requires some experience. Hence, most stu-
completely miscible. Type I systems exhibit a unique dents face some difficulty in the selection of the
plait point. Finally, in Type II systems, the solvent is proper model that is adequate for the chemical system
partially miscible with the two other components. Such under investigation. If mixtures deviate strongly from
systems exhibit no plait points. ideal behavior, they exhibit liquid‐phase splitting. If
In previous studies, the complex homotopy con- such is the case, to evaluate γi and perform LLE cal-
tinuation method was the method of choice for analyzing culations, two thermodynamic models are commonly
LLE [21,41]. The simpler arc‐length continuation tech- applied: NRTL and UNIQUAC models. The Margules
nique has been applied rarely to LLE data computa- model, which was derived before the NRTL and
tions [9]. UNIQUAC models, can also predict LLE and
The objective of the present paper is to introduce the vapor–liquid‐liquid equilibrium (VLLE) data, but it is
arc‐length continuation technique for LLE calculations seldom used nowadays. Finally, the Wilson model is
to engineering students. We will demonstrate the ap- only applicable to homogeneous systems and fails to
proach with several examples in which the bimodal detect liquid‐phase splitting.
curves and as many tie lines as needed can be predicted. According to the NRTL approach [2,4,17,22,28,30,31,
The paper is organized into the following five sec- 33,33,35], the activity coefficient γi of component i is
tions. First, a short description of the thermodynamic expressed as
models that will be used is given (i.e., the NRTL and 3
UNIQUAC models). The subsequent section lists the ∑ τji Gji xj ⎡
governing equations. Then, we introduce the reader to 3 x j Gij
the arc‐length continuation method and the particle
ln γi =
j =1
3
+ ∑ j =1 ⎢⎢ 3
⎣ ∑k =1 Gkj xk
swarm optimization (PSO) numerical techniques. In our ∑ Gki xk
k =1
discussion of the arc‐length continuation technique, we
⎛ ⎤
∑ τ G x ⎞
N3
draw on previous work in which the method has been
⎜τij − k =1 kj kj k ⎟ ⎥ , (2)
⎜ ⎟
used to solve various chemical engineering problems ∑k =1 Gkj xk ⎠ ⎥⎦
N3
⎝
[9,10,13,13,20,23,27]. The last section of this paper con-
tains the generated LLE data for seven industrially where Gij = e (‐aij τij).
BINOUS ET AL. | 3
∆ gij 3 3
τij = T is correlated to the interaction parameter
∆gij between different components i and j . For i = j , ∑xi′ = 1; ∑xi″ = 1. (8)
i =1 i =1
∆gii = 0 and hence, τii = 0 and Gii = 1. αij is the non-
randomness parameter (αij = αji ). Note that five equations from this six‐equation set
The activity coefficient γi in the UNIQUAC model are, however, independent as the summation of the
[2,4,17,23,28,30,31,33,33,35] is given by the equation Equation (7) over the index i , and using the summation
identities in Equation (8) results in Equation (6). To solve
γi = γiC γiR, (3)
for the eight unknowns of the problem (six‐mole frac-
where is the combinatorial contribution to γi and γiR .
γiC tions x i′ and x i″ as well as the molar quantities n′ and n″)
The residual contribution γiC depends on some geome- three more equations are needed. These are precisely the
trical properties of the component as expressed by the equilibrium condition given by Equation (1).
relative van der Waals surface area qi and volume ri . In a For computational purposes, it is convenient to sim-
mixture, the individual relative van der Waals char- plify the equations set. First, we set n = 1 and n″ = σ and
acteristics become hence, n′ = 1 − σ . We also introduce the quantity Ki ,
ri qi which is the ratio of the activity coefficients of compo-
Vi = 3
; Fi = 3
. nent i in the two phases:
∑rj xj ∑ qj xj γi′
j =1 j =1 Ki = i = 1…3. (9)
The above expression results for the combinatorial γi′′
contribution The mole fraction constraints given by Equation (8)
are further used to eliminate x 3′ and x 3″. We obtain finally
⎛ V V⎞
ln γiC = 1 − Vi + ln Vi − 5qi ⎜1 − i + ln i ⎟ . (4) an algebraic equations system in three unknowns ( x1′, x 2′ ,
⎝ Fi Fi ⎠ and σ ):
The energetic interactions between the components
ξ1
of a mixture are taken into account by the residual part x1′ = ,
γiR of the activity coefficient (
1 + K1 − 1 σ )
⎛ 3 ⎞ ξ2
⎜ ∑ τji qj xj ⎟ x 2′ = ,
R
⎜
ln γi = qi ⎜1 − ln
j =1
−∑
3 τij qj x j ⎟
⎟ , (5)
(
1 + K2 − 1 σ )
3 j =1 3
⎜ ⎟
⎜ ∑ qj xj ∑ τkj qk xk ⎟ x 3′ = 1 − x1′ − x2′ =
ξ3
⎝ ⎠
j =1 k =1
method avoids the problem of finding good start values value of ξ2 (overall mole fraction of component 2). Two
for each new iteration. solution routes can alternatively be used; the MATHEMA-
TICA© commands Findroot or FindMinimum. This
solution will be our initial condition in the upcoming
4 | NUMERICAL P ROCEDURES part. In Part III, finally, ξ2 is set as a function of the arc‐
length parameter, s . The auxiliary equation (Equation 15)
4.1 | Arc‐length continuation method is added to the system defined in Part II. Hence, we get a
system of differential algebraic equations, which is
Let us consider the following parametric system of N readily solved using NDSolve.
nonlinear equations, written in vector representation
[9,18,41].
F (m; φ) = 0. (11)
4.2 | PSO
φ is a parameter on which the solution depends. The In optimization, one attempts to find a global or local
components of vectors F and m are, respectively, minimum of a function on a given set. If such function is
F = (f1 , f2 , …, fN ) and m = (m1, m2, …, mN ). The objective not convex, then the classical deterministic algorithms
is now to obtain a solution of such a system as a continuous (e.g., the fixed step steepest descent algorithm, the opti-
function of φ. In the arc‐length continuation method, un- mal step steepest descent algorithm, the conjugate gra-
known variables and parameter φ are set as a function of dient method…) may be stuck in a local minimum and
the arc‐length, represented by s in the following. fail to find the global minimum. Hence, to find the global
Let us suppose for a particular value φ0 of the para- minimum, heuristic strategies that scan the search space
meter φ, the equations set (11) has a solution m 0 , more or less successfully have been developed. Among
these strategies, we find:
F (m 0; φ0 ) = 0 (12)
and that the solution m is an analytic function of φ (i.e., 1. Ant colony optimization
continuous and differentiable). In this case, a neighbor- 2. Simulated annealing
ing solution m = m (φ) can be calculated by constructing 3. Tabu search
a Taylor expansion about φ0 . For a multivalued function 4. Genetic algorithms
of φ, the solution can be parameterized in term of arc‐ 5. Swarm‐based optimization algorithms (e.g., PSO)
length s on the solution curve. Therefore, we can write: 6. Memetic algorithms
m = m (s ), φ = φ (s ). (13)
We owe PSO to the pioneering work in 1995 of
So that Equation (11) become Kennedy and Eberhart [1,19]. PSO algorithms imitate the
social behavior patterns of organisms that live and in-
F (m (s ), φ (s )) = 0. (14)
teract within large groups, such as flocks of birds,
To solve Equation (14), one more relation is needed. swarms of bees, ant colonies, schools of fish, and so forth.
The appropriate auxiliary equation is given by the defi- The method randomly creates a large number of poten-
nition of the arc‐length: tial solutions or particles. These particles evolve through
the search domain using their coordinates and velocities.
dm dm ⎛ dφ ⎞2
. + ⎜ ⎟ = 1. (15) A swarm is an ensemble of such particles. The individual
ds ds ⎝ ds ⎠
and the social behaviors, embedded in the optimization
The system to solve Equations (14) and (15) is now a algorithm, fix the convergence to the global optimum.
differential‐algebraic equations (DAE) set in (N + 1) The algorithm can be implemented using classical
unknowns. In this article, we solve it using the built‐in mathematical software such as MATLAB® or MATHEMATICA©.
MATHEMATICA© function NDSolve.
The computational procedure for the proposed
method is schematically described in the Appendix. The 5 | CASE STUDIES
process can be divided into three main parts. Part I in-
volves fixing some calculation parameters, such as the 5.1 | Oleic acid–water–ethanol
temperature, the binary interaction parameters for the
NRTL or UNIQUAC model, as well as ξ1 (mole fraction of Esters from long‐chain fatty acids and alkyl alcohols are
component 1 in the heterogeneous mixture). Part II is proposed as constituents of biodiesel. In the production
dedicated to the solution of Equation (14) for a fixed process of these compounds, the esterification reaction
BINOUS ET AL. | 5
5.2 | Water–1‐propanol–toluene
F I G . 2 Partition curve of ethanol (EtOH) between organic and
aqueous phases at 40°C and 1 atm. Dots: experimental data [36]; The binodal curve of this ternary system is Type I. For
blue line: calculated partition curve
this ternary mixture, a large experimental data bank is
available [37], but interaction parameters for the stan-
generates water as a by‐product, which then forms a dard thermodynamic models are missing. Here, we ap-
distinct second phase. If the reactant alcohol is more plied PSO to compute these parameters for both the
soluble in the aqueous phase than in the organic phase, NRTL (∆gij ) and UNIQUAC (Δuij ) models. To reduce the
the esterification reaction rate can decline due to de- dimensions of the optimization search domain for the
creased alcohol concentration in the reacting organic NRTL model, we have set all three nonrandomness
TABLE 1 Case study 1: Comparison between the arc‐length continuation method and the direct calculation using fsolve and
FindRoot
T A B L E 2 Case study 2: Binary interaction parameters for the T A B L E 4 Case study 2: Relative van der Waals surface area qi
NRTL model (∆gij ) with 1‐propanol (1), toluene (2), and water (3) and volume ri with 1‐propanol (1), toluene (2), and water (3)
i/j 1 2 3 i qi ri
1 0 260.43 1157.4 1 2.512 2.779
2 90.84 0 1215 2 2.967 3.922
3 −302.23 845.05 0 3 1.399 0.920
Abbreviation: NRTL, Non‐Random Two Liquid.
F I G . 3 Binodal curve of the system water‒1‐propanol‒toluene F I G . 5 Binodal curve of the system water‒ethanol‒DEC at 23°C
at 25°C and a pressure of 1 atm. Dots and dashed lines: and a pressure of 1 atm. Dots and dashed lines: experimental tie
experimental tie lines data [37]; blue curve: calculated miscibility lines data [38]; blue curve: calculated miscibility limit line
limit line
i qi ri
1 3.052 3.454
2 3.855 4.4499
3 1.399 0.920
5.7 | n‐Hexane–methyl
cyclopentane–aniline
i qi ri
1 2.636 2.988
2 1.399 0.920
3 2.400 3.187
F I G . 11 Binodal curves and tie lines of the system n‐hexane‒methyl cyclopentane‒aniline at 25°C, 24.5°C, and 45°C, respectively. Blue
dots and dashed lines: experimental tie lines data [40]; red curves and segments: calculated miscibility curves and tie lines
These techniques were shown to be successful in solving a The computed results were successfully bench-
classical graduate‐level problem in chemical engineering marked against experimental data. Mastering this new
thermodynamics, namely liquid‐phase equilibria of ternary approach requires minimal effort from students and
mixtures. In this study, we successfully benchmark our provides an easy way to generate an extensive library of
LLE predictions with experimental data from many in- LLE data for various industrially relevant mixtures.
dustrially relevant ternary systems. The generic computa- It is worth mentioning that state‐of‐the‐art research on
tional problem discussed in this paper can readily be LLE calculations is now focusing on ternary and quaternary
assigned to graduate student in either their numerical systems involving new extraction solvents (e.g., ionic li-
methods or applied thermodynamics courses during their quids [43–45] and natural deep eutectic solvents [7,36]).
first year of study in the Master of Science program. The Moreover, we firmly believe it is possible to successfully
authors firmly believe students can expand their knowledge apply our computational methodology to ternary systems
of mathematical software (e.g., MATHEMATICA© and MATLAB®) involving ionic liquids by proper choice of the thermo-
by being exposed to the type of chemical engineering pro- dynamic model (e.g., electrolyte‐NRTL or MSA‐NRTL). We
blems discussed in this paper. plan to present such treatment in a subsequent paper.
It is the authors' belief that this new approach can
contribute to enhanced usage of advanced mathematical
7 | CONCLUSION techniques in graduate‐level chemical engineering edu-
cation, such as thermodynamics and numerical methods
In this paper, we have shown that LLE computations courses.
can be readily implemented in the chemical en- In closing, we should note that the various MATHE-
gineering curriculum. The preferred method proposed MATICA© codes, written for the considered seven case
in this paper is based on the application of the arc‐ studies in this paper, are available upon request from the
length continuation technique, which can be im- corresponding author.
plemented in software, such as MATHEMATICA © or
MATLAB ®. We illustrated the approach with LLE data AC KNOW LEDGM ENTS
for the following ternary mixtures: The Tunisian Ministry of Higher Education is duly ac-
knowledged for allowing Dr. Housam Binous to take a
1. Type I systems: sabbatical leave in the academic year 2020–2021 to
a. oleic acid–water–ethanol complete this paper.
b. water–1‐propanol–toluene
c. DEC–ethanol–water C O NF L I C T O F I N T E R E S T S
d. water–propionic acid–n‐hexane The authors declare that there are no conflict of interests.
e. water–TMA–benzene
2. Type II systems: water–1‐butanol–n‐hexane DATA AVAILABILITY STATEMENT
3. Systems with temperature‐dependent behavior: The computer notebooks and coding are available upon
n‐hexane–methyl cyclopentane–aniline request from the corresponding author.
BINOUS ET AL. | 11
APPENDIX ξ2
x 2′ =
1 + (K 2 − 1)σ
ξ3 1 − ξ1 − ξ
2
Part 1 x 3′ = 1 − x1′ − x2′ = =
1 + (K 3 − 1)σ 1 + (K 3 − 1)σ
(Continues)