Numerical Modeling and Validation of a Novel 2D Compositional Flooding Simulator Using a Second-Order TVD Scheme

The aim of this paper is to present the latter and develop a numerical simulator aimed at solving a 2D domain porous medium, using the compositional approach to simulate chemical flooding processes. The simulator consists in a two-phase, multicomponent system solved by the IMplicit in Pressure, Explicit in Concentration (IMPEC) approach, which can be operated under an iterative/non-iterative condition on each time-step. The discretization of the differential equations is done using a fully second order of accuracy, along with a Total Variation Diminishing (TVD) scheme with a flux limiter function. This allowed reducing the artificial diffusion and dispersion on the transport equation, improving the chemical species front tracking, decreasing the numerical influence on the recovery results. The new model was validated against both commercial and academic simulators and moreover, the robustness and stability were also tested, showing that the iterative IMPEC is fully stable, behaving as an implicit numerical scheme. The non-iterative IMPEC is conditionally stable, with a critical time-step above which numerical spurious oscillations begin to appear until the system numerically crashes. The results showed a good correspondence in different grid sizes, being largely affected by the time-step, with caused a decrease in the recovery efficiency in the iterative scheme, and the occurrence of numerical oscillations in the non-iterative one. Numerically speaking, the second-order scheme using a flux splitting TVD discretization proved to be a good approach for compositional reservoir simulation, decreasing the influence of numerical truncation errors on the results when compared to traditional, first-order linear schemes. Along with these studies, secondary recoveries in constant and random permeability fields are simulated before employing them in tertiary recovery processes.


Introduction
The demand for energy has been steadily increasing during the last 150 years, and along with it, the need of discovering and/or developing new sources in order to fulfill the demands. Oil is the main energy source and also the main feedstock for the plastic industry [1]. The exploitation of oil reservoirs can be divided according to the mechanisms employed to recover it [2][3][4]. Primary recovery uses natural driven mechanisms present in the porous medium; then, water is injected in order to repressurize the medium as well as to sweep the remaining oil to the producer wells. It is usually considered that after these two stages around 45% to 55% of the original, oil in place is still trapped underground [5]. This fact, along with the increasing demand of energy and the decreasing number of new fields being discovered, has led researchers and industry to look for ways to increment the efficiency of existing fields. This marked the beginning of the enhanced oil recovery (EOR) techniques, which have become profitable in the last years due to the existing economic constraints [1]. There are many EOR methods, aimed at modifying the properties of the oil, water and/or rock formation. The employment of these techniques depends mainly on the physical properties of the oil trapped in the porous medium. For medium and low viscosity oils, chemical EOR (CEOR) represents a good alternative to increase the lifespan of the reservoir [6]. The standard techniques in CEOR include polymers, surfactants or alkali injection in order to modify the rheological of interfacial properties of the phases present in order to mobilize the still trapped oil. In this paper, a novel numerical simulator in MATLAB ® is developed for future CEOR processes, using a fully second-order discretization scheme in the Darcy and transport equations, along with split TVD flux limiter function in the continuity equations in order to diminish the influence of numerical diffusion and dispersion phenomena.

Previous Numerical Work
The simulation of multiphase multicomponent flow in porous media involves solving a number of coupled, highly non-linear systems of equations dealing with temporal and spatial variations of pressure and mass concentrations. The compositional flow offers a suitable approach to study chemical EOR processes, which can be described as the mass transfer of a number of components (e.g., polymers, surfactants, salts, etc.) in a two-or three-phase system. This model can also be applied to underground flow in several disciplines, such as groundwater hydrology [7][8][9], storage [10], environmental [9,11], and/or chemical engineering (involving chemical reactions between the rock and the fluids) [12,13].
It is usually employed in CEOR techniques using the compositional method in order to model the transport equations. This allows studying in a multiphase system a number of chemical components present in the latter which affect the properties of fluids and rock. The mathematical simulation of such a system has been already analyzed by several authors [14][15][16][17][18]. This has led to the development of commercial and academic simulators, namely: UTCHEM and IPARS (University of Texas at Austin) [19], MRST (open code for MATLAB) [20][21][22], CMG (Stars), Petrel and Eclipse (Schlumberger), and also others simulators found in the literature [23][24][25][26][27][28][29][30][31][32]. In addition to the physical phenomena, some problems of numerical source have been studied when the mass conservation equation was discretized. In order to address this issue, a scheme with a higher order of convergence was derived, both in time and in space. This scheme has a TVD flux limiting functions so as to prevent numerical diffusion and dispersion phenomena, and therefore the occurrence of spurious oscillations, commonly found in traditional Finite Difference Method schemes [5]. The combination of the compositional approach with the second numerical discretization has resulted in a novel and complete simulator, which can be used for the design and screening of new chemical species to be used in EOR.

Aim of this Work
The current numerical models used in chemical EOR processes were presented in the previous section, describing their problems regarding the formulation of the physical properties and the discretization of the differential equations. With respect to the physical properties affected in CEOR, most of commercial simulators do not consider one or more of these aspects, so the purpose of this research is the development of a new simulator that includes all these effects, namely: degradation processes of chemical EOR agents, shear-thickening effects in polymer solutions, influence of the viscoelasticity on the residual oil saturation, rheological properties based on the molecules' architecture and influence of several chemical agents on the interfacial tension (phenomena not considered by any of the mentioned simulators); competitive adsorption process in combined chemical flooding and the importance of all the components in the calculation of the aqueous phase viscosity (only considered by UTCHEM). In addition to the previously mentioned physical phenomena, some problems of numerical source have been studied when the mass conservation equation is discretized. It has been reported that first-order, linear schemes produce artificial diffusion of the different components which, in the case of CEOR, provokes a smearing of the chemical slug, decreasing its efficiency in the sweeping process. Thus, a full second-order, flux splitting non-linear TVD scheme is presented as a mean of decreasing this undesired phenomena and allow a better tracking of the chemical/water front, without the appearance of spurious oscillations, commonly found in traditional Finite Difference Method schemes reported in the literature. The combination of the mentioned has resulted in a novel and complete simulator, which can be used for the design and screening of new chemical agents to be used in EOR.
The two-dimensional approach was chosen because 1D systems are restricted to specific cases, since they do not consider certain phenomena like the areal sweeping efficiency. Conversely, the simulation in 3D oilfields might cause the model to lose numerical efficiency since a larger non-linear system of equations must be solved during every iteration. Furthermore, the vertical absolute permeability is usually considered negligible with respect to the horizontal ones, or at least one order of magnitude smaller. Thus, the increase in computational cost may not show a significant difference when compared to 2D models.

Physical Model
In order to model the process of secondary and tertiary flooding a 2D geometrical model is used, with a geometric pattern usually found in the oil industry. The five-spot scheme is a good model which relatively satisfies the previous requirement. It consists of a square domain, with constant or variable properties, where an injection well is placed at the center, and four producing wells are located at the corners. During this analysis, a simplification of the model was performed in what is known as quarter five-spot ( Figure 1). A problem associated with these geometries is the high speed and pressure gradients occurring at the vicinity of the wells, which may cause problems during the numerical simulation. The physical model is composed of a reservoir (Ω) of known geometric characteristics, with an absolute permeability (K) and porosity (φ), which can be considered constants or to have a statistical distribution. The flow is then considered isothermal and incompressible in a 2D field; it is also assumed that the physical system is in local thermodynamic (phase) equilibrium. The reservoir/domain is discretized in a system of n x × n y representative elementary volumes (REV) in order to perform the simulation. The Darcy's law is valid and moreover, gravitational forces are negligible when compared to the viscous ones [33]. The fluids can be considered Newtonian or non-Newtonian, depending on the presence of the chemical in the corresponding phase. Although Darcy's Law is valid only for Newtonian fluids, literature shows that the approach of considering non-Newtonian in the whole domain but Newtonian in each cell yielded good results.
Chemical EOR flooding processes involve a multiphase flow (aqueous and oleous), and several components (water, chemical and petroleum). It is noteworthy that the latter can be actually mixtures of a number of pure components, since petroleum is usually a mixture of many types of hydrocarbons; water may contain dissolved salts; and the chemical agent is composed by a number of molecules of different lengths and architectures [2][3][4]. The recovery process involves the injection at the beginning of an aqueous solution with the chemical, and thereafter a water-bank follows in order to drive the chemical slug, sweeping the still-trapped oil into the producing wells. Mathematically speaking, the model is represented by a system of non-linear partial differential equations (PDE's), completed by a number of algebraic relationships aimed at representing the rock and fluids' physical properties, namely: interfacial tension, residual phase saturations, relative permeabilities, rock wettabilities, degradation mechanisms, disproportionate permeability reduction, inaccessible pore volume, phase viscosities, capillary pressure, adsorption on the formation, and dispersion. It is clear that most of these properties are strongly dependent on the components' concentrations, which alters the flowability of the aqueous phase.
Another factor this new simulator will consider is the compressibility of the formation. Underground porous media are subject to internal and external stresses due to the forces acting on them. Internal stresses result mainly from the fluid pressure field whilst external stresses are originated from the weight of the overburden and, if any, tectonic stresses. The combination of the aforementioned forces causes a corresponding stress-strain condition in the formation. External stresses tend to compact and therefore reduce the pore volume. Internal pressure forces exert an opposite stress condition, resisting pore volume reduction or increasing it. As time goes on, and the reservoir is exploited, the pressure decreases resulting in a porosity reduction. Similarly, in deeper formations the overburden pressure increases hence the porosity is reduced [5,34,35]. The numerical technique adopted for the resolution of these equations is the IMPEC method, which calculates pressures implicitly and concentration for each of the component explicitly. In conclusion, the first step in the development of a chemical flooding reservoir simulation is to have a detailed model that allows predicting the phase behavior in the reservoir. All other properties are dependent on this, hence the recovered oil is a function of phase behavior [18,36].

Flow Equations
The goal of this research is to develop a simulator based on the compositional approach for the analysis of chemical EOR flooding in porous media. Therefore, the equations used to describe the process are the Darcy's equation applied to each phase and the mass conservation valid for each component [37,38]. The compositional method was chosen because of its versatility to model the different physical properties of the phases according to the concentration of these components. This makes it an ideal approach for chemical EOR processes. These equations are then applied on a REV of the porous medium. Considering Darcy's equation for each phase first, Considering Equation (1) for each phase and adding for the number of phases is obtained, Introducing the water-oil capillary pressure p c and the phases and total mobilities defined as, Along with Darcy's equation, the mass balance is applied for each component within the REV, considering the prevailing mechanisms in the flow in porous media, that is, flow by advection and diffusion. The loss of chemical component due to adsorption in the rock and finally the terms source/sinks to represent the wells are also considered in the formulation. Then, the equation is written as, When the details of the phenomena causing the diffusive flux are studied, it can be inferred that it is caused by several sources. The random Brownian motion exhibited by the molecules is the simplest molecular diffusion movement, which usually is neglected in reservoir simulations when compared to other considered forces acting on the fluids. Nonetheless, also mechanical dispersion is present in the narrow channels, where the flow experiences parabolic diffusion (Taylor dispersion) and the rock's pore network disperses the mass at a microscale. Besides this, the phenomena of transverse and longitudinal (tortuosity effect) spreading are also present. The hydrodynamic dispersion tensor which considers these effects is expressed as [37,39,40], These equations are complemented by the algebraic relations derived from the mass balance [40] One possible way to solve this system of equations is to use the pressure formulation and concentrations. This consists in obtaining the pressure of one of the phases, introducing the capillary pressure. In this paper, this is done by adding the mass conservation equation for each component and taking into consideration the constraints set by Equations (2), (3), (7) to (10). Thus, Equation (11) is the parabolic-type PDE usually found in reservoir simulation due to the formation and/or fluid compressibility. If the latter is assumed incompressible, the PDE becomes an elliptic-type. The resulting numerical model has for each REV 16 unknowns, namely: Darcy velocities (u o,a ), pressures (p c , p o,a ) and saturations (S o,a ), and volumetric (V o,a p,w,c ) and overall concentrations (z p,w,c ) of each component. However, thus far the system presents only 13 equations (Equation (1) for each phase, capillary pressure relationship, Equation (4) for two components, Equation (6) for each component, Equations (7), (8) for each phase, Equation (9), and Equation (11)). The remaining equations to determine the system, equal to N comp · N phase − 1 , are obtained from algebraic relationships between the volumetric concentrations of the components on the phases [5]. These describe the phase behavior, of which its understanding and correct modeling is a vital concept in chemical EOR processes. In the case of secondary recovery, these relationships are based on the fact that both aqueous and oleous phases are composed exclusively by their respective components, this means, no water is present in the oleous phase and vice versa (V o w = V a p = 0).

Physical Properties
Since the objective of this paper is to define the numerical model to be used in CEOR processes, this study is aimed at discussing and presenting the general physical properties of a multicomponent CEOR simulator.

Residual Saturation
Residual saturations play an important role in oil recovery processes. They establish a certain limit to how much oil can be mobilized during the process. If such saturations can be reduced, this will increase the efficiency of the whole process. As explained in the previous section, they depend on the IFT in the water-oil two-phase system. The presence of the polymer can modify the residuals saturations in the porous medium. This is governed by a dimensionless group, the Capillary number, defined by: The relationship between the Capillary number and residual saturations is described by the following piece-wise function [33]: The constant parameters depend on the fluids and on the porous medium type (e.g., rock formation) being simulated. The relationship between EOR and waterflooding residual saturation processes is known as the phase normalized residual saturation. Equation (14) determines what is known as the capillary desaturation curves (Figure 2). At low capillary numbers, the behavior is similar to a process of waterflooding and the normalized residual saturation is not decreased. As the IFT decreases and/or the viscosity increases, the capillary number raises to higher values than those of the secondary recovery. It is for this reason that in areas of high speeds (i.e., nearby the wells) oil saturation values lower than those of waterflooding can be achieved. It can be seen from Figure 2 that aqueous phase requires higher values of N vc to achieve the full desaturation [3].

Relative Permeabilities
The relative permeabilities influence Darcy's equation on the phase velocities, and therefore the efficiency of oil recovery. They depend on the residual saturations which were calculated in the previous section. The mathematical formulation adopted to calculate the relative permeabilities is taken from the work developed by Camilleri [41,42], which is used for most chemical flooding processes. Knowing beforehand the phase saturations, the relative permeabilities are calculated as: The terms k j0 r and e j represent the end-point and the curvature of the permeability function k j r (S j ), respectively. These values are calculated by the following equations: where k j0H r and e jH represent the end-point and curvature of the relative permeability curves for the water-oil (without chemical agents), respectively.

Capillary Pressure
This is defined as the difference between the pressure of the non-wetting (oleous) and wetting (aqueous) phases. The capillary pressure is usually expressed in reservoir simulation as a function of the aqueous phase saturation. In this paper the relationship is described using the following power-law equation [3]: The constant C is determined from experiments and n defines the curvature of the capillary pressure function. The parameter C relates the capillary forces in the EOR flooding system (petroleum, water and chemical) to the forces in the oil-water system.

Boundary Conditions
At the beginning of any chemical flooding process, the residual saturation in the reservoir is that of the result of the primary recovery, or the saturation after a waterflooding reaching a maximum allowable fractional flow at the producing well. There is no chemical present and initial pressure is constant throughout the reservoir. Thus: The flooding process begins injecting for a certain period of time a polymer or chemical solution with constant concentration. After this period, the chemical slug is followed by a water-bank in order to sweep the remaining oil. As the boundary conditions, a 'no flow' is assumed on the oilfield contour (Γ), since it is usually considered that the porous rock is surrounded by an impermeable rock layer. In the case of the advection mechanisms, this condition is satisfied imposing that the transmissibilities (or mobilities) are zero on the boundaries. In the case of diffusive mechanisms, Fick's first law is applied rendering,

Discretization of the Partial Differential Equations
The above formulation based on the Darcy's and mass conservation equations yielded a system of non-linear parabolic partial differential equations, which are discretized and then solved by a finite difference method. The first equation to analyze is the pressure of the aqueous phase (Equation (11)), which is implicitly solved using a centered discretization scheme for the pressure terms and a second order Taylor approximation in the time derivatives (see Appendix for the formula derivation). This scheme is often used in systems with derived second order with coefficients that are not constants in the domain in studio. Besides the Darcy equation, the discretization of the total and aqueous Darcy velocities is also presented, which are explicitly solved using a centered difference scheme. Therefore, Equations (11), (1) and (2) are discretized as follows, respectively: In the discretized equations the notation is as follows: m, n represent the cells in the axes of the physical numerical domain (x, y) = (m · ∆x, n · ∆y), respectively, < n > represents the temporal-step (time =< n > ·∆t) in the simulation and [k], ∀k ∈ N + , is the iteration number within each time-step. One of the most sensitive points of reservoir models is to calculate the in-and outflows in the well blocks. The concept of wells is commonly used in reservoir simulation [43], and for the purpose of this paper, it was adopted as the operating regime that producing wells operate at a constant total flow rate, and the injector will operate at a constant bottomhole pressure. For wells, both injectors and producers, in Cartesian coordinates, the following formula applies: where the productivity ratio is calculated for two-dimensional systems with the following formula: The equivalent radius necessary in the previous equation is obtained using the Peaceman model for heterogeneous models [43]: It is worth mentioning that, because of the production scheme adopted (i.e., quarter five-spot), wells are placed in boundary REV's. A consequence of this is that the equivalent radius in the mathematical model is affected. The Peaceman model adopted in the paper was extended to consider this factor, as well as several others (e.g., non-Darcy effects). This extension has been already reported previously [40] and it is considered in the mathematical model.
As the last step of the model, the analysis of the discretization of the mass conservation equation is analyzed. Equation (5) is the typical advection-diffusion PDE, employed in many phenomena in hydraulic, mass transport and flow in porous media. The advective terms have an hyperbolic nature, and the first-order, linear upwind discretization schemes cause numerical diffusion in the solution, as it was reported in the literature [44,45]. In order to solve this, higher order schemes should be used [46]. In this paper, a full second order explicit discretization scheme in time and space, based on flux limiting techniques (see Appendix) is derived. This allows increasing the numerical accuracy of the simulator as well as decreasing the influence of numerical diffusion and dispersion on the recovery factor. The diffusive term is discretized according to a centered second order scheme. In this study, the longitudinal and transversal dispersive terms in the diffusion tensor will be neglected. The second order in time is achieved using a Taylor expansion of second order, and moreover the simulator has the possibility to compare both first-and second-order schemes and their influence on the recovery efficiency [46,47].
The last step is to establish a functional relationship between the gradient of the volumetric concentration and the limiting function ψ. Several second order methods have been proposed and studied. The functions used in the development of this simulator are presented in Table 1, along with the standard Upwind method. These functions depend on the ratio of the concentrations' consecutive gradients in the numerical grid r Table 1. Flux limiter functions used in the model [5].

Flux Limiter Function
Upwind 0 All in all, the discretized mass conservation equation yields, x,m,n ∆t 2φ i,m,n + ...

Solution Algorithm
The discretization carried out in the previous section leads to a coupled system of non-linear equations, solved by a combined implicit-explicit numerical scheme known as IMPEC, in which the aqueous phase pressure is calculated implicitly. Then, the oleous pressure, Darcy velocities and the components' total concentrations are obtained explicitly. The complexity of this problem lies in the fact that the auxiliary properties are functions of both the pressure and the components' concentrations being calculated for the time-step under study. This problem is solved adopting an iterative approach in each time-step. Thus, the difference between two consecutive iterations, in the same time-step, of a certain parameter is required to be less than a preset tolerance, which is set using a criterion based in the literature as well as in the numerical conditions adopted for the simulation [33,48]. This difference is calculated using a specific vector norm for the overall concentrations, which can be also modified in the simulator. Then, the values of the parameters from the previous time-step (n and k = k max n+1 ), are employed as starting values for the next one (n + ∆t and k = 1).
Equations (29) and (30) represent the max norm of the error matrices. These norm can be adjusted in the model to change the convergence criteria. The 1,2,∞ norms may be also employed in the simulations to determine the convergence criterion. When both errors comply with a maximum allowable error given as input, the calculation is concluded in time step n and passed to n + 1, using as next input the data obtained in the last iteration of the previous time-step. If errors do not meet the compliance, the values obtained are used as input data for a new iteration in the same time step (Figure 3).

Results and Discussion
The simulator presented in this paper has been developed in MathWorks MATLAB ® aimed at solving the non-linear system of equations resulting of applying the aqueous pressure (Equation (11)) in the physical domain. The matrices' assembly (aqueous and capillary pressure terms) is solved using either a direct or sparse matrix tools. The technique is chosen based on the size of the reservoir mesh. Mathematically speaking, the resulting system is then expressed, Due to the fact the compositional approach employed in this simulator, secondary recovery processes (waterflooding) can also be simulated. The governing equations are modified to consider secondary recovery processes, reducing the system of equations to the well-known IMplicit Pressure and Explicit Saturation (IMPES) technique. It is important to mention that the traditional IMPES method is not iterative, contrarily to the model developed in this paper. This is ultimately reflected in the difference between the computational time between the two methods (IMPES and iterative IMPEC), although the iterative approach confers better numerical stability than the IMPES method. The simulator has the option to perform secondary recoveries based either on an iterative or on a non-iterative method.

Data
In order to test the new simulator, a number of physical properties were set emulating the recovery in an oilfield, presented in Table 2. Furthermore, the producing/injecting conditions are shown in Table  3. Finally, a number of auxiliary parameters are presented in Table 4, based on a previous work [48].

Validation of the Model
The new simulator is validated in a reference case against benchmark simulators. It was considered a 2D oilfield, operating under a secondary recovery scheme. The simulators used as benchmark are UTCHEM and GPAS (fully implicit, parallel EOS compositional simulator), both developed at the University of Texas at Austin. The oilfield and its operating conditions were adopted from Najafabadi [49]. The dimensions are 201 m × 201 m × 30.5 m and, for the purpose of the validation, it is discretized using a 10 × 10 grid scheme. The absolute permeability tensor is isotropic, with a value of 100 mD and considered constant. At the beginning of the flooding, the oil saturation is 0.7. The Figure 4 shows the oil recovery efficiency and produced flowrates, comparing the results with those reported by Najafabadi [49], using two discretization schemes for the new simulator. The latter presents a slight larger numerical dispersion than UTCHEM, although the oil recovery efficiency is practically the same and equal to the one yielded by GPAS. The major difference with respect to the reference simulators is observed when the waterfront reaches the production well (at ≈ 0.5 PV), rendering oil recoveries and flowrates slightly lower than those from UTCHEM, due to numerical errors. The numerical diffusion cannot be considered negligible, but it does not modify the final values. Moreover, these are accurate when considering the front tracking and the cumulative oil production. With respect to Figure 4b, it is worth mentioning a small variation in the flowrates during the waterbreakthrough period. This subtle variation (in both flowrates) is due to a minor change in the oil saturation in the producing well-REV (due to the mathematical representation of the physical phenomena), which affects the fractional flow and ultimately, the flowrates. This variation in the saturation takes place exactly at the same moment the waterbreakthrough occurs in GPAS (with a Tol. = 1). In our model this variation stabilizes and then the flowrates abruptly change when the waterbreakthrough occurs in GPAS (with a Tol. = 0.1) (and near the breakthrough time in UTCHEM). From that moment on, the flowrates are similar to those reported by both simulators.  The second step of this validation process consists in the verification of the accuracy order of the new numerical scheme. With respect to this, it was considered a chemical EOR flooding (polymer), using as reference the results obtained by a previous simulator based on a first-order, linear upwind scheme [47,48]. The reservoir dimensions were adopted from Table 2 and the results from the EOR flooding are presented in Figure 5. It is well-known from the literature that first-order schemes add artificial diffusion which, in the case of chemical flooding, causes the smearing of the EOR agent, smoothing the recovery curves, thus decreasing its sweeping properties and ultimately, the recovery efficiency [25,45]. Conversely, second-order TVD schemes are known for achieving a better front-tracking of the chemical slug, decreasing considerably the numerical diffusion and the occurrence of spurious oscillations (caused by dispersion phenomena), which renders slightly higher recovery efficiencies [46]. Figure 5 shows that the results with the second-order flux limiter functions match those obtained by a previous, first-order model, but yielding slightly higher recoveries due to the fact that the absence of numerical diffusion allowed a better front tracking of the chemical slug and thus, higher recovery factors. Figure 5. Oil recovery during a tertiary flooding with polymers, comparing the results from a first-order Upwind scheme [48] with the second-order TVD functions used in this paper (Adapted from Druetta [47]).

Iterative Process
The first set of trials of the new simulator is a secondary recovery process in a reservoir that is assumed to have been exploited in its primary recovery stage, and the oil produced flowrate has declined enough to make the process no longer profitable. It is then expected that the IFT and the aqueous phase viscosity will not change due to the absence of chemical EOR agents. Therefore, both the Capillary number and normalized residual saturations will not change throughout the waterflooding. However, in the areas near the wells the velocities may be high enough to cause a partial desaturation, below the water residual saturation.
As mentioned before, the simulator allows the option to follow iterative or non-iterative (traditional IMPES) approaches on each time step. The scenario under study is the following: a reservoir after the primary recovery, with a constant oil saturation, above the waterflooding residual one. In order to test the behavior, a total waterflooding period of 9000 days is simulated, which was set to guarantee the appearance of a pseudo-steady state operating conditions. In the analysis of the iterative simulator, six different runs were carried out with different grids and temporal steps in order to study the influence of the numerical model on the oil produced and the simulation time. Table 5 shows the models simulated, the total time employed, relative to the fastest case, and the cumulative oil production.  Figure 6 shows the pressure (in MPa) and the oil saturation (dimensionless) profiles after 5000 days of the waterflooding process. As it was expected, the remnant oil reached its maximum values in the vertexes where the Darcy velocity is nearly zero, because of the negligible pressure gradient, and nearly no displacement took place in this region. Furthermore, the oil saturation was increased due to the displacement of oil encountered originally near the injection well. Near the latter, the oil saturation dropped below the residual oil saturation due to the velocity in this area, which caused a partial desaturation. Moreover, Figure 7 depicts the behavior of the waterflooding during the whole process in terms of cumulative oil produced/fractional flow, oil/water flowrates, and pressure drop, also in terms of the grid size. The latter was the only one found to be considerably sensitive to the grid size and behaved as it was expected, showing lower pressure drop with larger grid size, increasing slightly and becoming nearly the same in the models with 50 and 60 blocks. As the flooding process evolves, the high-viscosity oil is swept by the water, and the pressure difference between injector and producer decreases. The other terms analyzed showed trends typical of waterflooding. These parameters were largely affected by the relative permeability curves of the rock formation, so a comprehensive previous analysis of its wettability is deemed necessary in order to obtain reliable results.
It is also worth of mentioning that after 9000 days, the fractional flow in the producing well reached in all cases values of fractional flows beyond the acceptable limit mentioned in the literature for a profitable waterflooding process [2,3]. Considering a fractional flow limit of 0.98, the waterflooding process should be stopped after 4500 days of flooding, yielding a total recovery of 38.21% of the original oil in place (OOIP).
In conclusion, the iterative approach has a calculation procedure that renders the IMPEC/IMPES scheme equivalent to a full implicit method, ensuring its stability. However, as it is reported for implicit techniques, the accuracy decreases as the time-step is increased, as it can be seen in Table 5 for the same grid size, yielding a maximum difference of 5.64% in the cumulative oil produced between the results obtained with different time-steps.

Non-Iterative Process
The first part of the study is based, like in the previous case, on a constant permeability field. The same operating conditions are employed but employing a non-iterative scheme, which transforms the simulator in a traditional IMPES method. It was found that when the time step exceeds a critical value dependent on the porosity, the space step and the saturation, the process became unstable. The problem consists then in finding where the velocity field reaches maximum values, and this occurs in the vicinity the wells. Then, a comparison between time-steps (below and above) near this critical value is presented in Figures 8 and 9.  Under some conditions, with time steps slightly above the critical value, oscillations appear at the beginning of the process. However, after a certain time, the critical time becomes higher than the time-step used for the simulation, conferring numerical stability. Thus, these oscillations start to progressively fade out, until they disappear (Figure 9a,b). Such spurious oscillations clearly have their origin in numerical instabilities because of the explicit calculation process used for the phases' saturations. When higher time steps are employed, the oscillations become after a certain time unrecoverable and the system collapses numerically. The pressure drop was not affected by these instabilities, whilst the cumulative oil production registered a slight difference caused by the oscillations at the beginning of the simulation. The oil produced by the fully stable configuration was 96,250 m 3 (44.0% of the OOIP) and the result in the simulation with oscillations was 98,265 m 3 (44.9% of the OOIP), which represents a difference of 2.1%. The results of the simulations are consistent with those obtained in the iterative method ( Table 6) in terms of the cumulative oil productions. Figure 8 shows the similar behavior in the pressure and oil saturation profiles, as it was expected since the physical and operating conditions did not change. Nonetheless, in Figure 9 the mentioned instabilities are clearly distinguishable at the beginning of the recovery, both in the water/oil flowrates and also in the fractional flow curve, but not present in the cumulative oil production or in the pressure drop. The nature of these oscillations can be deduced performing a matricial stability analysis of the mass transport equation. The critical time step for the stability of the method is based on the flow velocities and therefore on the phase saturations (Equation (32)) [48].
where f S and g S are functions of the phases' saturations and the Darcy velocities. These are a function of the time, thus the critical time step will also change as the recovery process evolves ( Figure 10). In this case, during the beginning, the time-step chosen was above the critical and therefore it caused oscillations in the flowrate. After a certain period of time, the time-step chosen became stable and therefore these oscillations started fading out until the system became completely stable. The simulations performed with the non-iterative IMPES method have taken into account the relationship between spatial and temporal discretization steps to guarantee the absence of oscillations. In order to achieve the latter, a relationship between these values was established to modify them simultaneously, without the introduction of numerical instabilities. Since the process analyzed is purely advective, the CFL (Courant-Friedrichs-Lewy) condition is adopted, so the equation yields, Using this concept, the following results were obtained for the different sets of spatial and temporal grids, indicating a good correspondence between the relationships chosen for the study ( Table 6). The CFL condition allows simulating the model using different grids without the appearance of numerical oscillations, and guaranteeing at the same time the accuracy in the simulations.

Random Permeability Field
As a final part of the study of a secondary recovery process, the influence of viscosity is presented in the new simulator in a heterogeneous porous medium. The assumption of constant permeability is only valid for the goals of this paper, but it is well known that oil fields have heterogeneous permeability distributions that affect the flow in EOR processes. For this purpose, a random heterogeneous field was generated in MATLAB ( Figure 11). Thus, using the same geometric configuration and the same operational conditions, a waterflooding process was simulated to sweep four oils of different viscosities: 5, 20, 50 and 100 mPa·s. The results evidenced, as expected, that the greatest pressure drop is recorded during the sweeping of the most viscous oil. Moreover, pressure drops within the field are related to the mobility and Darcy velocities of each block (Figure 12). The recovery process, both from the point of economically and recovered oil, is also sensitive to the oil viscosity. The results indicate that the time to reach the limit fractional flow is strongly dependent on the latter, affecting the recovery factor ( Figure 13). The behavior of the four different recovery processes is summarized in Figure 13. Since the non-iterative approach was employed, numerical instabilities appeared during the simulation ( Figure 13-case 50 mPa·s), which caused the time step in the cases with viscosities 5 and 20 mPa·s to be reduced in order to avoid the system to collapse numerically. The time steps for each of the scenarios were: 1.6 days (100 and 50 mPa·s), 1 day (20 mPa·s), and 0.5 days (5 mPa·s). With respect to Figure 12b,d is it important to notice some areas of the reservoir where the sweeping efficiency has been almost negligible. The latter is a function of the random permeability field, but also of other physical parameters in the reservoir (e.g., pressure gradient, operation time, viscosity, relative permeability, wells geometrical location). Focusing on the importance of the absolute permeability, this is represented by a two component tensor, and both components must be zero (or near zero) to keep the oil trapped (independently of the pressure gradient values). With respect to the pressure gradient itself in the Darcy equation, if one (or both) of its components is also zero/near zero, this might have the same effect on the recovery process. Moreover, the blue areas in Figure 11 indicate low permeabilities zones (this does not mean impermeable cells). Even in the low permeability areas (K < 100 mD), the sweeping process actually takes place, although it takes a longer time to achieve the oil desaturation. Finally, due to the process employed during the design of the permeability field, there is no smooth transition between low-permeability areas and the impermeable regions.  Figure 13 also shows that in the case of the oil with the lowest viscosity, the sweeping process was the fastest to reach the residual saturation, with the highest fractional flow at the end of the simulation, giving an indication of the efficiency in the recovery process. If the economic limit for waterflooding processes is set as a maximum fractional flow value of 0.98, then secondary recovery should end after the following periods: 4850 days (100 mPa·s) with a recovery of 20.3% of the OOIP; 5050 days (50 mPa·s) with a recovery of 27.5% of the OOIP; 4650 days (20 mPa·s) with a recovery of 36.0% of the OOIP; 2950 days (5 mPa·s) with a recovery of 42.3% of the OOIP. Summarizing, the simulator was tested in heterogeneous fields under different regimes to test the sensibility to the oil viscosity. The results also showed a strong dependence in the constants utilized in the relative permeability models, which emphasizes the necessity of laboratory experiments in order to determine the wettability of the porous medium.

Conclusions
A new numerical simulator for a two-phase, three-component compositional flow has been developed to study chemical EOR processes. The new simulator has been designed using the compositional approach in order to create a versatile source for the different chemical products used in industry. In order to diminish the numerical influence, the differential equations were discretized using a fully second-order approach which is usually found only in commercial simulators. This, coupled with a TVD flux-limiter function, allowed improving the front tracking of the chemicals being injected as well as reduce the numerical smearing of the latter, which causes a decrease in the recovery factor.
The validation process showed a good correspondence with commercial and academic simulators used for 2D waterflooding processes. The compositional method also allows simulations of secondary or tertiary recovery processes without further complications. This paper was aimed at developing, validating and then testing in waterflooding processes the numerical code. The simulator can be numerically operated in two different ways (with constant or random permeability fields): iterative and non-iterative schemes. Due to the number of properties involved in EOR, only the iterative process will be use to simulate chemical tertiary recovery methods. However, waterflooding scenarios were also tested using the non-iterative method, faster than the iterative, but prone to be affected by numerical instabilities. During the iterative scheme simulations, the cumulative oil production results were not affected substantially by the grid size. Nevertheless, as it happens in implicit schemes, the results were sensitive to the time step, which caused a reduction in the recovery efficiency of approximately 5.6% with respect to the benchmark case. Nonetheless, the grid size affected the simulation times, with a 37-fold increase between the grids with 25 and 60 elements, but with no significant modification in the oil recovered. With respect to the non-iterative approach, the results showed a good correspondence with the iterative one, yielding a maximum difference of 0.85% in the oil recovered for the cases tested. The CFL condition allowed testing different numerical grids without a significant variation in the results. Finally, the simulations with the random permeability field only confirmed the results previously obtained, validating the use of this approach in secondary recovery processes.
With respect to the numerical instabilities, there is a critical time step, a function of the simulation time and time-step, beyond which the system becomes unstable. This can be temporary and fade out as the simulation evolves, or it can cause the numerical crashing of the process. This simulator can be used as the base for developing further flooding processes meant both to test and to set design standards for new different chemical products for EOR.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript:

Appendix A. Discretization of the PDE
The purpose of this section is to explain the discretization of Equations (22) (aqueous pressure) and (28) (mass conservation). In Equation (22) the aqueous and capillary pressure terms are discretized using a centered scheme, which is second order accuracy [5]. The time derivatives must be also discretized using a similar order technique. A Taylor expansion of second order is proposed in this case. Two different possibilities were studied: Taylor series and multiple point derivative stencils. The former was chosen due to its versatility and possibility of application in the domain without modifying substantially the boundary conditions. The Taylor expansion of second order is calculated according to, Considering the porosity variation due to the compressibility, Equation (11) was derived with respect to time and neglecting higher-order derivatives and terms not dependent on time (i.e., total flowrate), Replacing the Taylor expansion in Equation (22) Regrouping and canceling terms in Equation (A4), the discretized pressure equation is finally obtained. The pressure, porosity and adsorption terms contains also time derivatives of the viscosity and adsorption which appeared due to the expansion of the Taylor series.
The second part of this appendix deals with the discretization of the mass conservation equation. The analysis is divided into two parts: the advective fluxes and the implementation of flux limiting functions, and the treatment of time derivatives, such as it was done before for the pressure equation. The analysis starts with the discretization of the advective term using flux limiters. It is well-known from the literature that first-order Upwind schemes can handle steep gradients but they are very diffusive, whilst Lax-Wendroff is a second-order scheme, presenting less artificial diffusion, but exhibiting serious problems with sharp gradients causing numerical dispersion [33,50]. Thus, the proposed technique couples the Upwind and Lax-Wendroff in order to take advantage of their benefits. Flux limiter has been widely described in the literature for 1D advective problems [50,51], and a way to use them in higher dimensions problems is by means of the splitting technique, which considers each dimension as a one dimensional problem with its limiter and gradients. The fluxes analysis is done using the Upwind and Lax-Wendroff schemes for the two-phase system,  The technique consists then in expressing the total flux as a linear combination of these two, Replacing these fluxes in the mass conservation equation terms, a modified Upwind scheme is obtained with a correction factor based on the flux limiting technique. The study presented in this appendix is based only on the coordinate x, and it is later extended to the second dimension, using different flux limiting functions, known as splitting technique [9,52,53]. This has been done in similar problems but, to our best knowledge, it has never been reported in CEOR techniques.
In order to continue with the study, it is assumed that u m−1 u m ∼ =û and moreover, the Courant number is introduced in the flux terms,    Table 1. In the standard Upwind method F j LI M,x = 1, thus the system returns to a first order accuracy scheme.
The last part of the analysis consists in the discretization of the time derivatives in Equation (4). The study starts from a simplified mass conservation equation with no diffusion mechanisms. Since this is a 2D model, the cross spatial derivatives must be also taken into account [46], and moreover, the third-order derivatives terms are considered negligible. The mass conservation equation is derived with respect to time and spatial coordinates.

∂ ∂t
(φz i ) + u x ∂c ∂x + u y ∂c ∂y From the spatial-derivative equations (Equation (A12)), the cross derivatives ∂ 2 z i/∂t∂x and ∂ 2 z i/∂t∂y are obtained and replaced in the second derivative with respect to time. In doing so it is assumed that ∂ 2 z i/∂t∂... ≈ ∂ 2 c/∂t∂... to simplify the approach.  Replacing in Equation (A14), the term ∂ 2 z i/∂t 2 with the relationship described previously from Equations (A12) and (A13), the general equation of the mass conservation is obtained in a semi-discretized form using a second-order accuracy approach.   Canceling the second-order time derivatives from Equation (A15) and regrouping terms, the final mass conservation equation is presented, written as a function of the flux limiter, such as in Equation (28). The coefficients C 1,2,3 are calculated according to the following expressions, (A16)