eq_sol_fixed: Calculate equilibrium solubility with fixed pH and pe

View source: R/eq_sol_fixed.R

eq_sol_fixedR Documentation

Calculate equilibrium solubility with fixed pH and pe

Description

Simulating extreme conditions may require fixing the pH or pe. This is accomplished here using tidyphreeqc::phr_pH_fix_definition(), with help from https://swilke-geoscience.net/post/phreeqc-mineral-solubility/.

Usage

eq_sol_fixed(
  ph,
  dic,
  phosphate = 0,
  phase,
  element,
  phase_quantity = 1,
  pe = 4,
  eq_phase_components = list(),
  new_phase = list(),
  phase_out = "Fix_pH",
  new_species = list(),
  surface_components = list(),
  output_components = list(),
  buffer = "NaOH",
  db = pbcu2sol,
  print = NULL,
  ...
)

pb_sol_fixed(..., element = "Pb")

cu_sol_fixed(..., element = "Cu")

Arguments

ph

pH

dic

Dissolved inorganic carbon, in mg C/L.

phosphate

Orthophosphate, in mg P/L.

phase

Equilibrium phase.

element

An element to return the equilibrium concentration of.

phase_quantity

Moles of equilibrium phase initially present.

pe

Set the pe of the solution.

eq_phase_components

Additional equilibrium phase components, passed to tidyphreeqc::phr_input_section as a list.

new_phase

Define phases not included in the database.

phase_out

Add an equilibrium phase to the output. Default is the pseudophase "Fix_pH".

new_species

Define solution species not included in the database.

surface_components

Components of a surface assemblage, passed to tidyphreeqc::phr_input_section as a list.

output_components

Additional output components, passed to tidyphreeqc::phr_input_section as a list.

buffer

Substance added or subtracted from the solution to yield the desired pH.

db

The database to use for equilibrium solubility computations. The default is leadsol

print

Choose whether to print the input file ("input"), the full output ("output"), or the selected output. Default is the latter.

...

Arguments passed on to tidyphreeqc::phr_input_section() as solution phase components. Concentrations should be expressed in mmol/kgw.

Value

A tibble with columns representing equilibrium phase, pH, dissolved inorganic carbon, orthophosphate (as P), pe, ionic strength (mu), total concentration of chosen element in solution, and moles of the equilibrium phase dissolved.

Functions

  • pb_sol_fixed(): Shorthand for eq_sol_fixed() with element = "Pb". For backwards compatibility.

  • cu_sol_fixed(): Shorthand for eq_sol_fixed() with element = "Cu". For backwards compatibility.

Examples

eq_sol_fixed(element = "Pb", ph = 6, dic = 5, phase = "Cerussite", buffer = "HCl")

bentrueman/pbcusol documentation built on Oct. 25, 2024, 1:06 p.m.