Abstract
Reservoir modeling consists of two key components: the reproduction of the historical performance and the prediction of the future reservoir performance. Industry-standard reservoir simulators must run fast on enormous and possibly unstructured grids while yet guaranteeing a reasonable representation of physical and chemical processes. However, computational demands limit simulators in capturing involved physical and geochemical mechanisms, especially when chemical reactions interfere with reservoir flow. This paper presents a mathematical workflow, implemented in IORSim, that makes it possible to add geochemical calculations to porous media flow simulators without access to the source code of the original host simulator. An industry-standard reservoir simulator calculates velocity fields of the fluid phases (e.g., water, oil, and gas), while IORSim calculates the transport and reaction of geochemical components. Depending on the simulation mode, the geochemical solver estimates updated relative and/or capillary pressure curves to modify the global fluid flow. As one of the key innovations of the coupling mechanism, IORSim uses a sorting algorithm to permute the grid cells along flow directions. Instead of solving an over-dimensionalized global matrix calling a Newton–Raphson solver, the geochemical software tool treats the species balance as a set of local nonlinear problems. Moreover, IORSim applies basis swapping and splay tree techniques to accelerate geochemical computations in complex full-field reservoir models. The presented work introduces the mathematical IORSim concept, verifies the chemical species advection, and demonstrates the IORSim computation efficiency. After validating the geochemical solver against reference software, IORSim is used to investigate the impact of seawater injection on the NCS Ekofisk reservoir chemistry.
Article Highlights
-
The IORSim sorting algorithm decouples the nonlinear geochemical reaction calculations into recurring one-dimensional problems to assure numerical stability and computation efficiency. To the best of our knowledge, this work presents the mathematical concept, implementation, and application of topological sorting for the first time on (industry) field-scale problems.
-
IORSim combines topological sorting with basis swapping and splay trees to significantly reduce computation times. Moreover, a high-speed forward simulation mode was developed to allow the post-advection of chemical components to visualize species distribution, water chemistry, and mineral interactions. If the geochemical reactions interfere with the fluid flow, the IORSim backward mode uses relative permeability curves to update the global fluid flow at each time step.
-
We validate the implemented topological scheme on a reservoir grid, show the computation efficiency, and compare the impact of explicit, implicit, and grid refinement on numerical dispersion.
-
The decoupled flow simulator and geochemical reaction calculations allow seamless integration of full-field reservoir models that contain complex geological structures, a large number of wells, and long production histories.
-
The computation capabilities of IORSim are demonstrated by simulating and reproducing the impact of seawater injection in the southern segment of the giant Ekofisk field (more than 50 years of injection and production history). IORSim shows that seawater injection changed the Ekofisk mineralogy and impacted the produced water chemistry. In the investigated Ekofisk case, seawater promoted calcite dissolution and led to the precipitation of magnesite and anhydrite. Moreover, surface complexation modeling revealed that sulfate is adsorbed on the calcite surface.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Reservoir simulators are designed and optimized for modeling fluid flow in complex geological structures with decades of injection and production histories. The industry-standard software programs allow a reliable computation of physical parameters such as phase pressures, saturations, and temperature to test field development scenarios, drainage strategies, and recovery optimization.
Rock–fluid interactions influencing the subsurface flow have mostly been overlooked, not because they are irrelevant but because geochemical reactions introduce numerical complexity that significantly affects the computation efficiency. Close to wellbores, rock–fluid interactions lead to scaling, and specialized software is used to monitor and plan scale treatments (Sorbie et al. 1991). However, rock–fluid interactions are not limited to the wellbore vicinity and may occur deep inside geological formations.
Field operators explore and execute improved and enhanced oil recovery methods as high recovery factors characterize most hydrocarbon reservoirs. Tertiary recovery methods include the injection of miscible and immiscible fluids, thermal applications, or substances that cause chemical reactions to increase oil recovery (Lake et al. 1989; Muggeridge et al. 2014). Moreover, underground gas storage is attracting increasing attention in the context of energy transition. The injection of carbon dioxide and hydrogen into porous underground media leads to fluid–fluid, fluid–rock, and/or microbiological interactions that significantly impact storage operations (Kelemen et al. 2019; Strobel et al. 2020).
Seawater is commonly used as a cost-effective fluid to displace oil in the Norwegian continental shelf (NCS). Although primarily injected for pressure maintenance, seawater may interact with the reservoir rock, induce formation compaction, or, ideally, improve oil recovery over waterflooding. To identify the impact of brine composition on oil recovery, experimental studies initially set a benchmark by evaluating the recovery efficiency of conventional waterfloodings (Strand et al. 2006). A modified brine then replaces the imbibing/injection fluid to estimate improved/enhanced oil recovery potential. Although many successful experimental enhanced oil recovery studies have been reported, upscaling the experimental findings to field-scale is complex. As a consequence, the number of implemented improved/enhanced oil recovery field operations remains limited (Bartels et al. 2019).
The Ekofisk field is one of the largest oil fields on the NCS and has exhibited significant compaction during more than 50 years of production. Apart from pressure depletion, Doornhof et al. (2006) attributed one-quarter of the Ekofisk compaction to rock–fluid interactions. Experimental studies have shown that selecting injection water compositions can affect compaction rates (Madland et al. 2011). Moreover, as the Ekofisk field consists of several distinct formation brines, monitoring the water ion concentrations provides information on aquifer drive, interconnection of formations, and well communication patterns.
1.1 Geochemical Modeling
In addition to solving the flow equation, reactive transport simulators must address nonlinear chemical species balances. Generally, two main formulations govern chemical equations in reactive transport modeling (Anderson and Crerar 1993; Bethke 2022):
-
1.
Direct minimization of the Gibbs free energy function.
-
2.
Formulating a set of nonlinear equilibrium reactions with the law of mass action.
Both formulations lead to a highly coupled, nonlinear set of discrete equations that sequential or global implicit approaches can numerically solve (Yeh and Tripathi 1989; Saaltink et al. 2001; Steefel and MacQuarrie 2018). Sequential approaches use operator splitting to decouple the transport equations from the chemical reactions (Kirkner and Reeves 1988; Reeves and Kirkner 1988). On the one hand, decoupling the transport and chemical reaction calculations results in splitting errors, which constrains simulations by putting an upper limit on the time steps (Valocchi and Malmstead 1992). On the other hand, sequential approaches are simpler to implement. Simulators that use a sequential approach are Hydrogeochem (Yeh et al. 2012), THOUGHREACT (Xu et al. 2008), and the one-dimensional transport solver in PHREEQC (Charlton and Parkhurst 2011; Parkhurst and Appelo 2013).
Unlike sequential reactive transport reservoir simulators, global implicit numerical schemes solve the transport equation and chemical reactions simultaneously. Characterized by good stability and robustness, global implicit approaches can address large time steps without encountering convergence problems. Although global implicit schemes avoid operator splitting errors, handling reactive multiphase and multicomponent systems results in tremendous memory demands. Yeh and Tripathi (1989) concluded that a reasonable utilization of global implicit approaches is restricted to one-dimensional simulation problems. Although more advanced global implicit approaches have been developed recently, the number of grid blocks processed remains significantly below the number of grid cells typically used in reservoir engineering applications (Saaltink et al. 2001; Kräutle and Knabner 2007). Examples of simulators that use the global implicit method are MIN3P (Su et al. 2021) and PFLOTRAN (Hammond et al. 2014).
Allowing the computation of large time steps, reservoir simulators employ implicit schemes to calculate unknown phase pressures and saturations. In the case of compositional models, implicit methods apply flash calculations to describe the partitioning of the aqueous, oleic, and gaseous phases into individual components (Trangenstein and Bell 1989). Typically, the Newton–Raphson method is used to iterate toward a solution by solving all unknowns simultaneously. While implicit approaches are feasible for black-oil models, the processing of multiphase and multi-component systems tends to introduce numerical instabilities and high computation costs (Rasmussen et al. 2021).
The literature lists IPhreeqc-UTCHEM, Reaktoro-Firedrake, and TOUGHREACT, among others, as examples of geochemical solvers that have been successfully coupled with flow simulators. IPhreeqc provides an interface that allows external programs to communicate with the PHREEQC geochemical packages. A detailed description of the IPhreeqc and UTCHEM coupling capabilities is presented in Korrani et al. (2015). To reduce computation time, IPhreeqc performs chemical equilibrium calculations only at the initial time step and subsequently adjusts the solution’s speciation without full recalculations. To maintain material balance, IPhreeqc has to track the charge imbalances and the transport of hydrogen (H), oxygen (O), and other elements throughout the reactive transport computations (Korrani et al. 2015). Reaktoro is an open-source computational framework that employs numerical methods to calculate various reactive processes governed by chemical equilibrium and/or chemical kinetics (Leal 2015). In addition, Reaktoro offers on-demand machine learning methods to reduce computation times (Leal et al. 2020). The literature provides examples of Reaktoro coupled with Firedrake and DuMuX to simulate geochemical processes in porous media (Kyas et al. 2022; Koch et al. 2021). TOUGHREACT is a multiphase, non-isothermal reactive transport simulator using shared memory parallelization. The software enhances the capabilities of TOUGH2, the initially developed multiphase flow solver, by incorporating a range of geochemical reactions such as aqueous reactions, mineral dissolution/precipitation, and gas reactions (Xu et al. 2006).
1.2 Adding Geochemistry to Existing Reservoir Models
Most hydrocarbon reservoirs on the NCS are modeled and history-matched using SLB Eclipse (Schlumberger 2002). While providing simplified and pre-defined formulations to simulate selected geochemical problems, the software is not designed to handle field-scale reactive transport problems. IPhreeqc-UTCHEM, Reaktoro-Firedrake, and TOUGHREACT, among others, provide geochemical formulations; however, lack the ability to integrate realistic and history-matched reservoir models. This paper introduces IORSim, an add-on software to existing reservoir simulators, to address two main challenges of reactive transport simulations:
-
1.
Providing a numerically robust and computationally efficient approach for solving field-scale reactive transport problems.
-
2.
Allowing a seamless computation and visualization of geochemical reactions in existing reservoir models.
After computing the velocity fields of the fluid phases (e.g., water, oil, and gas) in a standard reservoir simulator, IORSim employs topological sorting to identify the upstream and downstream neighbors of a grid block (cf. Sect. 2.1). Instead of solving a three-dimensional nonlinear IORSim species balance simultaneously, the identification of upstream and downstream cells allows IORSim to decouple the geochemical reaction calculations into an iterative sequence of local sub-problems. Solving the nonlinear geochemical reactions as a set of one-dimensional problems improves numerical stability and reduces computation times.
Besides the decoupled geochemical reaction species computations, IORSim offers additional numerical tools to tune and improve the reactive transport modeling. Depending on the simulation objectives, the software provides two specialized coupling mechanisms (Sect. 2). First, the unidirectional high-speed forward simulation mode allows the post-advection of chemical components to visualize species distribution, water chemistry, and mineral interactions. Secondly, if the geochemical reactions affect the fluid flow, the bidirectional IORSim backward coupling calculates relative permeability curves to adjust the global fluid flow at each time step. If a large number of chemical components and geochemical reactions interfere with each other, IORSim provides basis swapping and splay tree techniques to reduce computation times (Sect. 3.5). In a typical field-scale reservoir model, large grid blocks tend to introduce numerical dispersion and distort geochemical effects. Instead of reconstructing the entire geological model, IORSim allows the definition of one or several finer grid resolution regions to improve the geochemical species balance calculations (Sect. 3.3).
Reservoir models are typically optimized over years and include long injection/production histories, fluid properties, and well data within complex geological structures. Moreover, assisted history-matching software tools are commonly used to accurately represent the subsurface flow. Thus, depicting existing reservoir models in external reactive flow simulators requires substantial effort. By integrating IORSim into existing reservoir simulators, IORSim allows a seamless and straightforward representation of geochemical subsurface phenomena.
At present, IORSim features a water diversion module (sodium silicate injection), partitioning, non-partitioning tracer module, and a sophisticated geochemical solver that accounts for mineralization, ion exchange, surface complexation, and other chemical reactions (cf. Sect. 4.1).
In a previous study, IORSim was used to correlate sodium silicate gelation with permeability reduction using the Kozeny–Carman equation (Hiorth et al. 2016, 2017). However, Eclipse’s limitation to communicating only through Satnum files (relative permeability and capillary pressure curves) while running, restricts the modeling of geochemical processes. Therefore, IORSim is currently coupled with SLB Intersect, which allows external programs to update up to 282 static and dynamic simulation parameters. Moreover, coupling IORSim with an open-source reservoir simulator such as OPM Flow would allow glue codes to link the flow equation and geochemical species balance more efficiently together (Rasmussen et al. 2021; Bungartz et al. 2016; Chourdakis et al. 2021). Using reservoir simulators that offer a broader communication interface will allow IORSim to update, for instance, absolute permeability/porosity changes or the tracking and updating of partitioning components in the brine, oil, and gas phases.
The mathematical and numerical concepts of IORSim are introduced in Sect. 2, while the IORSim concept is analytically and numerically validated in Sect. 3. Section 4 showcases a field-scale reservoir study to demonstrate the seamless integration of IORSim into existing reservoir models (Ekofisk field), the ability to handle comprehensive injection/production histories, and the capability to compute and visualize geochemical reactions in complex geological systems. While the analyzed produced water chemistry shows a clear trend of magnesite and anhydrite precipitation, the presented IORSim study does not aim to make general assumptions about the Ekofisk reservoir.
2 IORSim Program Structure
The IORSim software provides two dedicated simulation modes that essentially differ in the implemented host simulator and IORSim coupling mechanism. During an IORSim forward mode simulation, the host simulator and geochemical reaction tool coupling is unidirectional. After completing the flow calculation in the host simulator, IORSim is used as a post-processor tool that advects chemical species along the flow direction (Fig. 1a). While the geochemical reactions impact the water chemistry, the global fluid flow remains unaffected. The intentional exclusion of a host simulator feedback mechanism allows high-speed chemical species balance calculations in complex reservoir systems.
If mineral dissolution, precipitation, or other geochemical mechanisms affect the reservoir fluid flow, IORSim provides a backward coupling mechanism. Unlike the IORSim forward mode, the backward coupling mode communicates with the flow simulator at each time step. A sketch of the bidirectional IORSim backward mode is depicted in Fig. 1b. After initiating the reservoir model and calculating the first time step in Eclipse, a Python control script pauses the reservoir flow simulation software (Fig. 1b, II). Since the flow calculations are only paused and a re-initialization of the model is avoided, the additional computation costs are kept to a minimum. IORSim reads the cell phase flow volumes (printed to root.unrst) and well rates (printed to root.rft) to detect the global fluid flow and to permute the grid cells into a sequence of upstream and downstream cells. Instead of assembling and handling a global matrix, the topological sorting algorithm allows IORSim to solve the reactive transport species balance as an iterative string of one-dimensional problems. Section 2.1 and Appendix 6 present a detailed description of the implemented sorting algorithm. After solving the geochemical reactions, IORSim calculates relative permeability and, optionally, capillary pressure curves that are communicated back to Eclipse by using the Eclipse Satnum option (Fig. 1b, III). The continuous process of starting and pausing the Eclipse and IORSim simulation is continued until the reactive transport simulation is completed. Once the last simulation step is reached, the Python control script merges the Eclipse and IORSim results into a single root.unrst file, which allows standard post-processing application programs such as OPM ResInsight (Dale et al. 2012) or SLB FloViz to visualize and analyze the IORSim reactive transport simulation results.
The IORSim computation performance significantly varies based on the selected (forward or backward) simulation mode and the selected geochemical module. For instance, the Ekofisk IORSim forward simulation presented in Sect. 4.2 required around 1 h of computation time on an i9-12th generation processor with 811 time steps, \(\Delta {t}=20\) day, and 56,498 active cells. On the other hand, an IORSim backward mode water diversion study (simpler geochemical module) on the NCS Snorre field required approximately 10 h with 2043 time steps, \(\Delta {t}=1\) day, and 512,550 active cells.
2.1 Topological Sorting: From 3D to 1D
Regardless of whether the IORSim forward mode or backward mode is selected, the software uses a sorting algorithm to simplify the transport and reaction calculations of geochemical components. After reading the flow field from the host simulator, IORSim permutes the grid cells with respect to the fluid flow direction. The implemented sorting algorithm leads to a generalized streamline approach in which the original three-dimensional problem is transformed into a sequence of smaller one-dimensional problems. Instead of assembling a global matrix to solve for all unknowns in all grid blocks at once (Fig. 2, I), IORSim detects the fluid flow and updates the geochemistry in one grid block at a time. IORSim initially calculates the geochemical balance at the injection well and then continues to solve the species balances along the fluid flow (Fig. 2, II). Since the species concentration in the depicted center block depends on three neighboring cells, IORSim takes a "detour" to compute the chemical balances in cells 2, 4, and 6 before solving the chemical species balance in cell 7 (Fig. 2, III). After resolving the inflow terms of the center block (\(\sum _{f=2,4,6} F_f^{\text {in}} (t + \Delta t) \Delta t\)), IORSim calculates the outflow term (\(F_{7}^{\text {out}} (t + \Delta t) \Delta t\)) and continues to solve the chemical species until the production well is reached.
Formally, the water flow field is viewed as a directed graph (Diestel 2016): A directed edge connects block i to block j whenever water flows from i to j. In the absence of flow cycles in the flow field, the graph is a directed acyclic graph (DAG). In this case, a simple depth first search (DFS) algorithm is used to order to the reversed flow graph along the flow direction.
The geochemical component concentrations at the next time level \(C^{n+1}\) are calculated by using Eq. 1,
where \(V_{w}=\phi S_w \Delta x \Delta y \Delta z\) is the volume of water in the grid cell, \(C^{n}\) is the old concentration of the given component, \(\Delta t\) is the time step, \(F_\text {in}\) is the incoming flow of water, \(Q_\text {in}\) is the incoming flow of geochemical components, and r is a source term to account for mineral precipitation/dissolution. The incoming water \(F_\text {in}\) and geochemical component flow \(Q_\text {in}\) is defined by the sum over the neighboring grid blocks and positive by definition
A derivation of the chemical species balance (Eq. 1) implemented in IORSim is provided in Appendix 6.
The authors acknowledge that in addition to the cell permutation technique used in IORSim, Natvig, Lie, and colleagues have independently developed a topological sorting method (Natvig and Lie 2008; Lie et al. 2014). Moreover, Natvig and Lie (2008) and Lie et al. (2014) discussed the possibilities of generalizing the sorting approach to cases in which the flow field contains closed flow cycles. After identifying strongly connected components (SCC) inside a flow graph, Natvig and Lie suggested solving each subsystem with a nonlinear solver before updating dependent grid cells. Several well-known algorithms exist for finding the SCC of a directed graph, e.g., Tarjan’s algorithm (Tarjan 1972) or Kosaraju’s algorithm (Sharir 1981).
3 IORSim Validation
3.1 1D Tracer Advection
In addition to a fully implicit species transport scheme, IORSim provides an explicit and adaptive numerical scheme. The selection of the numerical scheme is governed by the Courant–Friedrichs–Lewy (CFL) condition, in which a zero CFL criterion leads to a purely implicit solution and a value of one results in a strictly explicit solution (Courant et al. 1928).
The chemical species transport implementation was validated against an analytical transport calculations of a one-dimensional tracer core flood as illustrated in Fig. 3a. After four days of pure water injection, a step-pulse of a non-partitioning tracer is injected. In general, tracer transport is governed by the advection–diffusion equation with constant diffusion D
where the first term of the right-hand side denotes the advective flow, the second term denotes the chemical reactions, and the third term denotes mechanical dispersion. While the injected tracer concentration front follows the average water flow velocity through the column, the heterogeneous pore network causes variations in the flow velocity. Instead of obtaining piston flow, the non-uniform flow velocity causes a (mechanical) dispersion of the tracer concentration front. Assuming a semi-infinite column and a constant injection rate, the effluent tracer concentration \(c_f\) can be calculated as follows (Appelo and Postma 2004; Lapidus and Amundson 1952):
where \(c_{inj}\) is the injected tracer concentration, L is the total core length, v is the flow velocity, \(D_L\) is the longitudinal dispersion, and erfc is the complementary error function. Currently, IORSim does not consider mechanical dispersion, but the numerical scheme introduces numerical dispersion. Assuming constant \(\Delta x\) and \(\Delta t\), Lantz (1971) derived numerical dispersion coefficients for the explicit and implicit schemes
where x is the cell length, \(\Delta t\) is the time step size, and v is the flow velocity.
The implicit and explicit analytical and IORSim tracer transport solutions for a time step size of 0.1 days are plotted in Fig. 3b, c. For \(t=0.1\) days, the cell inflow at one time step is equivalent to the cell volume, which corresponds to a CFL criteria of one. Figure 3b shows that the explicit numerical dispersion term becomes zero, and the tracer breakthrough concentration approaches one. The zero dispersion case represents a hypothetical case in which the core material consists of a perfectly uniform porous media. While the explicit solution shows a piston-like species movement, Fig. 3c demonstrates that the implicit tracer front is significantly smeared out. Shorter time steps are required to decrease the impact of numerical dispersion on an implicit transport scheme. Figure 3d, e displays the analytical and IORSim tracer transport solution for a time step size of 0.01 days. In this case, the implicit and explicit tracer transport solutions are characterized by a similar (small) numerical dispersion.
The analytical tracer transport calculations match and validate the implicit and explicit IORSim schemes. Moreover, the numerically calculated concentration/time integrals align with the mass injected in all four plotted tracer experiments, confirming mass conservation.
3.2 3D Tracer Advection
Section 3.1 analytically validates the implicit and explicit IORSim chemical species transport. However, while one-dimensional tracer transport represents the most straightforward flow possible, geological formations are typically represented by unstructured grids. Most finite difference reservoir simulators use a seven-point stencil scheme to solve the partial differential equation of a cell and its six neighboring cells (Ron et al. 2007). Moreover, Eclipse 100 and other reservoir simulators support explicitly formulated cell connections to model diagonal flow along faults or pinched-out regions. Therefore, in a realistic reservoir case, the IORSim sorting algorithm must correctly identify the flow of a cell and its six surrounding cells, consider possibly pinched-out grid blocks, and integrate non-neighboring cell connections.
A reservoir segment of the NCS field Snorre was selected to test the IORSim chemical species transport solution on a geologically realistic field case. Besides diagonal flow along faults, the Snorre reservoir model contains several pinched-out reservoir zones. In the implemented species transport comparison example, 125 kg of non-partitioning tracer mass was admixed to the injection fluid. The injected tracer predominantly migrated along a thief-zone and was produced through a single production well.
The blue points in Fig. 4a represent the tracer production concentration observed using a standard Eclipse 100 simulation. The black curve displays the non-partitioning tracer production signal using a classical Newton–Raphson solver in IORSim. Finally, the red line illustrates the tracer transport profile with the enabled IORSim sorting algorithm.
3.3 Numerical Dispersion
The literature discusses several approaches to reduce numerical dispersion. Firstly, Lantz (1971) showed that explicit schemes are less impacted by numerical dispersion than implicit schemes. While numerical dispersion is proportional to \(x - \Delta t v\) in an explicit scheme, truncation errors in implicit schemes are proportional to \(x + \Delta t v\) (cf. Eqs. 6 and 7). Consequently, as shown in Sect. 3.1, numerical dispersion in implicit schemes increases with increasing time steps. While high-order discretization schemes are acknowledged to be significantly less impacted by numerical dispersion, high-order discretization schemes require higher computation efforts than upwind finite volume discretization (Mykkeltvedt et al. 2017).
As the species transport calculations are performed on a duplicated (IORSim) grid, IORSim provides a highly efficient and fast grid refinement option to limit chemical species dispersion. For a regular non-well reservoir grid block, the refined velocities are calculated by spatially weighted interpolation between the Eclipse flow rates on each side of the refined block connection. The IORSim grid refinement options allow the definition of one or several finer grid resolution regions with equal or different degrees of refinement. Figure 4b compares the produced tracer concentration when selecting an implicit, explicit, and refined IORSim chemical species transport scheme. In line with the literature, the implicit solution shows the strongest numerical dispersion when testing non-reactive tracer transport on the Snorre grid. The most substantial decrease in numerical dispersion was observed when enabling the IORSim grid refinement.
3.4 Sorting Algorithm Efficiency
The IORSim sorting algorithm was developed to address two main challenges of reactive transport simulations. Firstly, ensuring numerical stability while solving nonlinear geochemical reactions and, secondly, reducing computation times.
At an early stage of the software development, the IORSim tracer module used a classical, fully implicit approach to solve the chemical species balance. To demonstrate the computation efficiency of the IORSim sorting algorithm, the computation times of a global and a local implicit tracer simulation scenario were compared. Figure 4c shows the normalized IORSim computation times as a function of increasing non-partitioning tracer components. While the global and local implicit solver perform similarly when a small number of tracer species is injected, the efficiency of the IORSim sorting algorithm becomes distinct with an increasing number of tracer species. Compared to the global Newton–Raphson solver, the transport simulation of 100 tracer species (176,664 active cells) was approximately four times faster when activating the IORSim sorting algorithm. Although the non-reactive transport computation comparison certifies IORSim’s high-performance efficiency, the IORSim sorting algorithm is expected to become more significant when calculating nonlinear geochemical reactions.
3.5 Accelerating Geochemical Computations
IORSim offers a wide range of geochemical modules with varying levels of complexity. As the non-partitioning tracer, partitioning tracer, and sodium silicate gelation modules solve a limited set of nonlinear reactions, the decoupled chemical species balance approach is sufficient to obtain reasonable computation times. However, if IORSim addresses more intricate modeling tasks, such as the visualization of the initial and injected brine composition impact on reservoir chemistry (Sect. 4.4), IORSim must solve interconnected geochemical reactions (such as mineralization, ion exchange, surface complexation, etc.) of multi-component systems. In this case, IORSim applies basis swapping to reduce the number of unknowns and utilizes splay tree calculations to reuse geochemical equilibriums that have been solved before.
3.5.1 Basis Swapping
The IORSim solver divides the geochemical species into a set of basis and secondary species to speed up the calculation (Morel 1983; Bethke 2022). Based on the vector spaces theory in linear algebra, the concentrations of secondary species are uniquely determined from the basis species concentrations. As a result, IORSim reduces the number of unknowns by only solving for the basis species concentrations directly. While, in principle, any linearly independent set of species of the right dimension is suitable to determine the species compositions, IORSim defines the major reservoir ions and proton concentrations (i.e., the "free ion form" of each element) as the basis species. Moreover, in cases where a solution is assumed to be in equilibrium with one or more minerals, IORSim removes one of the major ions that the mineral consists of and replaces it with the mineral. The implemented basis swapping technique is essentially the same as presented by Bethke (2022).
3.5.2 Reusing Old Solutions with Splay Trees
While the IORSim sorting algorithm and basis swapping reduce computation time, complex geochemical simulations are yet computationally demanding. The literature describes the application of proxy models, e.g., various purely statistical algorithms, and/or machine learning approaches to reduce computation times (Jatnieks et al. 2016; Demirer et al. 2022; Laloy and Jacques 2022). However, as machine learning techniques tend to introduce mass balance errors (Guérillot and Bruyelle 2020), other research groups suggested solving chemical equations while reducing the precision of the solution. For example, Leal et al. (2020) and Kyas et al. (2022) combined an on-demand extrapolation strategy based on first-order Taylor approximations to speed up the computations by one to three orders of magnitude. De Lucia et al. (2021) focused on parallelization and the incorporation of distributed hash maps to store and retrieve solutions of previously solved geochemical problems. While similar-looking geochemical problems are treated equally, the interpolation or extrapolation of geochemical reactions is avoided.
IORSim uses a splay tree method to reduce the number of geochemical reaction calculations (Hiorth et al. 2016, 2017). If the geochemical solver encounters an equilibrium or an identical/similar problem solved before, IORSim retrieves the geochemical solution from splay trees (Sleator and Tarjan 1985). Initially, the program stores the geochemical solution concentrations in a splay tree based on the input concentration, with a new splay tree being initialized for each combination of minerals. If the grid cell concentrations are close enough to a previously calculated solution, the new species solution is obtained from the splay tree. A unique aspect of the IORSim implementation is the creation of splay tree keys and the retrieval of stored data. While only aqueous species concentrations are used to construct lookup keys, equilibrium calculations determine the adsorbed concentrations. Figure 4d demonstrates that the implemented IORSim splay tree technique can reduce computation times by a factor of up to ten while providing accurate numerical solutions. Compared to the computation time of the reference case (in which the chemical equilibriums are continuously solved over iterations), the computation time reduces with decreasing splay tree resolution. A detailed explanation of the implemented splay tree lookup algorithm is provided in Appendix 7.
4 Ekofisk Field Simulation
4.1 Geochemical Solver Validation
The IORSim geochemical solver incorporates the SUPCRT92 database of Johnson et al. (1992) to calculate the thermodynamic properties of minerals, gases, aqueous species, and reactions along characteristic subsurface temperatures and pressure conditions. Details on the implemented aqueous equilibrium chemistry, surface chemistry, and mineral kinetics are provided in Appendix 8.1 to Appendix 8.2
Before implementing a full-scale reservoir Ekofisk study, the geochemical IORSim solver was validated against (a) the well-documented PHREEQC ion transport and exchange benchmark (Parkhurst and Appelo 2013; Moortgat et al. 2020; Kolditz et al. 2012; Rolle et al. 2018) and (b) a core flooding experiment reported by Hiorth et al. (2013).
The PHREEQC benchmark represents a column saturated with a sodium-potassium-nitrate solution in equilibrium with a cation exchanger. Once a calcium chloride solution is injected into the sample, the calcium, potassium, and sodium ions react with the exchanger until chemical equilibrium is reached. Since chlorine acts as an inert ion, the chlorine effluents solely depend on the transport term. Figure 5a compares the IORSim geochemical solver with the PHREEQC solver results. While the overall effluent production is excellent, minor concentration differences are explained by the differences in underlying geochemical databases and the differences in employed numerical schemes.
During the second geochemical solver benchmark test, the IORSim module was tested against experimental core flooding data reported by Hiorth et al. (2013). The selected Liège outcrop sample was initially saturated with deionized water and then flooded by a calcium, magnesium, and sulfate-rich brine (Table 2). Figure 5b depicts the ion effluent concentration observed in the single-phase flooding experiments conducted at a temperature of 130\(^{\circ }\)C. After two days of injection, the effluent chlorine concentration matched the injected concentration, indicating a complete displacement of the deionized water (Table 2 and Fig. 5b, yellow curve). While the inert chlorine ions do not participate in geochemical reactions (Appelo and Postma 2004), the concentration differences between the injected and produced divalent ions reveal geochemical reactions. Three geochemical processes were considered to reproduce the divalent ion concentration profile: ion exchange, ion adsorption, and mineral kinetics.
Ion exchange is a rapid process that involves ion swapping between the solution and the mineral surface without altering the mineral’s structure. In Fig. 5b, ion exchange causes the calcium concentration to peak approximately two days after the brine injection starts. In contrast to ion exchange, the more gradual ion adsorption involves ion adhesion from a solution onto the pore surface without necessarily releasing other ions back into the solution, hence potentially changing the surface charge. The effluent ion concentration after ten simulation days (Fig. 5b) is predominantly impacted by the simulation’s mineral kinetic rates. Mineral dissolution/precipitation is a slow geochemical process that involves the breakdown or formation of the mineral’s crystal structure. Nermoen et al. (2015) experimentally demonstrated that magnesite precipitation in chalk samples can occur over several years.
The numerical IORSim effluent results are depicted in Figure 5b and the utilized rate mineral precipitation/dissolution constants, ion exchange rate, and surface complexation equilibrium rates are listed in Table 1. While IORSim replicates the effluent trend, constant mineral kinetics rates cannot reproduce the experimentally obtained slow-reaching mineral equilibrium. A comprehensive discussion and suggestion of dynamic mineral equilibrium constants are provided in Pedersen et al. (2016).
4.2 Ekofisk Field
Under production since 1971, the Norwegian offshore field Ekofisk is considered the first major oil discovery in the North Sea. Separated by an impermeable layer, an upper (Ekofisk) and lower (Tor) formation comprise the chalk reservoir. While the Ekofisk formation is highly fractured, the matrix porosity varies between 25 and 40 %, and the permeability ranges from 0.1 to 5 mD. Especially in the upper Ekofisk formation, mineralization, unfractured chalks, and tight clays act as local flow barrier (Jakobsson and Christian 1994).
The Ekofisk anticline structure spans an area of approximately five by ten kilometers and can be divided into smaller segments to allow faster and more efficient reservoir modeling. Figure 6 displays the southern Ekofisk reservoir model in which 19 injection and 34 production wells were operated between Mai 1975 and June 2014. The reservoir model includes three distinct brine compositions. Besides the high saline Tor formation brine (TDS of 192.7 g/L) and the medium saline Ekofisk formation brine (TDS of 83.5 g/L), around 50 Mm\(^3\) seawater was injected into the reservoir (TDS of 36.1 g/L) (Table 2).
Although the Ekofisk formation contains silica, illite, smectite, and kaolinite tracers, the upper Ekofisk and the lower Tor structure are considered pure calcite reservoirs (Kallesten et al. 2021). Numerous studies have investigated the brine–rock interactions caused by seawater injection into chalk formations. Madland et al. (2011) demonstrated that seawater injection into Liège and Stevns Klint chalk samples resulted in the precipitation of anhydrite and magnesium-bearing minerals. Similarly, Megawati et al. (2015) showed that the injection of magnesium-rich brines caused calcite dissolution and promoted magnesite precipitations. X-ray diffraction analysis (XRD) confirmed that magnesite precipitations occurred in pure as well as impure chalk samples. Moreover, Minde et al. (2018) highlighted the impact of temperature on calcite dissolution and magnesite precipitation. If magnesium-rich brines were injected into chalk samples, energy-dispersive X-ray (EDX) and XRD measurements detected magnesite crystals in flooding experiments that exceeded 110\(^{\circ }\)C.
4.3 Non-Reactive Transport Ekofisk Simulation
To visualize and quantify the geochemical interactions induced by seawater injection on the Ekofisk field, an IORSim forward mode simulation was implemented. The field operator supplied the Ekofisk Eclipse 100 reservoir model (comprising 89,936 grid blocks), covering the southern segment of the Ekofisk formation. While the reservoir model included 53 wells, the IORSim modeling study focused on (1) replicating the historical P-1 production rates, and (2) matching the corresponding produced water composition. Figure 6 marks the P-1 location in the lower left corner of the reservoir model, which communicates with the seawater injection well I-1. Separated by approximately 400 ms, the seawater injection well I-1 penetrates both the upper Ekofisk and lower Tor formations, while the production well P-1 is perforated in the upper Ekofisk formation. The combined effects of pressure depletion and rock–fluid interactions have led to significant Ekofisk reservoir compaction, which is numerically captured by the Eclipse 100 rock compaction module. To benefit from the history-matched Ekofisk model provided by the field operator, the presented IORSim Ekofisk study was run in forward mode, meaning that the chemical components were advected along the reservoir flow after the Eclipse simulation was completed. However, to further improve the accuracy of field history-matching, it would be feasible to conduct an IORSim backward mode study that correlates mineral dissolution and precipitation with changes in permeability and porosity.
After reviewing the field history matched, the sampled chlorine ion concentrations were used to determine the formation water and seawater mixing proportion of well P-1. Figures 7 and 8a show the water volume and chlorine concentration history-matches that were obtained by (1) balancing the fracture permeability introduced between injector I-1 and producer P-1, and (2) fine-tuning the well transmissibilities of I-1 and P-1.
As an inert ion, the chlorine concentration depends solely on the formation and injection water mixing. Between 1997 and 2000, the produced water composition agreed with the Ekofisk formation water. A sharp chlorine concentration decline from 2000 onwards indicates the seawater breakthrough at the production well. After two years of decreasing chlorine concentration, both sampled and modeled chlorine levels aligned with seawater chlorine concentration (Fig. 8a).
In contrast to chlorine, the concentration of the reactive calcium, magnesium, and sulfate ions deviated significantly from the measured data if geochemical reactions were not considered. Figure 8b and Table 2 show that ten years after seawater breakthrough (2010), the produced P-1 water calcium concentration was approximately 0.02 mol/L higher than the calcium concentration of the injected seawater. At the same time, the produced water chemistry is characterized by an approximately 0.03 mol/L lower magnesium and 0.02 mol/L lower sulfate ion concentration than the injected seawater (Fig. 8 and Table 2).
4.4 Reactive Transport Ekofisk Simulation
4.4.1 Rate-Controlled Mineralization
The significant mismatch of the non-reactive divalent ion transport and sampled ion concentration confirms that seawater injection induces chemical reactions. Activating mineral kinetic reactions in IORSim led to an improved match of the simulated and measured effluent ion concentration, as demonstrated by the green curves in Fig. 8b–d. The chemistry of seawater and brines is very different from the chemistry of rivers and drinking water; for a comprehensive discussion on this topic, see Chapter 4 in Garrels and Christ (1965). In Appendix 8.4, we have listed the chemical reactions included in IORSim used to describe seawater chemistry. When seawater, which at ambient conditions is close to being in equilibrium with calcite, is heated up to reservoir temperatures (\(\sim 130^\circ\)C), magnesite becomes supersaturated. Magnesite will precipitate, and since magnesite contains carbonate, carbonate is removed from the solution. When carbonate is removed, calcite becomes under-saturated and dissolves. The net effect of these reactions is summarized in the equation as follows:
Thus, magnesite precipitation leads to an increase in the calcium concentration in the solution. When the calcium concentration increases, anhydrite (calcium sulfate) becomes supersaturated and will precipitate.
The mineral dissolution and precipitation kinetics in IORSim are implemented according to Palandri and Kharaka (2004) and are presented in Appendix 8.2.
4.4.2 Surface Complexation
While the rate-controlled mineral kinetics capture the trend of the reactive ions concentration changes, particularly the sulfate ions breakthrough delay indicates the presence of additional geochemical reactions. Besides mineral kinetics, the second reactive transport IORSim Ekofisk simulation used surface complexation to improve the produced water chemistry match (Fig. 8b–d, red line). The sulfate adsorption is implemented as follows:
The IORSim surface complexation model was developed by Van Cappellen et al. (1993) and Hiorth et al. (2010) and is summarized in Appendix 8.3.
5 Conclusion
IORSim is a reactive transport simulator designed as a plug-in tool for industry-standard reservoir flow simulators. While the host simulator is used to integrate reservoir models and to perform the global flow calculations, IORSim solves the decoupled chemical species balance. The novel software coupling approach allows the implementation of full-field reservoir simulations with a large number of grid cells and chemical components.
-
The IORSim sorting algorithm decouples the nonlinear geochemical reaction calculations into a sequence of recurring one-dimensional problems to assure numerical stability and computation efficiency.
-
Moreover, for a complex geochemical problem, IORSim provides basis swapping and splay trees techniques to reduce computation times significantly.
-
IORSim offers two dedicated simulation modes: The high-speed IORSim forward mode allows the post-advection of chemical components to visualize species distribution, water chemistry, and mineral interactions. If the geochemical reactions interfere with the fluid flow, the IORSim backward mode uses relative permeability to update the global fluid flow at each time step.
After introducing the Eclipse/IORSim coupling mechanism and deriving the mathematical IORSim concept, the implemented program structure was analytically and numerically verified on a set of demonstration cases. IORSim was then used to investigate the impact of seawater injection on water chemistry and mineralogy in the NCS field Ekofisk.
-
The decoupled flow simulator and geochemical reaction calculations allow seamless integration of full-field reservoir models that contain complex geological structures, a large number of wells, and long production histories.
-
The reactive IORSim modeling of the Ekofisk case demonstrates that seawater injection into chalk formations impacts the mineralogy and changes the produced water chemistry. In the investigated Ekofisk case, seawater promoted calcite dissolution, and led to the precipitation of magnesite and anhydrite. Moreover, surface complexation modeling revealed that sulfate is adsorbed on the calcite surface.
References
Anderson, G.M., Crerar, D.A.: Thermodynamics in Geochemistry: The Equilibrium Model. Oxford University Press, Oxford (1993)
Appelo, C.A.J., Postma, D.: Geochemistry, Groundwater and Pollution. CRC Press, Boca Raton (2004)
Bartels, W.B., Mahani, H., Berg, S., et al.: Literature review of low salinity waterflooding from a length and time scale perspective. Fuel 236, 338–353 (2019)
Bethke, C.M.: Geochemical and Biogeochemical Reaction Modeling. Cambridge University Press, Cambridge (2022)
Bungartz, H.J., Lindner, F., Gatzhammer, B., et al.: preCICE—a fully parallel library for multi-physics surface coupling. Comput. Fluids 141, 250–258 (2016)
Charlton, S.R., Parkhurst, D.L.: Modules based on the geochemical model PHREEQC for use in scripting and programming languages. Comput. Geosci. 37(10), 1653–1663 (2011)
Chourdakis, G., Davis, K., Rodenberg, B., et al.: preCICE v2: A sustainable and user-friendly coupling library (2021). arXiv preprint arXiv:2109.14470
Courant, R., Friedrichs, K., Lewy, H.: Über die partiellen differenzengleichungen der mathematischen physik. Math. Ann. 100(1), 32–74 (1928)
Dale, S.I., Sjaastad, M., Høgstøl, H., et al.: Improving visualization of large scale reservoir models. In: SPE Mathematical Methods in Fluid Dynamics and Simulation of Giant Oil and Gas Reservoirs, SPE, pp SPE–163088 (2012)
De Lucia, M., Kühn, M., Lindemann, A., et al.: Poet (v0. 1): speedup of many-core parallel reactive transport simulations with fast DHT lookups. Geosci. Model Develop. 14(12), 7391–7409 (2021)
Demirer, E., Coene, E., Iraola, A., et al.: Improving the performance of reactive transport simulations using artificial neural networks. Transp. Porous Media 149, 271–297 (2022)
Diestel, R.: Graph Theory, 5th edn. Springer, Berlin (2016)
Doornhof, D., Kristiansen, T.G., Nagel, N.B., et al.: Compaction and subsidence. Oilfield Rev. 18(3), 50–68 (2006)
Garrels, R.M., Christ, C.L.: Solutions, Minerals, and Equilibria. Harper and Row, New York (1965)
Guérillot, D., Bruyelle, J.: Geochemical equilibrium determination using an artificial neural network in compositional reservoir flow simulation. Comput. Geosci. 24(2), 697–707 (2020)
Hammond, G.E., Lichtner, P.C., Mills, R.: Evaluating the performance of parallel subsurface simulators: an illustrative example with PFLOTRAN. Water Resour. Res. 50(1), 208–228 (2014)
Helgeson, H.C., Kirkham, D.H.: Theoretical prediction of the thermodynamic behavior of aqueous electrolytes at high pressures and temperatures; I, summary of the thermodynamic/electrostatic properties of the solvent. Am. J. Sci. 274(10), 1089–1198 (1974a). https://doi.org/10.2475/ajs.274.10.1089
Helgeson, H.C., Kirkham, D.H.: Theoretical prediction of the thermodynamic behavior of aqueous electrolytes at high pressures and temperatures; II, Debye–Huckel parameters for activity coefficients and relative partial molal properties. Am. J. Sci. 274(10), 1199–1261 (1974b). https://doi.org/10.2475/ajs.274.10.1199
Hiorth, A., Cathles, L., Madland, M.: The impact of pore water chemistry on carbonate surface charge and oil wettability. Transp. Porous Media 85(1), 1–21 (2010). https://doi.org/10.1007/s11242-010-9543-6
Hiorth, A., Jettestuen, E., Cathles, L., et al.: Precipitation, dissolution, and ion exchange processes coupled with a lattice Boltzmann advection diffusion solver. Geochim. Cosmochim. Acta 104, 99–110 (2013)
Hiorth, A., Sagen, J., Lohne, A., et al.: IORSim-a simulator for fast and accurate simulation of multi-phase geochemical interactions at the field scale. In: ECMOR XV-15th European Conference on the Mathematics of Oil Recovery, European Association of Geoscientists & Engineers, pp cp–494 (2016)
Hiorth, A., Sagen, J., Lohne, A., et al.: Simulation of sodium silicate water diversion using IORSim. In: IOR 2017-19th European Symposium on Improved Oil Recovery, European Association of Geoscientists & Engineers, pp. 1–16 (2017)
Jakobsson, N., Christian, T.: Historical performance of gas injection of ekofisk. In: SPE Annual Technical Conference and Exhibition, OnePetro (1994)
Jatnieks, J., De Lucia, M., Dransch, D., et al.: Data-driven surrogate model approach for improving the performance of reactive transport simulations. Energy Procedia 97, 447–453 (2016)
Johnson, J.W., Oelkers, E.H., Helgeson, H.C.: Supcrt92: a software package for calculating the standard molal thermodynamic properties of minerals, gases, aqueous species, and reactions from 1 to 5000 bar and 0 to 1000 c. Comput. Geosci. 18(7), 899–947 (1992). https://doi.org/10.1016/0098-3004(92)90029-Q
Kallesten, E.I., Zimmermann, U., Madland, M.V., et al.: Mineralogy and geochemistry of reservoir and non-reservoir chalk from the Norwegian continental shelf. J. Petrol. Sci. Eng. 205, 108914 (2021)
Kelemen, P., Benson, S.M., Pilorgé, H., et al.: An overview of the status and challenges of CO\(_2\) storage in minerals and geological formations. Front. Clim. 1, 9 (2019)
Kirkner, D.J., Reeves, H.: Multicomponent mass transport with homogeneous and heterogeneous chemical reactions: effect of the chemistry on the choice of numerical algorithm: 1. theory. Water Resour. Res. 24(10), 1719–1729 (1988)
Koch, T., Gläser, D., Weishaupt, K., et al.: Dumux 3-an open-source simulator for solving flow and transport problems in porous media with a focus on model coupling. Comput. Math. Appl. 81, 423–443 (2021)
Kolditz, O., Bauer, S., Bilke, L., et al.: OpenGeoSys: an open-source initiative for numerical simulation of thermo-hydro-mechanical/chemical (THM/C) processes in porous media. Environ. Earth Sci. 67, 589–599 (2012)
Korrani, A.K.N., Sepehrnoori, K., Delshad, M.: Coupling IPhreeqc with UTCHEM to model reactive flow and transport. Comput. Geosci. 82, 152–169 (2015)
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). https://doi.org/10.1029/2005WR004465
Kyas, S., Volpatto, D., Saar, M.O., et al.: Accelerated reactive transport simulations in heterogeneous porous media using reaktoro and firedrake. Comput. Geosci. 26(2), 295–327 (2022)
Lake, L.W., et al.: Enhanced Oil Recovery. Prentice Hall, Hoboken (1989)
Laloy, E., Jacques, D.: Speeding up reactive transport simulations in cement systems by surrogate geochemical modeling: deep neural networks and k-nearest neighbors. Transp. Porous Media 143, 433–462 (2022)
Lantz, R.: Quantitative evaluation of numerical diffusion (truncation error). Soc. Petrol. Eng. J. 11(03), 315–320 (1971)
Lapidus, L., Amundson, N.R.: Mathematics of adsorption in beds. VI. The effect of longitudinal diffusion in ion exchange and chromatographic columns. J. Phys. Chem. 56(8), 984–988 (1952)
Leal, A.: Reaktoro: An open-source unified framework for modeling chemically reactive systems (2015)
Leal, A.M., Kyas, S., Kulik, D.A., et al.: Accelerating reactive transport modeling: on-demand machine learning algorithm for chemical equilibrium calculations. Transp. Porous Media 133(2), 161–204 (2020)
LeVeque, R.J.: Finite Volume Methods for Hyperbolic Problems, vol. 31. Cambridge University Press, Cambridge (2002)
Lie, K.A., Nilsen, H.M., Rasmussen, A.F., et al.: Fast simulation of polymer injection in heavy-oil reservoirs on the basis of topological sorting and sequential splitting. SPE J. 19(06), 991–1004 (2014)
Madland, M., Hiorth, A., Omdal, E., et al.: Chemical alterations induced by rock–fluid interactions when injecting brines in high porosity chalks. Transp. Porous Media 87(3), 679–702 (2011)
Megawati, M., Madland, M.V., Hiorth, A.: Mechanical and physical behavior of high-porosity chalks exposed to chemical perturbation. J. Petrol. Sci. Eng. 133, 313–327 (2015)
Minde, M.W., Wang, W., Madland, M.V., et al.: Temperature effects on rock engineering properties and rock-fluid chemistry in opal-CT-bearing chalk. J. Petrol. Sci. Eng. 169, 454–470 (2018)
Moortgat, J., Li, M., Amooie, M.A., et al.: A higher-order finite element reactive transport model for unstructured and fractured grids. Sci. Rep. 10(1), 15572 (2020)
Morel, F.M.: Principles of Aquatic Chemistry, p. 446. Wiley, New York (1983)
Muggeridge, A., Cockin, A., Webb, K., et al.: Recovery rates, enhanced oil recovery and technological limits. Philos. Trans. R. Soc. A Math. Phys. Eng. Sci. 372(2006), 20120320 (2014)
Mykkeltvedt, T.S., Raynaud, X., Lie, K.A.: Fully implicit higher-order schemes applied to polymer flooding (2017)
Natvig, J.R., Lie, K.A.: On efficient implicit upwind schemes. In: Proceedings of ECMOR XI, Bergen, Norway, pp. 8–11 (2008)
Nermoen, A., Korsnes, R.I., Hiorth, A., et al.: Porosity and permeability development in compacting chalks during flooding of nonequilibrium brines: insights from long-term experiment. J. Geophys. Res. Solid Earth 120(5), 2935–2960 (2015)
Nødland, O., Hiorth, A.: A new formulation of the surface charge/surface potential relationship in electrolytes with valence less than three. In: ECMOR 2022, European Association of Geoscientists & Engineers, pp. 1–23 (2022)
Palandri, J.L., Kharaka, Y.K.: A compilation of rate parameters of water–mineral interaction kinetics for application to geochemical modeling. Tech. rep, Geological Survey, Menlo Park, CA (2004)
Parkhurst, D.L., Appelo, C.: Description of input and examples for PHREEQC version 3-a computer program for speciation, batch-reaction, one-dimensional transport, and inverse geochemical calculations. US Geol. Surv. Tech. Methods 6(A43), 497 (2013)
Pedersen, J., Jettestuen, E., Madland, M.V., et al.: A dissolution model that accounts for coverage of mineral surfaces by precipitation in core floods. Adv. Water Resour. 87, 68–79 (2016)
Rasmussen, A.F., Sandve, T.H., Bao, K., et al.: The open porous media flow reservoir simulator. Comput. Math. Appl. 81, 159–185 (2021)
Reeves, H., Kirkner, D.J.: Multicomponent mass transport with homogeneous and heterogeneous chemical reactions: effect of the chemistry on the choice of numerical algorithm: 2. numerical results. Water Resour. Res. 24(10), 1730–1739 (1988)
Rolle, M., Sprocati, R., Masi, M., et al.: Nernst–Planck-based description of transport, coulombic interactions, and geochemical reactions in porous media: Modeling approach and benchmark experiments. Water Resour. Res. 54(4), 3176–3195 (2018)
Ron, H., Lake, L., et al.: Petroleum Engineering Handbook, Volume V (B), Reservoir Engineering and Petrophysics. Society of Petroleum Engineers, Richardson (2007)
Saaltink, M.W., Carrera, J., Ayora, C.: On the behavior of approaches to simulate reactive transport. J. Contam. Hydrol. 48(3–4), 213–235 (2001)
Schlumberger, G.: Eclipse 300 Technical Description. Houston, Texas (2002)
Sharir, M.: A strong-connectivity algorithm and its applications in data flow analysis. Comput. Math. Appl. 7(1), 67–72 (1981)
Sleator, D.D., Tarjan, R.E.: Self-adjusting binary search trees. J. ACM (JACM) 32(3), 652–686 (1985)
Sorbie, K., Yuan, M.D., Todd, A., et al.: The modelling and design of scale inhibitor squeeze treatments in complex reservoirs. In: SPE International Symposium on Oilfield Chemistry, OnePetro (1991)
Steefel, C.I., MacQuarrie, K.T.: Approaches to modeling of reactive transport in porous media. Reactive transport in porous media, pp. 83–130 (2018)
Strand, S., Høgnesen, E.J., Austad, T.: Wettability alteration of carbonates-effects of potential determining ions (Ca\(^{2+}\) and SO\(_4^{2-}\)) and temperature. Colloids Surf., A 275(1–3), 1–10 (2006)
Strobel, G., Hagemann, B., Huppertz, T.M., et al.: Underground bio-methanation: concept and potential. Renew. Sustain. Energy Rev. 123, 109747 (2020)
Su, D., Mayer, K.U., MacQuarrie, K.T.: MIN3P-HPC: a high-performance unstructured grid code for subsurface flow and reactive transport simulation. Math. Geosci. 53(4), 517–550 (2021)
Tarjan, R.: Depth-first search and linear graph algorithms. SIAM J. Comput. 1(2), 146–160 (1972)
Trangenstein, J.A., Bell, J.B.: Mathematical structure of compositional reservoir simulation. SIAM J. Sci. Stat. Comput. 10(5), 817–845 (1989)
Valocchi, A.J., Malmstead, M.: Accuracy of operator splitting for advection–dispersion–reaction problems. Water Resour. Res. 28(5), 1471–1476 (1992)
Van Cappellen, P., Charlet, L., Stumm, W., et al.: A surface complexation model of the carbonate mineral-aqueous solution interface. Geochim. Cosmochim. Acta 57(15), 3505–3518 (1993). https://doi.org/10.1016/0016-7037(93)90135-J
Xu, T., Sonnenthal, E., Spycher, N., et al.: TOUGHREACT—a simulation program for non-isothermal multiphase reactive geochemical transport in variably saturated geologic media: applications to geothermal injectivity and CO\(_2\) geological sequestration. Comput. Geosci. 32(2), 145–165 (2006)
Xu, T., Sonnenthal, E., Spycher, N., et al.: TOUGHREACT user’s guide: a simulation program for non-isothermal multiphase reactive geochemical transport in variably saturated geologic media, v1. 2.1. Tech. Rep., Lawrence Berkeley National Lab.(LBNL), Berkeley, CA, USA (2008)
Yeh, G., Tripathi, V.: A critical evaluation of recent developments in hydrogeochemical transport models of reactive multichemical components. Water Resour. Res. 25(1), 93–108 (1989)
Yeh, GT., Tripathi, VS., Gwo, J., et al.: HYDROGEOCHEM: a coupled model of variably saturated flow, thermal transport, and reactive biogeochemical transport. Groundw React Transp Model 3–41 (2012)
Acknowledgements
The authors would like to acknowledge the Ekofisk PL018 license partners ConocoPhillips Skandinavia AS, TotalEnergies EP Norge AS, Vår Energi ASA, Sval Energi AS, and Petoro AS for providing the Ekofisk field data and for their kind permission to publish this work. Moreover, the authors acknowledge the Research Council of Norway and the industry partners of the National Centre for Sustainable Subsurface Utilization of the Norwegian Continental Shelf (NCS2030) Equinor ASA, Wintershall Dea Norge AS, OKEA ASA, DNO ASA, Aker BP ASA, Vår Energi ASA, SLB Norge AS, and Halliburton AS. Open-access funding provided by NORCE Norwegian Research Centre.
Funding
Open access funding provided by NORCE Norwegian Research Centre AS. Norges Forskningsråd (Grant No. 331644)
Author information
Authors and Affiliations
Contributions
All authors contributed to the study conception and design. Material preparation and data collection were performed by Felix Feldmann, Oddbjørn Nødland, Robert Moe, and Aksel Hiorth. Software conception and software development were performed by Felix Feldmann, Oddbjørn Nødland, Jan Sagen, Børre Antonsen, Terje Sira, Jan Ludvig Vinningland, and Aksel Hiorth. The first draft of the manuscript was written by Felix Feldmann and Oddbjørn Nødland and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Data Availability
The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.
Conflict of interest
The authors have no relevant financial or non-financial interests to disclose.
Appendices
Appendix 1: Sorting Algorithm Derivation
IORSim uses a cell-centered finite volume method (LeVeque et al. 2002). For a fixed volume \(\Omega\), the integral form of the mass balance equation for an arbitrary component is
where \(\Gamma =\partial \Omega\) denotes the volume boundary, \(\phi\) is the reservoir porosity, C is the molar concentration of the chemical component, \(\hat{\textbf{n}}\) is the outward-pointing normal vector to the boundary, J is the total mole flux of the component, and r is the source term. IORSim uses an implicit scheme to integrate Eq. 11 forward from \(t_n\) to \(t_{n+1}=t_n+\Delta t\). For simplicity, the derivation of Eq. 1 is shown for the case of one-dimensional flow in a Cartesian grid with a constant grid size, \(\Delta x\), and a constant cross-sectional area, A. However, the derivation can be extended to the general cases.
By abuse of notation, the concentration of the chemical component C and the source term r are initially replaced by their volume-averages. The total volume of each grid block is then \(\Omega =A\Delta {x}\), and it is straightforward to derive the discretized Eq. 12
where \(C_{i-1/2}\) is the concentration at the left boundary of the grid block, \(C_{i+1/2}\) is the concentration at the right boundary, and \(Q_w=uA\) denotes the volumetric flow rate of water across the interface between two cells.
So far, this is a conventional implicit scheme that can be solved as sparse system of coupled, nonlinear equations. The critical point is to rewrite the system so that the concentration in block i at time \(t_{n+1}\) solely depends on (1) the concentration in block i at the previous time and (2) the concentrations in the upstream cells that are already updated to the next time level. To this end, it can be assumed without loss of generality that \(Q_w>0\). In this case, the concentration at the left boundary is also the inflowing concentration, \(C_\text {in}=C_{i-1/2}=C_{i-1}\). Similarly, the concentration at the right boundary then becomes the outflowing concentration, \(C_\text {out}=C_{i+1/2}=C_{i}\). Equation 12 can therefore be written as
where
and
In the above equations, \(V_{w}=\phi S_w A \Delta x\) is the volume of water. For incompressible flow, \(Q_{w, \text {in}}=Q_{w, \text {out}}\), which yields
where \(B\equiv Q_w\Delta t/V_{w}\) was introduced. The physical interpretation of B is that it is the fraction of the grid block being flooded during the time step.
When applying the exact same procedure to the case of variable grid block dimensions and a three-dimensional grid, the derived equations are the same, provided each of the two flux terms is replaced with a sum to account for the possibility of multiple neighbors
The first sum is taken across all cell interfaces with an incoming flux (\(Q_{\text {in}, f} > 0\)), and the second sum over all interfaces with an outgoing flux (\(Q_{\text {out}, f} > 0\)). Thus, by definition, all flow rate terms remain positive in the notation.
Hiorth et al. (2017) noted the possibility of small mass balance error in the host simulator that impact the IORSim calculations. Therefore, the finite volume formula was corrected to take the volume balance of the flow simulator into account
where
In other words, the denominators of Eqs. 14 and 15 are replaced by inserting Eq. 19, which leads to Eq. 1 listed in Sect. 2.
Appendix 2: Splay Tree Lookup Algorithm
To save time in complex full-field simulations, IORSim uses splay trees to reuse solutions to geochemical equilibrium problems. However, due to the appearance or disappearance of minerals, it is more complex to store and search for solutions. IORSim creates one splay tree object for each possible combination of minerals. Whenever the geochemical solver is invoked, IORSim detects the minerals present at the given point in space and time. The information is encoded in a binary key, which is used to recover the correct splay tree. For each splay tree, the following pieces of data are used to construct lookup keys:
-
The total concentrations of each basis species (including surface basis species).
-
The time step, \(\Delta {t}\).
-
The temperature, T.
-
The log activity of minerals.
Given this data, the equilibrium state is uniquely determined. Each node in a splay tree stores the following pieces of data:
-
Differences in the total concentration of each basis specie over the time step (old values minus new values).
-
If ion exchange and/or surface complexation reactions are included, differences in the adsorbed concentrations (old–new).
-
If surface complexation reactions are included, \(\sigma\) (surface charge density) and \(\psi\) (surface potential).
-
The pH value.
To be more specific, each key consists of \(n_B+n_M+2\) integers, where \(n_B\) is the maximal number of basis species that can exist in the entire simulation run, and \(n_M\) is the maximal number of minerals. The first \(n_B+1\) entries are computed from the basis specie concentrations and the time step: given an input value v, it is converted into an integer via the formula
where \(N_\text {int}\) is the input splay tree resolution, \(f_\text {log}\) is a scaling factor (here, assumed to be unity), and the brackets signifies a floor-function. The splay tree resolution is related to w via
On the other hand, the final \(n_M+1\) values are obtained from the temperature and the mineral log activities. Each input value v is converted in to an integer key using Eq. 23
where \(f_\text {lin}\) is a scaling factor that is set to unity. Essentially, the approach categorizes solutions into bins; the finer the resolution of the splay tree, the greater the number of bins (meaning, more solutions are considered distinctly). When a new scenario arises, the solver initially seeks the "closest" pre-computed solution by utilizing the key. IORSim enables the user to adjust the splay resolution by setting an interpolation parameter. While a finer splay resolution causes longer computation, numerical accuracy increases with larger interpolation parameters.
Appendix 3: Geochemical Model
1.1 Appendix 3.1: Aqueous Equilibrium Chemistry
The equilibrium chemistry of the aqueous phase is computed from the Helgeson–Kirkham–Flowers (HKF) equation of state (Helgeson and Kirkham 1974a, b), using the SUPCRT thermodynamic database (Johnson et al. 1992).
1.2 Appendix 3.2: Mineral Kinetics
Rate-controlled mineral precipitation/dissolution is modeled according to Palandri and Kharaka (2004)
where \(M_i\) is the concentration of mineral i in mol/L PV, \(k_{1,2}\) are temperature-dependent rate constants in mol/L/s account for the mineral surface area, m and n are exponents indicating the order of reaction. The mineral saturation states \(\Omega _i\) is related to the ion activity product (IAP) and equilibrium constant (K) as follows:
In practice, the user inputs two reference rate constants at \(T_\text {ref}=25\) \(^{\circ }\textrm{C}\,\), \(k_{j}(T_\text {ref})\), as well as two activation energies, \(\epsilon _{a,1}^i\) and \(\epsilon _{a,2}^i\) (J/mol). The temperature dependence is computed with an Arrhenius-type relation
for \(j=1, 2\).
1.3 Appendix 3.3: Surface Chemistry
For simulations with surface chemistry, IORSim uses a surface complexation model that was previously developed for calcite surfaces (Van Cappellen et al. 1993; Hiorth et al. 2010):
Equations 27–33 are solved together with the reactions in the aqueous phase and are thus included in the mass balance equations. In the absence of data to the contrary, it is assumed that the temperature-dependence of the surface reactions is the same as for the analogous reactions in the aqueous phase (Hiorth et al. 2010).
A key difference between the aqueous and surface reactions is that the activity at the surface is related to the surface potential, \(\psi _0\) [V]. If the surface is negatively charged, positive ions will have a higher activity compared to negative ions, while the opposite is valid for a positively charged surface.
The relationship between the surface potential and the surface charge density, \(\sigma\) [\(\mathrm {C/m^2}\)], is given by the Grahame equation
Equation 34 is also included in the set of nonlinear equations to solve in each grid block at each time step; the physical solution is where \(\sigma\) and \(\psi _0\) have the same sign.
The notation used in Eq. 34 is as follows:
-
\(\varepsilon _{0}=8.854\cdot 10^{-12}\) C/V/m is the vacuum permittivity.
-
\(\varepsilon\) denotes the relative permittivity (dielectric constant) of water.
-
\(R=8.314\) J/K/mol is the ideal gas constant.
-
T is the absolute temperature.
-
\({\mathcal {F}}=96{,}484.56\) C/mol is the Faraday constant.
-
\(n_i^B\) is the molar concentration of charged species number i in the bulk aqueous phase away from the mineral surface.
Finally, the surface charge density is obtained from
where \(S_A\) is the specific surface area in units of square meter per liter of water, and the brackets denote molar concentrations of the surface complexes. For details on the numerical implementation, see Nødland and Hiorth (2022).
1.4 Appendix 3.4: Reactions and \(\log K\) Values
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Feldmann, F., Nødland, O., Sagen, J. et al. IORSim: A Mathematical Workflow for Field-Scale Geochemistry Simulations in Porous Media. Transp Porous Med (2024). https://doi.org/10.1007/s11242-024-02094-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11242-024-02094-9