1 Introduction

Interphase mass transfer in porous media involving multiple fluid phases is a fundamental process that appears in a large number of situations of applied science and engineering including the injection and sequestration of \(\hbox {CO}_{2}\) into the subsurface, the aquifer contamination by non-aqueous phase liquids (NAPL), and the primary migration of bitumen in petroleum reservoirs. In all these processes, two immiscible phases share the pore space. The phases distribution in the domain is process dependent involving complex configurations such as the entrapment of one of the phase by the flowing phase or the formation of thin films. Molecules may cross the interface that separates the different fluid phases. For example, the migration of bitumen produces important changes in composition and crude oils become progressively more paraffinic with increasing distance of migration (Waples 1981). This mass transfer may have different consequences, ranging from a simple change in the composition of the fluids to stronger impacts on the flow properties both locally and at very large scales. For example, once the supercritical \(\hbox {CO}_{2}\) is injected into the Earth’s subsurface, it flows as a separate phase forming an immiscible interface with the brine already in place. Complex capillary mechanisms, mostly governed by the wettability of the mineral surface, lead to the trapping of \(\hbox {CO}_{2}\) ganglia in the pore space. The \(\hbox {CO}_{2}\) from the supercritical phase dissolves in the aqueous phase to form carbonic acid which lowers the pH of the brine as the carbonic acid dissociates to the bicarbonate ions (Steefel et al. 2013; Cohen and Rothman 2015). The acid ions are then transported by advection and diffusion to the mineral surface where the dissolution and precipitation of the minerals might occur (Molins et al. 2014). These pore-scale processes associated with the injection and sequestration of \(\hbox {CO}_{2}\) into deep saline aquifer can completely reorganize the pore space, which means that the rock permeability and porosity evolve and consequently impact the flow properties at larger scales (Soulaine and Tchelepi 2016).

Fig. 1
figure 1

a Illustration of the mass transfer between two immiscible phases in a porous medium. b The thermodynamics equilibrium at the interface is described by Henry’s law

Significant efforts have been made to model the interphase mass transfer for subsurface processes. In particular, the most recent developments were related to the contamination of the water tables from the NAPL dissolution (Khachikian and Harmon 2000; Agaoglu et al. 2015). As it is commonly practiced for flow and transport in porous media, the interphase mass transfer can be investigated with different approaches, with a pore-scale modeling approach where the solid skeleton of the porous structure and all the interfaces between the fluids are explicitly described (see Fig. 1), or with a physics based on macroscale equations averaged over a representative elementary volume (REV) of the porous medium. Although physical mechanisms are the same for the two approaches, the mathematical tools used to represent the physics at these different scales may differ significantly. On the one hand, at the pore scale, the thermodynamics equilibrium of the system is defined as the equality of the chemical potentials for each species at the interface between the phases. When this condition is violated, there is mass flux from one phase to one another to reach a new thermodynamics equilibrium state. With REV-based approaches, on the other hand, non-local equilibrium models are often used to describe the multicomponent multiphase mass transfer and an exchange coefficient is introduced to quantify the mass exchange in the REV (Soulaine et al. 2011). These two modeling approaches are intrinsically related to each other, and upscaling techniques such as volume averaging have been used to derive the macroscale equations from the pore-scale physics (Quintard and Whitaker 1994; Kechagia et al. 2002; Coutelieris et al. 2006; Soulaine et al. 2011). Although the theoretical framework is now established to link the two different descriptions of the interphase mass transfer physics, many challenges arise to derive a general expression for this interphase mass exchange coefficient.

Clearly, the mass exchange coefficient is a function of the interfacial area because it characterizes the rate of mass transfer of the compounds across the interface. This is a difficult data to assess since it depends on many factors including solid topology, mineral wettability, and boundary conditions of the REV (Lenormand et al. 1988). Indeed, the phase distribution may form very different patterns like fingering instabilities, ganglia of the non-wetting phase trapped by capillarity, or thin films formed by the wetting phase. The macroscale expression of the interphase mass transfer may vary a lot according to these different situations. Hence, under thin films conditions, most of the mass transfer occurs from the film area. Various correlations developed based on ideal situations like the double film theory that postulates that the local mass transfers occur in a thin layer on each side of the interface (Lewis and Whitman 1924), like the penetration model (Higbie 1935) or like the surface renewal theory (Danckwerts 1970) usually failed to predict the mass transfer across interfaces in subsurface processes, mostly because of the complexity of flow in natural porous media. Hence, process-dependent correlations have been proposed from one-dimensional column experiments (Miller et al. 1990). If the interfacial area is probably one of the most influential parameters on interphase mass transfer, many other parameters influence the process. It has been shown that the interphase mass transfer coefficient increases significantly with velocity because it affects the rate of renewal of the compounds at the interface. However, no universal law has been proposed yet to quantify this dependency.

During the last decades, there have been important improvements in the experimental and numerical techniques to get more insight, directly from the pore scale, about the multicomponent multiphase mass transfer mechanisms. The use of glass bead or micromodel experiments combined with image analysis allows a direct visualization of the different processes involved (Kennedy and Lennox 1997; Powers et al. 1998; Jia et al. 1999; Sahloul et al. 2002; Chomsurin and Werth 2003). Particle image velocimetry techniques allow high-resolution measurement of the velocity profile in micromodels and offer new possibilities to investigate the pore-scale processes (Roman et al. 2016). Dye is often used to map the concentration evolution of a component in the system. Powers et al. (1992), however, reported that this could modify significantly the interfacial tension by 10–30% and may affect mass transfer rates as well. Moreover, magnetic resonance imaging is also used to acquire three-dimensional images of NAPL blobs during dissolution from columns packed with angular silica gel grains or spherical glass beads (Johns and Gladden 1999; Zhang et al. 2002).

The use of numerical models to simulate interphase mass transfer at the pore scale is not new. The advances in pore-scale simulators have closely followed the progress of small-scale experimental techniques and image analysis. The numerical models can be divided into the direct modeling approaches where Navier–Stokes or Boltzmann equations are directly solved in the void of the porous structure and into the pore network models (PNM) in which the porous medium is represented as a network of pore bodies and pore throats where the flow is ruled by Poiseuille’s law. Most of the early progress for the pore-scale simulation of interphase mass transfer was related to NAPL dissolution using PNM (Jia et al. 1999; Dillard and Blunt 2000; Dillard et al. 2001; Held and Celia 2001; Zhao and Ioannidis 2003, 2011). In these works, all the displacement mechanisms were not covered since it was assumed that the dissolving phase was immobile, trapped in the pore throats or bodies. Because in the case of NAPL dissolution most of the mass transfer occurs from the film area, the cylindrical bonds of the PNM were replaced by throats of rectangular cross section to account for the stagnant film residing in angular pores. Mass transfer models for pore-scale corner flow were developed from analytical solutions (Dillard and Blunt 2000; Zhou et al. 2000; Sahloul et al. 2002) or finite-element simulations (Zhao and Ioannidis 2007) and input to the PNM with various success. The direct modeling approaches, on the other hand, can relax the restrictions of the PNM. In particular, the approximation of the pore space geometry and the hypothesis that the dissolving phase is immobile. Lattice Boltzmann methods (LBM) have been proposed for the simulation of multiphase mass transfer and reaction of dilute species (Martys and Chen 1996; Swift et al. 1996; Knutson et al. 2001; Riaud et al. 2014).

The direct solution of Navier–Stokes equations is performed using interface capturing methods, such as level set (LS) (Sussman et al. 1994) or volume of fluid (VOF) (Hirt and Nichols 1981; Brackbill et al. 1992). Although these methods have great potential to simulate complex multiphase processes such as drainage or imbibition in complex pore space (Hoang et al. 2013; Horgue et al. 2013; Ferrari and Lunati 2013; Ferrari et al. 2015; Raeini et al. 2014; Santiago et al. 2016; Roman et al. 2017), multiple challenges remain. One of them is the apparition of parasitic velocities at the vicinity of the interface due to an inaccurate computation of the curvature. This issue is still a topic of active research for two-phase flow at low capillary numbers (Abadie et al. 2015). Another difficulty is to transport a concentration field in the system while insuring flux continuity and the concentration jump due to the thermodynamics equilibrium at the interface (Yang et al. 2005). This second point has been addressed by Haroun et al. (2010b) who proposed a robust formulation recently referred to as Continuum Species Transfer (CST) formulation (Marschall et al. 2012; Deising et al. 2016) to treat the jump discontinuity consistently with the VOF approach while satisfying the continuity of the mass flux across the interface. This technique has been applied with success to simulate the mass transfer in liquid film flowing along corrugated surfaces (Haroun et al. 2010a, 2012). The approach, however, excluded the presence of triple lines at the solid walls. In this work, we implement and extend the CST technique to simulate subsurface processes with moving contact line such as the injection of supercritical \(\hbox {CO}_{2}\) into saline aquifers.

The paper is organized as follows. In Sect. 2, we describe the volume-of-fluid approach combined with the CST formulation and its extension to solid boundaries. Then, in Sect. 3, we present some simulation results to illustrate the potential of this technique to investigate and upscale mass transfer in complex porous media from the pore scale.

2 Mathematical Model

In this section, we describe the methodology used to solve a two-phase multicomponent mass transfer in porous media at the pore scale. First, the volume-of-fluid formulation for the multiphase flow is described. Then, we discuss the implementation of the concentration equation in a two-phase system with a mass transfer at the fluid/fluid interface and the extension of the formulation at the solid boundary.

2.1 Volume-of-Fluid Formulation

The Navier–Stokes equations for multiphase system are solved with a volume-of-fluid formulation. Even though it is valid for all kind of fluid pairs, we consider a gas/liquid system for the rest of the paper. This approach works with an Eulerian grid where the physical quantities are averaged over the volume of a grid cell. We note \({\bar{\beta }}_{p}=\frac{1}{V}\int _{V_{p}}\beta _{p}\mathrm{d}V\) the average of a quantity \(\beta _{p}\) defined in the phase \(p=l,g\), where V is the cell volume and \(V_{p}\) is the volume occupied by this phase in the cell. The volume fraction of liquid in every cells denoted \(\alpha \) describes the phase distribution in the void space as illustrated in Fig. 2.

Fig. 2
figure 2

Volume-of-fluid representation of the gas/liquid interface. Numbers represent the numerical value of \(\alpha \) in each cell

If \(\alpha =1\) (respectively \(\alpha =0\)), then the cell is occupied by liquid (respectively gas) only. Intermediate values of the phase indicator function, i.e., \(0<\alpha <1\), correspond to cells that contain the gas/liquid interface. We call the phase indicator function a global variable because it is defined in every cell of the computational domain. Likewise, combining the cell average quantity \({\bar{\beta }}_{p}\) defined in the phase \(p=l,g\) only, and the phase indicator function, the global variable \({\bar{\beta }}\) for any physical quantities such as pressure, velocity, density, and viscosity is defined over the entire computational grid as,

$$\begin{aligned} {\bar{\beta }}=\alpha {\bar{\beta }}_{l}+\left( 1-\alpha \right) {\bar{\beta }}_{g}. \end{aligned}$$
(1)

Hence, a unique field describes this quantity regardless the nature of the phase that occupies the cell. The VOF formulation solves partial differential equations that govern these global variables.

Under isothermal conditions, assuming the fluids are incompressible, and neglecting the contribution of gravity effects, the velocity, \(\bar{\mathsf {v}}\), and pressure, \({\bar{p}}\), satisfy the following Navier–Stokes equations describing multiphase flow in the VOF method (Hirt and Nichols 1981),

$$\begin{aligned} \nabla .\bar{\mathsf {v}}=0, \end{aligned}$$
(2)

and,

$$\begin{aligned} \rho \left( \frac{\partial \bar{\mathsf {v}}}{\partial t}+\bar{\mathsf {v}}.\nabla \bar{\mathsf {v}}\right) =-\nabla {\bar{p}}+\nabla .\mu \left( \nabla \bar{\mathsf {v}}+^{t}\nabla \bar{\mathsf {v}}\right) +\mathsf {F}_{c}, \end{aligned}$$
(3)

where the density and viscosity are defined with \(\rho =\alpha \rho _{l}+\left( 1-\alpha \right) \rho _{g}\) and \(\mu =\alpha \mu _{l}+\left( 1-\alpha \right) \mu _{g}, \rho _{p}\) and \(\mu _{p} (p=l,g)\) being the physical properties per phase. The last term of the right-hand side of the momentum equation, Eq. (3), describes interfacial forces. It is evaluated numerically with the classical continuum surface forces (CSF) model (Brackbill et al. 1992) using the phase indicator, \(\alpha \), to compute the normal to the interface and the curvature,

$$\begin{aligned} \mathsf {F}_{c}=\sigma \nabla .\left( \frac{\nabla \alpha }{\left\| \nabla \alpha \right\| }\right) \nabla \alpha . \end{aligned}$$
(4)

Finally, the phase indicator function is tracked with the following relation,

$$\begin{aligned} \frac{\partial \alpha }{\partial t}+\nabla .\left( \bar{\mathsf {v}}\alpha \right) +\nabla .\left( \alpha \left( 1-\alpha \right) \bar{\mathsf {v}}_{r}\right) =0, \end{aligned}$$
(5)

where \(\bar{\mathsf {v}}_{r}\) is the relative velocity between the two phases at the interface, also called compressive velocity (Rusche 2003). Equation 5 results from the volume averaging of the continuity equations for the two phases (Graveleau 2016). The last term in this expression controls the sharpness of the interface. The relative velocity is normal to the interface, and its value is estimated according to the maximum velocity magnitude in the transition region (Rusche 2003).

2.2 Concentration Equation

The last ingredient of the model concerns the transport of the chemical components in the fluid phases. In a multiphase system, the species are present in both fluid phases. For instance, there is \(\hbox {CO}_{2}\) in the gas phase and dissolved \(\hbox {CO}_{2}\) in the aqueous phase. The system is described using the concentration \(C_{l,A}\) (resp. \(C_{g,A}\)) of the species A in the liquid (resp. gas). In each phase p, the concentration is governed by the classical advection–diffusion equation,

$$\begin{aligned} \frac{\partial C_{p,A}}{\partial t}+\nabla .\left( \mathsf {v}_{p}C_{p,A}\right) =\nabla .\left( D_{p,A}\nabla C_{p,A}\right) ,\,\text {with}\,p=l,g, \end{aligned}$$
(6)

where \(D_{p,A}\) is the molecular diffusion coefficient of A in phase p. At the gas/liquid interface, there is continuity of mass fluxes and chemical potentials. The latter condition is usually described by a partitioning relation such as Henry or Raoult laws (see Fig. 1), that states that, at the interface, the concentration in the liquid phase is proportional to the partial pressure of the species in the gas phase. The two boundary conditions at the interface become

$$\begin{aligned} \mathsf {n}_{lg}.\left( C_{l,A}\left( \mathsf {v}_{l}-\mathsf {w}\right) -D_{l,A}\nabla C_{l,A}\right) =\mathsf {n}_{lg}.\left( C_{g,A}\left( \mathsf {v}_{g}-\mathsf {w}\right) -D_{g,A}\nabla C_{g,A}\right) , \end{aligned}$$
(7)

and

$$\begin{aligned} C_{l,A}=H_{A}C_{g,A}, \end{aligned}$$
(8)

where \(\mathsf {n}_{lg}\) is the normal at the interface, \(\mathsf {w}\) is the velocity of the interface, and \(H_{A}\) is the partitioning coefficient or Henry’s constant. When this condition is not fulfilled, there is mass transfer between the fluid phases in order to reach the thermodynamics equilibrium.

As mentioned in the first part of the mathematical description of the problem, with the VOF formulation the quantities of interest in the model are the global variables. For the species A, it is defined as,

$$\begin{aligned} {\bar{C}}_{A}=\alpha {\bar{C}}_{l,A}+\left( 1-\alpha \right) {\bar{C}}_{g,A}. \end{aligned}$$
(9)

Haroun et al. (2010b) derive a partial differential equation that governs the evolution of the global variable \({\bar{C}}_{A}\), while satisfying simultaneously Henry’s law at the gas/liquid interface and the continuity of fluxes across the interface. This formulation, recently referred to as Continuum Species Transfer (CST) model (Marschall et al. 2012; Deising et al. 2016), is fully consistent with the VOF approach, i.e., a single equation holds for the evolution of species concentration in both phases including interfacial effects. We have,

$$\begin{aligned} \frac{\partial {\bar{C}}_{A}}{\partial t}+\nabla .\left( \bar{\mathsf {v}}{\bar{C}}_{A}\right) =\nabla .\left( D_{A}\left( \nabla {\bar{C}}_{A}+\varvec{\Phi }_{A}\right) \right) , \end{aligned}$$
(10)

where \(D_{A}\) is the diffusion, \(\varvec{\Phi }_{A}\) is the Continuum Species Transfer (CST) term. This additional flux in Eq. (10), \(\varvec{\Phi }_{A}\), results from the concentration jump at the gas/liquid interface. It transforms the solubility condition, Eq. (8), into a volumetric term, CST, under the framework of the VOF formulation (Haroun et al. 2010b). It reads,

$$\begin{aligned} \varvec{\Phi }_{A}=-\frac{{\bar{C}}_{A}\left( H_{A}-1\right) }{H_{A}\alpha +\left( 1-\alpha \right) }\nabla \alpha . \end{aligned}$$
(11)

It is responsible for the concentration jump at the interface while the flux continuity across the interface remains always insured. It is somehow reminiscent of the continuum surface force (CSF) used for the modeling of the surface tension between two fluids Brackbill et al. (1992). Note that if \(H_{A}=1\), then \(\varvec{\Phi }_{A}=0\) and the jump condition vanishes and that for the large values of \(H_{A}\), the concentration of acid in gas tends toward zero.

For the diffusion coefficient, we have,

$$\begin{aligned} D_{A}=\frac{D_{l,A}D_{g,A}}{\alpha D_{g,A}+\left( 1-\alpha \right) D_{l,A}}. \end{aligned}$$
(12)

Haroun et al. (2010b) and Deising et al. (2016) have demonstrated that this harmonic formulation is more robust than a simple mixing rule, \(D_{A}=\left( \alpha D_{l,A}+\left( 1-\alpha \right) D_{g,A}\right) \).

The local mass flux \({\dot{m}}_{A}\) from the liquid phase to the gas phase can be directly calculated as,

$$\begin{aligned} {\dot{m}}_{A}=\left( {\bar{C}}_{A}(\bar{\mathsf {v}}-\mathsf {w})-D_{A}\nabla {\bar{C}}_{A}\right) .\nabla \alpha -D_{A}\varvec{\Phi }_{A}.\nabla \alpha . \end{aligned}$$
(13)

2.3 Boundary Conditions at the Solid Walls

The model is completed by a set of boundary conditions to specify the wettability and concentration conditions at the solid walls in the presence of triple lines.

Classically for the two-phase flow, at the solid boundary, the fluid/fluid interface and the solid surface form a contact angle, \(\theta \). During the displacement of the interface, this condition is satisfied by enforcing, at the solid surface, the orientation of the vector, \(\mathsf {n}_{\alpha }\), normal to the fluid/fluid interface. This is achieved numerically through the relation,

$$\begin{aligned} \mathsf {n}_{\alpha }=\frac{\nabla \alpha }{\left\| \nabla \alpha \right\| }= \mathsf {n}_s \cos \theta + \mathsf {t}_s \sin \theta , \end{aligned}$$
(14)

where the \(\mathsf {n}_s\) is the unit normal to the solid surface pointing to the solid and \(\mathsf {t}_s\) is the unit vector tangent to the solid pointing to the wetting phase. In this study, we consider that the contact angle, \(\theta \), is constant and its value is specified by the user. More sophisticated models involving dynamic contact angles such as the Cox–Voinov model (Voinov 1976; Cox 1986) can be considered following the same procedure.

The CST model was initially developed to simulate mass transfer in the case of liquid films in the absence of partial wetting at the solid walls. Here, we derive a boundary condition for \({\bar{C}}_{A}\) at the solid walls to extend the VOF–CST model to more complex cases where triple lines can occur. We assume no interaction and no chemical reaction of the component at the solid surface. Hence, locally, the concentration of A in each phase at the wall has a zero mass flux condition \(\mathsf {n}_{s}.\nabla C_{p,A}=0\) (\(p=l,g\)), where \(\mathsf {n}_{s}\) is the normal to the surface of the solid. This does not mean, however, that the boundary condition for the global variable, \({\bar{C}}_{A}\), is also a zero gradient boundary condition. Indeed, using the definition of the global variable Eq. (9) and the zero flux condition for local variables, we have,

$$\begin{aligned} \mathsf {n}_{s}.\nabla {\bar{C}}_{A}= & {} \mathsf {n}_{s}.\alpha \nabla C_{l,A}+\mathsf {n}_{s}.\left( 1-\alpha \right) \nabla C_{g,A}+\mathsf {n}_{s}.\left( C_{l,A}-C_{g,A}\right) \nabla \alpha ,\nonumber \\= & {} \mathsf {n}_{s}.\left( C_{l,A}-C_{g,A}\right) \nabla \alpha . \end{aligned}$$
(15)

Note that at the triple point (\(\mathsf {n}_{s}.\nabla \alpha \ne 0\)) the right-hand side of Eq. (15) is nonzero because of the partitioning relation Eq. (8). To be fully closed, Eq. (15) must involve only global variables. This is achieved following Haroun et al. (2010b) guidelines who combined Eqs. (9) and (8) to form the relation, \(C_{l,A}-C_{g,A}=\frac{(H_{A}-1)}{\alpha H_{A}+(1-\alpha )}{\bar{C}}_{A}\), valid at the gas/liquid interface (\(\nabla \alpha \ne 0\)). Finally, the boundary condition with the solid for the global variable of concentration of the species A becomes,

$$\begin{aligned} \mathsf {n}_{s}.\nabla {\bar{C}}_{A}=\mathsf {n}_{s}.\frac{(H_{A}-1)}{\alpha H_{A}+(1-\alpha )}{\bar{C}}_{A}\nabla \alpha . \end{aligned}$$
(16)

2.4 Numerical Implementation

The mathematical model formed by Eqs. (2)–(5), Eqs. (10)–(12), and Eq. (16) is implemented in the open-source computational fluids dynamics software, OpenFOAM (www.OpenFOAM.org). The multiphase multicomponent mass transfer problem is implemented on top of OpenFOAM’s internal VOF solver, the so-called interFoam (Rusche 2003). interFoam solves Eqs. (2)–(5) on a collocated Eulerian grid with a predictor-corrector strategy based on the Pressure Implicit with Splitting of Operators (PISO) (Issa et al. 1985) algorithm.

The concentration equation is discretized with a finite-volume method and solved sequentially after the PISO loop with fixed pressure, velocity, and phase indicator function. The advection term \(\nabla .\left( {\bar{\mathsf {v}}}{\bar{C}}_{A}\right) \) and the CST additional flux \(\varvec{\Phi }_A\) are discretized with Gauss Van Leer scheme, a total variation diminishing (TVD) scheme to insure sharp front propagation. The diffusion term \(\nabla .\left( D_{A}\nabla {\bar{C}}_{A}\right) \) is discretized with a Gauss linear limited corrected scheme, which is second order and conservative.

In “Appendix A,” we present simulation results of simple cases where analytical solutions exist. These simulations validate the numerical implementation of the concentration equation with the CST flux in OpenFOAM.

3 Simulation Results

We present three examples to illustrate the potential of the proposed VOF–CST simulation framework and how simulation results can be upscaled to the REV scale. The first example deals with mass transfer during drainage in a capillary tube. In the second example, the VOF–CST formulation is used to investigate mass transfer in case of thin films. The third example demonstrates the ability of the framework to simulate multicomponent two-phase systems in complex porous structures.

3.1 Mass Transfer and Drainage in a Capillary Tube

In the previous section, we used the VOF–CST framework for simple cases where mass transfer and fluid flow were uncoupled and both fluids were immobile in the pore space. Here, we illustrate the potential of the solver when the characteristic time scales of flow and interphase mass transfer are of the same order of magnitude. The geometry is a 2D \(0.1\,\hbox {mm}\times 0.01\,\hbox {mm}\) tube meshed with a \(200\times 30\) Cartesian grid. The tube is initially filled with a liquid that contains no species A. At time \(t= 0\,\hbox {s}\), the liquid is drained by a gas injected from the left boundary and carrying \(C_{A}= 1\,\hbox {kg/m}^{3}\) of species A. The right boundary is a free outflow condition. At the interface between the solid walls and the two fluids, we impose a constant contact angle \(\theta =45^{\circ }\). The fluids densities are \(\rho _{l}=\rho _{g}= 1000\,\hbox {kg/m}^{3}\), the viscosities \(\mu _{l}= 6\times 10^{-2}\,\hbox {kg/m/s}\) and \(\mu _{g}= 6\times 10^{-1}\,\hbox {kg/m/s}\), and the surface tension is \(\sigma = 0.097\,\hbox {kg/s}^{2}\). The diffusivity of the species A in the gas and liquid phase is \(D_{l,A}=D_{g,A}= 10^{-6}\,\hbox {m}^{2}/\hbox {s}\), and the partitioning coefficient at the interface is \(H_{A}=0.7\). The simulation is run up to \(t=0.01\) s, with a time step \(\delta t= 10^{-5}\,\hbox {s}\).

Fig. 3
figure 3

Drainage of water in a tube by a gas carrying a contaminant. Top evolution of the concentration profile in the tube at different time. The gas/liquid interface is represented in white. Bottom plot of the concentration profile along the tube mid-plane at different times

Simulations results are presented in Fig. 3. The interface between the two fluids is represented in white, and we see that the liquid is pushed by the injected air. In the gas phase, the concentration profile of A is linear. Because of the diffusion of A at the interface, the concentration of A in the liquid phase increases progressively. We see that the concentration jump at the interface is respected at every time steps. Note that this simulation can only converge if the jump is also enforced at the triple point, i.e., using the boundary condition Eq. 16 that has been derived in Sect. 2.3. This simulation demonstrates the ability of the CST–VOF framework to deal with a mass transfer across interfaces in a pore structure in the presence of triple lines. This allows us to investigate multicomponent two-phase flow such as drainage or imbibition in complex pore structures.

3.2 Mass Transfer and Thin Films

In this part, we use the simulation framework to investigate and upscale at the REV scale the flux of interphase mass transfer in case of liquid films deposited at the surface of a capillary tube. The geometry consists in a \(l= 12\,\hbox {mm}\) long and \(2R= 2\,\hbox {mm}\) width 2D tube meshed with a \(30\times 200\) Cartesian grid, with refinement near the wall. To be consistent with the notations adopted in this paper, the subscript “g” denotes the non-wetting fluid and the subscript “l” denotes the wetting fluid. In this simulation, the two fluids have the same density \(\rho _{l}=\rho _{g}= 1000\,\hbox {kg/m}^{3}\). The fluid viscosities are \(\mu _{l}= 6\times 10^{-2}\,\hbox {kg/m/s}\) and \(\mu _{g}= 6\times 10^{-5}\,\hbox {kg/m/s}\). The surface tension is \(\sigma = 0.097\,\hbox {kg/s}^{2}\). The top and bottom boundaries are wall conditions with a contact angle fixed to \(\theta =20\)°. Left and right boundaries are inlet and outlet conditions, respectively. The simulation is performed in two successive steps. First, a drainage is achieved by injecting the non-wetting and less viscous fluid at a rate of \(U_{0}= 0.04\,\hbox {m/s}\) (“gas”) into the tube initially filled with the more viscous and wetting fluid. At this stage of the process, the concentration equation is not solved. With theses flow parameters, the capillary number \(Ca=\frac{\mu _{l}U_{0}}{\sigma }\) that characterizes the ratio of the viscous forces over capillary forces is \(Ca=2.4\times 10^{-2}\). The simulation is run for \(0.3\,\hbox {s}\) until the non-wetting fluid breakthrough. The liquid is pushed out of the tube which remains wet behind the invading fluid front as illustrated in Fig. 4.

Fig. 4
figure 4

Top illustration of the injection of a gas in a viscous liquid, leading to a residual thin layer of liquid on the walls. Bottom phases distribution during the injection of the non-wetting fluid in a tube (wetting fluid is in red and non-wetting fluid in blue)

These results are reminiscent of Taylor’s experiments of deposition of a viscous fluid on the wall of a tube (Taylor 1961). The film thickness obtained from simulation is in good agreement with the semiempirical Taylor’s law proposed by Aussillous and Quéré (2000) who extended Bretherton’s law (Bretherton 1961) for higher capillary number. Taylor’s law relates the volume of liquid in the tube, described by the ratio of layer width h by the radius R (see Fig. 4, top for notation), directly to the capillary number, Ca, with the relation,

$$\begin{aligned} \frac{h}{R}=\frac{1.34Ca^{2/3}}{1+3.35Ca^{2/3}}, \end{aligned}$$
(17)

where the capillary number is the ratio of the viscous forces to the capillary forces \(Ca=\frac{\mu _{l}\langle U_{g}\rangle ^{g}}{\sigma }\) in which \(\langle U_{g}\rangle ^{g}\) is the average velocity of the non-wetting fluid. In our setup, Eq. (17) indicates \(R/h=9.59\) whereas simulation results give \(R/h=9.36\), a relative error of 2%.

In a second step, after the liquid film has been deposited along the solid surface and reach a steady state, \(C_{g,A}= 1\,\hbox {kg/m}^{3}\) of species A contained in the non-wetting phase is injected from the inlet boundary. Initially, both fluids that occupy the tube do not contain \(A (C_{A}= 0\,\hbox {kg/m}^{3})\). The diffusion coefficient of A into the gas and liquid phase is \(D_{g,A}=D_{l,A}=D_{A}\) ranging from \( 10^{-9}\) to \( 10^{-3}\,\hbox {m}^{2}/\hbox {s}\) and Henry’s coefficient is \(H_{A}=1\). Because the thin film is stable and has reached a steady state, the simulation of the concentration evolution is uncoupled from the flow and only the conservation law for species A, Eq. (10), combined with the boundary condition at the solid walls, Eq. (16), is solved numerically. The velocity field, \(\bar{\mathsf {v}}\), and the phase distribution, \(\alpha \), are taken from the first stage described in the former paragraph.

Fig. 5
figure 5

Simulation results for \(D_{A}=10^{-7}\,\hbox {m}^{2}/\hbox {s}\). a Evolution of the average concentration \(\langle C_{g,A}\rangle ^{g}\) and \(\langle C_{l,A}\rangle ^{l}\), b red curve evolution of the concentration difference, \(\left( H_{A}\langle C_{g,A}\rangle ^{g}-\langle C_{l,A}\rangle ^{l}\right) \) and blue curve evolution of the mass flux per interfacial area \(F_{A}/a_{f}\), c the mass flux per interfacial area as a function of the concentration difference, and a linear regression which gives k

The evolution of the concentration of A in the wetting and the non-wetting phases for \( D_{A}=10^{-7}\,\hbox {m}^{2}/\hbox {s}\) is presented in Fig. 5a in terms of phase average concentrations \(\langle C_{g,A}\rangle ^{g}\) and \(\langle C_{l,A}\rangle ^{l}\) averaged over \(\varOmega \) (see Fig. 4) that corresponds to a REV. Different regimes are observed. First for early times, the chemical component has not reached the central part (\(\varOmega \)) of the tube yet and the average concentrations are equal to zero. It propagates by advection and diffusion in the flowing non-wetting fluid and reaches the area \(\varOmega \) around \( t=0.4\,\hbox {s}\). Then it crosses the interface and accumulates in the thin film until the thermodynamic equilibrium at the interface is satisfied (here it corresponds to the equality of \(\langle C_{g,A}\rangle ^{g}\) and \(\langle C_{l,A}\rangle ^{l}\) since \(H_{A}=1\)). The total flux of mass transfer across the interface per interfacial area at the REV scale, \(F_{A}/a_{f}\), is plotted in Fig. 5b, blue curve. There, the flux \(F_{A}\) is obtained by the integration of the local mass flux, \({\dot{m}}_{A}\), computed with Eq. (13) over \(\varOmega \). As for the effective interfacial area, \(a_{f}\), defined as the area of the fluid/fluid interface in the REV divided by \(\varOmega \), it is numerically assessed by averaging the magnitude of the gradient of the phase indictor function, \(\left\| \nabla \alpha \right\| \), over \(\varOmega \). The difference of average concentrations in both phases, \(\left( H_{A}\langle C_{g,A}\rangle ^{g}-\langle C_{l,A}\rangle ^{l}\right) \) (red curve), is also plotted in the same graph. We note that the two curves are strongly correlated. Actually, most of the REV-based models for mass transfer use a non-local equilibrium formulation that estimate the average flux of mass transfer across the fluid/fluid interface as a linear driving force (Soulaine et al. 2011),

$$\begin{aligned} F_{A}=a_{f}k\left( H_{A}\langle C_{g,A}\rangle ^{g}-\langle C_{l,A}\rangle ^{l}\right) , \end{aligned}$$
(18)

where k is the mass exchange coefficient. In Fig. 5c, \(F_{A}/a_{f}\) is plotted as a function of \(\left( H_{A}\langle C_{g,A}\rangle ^{g}-\langle C_{l,A}\rangle ^{l}\right) \). We note that after a certain period that corresponds to the travel time across the domain \(\varOmega \) (here, \( t=0.6\,\hbox {s}\)), the flux can be approximated linearly in function of the concentration difference. The slope corresponds to value of the exchange coefficient estimated to \(k= 0.21\,\hbox {m.s}^{-1}\) for this value of the diffusivity.

Fig. 6
figure 6

Mass exchange coefficient k in function of the Péclet number for the thin film in a tube case

Next, the mass transfer dependency with Péclet number is investigated. The Péclet number defined as \(P\acute{e}=\frac{R\langle U_{g}\rangle ^{g}}{D_{A}}\) quantifies the transport by advection with regards to the transport by diffusion. The same procedure described above is adopted for several values of the diffusion coefficient corresponding to Péclet numbers ranging from \(10^{-2}\) to \(10^{4}\). For each case, the mass exchange coefficient k is computed and the results are shown in Fig. 6. The curve is linear with a slope equal to \(-1\), meaning that the exchange coefficient is inversely proportional to the Péclet number. This result is reminiscent of the theoretical results by Quintard and Whitaker (1994) and Soulaine et al. (2011) for stratified flows in a tube.

3.3 Mass Transfer in Complex Pore Spaces

In this part, the VOF–CST simulation framework is used to investigate the multiphase mass transfer phenomena during the drainage of water in complex porous media under various flow conditions. The domain size is \( 900\,\upmu \hbox {m}\times 487\,\upmu \hbox {m}\). To mesh the computational domain, a \(800\times 400\) Cartesian background grid is generated, then all the cells containing solid are removed, and tetrahedral cells are introduced to perfectly match the shape of the solid grains. The final grid has 177,180 cells. For upscaling purpose, this pore space is considered as a REV and the data are averaged over the entire volume of the sample. Porosity and permeability of the REV are numerically estimated to \(\phi _{0}\approx 0.55\) and \(K_{0}= 9.85\times 10^{-12}\,\hbox {m}^{2}\), respectively. Top, bottom, and grain boundaries are impermeable fixed walls with a constant contact angle set to \(\theta =45^{\circ }\). A non-wetting fluid denoted “g” is injected from the left boundary at a constant velocity \( U_{0}=0.01\,\hbox {m/s}\). The right boundary is an outlet condition. Initially, the domain is saturated with water (viscosity is \(\mu _{l}= 6\times 10^{-2}\,\hbox {kg/m/s}\) and density is \(\rho _{l}= 1000\,\hbox {kg/m}^{3}\)). The surface tension is set to \(\sigma = 0.097\,\hbox {kg/s}^{2}\). As for the thin liquid film example, the simulations are performed in two step: First the flow is established and the mass transfer is investigated.

Fig. 7
figure 7

Results of the drainage of water in a complex pore space for different ratios of viscosity and density. a \(\frac{\mu _{g}}{\mu _{l}}=1\) and \(\frac{\rho _{g}}{\rho _{l}}=1\), \(S_{w}=35\%\), \(a_{f}= 1.4 \times 10^{4}\,\hbox {m}^{-1}\), b \(\frac{\mu _{g}}{\mu _{l}}=1\) and \(\frac{\rho _{g}}{\rho _{l}}=0.1\), \(S_{w}=51\%\), \(a_{f}= 1.1 \times 10^{4}\,\hbox {m}^{-1}\) and c \(\frac{\mu _{g}}{\mu _{l}}=10\) and \(\frac{\rho _{g}}{\rho _{l}}=1\), \(S_{w}=21\%\), \(a_{f}= 2.2 \times 10^{4}\,\hbox {m}^{-1}\)

Fig. 8
figure 8

Concentration field over time in the pore space for the first drainage case, with \(H_{A}=1\). White plain lines correspond to the fluid/fluid interface

Fig. 9
figure 9

Concentration field over time in the pore space for the first drainage case, with \(H_{A}=1.5\). White plain lines correspond to the fluid/fluid interface

Fig. 10
figure 10

Simulation results for the first case of drainage with \(D_{A}=6\times 10^{-5}\,\hbox {m}^{2}/\hbox {s}\). a Evolution of the average concentration \(\langle C_{g,A}\rangle ^{g}\) and \(\langle C_{l,A}\rangle ^{l}\), b red curve evolution of the concentration difference, \(\left( H_{A}\langle C_{g,A}\rangle ^{g}-\langle C_{l,A}\rangle ^{l}\right) \), and blue curve evolution of the mass flux per interfacial area \(F_{A}/a_{f}\), c the mass flux per interfacial area as a function of the concentration difference

Three different cases of drainage are performed. In the first case, the fluid properties are the same, \(\frac{\mu _{g}}{\mu _{l}}=1\) and \(\frac{\rho _{g}}{\rho _{l}}=1\). In the second case, the viscosities are still the same \(\frac{\mu _{g}}{\mu _{l}}=1\) but the non-wetting fluid injected in the domain has a smaller density than the water in place, \(\frac{\rho _{g}}{\rho _{l}}=0.1\). Finally in the third case, water is pushed by a more viscous fluid, \(\frac{\mu _{g}}{\mu _{l}}=10\), and both fluids have the same density, \(\frac{\rho _{g}}{\rho _{l}}=1\). Simulation results of those drainages are presented in Fig. 7 for different time steps. For each case, the last time step corresponds to the steady state, i.e., when the non-wetting fluid has percolated through the domain and the phase distribution is fixed. For the three cases, we observe different values of residual saturation, namely \(S_{w}=35\%, S_{w}=51\%\), and \(S_{w}=21\%\), respectively. Likewise, the interfacial area per volume for the different setups is estimated to \(a_{f}= 1.4\times 10^{4}\,\hbox {m}^{-1}, a_{f}= 1.1\times 10^{4}\,\hbox {m}^{-1}\) and \(a_{f}= 2.2\times 10^{4}\,\hbox {m}^{-1}\), respectively, which emphasizes that the fluids properties have a strong impact on the mass transfer across the fluid/fluid interface.

The steady-state flow and phase distribution are then used to transport a species A injected from the left boundary with a concentration \(C_{g,A}= 1\,\hbox {kg/m}^{3}\). The diffusion coefficient in both phases is \( D_{A}=D_{l,A}=D_{g,A}=10^{-7}\,\hbox {m}^{2}/\hbox {s}\). The evolution of the concentration of A in the domain for the first case of drainage (fluids with same densities and same viscosities) is presented in Figs. 8 and 9, when \(H_{A}=1\) and \(H_{A}=1.5\), respectively. The white plain lines correspond to the fluid/fluid interface. Species A is preferentially transported through the percolating viscous fingers where the advection is stronger. Then it crosses the interface and spreads mostly by diffusion in the less mobile area. When \(H_{A}>1\), the species concentration accumulates in the residual water.

Simulation results are then upscaled following the procedure introduced in Sect. 3.2. We present only in Fig. 10 the results where \(H_{A}=1\). The evolution of the phase average concentrations is plotted in Fig. 10a, the mass flux per interfacial area, \(F_{A}/a_{f}\), and the concentrations difference, \(\left( H_{A}\langle C_{g,A}\rangle ^{g}-\langle C_{l,A}\rangle ^{l}\right) \), are plotted in Fig. 10b, and \(F_{A}/a_{f}\) is plotted according to \(\left( H_{A}\langle C_{g,A}\rangle ^{g}-\langle C_{l,A}\rangle ^{l}\right) \) in Fig. 10c. As for the mass transfer in thin film setting, we see in this last plot that for early times, the flux behaves nonlinearly with respect to the concentration difference. Linearity is observed as soon as the chemical component A reaches the outlet of the averaging domain (\(t= 0.1\,\hbox {s}\)). From then, the mass exchange coefficient, k, is obtained by computing the slope of the curve.

The same operation is repeated for the three different cases of drainage and for several values of the diffusion coefficient ranging from \(D_{A}=10^{-5}\) to \( 10^{-8}\,\hbox {m}^{2}/\hbox {s}\). Results are collected in Fig. 11. First, we notice that the flow conditions have a direct impact on the value of the exchange coefficient. Indeed, for the three cases, the curves are shifted by an offset that monotonously increases with the value of the saturation. Second, we observe different regimes according to the value of the Péclet number as illustrated with case 1: On the one hand, for small \(P\acute{e}\), the slope is \(-0.1\) and on the other hand, for \(P\acute{e}>1\), the slope is \(-2/3\), which is in agreement with the correlations proposed in the chemical engineering literature based on the boundary layer theory applied to a single sphere (Friedlander 1957) or experimental measurements of mass transfer in packed beds of sphere (Wilson and Geankoplis 1966). Interestingly, for large Péclet numbers, the cases 1 and 2 share the same slope while case 3 which have a ratio of viscosity non-equal to one has a slope of \(-1/2\).

Fig. 11
figure 11

Mass exchange coefficient in function of the Péclet number for the three different cases of drainage

The VOF–CST numerical framework along with the upscaling methodology we propose can help to investigate the interphase multicomponent mass transfer in different types of rock under various flow conditions.

4 Conclusion

A simulation framework (VOF–CST) has been proposed to investigate multicomponent multiphase flow in porous media at the pore scale. The VOF–CST is based on the volume-of-fluid approach combined with the Continuous Species Transfer model used to solve partial differential equations for the species concentration including thermodynamics equilibrium condition at the fluid/fluid interface. We extended the method, originally proposed for thin films in the absence of dewetting by Haroun et al. (2010b), to simulate complex processes such as drainage and imbibition where triple lines may appear at the solid boundary.

The method has been validated successfully for simple configurations where analytical solutions exist. We illustrated the potential of the framework to simulate dynamically the mass transfer during complex two-phase flow mechanisms such as drainage and imbibition. Compared to other pore-scale approaches that rely on PNM, our method solves the multicomponent multiphase flow directly on the pore space of a rock sample and does need to neither approximate the pore geometry nor average the governing laws.

The VOF–CST model has been used to investigate multicomponent mass transfer in a two-phase flow and to upscale the rate of mass transfer at the REV scale. In the case of thin films of water deposited on the wall of a straight tube, we showed, in agreement with published theoretical results, that the mass exchange coefficient is inversely proportional to the Péclet number. Then, we used the numerical framework to investigate multicomponent interphase mass transfer in a complex pore space under various flow conditions. In this case, the mass exchange coefficient exhibits different regimes according to the Péclet number with slopes varying from \(-0.1\) to \(-2/3\). We also showed that the rate of mass transfer depends not only on the effective surface area between the two fluids but also on the saturation.

This simulation framework altogether with the upscaling methodology proposed in this paper can help to investigate and characterize the interphase multicomponent mass transfer in different types of rock under various flow conditions. In particular, the VOF–CST framework can complement micromodel experiments where the use of dye to visualize the concentration profile is challenging since, most of the time, it affects the interfacial conditions.