1. Introduction
When conducting flow simulations in petroleum engineering, fluid properties play a vital role in all types of calculations, including the estimation of recoverable reserves, the analysis of fluid flow within reservoirs and wellbores, the design of surface pipeline systems, and the selection of processing equipment. Phase behavior, pressure–volume–temperature (PVT) values, rheology, and thermal properties are all incorporated into the governing differential equations that impose the principles of mass, momentum, and energy conservation. Consequently, these factors have a direct impact on production forecasts and optimization processes. Among these factors, PVT values hold particular importance as they describe the changes in volume and physical properties that occur during fluid depletion and flash processes [
1], which take place during production through wellbores and surface separation systems.
The sampling process for petroleum fluids is fundamental in the development of reservoirs as subsequent standard and routine PVT analyses deliver valuable data regarding the phase and volumetric behavior of reservoir fluids [
2]. Due to the economically unattractive cost of the laboratory experiments included in main PVT analyses [
3,
4], these are performed on specific condition paths imposed by the reservoir itself [
4]. On account of limited experimental data, a computational model is required to predict a fluid’s behavior under a wide range of conditions expected to be encountered during the exploitation of a field.
Simplistic models based on the black oil principle satisfactorily describe hydrocarbon fluids when the oil and gas phases maintain a fixed overall composition throughout production [
5]. However, in cases where the displacement process depends on both pressure and fluid composition, black oil models are unable to capture the thermodynamic effects taking place. Many field development projects exhibit strong composition dependence, among them, volatile oil or gas condensate reservoir depletion, miscible gas injection for oil reservoirs, and liquid recovery under lean gas injection for gas condensate reservoirs [
6]. In these cases, all hydrocarbon phases should be treated as n
c-component mixtures and thus a compositional model should be utilized instead [
7].
The most commonly used compositional models for hydrocarbon systems and their mixtures are cubic Equations of State (cEoS), such as the Peng–Robinson (PR) [
8,
9] and Soave–Redlich–Kwong (SRK) [
10] fluid models, which are among the most computationally efficient cEoS [
11]. In general, an EoS model requires properties that define the vapor pressure curve of each individual component present in the hydrocarbon mixture under study: the critical pressure (P
c), critical temperature (T
c), acentric factor (ω), and binary interaction coefficients (BICs or k
ijs) [
12]. In addition, properties that ensure accurate predictions of the liquid density of each fluid component are also a prerequisite, such as the molecular weight (MW) and volume translation (V
s) parameter [
12].
However, EoS cannot be used directly as predictive models [
13] due to their relatively simplistic semi-empirical approach to physical phenomena [
14], their inherent deficiencies in estimating liquid density, and the uncertainties in the molecular weight and critical properties of the pseudo-components [
4]. These shortcomings render EoS insufficient for accurately simulating the phase and volumetric behavior of reservoir fluids under various conditions.
The standard approach to overcoming these challenges is to tune the adjustable EoS parameters against available experimental data [
14]. The optimal values of the selected regressing components parameters are obtained as soon as the error function, defined by the difference between the predicted and the lab measured PVT values, is minimized. Over the years, numerous tuning techniques have been proposed, the majority of which typically begin with assigning default values to the components of properties and the characterization of the plus fraction followed by the minimization of the error function using gradient-based (GB) optimizers.
Figure 1 describes graphically the EoS tuning process. This process is mathematically complicated; at the same time, it requires careful inspection of the physical interpretation of the values assigned to each tuned parameter. In other words, it is vital to pay particular attention to the physical soundness of the values attributed to the regression parameters apart from attempting to minimize the global error.
Due to the significant number of matching parameters, EoS tuning is undoubtedly a challenging task that depends to a great extent on the operator’s experience. For this reason, although many operators have developed ‘‘best practices’’ and EoS tuning workflows, they still rely on the services of experienced fluid engineers, when it comes to complex fluids. In addition, the strong nonlinearity of the error function (i.e., between the PVT values and the tunable parameters) makes the EoS tuning problem even more complex. Things become even more complicated when an EoS model needs to be simultaneously tuned against more than one reservoir fluid as is the case when commingled flow is considered. Therefore, it is reasonable to consider the implementation of global optimization techniques to obtain a reliable EoS model because of their wider viewing angle with regard to seeking the global minimum. To this end, Sarvestani et al. [
15] and Zarifi et al. [
16] conducted research on EoS tuning using global optimization in the form of genetic algorithms (GAs) [
15,
16]. In both of their studies, commercial PVT software programs, which use Newton’s numerical method as an optimization technique, have been coupled with GAs to further assess the software output and modify the selected EoS parameters.
Regarding research to ensure physically sound EoS tuning, various investigators have proposed simplistic approaches such as incorporating box constraints to define limits for regression parameters as part of their tuning methodologies. Among the most well-known methodologies are those proposed by Coats and Smart [
17], Christensen [
18], and Aguilar and McCain [
19].
The proposed methodology in this paper, being fully automated and directly incorporable into any related software, offers three main advantages. Firstly, it utilizes a Generalized Pattern Search (GPS) algorithm (global optimization technique) for handling the EoS tuning problem, which acts as a compromise between the fully random, exhaustively time-consuming GAs and the much faster, but prone to be trapped in local minima, gradient-based (GB) methods. Secondly, the tuning algorithm developed in this work is flexible and allows a number of mathematical constraints to be imposed on the optimization process to account for all physics-driven rules a reasonably tuned EoS model needs to honor, rather than solely simplistic box constraints. This introduces an additional layer of reliability and accuracy to the tuned EoS model ensuring not only that the attained minimum will be the global one but that it will not “twist” the EoS model to such an extent that unrealistic behavior is predicted by the tuned model. Finally, the proposed methodology being fully automated addresses the challenge of achieving accurate EoS tuning with minimal operator dependence.
The rest of this paper is organized as follows.
Section 2 describes the standard workflow followed in the oil and gas industry for developing a compositional model.
Section 3 provides a comprehensive discussion of EoS tuning, which constitutes the central theme and primary objective of this work.
Section 4 and
Section 5 present the physical constraints imposed and the features of GPS algorithms, respectively. Finally, the new automated EoS tuning algorithm developed and the results from the test application of the proposed methodology are presented in
Section 6. The paper concludes in
Section 7.
2. Best Practices for Developing a Compositional Model
During the development of a compositional simulation model, engineers aim at keeping the number of components low to reduce CPU time and memory usage during the simulations which will follow. Nevertheless, the model’s efficiency in providing accurate predictions tends to worsen as the number of components decreases. Clearly, reaching an optimal lumped EoS model that maintains the accuracy of the split model is not an easy task. Therefore, during the development of compositional models for pilot or full-scale flow simulations, standard practices can be followed.
The first step towards developing an EoS model is to mathematically split the plus fraction into several single carbon number (SCN) fractions using either Pedersen’s splitting scheme [
20], in which an exponential relationship is assumed between mole fractions and the molecular weight of SCN, or the generalized three-parameter gamma probability function developed by Whitson [
21]. In the context of the gamma distribution, parameter α plays a vital role in shaping the distribution’s form, as exemplified in
Figure 2, which provides a visual representation of how the gamma distribution model relates the SCN mole fraction to SCN molecular weight. When it comes to reservoir fluids, this parameter typically ranges from 0.5 to 2.5, with higher values corresponding to heavier fluids and lower values indicating lighter fluids. It is important to note that when α equals to 1, the gamma distribution reduces to an exponential distribution. Based on the resulting split model, a pseudoized EoS is developed for modeling calculations to be carried out within a reasonable time.
The next step incorporates the grouping of similar components into pseudo-ones to keep the total number of components as low as possible. Typically, light and pure components such as methane (C
1), ethane (C
2), and propane (C
3) are grouped with nitrogen (N
2), carbon dioxide (CO
2), and hydrogen sulfide (H
2S), respectively; the isomers of butane (i-C
4 and n-C
4) and pentane (i-C
5 and n-C
5) are grouped into a single pseudo-component or two separate ones. When N
2, CO
2, or H
2S content exceeds approximately 2% in the reservoir fluid or injection gas, these components are recommended to be kept intact. The properties and BICs of the resulting pseudo-components can be determined using a mixing rule since pseudoization is considered as a process of “combining streams” [
22]. Finally, the numerous SCN fractions must be lumped into few multiple carbon number (MCN) components using Whitson’s method, for instance. This lumping method makes use of mixing rules and is embedded in the majority of PVT software packages which are integral components of commercial reservoir simulators. The obtained lumped pseudos are then characterized using empirical correlations, which are functions of their molecular weight and specific gravity. BICs of the HCs-HCs binary systems can be defined by the Prausnitz correlation [
23].
Adjustments to the component and pseudo-component properties to match the measured PVT data can occur during the tuning of the EoS model. However, due to the excessive flexibility of the optimization process involved, EoS tuning is advised to be performed in a stepwise manner; matching saturation pressures and PVT properties should be attempted each time a new grouping scheme is evaluated.
3. Tuning of EoS Models
The objective of EoS tuning against laboratory measurements for a specific reservoir fluid is to achieve the highest level of accuracy and precision in describing the phase behavior and physical properties of hydrocarbon mixtures with an EoS model. It should be emphasized that there is no universal solution when it comes to EoS tuning, as the tuning process must be customized to align with the objectives and limitations of each individual field development project under study.
The EoS tuning process involves solving an optimization problem to minimize the error function, which is a key element during EoS calibration as it allows engineers to quantitatively assess the accuracy of their models. The error function
J is usually defined as the sum of the weighted squared relative deviations between the laboratory measurements and the EoS estimates:
where
and
correspond to the calculated and experimental PVT values, respectively. Weights
, which are associated with single pressure steps or groups of steps, assign a degree of importance to each data point. Box constraints are typically applied to avoid unrealistic adjustable parameters values. For bounding values of each tunable variable, it is generally accepted to allow a variation within the range of ±20% for the P
c, T
c, ω, and V
s of each component, as well as ±0.05 for the BICs [
24].
Calibrating an EoS model is intrinsically challenging due to the strong nonlinearity that governs Equation (1), thus rendering it as a nonlinear optimization problem involving complicated relationships between the variables being optimized. Furthermore, compositional models require the adjustment of a large number of EoS parameters to provide high-quality predictions, which makes EoS tuning a high-dimensional optimization problem. Solving this type of optimization problem is particularly difficult because of the ‘‘curse of dimensionality’’ which implies that the size of the search domain increases exponentially with the number of parameters. The high dimensionality of the EoS tuning optimization problem results in Equation (1) having numerous local optima, which can trap optimization algorithms and impede their ability to reach global optimum. This risk is particularly high when utilizing gradient-based (GB) optimizers. To mitigate the risk of being trapped in a local minimum, it is typical to run GB optimizers repeatedly using different initial estimates.
Tuning a compositional model poses the additional challenge of determining appropriate weighting factors, which play a crucial role in extrapolation—the use of the tuned EoS model to predict a fluid’s behavior under conditions beyond those for which experimental data are available. It is important to note that each modification of the assigned weighting factors leads to the complete alteration of the shape of the error function (Equation (1)); minima and maxima appear or vanish when compared with optimization problems, where different sets of weighting factors are used.
To assign weighting factors to each property, one must assess the relative importance of key data, account for the amount of data for a specific PVT property, and consider the uncertainty associated with the available laboratory data, to lend confidence to the ability of the tuned EoS model to provide reliable estimations. However, this procedure is highly subjective and closely linked to the level of experience of the operator performing the EoS tuning.
The general approach is to appoint the highest weighting factors to saturation pressures since they represent the state at which vapor and liquid are in equilibrium, and they are fewer in number than other data types, such as densities and relative oil volumes. Furthermore, high weights are assigned to thermodynamic properties that are especially significant in the application of interest. Additionally, Constant Composition Expansion (CCE) volume versus pressure data typically receive high weights during tuning due to their elevated reliability, attributed to the fact that no mass removal occurs during the CCE experiment, as opposed to other conventional PVT tests. Finally, when there is a significant difference in magnitude between the PVT properties, greater weight is assigned to the property with the lower magnitude to ensure a balanced and reliable model calibration.
Finally, accurately predicting fluid behavior across a wide range of pressures and temperatures, including high and low values, is a further hurdle of EoS tuning. In particular, the challenge lies in matching both the surface and reservoir properties [
12], which often proves significantly challenging for GB optimizers.
4. Tuning Constraints
The preceding discussion highlights the need to use an optimizer designed to search the entire solution space to attain global solutions. However, even with a global optimizer and box constraints, physically sound-tuned EoS models cannot be guaranteed. Therefore, the imposition of advanced thermodynamic constraints in addition to the box ones is necessary to ensure the validity and accuracy of the resulting EoS models.
To maintain the hierarchy of component properties during the EoS tuning process, it is essential to implement inequality constraints which ensure that, as SCN increases, key thermodynamic properties such as T
c, ω, V
s, and BICs or k
ijs exhibit corresponding increases, whereas P
c decreases. These constraints map to the following inequalities:
where
corresponds to the SCN.
Alternatively, the pseudos’ properties can be forced to lie within the range defined by the lightest and the heaviest component in the MCN group. For a group MCN
i-j spanning SCNs from
to
, the following inequalities must hold:
The molar mass of the pseudos is often tuned to match density measurements by directly affecting the mass contained in the molar volume. In such case, the pseudos’ molar mass values should be modified under the constraint that the heavy end molar mass is honored, that is:
where index
rolls over all pseudos comprising the heavy end. It should be noted that the heavy end molar mass is calculated by mass balance utilizing the STO molar mass which has been measured by Freezing Point Depression (FPD) or Vapor Pressure Osmometry (VPO). Although the experimental error in either method may be non-negligible, this error is attenuated when limited to that considered in the C
n+ heavy end, thus justifying the use of Equation (4). However, the popularity of adjusting the molecular weights has declined in recent years, as the introduction of volume shift parameters has been found to adequately enhance the accuracy of density predictions. Similarly to the molar mass, heavy end density should be honored as well by requiring that the volume additivity is retained, i.e.,
A more complex set of constraints can also be envisaged following the work presented by Gaganis et al. in [
25]. Such constraints impose the necessity of PVT properties’ derivatives with respect to components concentration rather than the properties themselves or the adjustable parameters, to follow specific patterns or to exhibit a specific sign. Derivatives such as
are defined by considering the change in the PVT property (e.g.,
) when increasing the concentration of some component while subtracting an equal number of moles distributed proportionally from all remaining components. For example, whenever the amount of a pseudo increases, against all other components, PVT properties accounting for the volatility of the reservoir fluid should be reducing whereas properties such as density should increase. In fact, the heavier the component considered, the greater is expected to be the effect on the PVT properties’ derivatives.
Finally, an experienced fluid expert recognizes that a fine-tuned EoS model must not only accurately reproduce available experimental data but also capture the overall trends specific to the fluid under investigation. For example, the second derivative with respect to pressure (i.e., curvature) of the oil formation volume factor (B
o) curve near the bubble point depends on the oil’s volatility. As a result, for oils with low volatility, the B
o curve in the vicinity of the bubble point takes on a concave downward shape. Conversely, for oils with high volatility, the B
o curve near the bubble point exhibits a concave upward trend, as illustrated in
Figure 3. This same principle applies to the solution gas–oil ratio (R
s) curve. In the case of gas condensates, it is worth noting that the shape of the liquid dropout curve varies among different fluids. Some exhibit a distinctive ‘‘tail’’ near the dew point, while others do not, as shown in
Figure 4. These observed trends present a unique challenge when trying to capture them using an EoS model. Therefore, operators should carefully apply these constraints during EoS model tuning, drawing upon experimental data obtained from PVT studies.
5. Generalized Pattern Search (GPS) Algorithm
Generalized Pattern Search (GPS) algorithms constitute a subset of direct search methods which aim at locating the global optimum of an error function. Because of their derivative-free nature, GPS algorithms do not require explicit calculation of the gradient of the error function being optimized and can be applied to non-smooth and non-convex optimization problems or problems where gradient information is difficult or even impossible to collect, either because of the CPU time cost or truncation error, as is usually the case for GB algorithms.
Figure 5 outlines the GPS optimization algorithm logic. The algorithm starts with an initial guess and repeatedly uses two key components: the search step and the poll step. During the search step, the algorithm generates a set of trial points lying around the current best estimate using a group of search directions that define a specific pattern, such as a simplex, box, or cross. The poll step then investigates the performance of the error function at each trial point generated during the search step, replacing the current best estimate with the first trial point that yields a lower value. The search directions are then updated to reflect the new best estimate and the search space is expanded to allow the algorithm to get a ‘‘wider’’ view of the error function shape and avoid getting trapped to a local minimum. The algorithm proceeds with another search step using the updated directions. If the poll step fails to deliver an improved point, the algorithm shrinks the search pattern and explores the region around the current best estimate more closely.
Figure 6 depicts examples of a successful and an unsuccessful poll. In the successful polling scenario, the pattern search begins at current estimate x
0 with an initial objective function value of 4.63. In the first iteration, with a mesh size of 1, the GPS algorithm adds the pattern vectors (or direction vectors) [1, 0], [0, 1], [−1, 0], and [0, −1] to x
0, generating the mesh points as shown in
Figure 5. Subsequently, the GPS algorithm evaluates these mesh points sequentially, in the order previously mentioned, by computing their respective objective function values until it identifies one with a value lower than 4.63. The first such point encountered is x
0 + [−1, 0], where the objective value is 4.51. In the case of the unsuccessful polling example, the GPS algorithm is unable to locate a mesh point with an objective value lower than 2.82, corresponding to the objective value of the current estimate x
0. The yellow arrows represent the slopes of the objective function surface.
The search and poll steps are repeated until the algorithm converges to an optimal solution or reaches the maximum number of iterations. Moreover, in case of a very high-dimensional error function space, the GPS algorithm makes strategic decisions to omit certain search directions, acknowledging that thoroughly investigating each search direction might pose significant computational challenges.