## 1. Introduction

[2] Stochastic simulation is an important research topic in the modeling of subsurface (unsaturated and saturated) flow and transport due to the various sources of uncertainties [*Dagan*, 1989; *Tartakovsky*, 2012; *Lin et al*., 2010; *Lu et al*., 2012] inherent in the mathematical models, especially those related to spatially and temporally distributed model parameters. In particular, effective and efficient uncertainty quantification methods (UQ) are needed to properly characterize and quantify uncertainties for complex subsurface transport models involving multiphase, multicomponent, and multiscale features.

[3] In *Chen et al*. [2013], a “modular” UQ methodology was proposed for the uncertainty and sensitivity analysis of multiphysics systems and was demonstrated on applications pertaining to reactive transport in an isotropic and homogeneous medium with constant flow. A unique feature of the modular UQ method is that it supports the use of different UQ methods, intrusive or nonintrusive (to be defined later), on different physics modules of a multiphysics system with minimal intermodule interference; that is, each “stochastic” module needs only to handle the propagation of its own internal uncertain parameters, regardless of whether there are any other uncertain parameters in other modules. This “modular” software engineering strategy has already been adopted as common practice in many deterministic simulation model development efforts [*Clark and Baldwin*, 2000]. The modular UQ methodology presented in *Chen et al*. [2013] extends this plug-and-play concept to stochastic simulation models via a computational framework that facilitates the propagation of global uncertainty and sensitivity through all physics modules. The objective of this paper is to generalize the modular UQ methodology to reactive transport applications involving spatially random velocity fields with realistic correlation lengths (that are much smaller than the size of the computational domain).

[4] To do so, we need another specialized module whose solver is equipped to handle uncertainty propagation for spatially distributed random parameters. The difficulty with such spatial randomness stems from the high dimensionality of the stochastic space, which is proportional to the number of grid points in the computational mesh. To reduce the stochastic dimension, the Karhunen-Loève expansion (KLE) [*Karhunen*, 1947; *Kac and Siegert*, 1947], also known as biorthogonal decomposition (BOD) or proper orthogonal decomposition (POD) or principal components analysis (PCA) [*Pearson*, 1901; *Hotelling*, 1933], has been widely applied to problems involving spatial heterogeneity, and is becoming more prevalent in environmental applications. These KLE-based approaches provide a mathematical procedure that transforms a number of possibly correlated variables into a smaller number of uncorrelated variables called principal components or modes. For example, *Chanem and Dham* [1998] combined the KLE of random permeability field with orthogonal polynomials, and applied the result to a two-dimensional (2-D) multiphase flow problem. *Zhang and Lu* [2004] proposed a moment-equation-based KLE approach called KLME for solving a 2-D flow problem. *Li and Zhang* [2007] applied the KLME technique to solve a 2-D stochastic solute transport problem. *Chen et al*. [2011a, 2011b] applied the POD-based approaches to solve reduced-order data assimilation problems for shallow-water equations model.

[5] In this work, we combine KLE-based approaches with our hybrid (modular) UQ framework to study a 2-D flow problem coupled with contaminant transport and reactions in heterogeneous media. In particular, the stochastic system comprises three modules: flow, transport, and reaction. To showcase the use of hybrid UQ methods in the modular UQ framework, we first use a polynomial-chaos-based nonintrusive method by a least squares fit [*Knio and Le Maître*, 2010] in the flow module to compute the stochastic hydraulic head to derive the stochastic velocity field. This stochastic velocity field is then used by the stochastic transport module, which solves for the species concentrations with a polynomial-chaos-based intrusive method. Finally, the stochastic reaction module (stochastic because of uncertain reaction rates), which simulates sequential chain reactions in absence of transport, uses a sampling-based nonintrusive method to propagate uncertainties. A benefit of the modular UQ methodology is that these three modules can be developed independent of one another using different UQ methods, and then be seamlessly “glued” together via a generic UQ framework to solve a transient multispecies reactive transport system. Subsequent changes to any module (for example, the reaction module) do not affect the implementations and operations of the other modules.

[6] The challenge to the applicability of the modular UQ framework to reactive transport in heterogeneous media is the high-dimensional stochastic space introduced by the presence of spatial randomness with large variance, which is specific to the user-defined physics and has not been studied in the previous modular UQ framework [*Chen et al*., 2013]. In this paper, we expand the framework to handle this scenario by incorporating a new KLE capability that allows uncertainties from the flow module to be propagated to the transport module. However, a straightforward application of the KLE method to the random hydraulic head does not preserve the orthogonality of the corresponding velocity field, which presents a computational bottleneck. To circumvent the problem, we develop a doubly nested dimension reduction scheme based on KLE and POD within the modular UQ framework to ensure that the velocity field is optimally represented in a low-dimensional manner.

[7] The outline of this paper is as follows: in section 2, we present the governing equations for deterministic groundwater flow, transport, and reactions in heterogeneous porous media. In section 3, we provide a brief review of intrusive, nonintrusive, and hybrid UQ methods. In section 4, we describe the steps to solve the subsequent stochastic two-dimensional flow system in randomly heterogeneous porous media. In section 5, we present the steps to solve a stochastic multispecies reactive transport system, using a polynomial chaos method for transport and a nonintrusive sampling method for reactions, followed by discussions about the application and implementation aspects of modular UQ framework. We report the results of numerical experiments in section 6. Finally, we conclude with summary and future work in section 7.