[Next] [Previous] [Up] [Top]

Keywords

KNOBS

This keyword data block is used to redefine parameters that affect convergence of the numerical method during speciation, reaction, and transport calculations. It also provides the capability to produce long, uninterpretable output files. Hopefully, this data block is seldom used.

Example

Line 0:  KNOBS 
Line 1:       -iterations     150
Line 2:       -tolerance      1e-14
Line 3:       -step_size      100.
Line 4:       -pe_step_size   10.
Line 5:       -diagonal_scale TRUE
Line 6:       -debug_prep     TRUE
Line 7:       -debug_set      TRUE
Line 8:       -debug_model    TRUE
Line 9:       -debug_inverse  TRUE
Line 10:      -logfile 

Explanation

Line 0: KNOBS

KNOBS is the keyword for the data block. Optionally, DEBUG.

Line 1: -iterations iterations

-iterations--allows changing the maximum number of iterations. Optionally, iterations, or -i[terations].

iterations--positive integer limiting the maximum number of iterations used to solve the set of algebraic equations for a single calculation. Default 100.

Line 2: -tolerance tolerance

-tolerance--allows changing the tolerance used by solver to determine numbers equal to zero. Optionally, tolerance, or -t[olerance]. This is not the convergence criterion used to determine when the algebraic equations have been solved. The convergence criteria are hard-coded in the program and can not be modified with the input file.

tolerance--positive, decimal number used by the routine cl1. All numbers smaller than this number are treated as zero. This number should approach the value of the least significant decimal digit that can be interpreted by the computer. The value of tolerance should be on the order of 1e-12 to 1e-14 for most computers and most simulations. Default is 1e-14.

Line 3: -step_size step_size

-step_size--allows changing the maximum step size. Optionally, step_size, or -s[tep_size].

step_size--positive, decimal number limiting the maximum, multiplicative change in the activity of an aqueous master species on each iteration. Default is 100, that is, activities of master species may change by up to 2 orders of magnitude in a single iteration.

Line 4: -pe_step_size pe_step_size

-pe_step_size--allows changing the maximum step size for the activity of the electron. Optionally, pe_step_size, or -p[e_step_size].

pe_step_size--positive, decimal number limiting the maximum, multiplicative change in the conventional activity of electrons on each iteration. Default is 10, that is, may change by up to 1 order of magnitude in a single iteration or pe may change by up to 1 unit. Normally, pe_step_size should be smaller than the step_size, because redox species are particularly sensitive to changes in pe.

Line 5: -diagonal_scale [True or False]

-diagonal_scale--allows changing the default method for scaling equations. Optionally, diagonal_scale, or -d[iagonal_scale].

[True or False]--a value of true (optionally, t[rue]) indicates the alternative scaling method is to be used; false (optionally, f[alse]) indicates alternative scaling method will not be used. If neither true nor false are entered, true is assumed. At the beginning of the run, the value is set to false. Invoking this alternative method of scaling causes any mole-balance equations with the diagonal element (approximately the total concentration of the element or element valence state in solution) less than 1e-11 to be scaled by the factor 1e-11/(diagonal element).

Line 6: -debug_prep [True or False]

-debug_prep--includes debugging prints for subroutine prep. Optionally, debug_prep or -debug_p[rep].

[True or False]--a value of true (optionally, t[rue]) indicates the debugging information will be included in the output file; false (optionally, f[alse]) indicates debugging information will not be printed. If neither true nor false is entered, a value of true is assumed. At the start of the program, the default value is false. If this option is set to true, the chemical equation and log K for each species and phase, as rewritten for the current calculation, are written to the output file. The printout is long and tedious.

Line 7: -debug_set [True or False]

-debug_set--includes debugging prints for subroutines called by subroutine set. Optionally, debug_set or -debug_s[et].

[True or False]--a value of true (optionally, t[rue]) indicates the debugging information will be included in the output file; false (optionally, f[alse]) indicates debugging information will not be printed. If neither true nor false is entered, a value of true is assumed. At the start of the program, the default value is false. If this option is set to true, the initial revisions of the master variables, which occur in subroutine set, are printed for each element or element valence state that fails the initial convergence criteria. The initial revisions occur before the Newton-Raphson method is invoked and provide good estimates of the master variables to the Newton-Raphson method. The printout is tedious.

Line 8: -debug_model [True or False]

-debug_model--includes debugging prints for subroutines called by subroutine model. Optionally, debug_model or -debug_m[odel].

[True or False]--a value of true (optionally, t[rue]) indicates the debugging information will be included in the output file; false (optionally, f[alse]) indicates debugging information will not be printed. If neither true nor false is entered, a value of true is assumed. At the start of the program, the default value is false. If this option is set to true, a large amount of information about the Newton-Raphson equations is printed. The program will print some or all of the following at each iteration: the array that is solved, the solution vector calculated by the solver, the residuals of the linear equations and inequality constraints, the values of all of the master variables and their change, the number of moles of each pure phase and phase mole transfers, the number of moles of each element in the system minus the amount in pure phases and the change in this quantity. The printout is very long and very tedious. If the numerical method does not converge in iterations-10 iterations, this printout is automatically begun.

Line 9: -debug_inverse [True or False]

-debug_inverse--includes debugging prints for subroutines called by subroutine inverse_models. Optionally, debug_inverse or -debug_i[nverse].

[True or False]--a value of true (optionally, t[rue]) indicates the debugging information will be included in the output file; false (optionally, f[alse]) indicates debugging information will not be printed. If neither true nor false is entered, a value of true is assumed. At the start of the program, the default value is false. If this option is set to true, a large amount of information about the process of finding inverse models is printed. The program will print the following for each set of equations and inequalities that are attempted to be solved by the optimizing solver: a list of the unknowns, a list of the equations, the array that is to be solved, any nonnegativity or nonpositivity constraints on the unknowns, the solution vector, and the residual vector for the linear equations and inequality constraints. The printout is very long and very tedious.

Line 10: -logfile [True or False]

-logfile--prints information to a file named phreeqc.log. Optionally, logfile or -l[ogfile].

[True or False]--a value of true (optionally, t[rue]) indicates information will be written to the log file, phreeqc.log; false (optionally, f[alse]) indicates information will not be written. If neither true nor false is entered, a value of true is assumed. At the start of the program, the default value is false. If this option is set to true, information about each calculation will be written to the log file. The information includes number of iterations in revising the initial estimates of the master unknowns, the number of Newton-Raphson iterations, and the iteration at which any infeasible solution was encountered while solving the system of nonlinear equations. (An infeasible solution occurs if no solution to the equality and inequality constraints can be found.) At each iteration, the identity of any species that exceeds 30 mol (an unreasonably large number) is written to the log file and noted as an "overflow". Any basis switches are noted in the log file. The information about infeasible solutions and overflows can be useful for altering other parameters defined through the KNOBS data block, as described below.

Notes

Convergence problems are less frequent with PHREEQC than with PHREEQE; however, they may still occur. The main causes of nonconvergence appear to be (1) calculation of very large molalities in intermediate iterations and (2) accumulation of roundoff errors in simulations involving very small concentrations of elements in solution. The first cause can be identified by "overflow" messages at iteration 1 or greater that appear in the file phreeqc.log (see -logfile above). This problem can usually be eliminated by decreasing the maximum allowable step sizes from the default values. The second cause of nonconvergence can be identified by messages in phreeqc.log that indicate "infeasible solutions". The remedy to these problems is an ongoing investigation, but altering -tolerance or -diagonal_scaling frequently fixes the problem. Additional iterations usually do not solve nonconvergence problems.

Example problems

The keyword KNOBS is not used in the example problems.

Example
Explanation
Notes
Example problems

User's Guide to PHREEQC - 07 MAY 96
[Next] [Previous] [Up] [Top]

Generated with CERN WebMaker