mosaic
calculates 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 (i.e. most stable) basis species can described as “mosaic diagrams”.
The function calculates the affinities using all combination of basis species given as a vector argument to bases
.
Or, a list can be provided contain any number of vectors that specify different groups of basis species.
All combinations of basis species in these groups are used for the calculations.
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).
The arguments in ...
are passed to affinity
to specify the variable conditions, such as temperature, pressure, and activities of other basis species.
blend
can be a single logical value or multiple values, in order to control the calculations for individual groups of 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.
This is appropriate when minerals, rather than aqueous species, are used as the changing basis species.
Note, however, that mosaic
is not internally recursive: the stabilities of one group of basis species (e.g. minerals) are not affected by changes in another group (e.g. aqueous species).
(“Stacked mosaic diagrams”) are useful for making diagrams for multi-metal systems.
By using the stable minerals in one calculation as the new basis species in a subsequent calculation, a series of stacked mosaic
diagrams with increasing complexity can be made.
Specifically, this is done by supplying previously calculated stabilities (from the predominant
element of the output of diagram
) as an element of the list in the stable
argument whose position corresponds to the appropriate group of basis species.
Note that a value in any position of the stable
list forces blend = FALSE
for the corresponding group of basis species, so there is no need to explicity change the blend
argument.
The activities of mosaiced basis species in each group are taken from the current basis
definition.
Generally it makes sense to set the activity of minerals to 1 (logact = 0) and the activity of aqueous species to some smaller value.
For mosaic stacking calculations where the mosaiced basis species include both minerals and aqueous species, the loga_aq
argument specifies the activity of aqueous species to be used in each group.
That is, there should be one value of loga_aq
for each group of basis species; use NA to indicate that the activity comes from the current basis
definition.
See the Mosaic Stacking 2 section of the vignette multi-metal for an example.