1 Introduction

Reactive transport in porous media is an essential field of study with broad ranging applications in a range of industries including oil and gas production, carbon dioxide (CO\(_2\)) and hydrogen (H\(_2\)) storage, geothermal energy production, nuclear waste disposal, and subsurface contaminant transport (Steefel et al. 2005). These processes include fluid flow with inertia and viscous effects, advective species transport, molecular diffusion, and chemical reactions. In addition, multiple fluid phases are often present, resulting in capillary effects and interface transfer. For such complex systems, analytical solutions are restricted to very simple geometries and flow conditions (Hadamard 1911; Coutelieris et al. 2006). These limitations in model complexity result in the use of experiments to investigate more complex physics with small analogue systems such as core samples (Menke et al. 2014, 2017) or reactive micromodels (Soulaine et al. 2017; Poonoosamy et al. 2020). However, experimental studies are often time-consuming, limited in size, and hard to control. In addition, reactive transport experiments on core samples are always destructive, and since no two cores are the same, they cannot be repeated on identical natural pore structures. These studies are thus often coupled with numerical simulations, a powerful tool that can be used both during the design of the experiment to choose optimal conditions, or to augment the experimental data afterwards by providing quantities of interest that may be difficult to measure (e.g. pH) or to explore additional ranges of physical conditions (e.g. pressure, temperature) (Soulaine et al. 2021).

While numerical modelling of multiphase flow (Pavuluri et al. 2020; Ferrari et al. 2015; Zhao et al. 2019) and single-phase reactive transport (Szymczak and Ladd 2009; Soulaine et al. 2017; Oliveira et al. 2020) in pore-scale geometries have been extensively investigated independently, few studies have attempted to model the coupling between the two. Raoof et al. (2013) used a pore network model to simulate reactive transport in variably saturated porous media. However, the pore network approach introduces restrictions on the transport regime and reactive surface area calculations. Chen et al. (2018) employed the Lattice Boltzmann method (LBM) to model multiphase reactive transport, with an interfacial reaction treatment rather than a direct modelling of interfacial conditions. Although this method has been used successfully in several studies (Chen et al. 2017, 2019), the LBM method has difficulty modelling the full range of regimes that occur during multiphase flow (Zhao et al. 2019) and reactive transport (Molins et al. 2020). Aziz et al. (2019) investigated wettability alteration during low-salinity flooding using a non-reactive multiphase transport solver based on direct numerical simulation (DNS). However, the model was restricted to transport in the aqueous phase with an immobile non-aqueous phase and no interfacial conditions. None of these studies include accurate modelling of interfacial conditions with phase transfer.

Recent advances in the development of DNS of multiphase transport have enabled accurate modelling of interfacial transfer. Haroun et al. (2010) introduced the single-field approach to model species transport in multiphase systems with interfacial conditions. Their method is based on the Volume-Of-Fluid (VOF) method (Hirt and Nichols 1981), where the interface between the two fluids is captured using an indicator function, which is a phase volume fraction. Although other methods such as level set (Gibou et al. 2018; Luo et al. 2019) can provide a more accurate description of the sharp interface, the VOF method is attractive due to its accuracy of mass conservation and adaptability to more complex physics. Marschall et al. (2012) developed Haroun’s single-field approach into a versatile and precise method for multiphase transport during bubbly flow labelled continuous species transport (CST). This method was extended to problems with moving contact lines by Graveleau et al. (2017) and later improved by Maes and Soulaine Maes and Soulaine (2018a) with the introduction of interface compression. The CST method was then used to model multiphase reactive transport during low-salinity flooding (Maes and Geiger 2018) and mineral dissolution with CO\(_2\) production in shale formations (Soulaine et al. 2018, 2019). Finally, the model was extended to include local volume changes induced by interface transfer for simulating dissolution of CO\(_2\) bubbles in liquid (Maes and Soulaine 2018b, 2020; Patsoukis-Dimou and Maes 2020).

The objective of this paper is to present our extended model that includes multiphase reactive transport with equilibrium reactions both in the water phase and at the surface of the solid, and its implementation within GeoChemFoam. The fully-coupled multiphase reactive transport model is presented in Sect. 2 and validated in Sect. 3. In particular, we show that precise representation of interfacial conditions is essential for accurate and robust modelling of reactive transport, even when the species only exist in one phase, demonstrating that the CST method can be used for reactive transport, unlike the model presented in Aziz et al. (2019). Finally, we present the simulation and upscaling of reactive transport with two model test cases: (1) first, we simulate carbonic acid formation during dissolution of a CO\(_2\) gas bubble in a 3D pore cavity, and then, (2) we introduce the first results of a multiphase reactive transport simulation on a real 3D pore space with injection of a CaCl\(_2\) solution into a micro-CT image of Bentheimer sandstone.

2 Model Description

2.1 Geochemical Model

We consider a multiphase system with a reactive phase p in a chemical model that includes \(N_c\) and \(N_s\) bulk and surface components, with \(N_x\) and \(N_y\) bulk and surface equilibrium reactions. Since the species are at chemical equilibrium, it is possible to partition the system into \(\overline{N}_c=N_c-N_x\) and \(\overline{N}_s=N_s-N_y\), the primary bulk and surface species (i.e. species with independent concentrations), and \(N_x\) and \(N_y\), the secondary bulk and surface species (Steefel et al. 2015). \(\overline{N}_c\) corresponds to the number of independent concentrations in the bulk, which also corresponds to the number of chemical elements (e.g. H, O, C). \(\overline{N}_s\) corresponds to the number of independent mole fractions at the solid surface, which also corresponds to the number of surface site types. The relationships between elements, primary bulk species, secondary bulk species, primary surface species, secondary surface species, and surface sites are represented in Fig. 1. For each element corresponds a primary bulk species, and for each surface site type corresponds a primary surface species. For each chemical reaction in the bulk corresponds a secondary bulk species, and for each surface reaction corresponds a secondary surface species.

Fig. 1
figure 1

Schematic of the relationships between elements, primary bulk species, secondary bulk species, primary surface species, secondary surface species, and surface sites in the chemical model. The elements are represented by balls with different colours, while the surface site types are represented by squares with different colours. In this example, \(N_c\)=5, \(\overline{N}_c\)=3, \(N_s=5\) and \(\overline{N}_s=2\).

The equilibrium chemical reactions between the primary and secondary species can be written as

$$\begin{aligned} A_i \rightleftharpoons \sum _{j=1}^{\overline{N}_c} \nu _{ij}A_j,&\quad S_n \rightleftharpoons S_m +\sum _{j=1}^{\overline{N}_c}\nu _{nj}A_j, \end{aligned}$$
(1)

where \(A_j\) and \(A_i\) are the chemical formulas of the primary and secondary species in the bulk phase, \(S_m\) and \(S_n\) are the chemical formulas of the primary and secondary species on the solid surface, and \(\nu _{ij}\) and \(\nu _{nj}\) are the stoichiometric coefficients. Note that on the solid surface, one secondary species is associated with one primary species only. Each equilibrium reaction provides an algebraic link between the primary and secondary species via the law of mass actions

$$\begin{aligned} a_{i,p} =K_i^{-1} \prod _{j=1}^{\overline{N}_c} a_{j,p}^{\nu _{ij}},&\quad \omega _n = \omega _m K_n^{-1} \prod _{j=1}^{\overline{N}_c}a_{j,p}^{\nu _{nj}}, \end{aligned}$$
(2)

where \(a_{j,p}\) and \(a_{i,p}\) are the activities of primary species j and secondary species j, \(\omega _m\) and \(\omega _n\) are the activity of the primary surface species m and secondary surface species n, and \(K_i\) and \(K_n\) are the chemical equilibrium constants. We assume that the activity of a species k in phase p is equal to

$$\begin{aligned} a_{k,p}=\gamma _{k,p}\frac{c_{k,p}}{c_0} \end{aligned}$$
(3)

where \(\gamma _{k,p}\) is the activity coefficient of species k (primary or secondary) , \(c_{k,p}\) is its concentration (kmol/m\(^3\)) in phase p and \(c_0=1\) kmol/m\(^3\) is the standard activity. The activity \(\omega _l\) of a surface species \(S_l\) (primary or secondary) is equal to its mole fraction on the corresponding surface, i.e. over all surface components which share the same primary species \(S_m\). For each primary bulk species j, we also define the total concentration \(\psi _{j,p}\) in phase p, which is the quantity conserved during chemical reactions, and can be written as

$$\begin{aligned} \psi _{j,p} = c_{j,p} + \sum _{i=1}^{N_x}\nu _{ij}c_{i,p} + \sum _{n=1}^{N_y}\nu _{nj}\omega _n \Gamma A_s, \end{aligned}$$
(4)

where \(\Gamma \) is the site density (kmol/m\(^2\)) and \(A_s\) is the specific surface area (m\(^2\)/m\(^3\)) of the solid which, at the pore-scale, is calculated from the mesh. The total concentrations are defined so that they are conserved during the chemical reaction step, i.e.

$$\begin{aligned} \left( \frac{\partial \psi _{j,p}}{\partial t}\right) _{Reaction}=0. \end{aligned}$$
(5)

For surface reactions, the apparent stability constant \(K_n\) is different from the intrinsic constant \(K^{i}_n\) due to the surface charge q (Israelachivili 1985)

$$\begin{aligned} q=F\sum _{n=1}^{N_s} v_{n}\omega _n\Gamma , \end{aligned}$$
(6)

where \(v_{n}\) is the charge of the surface species n and F (\(=9.649\times 10^{7}\) C/kmol) is the Faraday constant. The double-layer surface potential \(\varphi \) is related to the surface charge by the Grahame equation (Israelachivili 1985)

$$\begin{aligned} q^2=8000\epsilon \epsilon _0RTI\left[ \sinh \left( \frac{F\varphi }{2RT}\right) \right] ^2, \end{aligned}$$
(7)

where \(\epsilon \) (\(=78.41\) at 25\(^o\) C) is the dielectric constant of pure water, \(\epsilon _0\) (\(=8.854\times 10^{-12}\) C/V/m) is the vacuum permittivity, I (kmol/m\(^3\)) is the ionic strength of the electrolyte solution, R (\(=8.314\) kJ/kmol/K) is the ideal gas constant and T is the temperature. The relationship between \(K_n\) and \(K^i_n\) is given by Israelachivili (1985)

$$\begin{aligned} K_n = K^i_{n}\exp \left( -\frac{Z_nF\varphi }{RT}\right) , \end{aligned}$$
(8)

where \(Z_n\) is the net change of surface charge induced by the reaction. In this work, activity coefficients, ionic strength, surface charge, surface potential, and chemical equilibrium constants are calculated within Phreeqc (Parkhurst and Appelo 2013). In all our simulations, the temperature and pressure are set to the Phreeqc’s default values (\(25^\circ \mathrm{C}\) and 1 atm), and the reaction parameters are the ones given in the Phreeqc’s default database.

2.2 Multiphase Flow Model:VOF

In this study, the system includes two phases: the aqueous phase (phase 1) and a non-aqueous phase (phase 2) that can be either a gas or a liquid phase. In the VOF method, the interface between the two fluids is tracked using indicator functions \(\alpha _1\) and \(\alpha _2\), where \(\alpha _2=1-\alpha _1\), which are equal to the volume fractions of each phase in each grid cell. The density and viscosity of the fluid in each cell are expressed using their single-field values

$$\begin{aligned}&\rho = \alpha _1\rho _1 + \alpha _2\rho _2, \end{aligned}$$
(9)
$$\begin{aligned}&\mu = \alpha _1\mu _1 + \alpha _2\mu _2, \end{aligned}$$
(10)

where \(\rho _p\) (kg/m\(^3\)) and \(\mu _p\) (Pa.s) are the density and viscosity of phase p. Similarly, the velocity and pressure in the domain are expressed in terms of the single-field variables

$$\begin{aligned}&\mathbf {u} = \alpha _1\mathbf {u}_1 + \alpha _2\mathbf {u}_2, \end{aligned}$$
(11)
$$\begin{aligned}&p = \alpha _1p_1 + \alpha _2p_2, \end{aligned}$$
(12)

where \(\mathbf {u}_p\) (m/s) and \(p_p\) (Pa) are the velocity and pressure in phase p. Each phase is assumed to be Newtonian and incompressible, and fluid properties are assumed to be constant in each phase (and in particular independent of the phase composition). In this case, the single-field momentum equation (Hirt and Nichols 1981) can be written as

$$\begin{aligned} \frac{\partial \rho \mathbf {u}}{\partial t}+ \nabla \cdot \left( \rho \mathbf {u}\mathbf {u}\right) =-\nabla p + \nabla \cdot \left( \mu \left( \nabla \mathbf {u} + \nabla \mathbf {u}^T\right) \right) + \rho \mathbf {g} + \mathbf {f}_{st}, \end{aligned}$$
(13)

where \(\mathbf {g}\) (=9.81 m/s\(^2\)) is the gravity acceleration and \(\mathbf {f}_{st}\) is the surface tension force

$$\begin{aligned} \mathbf {f}_{st} = \sigma \kappa \mathbf {n}_{12}\delta _{12}. \end{aligned}$$
(14)

where \(\sigma \) (N/m) is the interfacial tension, \(\mathbf {n}_{12}\) is the normal vector to the fluid/fluid interface, going from phase 1 to phase 2, \(\kappa =\nabla \cdot \mathbf {n}_{12}\) is the interface curvature and \(\delta _{12}\) is a Dirac function located at the interface. At the triple point fluid/fluid/solid, the interface forms with the normal to the solid surface a contact angle \(\theta \) so that

$$\begin{aligned} \mathbf {n}_{12} = \cos \theta \mathbf {n}_s + \sin \theta \mathbf {t}_s, \end{aligned}$$
(15)

where \(\mathbf {n}_s\) and \(\mathbf {t}_s\) are the normal and tangent vectors to the solid surface, respectively (Brackbill et al. 1992). In addition, the single-field continuity equation writes

$$\begin{aligned} \nabla \cdot \mathbf {u}=\dot{m}_{12}\left( \frac{1}{\rho _2}-\frac{1}{\rho _1}\right) . \end{aligned}$$
(16)

where \(\dot{m}_{12}\) (kg/m\(^3\)/s) is the rate of mass transfer from phase 1 to phase 2 by solubility and is calculated after solving the transport equations. To advect the indicator functions, algebraic VOF methods solve the phase transport equation

$$\begin{aligned} \frac{\partial \alpha _1}{\partial t} + \nabla \cdot (\alpha _1 \mathbf {u}) + \nabla \cdot \left( \alpha _1\alpha _2\mathbf {u}_r\right) =-\frac{\dot{m}_{12}}{\rho _1}, \end{aligned}$$
(17)

where \(\mathbf {u}_r=\mathbf {u}_1-\mathbf {u}_2\) is the relative velocity, which is a consequence of mass and momentum transfer between the phases. Fleckenstein and Bothe (2015) showed that \(\mathbf {u}_r\) may be neglected even in the case of very good solubility (e.g. CO\(_2\) in water) in order to simplify Eq. (17). However, to reduce the smearing of the interface induced by numerical diffusion, an artificial compression term can be introduced by replacing \(\mathbf {u}_r\) in Eq. (17) by a compressive velocity \(\mathbf {u}_{comp}\) normal to the interface and with an amplitude based on the maximum of the single-field velocity Rusche (2002)

$$\begin{aligned} \mathbf {u}_r\equiv \mathbf {u}_{comp} = \mathbf {n}_{12}\left[ \min \left( c_{\alpha }\frac{|\Phi _f|}{A_f},\max _f\left( \frac{|\Phi _f|}{A_f}\right) \right) \right] , \end{aligned}$$
(18)

where \(c_{\alpha }\) is the compression constant (generally between 0 and 4), \(\Phi _f\) is the volumetric flux across a grid cell face f, and \(A_f\) is the face area. In all our simulations, we choose \(c_{\alpha }=1.0\).

In addition to \(\dot{m}_{12}\), which will be calculated in the next section, the system requires models for the normal vector to the fluid/fluid interface and the surface tension force for closure. Brackbill et al. (1992) developed an approximation referred to as the continuous surface force (CSF) where \(\mathbf {n}_{12}\) is calculated from \(\alpha _1\) and \(\mathbf {n}_{12}\delta _{12}\) is approximated by \(\nabla \alpha _1\), so that

$$\begin{aligned}&\mathbf {n}_{12} = \frac{\nabla \alpha _1}{\Vert \nabla \alpha _1 \Vert },&\mathbf {f}^{CSF}_{st} = \sigma \nabla . \left( \frac{\nabla \alpha _1}{\Vert \nabla \alpha _1 \Vert } \right) \nabla \alpha _1. \end{aligned}$$
(19)

The VOF-CSF method is attractive because of its simplicity. However, many studies (Scardovelli and Zaleski 1999; Abadie et al. 2015) have reported the presence of spurious currents in the capillary dominated regime that originate from errors in calculating the normal vector and the curvature of the interface. Spurious currents may be mitigated by a combination of smoothing and sharpening of the indicator functions (Pavuluri et al. 2018). Although these modifications of the CSF may reduce the magnitude of spurious currents, they do not fully eliminate them. In addition, they can potentially deteriorate contact line dynamics (Pavuluri 2019). For these reasons, we do not apply any modifications of the CSF method in this work. Spurious currents exist in our simulations, but their impact has been shown in our previous work (Maes and Soulaine 2018a, 2020) to be negligible when compared to analytical solutions. This is because even though spurious currents can rise to a magnitude of the same order as injection velocity and have the potential to impact the mixing between species, they oscillate at a time-scale orders of magnitude faster than the viscous drag velocity, so at the time scale of the injection their impact is limited. For complex geometry such as micro-CT images, their impact has yet to be understood and is a target of future research. However, in the absence of benchmark experimental data it is impossible to quantify their impact and thus for the purposes of this work we assume them to be negligible.

Multiphase flow in pore structures is generally characterized by two dimensionless numbers, the Reynolds number \(Re=\rho _1\)UL/\(\mu _1\) and the capillary number \(Ca=\mu _1\)U/\(\sigma \), where U and L are the reference velocity and length in the domain, respectively. Re describes the ratio of inertial to viscous forces and Ca the ratio of viscous to capillary forces. In this work, we concentrate our investigation to low flow rates, i.e. in the creeping flow and capillary dominated regime with \(Re<1\) and \(Ca<10^{-4}\).

2.3 Reactive Transport Model

In a multiphase system, the chemical species can be present in both fluid phases. The conservation equation is satisfied by the total concentration \(\psi _{j,p}\) of a primary species j (Eq. 4) in phase p with

$$\begin{aligned} \frac{\partial \psi _{j,p}}{\partial t}+ \nabla \cdot \left( \psi _{j,i}\mathbf {u}_i \right) = -\nabla \cdot \mathbf {J}_{j,p}, \end{aligned}$$
(20)

where \(\mathbf {J}_{j,p}\) is the total diffusive flux of primary species j in phase p. We assume that the diffusive flux can be modelled using Fick’s law

$$\begin{aligned} \mathbf {J}_{j,p} = -D_{j,p}\nabla c_{j_p} - \sum _{i=1}^{N_x}\nu _{ij}D_{i,p}\nabla c_{i,p}, \end{aligned}$$
(21)

where \(D_{j,p}\) and \(D_{i,p}\) are the molecular diffusion coefficients of the primary and secondary species in phase p. This is true for dilute species in a solvent, such as water, and for species in a pure or binary mixture. Chemical equilibrium in phase p is insured by the law of mass actions (Eq. 2). At the fluid/fluid interface, the jump conditions are given by the continuity of fluxes and chemical potentials, the latter described here by Henry’s law (Henry 1803),

$$\begin{aligned}&\left( \psi _{j,1}\left( \mathbf {u}_1-\mathbf {w}\right) +\mathbf {J}_{j,1}\right) \cdot \mathbf {n}_{12} = \left( \psi _{j,2}\left( \mathbf {u}_2-\mathbf {w}\right) +\mathbf {J}_{j,2}\right) \cdot \mathbf {n}_{12}, \end{aligned}$$
(22)
$$\begin{aligned}&c_{k,2}=H_kc_{k,1} \end{aligned}$$
(23)

where \(H_k\) is the Henry constant of species k (primary or secondary), while the total mass conservation at the interface is defined as

$$\begin{aligned} \rho _{1}\left( \mathbf {u}_1-\mathbf {w}\right) \cdot \mathbf {n}_{12} = \rho _{2}\left( \mathbf {u}_2-\mathbf {w}\right) \cdot \mathbf {n}_{12}. \end{aligned}$$
(24)

The diffusion coefficients in the aqueous phase and Henry’s constants used in this paper are summarized in Table 1. All species exist only in the aqueous phase, except for CO\(_2\) that can also exist in the gas phase. In particular, the evaporation of H\(_2\)O in the gas phase is neglected, so that the assumption in Maes and Soulaine (2020) can be satisfied and the rate of mass transfer can be calculated [Eq. (30)]. The gas phase is then assumed to be pure. Therefore, the diffusion coefficient of all species in the non-aqueous phase can be assumed to be 0.

Table 1 Diffusion coefficient of ions in water (obtained from Li and Gregory (1973)).

In order to solve reactive transport within the VOF method, the transport equations [Eq. (20)] are integrated over a control volume using volume averaging Maes and Soulaine (2020), and the boundary conditions [Eqs. (22) and (23)] are used to eliminate surface integrals arising from the divergence theorem (Whitaker 1998). Since the boundary conditions depend on the concentration of primary and secondary species, it is difficult to develop an accurate and stable transport solver for the total concentrations \(\left( \psi _j\right) _{1\le j\le \overline{N}_c}\). Instead, our numerical model solves directly for the concentration of the primary and secondary species and is based on a sequential non-iterative operator splitting approach (Carrayrou et al. 2004). The transport step solves for the single-field concentration of species k (primary or secondary)

$$\begin{aligned} c_{k}=c_{k,1}\alpha _1+c_{k,2}\alpha _2, \end{aligned}$$
(25)

using the CST method (Maes and Soulaine 2020). The transport step solves the single-field transport equation

$$\begin{aligned} \frac{\partial c_{k}}{\partial t}+ \nabla \cdot \left( c_k\mathbf {u}\right) + \nabla \cdot \left( \alpha _1\alpha _2\left( c_{k,1}-c_{k,2}\right) \mathbf {u}_r\right) - \nabla .\left( D_k\nabla c_k-\mathbf {\Phi }_k\right) =0, \end{aligned}$$
(26)

where

$$\begin{aligned} \mathbf {\Phi }_k=(1-H_k)D_k\frac{c_k}{\alpha _1+H_k\alpha _2}\nabla \alpha _1, \end{aligned}$$
(27)

is the CST flux of species k and

$$\begin{aligned} D_k= \frac{\alpha _1D_{k,1}+H_k\alpha _2D_{k,2}}{\alpha _1+H_k\alpha _2}, \end{aligned}$$
(28)

is the single-field diffusion coefficient of species k. At the surface of the solid, the boundary condition for the single-field concentration of species k is defined by Graveleau et al. (2017)

$$\begin{aligned} D_k\nabla c_k-\Phi _k = 0. \end{aligned}$$
(29)

At the end of the transport step, the rate of mass transfer is calculated by Maes and Soulaine (2020)

$$\begin{aligned} \dot{m}_{12}=-\frac{\sum _{1\le k<N_c}\left( D_k\nabla c_k -\mathbf {\Phi }_k\right) }{1-\alpha _1} \cdot \nabla \alpha _1. \end{aligned}$$
(30)

After the transport step is completed, the reaction step is calculated using the phase concentrations \(\left( c_{k,p}\right) _{1\le k\le N_{c}}\), using the law of mass action [Eq. (2)] and the mass conservation of the primary species [Eq. (5)].

In addition to the Reynolds and capillary numbers, multicomponent multiphase transport in pore structures is generally characterized using the species Péclet numbers \(Pe_j=UL/D_j\). The transport of a species is advection dominated if \(Pe_j>1\), and diffusion dominated if \(Pe_j<\)1.

2.4 Interface Boundary Conditions and Artificial Mass Transfer

One of the objectives of this paper is to demonstrate that an accurate modelling of interface boundary conditions, such as carried out in the CST method, is necessary for robust modelling of multiphase reactive transport, because without such modelling artificial mass transfer may arise that can critically damage the chemical equilibrium. This is true even when no interface transfer exists and the species remain in the water phase.

For this we will compare the transport model presented in this paper with the simplified transport model described in Aziz et al. (2019) which only solves for the concentration of species in water (Eq. 20). This is achieved by setting the diffusion coefficient in the non-aqueous phase to 0. The single-field equation is defined as

$$\begin{aligned} \text {(Simplified model)}&\frac{\partial c_k}{\partial t}+\nabla \cdot \left( c_k\mathbf {u}-D_{k,1}\alpha _1\nabla c_k\right) =0 \end{aligned}$$
(31)

It is then generally assumed that a sharp interface between \(c_k\) and \(\alpha _2\) will be obtained due to the absence of diffusion at the fluid/fluid interface. However, there are two sources of interface transfer that are not accounted for in Eq. (31). First, at the interface, \(0\le \alpha _1\le 1\), so the diffusion coefficient is not 0, even though \(D_{k,2}=0\). Second, artificial mass transfer can occur due to the interface compression term in Eq. (17) if no compression is present in Eq. (31) Maes and Soulaine (2020). We thus demonstrate in Sect. 3.2 how these unaccounted-for sources of artificial mass transfer may damage the numerical solution.

2.5 Upscaling

Upscaling of multiphase transport in porous media is generally conducted in terms of the Darcy velocity \(U_p\), defined using Darcy’s law

$$\begin{aligned} U_p = -\frac{K_ak_{rp}}{\mu _p}\nabla \left( P_p-\rho _p\mathbf {g}\right) , \end{aligned}$$
(32)

where \(P_p\) is the average pressure in phase p, \(K_a\) is the absolute permeability of the domain and \(k_{rp}\) is the relative permeability of phase p. Relative permeability is often modelled using the Brooks–Corey model (Brooks and Corey 1964)

$$\begin{aligned} \begin{aligned} k_{r1}= \max \left( 0.0,k_{r1,max}\left( \frac{S_1-S_{wc}}{1-S_{wc}-S_{nar}}\right) \right) ^{n_1}\\ k_{r2}= \max \left( 0.0,k_{r2,max}\left( \frac{S_{2}-S_{nar}}{1-S_{wc}-S_{nar}}\right) \right) ^{n_{2}} \end{aligned} \end{aligned}$$
(33)

where \(S_p\) is the macro-scale phase saturation, \(S_{wc}\) is the critical water saturation, \(S_{nar}\) is the residual non-aqueous saturation, \(k_{rp,max}\) is the maximum relative permeability of phase p, and \(n_p\) is the phase Corey index. The phase saturation \(S_p\) can be calculated from a pore-scale simulation using

$$\begin{aligned} S_p=\frac{1}{V}\int _V\alpha _pdV, \end{aligned}$$
(34)

where the integral is calculated over the whole domain V.

The phase velocity \(U_p\) is related to the total velocity \(U_T=U_1+U_{2}\) by the fractional flow function \(f_p\), such as \(U_p=f_pU_T\). The fractional flow functions can then be calculated from Darcy’s law, and we obtain

$$\begin{aligned} f_p=\frac{\frac{k_{rp}}{\mu _p}}{\frac{k_{r1}}{\mu _1}+\frac{k_{r2}}{\mu _{2}}}. \end{aligned}$$
(35)

Multiphase reactive transport in porous media is usually upscaled using an equilibrium model (Chang et al. 2016), for which the phase saturation \(S_p\) (Eq. 34) and the phase average concentrations \(C_{j,p}\) are defined as

$$\begin{aligned} C_{j,p}=\frac{1}{S_pV}\int _V\alpha _pc_{j,p}dV, \end{aligned}$$
(36)

and are computed using an equilibrium phase partitioning. To calculate chemical equilibrium between the species in the aqueous phase, species activities are calculated using the phase average concentrations and then the law of mass actions [Eq. (2)] is applied. However, due to the slow nature of molecular diffusion in water (\(D\sim 10^{-9}\) m\(^2\)/s) and the variation in interfacial area due to pore-size heterogeneity (Maes and Soulaine 2018b), the phase distribution is often more accurately predicted using a linear transfer model (Maes and Soulaine 2018a), for which the transfer \(M_k\) (kmol/s) of species k from phase 1 to 2 is calculated as

$$\begin{aligned} M_k=\sum _{1 \le k\le N_c}\lambda _k A_{12}\left( H_kC_{k,1}-C_{k,2}\right) , \end{aligned}$$
(37)

where \(\lambda _k\) (m/s) is the mass exchange coefficient and \(A_{12}\) is the interfacial area between phase 1 and phase 2, which can be calculated as

$$\begin{aligned} A_{12}=\int _V \Vert \nabla \alpha _1\Vert dV. \end{aligned}$$
(38)

In addition, equilibrium models usually overpredict the chemical reaction rates (Alhashmi et al. 2015; Jiménez-Martínez et al. 2020). Instead a mixing-induced reaction rate is often introduced as

$$\begin{aligned} R_i = k_i \left( 1-\Omega _i\right) , \end{aligned}$$
(39)

where \(k_i\) (kmol/m\(^3\)/s) is the mixing-induced reaction constant and \(\Omega _i\) is the saturation index of reaction i. For example, for reaction i in Eq. (1) we define the saturation index as

$$\begin{aligned} \Omega _i=\frac{K_i a_{i,p}}{\prod _{j=1}^{\overline{N}_c} a_{j,p}^{\nu _{ij}}}. \end{aligned}$$
(40)

We will show in Sect. 4.1 how pore-scale modelling can be applied to calculate mixing reaction rates.

2.6 Implementation

The numerical method has been implemented in GeoChemFoam (Maes and Menke 2020), our reactive transport toolbox based on OpenFOAM® (OpenCFD 2016). The full code can be downloaded from www.julienmaes.com. The standard VOF solver of OpenFOAM®, so-called interFoam, has been extended for this purpose into another solver called interReactiveTransferFoam. The full solution procedure is presented in Fig. 2.

Fig. 2
figure 2

Full solution procedure for interReactiveTransferFoam

interFoam solves the system formed by Eqs. (16), (17) and (13) on a collocated Eulerian grid. A pressure equation is obtained by combining the continuity (Eq. (16)) and momentum [Eq. (13)] equations. These equations are then solved with a predictor–corrector strategy based on the pressure implicit splitting operator (PISO) algorithm (Issa et al. 1985). Three iterations of the PISO loop are used to stabilize the system. An explicit formulation is used to treat the coupling between the phase distribution equation [Eq. (17)] and the pressure equation. This imposes a limit on the time-step size by introducing a capillary wave time scale described by the Brackbill conditions (Brackbill et al. 1992).

In interReactiveTransferFoam, the concentration equation [Eq. (26)] is solved sequentially after the PISO loop. The interfacial mass transfer [Eq. (30)] is then computed and re-injected in the continuity [Eq. (16)] and phase equations [Eq. (17)]. The space discretization of the convection terms is then performed using the second-order vanLeer scheme (van Leer 1974). For the compression terms, the interpolation of \(\alpha _d\alpha _c\) is carried out using the interfaceCompression scheme (OpenCFD 2016). The diffusion term \(\nabla .\left( {D}_j\nabla c_j\right) \) is discretized using the Gauss linear limited corrected scheme, which is the second order and conservative. The discretization of the CST flux is performed using the phase upwinding scheme (Patsoukis-Dimou and Maes 2020). Finally, the chemical reaction step is solved using the Phreeqc (Parkhurst and Appelo 2013), and the interface with the transport solver is based on the Phreeqc reaction module implemented in USGS transport solver PHAST (Parkhurst and Wissmeier 2015). Phreeqc and PHAST solve for the total concentration \(\psi _j\). However, GeoChemFoam solves for the single-field concentration of primary and secondary species in order to satisfy the boundary conditions at the fluid–fluid interface [Eq. (26)], so the Phreeqc reaction module had to be slightly modified to account for this. GeoChemFoam includes Phreeqc and the new reaction module as a third-party software.

3 Verification

The multiphase transport model and its implementation in GeoChemFoam have previously been validated by comparison with analytical and semi-analytical solution for a range of 1D, 2D, and 3D problems (Maes and Soulaine 2018a, b, 2020). In particular, the calculation of the local volume change induced by interface transfer for a soluble phase has been validated by comparison with the analytical solution for dissolution of a gas phase in water in a 1D domain. In this study, we present the validation of the coupling between the multiphase transport and chemical reactions.

3.1 Multiphase Reactive Transport in 1D at Equilibrium

The objective of this test case is to validate the coupling between multiphase transport and chemical reactions by comparison with a system where an analytical solution exists. For this, we consider a system with three components (A, B, and AB) and two phases (water and gas). The three component species are diluted in the water phase (\(\rho _w=1000\ {\hbox {kg/m}^3}\)) with diffusion coefficient all equal to \(D=10^{-9}\ \hbox {m}^2\)/s. The gas phase (\(\rho _g=1\ {\hbox {kg/m}^3}\)) is a pure mixture made of component A (\(H_A=10\), \(M_{A}=1\) kg/kmol) while B and AB do not cross the interface (\(H_B=H_{AB}=0\)). The components in the water phase react following the bimolecular reaction

$$\begin{aligned} AB \rightarrow A + B. \end{aligned}$$
(41)

We assume that for this case that all activity coefficient \(\gamma _k=1.0\). Therefore, the law of mass action can be written as

$$\begin{aligned} c_{AB,w}=\frac{c_{A,w}c_{B,w}}{Kc_0}, \end{aligned}$$
(42)

where \(K=10.0\) is the equilibrium constant of the reaction [Eq. (41)].

The domain is a 1D tube of 1mm length (Fig. 3).

Fig. 3
figure 3

Set-up for multiphase reactive transport in 1D at equilibrium

The gas/liquid interface is initially positioned at a distance \(l_0=0.5\) mm from the left boundary. The left boundary has a constant pressure \(p=p_0\), with constant concentration \(c_{A,w}=0\), \(c_{B,w}=\frac{\rho _g}{H_AM_{A}}\) and \(c_{AB,w}=0\), while the right boundary has a no-flow condition.

Since the right boundary has a no-flow condition, and because the fluids are assumed incompressible, the velocity in the gas phase is equal to 0. Hence, the total mass conservation at the interface [Eq. (24)] can be written as

$$\begin{aligned} \rho _w\left( u_w-w\right) =-\rho _g, \end{aligned}$$
(43)

which leads to \(u_w\approx w\). Assuming that advective transport is negligible by comparison to diffusive transport, i.e.

$$\begin{aligned} Pe=\frac{wl_0}{D}<<1, \end{aligned}$$
(44)

the transport equation [Eq. (20)] can be considered to be at equilibrium at the time scale of interface displacement. Therefore,

$$\begin{aligned}&D\nabla ^2 c_{A,w}+D\nabla ^2 c_{AB,w} = 0, \end{aligned}$$
(45)
$$\begin{aligned}&D\nabla ^2 c_{B,w}+D\nabla ^2 c_{AB,w} = 0. \end{aligned}$$
(46)

Since \(K>>1\), \(c_{AB,w}<<c_{A,w}\) and \(c_{AB,w}<<c_{B,w}\), an approximated analytical solution for the concentration in the water phase is

$$\begin{aligned}&c_{A,w}=\frac{\rho _g}{M_{A}H_A}\frac{x}{l}, \end{aligned}$$
(47)
$$\begin{aligned}&c_{B,w}=\frac{\rho _g}{M_{A}H_A}\left( 1-\frac{\rho _g}{Kc_0M_{A}H_A}\frac{x}{l}\right) , \end{aligned}$$
(48)
$$\begin{aligned}&c_{AB,w}=\frac{\rho _g^2}{Kc_0M_A^2H_A^2}\frac{x}{l}\left( 1-\frac{\rho _g}{Kc_0M_AH_A}\frac{x}{l}\right) , \end{aligned}$$
(49)

As only the component A crosses the interface,

$$\begin{aligned} w=M_A\frac{D\nabla c_{A,w}(x=l)}{\rho _g}=\frac{D}{H_Al}, \end{aligned}$$
(50)

which shows that Eq. (44) is valid for \(H_A>>1\). Finally, integrating Eq. (50) gives

$$\begin{aligned} l(t)=l_0\sqrt{1+\frac{2Dt}{H_Al_0^2}}. \end{aligned}$$
(51)

The test case is simulated on regular grids with resolution \(\Delta x=\) 4 \(\mu \)m, 2\(\mu \)m, 1\(\mu \)m and 0.5 \(\mu \)m to test convergence, and with a constant time-step t=0.01 s. In order to compare with the analytical solution, the local volume change is initially turned off and the concentration of A in the gas phase is kept equal to 1 kmol/m\(^3\) until the concentrations in the water phase reaches an equilibrium. Local volume change is then turned on and the simulation is run until t=1000 s with eight processors on an intel Xeon core. The CPU times of these simulations are 102 min for \(\Delta x=\) 4\(\mu \)m, 150 min for \(\Delta x=\) 2\(\mu \)m, 213 min for \(\Delta x=\) 1\(\mu \)m, and 396 min for \(\Delta x=\) 0.5\(\mu \)m. The convergence is assessed in terms of the error in interface position

$$\begin{aligned} Err = max_{t}\left( \frac{l-l_{ref}}{l_{ref}}\right) , \end{aligned}$$
(52)

where reference position \(l_{ref}\) is the one obtained with \(\Delta x=\) 0.5\(\mu \)m.

Figure 4 shows the error as a function of the mesh resolution. The order of convergence is 0.9, showing close to first-order convergence.

Fig. 4
figure 4

Convergence in terms of error in interface position as a function of mesh resolution. The order of convergence is 0.9

Figure 5 shows a comparison between the simulated results with \(\Delta x=\) 0.5\(\mu \)m and analytical results. We obtain a very good agreement between the model and the analytical solution and have thus validated the coupling between multiphase flow with interface transfer and chemical reactions in our model.

Fig. 5
figure 5

Comparison between simulated and analytical results during multiphase reactive transfer in a 1D geometry (see Fig. 3). a Evolution of the interface position; b concentration profile of A at different times; c concentration profile of B at different times; d concentration profile of AB at different time.

3.2 Injection of a CaCl\(_2\) Solution in An Oil-Filled Tube in 2D

The objective of this test case is to show that, unlike the CST method, the simplified model [Eq. (31)] generates artificial mass transfer that damages the numerical solution. First, we consider a 2D straight microchannel of size 300 \(\mu \)m\(\times \) 100 \(\mu \)m. The fluid properties are summarized in Table 2. The channel is initially filled with oil. At t=0, we start injecting an aqueous solution of 1000 mg/L of CaCl\(_2\) from the left boundary at velocity \(U=3\) mm/s, which corresponds to \(Re=0.3\) and \(Ca=10^{-4}\). The solid boundaries are assumed to be oil-wet, with a contact angle of 45\(^\circ \). In addition, surface complexation occurs at the surface of the solid following the Na-montmorillonite SCM proposed by Bradbury and Baeyens (1997). Bulk and surface species are summarized in Table 3, and chemical reactions are summarized in Table 4. The surface density \(\Gamma \) of adsorption sites > is equal to 2.4 \(\mu \)mol/m\(^2\).

Table 2 Fluid properties for oil and CaCl\(_2\) solution system.
Table 3 Elements, primary species, secondary species, primary surface species, and secondary surface species for solution of CaCl\(_2\).
Table 4 Surface complexation reactions and their intrinsic stability constant on a clay surface Bradbury and Baeyens (1997).

The aqueous solution includes four dilute species (Ca\(^{2+}\), Cl\(^{-}\), H\(^+\) and OH\(^-\)). Each of these species only exists in the water phase, so that \(H_k=0\) and \(D_{k,2}=0\). The diffusion coefficient of species in the water phase are obtained from Li and Gregory (1973) and are summarized in Table 1. The transport of these species in the domain is strongly advection-dominated, with Péclet numbers varying from 10.2 to 127.

We assume that the surface of the solid has been previously equilibrated with the same solution of 1000 mg/L of CaCl\(_2\). Therefore, the chemical equilibrium should be unchanged and the concentration in the water phase constant.

The simulations are performed on a 150\(\times \)50 Cartesian grid with a constant time-step \(\Delta t= 0.5\) ms. Figure 6 shows the concentration maps for Ca\(^{2+}\) and H\(^+\) obtained with each method at t=0.15 s. We see that the CST method leads to a sharp interface between species concentration and oil phase fraction, with constant concentration in the aqueous phase. No artificial mass transfer occurs and the system remains at chemical equilibrium. However, the simplified method leads to a large amount of artificial mass transfer. The species concentrations in the aqueous phase appear diffused and we obtain significant concentration in the oil phase that is purely induced by numerical errors. Note that the simplified model only considers the concentration in the aqueous phase, so the error of concentration in the oil phase can be ignored. However, as a result of the concentration diffusion in the water phase, the chemical equilibrium is disturbed and the concentration of surface species on the solid boundary changes.

Fig. 6
figure 6

Concentration maps for Ca\(^{2+}\) and H\(^+\) obtained with the CST method and with the simplified method at t=0.15 s.

Fig. 7
figure 7

Concentration of >Ca\(^+\) along the x-axis obtained with the CST method and with the simplified method at t=0.15 s.

Figure 7 shows the concentration of >OCa\(^+\) along the x-axis at t=0.15 s. We observe that the CST method leads to a constant concentration with no change of concentration by chemical reaction, while the simplified model has a decrease of 5\(\%\) of >OCa\(^+\) across the interface, indicating that changes of concentration by chemical reaction have occurred.

This example demonstrates that the CST method rather than the simplified model should be employed to simulate multicomponent reactive transport in pore-scale images. Additionally, the CST method only requires the computational of two additional fluxes (species compression and CST fluxes), so the increase in CPU time is very limited. For the case presented here, the simplified model ran for 6067 s with two processors on an intel Xeon core, while the CST method ran for 6127 s, representing an increase in computational expense of 1\(\%\).

4 Applications

In this section we show how GeoChemFoam can be used to simulate and upscale various reactive processes in pore-scale geometries. The test case folders are given in supplementary materials.

4.1 Test Case 1: CO\(_2\) gas dissolution in a 3D pore cavity

In this example, we investigate interface transfer and chemical reactions during dissolution of a CO\(_2\) gas bubble in a pore cavity. The model domain is the same as presented in Patsoukis-Dimou and Maes (2020). The geometry is a 6mm\(\times \)1mm\(\times \)1mm channel, with a 2mm\(\times \)2mm\(\times \)1mm cavity inserted in the middle (Fig. 8). The domain is meshed using a uniform grid with resolution 50 microns. Initially, CO\(_2\) gas is trapped in the cavity and the rest is filled with water. The fluid properties are summarized in Table 5.

Fig. 8
figure 8

Schematic diagram of the cavity geometry and initial conditions from Patsoukis-Dimou and Maes (2020)

Table 5 Fluid properties for CO\(_2\) dissolution in a cavity.

The system contains three primary and three secondary species, summarized in Table 6. Each species with the exception of H\(_2\)O is dilute in the aqueous phase. The evaporation of H\(_2\)O into the gas is neglected, so that Eq. (30) can be applied (Maes and Soulaine 2020), and the gas phase is pure CO\(_2\). The diffusion coefficient and Henry’s constant are summarized in Table 1.

The system includes three chemical reactions that are summarized in Table 7. As CO\(_2\) dissolves in the water phase, H\(^+\) and HCO\(_3^-\) are created and the chemical equilibrium is modified, leading to a decrease in pH.

Table 6 Elements, primary species, and secondary species for carbonated water
Table 7 CO\(_2\)-water reactions

At t=0, we inject pure water at pH=7 from the left boundary at a flow rate of 0.1 mL/min which corresponds to a capillary number of 3.3\(\times 10^{-6}\). The simulation is run with 24 processors on an intel Xeon core until t=3 min with a constant time-step \(\Delta t=50\) \(\mu \)s. The total CPU time of this simulation was 6 days.

Fig. 9
figure 9

Concentration map of CO\(_2\), OH\(^-\) and HCO\(_3^-\) at the mid-plan during dissolution of a CO\(_2\) bubble in a 3D pore cavity at t= 1 min, 2 min and 3 min. The gas/water interface is shown in white, and the concentration are shown with a colour map on a log scale to enhance the contrasts

Figure 9 shows the concentration map of CO\(_2\), OH\(^-\) and HCO\(_3^-\) at the mid-plane at t= 1 min, 2 min, and 3 min. The gas/water interface is shown in white. The concentrations are shown with a colour map on a log scale to enhance the contrast. We observe that the mixing of species in the water phase is poor. This is because, even though the flow rate is low with Re and Ca well into the creeping and capillary dominated regime, the transport of species is still advection-dominated. For example, the Péclet number for the CO\(_2\) species is equal to 104. Therefore, there is a strong difference between the concentrations upstream and downstream of the cavity. From the inlet and up to the cavity, pH is close to 7 with no CO\(_2\) present. Within the cavity, the water on top of the gas bubble has a pH close to 4 and a CO\(_2\) concentration close to 0.03 kmol/m\(^3\). From the end of the cavity to the outlet, the pH is close to 5 and CO\(_2\) is present at the bottom of the channel with a concentration close to 0.004 kmol/m\(^3\), but no CO\(_2\) is present in the top part of the channel.

Poor mixing has a strong impact when upscaling the chemical reactions to the larger scales. In Fig. 12, the evolution of gas saturation as well as the concentrations of CO\(_2\), OH\(^-\) and HCO\(_3^-\) obtained in the pore-scale simulation are compared with the results obtained when using a fully mixed equilibrium model. The results diverge significantly as the concentrations in the equilibrium model trend in the opposite direction to those of the pore-scale simulation. This divergence occurs with the equilibrium model because the CO\(_2\) dissolves instantaneously in the water phase, forming a carbonic acid that significantly reduces the pH of the water, and then the acid is slowly flushed out of the domain and the water becomes increasingly neutral.

However, in reality, the phase transfer occurs on a much larger time scale (Fig. 12a) and thus a linear transfer model would be more appropriate to simulate this at the larger scale. Using Eq. (37), the mass exchange coefficient for CO\(_2\) can be calculated from the results of the pore-scale simulation as

$$\begin{aligned} \lambda _{\text {CO}_2}= \frac{M_{\text {CO}_2}}{A_{12}\left( H_{\text {CO}_2}C_{\text {CO}_2,1}-C_{\text {CO}_2,2}\right) }. \end{aligned}$$
(53)

The mass exchange coefficient is plotted as a function of the gas saturation \(S_2\) in Fig. 10 and we observe that it can be approximated as a linear function of \(S_2\)

$$\begin{aligned} \lambda _{\text {CO}_2}\approx \lambda _{\text {CO}_2}^o+\lambda _{\text {CO}_2}^1S_2 \end{aligned}$$
(54)

where \(\lambda _{\text {CO}_2}^o=10^{-4}\) m/s and \(\lambda _{\text {CO}_2}^1=6.2\times 10^{-4}\) m/s. The evolution of the gas saturation in the domain can then be estimated using this linear transfer model, and the results are plotted in Fig. 12 and compared to the pore-scale and equilibrium models. Contrary to the equilibrium model, the evolution of saturation obtained using the linear transfer model are well fitted to the results of the pore-scale simulations.

In addition, the incomplete mixing in the water phase induces a delay in the chemical reactions and the phase average concentration of species in the domain are not at chemical equilibrium. Mixing-induced reaction rates can be calculated during the pore-scale simulation by integrating the changes of concentrations obtained by chemical reaction (calculated by Phreeqc) over the full simulation domain. Figure 11 shows the evolution of the reaction rates of the three reactions present in the system (Table 7). We observe that the rates of reactions 1 and 2 converge towards a plateau, which is typical of a mixing-induced reaction constant that does not depend on saturation. However, the rate of reaction 3 consistently decreases from t=0.5 min, which suggests that the mixing-induced reaction constant \(k_3\) decreases as the gas saturation increases. The saturation indexes \(\Omega _1\), \(\Omega _2\) and \(\Omega _3\) are calculated based on the averaged concentrations in the water obtained from the pore-scale simulation, and the mixing-induced reaction rates are calculated with constant \(k_1=1.80\times 10^{-11}\) and \(k_2=1.04\times 10^{-12}\) kmol/m\(^3\)/s. These along with \(k_3=\frac{5.30\times 10^{-7}}{1-\alpha _2}\) kmol/m\(^3\)/s are plotted in Fig. 11 and compared with the rates obtained from the pore-scale simulation results. We observe that the mixing-induced rates are well fitted to the pore-scale simulation results after an initialization time of about 0.5 min.

Fig. 10
figure 10

Mass exchange coefficient calculated from the pore-scale simulation during dissolution of a CO\(_2\) gas bubble in a 3D pore cavity and linear approximation \(\lambda _{\text {CO}_2}\approx \lambda _{\text {CO}_2}^o+\lambda _{\text {CO}_2}^1S_2\) use in the linear transfer model, with \(\lambda _{\text {CO}_2}^o=10^{-4}\) m/s and \(\lambda _{\text {CO}_2}^1=6.2\times 10^{-4}\) m/s

Fig. 11
figure 11

Evolution of the reaction rates of the three reactions present in a CO\(_2\) water system (Table 7) during dissolution of a CO\(_2\) gas bubble in a 3D pore cavity, and comparison with mixing-induced reaction models with \(k_1=1.80\times 10^{-11}\), \(k_2=1.04\times 10^{-12}\) and \(k_3=\frac{5.30\times 10^{-7}}{1-\alpha _2}\) kmol/m\(^3\)/s.

Fig. 12
figure 12

Evolution of a gas saturation and concentration of b CO\(_2\), c OH\(^-\) and d HCO\(_3^-\) in the water phase obtained with pore-scale, equilibrium and linear transfer with mixing-induced reaction rates models during dissolution of a gas bubble in a 3D pore cavity

These mixing-induced rates are included in the linear transfer model, and the concentration of CO\(_2\), OH\(^-\) and HCO\(_3\) obtained is plotted in Fig. 12 and compared to the results of the pore-scale and equilibrium models. Contrary to the equilibrium model, the evolution of the average concentrations in the water phase obtained using the linear transfer model are well fitted to the results of the pore-scale simulations. We can thus analyse the results of the pore-scale simulation to develop an accurate upscaled model based on linear transfer and mixing-induced reaction rates.

4.2 Test Case 2: Injection of a CaCl\(_2\) Solution in a Micro-CT Image

We now investigate multiphase multicomponent reactive transport in a micro-CT image. First, we simulate aqueous CaCl\(_2\) injection into an oil saturated pore space with surface complexation. Then from the pore-scale result we calculate volume averaged saturation and concentration and compared it to the result an upscaled equilibrium model. Then, we propose a correction to the upscaled equilibrium model based on a reduced surface charge.

The image is a 1000\(^3\) voxel micro-CT image of Bentheimer sandstone with a resolution of 2.5 microns, which can be downloaded from the Digital Rock Portal https://dx.doi.org/10.17612/f4h1-w124. A 512\(^3\) voxel image is extracted from the centre of the image for this example.

The domain is meshed using the OpenFoam® snappyHexMesh utility (OpenCFD 2016). First, a 128\(^3\) Cartesian grid is generated. Next, each grid block that is crossed by the solid surface is refined once in each direction, leading to resolution of 5 microns. The cells in the solid phase are then removed, while the cells that intersect the rock/pore interface are replaced by hexahedral or tetrahedral cells that match the solid boundaries. The final mesh contain 2,315,379 cells (Fig. 13). The porosity \(\phi \) can then be calculated from the mesh and the absolute permeability \(K_a\) can be estimated by solving the Stokes equation (Talon et al. 2012). Our image has a porosity of 0.22 and a permeability of \(2.9\times 10^{-12}\) m\(^2\) .

Fig. 13
figure 13

Computational mesh for injection of a CaCl\(_2\) solution in a micro-CT image of Bentheimer obtained with OpenFOAM and zoom into the bottom left corner

Fig. 14
figure 14

a Water phase fraction, b concentration of H\(^+\) in the water in the bulk, and c concentration of >OCa\(^+\) and d >O\(^-\) on the solid surfaces at t=0.5 during injection of a CaCl\(_2\) solution in a micro-CT image of Bentheimer sandstone.

The fluid properties (Table 2), species (Table 6) and chemical reactions (Table 4) are the same as the ones used in Sect. 3.2. The pore space is initially filled with oil and the surface of the solid has been previously equilibrated with a solution of 1000 mg/L of CaCl\(_2\). At t=0, we inject from the left boundary with a solution of 100 mg/L of CaCl\(_2\) at constant velocity U=3mm/s, corresponding to a capillary number \(Ca=10^{-4}\). A constant pressure is set at the right boundary, while the top, bottom, front and back boundaries have a no-flow condition. The solid boundaries are assumed to be oil-wet, with a contact angle of 45\(^o\). The simulation is run until t=0.5 s with a constant time-step \(\Delta t=1\) \(\mu \)s with 24 processors on an intel Xeon core. The total CPU time of this simulation was 31 days.

Figure 14 shows the water phase fraction, the concentration of H\(^+\) in the water in the bulk phase, and the concentration of >OCa\(^+\) and >O\(^-\) on the solid surfaces at t=0.5 s. Although the mixing of H\(^+\) is not complete, it is better than the mixing in the previous test case, with most values of H\(^+\) concentration close to 4\(\times 10^{-8}\) kmol/m\(^3\). However, the mixing on the solid surface is very poor.

The fractional flow of water at the outlet is calculated from the pore-scale results and plotted in Fig. 15. The curve is fitted to a Brooks–Corey model where \(k_{r1,max}=k_{r2,max}=1.0\), \(S_{wc}=0.24\), \(S_{nar}=0.25\), \(n_1=2\), and \(n_2=3\), which is also plotted in Fig. 15. Fractional flow is used in an upscaled model to calculate the evolution of the total water saturation in the domain. The results are plotted in Fig. 16a along with the water saturation obtained with the pore-scale simulation. The upscaled model fits the pore-scale simulation with a high degree of accuracy.

Fig. 15
figure 15

Fractional water flow as a function of water saturation during injection of a CaCl\(_2\) solution in a micro-CT image of Bentheimer sandstone, calculated from the pore-scale simulation results and using the Brook–Corey model, with \(k_{r1,max}=k_{r2,max}=1.0\), \(S_{wc}=0.24\), \(S_{nar}=0.25\), \(n_1=2\) and \(n_2=3\)

Fig. 16
figure 16

Evolution of a water saturation, b phase averaged concentration of H\(^+\) in the water, and c average concentration of >OCa\(^+\) and d >O\(^-\) on the solid surfaces obtained using a pore-scale model, an upscaled model and a corrected upscaled model during injection of a CaCl\(_2\) solution in a micro-CT image of Bentheimer sandstone

We then run a reactive transport simulation using an upscaled equilibrium model, where the mass action laws (Eq. (2) are calculated using the average concentration of solution species in the water phase and the average concentration of surface species on the solid surface. The results are plotted in Fig. 16b, c and d, along with the concentrations obtained in the pore-scale simulation. We observe that the equilibrium model predicts a higher concentration of >OCa\(^+\) and a lower concentration of >O\(^-\). This suggests that the equilibrium model does not overpredict the reaction rate, like in the previous case, but underpredicts it. Therefore, the simulation cannot be improved by defining mixing-induced reaction rates. Instead, the chemical equilibrium itself should be modified. Since the simulation predicts a higher concentration of >OCa\(^+\) and a lower concentration of >O\(^-\), the surface charge in the equilibrium model is lower in absolute value than the one obtained in the pore-scale model. This discrepancy will have a large impact on the chemical equilibrium as the equilibrium constant depends strongly on the surface charge through the surface potential [Eq. (8)].

In order to obtain a more accurate prediction, the model is corrected by multiplying the surface charge q [Eq. (6)] by 0.95 before calculating the surface potential [Eq. (7)]. The results of the corrected model are plotted in Fig. 16. The corrected model gives significantly more accurate results than the initial upscaled model. However, the errors in the surface concentrations are increasing and the concentration of H\(^+\) in the bulk remains significantly lower than the one obtained in the pore-scale simulation. This suggests that the model could be further improved by defining mixing-induced reaction rates with the corrected equilibrium constant.

5 Conclusion

In this study, we presented a novel multiphase reactive transport model to perform direct numerical simulation of multiphase flow, multicomponent transport and geochemical reactions on pore space images. The model is implemented in GeoChemFoam, our reactive transport toolbox. GeoChemFoam is based on OpenFOAM® (OpenCFD 2016), an established library to solve partial differential equations, and Phreeqc (Parkhurst and Appelo 2013), the most prevalent geochemical solver. The multiphase flow was solved using the VOF method (Hirt and Nichols 1981), and the transport of species using the CST method (Maes and Soulaine 2018a). The reactive transport solver was based on a sequential non-iterative operator splitting approach (Carrayrou et al. 2004) and the chemical equilibrium was solved with Phreeqc.

The model and its implementation were validated successfully for simple configurations where analytical solutions exist. In particular, we showed that the CST method provides an accurate representation of interface boundary conditions free of artificial mass transfer, and it can therefore be applied to model reactive transport in multiphase systems.

We then used our numerical toolbox to simulate two test cases. In test case 1, we simulated reactive transport during dissolution of a CO\(_2\) gas bubble in a 3D pore cavity. The liquid/gas interface was tracked as well as the concentration of each reactive species in the domain and incomplete mixing was observed. We showed that an upscaled model based on phase and chemical equilibrium could not predict accurately the evolution of average phase saturations and species concentrations in the domain. Instead, the total flux of interface transfer and the average reaction rates in the domain were calculated and we showed that an upscaled model based on linear transfer and mixing-induced reaction rates could accurately predict the evolution of average phase saturations and species concentrations in the domain.

Finally, in test case 2 we simulated multiphase reactive transport in a micro-CT image of Bentheimer sandstone where a solution of CaCl\(_2\) was injected into an oil saturated domain with surface complexation at the solid surface. The concentration map of each species on the solid surface was calculated and we observed a poor mixing of charge on the surface. We then ran an upscaled model based on chemical equilibrium and observed that it was overpredicting the change of surface concentration by chemical reactions. Thus, we show that surface concentrations cannot be modelled by mixing-induced reaction rates, and the chemical equilibrium need to be modified to take these into account. We then demonstrated that a corrected model that multiply the total surface charge by 0.95 was giving a significantly more accurate result.

The work presented in this paper has wide ranging applications in the oil and gas, carbon capture and storage, contaminant transport, battery, and fuel cell industries. Our simulation framework together with the upscaling methodologies proposed in this paper are an important step forward in our objective of fully characterizing multiphase reactive transport in porous media. Furthermore, this model enables the use of sensitivity analysis to understand how upscaled properties such as the mass exchange coefficient and mixing-induced reaction rates can change with respect to system properties such as injected flow rate or pore-size distribution. In addition, this numerical model can now be bootstrapped to field scale multiphase reactive transport simulators using machine-learning regression models by extending work already done for single-phase flow and transport (Menke et al. 2021) with the ultimate goal of developing upscaling strategies that do not require pore-scale simulations (Lichtner and Kang 2007).