XVIII International Conference on Water Resources CMWR 2010 J. Carrera (Ed) CIMNE, Barcelona 2010 COMPOSITIONAL FORMULATION FOR MULTI PHASE FLOW REACTIVE TRANSPORT IN POROUS MEDIA: AN APPROACH THAT SIMPLIFIES COUPLING BETWEEN PHENOMENA. Pablo Gamazo*, Maarten W. Saaltink* and Jesús Carrera† * Hydrogeology Group, Technical University of Catalonia (UPC) C/Jordi Girona 1-3, 08034 Barcelona, Spain e-mail: pablo.gamazo@upc.es, maarten.saaltink@upc.edu, web page: http://www.h2ogeo.upc.edu/ † IDAEA, Institute of Environmental Assessment and Water Research, Spanish Research Council (CSIC) C/Jordi Girona 18-26, 08034 Barcelona, Spain e-mail: jcrgeo@cid.csic.es, web page: http://www.idaea.csic.es/ Key words: formulation reactive transport, multiphase flow, coupling phenomena, compositional Summary. In this work we discuss coupling difficulties that arises when solving phase and species conservation equations. We present a compositional formulation that avoids these difficulties, and allows solving multiphase reactive transport problems for a generic number of species and reactions. The formulation is illustrated by an example. 1 INTRODUCTION Reactive transport modeling involves the simultaneous study of the conservation of several phenomena. Most general formulations include: conservation of phases (solid and fluids), conservation of species, momentum conservation and energy conservation7. Several variables in these equations are related by constitutive laws that couple these phenomena, increasing the difficulty to solve them. Variables like phase density, viscosity and saturation degree are present in all equations and may be affected by all the states variables of the system1. Reactions relating species form different phases (heterogeneous reaction) also coupled species and phases conservation phenomenon by producing source/sink terms that will affect both. Depending on the individual characteristics of the problem to be solved, there are several ways of dealing with the coupling of these phenomena. For example when changes in linking variables are relatively small during a time step, phenomena can be solved independently and changes in variables may be considered time-laged, or even neglected6,2. In case were these simplification cannot be made (e.g., density driven flow, production of gaseous CO2 and CH4, dry scenarios with evaporation or precipitation of hydrated minerals) interaction between phenomena must be considerd. This implies a significant increment in calculation time and, if all phenomena are solved simultaneously, an increase in size and complexity of the system to be solved. Pablo Gamazo, Maarten W. Saaltink and Jesús Carrera In this work we focus on the interaction between the phase conservation and the species conservation and we present a compositional formulation that avoids coupling problems. Momentum conservation is considered by Darcy’s law and is directly substituted in the other conservation equations. Coupling with energy conservation is not discussed. 2 REACTIVE TRANSPORT COMPOSITIONAL FORMULATION 2.1 Vantages of compositional formulation Most of the reactive transport codes, at our knowledge, consider both conservation of phases and conservation of species. This may be conflictive, because by definition the sum of all conservation equations of species belonging to a phase must be equal to the conservation equation of the phase. Thus, in order to obtain a linearly independent system of equation one species conservation equation should be removed for each phase. When considering phase conservation another difficulty appears which is the phase sink/sources due to heterogeneous reactions in equilibrium. The fact that there is no explicit expression for equilibrium reaction rates increases the complexity of the system to be solved. A compositional formulation eliminates these conflicts by setting out a combination of species conservation equations, avoiding phases4, and eliminating all equilibrium reaction rates terms. Excluding phase conservation equations also facilitates coupling with momentum or energy conservation by reducing the kinds of phenomena to solve. Composition formulation has been used to solve multiphase problems in aquifers and oil reservoirs but normally for a small number of species. In this work we present a general formulation that can be applied to an undefined number of species. 2.2 Proposed formulation We start the formulation introducing a general conservation equation for specie i that belongs to phase Ne ci L ci Se j ,i re j fi (1) t j 1 Where is the volumetric content of phase , ci is mol concentration of specie i ( mol i / m3 ),. L () is the transport operator, Ne is the number equilibrium equations Se j ,i is the stoichiometric coefficient of reaction j for specie i , re j is the reaction rate for reaction j and f i is a source/sink term that contains contributions of kinetic reactions and boundary exchanges of specie i . The L operator consists of L ci ci q jD ,i q Kkr p g 2 ; jD ,i D ci (2) (3) Pablo Gamazo, Maarten W. Saaltink and Jesús Carrera D Ddiff Ddisp ; Ddisp dt q I dl dt q qtr q (4) Were q is the Darcy flow for the phase and jD ,i is the diffusive-dispersive mol flow, Fickean in this case. K is the intrinsic permeability, k r and are the relative permeability and the viscosity of the phase, p is the phase pressure gradient, g is the phase density times gravity, Ddiff is the phase diffusion coefficient, is the tortuosity, I is the identity matrix and dl and dt are the longitudinal and transversal dispersion coefficients. The L operator is null for immobile species, like minerals or adsorbed species. Conservation equations of all species can be represented in a vectorial way θc L c Setr re f t Ll cliquid Were c c gaseous is a vector with the concentration of all species, L L g c 0 immovil (5) is a vectorial operator with the corresponding phase transport operator to each specie, S e is the stoichiometric matrix, and f is a vector with all species source/sink terms. Besides solving species conservation equations, a reactive transport problem implies mass action equations. The latter can be written in a matrix notation as: Se log a log k 0 (6) where S e is the stoichiometric matrix of size Ne (number of equilibrium reactions) x Ns (number of species), k is a vector with the equilibrium constants of all (Ne) reactions ,and a is a vector with the activity of all (Ns) species. The activity of a specie ai (or fugacity for gaseous species) is defined as: ai i xi (7) Were i represents the activity or fugacity coefficient, and xi the molality or partial pressure for a liquid or gaseous specie respectively. We treat mineral species as ideal species, thus its activity is considered equal to one. The set of Ne mass action equations (6) allowed us to obtain an expression to calculate Ne species molality or partial pressure (secondary species) as a function of Ns-Ne species (primary species). As mineral activities are considered equal to one, the number of primary species can be reduced to Ns-Ne-Nme (were Nme is the number of equilibrium minerals). log xsec log γ sec S* log x pri log γ pri log k ' (8) A full description of this procedure and how S * and log k ' are calculates is given by Saaltink et al.5. 3 Pablo Gamazo, Maarten W. Saaltink and Jesús Carrera Equilibrium reaction rate terms re in (5) can be eliminated by linearly combining the mass balance equations. To do so, we define the matrix U (also known as component matrix, (NsNe)xNs ) as: U Ste 0 (9) Multiplying equation (5) times U ensures elimination of all equilibrium reaction rates. It also leads to the definition of components as u U c , which by virtue of (9) become linear combinations of species that are not affected by equilibrium reactions. Multiplying system (5) times U yields to a system of size (Ns-Ne): (10) U θ c U L c U f t When mineral phases are present in equilibrium, Gibbs phase rule indicates that the system looses one degree of freedom for every additional mineral phase. Therefore the definition of components needs to be updated. There are several ways to achieve this goal, depending on the additional properties one may wish for components (see Molins et al.3). Here we will use the approach of Saaltink et al.5, where the initial component matrix U is multiplied by an elimination matrix E ( (Ns-Ne-Nme)x(Ns-Ne), were Nme is the number of mineral in equilibrium) to obtain the reduced component matrix U ' E U (Ns-Ne-Nme)x(Ns). Defining cliquid 0 0 ' ' ' (11) ul U 0 ; u g U c gaseous ; uim U 0 ; f ' U ' f 0 0 c immovil system (10) can be written as: l ul g u g l uim Ll ul L g u g f ' t t t (12) 2.3 Solving variables and secondary variables We set out Ns conservation equations (1) and for each we have the species concentration as unknown. The set of Ne mass action equations (6) and the fact that the mineral activity is considered equal to one, allowed us to obtain all species concentration, except the equilibrium minerals, as a function of Ns-Ne-Nme primary species. This is the dimension of the vectorial component concentration equations (12). As the chemical unit for aqueous species concentration is molality, the liquid h2o specie concentration becomes a constant. This gap in the unknowns can be used to include liquid pressure as a solving variable. Gas pressure can be calculated as the sum of all gaseous pressures, so it can be considered as a secondary variable. Thus, the liquid and gas pressure, which normally are associated to phase conservation, are considered as primary and secondary variables of component conservation, respectively. 4 Pablo Gamazo, Maarten W. Saaltink and Jesús Carrera The vectorial component concentration (12) will be solved considering liquid pressure and Ns-Ne-Nme-1 primary species as solving variables. Aqueous species volumetric concentrations ci can be calculated using the expression: ci l lh2o mi (13) Were mi is the specie molality, l is the phase density and lH 2O is the water mass fraction on the liquid phase. An expression for this last variable can be obtained from the sum of all liquid species mass fraction li : 1 1 m M 1 mli M i lh2o 1 mli M i (14) i i i H 2O i h2o Gas volumetric concentration can be calculated according to the gas model used. For ideal gas model volumetric concentration can be expressed as: p ci , g i (15) RT Were pi is the partial pressure of specie i , R is the universal gas constant and T the absolute temperature. Non equilibrium minerals are always considered as primary species. Equilibrium minerals, (which have been eliminated from the system by multiplying by U ' ), and equilibrium reaction rates re , are calculated from equations (5) after the rest of the species have been solved from equations (12). As the number of unknowns (equilibrium mineral concentrations and reaction rates that is 2Nme) is lower than the number of equations (Ns), some equations may be ignored or least squares techniques could be applied. i l h2 o l i l i h2 o l 2.3 Formulation application For a better understanding of the formulation, we illustrate it by setting the equations for a 2 phase system considering the following equilibrium reactions: H 2Ol H 2Ol N 2 l H OH K H 2Ol H 2O g K H 2O g N 2 g Ca 2 SO42 2 H 2O K N2 (16) gypsum K gypsum The vector of concentrations, components and source/sink terms, and the stoichiometric and reduced component matrix for this system are given in Table 1 5 Pablo Gamazo, Maarten W. Saaltink and Jesús Carrera cl cg cim mH 2 O mH m OH mCa 2 l wlh 2 o mSO42 m N 2l 0 0 0 0 0 0 0 1 0 RT 0 p H 2O g p N 2 g 0 0 0 0 0 0 0 0 0 c gypsum Setr H 2Ol H OH Ca 2 SO 2 4 N 2l H 2O g N 2 g gypsum r4 1 1 0 2 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 2 r1 r2 r3 U' H 1 0 1 0 0 0 1 0 1 0 0 0 0 cH 2Ol cOH 2 cSO42 cH cOH cN 2l cCa2 cSO 2 4 Ca 2 H 2O l ul OH 2 4 SO N 2 l H 2O g N 2 g gypsum 2 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0 f' ug uim cH 2O g 0 c N2 g 0 0 0 0 0 f H 2Ol fOH 2 f SO42 f H 2O g f H fOH f N2l f N2 g fCa2 f SO2 4 Table 1 - vector of concentration, components and source/sink terms, and the stoichiometric and reduce component matrix for this system Substituting component vectors in component conservation equation (12) leads to cH 2Ol cOH 2 cSO42 cH 2Ol cOH 2 cSO42 cH 2O g cH 2O g f H 2Ol cH cOH cH cOH 0 0 l g Lg Ll cN2l cN2l c t t cN2 g N2 g 0 0 cCa2 cSO2 cCa2 cSO2 4 4 6 fOH 2 f SO2 f H 2O g 4 f H fOH (17) f N2l f N2 g fCa2 f SO2 4 Pablo Gamazo, Maarten W. Saaltink and Jesús Carrera One possible set of solving variables are the liquid pressure pl and the molality of Ca , N 2 and H . The rest of species can by calculated by expression (8): mOH OH 1 1 pH 2O g H 2O g 1 0 log log p N2 N2 0 0 m 2 2 2 0 SO4 SO4 mH 2O H 2O K H 2Ol 0 K m 0 H 2O g log H log H (18) mN2 N2 1 0 K N 2 0 1 m Ca2 Ca2 K gypsum 0 0 2 CONCLUSIONS Solving reactive transport problems considering phase conservation implies dealing with source/sink terms that depends on equilibrium reaction rates for which there are no explicit expressions. These terms increase the complexity of the system to solve. We have shown that for cases where Darcy’s Law is considered to represent momentum conservation, a generic multiphase reactive transport problem can be formulated considering only species conservation equation and no explicit phase conservation. The formulation eliminates all equilibrium reaction rates. References [1] V. Freedman and M. Ibaraki. Effects of chemical reactions on density-dependent fluid flow: on the numerical formulation and the development of instabilities. Advances in Water Resources, 25(4):439 – 453, 2002. [2] K. T.B. MacQuarrie and K. U. Mayer. Reactive transport modeling in fractured rock: A state-of-the-science review. Earth-Science Reviews, 72(3-4):189–227, October 2005. [3] S. Molins, J. Carrera, C. Ayora, and M. W. Saaltink. A formulation for decoupling components in reactive transport problems. Water Resour. Res., 40(10):W10301–, October 2004. [4] S. Olivella, A. Gens, J. Carrera, and E.E. Alonso. Numerical formulation for a simulator (code_bright) for the coupled analysis of saline media. Engineering Computations, 13:87–112, 1996. [5] M. W. Saaltink, C. Ayora, and J. Carrera. A mathematical formulation for reactive transport that eliminates mineral concentrations. Water Resources Research, 34(7):1649– 1656, July 1998. [6] M.W. Saaltink, F. Batlle, C. Ayora, J. Carrera, and S. Olivella. Retraso, a code for modeling reactive transport in saturated and unsaturated porous media. Geologicaacta, 2, Nº3:235–251, 2004. [7] C. I. Steefel, D. J. DePaolo, and P. C. Lichtner. Reactive transport modeling: An essential tool and a new research approach for the earth sciences. Earth and Planetary Science Letters, 240(3-4):539–558, December 2005. 7