Skip to content

Instantly share code, notes, and snippets.

@paleolimbot
Last active March 1, 2019 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paleolimbot/409d0e68c48cc89aed9ef56764cde398 to your computer and use it in GitHub Desktop.
Save paleolimbot/409d0e68c48cc89aed9ef56764cde398 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(tidyphreeqc)
phr_input(
phr_surface_master_species("Iron_oxy", "Iron_oxyOH"),
phr_surface_species("Iron_oxyOH = Iron_oxyOH"),
phr_surface_species("Iron_oxyOH + Zn+2 = Iron_oxyOZn+ + H+", log_k = -1.99),
phr_solution("Zn" = 0.1, units = "mol/kgw"),
phr_surface(
Iron_oxyOH = phr_surface_item(sites = 0.07, specific_area_per_gram = 600, grams = 30)
),
phr_selected_output(molalities = c("Zn+2", "Iron_oxyOH", "Iron_oxyOZn+"))
) %>%
phr_run() %>%
#phr_print_output()
as_tibble() %>%
slice(3) %>%
select(pH, starts_with("m_"))
@paleolimbot
Copy link
Author

library(tidyverse)
library(tidyphreeqc)
phr_input(
  phr_surface_master_species("Iron_oxy", "Iron_oxyOH"),
  phr_surface_species("Iron_oxyOH = Iron_oxyOH"),
  phr_surface_species("Iron_oxyOH + Zn+2 = Iron_oxyOZn+ + H+", log_k = -1.99),
  phr_solution("Zn" = 0.1, units = "mol/kgw"),
  phr_surface(
    Iron_oxyOH = phr_surface_item(sites = 0.07, specific_area_per_gram = 600, grams = 30)
  ),
  phr_selected_output(molalities = c("Zn+2", "Iron_oxyOH", "Iron_oxyOZn+"))
) %>%
  phr_run() %>%
  #phr_print_output()
  as_tibble() %>%
  slice(3) %>%
  select(pH, starts_with("m_"))
#> # A tibble: 1 x 4
#>      pH `m_Zn+2(mol/kgw)` `m_Iron_oxyOH(mol/kgw)` `m_Iron_oxyOZn+(mol/kgw)`
#>   <dbl>             <dbl>                   <dbl>                     <dbl>
#> 1     7            0.0995                 0.00401                    0.0660

Created on 2019-03-01 by the reprex package (v0.2.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment