water <- define_water(ph = 7, temp = 25, alk = 10)
# Dose 1 mg/L of hydrochloric acid
dosed_water <- chemdose_ph(water, hcl = 1)
# Dose 1 mg/L of hydrochloric acid and 5 mg/L of alum simultaneously
dosed_water <- chemdose_ph(water, hcl = 1, alum = 5)
# Softening:
water2 <- define_water(ph = 7, temp = 25, alk = 100, tot_hard = 350)
dosed_water2 <- chemdose_ph(water2, caco3 = -100, softening_correction = TRUE)
# \donttest{
example_df <- water_df %>%
define_water_chain() %>%
dplyr::slice_head(n = 3) %>%
dplyr::mutate(
hcl = c(2, 4, 6),
Caustic = 20
) %>%
chemdose_ph_chain(input_water = "defined_water", mgoh2 = c(20, 55), co2 = 4, naoh = Caustic)
# Initialize parallel processing
library(furrr)
# plan(multisession)
example_df <- water_df %>%
define_water_chain() %>%
chemdose_ph_chain(naoh = 5)
# Optional: explicitly close multisession processing
# plan(sequential)
# }
# \donttest{
example_df <- water_df %>%
define_water_chain() %>%
dplyr::slice_head(n = 3) %>%
chemdose_ph_once(input_water = "defined_water", mgoh2 = 55, co2 = 4)
# }
Run the code above in your browser using DataLab