HAL Id: hal-01516810
https://hal-mines-paristech.archives-ouvertes.fr/hal-01516810
Submitted on 2 May 2017
HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
flow into an existing reactive transport simulator
Irina Sin, Vincent Lagneau, Jérôme Corvisier
To cite this version:
Irina Sin, Vincent Lagneau, Jérôme Corvisier. Integrating a compressible multicomponent two-phase
flow into an existing reactive transport simulator. Advances in Water Resources, Elsevier, 2017, 100,
pp.62-77. �10.1016/j.advwatres.2016.11.014�. �hal-01516810�
ContentslistsavailableatScienceDirect
Advances in Water Resources
journalhomepage:www.elsevier.com/locate/advwatres
Integrating a compressible multicomponent two-phase flow into an existing reactive transport simulator
Irina Sin
∗, Vincent Lagneau, Jérôme Corvisier
MINES ParisTech, PSL Research University, Centre for Geosciences and Geoengineering, 35 rue Saint-Honoré, F-77305 Fontainebleau Cedex, France
a r t i c l e i n f o
Article history:
Received 15 March 2016 Revised 23 November 2016 Accepted 25 November 2016 Available online 27 November 2016 Keywords:
Compressible two-phase flow Reactive transport
Sequential iterative coupling Operator splitting HYTEC Equation of state
a b s t r a c t
Thiswork aimsto incorporate compressible multiphase flowinto theconventional reactive transport frameworkusinganoperatorsplittingapproach.Thisnewapproachwouldallowustoretainthegeneral paradigmoftheflowmoduleindependentofthe geochemicalprocessesand tomodel complexmulti- phasechemicalsystems,conservingtheversatilestructureofconventionalreactivetransport.Thephase flowformulationisemployedto minimizethenumber ofmass conservationnonlinearequations aris- ingfromtheflowmodule.Applyingappropriateequationsofstatefacilitatedprecisedescriptionsofthe compressiblemulticomponentphases,theirthermodynamicpropertiesandrelevantfluxes.
The proposed flowcoupling method was implemented in the reactive transport software HYTEC.
The entire framework preserves itsflexibility for further numerical developments. The verification of thecouplingwasachievedbymodelingaproblemwithaself-similarsolution.Thesimulationofa2D CO2-injectionproblemdemonstratesthepertinentphysical resultsandcomputational efficiencyofthis method.Thecouplingmethodwasemployedformodelinginjectionofacidgasmixtureincarbonated reservoir.
© 2016TheAuthors.PublishedbyElsevierLtd.
ThisisanopenaccessarticleundertheCCBY-NC-NDlicense (http://creativecommons.org/licenses/by-nc-nd/4.0/).
1. Introduction
1.1.Background/motivation
Human activity in the subsurface has been expanding and diversifying(wastedisposal,miningexcavationandhigh-frequency storage of energy), and the public and regulatory expectations havebeenincreasing.Theassessmentofeachstepofunderground operations, including environmental impact evaluation, relies on elaborate simulators and leads to an urgent need to develop multiphysicsmodeling.Reactivetransport,ageochemicalresearch and engineering tool, is used in multicomponent systems and sophisticated chemical processes (activity andfugacity correction accordingto different models, mineral dissolution and precipita- tion,cation exchange, oxidation and reduction reactions, isotopic fractionation and filiation), in addition to gas evaporation and dissolution(vanderLeeetal.,2003;Mayeretal.,2012;Parkhurst andAppelo,1999;Steefel,2009;Yehetal.,2004).Multiphaseflow is based on broad experiences in reservoir engineering research, includingthethermodynamic modeling ofcomplex phase behav- ior. In particular, the equations of state were used to simulate
∗ Corresponding author.
E-mail address: [email protected] (I. Sin).
and study interfacial tension, gas, steam and alkaline injection inoil reservoirs andenhanced oilrecovery (Delshadetal., 2000;
Farajzadehetal.,2012;Nghiemetal.,2004;Wangetal.,1997)..
Thisworkaims toincorporateacompressiblemultiphase flow moduleintoan existingreactivetransportsimulator.Ourcoupling methodshouldthereforemeetthefollowingrequirements:
1. The new approach should handle the different complex mul- tiphasechemical modelsandretain thegeneralparadigmofa multiphase flow moduleindependent of thegeochemical sys- temandconservetheconventionalreactivetransportstructure;
2. The numberof mass conservationnonlinear equations arising fromtheflow module should beminimized such thatthe re- duced flow system preserves the matrix structure and mini- mizesthecomputationalintensity;
3. The entireframework should preserve its flexibility for possi- blenon-isothermal,geomechanical anddomaindecomposition developmentsinthefuture.
Reactivetransport methodshavebeen extensivelyinvestigated overthe pasttwo decades (seebelow). Thiswork focusesonthe coupling between multicomponent multiphase flow (MMF1) and
1The nomenclature is provided in Table 1 . The abbreviations are detailed in Table 2 .
http://dx.doi.org/10.1016/j.advwatres.2016.11.014
0309-1708/© 2016 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license ( http://creativecommons.org/licenses/by-nc-nd/4.0/ ).
Table 1 Nomenclature.
Latin symbols
a k activity of potential catalyzing or inhibiting species A s specific surface area, [ m 2/ m 3solution ] or [ m 2/ kg mineral ] c l,k total liquid mobile concentration of basis species k , [ mol / kg w ] c s,k immobile concentration of basis species k , [ mol / kg w ] c g,m gas concentration of basis species m , [ mol / m 3] C i concentration of primary species i in chemical module d dissolution parameter of transport model
dt time step
D α molecular diffusion coefficient of phase α, [ m 2/ s ] D eα effective diffusion coefficient of phase α, [ m 2/ s ] D α diffusion-dispersion tensor of fluid phase α e evaporation parameter of transport model
f iα fugacity of species i in phase α F residual function
g gravitational acceleration vector, [ m / s 2]
J Jacobian
k number of iterations in flow coupling k kin kinetic rate constant in , [ mol / m 2/ s ]
k maxf l maximum number of iterations in flow coupling
k rtmax maximum number of iterations in reactive transport coupling k rα relative permeability of phase α
K intrinsic permeability, [ m 2] K intrinsic permeability tensor, [ m 2] K i K-value/equilibrium ratio K j equilibrium constant of reaction j
K s equilibrium solubility constant of solid phase K ih Henry’s law constant
M · molar mass of species ·, [ kg / mol ] n α quantity of matter in phase α
n normal vector
N c number of primary species in chemistry module N f number of fluid phases α
N g number of gas species N kin number of kinetic reactions N Nit number of Newton iterations N Pit number of Picard iterations N p number of phases
N r number of independent chemical reactions N s number of species in chemistry module p α liquid/gas pressure, [ Pa ]
P pressure, [ Pa ]
P c set of the critical pressures q α mass source term of phase α, [ kg / s ]
q α,k mass source term of species k in phase α, [ kg / s ] q g,m source term of basis species m in the gas phase, [ mol / m 3] q l,k source term of basis species k in the liquid phase, [ mol / kg w ] Q s ion activity product
r αβ reaction term of phases αand βin αtransport operator R gas constant, [ J / K / mol ]
R α reaction term of phase α, [ kg / s ]
R α,k reaction term of species k in phase α, [ kg / s ]
R g,m reaction term of basis species m in the gas phase, [ mol / m 3] R l,k reaction term of basis species k in the liquid phase, [ mol / kg w ] R geochemical reaction operator
S j concentration of species j in chemical module S α saturation of phase α
t calculation time of entire system per time step t fl calculation time of flow operator per iteration t flc calculation time of flow coupling per iteration t gt calculation time of gas transport operator per iteration t rtc calculation time of reactive transport coupling per iteration T temperature, °C and K
T i total concentration in chemistry module T c set of the critical temperatures T α transport operator of phase α u α Darcy’s velocity of phase α v molar volume, [ m 3/ mol ]
V α volume of porous space occupied by phase α, [ m 3] V tot total volume, [ m 3]
x i mole fraction of basis species i in the liquid phase X α,k mass fraction of basis species k in phase α x vector of primary variables of the flow system y i mole fraction of basis species i in the gas phase
Table 1 ( continued ) Latin symbols
Z compressibility factor
Z c set of the critical compressibility factors Greek symbols
α= {l, g} liquid/gas phase αij stoichiometric coefficient γj activity coefficient
matrix of binary interaction coefficients of PR EOS εg gas quantity tolerance in reactive transport coupling εNf residual function tolerance in flow coupling εqss quasi-stationary state tolerance in flow coupling εrt tolerance in reactive transport coupling μα viscosity of phase α, [ Pa ·s ]
ρα mass density of phase α, [ kg / m 3]
ραg density of phase αin the gravity term, [ kg / m 3] τα tortuosity of phase α
φ porosity
ϕiα fugacity coefficient of species i in phase α ψα volumetric rate of phase α, [ m 3/ s ]
acentric factor set
T α mathematical transport operator of phase α
·∞ infinity norm
1 R>0(·) indicator function of the set of strictly positive real numbers
Table 2 Abbreviations.
AIM adaptive implicit method
CFL Courant-Friedrichs-Lewy number
DAE differential algebraic equations based method
DSA direct substitution approach
EOS equation of state
FIM fully implicit method
FVM finite volume method
GIA global implicit approach
IMPEC implicit pressure/explicit concentration
MMF multiphase multicomponent flow
MMRF multiphase multicomponent reactive flow
ODE ordinary differential equations based method
PDE partial differential equation
OSA operator splitting approach
RT reactive transport
SI saturation index
SIA sequential iterative approach
SNIA sequential non-iterative approach
TPFA two-point flux approximation
reactivetransport(RT)modules andstartsbysurveyingtheexist- ingapproaches
1.2.Areviewofmultiphasemulticomponentflowandreactive transportcodes
1.2.1. OperatorsplittingalgorithmsbetweenMMFandRT
Thestrengthoftheoperator-splittingapproach (OSA)(sequen- tial iterative(SIA) or sequential non-iterative(SNIA)) arises from the framework flexibility, which allows each model to be devel- opedandverified independently.Theseare importantreasonsfor selecting the OSA for the coupling between MMF and RT, par- ticularly when extending a hydrogeochemical code from single- to two-phase flow. The following codes apply the OSA: Code- Bright(Olivella etal., 1996) (coupling withthe reactivetransport code RETRASO (Saaltink et al., 2004)), DuMuX (based on DUNE) (Ahusbordeetal.,2015;Vostrikov,2014),DUNE(Hronetal.,2015), HYDROGEOCHEM(unsaturated)(Yehetal.,2004,2012),iCP(Nardi etal.,2014),IPARS(PeszynskaandSun,2002;Wheeleretal.,2012), MIN3P(thebubblemodel)(Mayeretal.,2012;MolinsandMayer, 2007),MoReS(Farajzadehetal.,2012;Wei,2012),NUFT(Haoetal., 2012), PFLOTRAN (Lichtner et al., 2015; Lu and Lichtner, 2007),
STOMP(Whiteetal.,2012;WhiteandOostrom,2006),TOUGHRE- ACT(XuandPruess,1998;Xuetal.,2012),andUTCHEM(Delshad etal.,2000);seealso(Steefeletal.,2014).
Thesimulatorsareprimarilybasedonthefinitevolumemethod (FVM)becauseofitsconservativeproperties.Thegeneraltendency incouplingistofirst(non-)iterativelysolvetheflowtoobtainthe velocities.Thecompositionalformulationistypicallychosen,oral- ternatively,theconservationequationscanbesolvedforthedom- inantcomponents(e.g.,water/air).Whenthe two-phaseflowsys- teminvolvesonly two components (e.g.,H2OandCO2),the final setsofequationsforthecompositional anddominantcomponent formulationsareidenticalandreducetothemassconservationfor eachcomponent.
Once the flow is established, the RT part can be solved us- ing the OSA (SIA, SNIA or predictor-corrector); a global implicit approach (GIA), such as the ordinary differential equation-based method(ODE, thechemistry moduleis usedas ablack box), the directsubstitutionapproach(DSA)(Saaltinketal.,2001)orthedif- ferential algebraic equation-based method (DAE) (de Dieuleveult, 2008; de Dieuleveult et al., 2009). The OSA and GIA applied to RTare compared in Carrayrou etal.(2010); de Dieuleveult etal.
(2009); Saaltink etal., (2001); Steefel andMacQuarrie (1996). In 2001,Saaltink etal.(2001) reportedthat SIA wasmorefavorable thanDSAincasesof largegrids andlow kineticratesbecause of thehigh computer storage requirements and slowlinear solvers.
Adecadelater,theMoMaSbenchmarkconfirmedthereliabilityof bothapproachesandtheenhancedcomputational potentialofthe DSAwiththereductiontechnique(KräutleandKnabner,2007).
1.2.2. FromglobalimplicitalgorithminRTtoglobalimplicit algorithminMMF&RT
The advantageofGIA isits accuracy,although itcomes atthe costofcomputational resources.However, thismethodis becom- ing more competitive because of increases in computer capabil- ities and advances in the methods that allow reducing the sys- temofequations.Additionally,reservoirsimulatorstypicallyutilize theglobal formulationfor the MMF problemcombined withthe fullyimplicitmethod(FIM)ortheadaptiveimplicitmethod(AIM), whichunifies theFIMandimplicitpressure/explicitconcentration (IMPEC).TheycanthereforebenaturallyextendedtotheRTusing GIA,e.g., COORES2, GEM-GHG (Nghiem etal., 2004), GPAS(Pope etal.,2005),andGPRS(Cao,2002;Fanetal.,2012).
For the global implicit solution of the RT, several techniques havebeen proposedtoreduce theinitial massbalancesystemby linearcombinationandeliminate the reactionterms inthe equi- libriumreactions(KräutleandKnabner,2007;Molinsetal.,2004;
Saaltink etal., 1998). Such modifications of the DSA forRT lead tomathematicaldecouplingoftheentiresystemandconsequently makeit interestingforthe globalimplicitcouplingofmultiphase flowandreactive transport, asrecentlydemonstratedby Saaltink etal.(2013) andFanetal.(2012).Saaltink etal.(2013)proposed amethodforintroducing thechemistrycalculationsto aconven- tionalmultiphasesimulatortominimizethenumberofmasscon- servationequationsbytakingthefluidphasepressuresandporos- ity as primary variables and expressing all secondary variables (suchascomponentconcentrations,fugacity,pH,andsalinity)asa polynomialfunctionofgaspressure,whichrequirespre-processing priorto eachapplication. Fanetal.(2012) employed theelement balanceformulation(MichelsenandMollerup,2007)viareduction techniques(Kräutle and Knabner,2007; Molins et al., 2004) and the decoupled linearized system on the primary and secondary equations. Saaltink et al. (2013) demonstrated that the GIA and OSAprovided similar results for CO2 storage andconcluded that thefullcouplingwasnotnecessaryforMMF&RTmodelingfroma
2A. Michel and T. Faney, personal communication , 2015
physicalperspective,althoughtheOSAcanbe morecomputation- allyexpensive.
Moreover,Gamazoetal.(2012) highlightedthe significantim- pact of geochemical reactions on the phase fluxes by modeling gypsumdehydration when thenon-isothermal flow is chemically restrained,i.e.,theanhydrite-gypsumparagenesiscontrolsthewa- ter activityandhencetheevaporationprocess. Theimportanceof DSA,whichimplicitlyconnectstheequilibriumheterogeneousre- actions and the phase flow, was emphasized compared with the decoupled formulation of the flow and the RT: the decoupled formulation overestimatesthe evaporation, butits computational timewasreducedby22.5%(comparedtoDSA).However,thedef- initionsof wateractivityandliquiddensity weredifferent inthe GIA’s andOSA’smodels.Furthermore,the decoupled flowsystem contained the conservation equations for dominant components (water and air), but the coupling between flow and RT was not specified. Given the nature of the formulations describedin this work,itislikelythatusingthestrongOSA(theSIA-basedconnec- tionbetweenflow andRTwiththeprecisereactiontermsinflow equations)wouldyieldresultssimilar tothoseofDSAatthecost ofadditionaliterations.
1.3. PreambletoanewMMF&RTcouplingapproach
Toreduce thenumberofnonlinearequationsarising fromthe flow system, the formulation of the dominant components was considered.Thisapproachisefficientwhentheimpactoftheother speciesis negligible.Ingeochemicalproblems,the speciation can vary largely over time and space. Ideally, the dominant compo- nentsshouldbeadaptedlocallytopreserve theaccuracy,butthis wouldrequirespecifictreatmentoftheglobalflowsolution.
Iftheflowsystemexpandssuch thatmanyspeciesplaysignif- icant roles in the thermodynamic state and phase displacement, thenthenumberofnonlinearequationsofcompositionalflowin- creaseswiththenumberofcomponents,whichiscomputationally expensive.
Despitethereductiontechniques,theprimarynonlinearsystem mustbecalculated.Ingeochemicalmodeling,whichincludescom- plex homogeneousandheterogeneousreactions,the primary(ba- sis)speciestypicallychangesspatially andtemporally.Thesystem of equations is therefore redefined,which requires modifications oftheJacobianstructurewithinNewton’smethod.Thesolutionof thetransportlinearsystemcanbeseveralorevenahundredtimes fasterthanthatofmultiphaseflow.
Tominimize thesize ofthenonlinearsystem, itis possibleto replace the compositional formulationby the phase formulation.
ThephaseflowcoupledtotheRTwasemployedbyPeszynskaand Sun(2002).Giventheirproblemconditions(slightlycompressible fluidsand density-independent flow), theauthors divided the RT intothreestages(advection,reaction,anddiffusion)withinthein- ternaltimestepsbyinterpolatingthefluxesandsaturations.Later, Hronetal.(2015)simulatedEscherichiacoli growthandtransport underaerobicandanaerobicconditionsviathesequentialcoupling of phase flow and the SNIA-based RT. The liquid fluid was as- sumedtobeincompressible,whereasthegasdensitywascompo- sitiondependent.Intheadvective-dominantregime,thetransport wassolvedexplicitlyinatimethat ledtoatime steprestriction:
CFL =0.4; thus, the split transport time step was applied. Note that the same issuearises fromthe IMPECscheme inwhich the componentequationsaresolvedexplicitly.
1.4. Ouralternativemethod
Thisworkproposesanewapproachforincorporatingthecom- pressibletwo-phaseflowinaconventionalreactivetransportsim- ulator.Itisbasedonthephaseflowformulationandpreservesall
the sustainability and facilities of the reactive part.This method builds on theunconditional stabilityof thefully implicitscheme andcanmodeladvective-dominantanddensity-drivenregimes.
The following simplifications are considered in this work:
isothermalflowandnogeomechanics.Themethodwasappliedto the(SIA)reactivetransportsimulatorHYTEC(Lagneauandvander Lee, 2010b;van der Leeet al., 2003). The HYTEC code hasbeen widely evaluated in several benchmark studies (Carrayrou et al., 2010; Lagneau and van der Lee, 2010a; Trotignon et al., 2005;
deWindtetal.,2003)andnumerousapplications,suchascement degradation(deWindtandDevillers,2010),radioactivewastedis- posal(Debureetal.,2013;deWindtetal.,2014),geologicalstorage ofacidgases(Corvisieretal.,2013;Jacquemetetal.,2012;Lagneau et al., 2005), and uranium in situ recovery processes (Regnault etal.,2014).
InSection2,aconcisedescriptionofthegoverningequationsof multicomponent multiphase flow andreactive transport is given.
Next, the proposed coupling methods are detailed in Section 3. Section 4 presents the method’s applicability and computational performance, firstusinga benchmarkproblemwitha self-similar solution and then for modeling 2D CO2 injection. Section 4 also illustrates aproblemofacidgasinjectionincarbonatedreservoir.
TheconclusionsarepresentedinSection5.
2. Governingprocessesandmathematicalformulation
Thestandard entireisothermal MMRFproblemiscomposedof componentcα,kmolconservation,massbalance,mass-actionlaws and other constitutive relations. The total number of phases is Np=3,wherethesolidphaseisimmobileandtheNffluidphases
α
are mobile (liquid andgas). The chemical system ofNs chem-ical speciesandNr linearlyindependent chemical reactionsrelies onMorel’smethod(MorelandHering,1993)ofNcprimaryspecies thatformabasisforallNsspecies:Nc=Ns−Nr.
2.1. Massconservationforeachphase
Wefirstintroducethestandard multiphasecompositionalflow problem and the physical parameters, and then we present the phasemassconservationformulationanditsadvantages.Letusbe- ginwiththegeneralmassconservationintermsofthemassfrac- tionXα,kofspecieskinfluidphase
α
thatformsNcNfequations:∂ ( φ
Sαρ
αXα,k)
∂
t =−∇
·( ρ
αXα,kuα−ρ
αDα∇
Xα,k)
+Rα,k+qα,k, (1) whereφ
istheporosity,Sα isthesaturationoffluidphaseα
,ρ
αis themass densityoffluidphaseα
,uα is theDarcy-Muskatveloc- ityoffluid phaseα
,Dα isthediffusion-dispersion tensoroffluid phaseα
. The classical Fick’s law is used forthe diffusion coeffi-cients Dα that are then scalar and independent of composition;
foreach phase
α
, thediffusioncoefficient should beidentical forall species to preserve the consistency of system (Hoteit, 2011).
In thiswork, the dispersion term isneglected. Consequently, the diffusion-dispersion tensorDα transformsinto theeffectivediffu- sionDeα=
φ
SαDα.Rα,kisthereactionterm, andqα,k istheexter- nal sourcetermof speciesk influid phaseα
. The Darcy–Muskat law(Muskatetal.,1937)statesthatuα=−krα
μ
αK( ∇
pα−ρ
αg)
, (2)wherekrα,
μ
α andpα are therelativepermeability, viscosityand pressureoffluidphaseα
,respectively.Kistheintrinsicpermeabil- itytensor,andg isthegravitationalaccelerationvector. Thepres- suresareconnectedbyNf−1capillarypressurerelations,andthe saturationsandmassfractionssumto1:α
Sα =1, (3)
k
Xα,k=1. (4)
Thus, an additional 2Nf constitutive relations are generated. The conventional PDE systemofisothermal compositional multiphase flow can be expressed using (1) by deriving the conservation of each species k in all phases
α. These Nc nonlinear equations, 2Nf constitutive relations andNc
(
Nf−1)
phase equilibrium rela- tions(Section2.3) yield2Nf+NcNf equations for2Nf+NcNf un- knowns pα, Sα andXα,k. According to the Gibbs phase rule, the number of intensive properties is Nc−Np+2. If the number of phases is locally known, then Np=2 for fixed temperature, and at least Nc nonlinear equations (e.g., pressure and composition (Jindrová and Mikyška,2015)) canbe solved to establish the ther- modynamicstate.Notethatthegeochemicalsystemcanbeabun- dantinspecies,implyingthatconsiderablylargenonlinearsystems mustbesolved.Inthiswork, we propose handlinga phasemass conservation system of Nf PDE whose size is independent of the number of chemicalspeciesNs.Weapply
kto(1)toobtain
∂ ( φ
Sαρ
α)
∂
t =−∇
·( ρ
αuα)
+Rα+qα, (5) takingintoaccountthatthesumofdiffusivefluxesforeachphaseα
isequalto0becausethediffusioncoefficientsDα areequalover all components in each phase. The external source term qα can alsobepresentedasqα=
ρ
αψ
α, (6)where
ψ
α isthe volumetricrate. Thesystem (5)ofNf equations, Nf−1capillarypressurerelationsand(3)isassembledfor2Nfun- knowns,pαandSα,whicharenaturalvariablesofmultiphaseflow problems.When one of the phases disappears, the corresponding equa- tion of system (5) degenerates, and the natural variables are no longerappropriatefordescribingthesystem.Inthiscase,wemove tothesingle-flowproblem.Numerousformalismsarededicatedto thetwo-component, two-phase flow and associatedphase disap- pearance/appearance(AbadpourandPanfilov,2009;Angelinietal., 2011;Bourgeatetal.,2013;Lauseretal.,2011;Massonetal.,2014;
Pruessetal., 1999). In thiswork, the liquidphase isassumed to be present throughout the system, even if it is present in small amounts. The liquid pressure and gas saturation are chosen as primary variables. Therefore, solving the system of Nf nonlinear Eq.(5)canbe beneficial when Nc > Nf.Althougha semi-implicit methodIMPEC is usedto reduce thenumber ofnonlinear equa- tions to be solved simultaneously (Hoteit and Firoozabadi,2006;
Mikyška and Firoozabadi, 2010), time stepping is constrained by theCFL condition. Alternatively,an implicit methodofdecoupled systemhasbeen proposed inZidane andFiroozabadi (2015). The authorssolveimplicitlythespeciestransportcoupledwiththeto- talfluxcalculatedbythemixedfiniteelementmethod.
2.2.Moleconservationforeachgascomponentandprimaryspecies
TheliquidandgasphasesconsistofNc primaryspeciesandNg gas species, respectively, Ng < Nc, for which the transport must besolved.Wechosethetransportformulationintermsofconcen- trationscα,k∝
ρ
αXα,k/Mk,where Mk is themolarmass ofspecies k. Deriving the transport equations in mole/massfractions, as in Eq.(1),thedensitydeviation∇ρ
α/ρ
α thatarisesfromthediffusive partoffluxisneglected. Basedonthe primaryspeciesformalism (vanderLee, 2009;Lichtner, 1996;SteefelandMacQuarrie,1996;YehandTripathi,1991),theliquidtransportisdefinedforthetotal
liquidmobileconcentration cl,kof primaryspecies kandthe gas transport forthe gas concentration cg,m ofgas species m, which yieldsNc+Ngtransport(linear)equations:
∂φ
Slcl,k∂
t =−Tl cl,k+Rl,k
cl,k,cs,k
+ql,k, (7)
∂φ
Sgcg,m∂
t =−Tg(
cg,m)
+Rg,m(
cg,m)
+qg,m, (8)wherecs,kistheimmobileconcentrationofspeciesk,operatorTα includestheadvectivefluxpresentedbytheDarcy–Muskatlaw(2), andassuming non-Knudsendiffusion, Fick’slawfordiffusive flux yields(Lichtner,1996;deMarsily,2004):
Tα
cα,k
=∇
·(
cα,kuα−Deα∇
cα,k)
, (9) whereDeα caninvolvethetortuositycoefficientτ
α(Millingtonand Quirk,1961).2.3.Molebalanceforeachprimarybasisspecies
The chemical equations arise from the mass action law and phase equilibrium relations. As mentioned above, the reactive transport code isbased on the primary speciesformulation, and thus,we denotetheconcentration ofspeciesSj, j=1,...,Ns,that canbeexpressedasafunctionofbasisspeciesCi,i=1,...,Nc: Sj
Nc
i=1
α
i jCi, (10)where
α
ijisthestoichiometriccoefficient.Atequilibrium,themass actionlawprovidesthereactionaffinity:Sj=Kj
γ
jNc
i=1
( γ
iCi)
αi j, (11)where
γ
j isthe activity coefficient andKj isthe thermodynamic equilibriumconstant ofreactionj.All aqueousreactions are con- sideredtobeatequilibrium.Foreachbasisspecies,themolebal- ance can be written in terms of the total concentration Ti, i= 1,...,Nc,Ti=Nsj=1
α
jiSj, Ti−Ci−Ns
j=1,j=i
α
jiKj
γ
j Nc
i=1
( γ
iCi)
αi j=0, (12)constitutingasystemofNcequationsonCi,i=1,...,Nc.
2.3.1. Liquidmixtures
In non-ideal liquid mixtures, the activity coefficients
γ
i are not trivial and can be calculated using different models whose complexityincreaseswiththeconcentrationofsolution,fromless tomoreconcentratedsolution: truncatedDaviesformula(Colston etal.,1990),B-dot(Helgeson,1969),SIT(Grentheetal.,1997),and Pitzer(1991).2.3.2. Gas-liquidequilibrium
Thechemicalpotentialsandcorrespondingfugacitiesofspecies i in mixture fiα are equal under equilibrium conditions. The fugacity-activity(
ϕ
−γ
)approachyieldsPyi
ϕ
ig=fi=Kihγ
ixi, (13) where yi is the mole fraction of species i in the gas phase,ϕ
igis the fugacity coefficient of species i, Kih=Kih
(
T,P)
is the cor- rectedHenry’sconstant ofspeciesi,γ
iistheasymmetric activity coefficient ofspecies i (Michelsen andMollerup, 2007),and xi is themolefractionofspeciesiintheliquidphase.Kihincludes the Poyntingfactor,whichcorrectsthereferencefugacitywithrespect to the pressure and is near unity at low to moderate pressures.The fugacity coefficients can be calculated using the equation of state(EOS).WechosethePeng–RobinsonEOS(RobinsonandPeng, 1978),whichprecisely reflectsthe gasmixturepropertiesathigh pressures/temperatures. For a given P, the cubic equation should besolved forthecompressibilityfactorZ=P
v
/RT,wherevisthe molarvolume.Thefugacitycoefficientisthencalculatedasfollows (RobinsonandPeng,1978):ϕ
ig=ϕ
ig(
T,P,Z,Tc,Pc,Zc,,
)
,where Tc,Pc,andZcarethesetsofthecriticaltemperatures,criticalpres- suresandcompressibilityfactorsofthespeciesinthemixture,re- spectively.istheacentricfactorset,and
isthematrixofem- piricalbinaryinteractionparametersforeachpairofspeciesinthe mixture.
TheEOSalsoprovidesthemassdensityforgasmixtures:
ρ
g=Ng i=1yiMi
v
=M¯
v
, (14)and,byanalogy,forliquidmixtures:M¯=Nc i=1xiMi.
NotethatRaoult’slaw(Pyi=Psatxi)isderivedfromEq.(13),as- suminglowpressureconditionsandidealsolutions.
2.3.3. Liquid-solidequilibriumandkineticrelations
For minerals under the thermodynamic equilibrium assump- tion,thesolubilityconstantKs,jcanbederivedfromthemassac- tionlaw.The mineralactivityisunityby convention.Byomitting theindexj,Eq.(11)yieldstheexpressionfortheequilibriumsolu- bilityconstantforsolids
Ks=
Nc
i=1
( γ
iCi)
αi j. (15)Whenthereactions arekineticallycontrolled,theratelawcan be described, e.g., by the transitionstate theory (Lasaga, 1984). The model uses the ion activity product Qs, which by definition be- comesKsatequilibrium,andthesaturationindex(SI):
SI=log
QsKs
= <0 undersaturated→dissolution,=0 saturated→equilibrium,
>0 oversaturated→precipitation.
(16)
Underthetransitionstatetheory,thekineticratelawisthen
dS dt =Askkin
sign
(
SI)
Qs
Ks
b1−1
b2k
ankk (17)
where As is the specific surface area; kkin is the kinetic dissolu- tion/precipitationrateconstant;b1,b2,andnkare fittingparame- ters;andakistheactivityofthepotentialcatalyzingorinhibiting species.
Themolebalanceequationswiththemassactionlawsforthe speciesat equilibrium, theratelaws forkinetically limitedsolids and phase equilibrium relations constitute a complete system of algebro-differentialequationswhosesolutionyieldstheconcentra- tionsofbasisandsecondaryspecies.Otherchemicalreactionscan alsobehandledby theformalismofbasis species,e.g.,cationex- changeandsurfaceandorganiccomplexation.
3. Numericalsolution
Applying the OSA to subsurface environmental modeling en- ablestheindependentdevelopmentofseparatedmodulesofcode andtherigoroussolutionofeach.Consequently,themajorityofRT simulators rely on the OSA(Steefel etal., 2014). The assessment ofdifferentcouplingmethodswasstudiedfortheMoMaSbench- markofRT codes(Carrayrouetal., 2010;Carrayrou andLagneau, 2007),duringwhichthereliabilitiesofboththeSIAandGIAwere determined, and the detailed results of HYTEC were reported in LagneauandvanderLee(2010a).Followingthegeneralstrategyof integratingthe(un)saturatedflow inRTcodes byOSA,we solved
thecompressibletwo-phase flowblockfirst.Thisprocessinvolved theflowsystem,thegastransportequations,andtheEOSandfluid property models. Then, reactive transport coupling was applied.
WeproposeemployingSIAforeachmodule,andhence,twointer- nalSIA-basedcouplingsexist.Letusdescribetheappliedmethods forflowandtransportdiscretizationandthesubsequentcoupling methods.
3.1. Discretizationofflowandtransport
The discretization of mass phase conservation (5) and mole species transport (7),(8) isconstructed based on a Voronoi-type finitevolume method.The timeapproximation oftwo-phase flow (5) is fully implicit, and the fluxes are handled by TPFA. In the 1960s, thetransmissibilitydiscretization wasdemonstratedto af- fect the numerical stability and accuracy (Allen, 1984; Blair and Weinaug, 1969; Settari and Aziz, 1975); in this work, the inter- face coefficients of flow between adjacent cells were evaluated implicitly and upstream. Forthe relative permeability(krα)ij, the upstream spaceapproximationiswidely usedbecauseits conver- gence wasconfirmedfortheBuckley–Leverett problem(Aziz and Settari,1979;Bastian,1999).Thedetailedcomparisonoftemporal discretizationpresentedinAzizandSettari(1979);BlairandWein- aug (1969) demonstrated the stability advantagesof the implicit upstream treatmentrelative toexplicitonesbutalsoreportedin- creasedtruncationerrors.Wewilldiscusstheimpactoftruncation errorsinSection4.1.Therelativepermeabilitykrα,intrinsicperme- abilityK,phasedensity
ρ
α,andphaseviscosityμ
α oftheinterface coefficientsbetweenadjacentcellsi,j atiterationk+1arethere- foredefinedas(
·)
ki j+1=(
·
)
ki ifukαni j>0,(
·)
kj else (18)wherenijisthenormalvectorfromitoj.
The discretizationofdensity
( ρ
gα)
i j in thegravitytermρ
αg is treateddifferentlyandweightedrelativetotheeffectivephasevol- ume. If thegas phase isabsent in one ofthe cells, thenthe up- streamtreatmentisapplied(Coats,1980):( ρ
αg)
i j=⎧ ⎨
⎩
ρ
α,iσ
+ρ
α,j(
1−σ )
if(
Sα,i>0)
∧(
Sα,j>0)
:σ
=Vα,i/(
Vα,i+Vα,j)
;( ρ
α)
i j else(19)
whereVα=
φ
SαVtotandVtotisthevolumeofthecell.Theresulting nonlinear system can be solved using Newton’smethod with an analyticalJacobian,aspresentedinSection3.2.The space discretization of transport operators (7) and (8) is achieved byupstream weighting for advectiveflux andharmonic weightingforeffectivediffusion.Thesemi-implicitmethodischo- senforthetimediscretization:theimplicitEulerschemeisapplied forthediffusiveflux,whereastheadvectivepartisdiscretizedus- ingtheCrank–Nicolsonmethod.
3.2. Coupling1:compressibletwo-phaseflow
Because the phase flow system (5) is nonlinear, the classic Newton’smethodisapplied.Wedenote thediscretizedEq.(5)as F
(
x)
=0,wherex=(
pl,Sg)
.Whenthefluidsarehighlycompress- ible(e.g.,thegasphase),thedensitypropertiesshouldbeprecisely evaluated ateach deviationoftheintensive variablesP, V, andn, where n is the quantity of matter. To ensure the implicit treat- ment ofinterfacecoefficients, the densityis updatedin Newton’s loop,similar totheother flowparameters.However, thegasden- sitymaybe stronglydependentonitscomposition. Therefore,the gas composition must be calculated by employing the gastrans- port(8)denotedbyTg(
cg;x)
=0.Thisisparticularlyimportantformodelingthegasappearanceanddisappearance.Theflowcoupling algorithmfortimestepn+1ispresentedinAlgorithm1,andits parsingisgivenbelow.
Algorithm1 Newton’smethodforflow.
1:
ε
N f=1×10−6 2:ε
qss=1×10−24 3: kmaxf l =9 4: k=05: while
F
(
xk)
∞≥ε
N fF(
x0)
∞∧
F
(
xk)
∞≥ε
qss∧
k≤kmaxf l
do
6: find
δ
xk+1:J(
xk) δ
xk+1=−F(
xk)
7: xk+1←xk+
δ
xk+18: findckg+1:Tg
(
ckg+1;xk+1)
=0 9: updateEOSandphysicalparameters 10: k←k+111: endwhile
The user-defined or default tolerance
ε
Nf (Section 3.4.3) and maximumnumberofNewtoniterationskmaxf l fortheflowcoupling areinitializedfirst.Next,thelinearizedsystemissolvedforthein- crementδ
xatline6.AllthepartialderivativesinvolvedintheJa- cobianJofthediscretizedflowsystemareanalytical.Forexample, thederivative ofthegasdensityinterface coefficientis expressed as∂ ( ρ
g)
i j∂
pg,i =∂ ( ρ
g)
i j∂ρ
g,i∂ρ
g,i∂
pg,i,∂ρ
g,i∂
pg,i =− M¯iv
2i( ∂
pg/∂ v )
i, (20)
where
∂
pg/∂
v is the analytical derivative arising fromthe corre-sponding EOS. Note that the density derivatives are composition dependent and proportional to the average molecular weight M¯ andthe densityfunction Eq.(14).Variousmethodsexistforsolv- ingmultiphasesystemsoflinearequations(Chenetal.,2006);we apply GMRES(Saad andSchultz, 1986),which isone ofthemost prevalent and efficient methods, with ILU(0) (van der Vorst and Meijerink,1981)asapreconditioner.
Usingthevelocitiesandsaturationsgivenbyxk+1 fromstep7, thelineartransportsystemTg
(
ckg+1;xk+1)
=0issolvedforckg+1at line8withGMRESandILU(0).Becauseofthe modifiedcomposi- tion,theEOSparametersmustbeupdatedtoevaluateanewmolar volumevbysolvingtheEOSanalytically.Then, thephysicalprop- erties can be calculated at line 9. Thereafter, three stop criteria mustbe checkedatline 5:two forthe flow systemresidualand oneforthenumberofiterations.TheproposedcouplinginAlgorithm1correspondstoNewton’s familyfortheflowsystemregardingxk+1,whereasitcanbecon- sideredasPicard’s method(fixed-pointmethod)forthetransport equationsonckg+1.Giventhatthegasphaseissupposedtobecom- pressible and that significant differences in gas density may oc- curthroughoutthemodeleddomain,anadditionalcriterionforgas quantityngdeviationcanbeincluded:
max
nkg+1−nkgnkg+1
≤
ε
g, (21)wheremax isthemaximumvalueoverthemodeleddomain.After numeroustests, wededucethatthismaynotbeanecessarycon- ditionbutissufficienttofinishtheloopthatdependsonthecom- plexityofgasdynamics.Despiteneglecting thecriterion(21),the solution’s accuracyis not lacking. In addition, the reactive trans- portcouplingdescribedinSection3.3,whichfollowstheflowcou- plinginAlgorithm1,entailstheconvergence(stop)conditionsfor the gasand solid phasesand guarantees the conservationof the entiresystem.