************************************************************************* ******************** ECO2N Version 1.0 ******************** ******************** August 2005 ******************** ************************************************************************* .......READ.ME..........READ.ME..........READ.ME..........READ.ME........ ......................................................................... .............................Update 10/05................................ ......................................................................... This flyer contains brief instructions for installing and running TOUGH2/ECO2N. ECO2N is a special fluid property module for mixtures of water-NaCl- CO2, designed for applications to CO2 storage in saline aquifers. General information about TOUGH2 is available on the TOUGH2 homepage: ************************************************************************* * http://www-esd.lbl.gov/TOUGH2/ * ************************************************************************* ECO2N is written in standard FORTRAN 77 and operates within the framework of TOUGH2, Version 2.0 (T2V2; Pruess et al., 1999). The code consists of a module (group of routines) named *eco2n.f* that must be linked to several standard T2V2 modules, as described below, and a data file named *CO2TAB* that provides thermophysical properties of CO2. The ECO2N package includes the following 14 files. (1) read.me - the file you're reading; (2) eco2n.f - the fluid properties package, consisting of subroutine EOS and satellite routines; (3) CO2TAB - a data file that must be present when TOUGH2/ECO2N is executed; (4) rtab - input file for sample problem 1 (demonstrates different initialization options); (5) rcc3 - input file for sample problem 2 (radial flow from a CO2 injection well); (6) m122a_ni - MESH file for sample problem 2; (7) r1dv - input file for sample problem 3 (CO2 discharge along a fault zone); (8) s67a - INCON file with gravity-equilibrated conditions for sample problem 3; (9) rtp7 - input file for sample problem 4 (CO2 injection into a 2-D layered brine formation); this file includes the MESHMAKER input data for grid generation at the end; (10) m37i - MESH file for sample problem 4; (11) s616f - INCON file with gravity-equilibrated conditions for sample problem 4; (12) co2tab3.f - an auxiliary program, written in Fortran 77, for generating a table of thermophysical properties to be used with ECO2N; (13) rco2h - an input data file for co2tab3.f; (14) eco2n_man.pdf - ECO2N user's manual (Lawrence Berkeley National Laboratory Report LBNL-57952, August 2005). ************************************************************************* TOUGH2/ECO2N requires 64-bit arithmetic (8 byte word length for floating point numbers) for successful execution. Users with 32-bit machines require a compiler option that will produce 64-bit arithmetic. If no such option is available it will be necessary to edit the FORTRAN code, declare all floating point variables double precision, and modify floating point constants to "D" format. No modifications in function names will be needed as ECO2N uses generic FORTRAN 77 function names throughout. As an example of compilation, linking, and program execution we reproduce here the commands that would be used on an IBM RISC System/6000 workstation, running a UNIX-based operating system. The example involves creating an executable "zco2n", and then using input file "rcc3" to run sample problem 2. COMPILATION (INCLUDE-file *T2* must be present) f77 -c -qautodbl=dblpad t2cg22.f meshm.f eco2n.f t2f.f t2solv.f ma28.f LINKING f77 -o zco2n t2cg22.o meshm.o eco2n.o t2f.o t2solv.o ma28.o EXECUTION zco2n rcc3.out (Note that file m122a_ni must be present as MESH for running this problem.) The option "-qautodbl=dblpad" is required in order to obtain 64-bit arithmetic. On some workstations, the same effect is achieved by specifying the option "-r8" for compilation. For example, on a Dec Alpha machine with a FORTRAN 90 compiler, compilation would be made as follows. f90 -c -r8 -i8 t2cg22.f meshm.f eco2n.f t2f.f t2solv.f ma28.f Here we have specified that integers will also be stored as 8 byte words. This is necessary to avoid alignment problems that may arise in some COMMON blocks where floating point and integer variables are mixed. For a faster executable, compiler optimization may be used. ========================================================================= DUPLICATE NAMES ========================================================================= The *eco2n.f* module contains some program units with the same names as standard T2V2 units. These units supersede original T2V2 units. The linking instruction given above will encounter "duplicate names;" for example, *eco2n.f* includes a subroutine FGTAB, while a standard T2V2 version of subroutine FGTAB is also present in T2V2 module t2f.f. On the IBM RS/6000 the linker will automatically link the first occurrence of FGTAB (from *eco2n.f*),and will ignore the additional FGTAB present in *t2f.f*. This is the desired outcome. On some computers, the linking instruction will give rise to a fatal "duplicate names" error. To avoid this problem, names of unwanted standard T2V2 subroutines should be changed prior to compilation. For example, the name of routine FGTAB in *t2f.f* should be changed to something like FGTABx. ========================================================================= TEST OF CODE INSTALLATION ========================================================================= Users should run several of the sample problems to check on proper code installation (compare with test results presented in the ECO2N report; Pruess, 2005). Due to machine-dependent roundoff, ECO2N may produce slightly different results on different computers. For same-size time steps, all primary variables should agree to typically four digits or better. However, on different computers the iteration sequence for a time step may be slightly different because of roundoff, and occasionally a different number of iterations may be required for convergence. If automatic time stepping is used, a different number of iterations for convergence may subsequently cause different-size time steps to be taken; naturally this will then produce somewhat larger discrepancies in results because of different time truncation errors. Of all the numbers processed by ECO2N, the most sensitive are the residuals, i.e. the differences between left-hand sides (accumulation terms) and right-hand sides (flow terms) of the governing equations. During the Newton-Raphson iteration process these residuals are reduced to smaller and smaller values, until they drop below user-selectable convergence tolerances. As convergence is approached, the residuals are subject to increasingly severe numerical cancellation, arising from subtracting two numbers with diminishing difference. Maximum residuals are (optionally) printed during the iteration process as "MAX. RES.", and are also printed in the header of a full time step printout. These numbers can serve as a convenient check when evaluating reproducibility of code applications. Small numerical differences due to roundoff etc. will first show up in different values for "MAX. RES.", long before giving any visible changes in primary variables or their increments. ========================================================================= GENERATION OF A CO2TAB FILE ========================================================================= The ECO2N package includes a utility program *co2tab3.f*, written in Fortran 77, for generating a table of thermophysical properties to be used with ECO2N. The reason this is included is to enable users to generate their own thermophysical property data, for different temperature and pressure ranges, and with different temperature and pressure increments. The thermophysical property correlations used in co2tab3.f are based on the work of Altunin and his collaborators in the former Soviet Union (Altunin, 1975), as embodied in a computer program that was kindly made available to us by Victor Malkovsky of the Institute of Geology of Ore Deposits, Petrography, Mineralogy and Geochemistry (IGEM) of the Russian Academy of Sciences, Moscow. These correlations were extensively cross- checked against experimental data and alternative PVT formulations, such as Span and Wagner (1996), and were found to be very accurate (García, 2003). The Fortran program provided by Malkovsky was incorporated into co2tab3.f. To facilitate use of co2tab3.f, an input file *rco2h* is also provided. This file was used to generate the CO2TAB data file with thermophysical properties of CO2 that is included as file #3 in the ECO2N distribution. The rco2h input data file for co2tab3.f consists of the following 3 data records, that will be further explained below. 1.e5 4.e5 10 3.04 2. 51 76.0e5 4.e5 101 On an IBM RS/6000 machine, program usage is as follows. COMPILATION f77 -c -qautodbl=dblpad co2tab3.f LINKING f77 -o xco2tab3 co2tab3.o EXECUTION xco2tab3 rco2h.out From the rco2h input data, the program will first generate internal arrays of temperature and pressure values. These values will subsequently be used to tabulate CO2 densities, viscosities, and enthalpies in a special format suitable for use with ECO2N. The tabulation will be output on an ASCII data file called "CO2TAB". For the particular *rco2h* input data provided here, the tabulation will proceed as follows. Temperatures (specified in second record of file *rco2h*) Starting value 3.04 šC, increment T = 2.0 šC; total number of points is 51 (i.e., temperature data are 3.04, 5.04, ... , 103.04 šC). (The reason for picking these particular temperature values is to ensure that the critical point at T = 31.04 šC will be included as a tabulation point.) Pressures (specified in first and third record of file *rco2h*) Starting value 1.e5 Pa (= 1 bar), increment P = 4.e5 Pa; total number of points is 10 (i.e., pressure data are 1.e5, 5.e5, ... 37.e5 Pa). Additional pressures will be generated from the temperature data up to and including the critical point. There are 15 such temperature data in the rco2h data set, and the 15 saturation pressures corresponding to them will be internally calculated and appended to the previous set of 10 pressures. A further 101 pressures will be generated and appended to this set, with a starting value of 76.0e5 Pa, increment P = 4.e5 Pa, for a highest pressure of 476.0e5 Pa A single additional pressure point at P = 600.e5 Pa will be added internally. The co2tab3.f program will then use these temperature and pressure data to generate a file CO2TAB that tabulates CO2 property data in a special format. ========================================================================= CO2TAB FORMAT ========================================================================= CO2TAB first lists the number of pressures and temperatures (127 and 51, respectively, for the above rco2h input data). This is followed by a list of all pressures; then a list of all temperatures. Subsequently there are three data sets, first density, then viscosity, then specific enthalpy. First the three data sets are given that correspond to the first pressure and all temperatures. This is followed by the data for the second pressure and all temperatures, and so on, until data for all pressures have been listed. For the particular rco2h input data used here, there will be 127 sets of density-viscosity-enthalpy data, each consisting of 3*51 data points corresponding to the different temperatures in ascending order. For all points that lie on the saturation line, this tabulation will list the liquid phase values. Liquid densities on the saturation line will be tabulated as negative numbers, which serves as a flag in the interpolation performed by ECO2N. Following all these data, there will be a record listing three numbers for pressure data, as follows: NP1 - the number of pressure points below the lowest saturation pressure (here NP1 = 10); I0 - the number of points on the saturation line (here I0 = 15); NP2 - the number of user-provided pressure points beyond the highest saturation pressure (here NP2 = 101). This is followed by saturation line data, consisting of a list of I0 temperatures, followed by an equal number of values for saturation pressure, gas density, gas viscosity, and gas specific enthalpy. ========================================================================= CRITICAL POINT ========================================================================= Before using a CO2TAB file so generated with ECO2N, we recommend to make a few simple changes "by hand," to ensure consistent parameter values at the critical point. These changes consist of substituting the following values for critical density, viscosity, and specific enthalpy for both liquid and gas phases. Critical density: 468 kg/m^3 (Vargaftik, 1975) Critical viscosity: 3.220e-5 Pa-s (Vukalovich and Altunin, 1968) Critical specific enthalpy: 6.3664e5 J/kg (Scharlin, 1966) References for critical data Scharlin, P. (ed.) Carbon Dioxide in Water and Aqueous Electrolyte Solutions, Volume 62 of Solubility Data Series, IUPAC, International Union of Pure and Applied Chemistry, Oxford University Press, Oxford, U.K., 1996. Vargaftik, N.B. Tables on the Thermophysical Properties of Liquids and Gases, 2nd Ed., John Wiley & Sons, New York, NY, 1975. Vukalovich, M.P. and V.V. Altunin. Thermophysical Properties of Carbon Dioxide, Collet's, 1968. ************************************************************************* References Altunin, V.V., Thermophysical Properties of Carbon Dioxide, Publishing House of Standards, 551 pp., Moscow, 1975 (in Russian). García, J.E., Fluid Dynamics of Carbon Dioxide Disposal Into Saline Aquifers, PhD dissertation, U. of California at Berkeley, Berkeley, California, December 2003. Span, R. and W. Wagner, A new Equation of State for Carbon Dioxide Covering the Fluid Region from the Triple-point Temperature to 1100 K at Pressures up to 800 MPa, J. Phys. Chem. Ref. Data, 25 (6), 1509­ 1596, 1996. Pruess, K. ECO2N: A TOUGH2 Fluid Property Module for Mixtures of Water, NaCl and CO2, Lawrence Berkeley National Laboratory Report LBNL-57952, August 2005. Pruess, K., C. Oldenburg and G. Moridis. TOUGH2 User's Guide, Version 2.0, Lawrence Berkeley National Laboratory Report LBNL-43134, November 1999. ************************************************************************* TOUGH2 and the ECO2N module are available from: Energy Science and Technology Software Center P.O. Box 1020 Oak Ridge, Tennessee 37831 U.S.A. phone (865) 576-2606 fax (865) 576-6436 email: estsc@adonis.osti.gov WorldWideWeb: http://www.osti.gov/estsc/ People with a valid license for TOUGH2 V 2.0 can obtain the ECO2N package from ESTSC free of charge. The code developer can be reached as follows: Karsten Pruess Mail Stop 90-1116 Lawrence Berkeley National Lab. Berkeley, CA 94720 U.S.A. phone: (510) 486-6732 email: K_Pruess@lbl.gov ************************************************************************* * Additional information is available on the TOUGH2 homepage on the web * * * * http://www-esd.lbl.gov/TOUGH2/ * ************************************************************************* ......................................................................... .............................Update 10/05................................ ......................................................................... .......READ.ME..........READ.ME..........READ.ME..........READ.ME........ .........................................................................