1 Introduction

Understanding the impact geochemical reactions, with some combination of fluid flow, solute transport and heat transfer, have on the subsurface is important since it has a wide range of applications. These include carbon sequestration (Addassi et al. 2021), geothermal energy extraction (Akaku et al. 1991; Todaka et al. 2004; Chen et al. 2018), nuclear waste management (Socié et al. 2021), microbiofilm processes (Rittmann and VanBriesen 1996) and ion exchange and chromatography (Appelo 1996).

The subsurface has, in many cases, a complex fracture network. Fractures often serve as the preferred flow paths. They thus transport more rapidly chemical species that trigger chemical reactions. The chemical reactions alter the porous medium locally, e.g. through dissolution/precipitation of reactive minerals, impacting fracture conductivity (Salimzadeh and Nick 2019), or through accelerated degeneration of the geological structure (Socié et al. 2021). Such modifications affect the porous medium globally. Hence, fractures strongly influence the geochemical alteration of the porous medium.

This tight interplay between reactive transport processes and fractures makes the development of mathematical models and simulation tools difficult. Additionally, the coupling of reactive transport with fluid flow and heat transfer is characterised by a strong chemical and physical coupling. The flow and transport equations are described by coupled partial differential equations (Steefel et al. 2005; Cheng and Yeh 1998; Xu and Pruess 2001). If local equilibrium is assumed, the chemical reactions are represented by nonlinear algebraic equations (Yeh and Tripathi 1989; Kirkner and Reeves 1988).

Numerical strategies for solving the coupled chemical and physical equations are divided into the sequential approach and the global implicit approach (Yeh and Tripathi 1989; Steefel and MacQuarrie 1996; Zhang et al. 2016). In the sequential approach, the equations are split and solved sequentially, either once (non-iterative) or via iteration. These options are attractive since they are easy to implement and allow the usage of the most suited method for each equation. However, they require small time steps, even for moderately complex problems (Saaltink et al. 2001; de Dieuleveult et al. 2009), and the iterative option may require several iterations to converge (Saaltink et al. 2001). In the global approach, the equations are not separated but solved fully coupled. While this method is more challenging to implement, the advantages are that it often requires fewer iterations and permits larger time steps (Saaltink et al. 2001; Steefel et al. 2015). The performance of the coupling schemes is compared in, e.g. Steefel and MacQuarrie (1996), Saaltink et al. (2001) and Carrayrou et al. (2010).

Incorporating fractures in solution strategies implies the need for a representation that captures the transport and reaction effects within the fractures. One option is to use the multiple interacting continua model of Pruess and Narasimhan (1985). The idea of this model is to appropriately subgrid the matrix near the matrix–fracture interface to capture, e.g. chemical concentrations that propagate more rapidly through the fractures. This model is implemented in the simulator TOUGHREACT (Xu and Pruess 2001), which has been applied to simulate the geochemical interaction with fractured media in various applications (Xu et al. 2006; Dobson et al. 2003).

An alternative option is to explicitly represent the fractures in conjunction with the matrix (MacQuarrie and Mayer 2005; Berre et al. 2019). This option is commonly referred to as a discrete fracture-matrix model. In such models, the matrix and fractures are assigned individual equations. Further, the fractures are considered as objects one dimension lower than the matrix (see, e.g. Steefel and Lichtner 1998a; Fumagalli and Scotti 2021; MacQuarrie and Mayer 2005), a representation often called mixed-dimensional representation (cf. Fumagalli and Scotti 2021). In the lower-dimensional modelling of fractures, the fracture aperture is treated as a model parameter and not a geometric constraint (Berre et al. 2019; Fumagalli and Scotti 2021). This is beneficial since the aperture may change during the simulations without requiring regridding.

Examples using this approach include Steefel and Lichtner (1998a), who presented a multicomponent reactive transport formulation with mineral dissolution and precipitation in fractured media. In their model, the matrix-fracture coupling was through a continuity concentration condition and a zero-gradient concentration condition midway between the fractures. In a companion article (Steefel and Lichtner 1998b), they used this formulation to simulate the infiltration of hyperalkaline groundwater into fractures.

Another example is Fumagalli and Scotti (2021), who proposed a mathematical model and sequential non-iterative scheme for non-isothermal reactive transport for the geochemical model of Agosti et al. (2016). Here, the matrix–fracture interface was modelled using the dimension-reducing interface modelling of Martin et al. (2005).

This work presents a mathematical model and numerical approach to simulate single-phase flow and non-isothermal multicomponent reactive transport with mineral dissolution and precipitation in fractured porous media. The basis of our model is a discrete fracture-matrix mixed-dimensional framework, using the methodology of Martin et al. (2005) to define the dimensionally reduced governing equations for the fractures and the fracture–matrix interactions. The fluid flow, heat transfer and solute transport are modelled by conservation partial differential equations (PDEs) and discretised by finite-volume methods. The chemical reactions are represented by nonlinear algebraic equations, while the mineral dissolution and precipitation are formulated as a complementarity problem. To advance in time, we solve the governing equations fully coupled.

The article is organised as follows: section 2 introduces mixed-dimensional geometry and describes the governing model equations and the chemical system. We describe our numerical approach in Sect. 3 and present simulation results in Sect. 4. The numerical tests will show the convergence of our model and its ability to handle the interplay between challenging fracture networks and chemical and physical processes. Finally, we give some concluding remarks in Sect. 5.

2 Mathematical Model

This section describes the mathematical model for the reactive transport in fractured porous media. We begin, for simplicity, by presenting the governing model equations in the context of the porous matrix in Sects. 2.12.3. After introducing the mixed-dimensional geometry in Sect. 2.4, we expand the model PDEs in the mixed-dimensional setting in Sect. 2.5. Finally, changes in factors that couple geochemical transport to fluid flow and energy transport are addressed in Sect. 2.6.

2.1 Geochemical Equations

We consider a geochemical system that consists of aqueous, sorbed and precipitated chemical species and assume at any time chemical equilibrium. We divided the species into \(M_1\) components and \(M_2\) secondary species (Lichtner 1996; Kirkner and Reeves 1988; Yeh and Tripathi 1989), where the components form a linearly independent basis for the geochemical system. The chemical reactions between the components and secondary species are written in the canonical form (Lichtner 1996):

$$\begin{aligned} X_{n} \rightleftharpoons \sum _{k=1}^{M_1}\xi _{nk}X_k, \quad n=1, \ldots , M_2 . \end{aligned}$$
(1)

The single species on the left-hand side is the secondary species, and the species on the right-hand side are the components. Finally, \(\xi _{nk}\) represents the stoichiometric coefficient for the kth component in the nth reaction.

Following the geochemical modelling of Yeh and Tripathi (1989), Kirkner and Reeves (1988) and de Dieuleveult et al. (2009), we distinguish between the aqueous, sorbed and precipitated species by writing the above reactions for the various species. The reactions for the aqueous and sorbed species read:

$$\begin{aligned} \alpha _{n}&\rightleftharpoons \sum _{k=1}^{N_{c}}S_{nk} c_{k}, \quad{} & {} n=1, \, \ldots , \, N_{\alpha }, \\ \beta _{n}&\rightleftharpoons \sum _{k=1}^{N_{c}}A_{nk} c_{k} + \sum _{k=1}^{N_{s}}B_{nk} s_{k},\quad{} & {} n=1, \, \ldots , \, N_\beta. \end{aligned}$$

Here, \(c=(c_{k})\in \mathbb {R}^{N_c}\) and \(s=(s_{k})\in \mathbb {R}^{N_s}\) are vectors representing the chemical species of the aqueous and sorbed components. Further, \(\alpha =(\alpha _{n}) \in \mathbb {R}^{N_{\alpha }}\) and \(\beta =(\beta _{n}) \in \mathbb {R}^{N_{\beta }}\) are vectors representing the chemical species of the aqueous and sorbed secondary species. Finally, the matrices \(S\in \mathbb {R}^{N_\alpha \times N_c}\), \(A \in \mathbb {R}^{N_{\beta } \times N_c}\) and \(B \in \mathbb {R}^{N_\beta \times N_s}\) contain the stoichiometric coefficients, with \(M_{ij}\) being element (ij) in the matrix M.

The equilibrium reactions are described by the mass action laws, which provide a link between the components and secondary species. Setting all activity coefficients to unity so that the activity and concentrations are equal and using the same notation for the chemical species and its concentration, the mass action laws for the aqueous and adsorbed reactions read:

$$\begin{aligned} \alpha _n &= K_{n}^{\alpha } \prod _{k=1}^{N_c} c_k^{S_{nk}},\end{aligned}$$
(2a)
$$\begin{aligned} \beta _n = K_{n}^{\beta } \prod _{k=1}^{N_c} c_k^{A_{nk}} \prod _{k=1}^{N_s} s_k^{B_{nk}}, \end{aligned}$$
(2b)

where \(K^{\alpha } = ( K_{n}^{\alpha })\in \mathbb {R}^{N_\alpha }\) and \(K^{\beta } = (K_{n}^{\beta })\in \mathbb {R}^{N_\beta }\) are the vectors of equilibrium constants.

The precipitate species dissolves or precipitates when they react with the aqueous components:

$$\begin{aligned} \gamma _{n} \rightleftharpoons \sum _{k=1}^{N_{p}} E_{nk}c_{k},\, n=1, \, \ldots , \, N_{\gamma }, \end{aligned}$$

where \(\gamma = (\gamma _{n}) \in \mathbb {R}^{N_{\gamma }}\) is a vector of precipitate species and \(E = (E_{nk}) \in \mathbb {R}^{N_\gamma \times N_p}\) are the stoichiometric coefficients.

If the precipitate species is present, we write the mass action law for the corresponding reaction as:

$$\begin{aligned} 1 = K_{n}^{\gamma }\prod _{k=1}^{N_{p}}c_k^{E_{nk}}, \end{aligned}$$
(3)

where \(K^{\gamma }=( K_{n}^{\gamma }) \in \mathbb {R}^{N_\gamma }\) are equilibrium constants, and the activity of the precipitate species has been taken to be 1. If, on the other hand, the precipitate species is completely dissolved, the right-hand side of (3) is less than the left-hand side:

$$\begin{aligned} 1 > K_{n}^{\gamma }\prod _{k=1}^{N_{p}} c_k^{E_{nk}}. \end{aligned}$$
(4)

Table 1 illustrates a schematic organisation of the algebraic relationships between the components, secondary species and stoichiometric coefficients in terms of the vectors c, s, \(\alpha\), \(\beta\) and \(\gamma\), and the matrices S, A, B and E. With these variables, we can write a mass balance law for each component (Yeh and Tripathi 1989; Kirkner and Reeves 1988)

$$\begin{aligned} U&= c + S^{T}\alpha + A^{T}\beta + E^{T}\gamma ,\end{aligned}$$
(5)
$$\begin{aligned}W = s + B^{T}\beta , \end{aligned}$$
(6)

where U and W are the total concentrations for the mobile and immobile components.

Table 1 Systematisation of the algebraic relationships between the components and secondary species

2.2 Flow Equations

We consider a single-phase flow in a porous medium, where the fluid flow is modelled by Darcy’s law, together with the mass conservation for the fluid:

$$\begin{aligned} \textbf{v}&=-\frac{\mathcal {K}}{\mu } \nabla p,\end{aligned}$$
(7)
$$\begin{aligned}\partial _{t}(\phi \rho _f)&+ \nabla \cdot (\textbf{v} \rho _f) = 0. \end{aligned}$$
(8)

In the above equations, \({\textbf {v}}\) is the Darcy flux, \(\mathcal {K}\) is the permeability, p is the pressure, \(\phi\) is the porosity and \(\rho _f\) is the fluid density, with the subscript f referring to the fluid. Finally, \(\mu\) is the fluid’s dynamic viscosity and is, for simplicity, assumed to be constant.

We can insert Darcy’s law into the mass conservation equation, yielding

$$\begin{aligned} \partial _t(\phi \rho _f) - \nabla \cdot (\frac{\rho _f \mathcal {K}}{\mu }\nabla p)=0, \end{aligned}$$
(9)

which we use to obtain the pressure.

2.3 Transport Equations

The transport of the solute species is assumed to happen due to advection but not dispersion. Denoting a concentration of a chemical species by u, we thus model the temporal evolution of the individual species by the transport equation

$$\begin{aligned} \partial _t (\phi u) + \nabla \cdot (\textbf{v}u) = R_{u}, \end{aligned}$$
(10)

where \(R_{u}\) is a reaction rate term. We can compute a linear combination of the transport equations, under the assumption that the flow is independent of time and the chemical species (cf. de Dieuleveult and Erhel 2010). Furthermore, since the chemical reactions are at equilibrium, the reaction rate terms are eliminated when computing the combination. The outcome is the following transport equations, applied to the total concentrations

$$\begin{aligned}&\partial _t(\phi U) + \nabla \cdot (\textbf{v} C)=0,\end{aligned}$$
(11)
$$\begin{aligned}\partial _t(\phi W) =0, \end{aligned}$$
(12)

where \(C=c+S^{T}\alpha\) is the aqueous part of U. For the derivation, we refer to Yeh and Tripathi (1989); Kirkner and Reeves (1988).

The mechanisms for energy transport are convection and thermal conduction, so we disregard external heat sources accounting for, e.g. heat production from chemical reactions. Moreover, local thermal equilibrium is assumed so that the temperature of the fluid and host rock are equal. With these assumptions, the temperature is modelled by the energy conservation equation:

$$\begin{aligned} \partial _t((\rho b)_{m} T) + \nabla \cdot (\textbf{v}(\rho b)_{f} T - \lambda _{m}\nabla T)=0, \end{aligned}$$
(13)

where \((\rho b)_{m}=\phi (\rho b)_{f}+(1-\phi )(\rho b)_{r}\) and \(\lambda _{m}=\phi \lambda _{f}+(1-\phi )\lambda _r\) are the heat capacity per unit volume and thermal conductivity, respectively. The subscript r refers to the rock. The specific heat capacity and thermal conductivity are denoted by b and \(\lambda\), with the subscripts indicating if it is a fluid or rock property. Finally, \(\rho _{r}\) is the density of the rock. We assume these parameters are given and constant.

2.4 Mixed-Dimensional Geometry

We described the governing model equations in the porous matrix in the preceding subsections. In this and the subsequent subsection, we expand the model for fractures and their intersections. The collection of the model equations for the matrix, fractures and intersections results in a discrete fracture-matrix mixed-dimensional non-isothermal reactive transport model.

We first introduce some notation for the mixed-dimensional representation of a \(D\)-dimensional (\(D=2,3\)) fractured porous medium \(\Omega\). Following Martin et al. (2005) and Boon et al. (2018), we divide \(\Omega\) into subdomains for the rock matrix, the fractures and fracture intersections. The subdomain for the matrix is a subset of \(\mathbb {R}^D\), the subdomains for the fractures are a subset of \(\mathbb {R}^{D-1}\) and the subdomains representing fracture intersection are a subset of \(\mathbb {R}^{D-2}\). Additionally, in the case \(\Omega \subset \mathbb {R}^3\), three fractures may mutually intersect at a single zero-dimensional point (intersection of intersections). Each subdomain is denoted \(\Omega _i\), where the subscript i varies over all subdomains and is used to identify variables belonging to the ith subdomain. See Fig. 1 (left) for a 2D illustration of this decomposition.

Two subdomains whose dimensions differ by one communicate through an interface \(\Gamma _j\), where subscript j varies over the interfaces and is used to identify quantities belonging to the jth interface. Using the notation of Keilegavlen et al. (2021), we denote the higher-dimensional subdomain by \(\Omega _h\) and the lower-dimensional subdomain by \(\Omega _l\). The part of \(\Omega _h\) connected to the interface is an internal boundary \(\partial _j \Omega _h\); see Fig. 1 (right). Hence, \(\Omega _l\), \(\partial _j\Omega _h\) and \(\Gamma _j\) coincide geometrically. We also define \(\hat{S}_{i}\) and \(\check{S}_{i}\) as the sets of interfaces from \(\Omega _{i}\) towards its higher- and lower-dimensional neighbours, respectively. For example, for a subdomain \(\Omega _i\) representing a fracture, the set \(\hat{S}_i\) will represent the interfaces of the fracture to the neighbouring matrix, while the set \(\check{S}_i\) represents the interfaces of the fracture to possible neighbouring fracture intersection subdomains. For a subdomain \(\Omega _i\) representing the matrix, the set \(\hat{S}_i\) will be empty, while the set \(\check{S}_i\) will indicate interfaces of the matrix to neighbouring fractures.

To complete the description of the connection between neighbouring subdomains, we introduce projection operators for transferring variables between \(\Omega _h\), \(\Omega _l\) and \(\Gamma _j\). The operators are depicted in Fig. 2. First, we have the trace operator, tr, which maps quantities in \(\Omega _h\) onto its internal boundary. \(\Pi\) is a projector that maps from a subdomain onto an interface. The superscript indicates whether the subdomain is of a higher or lower dimension, and the subscript points to the interface’s index. Lastly, the operator \(\Xi\) maps from the interface onto a neighbouring subdomain, with a similar interpretation of the super- and subscript.

Fig. 1
figure 1

Left: Illustration of a 2D porous matrix (\(\Omega _{1}\)) with five fractures (\(\Omega _{2-6}\)), represented as red lines and two fracture intersection points (\(\Omega _{7-8}\)), depicted as black dots. Right: Visualisation of the connection between a higher-dimensional subdomain, \(\Omega _{h}\), and a lower-dimensional subdomain, \(\Omega _{l}\), via an interface, \(\Gamma _j\). The part of \(\Omega _h\) connected to the interface is an internal boundary \(\partial _{j} \Omega _h\). The internal boundary, the interface and the lower-dimensional subdomain coincide geometrically but are shown apart for illustration

Fig. 2
figure 2

Illustration of the projection operators between two subdomains and a single interface. tr is a trace operator that maps quantities from inside \(\Omega _h\) onto its boundary, \(\partial _{j} \Omega _h\). The \(\Pi _{j}^l\) and \(\Pi _{j}^h\) operators map from a subdomain onto the interface. Lastly, \(\Xi _{j}^h\) and \(\Xi _{j}^l\) map from the interface to the higher- and lower-dimensional subdomains, respectively

2.5 Governing Equations in Fractured Media

Utilising the notation from the previous subsection, we now present the governing PDEs in the fractures and their intersections; the geochemical equations (3)–(5) are as in the matrix.

For a subdomain \(\Omega _i\) of dimension \(d<D\) (i.e. the fracture and intersections), the fluid flow equations read

$$\begin{aligned} \textbf{v}_{i}&=-\mathcal {V}_i\frac{\mathcal {K}_{i}}{\mu} \nabla p_i,\end{aligned}$$
(14)
$$\begin{aligned}\partial _{t}(\mathcal {V}_i\phi _i \rho _{f,i})&+ \nabla \cdot (\textbf{v}_i \rho _{f,i}) = \psi _{i}.\end{aligned}$$
(15)

In these equations, the nabla operator and the permeability \(\mathcal {K}_{i}\) operate in the tangential plane of the subdomain. Further, the scaling by the specific volume \(\mathcal {V}_i\) accounts for the dimension reduction (Stefansson et al. 2021). It is given by \(\mathcal {V}_{i} = a_{i}^{D-d}\), where \(a_{i}\) is the hydraulic aperture of the fracture (Zimmerman and Bodvarsson 1996). We also point out that there is no tangential flow direction for zero-dimensional points, resulting in a vanishing Darcy flux (Boon et al. 2018).

The source term \(\psi _{i}\) accounts for the coupling with the higher-dimensional neighbour subdomain. With \(v_{j}\) denoting an interface fluid flux, the source term on a single interface is \(\Xi _j^l(\Pi _{j}^{h}\mathcal {V}_{h})\rho _{f,j} v_j\). Here, the scaling by the specific volume ensures that the dimension of the interface flux matches with the fluxes in the higher-dimensional neighbour (Stefansson et al. 2021). Since \(\Omega _i\) has several interfaces that couple it with its higher-dimensional neighbour (recall Fig. 1 (right)), the source term is a sum of fluxes over the interfaces, that is

$$\begin{aligned} \psi _{i} =\Sigma _{j\in \hat{S}_i}\, \Xi _{j}^{l} (\Pi _{j}^{h} \mathcal {V}_{h}) \rho _{f,j} v_j. \end{aligned}$$

The higher-dimensional neighbour communicates with \(\Omega _{i}\), via the interface fluid flux, through a Neumann boundary condition:

$$\begin{aligned} {\textbf {n}}_h \cdot \textbf{v}_h = \Xi _{j}^{h}v_j \quad \text {on } \, \partial _j \Omega _h, \quad j \in \check{S}_i. \end{aligned}$$
(16)

The interface flux is modelled by the Darcy-type equation (Martin et al. 2005)

$$\begin{aligned} v_{j}=-\frac{2\mathcal {K}_{j}}{\mu \Pi _{j}^{l}a_{l}} \big (\Pi _{j}^l p_{l} - \Pi _{j}^{h}tr(p_{h})\big ). \end{aligned}$$
(17)

Here, \(\mathcal {K}_j\) is an effective permeability in the normal direction of the lower dimensional subdomain, accounting for the conductance of fractures (Berre et al. 2019), and \(p_h\) and \(p_l\) are the pressure in \(\Omega _{h}\) and \(\Omega _{l}\), respectively.

The equations describing the solute transport and heat transfer in the fracture and intersection subdomains, and at the interfaces have the same structure as the flow equations. For the solute transport equations, a sum of advective interface fluxes, \(\eta _{j}\), enters the equations as a source term so that the system of equations will be:

$$\begin{aligned}&\partial _{t}(\mathcal {V}_{i}\phi _{i} U_{i}) + \nabla \cdot (\textbf{v}_{i} C_{i})=\Sigma _{j\in \hat{S}_i} \, \Xi _{j}^{l} (\Pi _{j}^{h} \mathcal {V}_{h}) \eta _{j},\end{aligned}$$
(18)
$$\begin{aligned}\partial _{t}(\mathcal {V}_{i} \phi _{i}W_{i}) =0.\end{aligned}$$
(19)

In \(\Omega _h\), the Neumann boundary condition for the coupling takes the form:

$$\begin{aligned} \textbf{n}_{h} \cdot (\textbf{v}_{h} C_{h}) |_{\partial _{j} \Omega _{h}} = \Xi _{j}^{h} \eta _{j}, \,\, j \in \check{S}_i. \end{aligned}$$
(20)

The advective interface flux follows the interface fluid flux direction as follows:

$$\begin{aligned} \eta _{j}= {\left\{ \begin{array}{ll} v_{j}\Pi _{j}^{h}tr(C_{h}), &{}\text {if } v_{j} \ge 0 \\ v_{j} \Pi _{j}^{l}C_{l}, &{}\text {if } v_{j} < 0. \end{array}\right. } \end{aligned}$$
(21)

Finally, the energy conservation equation in the mixed-dimensional setting reads:

$$\begin{gathered} \partial _{t} ({\mathcal{V}}_{i} (\rho b)_{{m,i}} T_{i} ) + \nabla \cdot ({\mathbf{v}}_{i} (\rho b)_{{f,i}} T_{i} - {\mathcal{V}}_{i} \lambda _{{m,i}} \nabla T_{i} ) \hfill = \\ \quad\,\, \Sigma _{{j \in \hat{S}_{i} }} \Xi _{j}^{l} (\Pi _{j}^{h} {\mathcal{V}}_{h} )(w_{j} + q_{j} ), \hfill \\ \end{gathered}$$
(22)

with the internal boundary conditions

$$\begin{aligned}&\mathbf{n}_h \cdot (\mathbf{v}_{h}(\rho b)_{f,h}T_{h}) |_{\partial _j\Omega _h} &= \Xi _{j}^{h} w_j,\end{aligned}$$
(23)
$$\begin{aligned}\textbf{n}_h \cdot (-\lambda _{m,h}\nabla T_{h})|_{\partial _j\Omega _h} & = \Xi _{j}^{h}q_j,\end{aligned}$$
(24)

for \(j \in \check{S}_{i}\).

The interface convective and conductive fluxes, \(w_j\) and \(q_j\), are calculated as

$$\begin{aligned} w_j&={\left\{ \begin{array}{ll} v_j \Pi _{j}^h tr((\rho b)_{f,h} T_h), &{}\text { if } v_j \ge 0 \\ v _j\Pi _{j}^l (\rho b)_{f,l} T_l, &{}\text { if } v_j <0, \end{array}\right. }\end{aligned}$$
(25)
$$\begin{aligned}q_j&=-\frac{2 \Pi _{j}^{l} \lambda _{f,l} }{\Pi _j^{l}a_l}(\Pi _j^{l}T_l -\Pi _j^{h}tr(T_h)).\end{aligned}$$
(26)

2.6 Coupling of Fluid Flow, Reactive Transport and Heat Transfer

The last set of equations we need is constitutive laws for the factors that couple the fluid flow, reactive transport and heat transfer.

Our modelling framework allows using different constitutive laws to model a varying fluid density, such as linear dependence on temperature, pressure and ion concentration (Bringedal et al. 2014) or a combination of the temperature-dependent density of pure water and concentration, molecular weight and density of dissolved chemical species (Cheng and Yeh 1998).

In the present work, we model the fluid density of a slightly compressible fluid according to the following:

$$\begin{aligned} \rho _f=\rho _{f,0}\exp \big \{\hat{c}_f(p-p_{0}) - \hat{\beta }_f (T-T_{0})\big \}. \end{aligned}$$
(20)

Here, \(\rho _{f,0}\) is a reference fluid density, and the coefficients \(\hat{c}_f\) and \(\hat{\beta }_f\) are the fluid compressibility and fluid thermal expansion, respectively. Finally, \(p_{0}\) and \(T_{0}\) are initial pressure and temperature.

The porosity is calculated from

$$\begin{aligned} \phi = 1 - \sum _{n=1}^{N_\gamma }\chi _{n} - \chi _{\text {nr}}, \end{aligned}$$
(21)

where \(\chi _{n}\) is the nth mineral volume fraction,

$$\begin{aligned} \chi _{n}=\frac{V_{n}}{V_{\text {medium}}}, \end{aligned}$$

and \(V_{n}\) is the volume of the nth mineral. Further, \(\chi _{\text {nr}}\) is the mineral volume fraction of a non-reactive mineral and is only present in the matrix.

For alteration of the matrix permeability, we use a Kozeny–Carman equation,

$$\begin{aligned} \mathcal {K}=\mathcal {K}_{0}\big (\frac{1-\phi _{0}}{1-\phi }\big )^{2}\big (\frac{\phi }{\phi _{0}}\big )^{3}, \end{aligned}$$
(22)

where \(\mathcal {K}_0\) and \(\phi _0\) are the initial permeability and porosity. Other choices are also possible, see, e.g. MacQuarrie and Mayer (2005). The fracture permeability is calculated by the cubic law

$$\begin{aligned} \mathcal {K}=\frac{a^{2}}{12}. \end{aligned}$$
(23)

We estimate fracture aperture as

$$\begin{aligned} a=a_0-\sum _{n=1}^{N_\gamma }\frac{V_n}{A_n}, \end{aligned}$$
(24)

where \(a_{0}\) is the fracture aperture when no reactive minerals are present, and \(A_{n}\) is the nth mineral surface area. In this work, we set the surface areas to be constants for simplicity. However, constitutive laws where the surface areas depend on, e.g. porosity (Steefel and Lichtner 1998a) can also be used.

At fracture intersections, we calculate the aperture as the average of its higher-dimensional neighbours (Stefansson et al. 2021):

$$\begin{aligned} a_{\text {intersect}} = \frac{1}{|\hat{S}_{l} |}\Sigma _{j\in \hat{S}_{l}} \, \Xi ^{l}_{j} \Pi ^{h}_{j}a_{h}. \end{aligned}$$
(25)

In our model, the normal permeability at the fracture–matrix interface can be set independent from the tangential permeability. This flexibility can be used, for instance, to let the normal permeability determine which minerals are precipitated on the fracture walls. In the present simulation, we take the simpler option of setting the normal permeability equal to the permeability of its lower-dimensional neighbour:

$$\begin{aligned} \mathcal {K}_{j}=\Pi _{j}^{l}\mathcal {K}_{l}. \end{aligned}$$

Finally, the equilibrium constants depend on temperature. We model this temperature dependency according to van’t Hoff’s relationship

$$\begin{aligned} K=K_{0}\exp \bigg \{ \frac{\Delta H^0}{R} \Big (\frac{1}{T_0} -\frac{1}{T}\Big ) \bigg \}, \end{aligned}$$
(26)

where \(K_0\) is a reference equilibrium constant at the initial temperature \(T=T_0\) and R is the ideal gas constant. Finally, \(\Delta H^0\) is the standard enthalpy of the particular chemical reaction and is assumed to be independent of temperature. However, as remarked by Cheng and Yeh (1998), we pointed out that this equation is only applicable if the standard enthalpies are available, and some data-based equations can be used to model K if this information is not available. We use the standard enthalpy values in Chang and Goldsby (2014).

3 Numerical Approach

We now present our fully coupled solution strategy to solve the system that consists of the PDEs (6)–(19) and the nonlinear geochemical equations (3)–(5), together with the constitutive laws (21)–(26).

3.1 Spatial Discretisation

The PDEs are solved using the method of lines, i.e. we first discretise in space. For spatial discretisation, we use cell-centred finite-volume methods. The advective flux terms are discretised by a first-order upwind scheme so that, e.g. the advective part of Eq. (11) is calculated as

$$\begin{aligned} (\textbf{v}C)_{kl} = {\left\{ \begin{array}{ll} (\textbf{v} C)_{l}, \text { if sign}(\textbf{v}_{kl}) > 0 \\ (\textbf{v} C)_{k}, \text { if sign}(\textbf{v}_{kl}) \le 0 \end{array}\right. } \end{aligned},$$

where sign\((\textbf{v}_{kl})\) is the sign of the flux moving from cell k to l at the previous iterate. We have a similar expression for the convective term in Eq. (13), where also the fluid density is computed from the previous iterate.

For simplicity, the elliptic parts (the Darcy flux and conduction term) are discretised by the two-point flux approximation method (Aziz and Settari 1979). Finally, the fluid density in Eq. (9) is mapped from the cell centres to the faces by an upstream weighting.

For the lower-dimensional PDEs, we discretise the flux terms using lower-dimensional versions of the schemes described above (Keilegavlen et al. 2021; Stefansson et al. 2021). Moreover, the interface fluxes are calculated using the projected subdomain variables. In particular, the advective interface fluxes (21) and (26) are discretised by an upwind scheme (Keilegavlen et al. 2021).

3.2 Numerical Modelling of Geochemistry

To evaluate the conservation equations (5) and (6), we use the logarithmic formulation described in de Dieuleveult et al. (2009). We introduce the variables \(lc=\ln (c)\) and \(ls=\ln (s)\). These variables guarantee that the component concentrations are always positive. Further, the mass action laws (2) and (2) can be rewritten as

$$\begin{aligned} \alpha&= K^{\alpha }\exp (Slc), \\ \beta&= K^{\beta }\exp (Alc + Bls), \end{aligned}$$

where Slc, Alc and Bls are matrix–vector multiplications. One issue with the logarithm formulation is when concentrations equal zero. We resolve this problem by approximation zero by \(\exp \{-30\}\). Lastly, the solubility condition (3) and (4) can be formulated as a complementarity problem and solved, in vectorised from, as (Kräutle 2011)

$$\begin{aligned} \min (\gamma , \, 1-K^{\gamma }\exp (Elc) )=0. \end{aligned}$$

The minimum function is a semismooth function, and the equation must be solved by a semismooth Newton method. We solve it with an active set strategy by defining the two sets (Kanzow 2004)

$$\begin{aligned} \mathcal {A}_{n}&: \{\gamma : \gamma _n \ge 1-K_{n}^{\gamma }\Pi _{k=1}^{N_p}c_{k}^{E_{nk}} \}, \\ \mathcal {I}_{n}&: \{\gamma :1-K_{n}^{\gamma }\Pi _{k=1}^{N_p}c_{k}^{E_{nk}} > \gamma _n\}, \end{aligned}$$

so the minimum equation can be solved as

$$\begin{aligned} \mathcal {F}_{\mathcal {A}_{n}}(\gamma ) (1-K^{\gamma }\exp (E lc)) + \mathcal {F}_{\mathcal {I}_{n}}(\gamma )\gamma =0, \end{aligned}$$

where \(\mathcal {F}_{\mathcal {A}_{n}}\) and \(\mathcal {F}_{I_{n}}\) are diagonal matrices with entries

$$\begin{aligned} \mathcal {F}_{\mathcal {A}_{n}}(\gamma )&= {\left\{ \begin{array}{ll} 1,&{} n \in \mathcal {A}_{n} \\ 0,&{} n \in \mathcal {I}_{n} \end{array}\right. }, \\ \mathcal {F}_{\mathcal {I}_{n}}(\gamma )&= {\left\{ \begin{array}{ll} 0,&{} n \in \mathcal {A}_{n} \\ 1,&{} n \in \mathcal {I}_{n} \end{array}\right. }. \end{aligned}$$

3.3 Fully Implicit Scheme

To advance forward in time, we couple the semi-discretised PDEs with the geochemical equations (3)–(5) and the constitutive laws (21)–(26) at every computational cell. The resulting system of differential-algebraic equations is solved fully coupled, using the backward Euler method for temporal discretisation. Hence, at every time step, we solve a system of nonlinear equations in the form

$$\begin{aligned} G(Y^{n})=0. \end{aligned}$$

Here, G represents the residual form of the equations and \(Y^{n}\) is a vector representing \(p, \, U, \,W, \,T, \, \phi , \, a, \, \mathcal {K}, \, K\), at time step n. The nonlinear system is solved using a damped Newton’s method (Dennis Jr and Schnabel 1996). The kth Newton iteration gives rise to a linear system

$$\begin{aligned} J \cdot (Y_{k+1}^{n+1}-Y_{k}^{n}) = -G(Y_{k}^{n}), \end{aligned}$$
(27)

where J is the Jacobian of \(G(Y_{k}^{n})\) and is calculated by forward automatic differentiation. The linear system is solved using the software superLU (Li 2005).

This strategy is relatively simple and straightforward but can be computationally demanding for problems where the number of mesh points is high and numerous chemical reactions (and consequently solute transport equations) are present. One possible approach to resolve that issue could be to reduce the number of chemical transport equations (8) by applying the technique developed in Kräutle and Knabner (2005, 2007) and applied, e.g. in Hoffmann et al. (2010). Such an approach can also be applied to model solute transport and chemical reaction equations in the mixed-dimensional framework.

Finally, the time step is adjusted following Saaltink et al. (2001): If the number of Newton iterations needed to converge is lower than a prescribed number, the time step is increased by a specified factor. Conversely, if the number of Newton steps is higher than a prescribed number or does not converge, the time step is decreased by a fixed factor. These are complemented with an upper and lower bound on the time step, i.e. \(dt_\text {min} \le dt \le dt_\text {max}\).

We have implemented the presented model using the open-source simulator PorePy (Keilegavlen et al. 2021) to generate computational grids and for spatial discretisation.

4 Numerical Results

In this section, we test our numerical solution strategy on a synthetic test problem. The chemical reactions we consider were introduced by Bringedal et al. (2014) and are displayed in Table 2. This is a simple set of chemical reactions where the two minerals calcite (\(\mathrm{CaCO}_{3}\)) and anhydrite (\(\mathrm{CaSO}_{4}\)) might dissolve or precipitate and affect the permeability. The first three reactions are present since they affect the concentrations of three species in the last two reactions.

Table 2 Chemical reactions and reference equilibrium constants

Using the Gaussian elimination procedure described in Steefel and MacQuarrie (1996), we find that the total concentrations are

$$\begin{aligned} {\text{U}}_{{{\text{Ca}}^{{2 + }} }} &= {\text{Ca}}^{{2 + }} + {\text{CaCO}}_{3} + {\text{CaSO}}_{4}, \hfill \\ {\text{U}}_{{{\text{CO}}_{3}^{{2 - }} }} &= {\text{CO}}_{3}^{{2 - }} + {\text{HCO}}_{3}^{ - } + {\text{CaCO}}_{3}, \hfill \\ {\text{U}}_{{{\text{SO}}_{4}^{{2 - }} }} &= {\text{SO}}_{4}^{{2 - }} + {\text{HSO}}_{4}^{ - } + {\text{CaSO}}_{4}, \hfill \\ {\text{U}}_{{{\text{H}}^{ + } }} &= {\text{H}}^{ + } + {\text{HCO}}_{3}^{ - } + {\text{HSO}}_{4}^{ - } - {\text{OH}}^{ - }, \hfill \\ \end{aligned}$$

where \({\text{H}}_{2} {\text{O}}\) is treated as neither a component nor a secondary species and is assigned unit activity (i.e. it is incorporated in the equilibrium constant of the third reaction). We note that

$$\begin{aligned} U=c+S^{T}\alpha +E^{T}\gamma , \end{aligned}$$

where

$$\begin{aligned} S = \begin{bmatrix} 0 &{\phantom{1}} 1 &{\phantom{1}} 0 &{\phantom{-\!\!1}} 1 \\ 0 &{\phantom{1}} 0 &{\phantom{1}} 1 &{\phantom{-\!\!1}}1 \\ 0 &{\phantom{1}} 0 &{\phantom{1}} 0 &{}-\!\!1 \end{bmatrix}, \quad E = \begin{bmatrix} 1 &{\phantom{1}} 1 &{\phantom{1}} 0 &{\phantom{1}} 0 \\ 1 &{\phantom{1}} 0 &{\phantom{1}} 1 &{\phantom{1}} 0 \end{bmatrix}, \end{aligned}$$

are the stoichiometric coefficient matrices for the chemical reactions.

In the simulation examples, we consider a fractured porous medium filled with 20 \(\text {mol}/\text {m}^3\) of calcite and no anhydrite. We then inject a fluid, which causes dissolution of the calcite. The dissolved mineral releases \({\text{Ca}}^{{2 + }}\) ions, which will react with present \({\text{SO}}_{4}^{{2 - }}\) ions and trigger precipitation of anhydrite. An interesting point about our model is that, due to the chemical equilibrium assumption, the precipitation reaction happens simultaneously with the dissolution reaction. Hence, the dissolution front and the precipitation front coincide.

We estimate the mineral volumes using the mineral densities from Schön (2015), and the surface areas are set to two-thirds power of the computational cell volumes. The reference equilibrium constants are from Plummer et al. (1988) and are presented in Table 2.

4.1 Two-Dimensional Simulation—Convergence Study

We consider a convergence study in an isothermal and a non-isothermal context in the first two simulation examples.

The porous medium is initially at a state with a pressure \(p_{0}=1000\) Pa and a matrix permeability \(\mathcal {K}_{0}=10^{-11}\) m\(^2\). We alter the initial state by injecting a fluid, based on a pressure of 7000 Pa, from the left-hand side of the domain. For the aqueous species, the initial and inflow values for \({\text{SO}}_{4}^{{2 - }}\) and \({\text{OH}}^{ - }\) are 10 and 1500 \(\text {mol}/\text {m}^3\), respectively. The remaining initial and inflow values are so that the mass action laws and solubility conditions are fulfilled. The top and bottom walls are impermeable, while on the right-hand side, we impose the initial concentration and pressure values as boundary values.

The geometry is a \(2\times 1\) m two-dimensional domain, consisting of four fractures and one intersection, see Fig. 3 and is discretised with triangles. Starting with a coarse grid consisting of 187 cells for the matrix, 15 fracture cells and one intersection cell, we refine the grid five times. The solutions on the finest grid with 95972 2D cells, 318 1D cells and one 0D cell are used as reference solutions.

Fig. 3
figure 3

Fracture network for the simulations presented in Sects. 4.1.1 and 4.1.2

4.1.1 Isothermal Case

In this subsection, we verify our model in the isothermal context, i.e. we have \(T=T_{0}\) at all times. Consequently, we do not update the equilibrium constants, and the fluid density varies only due to pressure (recall Eq. 27). Additional simulation parameters are listed in Table 3.

Table 3 Simulation parameters for the isothermal test case

Figure 4 shows the reference solution of the pressure and concentrations of \({\text{Ca}}^{{2 + }}\), calcite and anhydrite at the time 1300 s. In the simulation, the fractures are the preferential flow paths, and thus we see a more rapid transport of the aqueous concentration through the leftmost fractures. We see analogous fronts for the dissolution and the precipitation. Further, Fig. 5 shows the same reference solutions at the time 7000 s. The impact of the fractures as the preferential flow paths is again visible. The aqueous concentration propagates rapidly in the rightmost fractures and alters its matrix state locally. The mineral concentrations exhibit similar profiles.

Figures 6 and 7 display the matrix and fracture permeabilities compared to their initial values, and the occluding of the fracture (given as \(a_{0}-a\)) at the times 1300 s and 7000 s. The relationship between the precipitation and the permeability and fracture closure is evident: As the anhydrite precipitates, it changes the porosity and aperture, altering the permeabilities and fracture occluding. However, the permeability results show that the chemical impact is minor.

Fig. 4
figure 4

The reference solutions of the pressure and the concentrations of \({\text{Ca}}^{{2 + }}\), \({\text{CaCO}}_{3}\) and \({\text{CaSO}}_{4}\) at the time 1300 s

Fig. 5
figure 5

The reference solutions of the pressure and the concentrations of \({\text{Ca}}^{{2 + }}\), \({\text{CaCO}}_{3}\) and \({\text{CaSO}}_{4}\) at the time 7000 s

Fig. 6
figure 6

Permeabilities of matrix and fractures relative to the initial state (top), and aperture closure (bottom) at the time 1300 s

Fig. 7
figure 7

Permeabilities of matrix and fractures relative to the initial state (top), and aperture closure (bottom) at the time 7000 s

Finally, Figs. 8 and 9 show the logarithm of the errors for pressure and the chemical species in the individual subdomains under the grid refinement at the time 7000 s. The error is calculated by projecting the coarse grid solution onto the reference grid and measuring the \(l^2\)-norm of the difference between the reference solution and coarse solution. Lastly, the error is normalised by the number of cells in the reference subdomain (Stefansson et al. 2021).

In general, we observe first-order convergence. However, we also observe that the convergence is somewhat slow, and in the fractures, particularly the second one, there are minor kinks. We also note from Fig. 5 that all the calcite within the fractures is dissolved. This implies that the errors for this variable are always zeros, and while we cannot take the logarithm of the errors, it still is convergent.

Modelling of reactive transport is difficult (Carrera et al. 2022) since it requires the solution of coupled PDEs and nonlinear algebraic equations (de Dieuleveult et al. 2009; Carrera et al. 2022). The obtained solution depends on several aspects, such as discretisation, the number of chemical species present (Addassi et al. 2021) and, in our simulation, the varying fracture aperture. These aspects strongly influence the result. Therefore, we consider the results in Figs. 8 and 9 to serve as a convergence verification of the model.

Fig. 8
figure 8

Convergence of the variables in the matrix for the isothermal simulation case. The black line represents first-order convergence

Fig. 9
figure 9

Logarithm of the errors of the variables for the isothermal simulation case in each fracture. The black lines represent first-order convergence

4.1.2 Non-isothermal Case

In this subsection, we carry out the convergence study in the non-isothermal context. The addition of the thermal effects increases the complexity of the simulation because it adds more couplings, particularly to the updates of the equilibrium constants. The varying equilibrium constants introduce an extra thermal front to the chemical front for the chemical concentrations.

The simulation parameters are the same as in Table 3. Regarding the thermal effects, the initial temperature is 573.15 K, and the inflow temperature is 543.15 K. The top and bottom borders are insulating barriers, and we use the initial temperature at the right border. Further parameters for the energy conservation equation and other temperature-related parameters are given in Table 4, and the standard enthalpy values are presented in Table 5.

Table 4 Additional simulation parameters for the non-isothermal convergence study
Table 5 Standard enthalpy values from Chang and Goldsby (2014)

Figures 10 and 11 depict the reference solution of temperature and concentrations of \({\text{Ca}}^{{2 + }}\) ion, the calcite and the anhydrite, after 1300 s and 5000 s, respectively. As in the isothermal case, the fractures are the preferred flow paths. Hence, the temperature and the ion concentration are transported faster through the fractures. Moreover, the chemical and thermal fronts are visible in the outcomes of the \({\text{Ca}}^{{2 + }}\) ion concentration: The blue middle part represents the chemical front, while the leftmost part illustrates the temperature front. The results for matrix and fracture permeabilities compared to their initial state and aperture clogging are not shown since they are indistinguishable from the isothermal case.

Fig. 10
figure 10

Reference solutions for temperature and the concentrations of \({\text{Ca}}^{{2 + }}\), calcite and anhydrite at the time 1300 s

Fig. 11
figure 11

Reference solutions for temperature and the concentrations of \({\text{Ca}}^{{2 + }}\), calcite and anhydrite at the time 5000 s

Fig. 12
figure 12

Convergence of the variables in the matrix for the non-isothermal simulation case. The black line represents first-order convergence

Fig. 13
figure 13

Logarithm of the errors of the variables for the non-isothermal simulation case in each fracture. The black lines represent first-order convergence

Fig. 14
figure 14

Zoom on instabilities in the minerals. To the left, we see an oscillatory behaviour for the precipitating mineral. To the right, we see some remains of the dissolved mineral

Figures 12 and 13 show the logarithm of the errors in the matrix and the fractures for the variables at the time 5000 s. We again observe first-order convergence, albeit slow. Nevertheless, based on the discussion in the previous subsection, we again consider this to be a convergence verification of our model.

We finally observe in Fig. 11 what appears to be a non-physical oscillatory-like behaviour for the anhydrite and remaining calcite in the region that is affected by the cooling, in particular within the intersection fractures and in the matrix around these fractures. We zoom in on this region in Fig. 14. These instabilities were not present in the isothermal simulation case. Therefore, we believe they come from nonlinearities induced by the chemical reactions, in which the equilibrium constants vary due to an altering temperature in a porous media with different dynamically updated properties due to chemical reactions.

4.2 Three-Dimensional Simulation

In this section, we test our model on a three-dimensional problem. We consider the unit cube with two two-dimensional intersecting fractures; see Fig. 15.

Fig. 15
figure 15

Left: Unit cube. Right: Intersecting two-dimensional fractures

The simulation parameters and initial and boundary values are as in Sect. 4.1, with the modification that the inlet and outlet for this problem are the planes \(x=0\) and \(x=1\), respectively.

Fig. 16
figure 16

Calcite concentration (left) and anhydrite concentration (right) after 700 s. The matrix concentrations are illustrated as contour surfaces and cut in half to highlight where the fractures have affected them

Fig. 17
figure 17

Calcite concentration (left) and anhydrite concentration (right), after 1500 s. The matrix concentrations are illustrated as contour surfaces and cut in half to highlight where the fractures have affected them

As in the 2D simulations, the reactive front is characterised by the calcite dissolving and the anhydrite precipitating. Figures 16 and 17 depict the calcite concentration and the anhydrite concentration, with the matrix concentrations represented as surface contours, after 700 and 1500 s, respectively. Similar to the 2D cases, the fractures are the preferred flow path, and the reactive front propagates more quickly in the fractures compared to the matrix (Fig. 16) and migrates into the matrix when the end of the fracture network is reached (Fig. 17). We also observe that within the fracture planes, the reactive front moves the fastest close to the fracture intersection.

This simulation illustrates that our modelling framework readily applies to 3D domains with intersecting fractures. We emphasise that this also applies to our implementation; beyond altering the computational grid, no code alterations were necessary to migrate from 2D to 3D.

5 Conclusion

This work presented a fully coupled approach to simulate single phase-flow and non-isothermal reactive transport in fractured porous media with mineral dissolution and precipitation. The model equations consist of coupled nonlinear partial differential-algebraic equations combined with several constitutive laws. Our solution strategy uses cell-centred finite-volume methods to discretise the PDEs and Newton’s method to solve a nonlinear system of equations. Two-dimensional simulations have shown a convergence verification of the model and its ability to handle the two-way interaction between multi-physical processes and fractures. We also tested the latter point on a three-dimensional problem, demonstrating the full capabilities of our model.