| Next || Previous || Top |
This keyword data block is used to define mathematical rate expressions for kinetic reactions. General rate formulas are defined in the RATES data block and specific kinetic parameters for batch reaction or transport are defined in the KINETICS data block.
numbered Basic statement --A valid Basic language statement that must be numbered. The statements are evaluated in numerical order. The sequence of statements must extrapolate the rate of reaction over the time subinterval given by the internally defined variable TIME. There must be a statement “ SAVE expression ”, where the value of expression is the moles of reaction that are transferred during time subinterval TIME. Statements and functions that are available through the Basic interpreter are listed in the section on the Basic interpreter. Parameters defined in the KINETICS data block also are available through the Basic array PARM.
-end --Identifier marks the end of a Basic program by which the number of moles of a reaction for a time subinterval is calculated. Note the hyphen is required to avoid a conflict with the keyword END .
A Basic interpreter (David Gillespie, Synaptics, Inc., San Jose, Calif., written commun., 1997) distributed with the Linux operating system (Free Software Foundation, Inc.) is embedded in PHREEQC. The Basic interpreter is used during the integration of the kinetic reactions to evaluate the moles of reaction progress for a time subinterval. A Basic program for each kinetic reaction must be included in the input or database file. Each program must stand alone with its own set of variables and numbered statement lines. There is no conflict in using the same variable names or line numbers in separate rate programs.
It is possible to transfer data among rates with the special Basic statements PUT and GET (see The Basic Interpreter). The programs are used to calculate the instantaneous rate of reaction and extrapolate that rate for a time subinterval given by the variable “TIME” (calcite, line 140; pyrite line 50). TIME is an internally generated and variable time substep, and its value cannot be changed. The total moles of reaction must be returned to the main program with a SAVE command (line 200 in each example). Note that moles of reaction are returned, not the rate of the reaction. Moles are counted positive when the solution concentration of the reactant increases.
The first example estimates the rate of calcite dissolution or precipitation on the basis of a rate expression from Plummer and others (1978) (see also equations 101 and 106, Parkhurst and Appelo, 1999). The forward rate is given by
where square brackets indicate activity and , , and are functions of temperature (Plummer and others, 1978). In a pure calcite-water system with fixed , the overall rate for calcite (forward rate minus backward rate) is approximated by
where is mmol cm -2 s -1 (millimole per square centimeter per second). Equation 2 is implemented in Basic for the first example above. Explanations of the Basic lines for this rate expression are given in table 5.
where parentheses indicate molality. This rate is based on detailed measurements in solutions of varying compositions and shows a square root dependence on the molality of oxygen and a small dependence on pH. This rate is applicable only for dissolution in the presence of oxygen and will be incorrect near equilibrium when oxygen is depleted. Explanations of the Basic lines for this rate expression are given in table 6.
Some special statements and functions have been added to the Basic interpreter to allow access to quantities that may be needed in rate expressions. These functions are listed in The Basic Interpreter, table 8. Standard Basic statements that are implemented in the interpreter are listed in The Basic Interpreter, table 7. Upper or lower case may be used for statement, function, and variable names. String variable names must end with the character “$”.
The PRINT command in Basic programs is useful for debugging rate expressions. It can be used to write quantities to the output file to check that rates are calculated correctly. However, the PRINT command will write to the output file every time a rate is evaluated, which may be many times per time step. The sequence of information from PRINT statements in RATES definitions may be difficult to interpret because of the automatic time-step adjustment of the integration method.
| Next || Previous || Top |