Study of surface complexation modeling on a novel hybrid enhanced oil recovery (EOR) method; smart-water assisted foam-flooding

This contribution focuses on surface complexes in the calcite-brine-surfactant system. This is relevant for the recovery of oil when using a new hybrid enhanced oil recovery (EOR) method, which combines smart-water (i.e., ionically modified brine) and foam-flooding (SWAF) of light oil with dissolved carbon dioxide (CO 2 ) at high pressure in carbonate (i.e., calcite) reservoirs. Using this new hybrid EOR-method (i.e., the SWAF-process) is not only economically attractive (i.e., it reduces opex costs) but also enhances the effectiveness of the production process, and thus reduces the environmental impact. Ionically modified brine (i.e., low-salinity) has a dual improvement effect. It not only leads to more stable foam lamellae, but also helps to change the carbonate rock wettability, leading for some conditions to more favorable relative permeability behavior. The mechanism for the modified permeability behavior in the presence of ionically modified brine is only partly understood. Therefore, we study this process initially in a zero dimensional (thermodynamics) setting, which can be used for the one dimensional (1D) displacement process with an oleic phase that contains carbon dioxide (CO 2 ) and an aqueous phase that contains both carbon dioxide (CO 2 ) and all the ionic substances. Using DLVO theory and surface complexation modeling to better understand the mechanism(s) of ionically modified brine as wettability modifier and foam stabilizer. We perform simulations using both (NaCl) and (MgCl 2 ) to show the effect of a divalent ion at the high-salinity (8500 mmol/kg-w) and low-salinity (0.4 mmol/kg-w) for both ambient-conditions at (25 � C) and at the reservoir-conditions (80 � C). We confine our analysis to a description that uses the Dzombak-Morel model of surface complexes, which is based on the Debye-Hückel theory (i.e., valid up to ionic strength of 0.3 (mol/ kilogram of water)). We also investigate the effect of carbon dioxide (CO 2 ) on the stability of low-salinity foam-laminae. We model the foam-laminae, which contain as surface complex a (cationic) surfactant in an aqueous phase. We use the PHREEQC-software to calculate the surface charge and the surface potential. The presence of a carbon dioxide (CO 2 ) phase leads to dissolution of four valent C(IV) compounds in the aqueous film. PHREEQC also calculates the equilibrium concentrations and surface potential and allows the study of the effect of salinity and the carbon dioxide (CO 2 ) gas pressure. For the soap-film (foam-film) in a carbon dioxide (CO 2 ) atmosphere we do use Pitzer activity coefficients (i.e., valid up to 6 (mol/kilogram of water)). As our aim is to show the methodology and the versatility of this approach, we leave more realistic choices of these parameters for future work.sFor the conditions considered we can qualitatively state that, in the presence of (NaCl i.e., at pH > 10) and (MgCl 2 i.e., pH > 10.3), the low-salinity case shows a more stable water-film behavior at (25 � C) and at (80 � C) than the high-salinity case for both (25 � C) and (80 � C). Moreover, high carbon dioxide (CO 2 ) pressures have a destabilizing effect on the film, as they reduce the surface potential. A reduced surface potential leads to a decreasing electrostatic double layer repulsion and thus destabilizes the foam-film, whereas low-salinity leads to less screening of the surface potential and thus improves the stability of the foam-film. The low-salinity flow is characterized by a high residual oil saturation and low end-point permeability for the two phase oil-water flow. This leads to a more favorable mobility ratio and thus a more favorable displacement process. For the calcite surface an enhanced stability helps to stabilize the water film on the calcite surface if the oil-water surface charge has the same sign as the surface charge on the calcite surface. Our calculations show the pH range where the sign of these charges is the same or opposite at low-salinity and high-salinity conditions. Admittedly these calculations only show trends, but can be used to delineate optimal conditions for Assisted Foam (SWAF) Flooding ” . It is expected that the SWAF-process under the optimum conditions will make the proposed new hybrid Enhanced Oil Recovery (EOR) process environmentally and economically attractive.

This contribution focuses on surface complexes in the calcite-brine-surfactant system. This is relevant for the recovery of oil when using a new hybrid enhanced oil recovery (EOR) method, which combines smart-water (i.e., ionically modified brine) and foam-flooding (SWAF) of light oil with dissolved carbon dioxide (CO 2 ) at high pressure in carbonate (i.e., calcite) reservoirs. Using this new hybrid EOR-method (i.e., the SWAF-process) is not only economically attractive (i.e., it reduces opex costs) but also enhances the effectiveness of the production process, and thus reduces the environmental impact. Ionically modified brine (i.e., low-salinity) has a dual improvement effect. It not only leads to more stable foam lamellae, but also helps to change the carbonate rock wettability, leading for some conditions to more favorable relative permeability behavior. The mechanism for the modified permeability behavior in the presence of ionically modified brine is only partly understood. Therefore, we study this process initially in a zero dimensional (thermodynamics) setting, which can be used for the one dimensional (1D) displacement process with an oleic phase that contains carbon dioxide (CO 2 ) and an aqueous phase that contains both carbon dioxide (CO 2 ) and all the ionic substances. Using DLVO theory and surface complexation modeling to better understand the mechanism(s) of ionically modified brine as wettability modifier and foam stabilizer. We perform simulations using both (NaCl) and (MgCl 2 ) to show the effect of a divalent ion at the high-salinity (8500 mmol/kg-w) and low-salinity (0.4 mmol/kg-w) for both ambient-conditions at (25 � C) and at the reservoir-conditions (80 � C). We confine our analysis to a description that uses the Dzombak-Morel model of surface complexes, which is based on the Debye-Hückel theory (i.e., valid up to ionic strength of 0.3 (mol/ kilogram of water)). We also investigate the effect of carbon dioxide (CO 2 ) on the stability of low-salinity foamlaminae. We model the foam-laminae, which contain as surface complex a (cationic) surfactant in an aqueous phase. We use the PHREEQC-software to calculate the surface charge and the surface potential. The presence of a carbon dioxide (CO 2 ) phase leads to dissolution of four valent C(IV) compounds in the aqueous film. PHREEQC also calculates the equilibrium concentrations and surface potential and allows the study of the effect of salinity and the carbon dioxide (CO 2 ) gas pressure. For the soap-film (foam-film) in a carbon dioxide (CO 2 ) atmosphere we do use Pitzer activity coefficients (i.e., valid up to 6 (mol/kilogram of water)). As our aim is to show the methodology and the versatility of this approach, we leave more realistic choices of these parameters for future work.sFor the conditions considered we can qualitatively state that, in the presence of (NaCl i.e., at pH > 10) and (MgCl 2 i.e., pH > 10.3), the low-salinity case shows a more stable water-film behavior at (25 � C) and at (80 � C) than the high-salinity case for both (25 � C) and (80 � C). Moreover, high carbon dioxide (CO 2 ) pressures have a destabilizing effect on the film, as they reduce the surface potential. A reduced surface potential leads to a decreasing electrostatic double layer repulsion and thus destabilizes the foam-film, whereas low-salinity leads to less screening of the surface potential and thus improves the stability of the foam-film. The low-salinity flow is characterized by a high residual oil saturation and low end-point permeability for the two phase oil-water flow. This leads to a more favorable mobility ratio and thus a more favorable displacement process. For the calcite surface an enhanced stability helps to stabilize the water film on the calcite surface if the oil-water surface charge has the same sign as the surface charge on the calcite surface. Our calculations show the pH range where the sign of these charges is the same or opposite at low-salinity and high-salinity conditions. Admittedly these calculations only show trends, but can be used to delineate optimal conditions for the application of "Smart Water

Introduction
In view of the increasing demand of energy in the world and of depleting oil and gas resources, it is important to increase the production from existing reservoirs (since the fossil fuel is and remains the primary contributor to meet the global energy demand) by introducing new technologies for enhanced oil recovery (EOR) (Lakeet al., 1989;Lake, 2003;Firoozabadiet al., 2000;Hassan et al., 2019a;Hassan et al., 2017). Enhanced oil recovery can improve (1) the displacement efficiency, (2) reduce the amount of oil left behind (residual oil saturation) and (3) improve the vertical and horizontal sweep efficiency (Sheng, 2013;Lake et al., 2002Lake et al., , 2014Hassan et al., 2019b). An improved displacement efficiency corresponds to a steeper displacement front with a large saturation jump. This work introduces a new hybrid enhanced oil recovery method to improve the recovery from all of these three mechanisms by combination of Water Assisted Foam (SWAF) Flooding in carbonate (i.e., calcite) reservoirs. Using this novel hybrid EOR-method (i.e., the SWAF-process) is not only economically attractive but also improves the effectiveness of the production process, and thus reduces the environmental impact (Hassan et al., 2017;Govind et al., 2008;Gupta Gittinset al., 2007). SWAF-process has a multiple improvement effect, it changes the rock wettability, reduces the interfacial tension (IFT), and enhances the stability of the foam lamellae.The mechanism by which oil is mobilized in the presence of smart water (i.e., brine with a modified ionic composition NaCl and MgCl 2 ) is not yet understood (Morrow and Buckley, 2006). In this work, we focus on the study of surface complexes modeling in the calcite-water/brine-surfactant system to provide more fundamental insights to understand the prevailing mechanisms. Improved understanding of the mechanisms is also expected to improve our predictive capability for the choice of the optimum conditions that SWAF enhances both the foam and water film stability. We study this process initially in a zero dimensional (thermodynamics) setting, which is relevant for the one dimensional (1D) displacement process (see Fig. 1) with an oleic phase that contains carbon dioxide (CO 2 ) and an aqueous phase that contains both carbon dioxide (CO 2 ) and all the ionic substances.
We use the DLVO theory (Hunter, 1993;Overbeek, 1971), and surface complexation modeling (J Appelo and Postma, 2005;Werner and James, 2012), to better understand the mechanism(s) of ionically modified brine as wettability modifier and foam stabilizer. The consequences of our new insights for field implementation will help to find optimal conditions for combined smart water assisted foam flooding or SWAF. In case of the SWAF-process the low-salinity water with an optimal electrolyte concentration and a cationic surfactant (e.g., CTAB) is injected as a displacement agent. The optimal conditions will be obtained by using the modeling capabilities of the PHREEQC software (J Appelo and Postma, 1994;Parkhurst and Appelo, 2013a;Parkhurst and Appelo, 2013b), regarding the surface complexes in calcite rock. By assuming chemical equilibrium we can define the behavior of all dissolved compounds for future use in a limited number of transport equations of master species. Certainly, from the concentration of master species, the chemical equilibrium determines the concentration of ions and molecules dissolved in water inclusive carbon dioxide (CO 2 ), which is the only substance that exists in both phases. Active sites on oil and calcite are in chemical equilibrium with the ions in the solution to produce surface complexes of which the surface concentrations can also be determined (J Appelo and Postma, 2005;Klebanov et al., 2001;Van Cappellen et al., 1993). The concentrations of the surface complexes determines the charge on the calcite and the oil surfaces (George Zhanget al., 2004). If the charges on the surfaces have the opposite sign, they attract each other and the water film will be squeezed out. On the other hand, when they have same sign, they repel each other and allow a water film to be formed in between (George Zhanget al., 2004). A system where the water film is squeezed out can be expected to be oil-wet; A system with water films can be expected to be water-wet (Buckley et al., 1995;Hirasakiet al., 1991;Morrowet al., 1990). The wetting properties determine both the behavior of the capillary pressure and relative permeabilities. The stability of the water film is thus both of fundamental and practical interest, i.e., see Fig. 2. We investigate the effect of carbon dioxide (CO 2 ) on the stability of low-salinity foam laminae. We model the foam laminae as a surface complex of the surfactant in an aqueous phase. This makes it possible to obtain the surface charge and the surface potential (Appelo, 2015). The presence of a carbon dioxide (CO 2 ) phase leads to dissolution of C(IV) compounds in the aqueous film. We use PHREEQC (J Appelo and Postma, 2005) to obtain the equilibrium concentrations and surface potential and to study the effect of salinity and carbon dioxide (CO 2 ) gas pressure. For the surface complexation model, we use the model of Dzombak and Morel (1990), which uses Debye H uckel activity coefficients (valid at ionic strengths up to I ¼ 0:3 mol/kilogram of water). We also examine the effect of using Pitzer activity Fig. 1. Low and high salinity (i.e., NaCl and MgCl 2 ) carbonated water/surfactant injection (e.g., surfactant aqueous solution or SAS) model using PHREEQC software at 25 � C and 80 � C).
coefficients (Pitzer, 1975(Pitzer, , 1987Pitzer et al., 1977;Pitzer and Silvester, 1976;PitzerJanice, 1974;Pitzer and Mayorga, 1973), which extends the validity range to 6 mol/kg of water. We apply the DLVO theory, which considers double layer repulsion, van der Waals attraction, and Born repulsion. The derivative versus the layer thickness determines the disjoining pressure. The film becomes unstable when the capillary pressure exceeds the disjoining pressure. We notice that our calculations are only approximate, as for instance the Hamaker constant (Hunter, 1993), which determines the van der Waals interaction is only known by its order of magnitude (H ¼ 10 À 20 to 10 À 21 ) J/m (Hunter, 1993;George Zhanget al., 2004;Ridley et al., 2009). Qualitatively we can state that high carbon dioxide (CO 2 ) pressures have a destabilizing effect on the film, as they make the surface potential less negative. The activity coefficients are more accurately given by the Pitzer coefficients above 0.3 [mol/kilogram of water] (Davies, 1938).

DLVO theory
The DLVO theory is named after Derjaguin, Landau, Verwey, and Overbeek. It is the explanation of the stability of colloidal suspensions, quantitatively describing the balance between two forces between charged surfaces in a porous media, i.e., electrostatic repulsion and van der Waals attraction (in our geometric structure, with a high dielectric coefficient of the water film squeezed between two layers of lower dielectric coefficient it is an attraction). (Deraguin and Landau, 1941;Verwey et al., 1948). Our goal is to study the aqueous foam film, which can be modeled in the context of DLVO theory, considering that only two forces dominate interactions between charged surfaces: the van der Waals (vdW) attractive and the Electrostatic Double Layer (EDL) repulsion forces (Hotze et al., 2010), i.e., see Fig. 3. There we apply the DLVO theory to the liquid film, which is enclosed by carbon dioxide (CO 2 ) layers at pressure (P). As surfactant molecule, by way of example a carboxylic acid (R-COOH), where the head of the surfactant molecule penetrates into the liquid, and the aliphatic tail is located in the carbon dioxide layer. The aqueous solution constituting the film, contains a given concentration of a sodium chloride solution in equilibrium with carbon dioxide (CO 2 ) in the gas phase. We will assume that the carboxylic acid behaves as a surface complex (< RCOOH), which can dissociate into the carboxylic acid anion and an H þ ion. We denote the negative logarithm of the equilibrium constant K a ¼ aðRCOO À ÞaðH þ Þ aðRCOOHÞ (1) by À log 10 K a ¼ pK a ¼ 5. The disjoining pressure (Π) can be decomposed into two parts, viz., the van der Waals attraction (Π vdW ), and the electrostatic repulsion (Π el ) (Parkhurst and Appelo, 2013b;Appelo et al., 2002;Zeng et al., 2016), as shown in the equation below

van der Waals forces
Following (Overbeek, 1971) the van der Waals interaction energy is calculated from the Hamaker constant A and the film thickness h as ω vdW ðhÞ ¼ À ðA = 12πÞh À 2 : (3) The Hamaker constant for material 1 (gas) separated by the film of material 2 (water with surfactant) can be approximated by (i.e., see (Hirasakiet al., 1991) and   GambaJoseph et al., 1992). The diagram comprises distinct regions containing (A) water molecules and counter-ions, (B) chain head-groups, (C) hydrocarbon tails; the hydrocarbon tails are "dissolved" or "protrude" in the outside gaseous phase, which can be (CO 2 ) or nitrogen (N 2 ), and (D) gaseous boundaries, which can be composed of more or less carbon dioxide (CO 2 ) or nitrogen (N 2 ).
The material parameters are: ε i , the zero frequency dielectric constant, n i is the refractive index in the visible part of the spectrum, ν e is the ionic absorption or ionization frequency, T is the absolute temperature, k and P are the Boltzmann and Planck constant respectively.

Electrostatic double layer
Following (Hirasakiet al., 1991) the electrostatic specific interaction potential can be expressed as function of the film thickness by the following equation and also by where Φ eo is the surface electrical potential of each surface and h D ¼ κh is a dimensionless film length. In our case F Φ ¼ 1 as the surfaces are both separating water and gas phases. The dimensionless distance is h D ¼ κh, where the inverse Debye-H uckel length is The sum adds the molecules in the equation as we sum over the total number of molecules.
For the double layer interaction potential we obtain: Adding equations Eq. (3) and Eq. (10) we obtain the total specific interaction potential The total disjoining pressure can be recovered from the total specific interaction potential by taking the derivative, i.e., Π À Π equil ¼ d h ω tot ðhÞ: (12) Remark: n g is the refractive index of gas ( ffi ffi ffi ffi ε g p at optical frequency) (see Fig. 4).

Model description
We must relate the concentrations of the surface complexes, such as carboxylic acids (R À COOH), amine (R À NH 2 ), and other complexes involving surface sites that combine with compounds in the solution to the ions present in the bulk. Indeed, the ions will be transported by the water phase and also react with the rock or are adsorbed at the oil-water interface. The rock surface and the oil contains adsorption sites on to which anions and cations can be adsorbed. We follow Brady (Brady and KrumhanslPaul, 2012) and consider the following four surface master species, oil s;NH þ , oil w;COOH , Cal s;OH , Cal w;CO3H for respectively κ ¼ 1; 2; 3; 4. We use it only for subscripts of the equilibrium constant. The subscripts w; s are derived from the model for hydroferrous oxide by Dzombak and Morel (1990), where w stands for weak and the subscript s stands for strong to distinguish two type of binding sites. For the two number of surface sites of oil one type may receive carboxylic acid (R À COOH) based radicals, termed weak sites, and one type of surface sites may receive amine (R À NH 2 ) based, termed strong. In the same way, the two types of surface (complexes) sites of calcite ðCaCO 3 Þ we have sites that receive calcium (Ca) based radicals, which we label as strong, and sites that the receive carbonate (CaCO 3 ) based radicals, which we label as weak. The notation of weak ðwÞ and strong ðsÞ surface sites have no other purpose than labeling two types of adsorption sites. The surface species are oil s;NH þ , oil w;COOH , Cal s;OH , Cal w;CO3H , oil s;N , oil w;COO À , oil w;COOCa þ , oil w;COOMg þ , Cal s;OH þ 2 , Cal s;CO À 3 , Cal w;CO À 3 , Cal w;CO3Ca þ , Cal w;CO3Mg þ . The following species can be adsorbed, viz., (H þ , Ca 2þ , and HCO À 3 ) labeled respectively (j ¼ 1; 2; 3). The sorbent reactions are attained from Brady models (Brady and KrumhanslPaul, 2012;Patrick et al., 1996;Bradley and Pitzer, 1979;Patrick and Thyne, 2016). Brady et al. (Brady and KrumhanslPaul, 2012), uses 1.67 μmol=m 2 for both À NH and À COO sites on oil and 4.1 μmol=m 2 for both C and Ca sites on calcite. Moreover Brady uses the surface area of oil and calcite both as 1 m 2 =g. Oil can adsorb 1.67 μmol=g-oil of amines (R À NH 2 ) based and carboxylic (R À COOH) based radicals each. Calcite can adsorb 4.1 μmol=g-CaCO 3 strong and 4.1 μmol=g-CaCO 3 weak surface complexes. The density of calcite is 2710 kg=m 3 and therefore calcite can adsorb ð1 À ϕÞ 2710 � 4:1 ¼ 1:1 � 10 À 2 ð1 À ϕÞ mol=m 3 calcite complexes. The density of oil is about 800 kg=m 3 ; and can adsorb 1:3 � 10 À 3 ϕS o mol=m 3 carboxylic based and amines based radicals. For the purpose of this calculation, we choose ϕ ¼ 19% (i.e., Indiana-limestone rock with 93% calcite or CaCO 3 ). For further information on surface complexes we refer to (Van Cappellen et al., 1993). The values of the equilibrium coefficients and the enthalpy of the reactions are taken from the data base provided with PHREEQC (i.e., data-base phreeqc.dat & pitzer.dat) (J Appelo and Postma, 2005;Parkhurst and Appelo, 2013a;Parkhurst and Appelo, 2013b). Table 1 summarizes relevant properties of the surface complexes (i.e., the sorbent reaction and the log 10 base equilibrium constants), where K i;κ are the equilibrium coefficients (Brady and KrumhanslPaul, 2012) and all dissolved activities are expressed as [mol/kg-water]. The reference activity is the activity of a solution containing a molality of 1 mol/kg-water if such a solution would behave ideally. Moreover, a minus sign in the subscript of K indicates that the species is desorbed. The adsorbed ions are indicated by ð1; 2; 3Þ ¼ ðH þ ; Ca 2þ ; HCO À 3 Þ. The total number (i.e., molality) of surface sites for each adsorption process, combining filled and empty adsorption sites is indicated by ðoil s;NH þ Þ tot , ðoil w;COOH Þ tot ; ðCal s;OH þ Þ tot and ðCal w;HCO þ 3 Þ tot . In terms of the molar fraction of active sites: x Calw indicate the mole-fraction of oil that contain strong sites and weak sites and the mole-fractions calcite that contain strong and weak sites. These mole-fractions are constant. In addition we give the characteristic surface area for sites of a certain type A oils ; A oilw , A Cals , A Calw ; which are expressed as surface area per gram of oil or calcite. Finally we give the molal concentration, i.e., moles of the adsorbent ðOil or CaCO 3 Þ per kg of water. Oil contains a certain concentration of amines and a certain concentration of carboxylic acids. We arbitrarily choose one of the surface complexes as master surface complex. The other surface complexes can be related to the master surface complex. For instance we can convert oil w;COOH to oil w;COOCa þ or oil w;COO À . In the same way, oil s;NH þ can be converted to oil s,N . The total concentration in [mol/kilogram of water-oil] of both "strong"-sites and "weak"-sites is considered constant. Furthermore, we can convert Cal s;OH → Cal s;OH þ 2 → Cal s;CO À 3 and Cal w;CO3H →Cal w;CO À 3 →Cal w;CO3Ca þ . The total concentration in [mol/kilogram of water-calcite] of both "strong"-sites and "weak"-sites is considered constant.

Surface complexation parameters
When we add water, CaCO 3 , oil (i.e., carboxylic acids and amines), and (NaCl or MgCl 2 ), we follow Parkhurst and Appelo (J Appelo and Postma, 2005;Parkhurst and Appelo, 2013a;Parkhurst and Wissmeier, 2015) in assuming that in the aqueous and oleic phase the surface complexes species are formed with the sorbent reaction given in Table 1. We have divided the description into two sub-problems, viz., the stability of the foam-film, which is bounded by a gas phase being either nitrogen (N 2 ) or carbon dioxide (CO 2 ) and the surfactant layer. The calcite-brine (water)-oil interface, i.e., the stability of the aqueous-film between the calcite and the oil layer (i.e., see Fig. 2) plays an important part in the relative permeability behavior. The stability of the foam-film is governed by the effect of the van der Waals attraction forces and the double layer repulsion forces. The stability is enhanced if the repulsive double layer forces dominate. We have added in Fig. 3 the gaseous boundaries, which can be composed of more or less carbon dioxide (CO 2 ) or nitrogen (N 2 ). The carbon dioxide (CO 2 ) influences the composition of the foam-film and thus enables to quantify the behavior of the foam-film in a carbon dioxide (CO 2 ) atmosphere. For the calcite-water-oil interface, we apply PHREEQC to determine the composition on the calcite-brine surface and the oil-brine surface. PHREEQC allows to study the effect at various compositions. We also performed simulations using (MgCl 2 ) instead of (NaCl) to show the effect of a divalent ion at ambient (25 � C) and reservoir (80 � C) conditions (i.e., see Fig. 1). As our aim is to show the methodology and the versatility of this approach, we have refrained from choosing specific conditions and arbitrarily assumed the (semi-identical) amounts of carboxylic acids (R À COOH) and amine (R À NH 2 ) in the absence of further data. We ignore the presence of the hydration water-layer, which describes the intermediate-wet situation (i.e., Hirasaki, Fig. 12) (Hirasakiet al., 1991)). For increasing capillary pressure, the water-film thickness decreases and if the water-film becomes sufficiently thin a hydration layer is formed and the system can become intermediate-wet (Israelachvili, 2015); this is however outside the scope of our present paper; and we only distinguish between a stable water film (between water-wet) and non-stable water film (oil-wet). The surface complex composition determines the charge on these interfaces, which can be computed from total charge of its surface complex components. If the charge on the calcite-brine interface has the same sign as the charge on the brine-oil interface, then the water-film is considered stable. The idea that, a system that contains two interfaces of which the charge has the same sign is water wet was put forward in the paper by Hirasaki (1995) (George Zhanget al., 2004;Hirasakiet al., 1991;Hirasaki Lawsonet al., 1985). The surface complex composition also depends on parameters that characterize the surface on which the surface complexes adhere. We adopt the approach that is given in PHREEQC (and Appelo), which describes the interaction between the substrate and the surface complex. In PHREEQC, there are three independent parameters that describe the amounts of surface active sites (i.e., complexes), namely the fraction of active sites, the specific surface area (i.e., m 2 =g), and the amount of surface complexes per kg of water (i.e., mol=kg À water) (Parkhurst and Appelo, 2013a;Appelo, 2015;Parkhurst and Wissmeier, 2015;J Appelo and Postma, 2004;Appelo et al., 1999). With these parameters, we can calculate the amount of the various compounds per unit surface area (i. e., surface concentration) on the surface complexes. Knowing the charges of these compounds, we can also calculate the charge per unit area and thus the surface charge (Dzombak and Morel, 1990;Appelo, 1977). There is a lack of data on surface active complexes for various conditions and situations. Therefore, we use an estimate of the PHREEQC-input parameter(s). Based on (1) we assume arbitrary values for the fraction of "strong" and "weak" active sites (2) for other cases we infer the value of the input parameter(s) from the kilogram of waterature (i.e., the values of these parameters are inferred from the article by Brady et al. (Brady and KrumhanslPaul, 2012),) such that an example calculation is possible. First we assign the "strong" and "weak" active sites. We explain here the characteristics of surface complexes following the PHREEQC-manual (Parkhurst and Appelo, 2013a); the number of weak sites are larger than the number of strong sites. Analogously, we also used the same ratio between the strong and the weak active sites for the oil and calcite. For the oil, we assume the "strong" active sites that bind amines-based (R À NH 2 ) surface complexes and the "weak" active sites that bind the carboxylic acids-based (R À COOH) surface complex are (1:67 � 10 À 6 ) and (1:67 � 10 À 5 ) respectively. In the same way, for calcite ðCaCO 3 Þ, we assume the "strong" active sites that bind calcium-based (Ca) surface complex, and the "weak" active sites that bind the carbonate-based (CaCO 3 ) surface complex are (4:1 � 10 À 6 ) and (4:1 � 10 À 5 ) respectively. Following the papers of Brady (i.e., and co-authors), we assume a surface area of 1 square meter per gram (m 2 =g) for both the oleic and calcite interface (Brady and KrumhanslPaul, 2012). The last quantity that characterizes the behavior of the surface complexes is the mass of substrate per (kg-water). Considering calcium carbonate as porous medium with a porosity of (19%) (i.e., Indiana-limestone CaCO 3 ), we can calculate the fraction of calcium carbonate per kilogram-water and the fraction of oil per kilogram-water. Moreover, we attribute a constant number of weak and strong surface sites to (CaCO 3 ; ) and also to oil. As oil is a liquid this is an approximation, but adopted in many papers (Brady and KrumhanslPaul, 2012;Dubey and Doe, 1993). The water and oil relative permeability depend on the wettability. The change of permeability is caused by the low salinity brine to a more water-wet behavior; this improves the mobility ratio and thus production rates; this practically increases the oil recovery (Morrow Buckleyet al., 2011). In addition, we consider a soap-film (i.e., foam-film) of (10 À 3 m) (Overbeek, 1971(Overbeek, , 1990 and an area of (1 m 2 ) (i.e., without loss of generality). Such a film has a volume of (10 À 3 m 3 ) and thus a mass of (10 À 3 kg) considering the density of water of 10 3 (kg=m 3 ). Therefore the specific surface area is 10 À 3 (m 2 =g). The site density of water can be estimated using reference (Athanasios and Dzombak, 2011) by where d is the average distance between the molecules, the "2 00 is the coefficient in Eq. (13), which describes that the two faces of the surface (top and bottom) are taken into account, (n) is the number of soap molecules per site, and (V) is the volume per soap molecule. The number of soap molecules can be estimated by its concentration (i.e., see Overbeek (1971Overbeek ( , 1990).

Chemical degrees of freedom
We apply Gibbs rule to determine the number of chemical degrees of freedom. Gibbs phase rule states (Broder et al., 2005) that the number of degrees of freedom is given by where N f is the number of degrees of freedom, N S is the number of surface species, N s is the number of different chemical species, N r is the number of possible equilibrium reactions in the aqueous phase, N R is the number of surface reactions, N c is the number of constraints, e.g., the charge balance. We call the charge balance a constraint as opposed to a mass balance equation, which involves convection, diffusion, and accumulation terms; it is an algebraic equation satisfied everywhere. p the number of phases, and the number 2 represents the temperature and pressure (i.e.e, T, and P Moreover there is an alkane ðAÞ with concentration c o;A in the oleic phase. The alkane occurs in the oleic phase only, whereas all the other components occur only in the aqueous phase except for carbon dioxide (CO 2 ) and CaCO 3 . Carbon dioxide (CO 2 ) occurs both in the oil phase with concentration c o;CO2 and in the aqueous phase with concentration c a;CO2 . Calcium carbonate occurs both in the solid phase with concentration c r;CaCO3 and in the aqueous phase with concentration c a;CaCO3 .

Dzombak and Morel model of surface complexation
A model was proposed by Dzombak and Morel to describe the behavior of charged surface complexes (Dzombak and Morel, 1990). It requires three parameters, i.e., the mole fraction of sites ω of a sorbent that is available to the surface complex, the specific surface area A in [m 2 /g-sorbent] and the molar weight of the sorbent [g/mole-sorbent]. The total concentration of surface sites e.g., ðoil s;NH þ Þ tot ; is given by the molar concentration of the sorbent (e.g. for oil ρ o ) multiplied by ω: The surface charge σ can be calculated by Eq. (15). The charged surface contains a layer of fixed adsorbed cations and anions and then a diffuse layer of ions, predominantly cations (the Gouy-Chapman diffuse double layer). The domain of fixed ions has a constant charge density σ and potential and the Gouy-Chapman diffuse layer with charge density σ d . The charge density σ d is due to the mobile ions in the solution. Due to the charge of the surface there is a dominance of oppositely charged species near the surface, i.e., in a domain of several nano-meters from the surface. The total charge density σ þ σ d ¼ 0 follows from electron neutrality. In the Gouy-Chapman layer, the potential decreases exponentially.
The charge density in the domain of fixed ions is given by where F is the Faraday constant F ¼ 96485:34 ½C=mole�, A is the specific surface area ½m 2 =g�, and S is the solid concentration ½g=L�. Furthermore m s and v s are the molar concentrations and charges of the surface species s. According to the Gouy-Chapman theory for a symmetrical electrolyte, the relation between the charge density and potential For asymmetric electrolytes we obtain Eq. (15), (Flanaga, 2008;Allen and Faulkner, 1980;Aveyard and Haydon, 1973;Duncan and Costello, 1993).
ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffiffi where S bulk;j is the concentration [mol/kilogram of water] of ion species i in the bulk, ε 0 is the electrical permittivity of free space ð8:85419x10 À 12 C 2 N À 1 m À 1 ), ε r is the relative electrical permittivity (dielectric constant) of the aqueous phase, R is the gas constant (8.314 J/ K/mol), T is the absolute temperature, F is the Faraday constant (86400 C/mol) and sign(ψ o ) is the sign of ψ o , i.e., þ1 or À 1. Moreover z i is the charge of the ion. For a symmetric electrolyte the expression reduces to σ ¼ À ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi where the equal sign is valid at (25 � C). Here m denotes total the molality of the electrolyte. For all surface reactions the free energy is the sum of the intrinsic free energy ΔG 0 intrinsic and the Coulombic free energy ΔG 0 and recalling (Smith, 2001) that the equilibrium constant is given by where ΔZ is the change in charge number of the surface species. Furthermore ΔG 0 Coulombic is the electrostatic work to transport the species through the interfacial potential gradient. K int is the equilibrium constant when only the chemical bond is taken into account. The value of ΔZ ¼ À 1 in Table 1 in which the surface complex looses a charge or where ΔZ ¼ 1 where the surface complex gains a charge. Clearly if the surface is positively charged adding a positive ion will decrease the apparent equilibrium constant. A procedure for the calculation of the apparent equilibrium constants K app can be as follows. Start to use Eqs. in Table 1 Table 1 Surface complexes species: The sorbent reaction and the log 10 base equilibrium constants (Brady and KrumhanslPaul, 2012 A.M. Hassan et al. until convergence is obtained. We will not explicitly use it, but these ideas have already been implemented in PHREEQC (Parkhurst and Appelo, 2013b) (see Table 2).

Surface complexation modeling using PHREEQC
Desorption sorption can be modeled using surface complexation reactions provided by PHREEQC software. PHREEQC is a general geochemical aqueous equilibrium program written in the C and Cþþ programming languages that is relevant to perform a extensive surface complexation calculations. In surface complexation model, the reaction is a function of chemical and electrostatic energy as described by the following free energy equation (Werner and James, 2012;Parkhurst and Appelo, 2013b;Dzombak and Morel, 1990): where ΔG tot is the Gibbs energy ½J=mol�, z is the charge number (i.e., unitless [-]) of the reacting species, F is the Faraday constant (96,485 C= mol), ψ is the potential in volts [V], and subscript "tot" and "reac" indicate total and reaction energy, respectively. The equilibrium constant is given by and thus depends both on the reaction energy and electrostatic contributions. Eq. (20) makes it possible to incorporate electrostatic effects in the equilibrium constants. Sorption is stronger when the Gibbs energy decreases. Thus, a counter-ion that carries a charge opposite to the surface charge tends to be sorbed electrostatically, while co-ion that carries a charge with a same sign as the surface tends to be rejected (Werner and James, 2012;Parkhurst and Appelo, 2013b;J Appelo and Postma, 2004;Appelo et al., 2010). We apply Gibbs rule to determine the number of chemical degrees of freedom (i.e., see Eq. (14)) (Broder et al., 2005). We use Dzombak and Morel (i.e., see Eq. (15), Eq. (16), and Eq. (17)) (Dzombak and Morel, 1990) to describe surface complexes. Dzombak and Morel model uses the Gouy-Chapman equation to relate surface charge and potential (Werner and James, 2012;Bolt, 1955) In addition, PHREEQC allows the concentration of surface complexes of the lammella surface to be adjusted to achieve equilibrium. The program PHREEQC gives us the concentrations of surface complexes of the lammella surface. However these quantities are given by default in [moles]/[kg H 2 O]. In order to use this data in equation Eq. (9) we use where N A ¼ 6:022 � 10 23 [molecule/mol] is the Avogadro number and ρ H2O ¼ 10 3 [kg/m 3 ] is the water density. Another result from PHREEQC is the surface charge given in [C/m 2 ]. In order to use these data in equation Eq. (9) we need to adapt it to obtain surface electrical potential. The relation between surface charge σ and surface potential is expressed by the Grahame equation, which states that the total charge of the double layer must be equal to minus the surface charge. In order to derive the simple relation one uses the one-dimensional Poisson equation, which assumes that at an infinitely great distance the potential gradient is equal to 0 and considers only the main term in hyperbolic sinus expansion obtaining where σ [C/m 2 ] is the electric surface charge, ε 0 [C 2 /(J m)] is the permittivity of free space, ε w [-] is the relative permittivity of water, λ D [m] is the Debye length (inverse of κ) and Φ eo [J/C] is the surface electrical potential. Thus for each value of σ we calculate Φ eo .

Results and discussions
In all calculations below we assume that the "strong" active sites, at which the amines-based (R À NH 2 ) surface complex is bound and the "weak" active sites, at which the carboxylic acid-based (R À COOH) surface complex for oil is bound contains 1:67 � 10 À 6 ðmol =m 2 Þ and 1:67 � 10 À 5 ðmol =m 2 Þ respectively. For calcite ðCaCO 3 Þ, we assume the "strong" active sites that bind calcium-based (Ca) surface complex, and the "weak" active sites that bind the carbonate-based (CaCO 3 ) surface complex in are 4:1 � 10 À 6 ðmol =m 2 Þ and 4:1 � 10 À 5 ðmol =m 2 Þ respectively. The surface area of the oil-water interface available for oil (i.e., amines and carboxylic acids) and the surface area available for calcite complexes is 1 (m 2 =g) (Brady and KrumhanslPaul, 2012). Furthermore, the concentration (i.e., molality) of the high-salinity case is 8500 (mmol/kg-water), and the concentration of the low-salinity case is 0.4 (mmol/kg-water). For describing the water-film between oil and calcite, we use the Debye Hückel activity coefficients (i.e., valid up to ionic strength of 0.3 (mol/kilogram of water)). For the soap-film (foam-film) in a carbon dioxide (CO 2 ) atmosphere we do use Pitzer activity coefficients (i.e., valid up to 6 (mol/kilogram of water)). As our aim is to show the methodology and the versatility of this approach, we leave more realistic choices of these parameters for future work. Fig. 5 illustrates the surface complexes ( mol=m 2 ) and the potential (mVolts) as a function of the pH at high-salinity and (25 � C). Fig. 5 shows the moles of surface complex per square meter of surface area (mol=m 2 ) at a salt concentration (NaCl) of 8500 mmol per kilogram of water (mmol=kg À w). The surface complexes considered between oil and amine is denoted by (Oil s NH þ ). The subindex ( s ) shows that the binding is strong. (Oil s N) is the surface complex where a hydrogen ion has split of the amines group. The surface complex (Oil w COOH) is a surface complex where the carboxylic group has been attached to oil. The subindex ( w ) shows that it is a weak surface complex. The surface complex (Oil w COOH) can dissociate into the surface complex (Oil w COO À ) and an hydrogen ion. The surface complex can react with (Ca 2þ ) to form the surface complex (Oil w COOCa þ ). On the other hand, the surface complexes on the calcite surface are denoted as (Ca s ) and (Ca w ) to denote the strong and weak surface complexes on the (CaCO 3 ) surface. (Ca s OH) denotes a strong surface complex with the (OH) radical. This compound can react with (H þ ) to form the (Ca s OH 2þ ) complex. There is a weak surface complex of (Ca w ) with carbonic acid, denoted as (Ca w CO 3 H), and a weak and a strong surface complex respectively with (Ca w , Ca s ) with the carbonate ion (Ca w CO À 3 ) and (Ca s CO À 3 ). Finally the surface complex (Ca w CO À 3 ) can react with calcium (Ca 2þ ) to form the surface complex (Ca w CO 3 Ca þ ). The equilibrium constants in Table 1 of the surface species can be used to calculate the surface concentrations. It turns out that all concentrations are determined by the pH, i.e., see Eq. (14), which show that there are only two degrees of freedom, e.g., the pH and the ionic strength.
Multiplying the concentrations with the charge of the ions allows to determine the surface charge (σ) (i.e., see Eq. (15) and Eq. (16)). Then we can apply Eq. (17) to determine the surface potential.Moreover, Fig. 5a shows the concentration surface complexes (i.e., mol= m 2 ) characterized by an initial increase and then a decrease. The concentrations range over eight decades. Moreover, it shows that the surface complex (oil s NH þ ) is the main contributor to the positive charge of the oil-water interface, whereas surface complex (Ca s OH 2þ ) is the main contributor to the positive charge of calcite-water interface. On the other hand, the surface complex (oil w COO À ) is the main contributor to the negative charge of the oil-water interface, whereas surface complex (Ca w CO 3 À ) is the main contributor(s) to the negative charge of calcite-water interface. As the pH increases the concentration of the surface complex (oil s NH þ ) decreases until it intersects at pH ¼ 7 with the negative concentration of the surface complex (Oil w COO À ) (i.e., the main contributor to the negative charge), and beyond this pH the oil-water interface starts to be negatively charged. The calcite-water interface remains positively charged until the pH ¼ 12. Fig. 5b shows the surface potential (mVolts) as function of the pH at salt concentration (NaCl) of 8500 mmol per kilogram of water (mmol=kg À w). At low pH (i. e., pH < 7), the oil-water interface and the calcite-water interface are characterized by a negative potential and thus attract each other and it leads to unstable water-film. When the pH exceeds 7 (i.e., pH > 7), the oil-water interface and calcite-water interface have a positive and negative potential respectively, and thus attract each other, and the water-film collapses. Fig. 6 illustrates the concentration of the surface complex ( mol=m 2 ) and the potential (mVolts) as a function of the pH at the given salt concentration (i.e., NaCl of 8500 mmol per kilogram of water mmol=kg À w) as Fig. 5, but now at reservoir-conditions (i.e., 80 � C). Fig. 6a shows the moles of surface complex per square meter of surface area (mol=m 2 ) at high-salinity and (80 � C). In the same way as Fig. 5a, Fig. 6a shows that the complex (oil s NH þ ) is the main contributor to the positive charge of the oil-water interface, whereas (Ca s OH 2þ ) is the main contributor to the positive charge of calcite-water interface. On the other hand, the surface complex (oil w COO À ) is the main contributor to the negative charge of the oil-water interface, whereas the surface complex (Ca w CO 3 À ) is the main contributor(s) to the negative charge of calcite-water interface. Furthermore, Fig. 6b shows similar behaviour as at (25 � C) (i.e., see Fig. 5b). At low pH (i.e., pH < 7) the calcite-water interface and the oil-water interface are characterized by a positive potential and therefore, these surfaces repel each other and this leads to  Fig. 6. Surface complexes and potential of NaCl (i.e.,high-salinity case) at (80 � C).
A.M. Hassan et al. a stable water-film. However, the temperature (i.e., 80 � C) effect makes the surface potential of calcite-water interface more positive, while the surface potential of the oil-water interface remains more or less the same as obtained for (25 � C). At (pH > 7), the calcite-water interface and oil-water interface are characterized by a positive and negative potential respectively, and the water-film collapses. Fig. 7 illustrates the concentration of the surface complexes and the potential as a function of the pH at low-salinity (i.e., NaCl of 0.4 mmol per kilogram water mmol=kg À w) and (25 � C). Fig. 7a shows the surface concentrations (i.e., complexes) characterized by an initial increase and then a decrease. The concentrations range over eight decades. Moreover, it shows that the surface complex (oil s NH þ ) is the main contributor to the positive charge of the oil-water interface, whereas the surface complex (Ca s OH 2þ ) is the main contributor to the positive charge of the calcite-water interface. On the other hand, the surface complex (oilw COO À ) is the main contributor to the negative charge of the oil-water interface, whereas the surface complex (Ca w CO 3 À ) (i.e., supported by the surface complex (Ca s CO 3 À )) is the main contributor(s) to the negative charge of the calcite-water interface. As the pH increases the concentration of the surface complex (oil s NH þ ) decreases until it intersects (i.e., at pH ¼ 7) with the negative concentration of the surface complex (Oil w COO À ), and the oil-water interface starts to be negatively charged. Whereas, the calcite-water interface remains positively charged until the pH exceeds 10 (pH > 10) (i.e., at the point where the (Ca s OH2 þ ) complex decreases and intersects with the concentration curve of the surface complex (Ca s CO 3 À ). Above this pH (i.e., pH ¼ 10) the calcite-water interface and the oil-water interface are both characterized by a negative potential and thus repel each other and this situation leads to stable water-film. Fig. 7b shows that at low pH (i.e., pH < 7), the oil-water interface and the calcite-water interface have a positive potential and therefore these surfaces repel each other at low pH leading to a stable water-film. At a pH between 7 and 10 (i.e., 7 < pH < 10), the oil-water interface and calcite-water interface have a positive and negative potential respectively,and thus attract each other, and the water-film collapses. At high pH (i.e., pH > 10), the oil-water interface and calcite-water interface have a negative potential and thus repel each other and this leads to a stable water-film. Fig. 8 illustrates the concentration of the surface complexes ( mol=m 2 ) and the potential in millivolts (mVolts) as a function of the pH at the same salt concentration (i.e., NaCl of 0.4 mmol per kilogram of water mmol=kilogramofwater) as Fig. 7, but now at a reservoir temperature of (80 � C). Fig. 8a shows the moles of surface complex per square meter of surface area (mol= m 2 ) at low-salinity and (80 � C). In the same way as Fig. 7a, Fig. 8a shows that the surface complex (oil s NH þ ) is the main contributor to the positive charge of the oil-water interface, whereas (Ca s OH 2þ ) is the main contributor to the positive charge of calcite-water interface. On the other hand, the surface complex (oil w COO À ) is the main contributor to the negative charge of the oil-water interface, whereas the surface complex (Ca w CO 3 À ) (i.e., supported by the surface complex Ca s CO 3 À )) is the main contributor(s) to the negative charge of the calcite-water interface. As the pH increases the concentration of the surface complex (oil s NH þ ) decreases until it intersects (i.e., at pH ¼ 7) with the main negative contributor, i.e., the surface complex (Oil w COO À ), and the oil-water interface starts to be negatively charged. The calcite-water interface remains positively charged until the pH exceeds 10 (pH > 10) (i.e., at the point where the (Ca s OH þ 2) complex deceases and intersects with the concentration curve of the surface complex (Ca s CO 3 À ). However, above this pH (i.e., pH ¼ 10) the calcite-water interface and the oil-water interface are both characterized by a positive potential and thus repel each other and it still leads to stable water-film. Furthermore, Fig. 8b shows similar behaviour as at (25 � C) (i.e., see Fig. 7b) shows that at low pH (i.e., pH < 7), the oil-water interface and the calcite-water interface have a positive potential and therefore these surfaces repel each other at low pH (i.e., pH < 7) and this leads to a stable water-film. At a pH between 7 and 10 (i.e., 7 < pH < 10), the oil-water interface and calcitewater interface have a positive and negative potential respectively,and thus attract each other, and the water-film collapses. At high pH (i.e., pH > 10), the oil-water interface and calcite-water interface have a positive potential and thus repel each other at high pH and this leads to a stable water-film. In addition, temperature effect (i.e., 25 � C) makes the surface potential of calcite-water interface more positive, while the surface potential of oil-water interface remains more or less the same compared to the surface potential at (25 � C). In summary, the sign of the surface charge is condition dependent. The sign of the surface potential is very dependent on the activity coefficients. We see that one of the surface complexes is dominant in determining the sign. For low pH (i.e., pH < 7), the main contributors to the positive charge on the oil-water interface (i.e., oil s NH þ ) and the calcite-water (i.e., Ca s OH 2þ ) are dominant (i.e., see Fig. 5a, 6a, 7a, 8a). Consequently, the oil-water interface and the calcite-water interface both have a positive potential and therefore, these surfaces repel each other at low pH (i.e., pH < 7). This leads to a stable water-film (i.e., see Fig. 5b, 6b, 7b, 8b) Such a system is water-wet, but uncertainties in the Hamaker constant and double layer repulsion need to be considered. We assert for the conditions considered that qualitatively we can conclude that the charges at the oil-water interface and calcite-water interface are Fig. 7. Surface complexes and potential of NaCl (i.e., low-salinity case) at (25 � C).
A.M. Hassan et al. positive at low pH-value (i.e., pH < 7). For pH between 7 and 10 (i.e., 7 < pH < 10), the main contributors to the negative charge on the oilwater interface (i.e., surface complex oil w COO À ) becomes dominant, whereas the main contributors to the positive charge on calcite-water (i. e., surface complex Ca s OH 2þ ) remains dominant (i.e., see Fig. 5a, 6a, 7a, 8a). Consequently, the oil-water interface and calcite-water interface have a positive and negative potential respectively, and thus attract each other, leading to a collapsing of the water-film, which is squeezed out (i. e., see Fig. 5b, 6b, 7b, 8b)). For pH between 10 and 12 (10 < pH < 12), we have distinguished three different situations (1) at high salinity (i.e., 8500 mmol/kg-w) and at both (25 � C and 80 � C), the main contributors to the negative charge on the oil-water interface (i.e., surface complex oil w COO À ) and the main contributors to the positive charge on calcitewater (i.e., surface complex Ca s OH 2þ ) remain dominant (i.e., see Fig. 5a and 6a). Consequently, the oil-water interface and calcite-water interface have a negative and positive surface potential respectively, and thus attract each other, and the water-film collapses (is squeezed out) (i. e., see Fig. 5b and 6b) (2) at low salinity (i.e., 8500 mmol/kg-w) and at (25 � C), the main contributors to the negative charge on the calcite-water interface (i.e., surface complexes (Ca w CO 3 À ) and (Ca s CO 3 À )) become dominant, whereas the main contributors to the negative charge on the oil-water interface (i.e., surface complex (oil w COO À )) remains dominant (i.e., see Fig. 7a. Consequently, the oil-water interface and calcite-water interface have both negative potential, and thus repel each other, and it leads to stable water-film (i.e., see Fig. 7b).
(3) at low salinity (i.e., 8500 mmol/kg-w) and at (80 � C), the main contributors to the negative charge on the calcite-water interface (i.e., surface complex (oil s NH þ ) and (Ca s CO 3 À )) become less dominant, whereas the main contributors to the positive charge on oil-water (i.e., surface complex (oil s NH þ )) becomes dominant (i.e., see Fig. 8a). Consequently, the oil-water interface and calcite-water interface have both positive potential, and thus repel each other, and this leads to a stable water-film (i.e., see Fig. 8b). Note that, the temperature (i.e., 80 � C) effect makes the surface potential of calcitewater interface more positively charged compared to the surface potential at (25 � C). We also performed simulations using (MgCl 2 ) instead of (NaCl) to show the effect of a divalent ion at the high-salinity (8500 mmol/kg-w) and low-salinity (0.4 mmol/kg-w) for both ambient-conditions at (25 � C) (see Fig. 9 10) and at the reservoir-conditions (80 � C) (see Figs. 11 and 12). Moreover, We focus on the behavior of the surface potential (see Figs. 9b,10b and 11b,and 12b). We show also the concentration of surface complex profiles (i.e., see Figs. 9a, 10a and 11a, and 12a) using  Fig. 9. Surface complexes and potential of MgCl 2 (i.e., high-salinity case) at (25 � C).
A.M. Hassan et al. (MgCl 2 ) for the purpose of general reference, because the figures are very similar to the figures where (NaCl) is present, we will not repeat discussing these figures in the text. For (MgCl 2 ), the general features of the surface potential profiles with (MgCl 2 ) are very similar to the surface potential profiles with only (NaCl) present. However, as opposed to the NaCl case we now observe that in Fig. 9b at (7 < pH < 10) the surface potential of the oil-water interface is positive. Consequently the waterfilm is now stable in the whole range (4 < pH < 11). Above (pH > 11) the oil-water interface has a positive potential, whereas the calcite-water interface has a negative potential at (25 � C), and thus these interfaces attract each other, and the water-film collapses. On the other hand, at (80 � C) (see Fig. 10b) the potential of the oil-water interface above (pH > 11), becomes negatively charged. Therefore, both the oil-water interface and the calcite-water interface are negatively charged and have the same sign. Consequently, we have a stable water-film over the entire pH range (4 < pH < 13). Fig. 11b shows the surface potential in the presence of (MgCl 2 ) at low-salinity and at ambient-conditions (i.e., 25 � C). We observe that Fig. 11b shows the same behaviour as Fig. 11b in the presence of (NaCl), which illustrates that at (pH < 7) the surface potential of the oil-water interface and calcite-water interface both have a positive surface potential, and thus repel each other and this leads to stable water-film. At a pH between 7 and 10 (i.e., 7 < pH < 10), the oilwater interface and calcite-water interface have a positive and negative surface potential respectively,and thus attract each other, and the waterfilm is squeezed out. At high pH (i.e., pH > 10), the oil-water interface and calcite-water interface have a positive potential and thus repel each other at high pH; this leads to a stable water-film.On the other hand, Fig. 12b shows the surface potential in the presence of ( MgCl 2 ) at lowsalinity and at reservoir-conditions (i.e., 80 � C). We observe that, Fig. 12b shows the same trend as Fig. 11b However, at (pH > 10) we see that the negative sign of the surface potential extends beyond (pH > 11) for both the oil-water interface and calcite-water interface, and becomes more negatively charged. This means that for low (MgCl 2 ) concentrations (0.4 mmol/kg-w) at ambient and reservoir conditions (i.e., 25 � C and 80 � C), the water-film is stable both at low-pH (i.e., pH < 7) and high-pH (i.e., pH < 10).
A.M. Hassan et al. the calcite-water interface both have a positive potential and therefore, these surfaces repel each other at low pH (i.e., pH < 7). This leads to a stable water-film (i.e., see Fig. 9b,10b,11b,12b). For pH between 7 and 10 (i.e., 7 < pH < 10.3), we have distinguished two situations (1) at high salinity (i.e., 8500 mmol/kg-w) and at both (25 � C and 80 � C), the main contributors to the positive charge on the oil-water interface (i.e., oils NH þ ) and the calcite-water (i.e., Ca s OH 2þ ) both remains dominant (i.e., see Figs. 9a, 10a). Consequently, the oil-water interface and the calcitewater interface both have a positive potential and therefore, these surfaces repel each other. This leads to a stable water-film (i.e., see Figs. 9a, 10a) (2) at low salinity (i.e., 0.4 mmol/kg-w) and at both (25 � C and 80 � C), the main contributors to the negative charge on the oil-water interface (i.e., oil w COO À ) and the main contributor to the positive charge on the calcite-water (i.e., Ca s OH 2þ ) are dominant (i.e., see Figs. 9a, 10a). Consequently, the oil-water interface and the calcitewater interface have a negative and positive surface potential and therefore, these surfaces attract each other, and water-film collapses (squeezed out) (i.e., see Figs. 9a, 10a). For pH-value exceeds 10.3 (pH > 10.3), we have distinguished two situations (1) at high salinity (i.e., 8500 mmol/kg-w) and at (25 � C), the main contributor to the positive charge on the oil-water interface (i.e., oil s NH þ ) and the main contributors to the negative charge on the calcite-water (i.e., (Ca w CO 3 À ) and (Ca s CO 3 À )) are dominant (i.e., see Fig. 9a. Consequently, the oil-water interface and the calcite-water interface have a positive and negative surface potential respectively, and therefore, these surfaces attract each other, and water-film collapses (squeezed out) (i.e., see Fig. 9b (2) at high salinity (i.e., 8500 mmol/kg-w) and at (80 � C), at low salinity (i.e., 0.4 mmol/kg-w) and at (25 � C), and at low salinity (i.e., 0.4 mmol/kg-w) and at (80 � C); the main contributors to the negative charge on the oilwater interface (i.e., surface complex oil w COO À ) and on the calcitewater interface (i.e., surface complexes (Ca w CO 3 À ) and (Ca s CO 3 À )) both are dominant (i.e., see Fig. 10a, 11a, 12a). Consequently, the oilwater interface and the calcite-water interface both have a negative surface potential and therefore, these surfaces repel each other. This leads to a stable water-film (i.e., see Fig. 10b, 11b (12b)). Note that, the temperature (i.e., 80 � C), effect makes the surface potential of calcitewater interface more positively charged compared to the surface potential at (25 � C).

Fig. 12.
Surface complexes and potential of MgCl 2 (i.e., low-salinity case) at (80 � C). . 13. The result of the effect of the carbon dioxide (CO 2 ) concentration on the surface charge at different salinity ranges for the foam-film. A high carbon dioxide (CO 2 ) concentration leads to a decrease of the surface charge (i.e., less negative), and thus a low pH value destabilizes the foam film. Fig. 13 shows the effect of the carbon dioxide (CO 2 ) concentration on the surface charge density for a foam-film. At low carbon dioxide (CO 2 ) pressures the surface charge is negative. It increases towards zero at high carbon dioxide (CO 2 ) pressures. This means that the surface charge of the foam film decreases at increasing carbon dioxide (CO 2 ) pressure and decreasing pH. At increasing salinity the surface potential and therefore also the stability of the foam film decreases. The stability of the brine film on the calcite surface benefits from a low pH, whereas the stability of the foam film benefits from a high pH. An optimal choice of the pH that at the same time leads to a stable water-film on the calcite-water interface requires fine tuning. Fig. 14 shows the surface potential versus the carbon dioxide (CO 2 ) pressure for various ionic strengths for the foam-film. In terms of interpretation, Fig. 14 shows the same trend as Fig. 13, and thus corroborates our previous observation in Fig. 13, namely that a high carbon-dioxide pressure makes the surface potential and the surface charge less negative. Consequently the electrostatic double layer repulsion decreases with increasing (CO 2 ) concentration. Therefore the liquid film will be less stable for high carbon dioxide (CO 2 ) pressures. The surface charge and the surface potential also becomes less negative at high salt concentrations (i.e., ionic strength). Therefore lowsalinity conditions will be favorable to stable liquid films. Fig. 15, shows the effect of the pH on the surface charge density at a different salinity range for the foam-film. In the same way, in terms of interpretation, Fig. 15 confirms the same trend as Fig. 13 and Fig. 14, viz. low pH leads to a decrease of the surface charge (i.e., less negative), and therefore the liquid film will be less stable. In addition, the surface charge also becomes less negative at high brine concentrations (i.e., ionic strength). Therefore low-salinity conditions will be favorable to a stable foam-film.

Summary and conclusions
It is to be expected that foam flow in calcite reservoirs requires both a water film on the calcite surface and stable foam lamellae. An optimal choice of conditions as to ionic compositions with optimal improvement of the stability of the foam-lamellae and a stable water-film between the rock (calcite) and oil (i.e., dual improvement) has been called "smart water". In this paper we use low-salinity (NaCl) and (MgCl 2 ). Such a system makes the system water-wet, leading to high residual oil saturations and low end point permeabilities. Low end point permeabilities lead to an improved mobility ratio, leading to a better displacement efficiency, less viscous fingering, and a higher sweep efficiency. The combination is also called Smart Water Assisted Foam (SWAF) flooding. We have shown that in creating both a stable foam-film and a stable water-film between oil and carbonate rock, surface complexes play an important role. We follow Brady in defining the surface complexes on the oil-water and calcite-water interfaces, leading to four surface master species, which are labeled weak and strong. Using these surface complexes we can determine the charge on the calcite-water surface, the oilwater surface and the water-gas surface constituting the foam. Using the (DLVO) theory we can determine the surface potential at the hydrodynamic shear plane also called the zeta-potential. We confine our analysis to a description that uses the Dzombak-Morel model of surface complexes, which is based on the Debye-HÃ¼ckel theory (i.e., valid up to ionic strength of 0.3 (mol/kilogram of water)). For the soap-film (foamfilm) in a carbon dioxide (CO 2 ) atmosphere we do use Pitzer activity coefficients (i.e., valid up to 6 (mol/kilogram of water)). As our aim is to show the methodology and the versatility of this approach, we leave more realistic choices of these parameters for future work. The values of the equilibrium coefficients and the enthalpy of the reactions are taken from the data base provided with PHREEQC (i.e., data-base phreeqc.dat & pitzer.dat) (J Appelo and Postma, 2005;Parkhurst and Appelo, 2013a;Parkhurst and Appelo, 2013b). The calculation with the surface complexes can be accomplished with PHREEQC software. Our results show the stability of the foam lamellae and the water film between the oil-water and calcite water surface. Using an extended Gibbs phase rule we can show that for given surface component concentrations, the thermodynamic behavior of the films in a carbon dioxide atmosphere only depends on the two degrees of freedom, which we choose to be the pH (or carbon dioxide (CO 2 ) pressure) i.e., ≪ 1, and the ionic strength. Moreover, from the study of the surface complexation modeling using the PHREEQC software for creating both a stable-foam and a stable water-film between oil and carbonate rock, we assert for the conditions considered that qualitatively we can summarize and conclude the following: � We adopt the approach that is given in PHREEQC, which describes the interaction between the substrate and the surface complex. The Input parameters of PHREEQC modelling are: (1) the fraction of active sites, (2) the specific surface area (i.e., m 2 =g), and (3) the amount of surface complexes per kg of water (i.e., mol=kg À water). � Our calculations show the pH-range (i.e., from 4 to 12) for (NaCl) where the sign of these surface charges is the same or opposite at high-salinity (8500 mmol/kg-w) and low-salinity (0.4 mmol/kg-w) Fig. 14. The result of the effect of the carbon dioxide (CO 2 ) concentration on the surface potential at different salinities for the foam-film. A high carbon dioxide (CO 2 ) concentration leads to a decrease of the surface potential (i.e., less negative), and thus a low pH value destabilizes the foam film.
conditions for both ambient-conditions at (25 � C) and reservoirconditions at (80 � C). � The sign of these surface charges and the sign of the surface potential are very dependent on the activity coefficients. We see also that one of the surface complexes is dominant in determining the sign of the surface charges and the surface potential. � In the presence of (NaCl), the low-salinity case shows a more stable water-film behavior at (25 � C) and at (80 � C) than at the high-salinity case (i.e., at high-pH values; pH > 10). Our model states that such a system is water-wet. � We also performed simulations using (MgCl 2 ) instead of (NaCl) to show the effect of a divalent ion at high-salinity (8500 mmol/kg-w) and low-salinity (0.4 mmol/kg-w) for both ambient-conditions at (25 � C) and reservoir-conditions at (80 � C). � In the same way, in the presence of (MgCl 2 ), the low-salinity case shows a more stable water-film behavior at (25 � C) and at (80 � C) than the high-salinity case (i.e., at high-pH values; pH > 10.3). Our model states that such a system is water-wet. � Moreover, for the foam lamella, it is shown that a reduced surface potential leads to a decreasing electrostatic double layer (EDL) repulsion and thus destabilizes the stability of the foam film, whereas low-salinity (i.e., NaCl and MgCl 2 ) leads to less screening of the surface potential, and thus improves the stability of the foam-film. � An optimal choice of the pH that at the same time leads to a stable water-film on the calcite surface and a stable foam-film requires fine tuning. � It is shown that a reduced surface potential leads to a decreased electrostatic double layer repulsion (EDL) and thus, destabilizes the stability of the foam film. � A high carbon dioxide (CO2) concentration (pressure) leads to a decrease of the surface charge (i.e., less negative), and a lower pH value, and this destabilizes the foam film. � It is generally accepted that the presence of a stable water-film makes the reservoir water-wet, which is conducive to high residual oil saturations and low water end point permeabilities, which lowers the mobility ratio. This helps to establish stable displacement. � Consequently, the stable displacement avoids the necessity of a large water injection requirement to approach residual oil; it can be shown that shortly after breakthrough the circulation exergy starts to exceed the exergy that can be obtained from the oil (Hassan et al., 2019b).
� It is expected that, the SWAF-process under the optimum conditions will possibly make the proposed new hybrid Enhanced Oil Recovery (EOR) process environmentally and economically attractive.