# Jacobian Free Methods for Coupling Transport with Chemistry in Heterogenous Porous Media

Laila Amir, Michel Kern

<figure><img src="image_1.png" /></figure>

## To cite this version:

Laila Amir, Michel Kern. Jacobian Free Methods for Coupling Transport with Chemistry in Heterogenous Porous Media. Water, 2021, 13 (3), pp.370. 10.3390/w13030370. hal-03132416

HAL Id: hal-03132416

https://inria.hal.science/hal-03132416

Submitted on 5 Feb 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_3.png" /></figure>

# Jacobian Free Methods for Coupling Transport with Chemistry in Heterogenous Porous Media

Laila Amir<fnref n="1" /> and Michel Kern <fnref n="2" />,<fnref n="3" />,*

**Abstract:** Reactive transport plays an important role in various subsurface applications, including carbon dioxide sequestration, nuclear waste storage, biogeochemistry and the simulation of hydro-thermal reservoirs. The model couples a set of partial differential equations, describing the transport of chemical species, to nonlinear algebraic or differential equations, describing the chemical reactions. Solution methods for the resulting large nonlinear system can be either fully coupled or can iterate between transport and chemistry. This paper extends previous work by the authors where an approach based on the Newton-Krylov method applied to a reduced system has been developed. The main feature of the approach is to solve the nonlinear system in a fully coupled manner while keeping transport and chemistry modules separate. Here we extend the method in two directions. First, we take into account mineral precipitation and dissolution reactions by using an interior point Newton method, so as to avoid the usual combinatorial approach. Second, we study two-dimensional heterogeneous geometries. We show how the method can make use of an existing transport solver, used as a black box. We detail the methods and algorithms for the individual modules, and for the coupling step. We show the performance of the method on synthetic examples.

**Keywords:** reactive transport; finite volume methods; Newton-Krylov methods; porous media flow and transport

<figure><img src="image_4.png" /></figure>

check for
updates

**Citation:** Amir, L.; Kern, M. Jacobian Free Methods for Coupling Transport with Chemistry in Heterogenous Porous Media. *Water* **2021**, *13*, 370. https://doi.org/10.3390/w13030370

Academic Editor: Anis Younes

Received: 24 December 2020

Accepted: 25 January 2021

Published: 31 January 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

<figure><img src="image_5.png" /></figure>

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## 1. Introduction

Reactive transport plays an important role in various subsurface applications [1–3] including carbon dioxide sequestration, nuclear waste storage bio-geochemistry and the simulation of hydro-thermal reservoirs.

The numerical simulation of reactive transport has been the topic of numerous work. The survey by Yeh and Tripathi [4] has been very influential in establishing a mathematical formalism for setting up models, and also for establishing the “operator splitting” approach (see below) as a standard. More recent surveys, detailing several widely used computer codes and their applications, can be found in the book [1] and the survey article [2].

Methods for coupling transport and chemistry fall into two broad categories:

* Sequential Iterative Approach (SIA), where transport and chemistry are solved alternatively and one iterates to convergence [5–10].

* Globally Implicit Approach (GIA), where one solves the fully coupled system in one shot [11–14].

Recently, methods that solve coupled problem without direct substitution, thus maintaining a separation between transport and chemistry, have been introduced [15–21].

In previous work [22,23], the authors introduced a method for the simulation of reactive transport that falls in the latter category. The method is a globally coupled approach, where transport and chemistry are solved together, but where the transport and

<footnote n="1">¹ Laboratoire d'Ingénierie Informatique et Systèmes (L2IS), Faculté des Sciences et Techniques, UCAM, 4000 Marrakech, Morrocco; l.amir@uca.ma</footnote>

<footnote n="2">² Inria, 2 Rue Simone Iff, 75589 Paris, France</footnote>

<footnote n="3">³ CERMICS, Ecole des Ponts, 77455 Marne-la-Vallée, France</footnote>

<footnote>* Correspondence: michel.kern@inria.fr</footnote>
chemistry modules are kept separate at the software level. At each time step, the large nonlinear system of algebraic equations representing the coupling of all chemical species at all mesh points is solved by a Newton–Krylov method [24]. The Newton–Krylov method has recently been used for closely related applications to reactive transport, see [25–27]. In these works, the method is applied to a system where the mass action laws are substituted into the mass balance transport equations, while in our work we solve a fixed point system using solution operators for transport and chemistry. In the Newton–Krylov approach the linearized system at each Newton iteration is solved by an iterative method (usually GMRES), so that the full Jacobian matrix does not have to be formed. All that is required is a procedure to multiply the Jacobian matrix by a given vector, and this is where the specific structure of the coupled problem is exploited. It was also shown in [23] that a suitable non-linear preconditioning made the method both more robust and more efficient, as the number of both linear and nonlinear iterations became independent of the mesh size.

The purpose of the present paper is to extend the approach to a larger set of models. Specifically, we target two different extensions:

**Mineral species:** We extend the capabilities of the equilibrium chemical solver to handle mineral precipitation and dissolution;

**2D geometries:** All the examples in [22,23] were one-dimensional. Here we show 2D examples.

Mineral precipitation and dissolution reactions lead to non-smooth problems, where it is not known a priori which species are dissolved. The corresponding equilibrium problem can be formulated in an elegant, and mathematically consistent, formulation as a complementarity problem, as for example in [28–30]. However, instead of using a Newton–min method as in those references, we solve the non-linear system by an interior point method [31] or [32], adapted to nonlinear equations as in [33,34]. The approach is validated by computing the potential-pH precipitation diagram for iron.

The chemical module is coupled to a transport module based on the recently developed ComPASS code [35]. ComPASS targets multiphase, multicomponent geothermal systems. The discretization uses a fully implicit time integration combined with the Vertex Approximate Gradient (VAG) finite volume scheme [36], which is adapted to polyhedral meshes and anisotropic heterogeneous media. The extension of the coupling method to 2D is non-trivial as the cost of the transport step now becomes significant.

The code is validated on two examples:

* The potential pH diagram for iron is used to validate the interior point Newton method;

* A 2D variant of the ion exchange system used in Example 11 of the PhreeqC documentation [37]. This test case involves 8 chemical species undergoing 3 ion-exchange reactions, in a simple 2D geometry.

* The so-called SHPCO2 benchmark that involves 11 chemical species, distributed among 3 phases, and undergoing 4 reactions. One species is a mineral, and one is a gas.

The results show that the proposed approach does handle the large class of models, but that further work is still required to ascertain its efficiency on large scale examples. This topic is currently being pursued.

An outline of the paper is as follows: Section 2 presents the model and its hypotheses. Section 3 shows how to obtain a reduced coupled problem, and discusses solution methods at the semi-discrete level. In Section 4, we present the numerical methods used for solving the chemical and transport sub-problems. Section 5 discusses the numerical examples.

## 2. Physical Model and Mathematical Formulation

### 2.1. *The Model*

We consider a set of species subject to transport by advection and diffusion and to chemical reactions in a porous medium occupying a domain $\Omega \subset \mathbf{R}^d$ ($d = 1, 2, 3$). The
chemical phenomena involve both homogeneous and heterogeneous reactions. Homogeneous reactions, in the aqueous phase, include water dissociation, acid-base reactions and redox reactions, whereas heterogeneous reactions occur between the aqueous and solid phases, and include surface complexation, ion exchange and precipitation and dissolution of minerals (see [38] for details on the modeling of specific chemical phenomena). Accordingly, we assume there are $N_a$ aqueous (mobile) species ($X_j^a$)$_{j=1,...,N_a}$ in the aqueous phase undergoing $N_r$ homogeneous reactions, $N_s$ solid (immobile) species ($X_j^s$)$_{j=1,...,N_s}$ in the solid phase undergoing $\bar{N}_r$ surface sorption reactions or ion exchange reactions, and $N_p$ precipitation-dissolution reactions with the additional assumption that each mineral reaction involves only aqueous species and only one mineral species, denoted by ($X_j^p$)$_{j=1,...,N_p}$.

In this work, we only consider equilibrium reactions, which means that the chemical phenomena occur on a much faster scale than transport phenomena, see [39]. This assumption is justified for aqueous phase and ion-exchange reactions, but may be questionable for reactions involving minerals that could also be modeled as kinetic reactions, with specific rate laws [13,40].

Under the above assumptions, we can write the chemical system as

$$ \sum_{j=1}^{N_a} (S_{aa})_{ij} X_j^a \quad \Leftrightarrow \quad 0 \quad i=1, \dots, N_r \quad \text{homogeneous reactions,} $$

$$ \sum_{j=1}^{N_a} (S_{sa})_{ij} X_j^a + \sum_{j=1}^{N_s} (S_{ss})_{ij} X_j^s \quad \Leftrightarrow \quad 0 \quad i=1, \dots, \bar{N}_r \quad \text{heterogeneous sorption reactions,} $$

$$ \sum_{j=1}^{N_a} (S_{pa})_{ij} X_j^a \quad -X_i^p \quad \Leftrightarrow \quad 0 \quad i=1, \dots, N_p \quad \text{precipitation-dissolution reactions,} $$

or in condensed form

$$ S \begin{pmatrix} X^a \\ X^s \\ X^p \end{pmatrix} \Leftrightarrow \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}, \quad \text{where } S = \begin{pmatrix} S_{aa} & 0 & 0 \\ S_{sa} & S_{ss} & 0 \\ S_{pa} & 0 & -I \end{pmatrix} \quad (1) $$

denotes the stoichiometric matrix, with the sub-matrices $S_{aa} \in \mathbf{R}^{N_r \times N_a}$, $S_{sa} \in \mathbf{R}^{\bar{N}_r \times N_a}$, $S_{ss} \in \mathbf{R}^{\bar{N}_r \times N_s}$ and $S_{pa} \in \mathbf{R}^{N_p \times N_a}$. We assume that both the global stoichiometric matrix S and the “aqueous” stoichiometric matrix $S_{aa}$ are of full rank.

Since the heterogeneous reactions in the examples used in Section 5 have either all surface reactions or all mineral reactions, we illustrate the above concepts with an example from [41] that has both kinds of reactions. The chemical reactions are as follows, the first two reactions are homogeneous, the third one is a surface reaction and the fourth one is a mineral reaction:

$$ \textbf{R1} \quad H^+ + OH^- \rightleftharpoons H_2O $$

$$ \textbf{R2} \quad CO_3^{2-} + H^+ \rightleftharpoons HCO_3^- $$

$$ \textbf{R3} \quad X_2Ca + 2Na^+ \rightleftharpoons 2XNa + Ca_2^+ $$

$$ \textbf{R4} \quad Ca_2^+ + CO_3^{2-} \rightleftharpoons CaCO_3(s). $$

The aqueous species are $X^a = (H^+, OH^-, CO_3^{2-}, Na^+, Ca_2^+, H_2O, HCO_3^-)^T$, the sorbed species are $X^s = (X_2Ca, XNa)^T$ and the mineral species is $X^p = (CaCO_3)^T$. The corresponding matrices are:

$$ S_{aa} = \begin{pmatrix} 1 & 1 & 0 & 0 & 0 & -1 & 0 \\ 1 & 0 & 1 & 0 & 0 & 0 & -1 \end{pmatrix}, \quad S_{sa} = \begin{pmatrix} 0 & 0 & 0 & 2 & -1 & 0 & 0 \end{pmatrix}, $$

$$ S_{ss} = \begin{pmatrix} 1 & -2 \end{pmatrix}, \quad S_{pa} = \begin{pmatrix} 0 & 0 & 1 & 0 & 1 & 0 & 0 \end{pmatrix}. $$
Each reaction gives rise to a mass action law, linking the activities of the species. For simplicity, we ignore the activity correction, so that the activities of aqueous and sorption species are equal to their concentrations (if water is included as a species, as in example Section 5.3, its activity is taken equal to 1), while the activity of mineral species is by convention equal to 1. We denote by $c_j$ (resp. $s_j, p_j$) the concentration of species $X_j^a$ (resp. $X_j^s, X_j^p$). It will be convenient to write the mass action law in logarithmic form: given a vector $c$ with positive entries we denote by $\log c$ the vector with entries $\log c_j$.

For the aqueous and sorption reactions we write the corresponding mass action law

$$ \begin{pmatrix} S_{aa} & 0 \\ S_{sa} & S_{ss} \end{pmatrix} \begin{pmatrix} \log c \\ \log s \end{pmatrix} = \begin{pmatrix} \log K_a \\ \log K_s \end{pmatrix}, \qquad (2) $$

where $K_a \in \mathbf{R}^{N_r}, K_s \in \mathbf{R}^{\bar{N}_r}$ are the equilibrium constants for their respective reactions.

For reactions involving minerals, we define the (logarithmic form of) the solubility product, with $K_p \in \mathbf{R}^{N_p}$ denoting again the equilibrium constant

$$ \Pi = \log K_p - S_{pa} \log c. \qquad (3) $$

Mineral reactions can only be written if the mineral is present, and the mass action law must then be written as the following alternative:

$$ (\Pi = 0 \text{ and } p \ge 0) \text{ or } (\Pi \ge 0 \text{ and } p = 0). \qquad (4) $$

Next, we write the mass conservation for each species, considering both transport by advection, diffusion and chemical reaction terms:

$$ \begin{gathered} \phi \partial_t c + \mathcal{L} c = S_{aa}^T r_a + S_{sa}^T r_s + S_{pa}^T r_p, \\ \rho_s (1 - \phi) \partial_t s = S_{ss}^T r_s, \qquad \text{in } \Omega \times [0, T_f] \\ \rho_s (1 - \phi) \partial_t p = -r_p. \end{gathered} \qquad (5) $$

where $\mathcal{L}$ denotes the advection-diffusion operator:

$$ \mathcal{L}(c) = \nabla \cdot (qc - D\nabla c), $$

$\phi$ is the porosity (fraction of void in a Representative Elementary Volume available for the flow), $q$ is the Darcy velocity (we assume here permanent flow, so that $q$ is considered as known), $D$ is a diffusion-dispersion coefficient and $\rho_s$ is the density of the rock matrix. The vectors $r_a \in \mathbf{R}^{N_r}, r_s \in \mathbf{R}^{\bar{N}_r}$ and $r_p \in \mathbf{R}^{N_p}$ contain the (unknown) reaction rates. We assume that the diffusion coefficient is independent of the species. This is a strong restriction on the model, but one that is commonly assumed to hold [4,16,22,41]. To complete the model, we add boundary conditions, with a partition of the boundary $\bar{\partial}\Omega = \bar{\Gamma}_D \cup \bar{\Gamma}_N, \Gamma_D \cap \Gamma_N = \emptyset$. For simplicity we only consider either given concentration, or zero diffusive flux boundaries:

**Dirichlet boundary:** $c = c_D$ on $\Gamma_D \times [0, T_f]$,

**Neumann boundary:** $\nabla c \cdot n = 0$ on $\Gamma_N \times [0, T_f]$, where $n$ is the outgoing normal to $\Omega$ along $\Gamma_N$.

Finally, an initial condition

$$ c(x, 0) = c_0(x) \text{ in } \Omega $$

is given.

Since we assume that all reactions are at equilibrium the reaction rates are unknown, but they can be eliminated. The process is by now well known, and will not be repeated here. We adapt the construction given in [23], to take into account the extra structure due
to the presence of mineral species. See [28] for a related derivation, and [16,17] for a more general framework. This approach, originating from [41], makes use of a kernel matrix $U$ such that $US^T = 0$, i.e. such that the columns of $U^T$ form a basis for the null-space of $S$. Among the many possible choices there exists one such that

$$ U = \begin{pmatrix} U_{aa} & U_{as} & U_{ap} \\ 0 & U_{ss} & 0 \end{pmatrix} \quad \begin{array}{l} U_{aa} \in \mathbf{R}^{(N_a - N_r) \times N_a}, \quad U_{as} \in \mathbf{R}^{(N_a - N_r) \times N_a}, \quad U_{ap} \in \mathbf{R}^{(N_a - N_r) \times N_a} \\ U_{ss} \in \mathbf{R}^{(N_s - \bar{N}_r) \times N_s} \end{array} \qquad (6) $$

For the example system given above, one finds that the kernel matrices are given by

$$ U_{aa} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 \end{pmatrix}, \quad U_{sa} = \begin{pmatrix} 0 & 0 \\ 0 & 0 \\ 0 & 0 \\ -2 & 0 \\ 0 & -1/2 \end{pmatrix}, \\ U_{ss} = (2 \ 1), \quad U_{pa} = \begin{pmatrix} 0 \\ 0 \\ -1 \\ 0 \\ 1 \end{pmatrix}. $$

## 2.2. Elimination of the Reaction and Coupled Problem

With this kernel matrix, we can eliminate the reaction terms in Equation (5). We start by defining the total analytic concentration for the mobile and immobile species respectively (these are the same as various total quantities defined in the classical survey by Yeh and Tripathi [4])

$$ \left(\frac{T}{\bar{T}}\right) = \begin{pmatrix} U_{aa} & U_{as} & U_{ap} \\ 0 & U_{ss} & 0 \end{pmatrix} \begin{pmatrix} c \\ s \\ p \end{pmatrix}. \qquad (7) $$

We denote by $N_c = N_a - N_r$ and $\bar{N}_c = N_s - \bar{N}_r$ the respective dimensions of $T$ and $\bar{T}$. We also define the total mobile and immobile concentrations for the species in the aqueous phase

$$ C = U_{aa} c, \quad \bar{C} = U_{as} s + U_{ap} p, \qquad (8) $$

so that the total concentrations are given by

$$ T = C + \bar{C} = U_{aa} c + U_{as} s + U_{ap} p. \qquad (9) $$

We now multiply system (5) on the left by $U$. Because of our assumption that $D$ is the same for all chemical species, multiplication by $U$ commutes with the differential operator, and the system can be rewritten as

$$ \begin{aligned} & \phi \partial_t C + \rho_s (1 - \phi) \partial_t \bar{C} + LC = 0, \\ & \rho_s (1 - \phi) \partial_t \bar{T} = 0. \end{aligned} \qquad (10) $$

# 3. The Coupled Problem

The coupled system consists of the $(N_a - N_r) + (N_s - \bar{N}_r)$ conservation Partial Differential Equations (PDEs) and Ordinary Differential Equations (ODEs) (10), together with the $N_r + \bar{N}_r + N_p$ mass action laws (2), the relations connecting concentration and totals (8) and the second line of (7), for the $N_a + N_s + N_p$ concentrations and $2(N_a - N_r) + N_s - \bar{N}_r$ totals. Note that the ODEs for $\bar{T}$ are decoupled from the rest of the system.
### 3.1. Reduction of the Coupled Problem

It is possible to solve directly the coupled system for the concentrations of the species. This is what the Direct Substitution Approach (DSA) does. Actually this is usually done after a further reduction of the chemical system, by introducing primary and secondary species such that each mass action law expresses the formation of one secondary species from the primary species. One substitutes the mass action laws (2) and (4) into the mass conservation PDEs (10), obtaining a large system of nonlinear equations for the primary species (see [25] or [42] for representative examples of this approach).

We prefer, however, to separate the local chemical equations from the PDEs. In order to do this, it will be useful to eliminate the concentrations of the individual species, and keep only the totals as main unknowns. Towards this goal, we notice that given the totals $T \in N_c, \bar{T} \in N_{\bar{C}},$ we can solve the “local chemical equilibrium problem” made up of the mass action laws (2) and (4) together with the definition of the totals (7). Knowing the species concentrations $c, s$ and $p$, we can compute $C \in N_c, \bar{C} \in N_{\bar{C}}$ through Equation (8). Because $\bar{T}$ is constant, it is convenient to remove it from the system, and we define the chemical solution operator by

$$ \Psi_C: \begin{array}{rcl} R^{N_c} & \rightarrow & R^{N_c} \\ T & \rightarrow & C \end{array} \qquad (11) $$

The end result is that the coupled problem given by Equations (2), (4), (7), (8) and (10) is equivalent to the following system involving only the totals $C$ and $\bar{C}$:

$$ \begin{array}{l} \phi \partial_t C + \rho_s (1 - \phi) \partial_t \bar{C} + \mathcal{L} C = 0, \\ \bar{C} - \Psi_C(C + \bar{C}) = 0. \end{array} \qquad (12) $$

**Remark 1.** Note that one can equivalently add $T$ as an unknown with the added equation

$$ T = C + \bar{C}. $$

As we recall below, this is how the SIA method is defined, but it turns out to be more efficient to work directly with the smaller system (12) (see [23] for a comparison of the various formulations of the coupled problem).

Before we can fully specify how to solve the reduced system (12), we need to make precise the numerical methods used for solving the transport equations and the local chemical system.

### 3.2. Semi-Discrete System in Time

We first keep space continuous, and describe our approach on a semi-discrete system. We introduce a discretization of the time interval $[0, T_f]$ into $N_t$ intervals $[t^n, t^{n+1}]$, $n = 0, \dots, N_t - 1$, with $t^0 = 0$ and $t^{N_t} = T_f$, and we denote $\Delta t^n = t^{n+1} - t^n$. We take the simplest backward Euler discretization and approximate the coupled system (12) by

$$ \begin{array}{l} \phi \frac{C^{n+1} - C^n}{\Delta t^n} + \rho_s (1 - \phi) \frac{\bar{C}^{n+1} - \bar{C}^n}{\Delta t^n} + \mathcal{L} C^{n+1} = 0, \\ \bar{C}^{n+1} - \Psi_C(C^{n+1} + \bar{C}^{n+1}) = 0. \end{array} \qquad (13) $$

In analogy with chemical solution operator $\Psi_C$ defined in (11) we now introduce the transport solution operator as follows: given an initial concentration $c^n$ at time $t^n$ and a source term $f^{n+1}$, we let $\Psi_T(c^n, f^{n+1}) = c^{n+1}$ where $c^{n+1}$ solves the transport problem over one time-step:

$$ \phi \frac{c^{n+1} - c^n}{\Delta t^n} + \mathcal{L} c^{n+1} = f^{n+1}. \qquad (14) $$
We can then rewrite the coupled problem as

$$ 
\begin{aligned}
C^{n+1} &= \Psi_T \left( C^n, -\rho_s(1-\phi) \frac{\bar{C}^{n+1} - \bar{C}^n}{\Delta t^n} \right) \\
\bar{C}^{n+1} &= \Psi_C(C^{n+1} + \bar{C}^{n+1}).
\end{aligned} 
\quad (15) $$

Among the various mathematically equivalent formulations, it was shown in [23] that eliminating $C^{n+1}$ leads to an efficient formulation. The resulting problem involves only the unknown $\bar{C}^{n+1}$ and is written as

$$ \bar{C}^{n+1} = F(\bar{C}^{n+1}) = \Psi_C \left( \bar{C}^{n+1} + \Psi_T \left[ C^n, -\rho_s(1-\phi) \frac{\bar{C}^{n+1} - \bar{C}^n}{\Delta t^n} \right] \right). \quad (16) $$

This is a fixed point problem for $\bar{C}^{n+1}$. We recall two ways by which this problem can be solved:

**Fixed point** A fixed point iteration for solving (16) is known in the reactive transport literature as the Sequential Iterative Approach (SIA, see [4,43–45] among many references).

At each time step $n$, one iterates between transport and chemistry. More precisely, for each iteration $k$, one computes

$$ \bar{C}^{(n+1,k+1)} = F(\bar{C}^{(n+1,k)}) = \Psi_C \left( \bar{C}^{(n+1,k)} + \Psi_T \left[ C^n, -\rho_s(1-\phi) \frac{\bar{C}^{(n+1,k)} - \bar{C}^n}{\Delta t^n} \right] \right). \quad (17) $$

The iterations are stopped when the relative progress indicator

$$ \eta^k = \frac{\| \bar{C}^{n+1,k+1} - \bar{C}^{n+1,k} \|}{\| \bar{C}^{n+1,k} \|} $$

becomes small enough.

One can easily show that this is equivalent with the more standard description of SIA involving three unknowns ($C^{n+1}$, $T^{n+1}$ and $\bar{C}^{n+1}$).

**Newton–Krylov** As was shown in previous work by the authors [22,23], the coupled system (15) can also be solved by a Newton–Krylov method, leading to a more efficient algorithm.

Recall that at each step of the “pure” form of Newton’s method for solving $F(\bar{C}^{n+1}) = 0$, one should compute the Jacobian matrix $J = F'(\bar{C}^{(n+1,k)})$, solve the linear system

$$ J \delta \bar{C} = -F(\bar{C}^{(n+1,k)}), \quad (18) $$

usually by Gaussian elimination, and then set $\bar{C}^{(n+1,k+1)} = \bar{C}^{(n+1,k)} + \delta \bar{C}$. In practice, one should use some form of globalization procedure in order to ensure convergence from an arbitrary starting point. If a line search is used, the last step should be replaced by $\bar{C}^{(n+1,k+1)} = \bar{C}^{(n+1,k)} + \lambda \delta \bar{C}$, where $\lambda$ is determined by the line search procedure [46].

In our context, however, solving the linearized system (18) exactly, or even computing the $J$ matrix, is not possible as both $\Psi_C$ and $\Psi_T$ are implicitly defined functions. It was shown in our previous work (see [22,23]) that this difficulty could be circumvented by resorting to the Newton–Krylov method (see [24,25,46], to which our work is closely related). The Newton–Krylov method is a variant of Newton’s method where the linear system (18) is solved by an iterative method (of Krylov type), for instance GMRES [47]. The advantage of this choice is that the Jacobian matrix $J$ is no longer required. Instead one needs a procedure to compute the product $Jv$ for any given vector $v$.
In the next section, we complete the description of the method by giving details on the space discretization, and we give additional implementation details on the solution of the coupled problem.

# 4. Numerical Methods for Transport Furthermore, Chemistry

## 4.1. Solution of the Chemical Equilibrium Problem by an Interior Point Method

In this section, we show how to solve the local equilibrium problem. We recall that, given $T \in \mathbf{R}^{N_c}$ and $T \in \mathbf{R}^{\bar{N}_c}$, we need to compute $c \in \mathbf{R}^{N_a}$, $s \in \mathbf{R}^{N_s}$ and $p \in \mathbf{R}^{N_p}$, such that Equations (2), (4) and (7) hold. Once the concentrations have been computed a simple post-processing as in Equations (8) gives the chemical operator $\Psi_c$.

In this section, in order to simplify the notation, we will not distinguish between aqueous and sorbed species. Alternatively, this is the same as assuming that all immobile species are mineral species. Additionally, we assume that the aqueous part of stoichiometric matrix $S_{aa}$ has been reduced to the “Morel” form

$$S_{aa} = [I - \tilde{S}_{aa}].$$

Note that under the assumption that $S_{aa}$ is of full rank, this is always possible (see [41], or [23,48] for more general reductions). This means that the aqueous concentrations have been split between primary species $c^p$ and secondary species $c^s$, so that each reaction produces one secondary species, the mass action laws take the form

$$\log c^s = \tilde{S}_{aa} \log c^p + \log K_a,$$

and the mass conservation Equation (7) become

$$T = c^p + \tilde{S}_{aa}^T c^s + S_{pa}^T p.$$

We restate the problem to be solved with this new notation. As mentioned previously, we take as unknowns not the aqueous concentrations themselves but their logarithms. This has the obvious advantage that the concentrations will always be positive, and also reduces the ill-conditioning of the non-linear system (see [22,49,50]). We denote by $\tilde{\xi}^p$ (resp. $\tilde{\xi}_s$) the vector such that $\tilde{\xi}_i^p = \log c_i^p$ (resp. $\tilde{\xi}_i^s = \log c_i^s$), and we will write $\tilde{\xi}^p = \log c^p$ or $c^p = \exp(\tilde{\xi}^p)$.

The problem to be solved for local chemical equilibrium is:

Given $T \in \mathbf{R}^{N_c}$, find $\tilde{\xi}^p \in \mathbf{R}^{N_c}$, $p \in \mathbf{R}^{N_p}$ such that:

$$\exp \tilde{\xi}^p + \tilde{S}_{aa}^T \exp(\tilde{\xi}^s) + S_{pa}^T p - T = 0, \quad \text{with } \tilde{\xi}^s = \tilde{S}_{aa} \tilde{\xi}^p - \log K_a, \quad (19)$$

$$(\log K_p - S_{pa}\tilde{\xi} = 0 \text{ and } p \ge 0) \text{ or } (\log K_p - S_{pa}\tilde{\xi} \ge 0 \text{ and } p = 0). \quad (20)$$

Equation (19) combines the mass action law and the conservation of mass. Equation (20) takes the form of a complementarity condition [51,52] and expresses the fact that either the mineral is under-saturated and its concentration is zero, or the mineral is present and the solubility product equals 1. The classical method to take minerals into account involves a systematic search across possible states (the procedure is detailed in [53], and is used by most reactive transport codes [37,54] for example).

More recently, methods based on a more consistent mathematical approach have been used with success: the semi-smooth Newton's method in [28,29]) and an interior point method that originates from inequality constrained optimization in [33,55]. See also [32] for an overview of solution methods for both equilibrium and kinetic reaction modeling.

In this work we follow [33], who adapted to the case of nonlinear equations with inequality constraints an interior point method originally proposed in [31].

To formulate the algorithm, we rewrite (19)–(20) by introducing a slack variable $z \in \mathbf{R}^{N_p}$ (and we denote the system in the first line of (19) by $F_e(\tilde{\xi}^p, p) = 0$):
$$ 
\begin{array}{l}
F_e(\xi^p, p) = 0 \\
S_{pa}\xi^p + \log K_p + z = 0, \quad \text{with } p \ge 0, z \ge 0, \\
p \cdot z = 0
\end{array} 
\qquad (21) $$

where the inequalities are to be understood component-wise.

The idea of the interior point method in [31,33] is to relax the last equation of (21) by introducing a parameter $\mu$ that will be driven to 0 by the algorithm and to apply Newton's method to the relaxed system $F_c(X) = 0$ with unknowns $X = (\xi^p, p, z) \in \mathbb{R}^{N_a+2N_p}$:

$$ 
\begin{array}{l}
F_e(\xi^p, p) = 0 \\
S_{pa}\xi^p + \log K_p + z = 0, \quad \text{with } p \ge 0, z \ge 0. \\
PZe - \mu e = 0
\end{array} 
\qquad (22) $$

We have used a notational device that is standard in the optimization literature: we let $P = \text{diag } p$, $Z = \text{diag } z$, and we also let $e = (1, \dots, 1)^T \in \mathbb{R}^{N_p}$.

A detailed description of the algorithm, together with a convergence proof, can be found in the given references. We just note a few important implementation details.

**Computing the Newton step** Each Newton iteration requires the solution of a linear system

$$ J_c s = -F_c(X), $$

where the Jacobian of system (22) is given by:

$$ J_c = \begin{pmatrix} I + \tilde{S}_{aa}^T Y \tilde{S}_{aa} & S_{pa}^T & 0 \\ S_{pa} & 0 & I \\ 0 & Z & P \end{pmatrix}, $$

where $Y = \text{diag exp}(\xi^S)$, and $I$ is an identity matrix of the appropriate size. These systems can become severely ill-conditioned (see [49]) so that Gaussian elimination may give inaccurate solutions. We monitor the condition number of the Jacobian and if it is larger than $10^{15}$, so that the solution may have no correct digit, we perform a singular value decomposition and compute a least squares solution.

**Damping** After the Newton step has been computed, we apply two steps of damping: the first one reduces the step to ensure that the iterates for $p$ and $z$ remain positive, and the second one is a line search that makes sure the size of the residual is reduced along the Newton direction.

## 4.2. The VAG Scheme

The Vertex Approximate Gradient (VAG) scheme has been introduced in [36,56,57]. Its purpose is to provide a consistent discretization method for anisotropic diffusion schemes on general (polyhedral) meshes, at a reasonable cost. We only give a brief presentation here, referring to the above references for full details. In particular, we only describe the scheme in 2D where important simplification arise.

Let $\mathcal{T}$ be a mesh of $\Omega$ made up of (open, convex) disjoint polygonal cells $K$ such that $\cup_{K \in \mathcal{T}} \bar{K} = \bar{\Omega}$. For all $K \in \mathcal{T}$, let $x_K \in K$ be a point such that $K$ is star-shaped with respect to $x_K$. We denote the set of vertices of the mesh by $\mathcal{V}$, for each $K \in \mathcal{T}$ by $\mathcal{V}_K$ the set of its vertices, and for each $v \in \mathcal{V}$ by $\mathcal{T}_K$ the set of elements containing $v$ as a vertex.

The discrete unknowns of the VAG scheme are values at the vertices of the mesh and at the center of each element. Following [56], we define a discrete space as

$$ W_{\mathcal{T}} = \{(c_s)_{s \in \mathcal{V}}, (c_K)_{K \in \mathcal{T}}, c_s = 0 \text{ for } s \in \Gamma_D\}, $$

and we denote by $N_{\mathcal{T}}$ its dimension (the sum of the number of vertices and the number of cells, up to the vertices located on the Dirichlet part of the boundary).
Given a cell $K \in \mathcal{T}$, we consider the triangular submesh where, for each edge $\sigma \in \mathcal{E}_K$ a triangle is formed by joining the center of the cell to each of the two vertices at the ends of $\sigma$ (see Figure 1).

<figure><img src="image_6.png" /><figcaption>Figure 1. Triangular submesh for a cell K.</figcaption></figure>

We can now define a discrete gradient for each discrete unknown $c_T \in W$, as the gradient of the $P_1$ finite element function on the submesh defined above. This gradient is a constant vector on each triangular sub-cell. For future reference, we denote by $\eta_s, s \in \mathcal{V}$ (resp. $\eta_K, K \in \mathcal{T}$) the basis functions of the $P_1$ space associated to the vertices (resp. the cell centers).

The VAG scheme is defined by a variational formulation on the discrete space $W_T$ using the gradient defined above. The gradient leads to the definition of fluxes from a cell $K \in \mathcal{T}$ to any of its vertices $v \in \mathcal{V}_K$. The diffusion fluxes are defined as

$$F_{K,v}^{\mathrm{d}}(c_{T}^{n+1}) = \sum_{v' \in \mathcal{V}_K} T_{K}^{vv'}(c_{K}^{n+1} - c_{v'}^{n+1}), \quad (23)$$

where the transmissivities $T_K^{vv'}$ can be computed locally on element K. Their values are given in [56,57].

One also needs advection fluxes, defined as

$$F_{K,v}^{\mathrm{a}}(c_{T}^{n+1}) = F_{K,v}^{\mathrm{d}}(p_{T})c_{K,v}^{n+1}, \quad (24)$$

where $F_{K,v}^{\mathrm{d}}(p_T)$ is the flux computed as in (23) with the pressure from the flow step, and $c_{K,v}$ is the upwind concentration defined as (cf [56])

$$c_{K,v} = \begin{cases} c_K & \text{if } F_{K,v}^{\mathrm{d}}(p_T) \ge 0, \\ c_v & \text{if } F_{K,v}^{\mathrm{d}}(p_T) < 0. \end{cases} \quad (25)$$

The discrete problem is now defined by the following system:

$$\left\{ \begin{array}{l} \phi_K |K| \frac{c_K^{n+1} c_K^n}{\Delta t} + \sum_{v,v' \in \mathcal{V}_K} T_K^{v,v'} (c_K^{n+1} - c_{v'}^{n+1}) + \sum_{v \in \mathcal{V}_K} F_{K,v}(p_T) c_{K,v}^{n+1} = f_K, \quad \forall K \in \mathcal{T} \\ \\ \phi_K |K| \frac{c_v^{n+1} c_v^n}{\Delta t} - \sum_{K \in \mathcal{V}_v, v' \in \mathcal{V}_K} T_K^{v,v'} (c_K^{n+1} - c_{v'}^{n+1}) - \sum_{K \in \mathcal{T}_v} F_{K,v}(p_T) c_{K,v}^{n+1} = f_v, \quad \forall v \in \mathcal{V} \end{array} \right. \quad (26)$$

where $\phi_K$ is the average porosity on cell K, $f_K = \int_K f(x) \eta_K(x) dx$ and $f_v = \int_{\Omega} f(x) \eta_s(x) dx$. In a more condensed notation, we have to solve a linear system

$$\Phi \frac{c_T^{n+1} - c_T^n}{\Delta t} + A_V c_T^{n+1} = f_T^{n+1}. \quad (27)$$

One notes that the first equation in (26) is local to each element. The cell unknowns can thus be eliminated locally, so that the resulting system involves only the values of the concentration at the vertices. However, in a time dependent problem, the cell unknowns
must be recomputed at each time step. This will be important in the coupling with the local chemical problem in Section 4.3.

With a slight abuse of notation, we denote again by $\Psi_T$ the discrete version of the transport operator defined in (14), so that (27) is equivalent to $c_T^{n+1} = \Psi_T(c_T^n, f_T)$.

In the examples reported in Section 5, we have used ComPASS [35,58] as a black box for the transport solver. ComPASS is an open source platform for the simulation of multiphase compositional flow on generic unstructured meshes, targeting hydrothermal systems.

### 4.3. The Discrete Coupled Problem

We now put the two previous sections and Section 3.2 together. The framework for doing this is provided by previous work by the authors [23]. The main issue is to realize that we are solving a problem that couples all concentrations at all degrees of freedom (DOFs), both vertices and cell centers, but that transport only couples spatial DOFs while chemistry is local to each DOF. The method proposed in [22,23] attempts to decouple transport and chemistry, without sacrificing the numerical efficiency afforded by Newton's method on the coupled problem.

The unknowns of the discrete problems are vectors in $\mathcal{X} = \mathbf{R}^{(N_c+N_p)\times N_T}$, and we denote them by the same letter as their continuous counterpart, written in bold face. For a vector $\mathbf{C} \in \mathcal{X}$, we follow [22] and denote by

* $\mathbf{C}_{:,j}$ the column vector of concentrations of all chemical species at the DOF $j$.

* $\mathbf{C}_{i,:}$ the row vector of concentrations of species $i$ at all DOFs.

We now extend the transport and chemical operators to operate on vectors in $\mathcal{X}$.

$$ \Psi_C: \begin{array}{c} \mathcal{X} \mapsto \mathcal{X} \\ \mathbf{T} \to \Psi_C(\mathbf{T}), \end{array} \quad \text{and} \quad \Psi_T: \begin{array}{c} \mathcal{X} \mapsto \mathcal{X} \\ \mathbf{C} \to \Psi_C(\mathbf{C}), \end{array} \qquad (28) $$

with

$$ \begin{aligned} \Psi_C(\mathbf{T})_{:,j} &= \psi_C(\mathbf{T}_{:,j}), \quad \text{for } j = 1, \dots, N_T, \\ \Psi_T(\mathbf{C}, \mathbf{f})_{i,:} &= \psi_T(\mathbf{C}_{i,:}, \mathbf{f}_{i,:}), \quad \text{for } i = 1, \dots, N_c + N_p. \end{aligned} \qquad (29) $$

We also note that $\Psi_T$ can be made explicit, in matrix form, by making use of the Kronecker product [59]. As first explained in [21] the action of the transport operator

$$ \mathbf{C}^{n+1} = \Psi_T(\mathbf{C}^n, \mathbf{f}^{n+1}) $$

is equivalent to the solution of the linear system

$$ (\mathbf{\Phi} \otimes I) \frac{\mathbf{C}^{n+1} - \mathbf{C}^n}{\Delta t} + (A_V \otimes I) \mathbf{C}^{n+1} = \mathbf{f}^{n+1}. $$

Of course the Kronecker product is just a notational device, the full matrix $A_V \otimes I$ is never actually formed. Rather, the implementation of the transport operator is done with a loop over all species, in which one time step of a transport problem is solved (see [23] for details). Similarly, the chemical solution operator $\Psi_C$ can be evaluated independently for each degree of freedom of the mesh.

We noted in Section 3.2 that the implementation of the Newton-Krylov method required the solution of a linear system with the jacobian of the function $F$ defined in (16). We emphasize that this function is defined implicitly through the evaluation of both solution operators $\Psi_C$ and $\Psi_T$. Alternatively, evaluating $F$ requires the solution of

1. One step of a transport problem for each chemical species;

2. One chemical equilibrium problem for each vertex and each cell.

As explained above, computing the Jacobian matrix is impractical, as it requires the inverse of the two solution operators. However, GMRES does not need the Jacobian matrix itslef, but only its action on a vector. The product $Jv$ is interpreted as a directional
derivative. We have shown in [23] how to compute this matrix vector product from the Jacobians of the transport operator (in our case, this is a linear operator) and the chemical equilibrium operator (where the local Jacobian is needed as part of an inner Newton loop).

In this work, we have resorted to a Jacobian free version of the Newton–Krylov method (see [24] or [25–27]), where the required matrix by vector product is approximated by a finite difference quotient. For a small value of $δ$ (see [46] for guidelines on how to choose $δ$), there holds:

$$Jv = F'(\bar{C}^{(n+1,k)})v \approx \frac{F(\bar{C}^{(n+1,k)} + \delta v) - F(\bar{C}^{(n+1,k)})}{\delta}.$$

The consequence is that the overall method can be implemented as soon as one can evaluate the transport and chemistry operators. Not only is this a minimal requirement, it is also what is needed to implement the more common Standard Iterative Approach recalled in (17). The tradeoff between both methods is an expected reduction in the number of iterations versus an increase in function evaluations for solving the linear systems at each Newton step (but notice that the Newton–Krylov methods are a special case of Inexact Newton methods, so that the linear system can be solved with an accuracy that depends on the progress of the outer Newton loop).

# 5. Numerical Results

## 5.1. Validation Example for the Interior Point Method: The Iron Precipitation Diagram

As a validation for the Newton–interior point method for computing chemical equilibrium in the presence of precipitation, we chose to recompute the pE–pH diagram for iron, also known as a Eh–pH or Pourbaix diagram ([60], p. 73).

The precise set of species used and the value of the equilibrium constants can be found in the PhD. thesis by Carrayrou [61]. It comprises nine aqueous species and four solid species.

For each pair of values of the pH (between 0 and 14) and the pE (between -14 and 20), a chemical equilibrium is solved by the method detailed in Section 4.1. We first report on the number of iterations needed for the method to converge. On the left, Figure 2 shows a map of the number of iterations for each pE–pH pair, and on the right a histogram of the total number of iterations. Both images show that the method usually converges in less than 30 iterations (the average is 31.6 and the median is 19), but that it failed to converge in a significant number of cases, and we see from the left image that these cases correspond to the upper-right corner of the diagram, that is too large values of both pE and pH.

<figure><img src="image_7.png" /><figcaption>**Figure 2.** Number of iterations for the iron precipitation example. (Left) map as a function of pH and pE, (Right) histogram of iteration number.</figcaption></figure>
The diagram itself is shown on Figure 3. We see again in the upper right corner, and also on the rightmost band, that the Newton–IP method had difficulties with this range of values. However, the general shape of the computed diagram is in qualitative agreement with the expected behavior.

<figure><img src="image_8.png" /><figcaption>Figure 3. pH–pE diagram (Pourbaix diagram) for iron. In each region, the dominant species is shown.</figcaption></figure>

## 5.2. 2D Test Case: Example 11 of PhreeQC

### 5.2.1. Description of the Test Case

The following example simulates an advective transport in the presence of a cation exchanger. This example is adopted as a test case to validate our method in the two-dimensional case. Its 1D version represents the well known example 11 of PHREEQC documentation [37]. The example describes an experiment in a column whose chemical composition contains a cation exchanger.

Initially, the column contains a sodium-potassium-nitrate solution in equilibrium with the exchanger. The column is flushed along its left side with three pore volumes of a calcium chloride solution. Calcium, potassium, and sodium react to equilibrium with the exchanger at all times.

The flow and transport parameters used in this example are presented in Table 1, with some additional parameters to represent a 2D geometry. The initial and injected concentrations are listed in Table 2. The cation exchanger capacity is 1.1 mmol/L.

The chemical reactions for this example can be written as

$$Na^+ + X^- \rightleftharpoons NaX$$

$$K^+ + X^- \rightleftharpoons KX$$

$$\frac{1}{2}Ca^{2+} + X^- \rightleftharpoons \frac{1}{2}CaX_2$$
<table><caption>**Table 1.** Physical parameters.</caption><thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr><td>Darcy Velocity (m/s)</td><td>2.78 × 10<sup>-6</sup></td></tr><tr><td>Diffusion coeff (m<sup>2</sup>/s)</td><td>5.56 × 10<sup>-9</sup></td></tr><tr><td>Domain dimensions (m)</td><td>0.1 × 0.015</td></tr><tr><td>Mesh size (m)</td><td>0.002 × 0.0015</td></tr><tr><td>Time duration (day)</td><td>1</td></tr></tbody></table>

<table><caption>**Table 2.** Initial and injected aqueous concentrations (mmol).</caption><thead><tr><th>Comp.</th><th>C<sub>init</sub></th><th>C<sub>inflow</sub></th></tr></thead><tbody><tr><td>Ca<sup>2+</sup></td><td>0</td><td>0.6 × 10<sup>-3</sup></td></tr><tr><td>Cl<sup>-</sup></td><td>0</td><td>1.2 × 10<sup>-3</sup></td></tr><tr><td>K<sup>+</sup></td><td>2 × 10<sup>-4</sup></td><td>0</td></tr><tr><td>Na<sup>+</sup></td><td>1 × 10<sup>-3</sup></td><td>0</td></tr></tbody></table>

KX, NaX, and CaX₂ are the complexes formed with the rock, while X indicates the ion exchange site with a charge -1. The chemical description (mass action and conservation laws) can be represented in the Morel tableau in Table 3:

<table><caption>**Table 3.** Morel tableau for Phreeqc example.</caption><thead><tr><th></th><th>Ca<sup>2+</sup></th><th>Na<sup>+</sup></th><th>Cl<sup>-</sup></th><th>K<sup>+</sup></th><th>X</th><th>log K</th></tr></thead><tbody><tr><td>CaX<sub>2</sub></td><td>1</td><td>0</td><td>0</td><td>0</td><td>2</td><td>3.4576</td></tr><tr><td>NaX</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td><td>0</td></tr><tr><td>KX</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td><td>0.7</td></tr><tr><td>Total</td><td>T<sub>Ca</sub></td><td>T<sub>Na</sub></td><td>T<sub>Cl</sub></td><td>T<sub>K</sub></td><td>W</td><td></td></tr></tbody></table>

where T<sub>Ca</sub>, T<sub>Na</sub>, T<sub>Cl</sub>, T<sub>K</sub> are the total aqueous concentrations and W is the total fixed concentrations (in this example W is a constant equal to 1.1 × 10<sup>-3</sup>).

The domain is a rectangle that initially contains a solution of potassium and sodium, with CaCl₂ injected on all or part of the left boundary (the other boundary conditions are zero diffusive flux). We assume that the flow undergoes a uniform horizontal velocity.

We consider two different configurations depending on where CaCl₂ is injected on the left boundary of the domain:

**1D configuration:** The injection is made on the entire left boundary of the domain, which leads to a solution that depends only on *x*. This allows for a quick check of the method;

**2D configuration:** The injection is made only on a part of the left boundary of the domain, which gives rise to a genuinely two-dimensional solution.

### 5.2.2. Numerical Results

#### 1D Configuration

In this case, CaCl is injected along the full left boundary, so that the concentration depends only on *x*. This allows for a comparison with the reference solution from the PhreeqC documentation [37].

Figure 4 shows the concentrations along a horizontal line at *t* = 6 h.
<figure><img src="image_9.png" /><figcaption>**Figure 4.** Total aqueous concentrations for *y* = 0.0075, at *t* = 6 h.</figcaption></figure>

Then, we plot on Figure 5 the elution curves (concentrations at the end of the column as a function of pore volume), so as to compare with the reference solution (cf. page 241 of the PhreeqC documentation [37]). We recall that chloride is a tracer that does not react chemically, and is only subject to transport. Its concentration is given by the well known analytical solution of Ogata and Banks [62].

<figure><img src="image_10.png" /><figcaption>**Figure 5.** Evolution of concentrations at the end of the column.</figcaption></figure>

The results show a good agreement with those in [37].
## 2D Configuration

In this second case, to show real 2D effects, we inject the solution of CaCl₂ on only a part of the left boundary. We consider the same values of the concentrations at the limits, and the same initial conditions as those of the 1D configuration.

Figure 6 shows the aqueous concentration of Ca²⁺, Na⁺, Cl⁻, and K⁺, obtained at time t = 6 h, while Figure 7 shows the aqueous concentration as a function of x along the middle of the domain.

<figure><img src="image_11.png" /><figcaption>Figure 6. Total aqueous concentrations at t = 6 h.</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>Figure 7. Total aqueous concentrations for y = 0.0075 m, at t = 6 h.</figcaption></figure>
The results are consistent with physical understanding. Here also chloride remains a perfect tracer whose solution curve can be compared with an analytical solution [63]. The numerical chloride results show a good agreement with this analytical solution. The behavior of the other species is similar to the 1D case, with the addition of diffusion along the vertical direction.

### 5.2.3. Performance of the Elimination Method

In this section we compare the methods discussed in Section 4 for solving the coupled system: the Sequential Iterative Approach and the global approach using Newton-Krylov method (NKM in what follows), that is the nonlinear elimination strategy described in Sections 3.1 and 4.3. Our main criterion will be the number of iterations required by each method.

We apply the global and the splitting approaches to the 2D test case described in the previous section using several spatial resolutions (ranging from 80 to 2000 grid cells), see Figure 8.

<figure><img src="image_13.png" /><figcaption>Figure 8. Number of iterations per time-step for the first 20 time-steps for the various solution methods.</figcaption></figure>

Figure 8 shows the number of iterations required by each method per time-step for the first 20 time steps, as the mesh resolution is refined. The shape of the curves shows that the both methods have difficulty in converging for the first two time steps, but from the third time step (from time = 0.3 h), and for a given mesh resolution, the convergence becomes stable for almost the same number of iterations during the simulation.

Now if we compare the two methods, SIA requires at each time step more iterations than the NKM method (the nonlinear elimination strategy). This number of iterations increases with the mesh resolution for the SIA method while it remains stable and small for the NKM method.

The NKM method requires only two nonlinear iterations on average at each time step for different mesh resolution. Figure 9 shows the results for a typical time step (at $t = 0.5$ h). As predicted, the elimination method gives a convergence independent of the mesh size also in this 2D case (we had shown in [23] that this was the case for the 1D configuration).
<figure><img src="image_14.png" /><figcaption>**Figure 9.** Number of Iterations as a function of the mesh size for the various solution methods at *t* = 0.5 h.</figcaption></figure>

**Remark 2.** Here, we do not compare the CPU time, nor the number of evaluation of the objective function. Certainly the NKM method whose Jacobian* vector product is approximated by finite differences at each linear iteration requires a larger number of function evaluations. The number of evaluation of the function will be proportional to the number of the non-linear iterations for the NKM method times the number of GMRES iterations. We are currently investigating the use of an exact Jacobian times vector product, as this should drastically reduce the CPU time for a simulation.

## 5.3. SHPCO2 Benchmark

### 5.3.1. Description of the Test Case

The aim of this study is to test the capabilities of the equilibrium chemical solver to handle mineral precipitation and dissolution as well as taking into account chemical reactions in a spatially heterogeneous medium. The test case has been described in [64], and results can be found in [65]. The model is a simplified scenario for CO₂ injection assuming the gas remain immobile, so that a one-phase flow model can be used and gaseous carbon dioxide CO₂(g) is considered as a fixed species.

The reservoir model is heterogeneous, with low permeability barriers designed to create a complex flow pattern. At the same time, two injectors at different locations induce a complex mixing: one is upstream directly in contact with the bubble of CO₂ and the second one is downstream of the CO₂ bubble. At time *t* = 0, supercritical CO₂(g) is injected in a specific zone and is in equilibrium with the concentrations of other chemical species.

## Geometry and Physical Data

In this test we consider a two dimensional rectangular domain. A detailed geometry of the domain is shown in Figure 10. The aquifer is divided into five zones, the three green rectangle zones are low permeability barriers, the orange disc zone is the injection zone of gaseous CO₂ and has the same properties as the remaining bulk zone (in white).

The flow in the porous medium is computed by solving a single phase flow for the Darcy velocity where the boundary conditions are 110 bars in injector 1, 105 bars in injector 2 and 110 bars in producer as labeled in Figure 10. The other boundary conditions are no flow, an impermeable Neumann boundary conditions.
<figure><img src="image_15.png" /><figcaption>Figure 10. Geometry of domain for the SHPCO2 Benchmark.</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>Figure 11. Pressure and velocity for the SHPCO2 model.</figcaption></figure>

The values of the flow parameters are given in Table 4. Figure 11 shows the pressure and the velocity fields, and one can see clearly the effect of the low permeability barriers.

<table><caption>Table 4. Flow parameters.</caption><thead><tr><th>Constants</th><th>Bulk</th><th>Barriers</th></tr></thead><tbody><tr><td>Permeability K [m<sup>2</sup>/Pas]</td><td>10<sup>-10</sup></td><td>10<sup>-12</sup></td></tr><tr><td>Diffusion coefficient D [m/s<sup>2</sup>]</td><td>10<sup>-9</sup></td><td>10<sup>-9</sup></td></tr><tr><td>Porosity φ</td><td>0.2</td><td>0.2</td></tr></tbody></table>

## Chemical System

The chemical system in this test consists of eight components:

* Five liquid primary components: water (H₂O), hydrogen ion (H⁺), carbon dioxide dissolved in water (CO₂(l)), calcium ion (Ca²⁺), chlorine (Cl⁻);

* Two secondary liquid components: hydroxide ion (OH⁻), hydrogen carbonate (HCO₃⁻);

* One fixed precipitated component: calcite (CaCO₃);

* One gas component: gaseous carbon dioxide (CO₂(g)).
In this test, we make the assumption that the gas phase is immobile and therefore gaseous carbon dioxide CO₂(g) can be considered like a fixed precipitated component, and because pressure variations are small throughout the domain, the partial pressure can be incorporated in the equilibrium constant for CO₂ dissolution.

Among the components of the system there are four chemical reactions:

* Two aqueous equilibrium reactions:

$$ \begin{aligned} \text{OH}^{-} &\rightleftharpoons \text{H}_2\text{O} - \text{H}^{+} \\ \text{HCO}_3^{-} &\rightleftharpoons \text{H}_2\text{O} - \text{H}^{+} + \text{CO}_2\text{(l)} \end{aligned} $$

* Two precipitation-dissolution reactions (taken here to be at equilibrium):

$$ \begin{aligned} \text{CO}_2\text{(g)} &\rightleftharpoons \text{CO}_2\text{(l)} \\ \text{CaCO}_3 &\rightleftharpoons \text{H}_2\text{O} - 2\text{H}^{+} + \text{CO}_2\text{(l)} + \text{Ca}^{2+} \end{aligned} $$

Chlorine Cl⁻ does not participate in chemical reactions and is used as tracer. Chemical description of the test can be represented in the Morel tableau in Table 5. The values of equilibrium constants log K are given under the condition that we use moles as units for concentration of components.

<table><caption>**Table 5.** Morel table for SHPCO2 system</caption><thead><tr><th></th><th>H<sub>2</sub>O</th><th>H<sup>+</sup></th><th>CO<sub>2</sub>(l)</th><th>Ca<sup>2+</sup></th><th>Cl<sup>-</sup></th><th>log K</th></tr></thead><tbody><tr><th>OH<sup>-</sup></th><td>1</td><td>-1</td><td>0</td><td>0</td><td>0</td><td>-13.2354</td></tr><tr><th>HCO<sub>3</sub><sup>-</sup></th><td>1</td><td>-1</td><td>1</td><td>0</td><td>0</td><td>-6.22</td></tr><tr><th>CO<sub>2</sub>(g)</th><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>-0.2226</td></tr><tr><th>CaCO<sub>3</sub></th><td>1</td><td>-2</td><td>1</td><td>1</td><td>0</td><td>-7.7454</td></tr><tr><th>Total</th><td>T<sub>H<sub>2</sub>O</sub></td><td>T<sub>H<sup>+</sup></sub></td><td>T<sub>CO<sub>2</sub>(l)</sub></td><td>T<sub>Ca<sup>2+</sup></sub></td><td>T<sub>Cl<sup>-</sup></sub></td><td></td></tr></tbody></table>

## Initial State

For the transport problem, initially in the domain we have two zones with different initial values of total concentrations. The first zone is the circular area containing gaseous CO₂ (in orange on Figure 10). In the rest of the domain, concentration of CO₂(g) is initially equal to zero. The initial concentrations of liquid primary components are given in Table 6

<table><caption>**Table 6.** Initial total concentrations for the SHPCO2 Benchmark.</caption><thead><tr><th>Components</th><th>T<sub>init, out of bubble</sub> [mol/L]</th><th>T<sub>init, in bubble</sub> [mol/L]</th></tr></thead><tbody><tr><td>H<sub>2</sub>O</td><td>77.19</td><td>77.21</td></tr><tr><td>H<sup>+</sup></td><td>-43.36</td><td>-43.38</td></tr><tr><td>CO<sub>2</sub>(l)</td><td>21.68</td><td>24.37</td></tr><tr><td>Ca<sup>2+</sup></td><td>21.72</td><td>21.73</td></tr><tr><td>Cl<sup>-</sup></td><td>0</td><td>1</td></tr></tbody></table>

## 5.3.2. Numerical Results

For this preliminary study, we have ran the simulations over the relatively short period of 1900 years. For the results reported below, we could not obtain convergence of the Newton-Krylov method. Because they appear to be qualitatively reasonable, we have nevertheless decided to include them. More investigations are underway to improve the behavior of the NKM method in the presence of minerals, and to ascertain those results.
One particular direction we are currently following is to improve the computation of the Jacobian matrix by vector product, by exploiting the known block structure of the matrix.

## Evolution of Concentrations

Figure 12 shows the initial condition, while Figures 13–15 show snapshots of the concentrations of several species (gaseous CO₂, calcite, H⁺ and Cl⁻) at 302 years, 1352 years and 1852 years respectively (for a mesh with 95 × 60 grid cells).

The gas bubble disappears as CO₂(g) dissolves into water. Here it appears that the dissolution time is somewhat less than 2000 years. At the same time, calcite precipitates, though the effect is quite small, and the medium becomes more acidic. Indeed, one can see that the concentration of H⁺ behaves somewhat differently than that of the tracer.

Variable time steps are used, as described in Table 7. The time steps are chosen so as to have a small time step at the initialization when strong variations happen and to let the time step increase when the solution varies more slowly.

The results can be compared with those reported by [65]. It appears that the dissolution of the gas is faster on our simulations. On the other hand, the evolution of H⁺ happens on a similar scale as that in [65]. This is also the case for Cl⁻, as it is a tracer, and thus only subject to transport.

<table><caption>**Table 7.** Values for variable time step simulation.</caption><thead><tr><td>Start Time (Year)</td><td>End Time (Year)</td><td>Timestep (Year)</td></tr></thead><tbody><tr><td>0</td><td>2</td><td>0.1</td></tr><tr><td>2</td><td>20</td><td>1</td></tr><tr><td>20</td><td>400</td><td>10</td></tr><tr><td>400</td><td>1210</td><td>50</td></tr><tr><td>1210</td><td>1900</td><td>100</td></tr></tbody></table>

<figure><img src="image_17.png" /><figcaption>**Figure 12.** Concentrations of the gas CO₂(g), the calcite CaCO₃, H⁺ and the tracer Cl⁻ at t = 0 year.</figcaption></figure>
<figure><img src="image_18.png" /><figcaption>**Figure 13.** Concentrations of the gas CO₂(g), the calcite CaCO₃, H⁺ and the tracer Cl⁻ at t = 302 year.</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>**Figure 14.** Concentrations of the gas CO₂(g), the calcite CaCO₃, H⁺ and the tracer Cl⁻ at t = 1352 year.</figcaption></figure>
<figure><img src="image_20.png" /><figcaption>**Figure 15.** Concentrations of the gas CO₂(g), the calcite CaCO₃, H⁺ and the tracer Cl⁻ at *t* = 1852 year.</figcaption></figure>

### Comparison of the Dissolution CO₂(g) on Two Different Meshes

We investigate the effect of the mesh refinement on the results. We present on Figures 16 to 17 the CO₂ concentrations obtained with two different meshes (a coarse mesh with 38 × 24 cells and a fine mesh with 95 × 60 cells) at two different times.

<figure><img src="image_21.png" /><figcaption>**Figure 16.** CO₂(g), at *t* = 302 y (left image: coarse mesh, right image: fine mesh).</figcaption></figure>

<figure><img src="image_22.png" /><figcaption>**Figure 17.** CO₂(g), at *t* = 800 y (left image: coarse mesh, right image: fine mesh).</figcaption></figure>

One can see the expected better resolution of the bubble (less numerical diffusion), but also that the speed of dissolution of the bubble changes as the mesh is refined. This is
one possible explanation for the apparent shorter dissolution times that we observed as compared to [65].

**Author Contributions:** Both authors contributed equally to all parts of the work. Both authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Data Availability Statement:** The code and data used in the experiments can be found on https://gitlab.inria.fr/charms/pynkrt.

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

## References

1. Zhang, F.; Yeh, G.; Parker, J., Eds. *Groundwater Reactive Transport Models*; Bentham Publishers: Sharjah, United Arab Emirates, 2012.

2. Steefel, C.I.; Appelo, C.A.J.; Arora, B.; Jacques, D.; Kalbacher, T.; Kolditz, O.; Lagneau, V.; Lichtner, P.C.; Mayer, K.U.; Meeussen, J.C.L.; et al. Reactive transport codes for subsurface environmental simulation. *Comput. Geosci.* **2015**, *19*, 445–478. [CrossRef]

3. Steefel, C.; DePaolo, D.; Lichtner, P. Reactive transport modeling: An essential tool and a new research approach for the Earth sciences. *Earth Planet. Sci. Lett.* **2005**, *240*, 539–558. [CrossRef]

4. Yeh, G.T.; Tripathi, V.S. A critical evaluation of recent developments in hydrogeochemical transport models of reactive multi-chemical components. *Water Resour. Res.* **1989**, *25*, 93–108. [CrossRef]

5. Carrayrou, J.; Mosé, R.; Behra, P. Operator-splitting procedures for reactive transport and comparison of mass balance errors. *J. Contam. Hydrol.* **2004**, *68*, 239–268. [CrossRef]

6. Lagneau, V.; van der Lee, J. HYTEC results of the MoMas reactive transport benchmark. *Comput. Geosci.* **2010**, *14*, 435–449. [CrossRef]

7. Mayer, K.U.; Frind, E.O.; Blowes, D.W. Multicomponent reactive transport modeling in variably saturated porous media using a generalized formulation for kinetically controlled reactions. *Water Resour. Res.* **2002**, *38*, 1174,

8. Samper, J.; Xu, T.; Yang, C. A sequential partly iterative approach for multicomponent reactive transport with CORE2D. *Comput. Geosci.* **2008**, *13*, 301–316. [CrossRef]

9. Yeh, G.T.; Tripathi, V.S. A Model for Simulating Transport of Reactive Multispecies Components: Model Development and Demonstration. *Water Resour. Res.* **1991**, *27*, 3075–3094. [CrossRef]

10. Su, D.; Mayer, K.U.; MacQuarrie, K.T.B. MIN3P-HPC: A High-Performance Unstructured Grid Code for Subsurface Flow and Reactive Transport Simulation. *Math. Geosci.* **2020**. [CrossRef]

11. Xu, T.; Sonnenthal, E.; Spycher, N.; Pruess, K. TOUGHREACT—A simulation program for non-isothermal multiphase reactive geochemical transport in variably saturated geologic media: Applications to geothermal injectivity and CO₂ geological sequestration. *Comput. Geosci.* **2006**, *32*, 145–165. [CrossRef]

12. Yapparova, A.; Gabellone, T.; Whitaker, F.; Kulik, D.A.; Matthäi, S.K. Reactive Transport Modelling of Dolomitisation Using the New CSMP++GEM Coupled Code: Governing Equations, Solution Method and Benchmarking Results. *Transp. Porous Med.* **2017**, *117*, 385–413. [CrossRef]

13. Fan, Y.; Durlofsky, L.J.; Tchelepi, H.A. A fully-coupled flow-reactive-transport formulation based on element conservation, with application to CO₂ storage simulations. *Adv. Water Resour.* **2012**, *42*, 47–61. [CrossRef]

14. Ahusborde, E.; El Ossmani, M.; Moulay, M.I. A fully implicit finite volume scheme for single phase flow with reactive transport in porous media. *Math. Comput. Simul.* **2019**, *164*, 3–23.

15. Hoffmann, J.; Kräutle, S.; Knabner, P. A parallel global-implicit 2-D solver for reactive transport problems in porous media based on a reduction scheme and its application to the MoMaS benchmark problem. *Comput. Geosci.* **2009**, *14*, 421–433. [CrossRef]

16. Kräutle, S.; Knabner, P. A new numerical reduction scheme for fully coupled multicomponent transport-reaction problems in porous media. *Water Resour. Res.* **2005**, *41*. [CrossRef]

17. Kräutle, S.; Knabner, P. A reduction scheme for coupled multicomponent transport-reaction problems in porous media: Generalization to problems with heterogeneous equilibrium reactions. *Water Resour. Res.* **2007**, *43*. [CrossRef]

18. de Dieuleveult, C.; Erhel, J.; Kern, M. A global strategy for solving reactive transport equations. *J. Comput. Phys.* **2009**, *228*, 6395–6410. [CrossRef]

19. De Dieuleveult, C.; Erhel, J. A global approach to reactive transport: Application to the MoMas benchmark. *Comput. Geosci.* **2010**, *14*, 451–464. [CrossRef]

20. Erhel, J.; Sabit, S. Analysis of a Global Reactive Transport Model and Results for the MoMaS Benchmark. *Math. Comput. Simul.* **2017**, *137*, 286–298. [CrossRef]

21. Erhel, J.; Sabit, S.; de Dieuleveult, C. Solving Partial Differential Algebraic Equations and Reactive Transport Models. In *Developments in Parallel, Distributed, Grid and Cloud Computing for Engineering*; Topping, B.H.V., Ivànyi, P., Eds.; Computational Science, Engineering and Technology Series; Saxe Coburg Publications: London, UK, 2013; pp. 151–169.
22. Amir, L.; Kern, M. A global method for coupling transport with chemistry in heterogeneous porous media. *Comput. Geosci.* **2010**, *14*, 465–481. [CrossRef]

23. Amir, L.; Kern, M. Preconditioning a Coupled Model for Reactive Transport in Porous Media. *Int. J. Numer. Anal. Model.* **2019**, *16*, 18–48.

24. Knoll, D.A.; Keyes, D.E. Jacobian-free Newton-Krylov methods: A survey of approaches and applications. *J. Comput. Phys.* **2004**, *193*, 357–397. [CrossRef]

25. Hammond, G.E.; Valocchi, A.; Lichtner, P. Application of Jacobian-free Newton–Krylov with physics-based preconditioning to biogeochemical transport. *Adv. Water Resour.* **2005**, *28*, 359–376. [CrossRef]

26. Carr, E.; Turner, I.; Perré, P. A variable-stepsize Jacobian-free exponential integrator for simulating transport in heterogeneous porous media: Application to wood drying. *J. Comput. Phys.* **2013**, *233*, 66–82. [CrossRef]

27. Guo, L.; Huang, H.; Gaston, D.R.; Permann, C.J.; Andrs, D.; Redden, G.D.; Lu, C.; Fox, D.T.; Fujita, Y. A parallel, fully coupled, fully implicit solution to reactive transport in porous media using the preconditioned Jacobian-Free Newton-Krylov Method. *Adv. Water Resour.* **2013**, *53*, 101–108. [CrossRef]

28. Kräutle, S. The semismooth Newton method for multicomponent reactive transport with minerals. *Adv. Water Resour.* **2011**, *34*, 137–151. [CrossRef]

29. Buchholzer, H.; Kanzow, C.; Knabner, P.; Kräutle, S. The semismooth Newton method for the solution of reactive transport problems including mineral precipitation-dissolution reactions. *Comput. Optim. Appl.* **2011**, *50*, 193–221. [CrossRef]

30. Kräutle, S. Existence of global solutions of multicomponent reactive transport problems with mass action kinetics in porous media. *J. Appl. Anal. Comput.* **2011**, *1*, 497–515.

31. El-Bakry, A.S.; Tapia, R.A.; Tsuchiya, T.; Zhang, Y. On the formulation and theory of the Newton interior-point method for nonlinear programming. *J. Optim. Theory Appl.* **1996**, *89*, 507–541. [CrossRef]

32. Leal, A.M.M.; Kulik, D.A.; Smith, W.R.; Saar, M.O. An overview of computational methods for chemical equilibrium and kinetic calculations for geochemical and reactive transport modeling. *Pure Appl. Chem.* **2017**, *89*, 597–643. [CrossRef]

33. Saaf, F.E. A Study of Reactive Transport Phenomena in Porous Media. Ph.D. Thesis, Rice University, Houston, TX, USA, 1997.

34. Arbogast, T.; Bryant, S.; Dawson, C.; Saaf, F.; Wang, C.; Wheeler, M. Computational methods for multiphase flow and reactive transport problems arising in subsurface contaminant remediation. *J. Comput. Appl. Math.* **1996**, *74*, 19–32. [CrossRef]

35. Lopez, S.; Masson, R.; Beaude, L.; Birgle, N.; Brenner, K.; Kern, M.; Smaï, F.; Xing, F. Geothermal Modeling in Complex Geological Systems with the ComPASS Code. In *Stanford Geothermal Workshop 2018—43rd Workshop on Geothermal Reservoir Engineering*; Stanford University: Stanford, CA, USA, 2018.

36. Eymard, R.; Guichard, C.; Herbin, R. Small-stencil 3D schemes for diffusive flows in porous media. *ESAIM Math. Model. Numer. Anal.* **2012**, *46*, 265–290. [CrossRef]

37. Parkhurst, D.L.; Appelo, C. *User's Guide to PHREEQC (Version 2)—A Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations*; Technical Report 99-4259; USGS: Reston, VA, USA, 1999.

38. Appelo, C.A.J.; Postma, D. *Geochemistry, Groundwater and Pollution*, 2nd ed.; CRC Press: Boca Raton, FL, USA, 2005.

39. Rubin, J. Transport of reacting Solutes in Porous Media: Relation Between Mathematical Nature of Problem Formulation and Chemical Nature of reactions. *Water Resour. Res.* **1983**, *19*, 1231–1252. [CrossRef]

40. Bear, J.; Cheng, A.H.D. *Modeling Groundwater Flow and Contaminant Transport*; Theory and Applications of Transport in Porous Media; Springer: Berlin/Heidelberg, Germany, 2010; Volume 23.

41. Saaltink, M.; Ayora, C.; Carrera, J. A Mathematical Formulation for Reactive Transport that Eliminates Mineral Concentrations. *Water Resour. Res.* **1998**, *34*, 1649–1656. [CrossRef]

42. Fahs, M.; Carrayrou, J.; Younes, A.; Ackerer, P. On the efficiency of the direct substitution approach for reactive transport problems in porous media. *Water Air Soil Pollut.* **2008**, *193*, 299–308. [CrossRef]

43. Saaltink, M.; Carrera, J.; Ayora, C. On the behavior of approaches to simulate reactive transport. *J. Contam. Hydrol.* **2001**, *48*, 213–235. [CrossRef]

44. Kanney, J.F.; Miller, C.T.; Kelley, C.T. Convergence of Iterative Split Operator Approaches for Approximating Nonlinear Reactive Transport Problems. *Adv. Water Resour.* **2003**, *26*, 247–261. [CrossRef]

45. Saaltink, M.; Carrera, J.; Ayora, C. A Comparison of Two Approaches for Reactive Transport Modelling. *J. Geochem. Explor.* **2000**, *69–70*, 97–101. [CrossRef]

46. Kelley, C.T. *Iterative Methods for Linear and Nonlinear Equations*; With Separately Available Software, Frontiers in Applied Mathematics; SIAM: Philadelphia, PA, USA, 1995; Volume 16, pp. 154–165.

47. Saad, Y.; Schultz, M.H. GMRES: A generalized minimal residual algorithm for solving nonsymmetric linear systems. *SIAM J. Sci. Stat. Comput.* **1986**, *7*, 856–869. [CrossRef]

48. Hoffmann, J.; Kräutle, S.; Knabner, P. A general reduction scheme for reactive transport in porous media. *Comput. Geosci.* **2012**, *16*, 1081–1099. [CrossRef]

49. Marinoni, M.; Carrayrou, J.; Lucas, Y.; Ackerer, P. Thermodynamic Equilibrium Solutions Through a Modified Newton Raphson Method. *AIChE J.* **2016**, *63*, 1246–1262. [CrossRef]

50. Wolery, T.; Jarek, R.L. *Software User's Manual*; EQ3/6, Version 8.0; Sandia National Laboratories: Albuquerque, Bernalillo, 2003.

51. Facchinei, F.; Pang, J.S. *Finite-Dimensional Variational Inequalities and Complementarity Problems*; Springer Series in Operations Research; Springer: New York, NY, USA, 2003; Volume I, pp. 34, 624, I69.
52. Facchinei, F.; Pang, J.S. *Finite-Dimensional Variational Inequalities and Complementarity Problems*; Springer Series in Operations Research; Springer: New York, NY, USA, 2003; Volume II, pp. 1–34, 625–1234, II1–II57.

53. Bethke, C.M. *Geochemical and Biogeochemical Reaction Modeling*, 2nd ed.; Cambridge University Press: Cambridge, UK, 2008.

54. Carrayrou, J. Looking for some reference solutions for the reactive transport benchmark of MoMaS with SPECY. *Comput. Geosci.* **2010**. [CrossRef]

55. Leal, A.M.; Blunt, M.J.; LaForce, T.C. Efficient chemical equilibrium calculations for geochemical speciation and reactive transport modelling. *Geochim. Cosmochim. Acta* **2014**, *131*, 301–322. [CrossRef]

56. Eymard, R.; Guichard, C.; Herbin, R.; Masson, R. Vertex centred discretization of two-phase Darcy flows on general meshes. In *Congrès National de Mathématiques Appliquées et Industrielles*, ESAIM Proc.; EDP Sciences: Les Ulis, France, 2011; Volume 35, pp. 59–78. [CrossRef]

57. Eymard, R.; Guichard, C.; Herbin, R.; Masson, R. Vertex-centred discretization of multiphase compositional Darcy flows on general meshes. *Comput. Geosci.* **2012**, *16*, 987–1005. [CrossRef]

58. Dalissier, E.; Guichard, C.; Havé, P.; Masson, R.; Yang, C. ComPASS: A tool for distributed parallel finite volume discretizations on general unstructured polyhedral meshes. In *CEMRACS 2012*, ESAIM Proc.; EDP Sciences: Les Ulis, France, 2013; Volume 43, pp. 147–163. [CrossRef]

59. Golub, G.H.; van Loan, C.F. *Matrix Computations*, 4th ed.; Johns Hopkins University Press: Baltimore, MD, USA, 2013.

60. Brookins, D.G. *Eh-pH Diagrams for Geochemistry*; Springer: Berlin/Heidelberg, Germany, 1988.

61. Carrayrou, J. Modélisation du Transport de Solutes Réactifs en Milieu Poreux Saturé. Thèse de Doctorat, Université Louis Pasteur, Strasbourg, France, 2001.

62. Ogata, A.; Banks, R.B. *A Solution of the Differential Equation of Longitudinal Dispersion in Porous Media*; Technical Report Prof. Pap., 411-A; USGS: Reston, VA, USA, 1961.

63. Feike, L.; Dane, J.H. Analytical solution of the one dimensional advection equation and two- or tree-dimensional dispersion equation. *Water Resources Res.* **1990**, *26*, 1475–1482.

64. Haeberlein, F. Time Space Domain Decomposition Methods for Reactive Transport—Application to CO2 Geological Storage. Thèse de Doctorat, Université Paris 13, Paris, France, 2011.

65. Ahusborde, E.; El Ossmani, E. A sequential approach for numerical simulation of two-phase multicomponent flow with reactive transport in porous media. *Math. Comput. Simul.* **2017**, *137*, 71–89. [CrossRef]