mosaic: Chemical Affinities with Changing Basis Species

Description Usage Arguments Details Value References See Also Examples

View source: R/mosaic.R

Description

Calculate chemical affinities of formation reactions of species using basis species that change with the conditions.

Usage

1
  mosaic(bases, bases2 = NULL, blend = TRUE, ...)

Arguments

bases

character, basis species to be changed in the calculation, or list, containing vectors for each group of changing basis species

bases2

character, second set of changing basis species

blend

logical, use relative abundances of basis species?

...

additional arguments to be passed to affinity

Details

mosaic can be used to calculate the affinities of formation of species when the relative abundances of the basis species listed in bases change over the range of conditions, due to e.g. ionization, complexation or redox reactions. This is a way to “speciate the basis species”. For example, the speciation of sulfur (SO4-2, HSO4-, HS- and H2S) as a function of Eh and pH affects the formation affinities, and therefore relative stabilities of iron oxide and sulfide minerals. Chemical activity diagrams constructed by assembling sub-diagrams corresponding to the predominant basis species can described as “mosaic diagrams”.

The function calculates the affinities using all combination of basis species given as vector arguments to bases and bases2. The first species listed in each group should be in the current basis definition, and all the basis species in each group should be related to the first basis species there (i.e. all share the same element). A second, independent set of basis species can be provided in bases2 (for example CO3-2, HCO3-, CO2, if the first set of basis species are the sulfur-bearing ones listed above). The arguments in ... are passed to affinity to specify the variable conditions, such as temperature, pressure, and activities of other basis species.

If blend is TRUE (the default), the relative abundances of the basis species in each group are calculated using equilibrate, with the total activity taken from the corresponding basis species in the incoming basis definition. Then, the function calculates overall affinities of the formation reactions of each species by combining reactions written using individual basis species in proportion to the relative abundances of the basis species. If blend is FALSE, the function returns the affinities calculated using the single predominant basis species in bases at each condition.

A more flexible method of specifying multiple sets of basis species is now available. Instead of using bases and bases2, supply a list for just the bases argument. The list should contain any number of vectors specifying the groups of basis species. All combinations of basis species in these groups are used for the calculations. This overcomes the prior limitation of only having two changing groups of basis species.

Value

A list containing A.species (affinities of formation of the species with changing basis species) and A.bases (affinities of formation of the basis species in terms of the first basis species), each having same structure as the list returned by affinity. If blend is TRUE, the output also contains E.bases (the output of equilibrate for each group of basis species) If bases2 is provided, the list also contains A.bases2 (affinities of formation of the second group of basis species).

References

Garrels, R. M. and Christ, C. L. (1965) Solutions, Minerals, and Equilibria, Harper & Row, New York, 450 p. http://www.worldcat.org/oclc/517586

See Also

demo("mosaic"), extending the example below by addition of carbonate species in bases2, and using thermodynamic data from Garrels and Christ, 1965. The help page of solubility has an example combining mosaic with solubility calculations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Fe-minerals and aqueous species in Fe-S-O-H system
# speciate SO4-2, HSO4-, HS-, H2S as a function of Eh and pH
# after Garrels and Christ, 1965 Figure 7.20
pH <- c(0, 14, 250)
Eh <- c(-1, 1, 250)
T <- 25
basis(c("FeO", "SO4-2", "H2O", "H+", "e-"))
basis("SO4-2", -6)
species(c("Fe+2", "Fe+3"), -6)
species(c("pyrrhotite", "pyrite", "hematite", "magnetite"))
# the basis species we'll swap through
bases <- c("SO4-2", "HSO4-", "HS-", "H2S")
# calculate affinities using the relative abundances of the basis species
# NOTE: set blend = FALSE for sharp transitions between the basis species
# (looks more like the diagram in GC65)
m1 <- mosaic(bases, pH = pH, Eh = Eh, T = T)
# make a diagram and add water stability lines
d <- diagram(m1$A.species, lwd = 2)
water.lines(d, col = "seagreen", lwd = 1.5)
# show lines for Fe(aq) = 10^-4 M
species(c("Fe+2", "Fe+3"), -4)
m2 <- mosaic(bases, pH = pH, Eh = Eh, T = T)
diagram(m2$A.species, add = TRUE, names = FALSE)
title(main=paste("Iron oxides and sulfides in water, log(total S) = -6",
  "After Garrels and Christ, 1965", sep="\n"))
legend("bottomleft", c("log(act_Fe) = -4", "log(act_Fe) = -6"), lwd = c(2, 1), bty = "n")
# we could overlay the basis species predominance fields
#diagram(m1$A.bases, add=TRUE, col="blue", col.names="blue", lty=3)

Example output

CHNOSZ version 1.3.2 (2019-04-20)
reset: creating "thermo" object
obigt: loading default database with 1841 aqueous, 3360 total species
      Fe H O S  Z ispecies logact state
FeO    1 0 1 0  0      625      0    aq
SO4-2  0 0 4 1 -2       24      0    aq
H2O    0 2 1 0  0        1      0   liq
H+     0 1 0 0  1        3      0    aq
e-     0 0 0 0 -1        2      0    aq
      Fe H O S  Z ispecies logact state
FeO    1 0 1 0  0      625      0    aq
SO4-2  0 0 4 1 -2       24     -6    aq
H2O    0 2 1 0  0        1      0   liq
H+     0 1 0 0  1        3      0    aq
e-     0 0 0 0 -1        2      0    aq
  FeO SO4-2 H2O H+ e- ispecies logact state name
1   1     0  -1  2  0      527     -6    aq Fe+2
2   1     0  -1  2 -1      528     -6    aq Fe+3
  FeO SO4-2 H2O H+ e- ispecies logact state       name
1   1     0  -1  2  0      527     -6    aq       Fe+2
2   1     0  -1  2 -1      528     -6    aq       Fe+3
3   1     1  -5 10  8     1885      0    cr pyrrhotite
4   1     2  -9 18 14     1884      0    cr     pyrite
5   2     0   1 -2 -2     2481      0    cr   hematite
6   3     0   1 -2 -2     2489      0    cr  magnetite
info.character: found H2S(aq); other available state is gas
affinity: temperature is 25 C
affinity: pressure is Psat
affinity: variable 1 is pH at 250 values from 0 to 14
affinity: variable 2 is Eh at 250 values from -1 to 1 V
subcrt: 15 species at 298.15 K and 1 bar (wet)
subcrt: 3 phases for pyrrhotite ... phase 1 is stable
mosaic: calculating affinities of basis species group 1: SO4-2 HSO4- HS- H2S
mosaic: calculating affinities of species for all 4 combinations of the basis species
balance: moles of SO4-2 in formation reactions
equilibrate: n.balance is 1 1 1 1
equilibrate: loga.balance is -2.39794000867204
equilibrate: using boltzmann method
balance: moles of FeO in formation reactions
diagram: using maximum affinity method for 2-D diagram
  FeO SO4-2 H2O H+ e- ispecies logact state       name
1   1     0  -1  2  0      527     -4    aq       Fe+2
2   1     0  -1  2 -1      528     -4    aq       Fe+3
3   1     1  -5 10  8     1885      0    cr pyrrhotite
4   1     2  -9 18 14     1884      0    cr     pyrite
5   2     0   1 -2 -2     2481      0    cr   hematite
6   3     0   1 -2 -2     2489      0    cr  magnetite
info.character: found H2S(aq); other available state is gas
affinity: temperature is 25 C
affinity: pressure is Psat
affinity: variable 1 is pH at 250 values from 0 to 14
affinity: variable 2 is Eh at 250 values from -1 to 1 V
subcrt: 15 species at 298.15 K and 1 bar (wet)
subcrt: 3 phases for pyrrhotite ... phase 1 is stable
mosaic: calculating affinities of basis species group 1: SO4-2 HSO4- HS- H2S
mosaic: calculating affinities of species for all 4 combinations of the basis species
balance: moles of SO4-2 in formation reactions
equilibrate: n.balance is 1 1 1 1
equilibrate: loga.balance is -2.39794000867204
equilibrate: using boltzmann method
balance: moles of FeO in formation reactions
diagram: using maximum affinity method for 2-D diagram

CHNOSZ documentation built on July 7, 2020, 3 p.m.