science lot a changing world
User's Guide to PHREEQC (Version 2) A Computer Program for Speciation, Batch Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations
Water-Resources Investigations Report 99-4259
U.S. DEPARTMENT OF THE INTERIOR U.S. GEOLOGICAL SURVEY U.S. DEPARTMENT OF THE INTERIOR U.S. GEOLOGICAL SURVEY
USER'S GUIDE TO PHREEQC (VERSION 2) A COMPUTER PROGRAM FOR SPECIATION, BATCH-REACTION, ONE-DIMENSIONAL TRANSPORT, AND INVERSE GEOCHEMICAL CALCULATIONS
By David L. Parkhurst and C.A.J. Appelo1
Water-Resources Investigations Report 99-4259
1 Hydrochemical Consultant Valeriusstraat 11 1071 MB Amsterdam, NL [email protected] http://www.xs4all.nl/~appt/index.html
Denver, Colorado 1999 U.S. DEPARTMENT OF THE INTERIOR BRUCE BABBITT, Secretary U.S. GEOLOGICAL SURVEY Charles G. Groat, Director
The use of trade, product, industry, or firm names is for descriptive purposes only and does not imply endorsement by the U.S. Government.
For additional information write to: Copies of this report can be purchased from:
Chief, Branch of Regional Research U.S. Geological Survey U.S. Geological Survey Earth Science Information Center Box 25046, MS 418 Open-File Reports Section Denver Federal Center Box 25286, MS 517 Denver, CO 80225 Denver Federal Center Denver, CO 80225 CONTENTS
Abstract...... _^ 1 Introduction...... ^ 1 Program capabilities...... 3 Program limitations...... ^ 4 Aqueous model...... 4 Ion exchange...... 5 Surface cornplexation...... 5 Solid solutions...... ^ 5 Transport modeling...... 6 Convergence problems...... 6 Inverse modeling...... 6 How to obtain the software and manual...... 6 Installation and execution of the Win32 version...... 7 Installation and execution of the Unix version...... 8 Purpose and scope...... 9 Equations for speciation and forward modeling...... 9 Activities and mass-action equations...... 10 Aqueous species...... 10 Exchange species...... 12 Surface species...... 13 Gas-phase components...... 15 Equations for the Newton-Raphson method...... 17 Activity of water...... 17 Ionic strength...... 18 Equilibrium with a fixed-volume multicornponent gas phase...... 18 Equilibrium with a fixed-pressure multicornponent gas phase...... 18 Equilibrium with pure phases ...... 19 Equilibrium with solid solutions...... 20 Mole balance for surface sites...... 22 Mole balance for exchange sites...... 23 Mole balance for alkalinity...... 24 Mole balance for elements...... 25 Aqueous charge balance...... 26 Surface charge-potential equation with no explicit calculation of the diffuse-layer composition...... 28 Surface charge-balance equation with explicit calculation of the diffuse-layer composition...... 29 Non-electrostatic surface cornplexation...... 32 Numerical method for speciation and forward modeling ...... 32 Aqueous speciation calculations...... 34 Calculation of the initial composition of an exchanger ...... 36 Calculation of the initial composition of a surface...... 37 Calculation of the initial composition of fixed-volume gas phase...... 38 Batch-reaction and transport calculations...... 38 Numerical method and rate expressions for chemical kinetics...... 40
CONTENTS III Numerical method...... 41 Rate expressions...... 41 Equations and numerical method for transport modeling...... 44 The advection-reaction-dispersion equation...... 44 Transport of heat...... 48 Transport in dual porosity media ...... 49 First-order exchange approximation...... 49 Finite differences for the stagnant zone...... 51 Equations and numerical method for inverse modeling...... 54 Equations and inequality constraints...... 54 Mole-balance equations...... 55 Alkalinity-balance equation...... 55 Electron-balance equation...... 56 Water-balance equation...... 56 Charge-balance equation...... 56 Isotope-balance equations...... 57 Relation among pH, alkalinity, and total dissolved inorganic carbon uncertainty terms...... 57 Inequality constraints...... 58 Change of variables...... 58 Organization of the computer code...... 61 Description of data input...... 63 Conventions for data input...... 65 Reducing chemical equations to a standard form ...... 67 Conventions for documentation...... 68 Getting started...... _^ 68 Speciation calculations...... 69 Batch-reaction calculations...... 69 Advective-transport calculations...... 71 Advective-dispersive transport calculations...... 71 Inverse modeling...... 72 Units...... ^ 72 Keywords ...... ~ 72 ADVECTION...... ^ 74 Example data block...... 74 Explanation...... 74 Notes...... 76 Example problems...... 77 Related keywords...... 77 END...... ;...... _ 78 Example problems...... 78 EQUILIBRmMJPHASES...... _ 79 Example data block...... 79 Explanation...... 79 Notes...... 80 Example problems...... 81 Related keywords...... 81
IV CONTENTS EX( .^NGE...... 82 hxample data block 1...... 82 Explanation 1...... 82 Notes 1 ...... ^^ 83 Example data block 2...... 83 Explanation 2...... 84 Notes 2...... 84 Example problems...... 85 Related keywords...... 86 EXCHANGEJvlASTER_SPECffiS...... ^^ 87 Example data block...... 87 Explanation...... 87 Notes...... _ 87 Example problems...... 87 Related keywords...... 87 EXCHANGE_SPECffiS...... ^^ 88 Example data block...... 88 Explanation...... 88 Notes...... ^ 89 Example problems...... 90 Related keywords...... 90 GASJ»HASE...... » 91 Example data block 1. Fixed-pressure gas phase...... 91 Explanation 1...... 91 Notes !...... _ 92 Example data block 2. Fixed-volume gas phase: Define initial moles of components with partial pressures...... 92 Explanation 2...... 93 Notes 2...... 93 Example data block 3. Fixed-volume gas phase: Define initial moles of components by equilibrium with a solution...... 94 Explanations...... 94 Notes 3...... »^^ 95 Example problems...... 95 Related keywords...... 95 INCREMENTAL_REACTIONS...... 96 Example data block...... 96 Explanation...... 96 Notes...... 96 Example problems...... 97 Related keywords...... 97 INVERSEJrtODELING...... _^ 98 Example data block...... 98 Explanation...... 98 Notes...... 103 Example problems...... 105
CONTENTS V Related key words...... 105 KINETICS ...... 106 Example data block 1...... 106 Explanation 1...... 106 Example data block 2...... 109 Explanation 2...... 109 Notes ...... 109 Example problems...... 110 Related key words...... 110 KNOBS...... ^^ 111 Example data block...... Ill Explanation...... Ill Notes ...... 114 Example problems...... 115 MK...... » 116 Example data block...... 116 Explanation...... 116 Notes...... 116 Example problems...... 117 Related keywords...... 117 PHASES...... _^ 118 Example data block...... 118 Explanation...... 118 Notes ...... 119 Example problems...... 119 Related keywords...... 119 PRINT ...... 120 Example data block...... 120 Explanation...... 120 Notes...... 122 Example problems...... 123 Related keywords...... 123 RATES ...... 124 Example data block...... 124 Explanation...... 124 Notes...... 125 Example problems...... 129 Related keywords...... 129 REACTION...... ^ 130 Example data block 1...... 130 Explanation 1 ...... 130 Example data block 2...... 131 Explanation 2...... 131 Notes ...... 131 Example problems...... 132 Related keywords...... 132
VI CONTENTS REACTION_TEMPERATURE...... 133 Example data block 1...... 133 Explanation 1 ...... 133 Example data block 2...... 133 Explanation 2...... 133 Notes...... 134 Example problems...... 134 Related keywords...... 134 SAVE...... _ 135 Example data block...... 135 Explanation...... 135 Notes...... _ 135 Example problems...... 136 Related keywords...... 136 SELECTED_OUTPUT...... ^ 137 Example data block...... 137 Explanation...... 138 Notes...... 142 Example problems...... 143 Related keywords...... 143 SOLro_SOLUTIONS...... _ 144 Example data block...... 144 Explanation...... 144 Notes...... 147 Example problems...... 148 Related keywords...... 148 SOLUTION...... 149 Example data block...... 149 Explanation...... 149 Notes ...... 152 Example problems...... 153 Related keywords...... 153 SOLUTION_MASTER_SPECffiS...... 154 Example data block...... 154 Explanation...... 154 Notes...... 155 Example problems...... 155 Related keywords...... 155 SOLUTION_SPECffiS...... ^ 156 Example data block...... 156 Explanation...... 156 Notes...... 158 Example problems...... 158 Related keywords...... 158 SOLUTION_SFREAD ...... 159 Example data block...... 159
CONTENTS VII Explanation...... 159 Notes ...... 161 Example problems...... 162 Related keywords...... 162 SURFACE...... 163 Example data block 1...... 163 Explanation 1...... 163 Notes 1...... _^ 165 Example data block 2...... 167 Explanation 2...... 167 Notes 2 ...... 167 Example problems...... 168 Related keywords...... 168 SURFACE_MASTER_SPECIES ...... 169 Example data block...... 169 Explanation...... 169 Notes...... 169 Example problems...... 169 Related keywords...... 169 SlJRFACE_SPECffiS...... ^ 170 Example data block...... 170 Explanation...... 170 Notes ...... 170 Example problems...... 171 Related keywords...... 171 TITLE...... 172 Example data block...... 172 Explanation...... 172 Notes...... 172 Example problems...... 172 TRANSPORT...... _ 173 Example data block...... 173 Explanation...... 173 Notes...... 177 Example problems...... 180 Related key words...... 180 USE...... 181 Example data block...... 181 Explanation ...... 181 Notes ...... 181 Example problems...... 182 Related keywords...... 182 USERJ^RINT...... 183 Example data block...... 183 Explanation...... 183 Notes...... 183
VIM CONTENTS Example problems...... 183 Related key words...... 184 USERJ^JNCH...... -...... -_ 185 Example data block...... 185 Explanation...... 185 Notes ...... ^ 185 Example problems...... 186 Related key words...... 186 Summary of data input...... 187 Examples...... 196 Example l.--Speciation calculation...... 196 Example 2. Equilibration with pure phases...... 203 Example 3. Mixing...... 206 Example 4. Evaporation and homogeneous redox reactions...... 209 Example5.--Irreversiblereactions...... 211 Example 6.--Reaction-path calculations...... 213 Example7.--Gas-phasecalculations...... 221 Example 8. Surface complexation...... 224 Example 9. Kinetic oxidation of dissolved ferrous iron with oxygen...... 230 Example 10. Aragonite-strontianite solid solution...... 234 Example 11 .--Transport and cation exchange...... 238 Example 12.--Advective and diffusive flux of heat and solutes...... 242 Example 13.--1D transport in a dual porosity column with cation exchange...... 247 Stagnant zone calculation using the first-order exchange approximation with implicit mixing factors...... 247 Stagnant zone calculation using the first-order exchange approximation with explicit mixing factors ...... 249 Stagnant zone calculation using a finite difference approximation ...... 251 Example 14.--Advective transport, cation exchange, surface complexation, and mineral equilibria...... 254 Initial conditions ...... 255 Recharge water...... 257 Advective transport calculations...... 257 Example 15.--1D Transport: Kinetic biodegradation, cell growth, and sorption...... 259 Transport parameters...... ^ 259 Aqueous model...... 259 Initial and boundary conditions...... 261 Kinetic degradation of Nta and cell growth...... 261 Sorption reactions ...... 263 Input data set...... 263 Grid convergence...... 267 Results...... 268 Example 16.~Inverse modeling of Sierra spring waters...... 269 Example 17. Inverse modeling with evaporation...... 275 Example 18. Inverse modeling of the Madison aquifer...... 278 Water compositions and reactants...... 278 Madison aquifer results and discussion ...... 282 References cited...... 284 Attachment A Listing of notation...... 288
CONTENTS IX Attachment B~Description of database files and listing ...... 292 Attachment C--Input file to investigate the order of the numerical method for example 12 ...... 309
FIGURES
1. Diagram showing terms in the advection-reaction-dispersion equation...... 44 2-5. Graphs showing:
2. Analytical solution for ID transport with ion-exchange reactions and flux boundary condition compared with PHREEQC calculations at various grid spacings...... 47 3. Analytical solution for ID transport with ion-exchange reactions and constant boundary condition compared with PHREEQC calculations at various grid spacings...... 48 4. Analytical solution for transport with stagnant zones, a pulse input, and ion-exchange reactions compared with PHREEQC calculations at various grid spacings...... 52 5. Saturation indices of gypsum and anhydrite in solutions that have equilibrated with the more stable of the two phases over the temperature range 25 to 75° Celsius...... 204 6. Phase diagram for the dissolution of microcline in pure water at 25°C showing stable phase-boundary intersections (example 6A) and reaction paths across stability fields (example 6B)...... 218 7-16. Graphs showing:
7. Composition of the gas phase during decomposition of organic matter with a composition of CH2O(NH3)0 07 in pure water under conditions of fixed volume and fixed pressure for the gas phase...... 222 8. Distribution of zinc among the aqueous phase and strong and weak surface sites of hydrous iron oxide as a function of pH for total zinc concentrations of 10"7 and 10'4 molal...... 229 9. Concentration of total Fe(2), total Fe(3), and pH as dissolved ferrous iron [Fe(2)] is kinetically oxidized to ferric iron [Fe(3)] by oxygen...... 234 10. (A) Mole fraction of strontianite and aragonite in solid solution, (B) mole fraction of calcium and strontium in aqueous phase, (C) moles of strontianite and aragonite in solid solution, and (D) moles of miscibility-gap end members in solid solution, as a function of the amount of strontium carbonate added...... 235 11. Results of transport simulation of the replacement of sodium and potassium on a cation exchanger by infilling calcium chloride solution...... 241 12. Simulation results for diffusion from column ends of heat and Na+ (retardation R = 3) and Cl" (R = 1) compared with constant-boundary-condition analytical solution...... 245 13. Results of simulations of transport with diffusion into spherical stagnant zones modeled using finite difference and first-order exchange approximations...... 254 14. Results of transport simulation of the chemical evolution of ground water due to calcium magnesium bicarbonate water inflow to an aquifer initially containing a brine, calcite and dolomite, a cation exchanger, and a surface that complexes with arsenic...... 258 15. Aqueous concentrations and pH values at the outlet of the column for Nta and cobalt transport simulations with 10 and 20 cells...... 268 16. Concentrations of sorbed species and biomass at the outlet of the column for Nta and cobalt transport simulations with 10 and 20 cells ...... 269
CONTENTS TABLES
1. Shape factors for diffusive first-order exchange between cells with mobile and immobile water...... 53 2. List of keyword data blocks and their function...... 64 3. Summary of special characters for input data files...... 67 4. Elements and element valence states included in default database phreeqc.dat, including phreeqc notation ...... and default formula for gram formula weight...... 70 5. Default uncertainty limits for isotopes...... 105 6. Description of Basic program for calcite kinetics given in example for RATES data block...... 126 7. Description of Basic program for pyrite dissolution kinetics given in example for RATES data block...... 126 8. Special Basic statements and functions for PHREEQC...... 127 9. Standard Basic statements and functions...... 128 10. Seawater composition ...... 196 11. Input data set for example 1...... 197 12. Output for example 1 ...... 199 13. Input data set for example 2...... 203 14. Selected output for example 2...... 205 15. Input data set for example 3...... 207 16. Selected results for example 3...... 208 17. Input data set for example 4...... 209 18. Selected results for example 4...... 211 19. Input data set for example 5...... 211 20. Selected results for example 5...... 212 21. Input data set for example 6...... 213 22. Selected results for example 6A...... 217 23. Description of Basic program for K-feldspar dissolution kinetics and identification of phase transitions ...... 220 24. Phase transitions identified by the RATES Basic program and printed to the output file by the USER_PRINT Basic program in example 6C, which simulates the kinetic dissolution of K-feldspar...... 220 25. Results written to the selected-output file by the USER_PUNCH Basic program in example 6C, which ...... simulates the kinetic dissolution of K-feldspar...... 221 26. Input data set for example 7...... 223 27. Input data set for example 8...... 225 28. Partial input data set for example 9...... 231 29. Input data set for example 10...... 236 30. Input data set for example 11...... 239 31. Input data set for example 12...... 242 32. Numerical errors relative to an analytical solution for example 12 for a 20-cell and a 60-cell model...... 246 33. Input data set for example 13A: Stagnant zone with implicitly defined mixing factors...... 248 34. Input data set for example 13B: Stagnant zone with explicitly defined mixing factors...... 249 35. Mixing factors for finite difference calculation of diffusion in spheres...... 251 36. Input data set for example 13C: Stagnant zone with diffusion calculated by finite differences (partial listing)...... 252 37. Input data set for example 14...... 255 38. Hydraulic and physical properties of the column in example 15...... 259 39. Database for example 15...... 260 40. Concentration data for example 15 ...... 261 41. Reaction stoichiometry for oxidation of Nta...... 262