In Chen et al. (2013), the fundamental concepts of the modular UQ methodology have been introduced for general multiphysics applications in which each physics module can be independently embedded with its internal UQ method (intrusive or nonintrusive) without losing the global uncertainty propagation property. In the current paper, we extend the modular UQ methodology to subsurface flow and reactive transport applications, which are characterized by high dimensionality in the stochastic space due to spatially random velocity field in randomly heterogeneous porous media. Specifically, we develop a scheme to reduce the dimension of the stochastic space. This is achieved via a doubly nested dimension reduction by applying Karhunen-Loève expansion to the logarithmic hydraulic conductivity field, followed by Proper Orthogonal Decomposition to the velocity field. This scheme enables the modular UQ framework to handle spatially random models efficiently while maintaining solution accuracy. When compared against sampling-based nonintrusive UQ methods, the modular UQ method demonstrates a similar accuracy at a fraction of computational cost on designed numerical experiments.
 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.
 In Chen et al. , 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.  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).
 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  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  proposed a moment-equation-based KLE approach called KLME for solving a 2-D flow problem. Li and Zhang  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.
 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.
 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.
 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.
2. Governing Equations
 In this section, we present the governing equations for deterministic groundwater flow, transport, and reactions in a heterogeneous porous medium. We defer the discussion of uncertainty and sensitivity propagation between these three (flow, transport, and reaction) modules to sections 4 and 5.
2.1. Two-Dimensional Flow in Heterogeneous Porous Media
 Let Ω be a heterogeneous two-dimensional domain and . We consider a steady state flow in a saturated medium satisfying the following continuity equation:
where h(x) is the hydraulic head, and K(x) is the hydraulic conductivity. We impose a no-flow condition and constant heads on the boundary .
2.2. Two-Dimensional Transport Coupled With First-Order Reactions
 The study of sequential multistep reactions is central to the understanding of various biodegradation processes subsurface [Clement et al., 1998; Sun et al., 1998]. For example, the reductive anaerobic degradation of trichloroethylene (TCE) to dichloroethylene (DCE), then to vinyl chloride (VC), and eventually to ethylene (ETH), may be modeled using a sequential first-order degradation kinetic model [Sun et al., 2004]. The ability to quantify uncertainties in sequential multistep reaction models has the potential to facilitate the assessment and control of various biochemical processes impacting the environment.
 The reductive anaerobic degradation falls under the general category of multispecies reactive transport in heterogeneous porous media that can be described by the following system of equations:
where is the concentration of the ith species; t [T] is time; vx and are the velocity components for x and y direction; Dx and Dy [L2T−1] are the dispersion coefficients in x and y direction. The dispersion coefficient can be prescribed as a linear function of the dispersivity , i.e., and [Scheidegger, 1961]. For each species i, ki [T−1] is the first-order reaction rate, and Ri is the retardation factor with R0 = 0. Let n be the number of species and , then the system of multispecies equations can be rewritten as:
where . The structure of the matrix A depends on the nature of the reaction network [Sun et al., 2012].
 In this paper, we apply equation (3) to model the sequential first-order network representing the biodegradation from TCE to ETH:
 In this case, li is the yield coefficient of the ith reaction, with li = 1 for unimolecular reactions. The reaction matrix A for this network has the following form:
 To solve equation (3), one popular solution approach is to use “operator splitting,” namely, split the solution process into two stages to mimic the equation structure that consists of independent transport and reaction terms. At each time step, the “transport equation” is solved for the species concentration, followed by the solution of the “reaction equation.” In the special case of sequential networks with first-order reactions, the reaction equation has an analytical solution [Sun et al., 2012].
 Using operator splitting of equation (3), the (vectorized) transport equation becomes:
which consists of four independent equations, one per species. Then, we apply (i.e., the solution to equation (6)) as initial conditions to the (vectorized) reaction equation:
 In this section, we give a brief review of intrusive and nonintrusive UQ methods, then, describe related works in hybrid UQ methods. We contrast these methods against the modular UQ methodology, and present the mathematical framework of the methodology.
3.1. Intrusive UQ Methods
 A popular intrusive method is the stochastic Galerkin method using polynomial chaos expansions (PCE) [Ghanem and Spanos, 1991a, 1991b]. Intuitively, PCE formulations involve the expansion of random quantities (e.g., a random variable, vector, or field) in terms of orthogonal polynomials corresponding to the random quantities' probability distributions. PCE provides a convenient representation because uncertainty and sensitivity information can be efficiently computed at low computational expense assuming adequate smoothness of the given random quantity.
 Formally, consider a probability space (Θ, Σ, P) where Θ is the sample space, Σ is a σ-algebra on Θ (nonempty collection of subsets of Θ that is closed under complementation and countable unions of its members), and P is a probability measure (mapping Σ to [0,1]). Let X be a real-valued random variable defined on (Θ, Σ, P):
and let be the set of second-order random variables such that, for , we have where . forms a Hilbert space with respect to the inner product:
where P(X, Y) is the joint probability density function of X and Y. The associated norm of X is .
 The basic concept in representing uncertainty using polynomial chaos is that one can express a second-order random variable X involving m random variables as a sum of orthogonal polynomials:
where are polynomial chaoses of order p in the variables with the polynomial type and domain depending on the distributions imposed on the m-dimensional random variables . For example, in the flow and reactive transport equations (1) and (2), X can represent the physical random parameters, which in our case, would be . These parameters are approximated by a polynomial chaos expansion using the generic random variables ξ with known distribution P(ξ) in the Hilbert space. Alternatively, the random variable X can also be used to represent the stochastic solution of equation (1) or (2).
 To simplify notation, the multidimensional expansion in equation (10) is usually mapped term-by-term to a single-index form given by:
where 's are the same polynomial chaoses in single-index form and (Q + 1) is the total number of terms in the expansion using polynomial order p:
 The polynomial chaoses are mutually orthogonal with respect to the inner product associated with the space spanned by the random variables ξ. In particular, when a uniform distribution is assumed for the m random variables, the associated orthogonal polynomials are the Legendre polynomials. Using PCE, it is straightforward to verify that the approximate mean of X (using Q + 1 terms) is X0 and the approximate variance is:
 In general, when the input-output mapping is sufficiently smooth, intrusive methods have the potential to be more computationally efficient than nonintrusive methods [Li and Xiu, 2009; Elman et al., 2011]. However, this is at the expense of higher development effort, since implementation would require major modifications to existing deterministic codes. This overhead might be too cumbersome or time consuming for complex multiphysics and multiscale computer codes. As a result, intrusive methods have not been as widely adopted as nonintrusive methods.
3.2. Nonintrusive UQ Methods
 Nonintrusive methods consist of generating samples of random variables based on their distributions via a fixed sampling scheme. Different sampling schemes generate samples with different “space coverage” properties. The samples are then propagated through the model by running the model repeatedly with the sample inputs. The outputs of interest are collected and the desired statistics, such as mean and standard deviation, are computed. Again, let m be the number of random variables; be the corresponding joint probability distribution function; be the set of N samples drawn from this distribution, where each row of S is a single sample of the input m dimensional random variables; and be the (univariate) outputs corresponding to the N “input” samples. The sample approximations of the mean and standard deviation are and , respectively.
 While straightforward to implement, the nonintrusive approach suffers from poor computational efficiency. The convergence rate of the computed mean is only O( ) for the Monte Carlo sampling method. Despite the fact that other sampling strategies (e.g., Latin hypercube [McKay et al., 1979], Quasi-Monte Carlo [Morokoff and Caflisch, 1985], importance sampling [Ghanem and Spanos, 2002; Liu, 2001]) have been proposed to improve convergence, existing sampling methods are still inadequate to handle high-dimensional models. When input-to-output mapping is sufficiently smooth, a popular alternative is to assess uncertainties on the surrogates (or response surfaces) constructed from the samples.
3.3. Hybrid UQ Methods
 Hybrid UQ methods seek to bridge the gap between the practicality of nonintrusive methods and the potential efficiency of intrusive methods. The term “Hybrid UQ” has been used in various contexts [Abdel-Khalik, 2010; Joslyn and Ferson, 2005; Constantine et al., 2009]. Here, “hybrid” stands for mixed techniques that facilitate the flexibility of using different UQ methods, intrusive or nonintrusive, at individual modules in a strongly coupled multiphysics system. As such, the modular UQ framework can be interpreted as a hybrid UQ method.
 There are two key issues in designing a modular UQ framework for propagating global uncertainties using only user-implemented modules that propagate only local uncertainties: (1) defining the global uncertainty representation and (2) deriving the operators that handle information between modules. In this work, we have selected PCE to represent global uncertainty. This choice is appropriate if the dependent stochastic variables are sufficiently smooth in the independent stochastic parameter space. The advantage of this choice is that both uncertainties and parameter sensitivities are embedded in the representation. The drawback is that it may suffer from the “curse of dimensionality,” as the computational cost grows rapidly with respect to the dimension of the stochastic space. This drawback is especially acute in applications involving spatial randomness with relatively small length scales. For this reason, we developed a doubly nested dimension reduction scheme to facilitate dimension reduction in order to overcome this drawback.
 Let κ be the number of independent physics modules in a multiphysics system in which each module has a stochastic solver (which could be implemented by an intrusive, nonintrusive, or even hybrid method). Let be κ disjoint subsets of independent second-order stochastic variables, where ξk denotes module k's internal stochastic variables. Also, let u(x, ξ) be the dependent stochastic variables that are propagated between different modules. Each module k contributes local updates to u(x, ξ):
where Mk is a stochastic solver for module k. Suppose a two-module system is solved by using the solvers M1 and M2 via operator splitting. The updates through the system at time step t can be performed in two steps:
where ξ1 and ξ2 are stochastic variables internal to modules 1 and 2, respectively. For example, M1 could represent the transport solver (cf. equation (6)) with , while M2 the reaction solver (cf. equation (7)) with .
 When equation (14) is naively formulated as equation (15), the solver M1 requires all the stochastic variables in the system including ξ2. This is an impediment to “separability” in model development. The key to decoupling the stochastic modules is to reformulate equation (14) as equation (16):
by introducing restriction (Rki) and interpolation (Pki) operators. These operators help to break up the stochastic solver Mk into nk subproblems. Each subproblem solver is responsible for propagating uncertainties with respect to only the local stochastic variables, but together, these 's propagate global uncertainties. The role of Rki is to restrict the dependent stochastic variables defined in the entire stochastic space ξ to the local stochastic space ξk, while the role of Pki is to interpolate these same dependent stochastic variables from the local space back to the global stochastic space ξ.
 The mathematical forms of Rki and Pki are different for different modules with different UQ methods. For example, in intrusive polynomial-chaos-based modules for linear partial differential equations, Rki and Pki are analogous to the “scatter” and “gather” operators, respectively. We provide these operators as part of the modular UQ library so that code developers need only to focus on their own solvers in equation (16). The only requirement for users to use the framework is to specify, for each module, the degree of polynomial (for PCE representation), the number of random variables, the stochastic solvers, and whether they are intrusive or nonintrusive, linearly coupled or nonlinearly coupled. In section 5, more details about the requirements for user-generated solvers are given.
4. Two-Dimensional Stochastic Flow in Heterogeneous Porous Media
 Let K(x, θ), the stochastic hydraulic conductivity, be represented as a random process in the space , where denotes the Cartesian product and , . Applying the logarithmic transformation , we have the following stochastic partial differential equations to describe the stochastic flow:
where h(x, θ) is the stochastic hydraulic head, which will be used to compute the stochastic velocity field required by the transport module.
 In this section, we describe the steps to compute the stochastic velocity field (i.e., the solution to the stochastic flow equation given in equation (17)) via a doubly nested dimension reduction scheme that combines KLE and POD. Section 4.1 describes how KLE is used to reduce the infinite-dimensional random field Y(x, θ) to an approximate finite-dimensional representation. Section 4.2 presents a nonintrusive PCE-based method (the implementation of which is greatly facilitated by the modular UQ framework) to solve for the stochastic hydraulic head h(x, θ) from the stochastic flow equation. Section 4.3 describes a POD reduced-order modeling technique based on singular value decomposition (SVD) to generate a low-dimensional stochastic velocity field from the stochastic hydraulic head.
4.1. KLE of Log Hydraulic Conductivity
 For the random process Y(x, θ) in equation (17), the covariance function [Zhang and Lu, 2004; Li and Zhang, 2007, 2009; Liu et al., 2007]:
is bounded, symmetric, and positive definite with and ( in equation (18) denotes the inner product in the space Ω). The covariance function can be decomposed into:
where λn and fn(x) are the eigenvalues and eigenfunctions, respectively. Here, fn(x) are the orthogonal and deterministic functions that form a complete set such that:
where δnm is the Kronecker product. The random process Y(x, θ) can be expressed via KLE as:
where is the mean of the stochastic process Y(x, θ), and ξn(θ) are orthogonal zero-mean random variables. Formally, , and , where denotes the inner product in the space .
 Eigenvalues and eigenfunctions of the covariance function CY(x, y) can be solved from the following Fredholm equation:
 For example, consider a one-dimensional stochastic process with the following covariance function:
where x and y are scalars, and and ζ are the variance and correlation length of the random process. The eigenvalues λn and eigenfunctions fn(x, y) can be solved analytically [Zhang and Lu, 2004]. For problems in two dimensions, we consider a separable covariance function:
in a domain , and the eigenvalues and eigenfunctions can be obtained by combining those from the one-dimensional formulations. We can truncate the KLE to a finite number of terms by inspecting the spectral decay rate of λn. The higher the rate of spectral decay is, the smaller the number of terms is needed in the truncated KLE. In fact, the rate of spectral decay depends on the correlation function of the stochastic process. The more correlated the process is, the higher is the rate of spectral decay and fewer terms are needed in the truncated KLE to account for the same fraction of the total variance.
4.2. Nonintrusive PCE-Based Stochastic Solution of Flow Equation
 By substituting the truncated ( -term) KLE of Y(x, θ) (assuming and omitting θ in ξn(θ)) into the stochastic flow equation, we obtain:
 Next, we expand h(x, θ) in terms of PCE:
where Q is defined in equation (12), and ξ is the vector of random variables from equation (25):
 To solve the stochastic flow equation, we first generate a set of the sample points, that is:
 For each sample point ξl, we solve the following deterministic equation:
by applying a Galerkin finite-element discretization approach.
 Let be the set of hydraulic heads obtained by solving the corresponding deterministic equations above. The objective is to compute the PCE coefficients for the hydraulic head h(x, θ), that is, , such that:
 In matrix form, equation (30) can be rewritten as:
where with consisting of Legendre polynomials evaluated at the sample points . Since Z is either a square matrix or an overdetermined matrix, h(x) can be solved in a least-square sense by:
 The sample generation and the computation of h(x) are automatically handled by the nonintrusive module in the modular UQ framework.
4.3. Generation of the Stochastic Velocity Field
 The stochastic velocity can now be computed using the KLE of hydraulic conductivity and the stochastic hydraulic head. The respective x and y direction velocities are:
where ϕ is the porosity, which is assumed to be a known constant. Therefore, the overall velocity field is given by:
 In equation (35), the biorthogonality structure of the KLE representation of K(x, θ) is destroyed in v(x, θ). This introduces high stochastic dimension and thus computational inefficiency in the solution of the stochastic transport equation. To mitigate this situation, we use a numerical covariance quadrature method to approximate the analytical covariance function (i.e., the method of snapshots [Sirovich et al., 1987]), then apply singular value decomposition. To do so, we generate a set of samples in the stochastic space Θ and solve equations (33) and (34) at each sample point θi to compute , where . Subsequently, the numerical covariance matrix can be constructed from , where is the sample mean of vs.
 It can be shown that the eigenvalue decomposition of the covariance matrix is equivalent to applying SVD [Golub and Loan, 1996] to :
where is the sample mean of vs representing the average velocity field; r is the number of truncated singular values; and is the number of nodes on the finite-element mesh that are not lying on . Let , and . Then, vs can now be represented by an optimal rank r approximation using the eigen-velocity field fn(x):
where . If instead of using the samples , we consider the sampled variables themselves (denote the first r of those variables as ), then we have the general (nonsample-based) expression for the velocity field:
 As such, we obtain
 Note that and now share a new set of random variables η, and their ranges can be specified by the variability of their realizations from the coefficient matrix V computed from SVD. Let and , and define:
 Using Rn, we can normalize the random variables by and finally represent the spatially correlated random field v(x, ξ) in terms of the stochastic expansion of the spatially uncorrelated normalized random variables η:
which is applied as an (uncertain) input to the transport module (to be discussed in section 5). Here, ηn(θ) follows a standard uniform distribution:
5. Hybrid UQ for Reactive Transport System in Randomly Heterogeneous Media
 In this section, we describe the steps to solve a multispecies reactive transport system using the velocity field obtained in section 4. Here, we apply the modular UQ methodology described in section 3.3. In the following, we first introduce the formulation of a two-dimensional reactive transport system in heterogeneous porous media, then describe the stochastic solution of the transport and reaction modules, where the transport system is solved by the PCE-based intrusive method and the reaction system is solved by a sampling-based nonintrusive method. Finally, we show how to “glue” these two independently implemented modules together using the modular UQ framework to propagate global uncertainties and sensitivities.
5.1. PCE-Based Stochastic Transport Module
 The transport equation can be solved independently for each species. Hence, it suffices to discuss the PCE formulation of one generic species' (scalar) transport equation. Removing the species and time indices, the scalar transport equation becomes:
where again, Ω is an anisotropic two-dimensional domain with boundary .
 When αx, αy, vx, and vy are fixed parameters, equation (42) describes a deterministic problem with the species' concentration field as its solution:
where , and is a given function on .
 We apply PCE-based stochastic Galerkin projection with the finite-element approximation of the stochastic variational form and we introduce the “polynomial chaos space” onto which we project the stochastic space :
where are the polynomial chaoses of some prespecified order p, and the number of terms (Q + 1) is defined in equation (12). After applying stochastic Galerkin projection (Appendix A) to the stochastic problem, we arrive at equation (A(6)), which is a sparse matrix system that can be solved by preconditioned Krylov methods [Golub and Loan, 1996].
5.2. Propagation of Uncertainties Through the Transport and Reaction Modules
 While the transport system (equation (6)) can be solved independently for each species, the reaction system (equation (7)) is coupled so it must be solved in its vectorized form. Reproduced here for clarity, the reaction problem is to apply (the transport solution) as the initial condition for solving in:
where A has the form of equation (5). To solve this equation, we follow the analytical procedure in Sun et al. . This equation is solved for each sample of , the first-order reaction rates which are the random variables in the reaction module.
 In terms of implementation, the reaction solver is “wrapped” around by a nonintrusive module in the modular UQ framework, which provides generic tools for sampling and regression analysis. Thus, the reaction solver is treated as a black box to run an ensemble of sample points drawn from the probability distributions of , the results of which are used to construct uncertainty and sensitivity information to be propagated to the next module.
 The full reaction-transport system with embedded UQ can now be solved by calling each module sequentially at each time step. At the end of the simulation, the overall uncertainty and sensitivity information can be extracted from the PCE coefficients as prescribed in section 3. The task of global uncertainty propagation is handled by the modular UQ framework, freeing the user to develop the transport or reaction solver independently. The computational framework to handle the decomposition and recombination of the global PCE information is generic so that it can be applied to other similar “multiphysics” problems.
 In summary, we have described the multispecies reactive transport problem as a two-module system in the modular UQ framework, in which the propagation of global uncertainties through the transport module is performed intrusively while the propagation of global uncertainties through the reaction module is performed nonintrusively. By applying the stochastic velocity field from the flow module as input into the transport module, spatial uncertainty associated with the randomly heterogeneous media is propagated through the system.
6. Numerical Results and Analysis
 In numerical experiments, we consider a two-dimensional square domain Ω of size (m), with 40 evenly spaced elements in each direction. The time step is set to Δt = 1 (day). We used a polynomial order of p = 3 in the PCE representation, which has been verified to give results with sufficient accuracy.
6.1. Multispecies Reactive Transport (Validation Experiments)
 First, we make sure that our previously described two-dimensional methodology agrees well with the analytical solution [Sun et al., 2012] for one-dimensional multispecies reactive transport model problem. This validation step is important to ensure the methodology does not introduce numerical bias to the solution. In this problem setup, dispersivity is α = 1.25 (m) and velocity is (m d−1). The reaction rates for the four species are , and k4 = 0.005 (day−1), respectively. The retardation factors and yield coefficients are all assumed to be 1.0. The homogeneous velocity is given by , where both vx and vy are homogeneous random variables with ranges defined in Table 1. Since we are using a one-dimensional problem to verify the two-dimensional implementation, we set the dispersivity and velocity in the y direction to zero. The total simulation time is t = 40 (days) with Δt = 1 (day). We used the HYPRE iterative solver package [Falgout, 2011] to solve the matrix equations arising from the discretization of the stochastic finite-element problem.
Table 1. Ranges of Physical Parameters in Validation Experiments
 We considered two scenarios: one in which the uncertainty is negligible (Case I) and another with increased uncertainty (Case II). In both scenarios, we compare the analytic solution against our solution at the center line y = 10 (m) since the solution is computed for a two-dimensional stochastic domain. For the first scenario, we assumed no variability in dispersivity and velocity (as defined in Case I of Table 1) by setting very small uncertainty ranges to velocity parameters and using a polynomial order of p = 0. As shown in Figure 1, the concentration means computed by the modular UQ method (solid lines) agree well with the exact solutions (circles) given in Sun et al. . For the second scenario, the ranges of dispersivity and velocity are defined in Case II of Table 1. As shown in Figure 2, the exact solutions (circles) of the concentration profiles lie inside of the uncertainty bands of computed by our method. Here, the μ lines are the same as the ones from Figure 1. These two scenarios demonstrate that our method is well validated against analytic methods and that no bias is introduced by our method.
6.2. Multispecies Flow and Reactive Transport in Random Media
 In the next numerical experiment, we consider a two-dimensional four-species flow and reactive transport system in randomly heterogeneous porous media. We first used KLE to reduce the dimension of the logarithmic hydraulic conductivity. We then applied a PCE-based nonintrusive approach (i.e., used sampling to construct the PCE coefficients) to solve the stochastic head from the stochastic flow equation. In this setup, no-flow boundary conditions are assumed at y = 0.0 and 20 m; and constant hydraulic heads are prescribed to be 2.0 and 0.0 m at x = 0.0 and 20 m, respectively. The mean of the logarithmic hydraulic conductivity is prescribed as . We used a separable covariance function of the logarithmic hydraulic conductivity in the square domain , with variance and correlation length . Figures 3 and 4 show the computed mean and variance of the hydraulic head, which have been verified by using a large Monte Carlo sample. The stochastic velocity field was thus computed based on the KLE of hydraulic conductivity field and the computed stochastic hydraulic head field, which introduces high stochastic dimension to the velocity field. We then obtain orthogonal eigen-velocity fields by our doubly nested dimension reduction scheme, as discussed in section 4.3. Figure 5 displays the first, second, fifth, and seventh eigen-velocity field in the two dimensional domain.
 Next, we applied the solution to the stochastic flow equation for solving the reactive transport system (equation (2)). Initial concentrations for all four species are assumed to be zero throughout the computational domain. A Gaussian boundary concentration is imposed at the inlet in the x direction. The retardation factors and yield coefficients in the reaction matrix A (equation (5)) are treated as deterministic and are given by: and . Results are presented for t = 10 (days).
 In this experiment, the porosity is specified by a deterministic constant . The independent physical parameters are: from the flow module, from the transport module (because , and are dependent random variables), and from the reaction module. These parameters are assumed to follow uniform distributions and their ranges are given in Tables 2 and 3. These tables also show how each of these physical parameters are internally represented by the generic random variables in the modular UQ framework: by , where r is the number of KLE functions taken from the stochastic flow module; is internally represented by by and ξ1; and ki by . The total number of uncertain parameter is r + 5 where r is the number of KLE functions taken from the stochastic flow module and 5 is the number of ξi's. We use r = 2, for the reason that, when we varied r from 2 to 7, we noticed only a negligible change in the standard deviations. In sum, the physical uncertain parameters are represented by the random vector .
Table 2. Description of Physical Flow and Transport Parameters in Numerical Experiments
Table 3. Description and Ranges of Physical Reaction Parameters in Numerical Experiments
 We ran the numerical experiment on an iMac computer (with 3.4 GHz Intel Core i7 processor and 8 GB 1333 MHz DDR3 memories). We compare our results against the “ground truth” results approximated by a large number of samples, as shown in Figures 6 and 7. We observe that the modular UQ method demonstrates a similar accuracy as the ground truth results. Figures 8 and 9 show the contours of μ (mean) and σ (standard deviation) over the entire two-dimensional domain, respectively. We also compare the performance of our modular UQ method with a pure sampling-based method (using 1000 samples, which is the minimum required for convergence of statistical moments). The overall CPU run times are 91 and 821 s, respectively. The speedup of the modular UQ can be attributed to the reuse of the assembled stochastic matrices in the intrusive transport module. Specially, the CPU run times for matrix setup are 15 and 389 s, respectively, while the CPU run time for linear system solves are 76 and 432 s, respectively. Further speedup of our modular UQ can be obtained by using more efficient solvers for linear system with multiple right hand sides.
 Intrusive UQ methods offer mathematically rigorous and also potentially more efficient means of quantifying uncertainties in simulation models compared to nonintrusive methods. However, the complexities of their formulation and implementation have hampered the practicality of these methods for large-scale reactive transport applications. In this paper, we applied our computational framework to address spatial heterogeneity in the propagation of global uncertainties and sensitivities in a multispecies problem involving flow, diffusive transport, and sequential first-order reactions with spatial stochasticity in randomly heterogeneous porous media. In this setting, transport is handled by intrusive PCE and reaction is solved by a deterministic solver. Specifically, we develop a scheme to reduce the dimension of the stochastic space via a doubly nested dimension reduction scheme. This scheme enables the modular UQ framework to handle spatially random models efficiently while maintaining solution accuracy. We have validated the framework under different uncertainty levels for the transport and reaction parameters. The modular UQ method shows excellent computational accuracy and efficiency compared to estimates derived from a purely nonintrusive sampling method. By providing a generic computational framework and the associated algorithms to manage the complexities of global uncertainty/sensitivity propagation, this approach has strong potentials for streamlining the development and maintenance of UQ methods on a per module basis, allowing the application developers to independently enhance each module without having to be concerned about incompatibilities with other modules. This paradigm of “plug-and-play” (or modular programming) is already well adopted in the development of deterministic simulation models, and our work provides the computational machinery to extend this concept to stochastic simulation models. The future work includes extending this framework to handle more complex reaction networks with stronger heterogeneity and nonlinearity, and coupling scale-dependent heterogeneity within the hybrid UQ framework.
Appendix A: Stochastic Galerkin Projection
 The stochastic Galerkin projection of the Q + 1 polynomial chaos bases onto equation (6) gives rise to a system, where each subproblem (i, j) has the following form:
Here, , and are the effective velocity and dispersion coefficients corresponding to the subproblem (i, j). These quantities can be computed by substituting equation (41) in x and y direction separately as follows:
We assume the dispersivity α to be linear function of a random variable ξ. That is, , in which γ and β are constants, and their values depend on α's uncertainty range. For the dispersion coefficients, we have:
 Due to the orthogonality of the stochastic expansion bases in , the PCE-based stochastic variational problem can be simplified and rewritten in terms of the stochastic global sparse matrices[M] and [K]:
where the stochastic global matrices [M] and [K] are constructed from the deterministic global mass matrices M and stiffness matrices K (assembled from the finite-element method) as follows:
Here, is the stiffness matrix corresponding to each subproblem from the stochastic global problem, and:
is the stochastic concentration field, where denotes the vector of nodal values of the kth stochastic mode of the solution.
 Using the backward Euler method, we can discretize equation (A(4)) in time and rewrite it as:
 Assuming uniform probability distributions for the random variables and , we can exploit the orthogonality of the Legendre polynomial chaos to approximate the mean and variance of the concentration at each grid point i by:
 This research was funded by U. S. Department of Energy Office of Advanced Scientific Computing Research Applied Mathematics Program and performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under contract DE-AC52-07NA27344.