Learn R Programming

tidywater (version 0.7.0)

chemdose_dbp: Calculate DBP formation

Description

chemdose_dbp calculates disinfection byproduct (DBP) formation based on the U.S. EPA's Water Treatment Plant Model (U.S. EPA, 2001). Required arguments include an object of class "water" created by define_water chlorine dose, type, reaction time, and treatment applied (if any). The function also requires additional water quality parameters defined in define_water including bromide, TOC, UV254, temperature, and pH.

Usage

chemdose_dbp(
  water,
  cl2,
  time,
  treatment = "raw",
  cl_type = "chorine",
  location = "plant"
)

Value

A water class object with predicted DBP concentrations.

Arguments

water

Source water object of class "water" created by define_water

cl2

Applied chlorine dose (mg/L as Cl2). Model results are valid for doses between 1.51 and 33.55 mg/L.

time

Reaction time (hours). Model results are valid for reaction times between 2 and 168 hours.

treatment

Type of treatment applied to the water. Options include "raw" for no treatment (default), "coag" for water that has been coagulated or softened, and "gac" for water that has been treated by granular activated carbon (GAC). GAC treatment has also been used for estimating formation after membrane treatment with good results.

cl_type

Type of chlorination applied, either "chlorine" (default) or "chloramine".

location

Location for DBP formation, either in the "plant" (default), or in the distributions system, "ds".

Details

The function will calculate haloacetic acids (HAA) as HAA5, and total trihalomethanes (TTHM). Use summarise_wq to quickly tabulate the results.

Examples

Run this code
example_dbp <- suppressWarnings(define_water(8, 20, 66, toc = 4, uv254 = .2, br = 50)) %>%
  chemdose_dbp(cl2 = 2, time = 8)
example_dbp <- suppressWarnings(define_water(7.5, 20, 66, toc = 4, uv254 = .2, br = 50)) %>%
  chemdose_dbp(cl2 = 3, time = 168, treatment = "coag", location = "ds")

Run the code above in your browser using DataLab