Description Usage Arguments Details Value Examples
Mass balance and charge balance solver for chemical equilibria at 0.5 kb. This is a wrapper function for chemsolve_generic and prods.
1 2 3 4 |
Tc |
Temperature (degrees C - between 300 and 400) |
Nat |
Sodium concentration (mol/kg); total |
Kt |
Potassium (mol/kg); total |
Clt |
Chloride (mol/kg); total |
SO4t |
Sulphate (mol/kg); total |
Cat |
Calcium (mol/kg); total |
Mgt |
Magnesium (mol/kg); total |
start |
Initial guess for the calculated equilbrium concentrations of the basis species (in the order of H+, OH-, Na+, K+, Cl-, SO42+, Ca2+, Mg2+). |
maxitr |
Maximum number of iterations |
exprod |
A vector of the names of the additional complex(es) |
exconstit |
A vector of the chemical symbol names of the the basis species that are constitute each of the the additional complexes |
exnumz |
A vector of the stiochiometry given by the equilibrium reaction for each of the additional complexes |
excharges |
A vector of the charge of the additional complex species |
exa |
A vector of the ion size parameters for the complexes of the additional complex species |
exK |
A vector of the log K of the dissociation constants of the additional complex species |
bal |
Species to balance against (Defaults to Cl, can also be set to NULL for none) |
A wrapper for the chemsolve_generic function that allow easy addition of product species.
Use the generic function (chemsolve_generic) if new basis species need to be added or if the log K/temperature range is extended (up or down).
Normally total moles anions = total moles cations. The charge balance (without any speciation) is adjusted to zero
by balancing against Cl- (default) as otherwise the calculation can be too sensitive to H+. The balancing species can be easily changed to any of the other basis species (or none).
Choose reasonable starting values; for H+, OH- and equilibrium concentrations of the basis species.
If negative concentrations are calculated, choose better initial starting values.
If bal = NULL and a large excess of chloride (or sulphate) is present this will simulate the addition of acid HCl. In this case use a higher starting concentration of H+.
To exclude a basis value set the basis concentration to zero and the concentrations of this and the derived species
will be vanishing small and can be ignored. In the generic version of the program the basis species are simply left out.
The basis species are: Na+, K+, Mg2+, Ca2+, Cl-, SO42-. The default complexes are: NaCl°, KCl°, HCl°, KOH°, NaOH°, KSO4-, NaSO4-,HSO4-,CaSO4°,MgSO4°, MgCl+,CaCl+,CaCl2°,MgOH+,CaOH+.
Additional complexes based on the existing basis species can easily be added (see example below).
To set up a problem in chemsolve or chemsolve_generic it is relatively trivial to set up and manipulate a sequence of commands in Excel and cut and past into R.
Complex dissociation constants (log K) are from SupCrt 92 slop98.dat http://geopig.asu.edu/?q=tools
The Debye_Hückel parameters (A, B) equations are polynomial fits to data at 0.5 kb from tables in Helgeson & Kirkham (1974).
Note Bdot is not used.
Helgeson H. C. and Kirkham D. H. (1974) Theoretical prediction of the thermodynamic behavior of aqueous electrolytes at high pressures and temperatures: II. Debye-Hückel parameters for activity coefficients and relative partial molar properties American Journal of Science 274, 1199-1261.
A list containing the concentrations, activity coefficients, and pH at equilibrium
1 2 3 4 5 6 7 8 9 10 11 | ## Add KHSO4° as an additional complex given the existing list of basis species and
## calculate the equilibrium concentrations and pH at 400°C.
chemsolve(exprod = c("KHSO4"), exconstit = c("K", "H", "SO4"),
exnumz = c(3), excharges = c(0), exa = c(0), exK = c(-8.701), bal = "Cl")
## Determine the equilibria at a range of temperatures.
## Additional complexes can be added per the previous example.
temps <- seq(300,400,10) #A vector of temperatures repeating every 10 degrees from 300 to 400
## Na concentration is changed slightly from the default. Further parameters can be added.
r <- lapply(temps,chemsolve,Nat=0.45) #Creates a list of the results
r[[1]] #Display results from first temperature
r[[10]] #Display the results of the 10th temperature
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.