**5.2 The reduced variable framework**

Reduced variables methods are based on the fact that the intrinsic dimensionality of the stability and phase split calculations, hence the number of equations to be solved, is related to the rank of the complementary BIP matrix **Γ**, defined by *γij* ¼ 1 � *kij*, rather than the number *n* of components used. Michelsen [41] derived the first reduced variables algorithm for cubic EoS models with zero BIPs (*kij* ¼ 0) by showing that the equations to be solved could be reduced to only 3. Simply speaking, although the phase composition, e.g. *yi* , is a vector with *n* components, it is incorporated in the mixing rules only through its scalar projections to the components' *ai* and *bi* constants vectors, thus forming only two variables, i.e. *amix* ¼ P ffiffiffiffi *ai* <sup>p</sup> *yi* � �<sup>2</sup> and *bmix* <sup>¼</sup> <sup>P</sup>*biyi* . By further considering the molar fraction *β*, the number of variables to be determined reduces to only 3.

In general, the *n* þ 1 original variables (i.e. the k-values and the molar fraction) are replaced by a set of *m* þ 2 reduced ones, with *m* ≪ *n*, thus significantly reducing the phase behavior problem dimensionality. Several authors extended Michelsen's idea to calculations with nonzero BIP [42–44] by applying Singular Value Decomposition to the BIP matrix so as to split it in a sum of rank-1 matrices. The less is the number of rank-1 matrices required to reconstruct accurately the original BIP matrix, the less is the number of reduced variables that need to be utilized, hence the less is *m*. Nichita and Graciaa [45] presented an alternative reduced variables set which allows for an easier Hessian matrix computation procedure and faster convergence while Gaganis and Varotsis [46] proposed a new procedure for generating improved reduced variables.

More specifically, let the complementary BIP matrix **<sup>Γ</sup>** <sup>¼</sup> <sup>1</sup> � *kij* � � be decomposed to a set of eigenvalues *λ<sup>i</sup>* and eigenvectors **t***<sup>i</sup>* by use of the Singular Value Decomposition method [28], so that **<sup>Γ</sup>** <sup>¼</sup> <sup>P</sup>*<sup>m</sup> <sup>i</sup>*¼**1***λi***t***i***t***<sup>T</sup> <sup>i</sup>* , where *m* denotes the rank of **<sup>Γ</sup>**. For the vapor phase, we define the projection vectors **<sup>q</sup>***<sup>i</sup>* <sup>¼</sup> **<sup>t</sup>***i*<sup>∘</sup> ffiffiffi *a* p and the reduced variables **<sup>h</sup>***<sup>V</sup>* <sup>¼</sup> **<sup>Q</sup>***<sup>T</sup>***y**, where **<sup>a</sup>** <sup>¼</sup> f g *ai* is the vector containing the components energy parameters, **Q** ¼ **q**<sup>1</sup> ⋯ **q***<sup>m</sup>* � � and operator ∘ denotes the Hadamard vector product (by element multiplication). The phase energy parameter *aV* and its derivative (required for the computation of phase fugacity) can be computed as functions of the reduced variables, that is *aV* <sup>¼</sup> **<sup>h</sup>***<sup>T</sup> <sup>V</sup>***Λh***<sup>V</sup>* and *<sup>∂</sup>aV=∂***<sup>y</sup>** <sup>¼</sup> **2QΛh***V*, where **Λ** ¼ *diag*f g *λ*<sup>1</sup> ⋯ *λ<sup>m</sup>* . By further considering the vapor phase volume parameter *bV* as an unknown variable all required quantities (i.e. compressibility factor *ZV* from Eq. (7) and fugacity coefficients from Eq. (10)) can now be completed as functions of **h***<sup>V</sup>* and *bV* .

The corresponding variables of the liquid phase can be easily computed by considering the vapor phase molar fraction *β* as an unknown variable and applying mass balance, i.e. **<sup>h</sup>***<sup>L</sup>* <sup>¼</sup> **<sup>Q</sup>***<sup>T</sup>***<sup>z</sup>** � *<sup>β</sup>***h***<sup>V</sup>* � �*=*ð Þ <sup>1</sup> � *<sup>β</sup>* and *bL* <sup>¼</sup> **<sup>b</sup>***<sup>T</sup>***<sup>z</sup>** � *<sup>β</sup>bV* � �*=*ð Þ <sup>1</sup> � *<sup>β</sup>* , thus allowing for the computation of the liquid phase properties as well.

To summarize, **h***V*, *bV* and *β* form an alternative set of variables in terms of which the phase split problem can be cast. The constraining equations that need to be satisfied are

$$\mathbf{h}\_V - \mathbf{Q}^T \mathbf{y} = \mathbf{0} \tag{66}$$

*A Collection of Papers on Chaos Theory and Its Applications*

$$\mathbf{b}\_V - \mathbf{b}^T \mathbf{y} = \mathbf{0} \tag{67}$$

$$\sum \frac{z\_i(k\_i - 1)}{1 + \beta(k\_i - 1)} = 0.\tag{68}$$

The solution algorithm is as follows


Eqs. (66) and (67) guarantee thermodynamic equilibrium whereas Eq. (68) ensures mass balance. Clearly, the equations are nonlinear and their solution still requires the utilization of iterative function solving methods. Nevertheless, the benefit of the reduced variables approach lies in the cardinality of the variables set which is usually smaller than that of the conventional approach as it equals to *m* þ 2. When the BIP matrix contains many small or even zero values, as it is commonly the case with the EoS modeling of multicomponent fluids, the rank of matrix **Γ** is much smaller than its size (*m* ≪ *n*) which implies that the number of equations that need to be solved is significantly reduced. Moreover, reduced variables *hi* corresponding to very low eigenvalues *λ<sup>i</sup>* can also be neglected at the cost of the truncation error of matrix **Γ**. For the extreme case where all BIPs are equal to zero, *m* ¼ 1, Eq. (66) simplifies to a scalar one and only three nonlinear equations need to be solved regardless of the number of the mixture components [41]. Nevertheless, there has been some questioning about the real benefit of reduction methods as modern computers architecture has significantly reduced their computing time gain against the conventional ones [47, 48].

#### **5.3 Soft computing methods**

Soft computing methods aim at solving phase equilibrium problems by utilizing data points rather than solving the thermodynamically rigorous equations discussed in the previous sections. Simply speaking, data related to the stability and phase split problems are generated and subsequently used to build correlations which

## *Perturbation Theory and Phase Behavior Calculations Using Equation of State Models DOI: http://dx.doi.org/10.5772/intechopen.93736*

provide directly the variables of interest such as the TPD value and the prevailing kvalues for the stability and phase split problems respectively. Such flow-specific and fluid-specific soft computing models are case dependent as they are generated using data obtained either prior to the specific simulation of interest or during that.

The benefit lies in that the generated correlations consist of simple, noniterative calculations which are by orders of magnitude faster than the conventional iterative ones. Although the numerical treatment of the datapoints involves purely numerical techniques such as regression, classification and clustering [49], thermodynamics are still incorporated indirectly in the soft computing based models as the data points used to build the models have been generated in advance by conventional rigorous methods.

Composition independent correlations to estimate the equilibrium coefficients (k-values), such as those of Standing and Whitson as well as the convergence pressure method, all discussed in 3.2.1, can be thought of as the simplest soft computing method to treat the phase split problem as they provide k-values estimates without being based on a rigorous EoS model, hence avoiding the iterative solution of the fugacity equations or the minimization of the Gibbs energy.

Voskov and Tchelepi [50] proposed the generation and storage of the encountered tie-lines in Tables "on the fly". Initially, for each feed composition encountered during the simulation, the phase split problem is solved conventionally and the equilibrium compositions (i.e. the tie line endpoints) are stored. For each subsequent feed the algorithm searches quickly the Tables to identify the closest stored tie-lines and interpolate them linearly to get the equilibrium compositions. If no close enough tie lines can be found, the phase split problem is solved conventionally, and the table is enriched. Stability is determined by using the negative flash approach [30]. To reduce the computing time cost for accessing and further building-up the tie line Table, Belkadi et al. [51] proposed the Tie-line Distance Based Approximation which further accelerates the search procedure.

Gaganis and Varotsis [52, 53] presented the methodology to develop proxy models for treating both the phase stability and phase split problems using machine learning tools. Their approach aims at solving conventionally the phase behavior problem for a set of sampled operating points and using the obtained data to generate explicit proxy models using multivariate regression models such as neural networks to directly predict the prevailing equilibrium coefficients values given feed composition, pressure and temperature (for nonisothermal runs). For the

**Figure 4.** *The SVM output equals to zero at the phase boundary.*

phase stability problem, their model outputs a positive nonlinear transformation of the conventional TPD value that exhibits the same sign as the former (**Figure 4**). Their model utilizes Support Vector Machines, SVM [54] to provide the same binary stable/unstable answers anywhere in the operating space even outside the stability test limit locus [31]. An improved stability test method has been presented by Gaganis [55] which reliefs the need to model accurately the phase boundary thus allowing for even simpler and faster to evaluate stability models. His approach develops two classifiers which only identify whether the point under question lies "far enough" from the phase boundary or not. If it lies far enough outside of the phase envelope, then the fluid is surely single phase whereas it is certainly at twophase when lying well inside the phase envelope. If a certain answer cannot be obtained, a regular stability algorithm is invoked.
