Apply solvect_o3 to a data frame and create new columns with ct and log removals.
Apply solvect_o3 to a data frame and create new columns with ct and log removals.
This function allows solvect_o3 to be added to a piped data frame. Three additional columns will be added to the data frame; ct_required (mg/Lmin), ct_actual (mg/Lmin), glog_removal
df: a data frame containing a water class column, which has already been computed using define_water_chain
input_water: name of the column of Water class data to be used as the input for this function. Default is "defined_water".
time: Retention time of disinfection segment in minutes.
dose: Ozone dose (mg/L as O3). This value can also be the y intercept of the decay curve (often slightly lower than ozone dose.)
kd: First order decay constant. This parameter is optional. If not specified, the default ozone decay equations will be used.
baffle: Baffle factor - unitless value between 0 and 1.
water_prefix: name of the input water used for the calculation will be appended to the start of output columns. Default is TRUE.
Returns
A data frame containing the original data frame and columns for required CT, actual CT, and giardia log removal.
Details
The data input comes from a water class column, initialized in define_water_chain.
For large datasets, using fn_once or fn_chain may take many minutes to run. These types of functions use the furrr package for the option to use parallel processing and speed things up. To initialize parallel processing, use plan(multisession) or plan(multicore) (depending on your operating system) prior to your piped code with the fn_once or fn_chain functions. Note, parallel processing is best used when your code block takes more than a minute to run, shorter run times will not benefit from parallel processing.