| Next|| Previous || Top |

Conventions for Data Input

PHREEQC was designed to eliminate some of the input errors due to complicated data formatting. Data for the program are free format; spaces or tabs may be used to delimit input fields (except SOLUTION_SPREAD, which is delimited only with tabs); blank lines are ignored. Keyword data blocks within a simulation may be entered in any order. However, data elements entered on a single line are order specific. As much as possible, the program is case insensitive. However, chemical formulas are case sensitive.

The following conventions are used for data input to PHREEQC:

Keywords--Input data blocks are identified with an initial keyword. This word must be spelled exactly, although case is not important. Several of the keywords have synonyms. For example PURE_PHASES is a synonym for EQUILIBRIUM_PHASES.

Identifiers--Identifiers are options that may be used within a keyword data block. Identifiers may have two forms: (1) they may be spelled completely and exactly (case insensitive) or (2) they may be preceded by a hyphen and then only enough characters to uniquely define the identifier are needed. The form with the hyphen is always acceptable and is recommended. Usually, the form without the hyphen is acceptable, but in some cases the hyphen is needed to indicate the word is an identifier rather than an identically spelled keyword; these cases are noted in the definition of the identifiers in the following sections. In this report, the form with the hyphen is used except for identifiers of the SOLUTION keyword and the identifiers log_k and delta_h. The hyphen in the identifier never implies that the negative of a quantity is entered.

Chemical equations--For aqueous, exchange, and surface species, chemical reactions must be association reactions, with the defined species occurring in the first position past the equal sign. For phases, chemical reactions must be dissolution reactions with the formula for the defined phase occurring in the first position on the left-hand side of the equation. Additional terms on the left-hand side are allowed. All chemical equations must contain an equal sign, "=". In addition, left- and right-hand sides of all chemical equations must balance in numbers of atoms of each element and total charge. All equations are checked for these criteria at runtime, unless they are specifically excepted. Nested parentheses in chemical formulas are acceptable. Spaces and tabs within chemical equations are ignored. Waters of hydration and other chemical formulas that are normally represented by a " · "--as in the formula for gypsum, CaSO 4 ·2H 2 O--are designated with a colon (":") in PHREEQC (CaSO 4 :2H 2 O), but only one colon per formula is permitted.

Element names--An element formula, wherever it is used, must begin with a capital letter and may be followed by one or more lowercase letters or underscores, "_". In general, element names are simply the chemical symbols for elements, which have a capital letter and zero or one lower case letter. It is sometimes useful to define other entities as elements, which allows mole balance and mass-action equations to be applied. Thus, "Fulvate" is an acceptable element name, and it would be possible to define metal binding constants in terms of metal-Fulvate complexes.

Charge on a chemical species--The charge on a species may be defined by the proper number of pluses or minuses following the chemical formula or by a single plus or minus followed by a integer number designating the charge. Either of the following is acceptable, Al+3 or Al+++. However, Al3+ would be interpreted as a molecule with three aluminum atoms and a charge of plus one.

Valence states--Redox elements that exist in more than one valence state in solution are identified for definition of solution composition by the element name followed by the formal valence in parentheses. Thus, sulfur that exists as sulfate is defined as S(6) and total sulfide (H 2 S, HS - , and others) is identified by S(-2).

log K and temperature dependence--The identifier log_k is used to define the log K at 25 o C for a reaction. The temperature dependence for log K may be defined by the van't Hoff expression or by an analytical expression. The identifier delta_h is used to give the standard enthalpy of reaction at 25 o C for a chemical reaction, which is used in the van't Hoff equation. By default the units of the standard enthalpy are kilojoules per mole (kJ/mol). Optionally, for each reaction the units may be defined to be kilocalories per mole (kcal/mol). An analytical expression for the temperature dependence of log K for a reaction may be defined with the -analytical_expression identifier. Up to five numbers may be given, which are the coefficients for the equation: , where T is in Kelvin. A log K must always be defined either with

log_k or -analytical_expression; the enthalpy is optional. If both are present, an analytical expression is used in preference to the enthalpy value for calculation of temperature dependence of a log K .

Comments--The "#" character delimits the beginning of a comment in the input file. All characters in the line that follow this character are ignored. If the entire line is a comment, the line is not echoed to the output file. If the comment follows input data on a line, the entire line, including the comment, is echoed to the output file. The "#" is useful for adding comments explaining the source of various data or describing the problem set up. In addition, it is useful for temporarily removing lines from an input file.

Logical line separator--A semicolon (";") is interpreted as a logical end of line character. This allows multiple logical lines to be entered on the same physical line. For example, solution data could be entered as:

 

pH 7.0; pe 4.0; temp 25.0
 

on one line. The semicolon should not be used in character fields, such as the title or other comment or description fields.

Logical line continuation--A backslash ("\") at the end of a line may be used to merge two physical lines into one logical line. For example, a long chemical equation could be entered as:

"Ca0.165Al2.33Si3.67O10(OH)2 + 12 H2O = \"

"0.165Ca+2 + 2.33 Al(OH)4- + 3.67 H4SiO4 + 2 H+"

on two lines. The program would interpret this sequence as a balanced equation entered on a single logical line. Note the backslash must be the last character in the line; if white space or other characters follow the backslash, the next line is not considered to be a continuation line.

Repeat count--An asterisk ("*") can be used with data for the identifiers -length and -dispersivity in the TRANSPORT data block to indicate a repeat count for the following data item. The format is an integer followed directly by the asterisk, which is followed directly by a numeric value. For example "4*1.0" is the same as entering four values of 1.0 ("1.0 1.0 1.0 1.0").

Range of integers--A hyphen ("-") can be used to indicate a range of integers for the keywords with an identification number. It is also possible to define a range of cell numbers for the identifiers -print_cells and -punch_cells in the ADVECTION and TRANSPORT data blocks. A range of integers is given in the form m-n , where m and n are positive integers, m is less than n , and the two numbers are separated by a hyphen without intervening spaces.

Table 3. --Summary of special characters for input data files

Special
character

Use

-

When preceding a character string, a hyphen indicates an identifier for a keyword (or subkeyword).

-

Indicates a range of cell numbers for keyword data blocks (for example, SOLUTION 2-5) or for identifiers -print_cells and -punch_cells in the ADVECTION and TRANSPORT data blocks.

:

In a chemical equation, ":" replaces " . " in a formula like CaSO 4 . 2H 2 O.

( )

The redox state of an element is defined by a valence enclosed by parentheses following an element name.

#

Comment character, all characters following # are ignored.

;

Logical line separator.

\

Line continuation if "\" is the last non-white-space character of a line.

*

Can be used to indicate a repeat count for -length and -dispersivity values in the TRANSPORT data block.


| Next|| Previous || Top |