tidywater0.10.0 package

Water Quality Models for Drinking Water Treatment Processes

balance_ions

Add an ion to balance overall charge in a water

biofilter_toc

Determine TOC removal from biofiltration using Terry & Summers BDOC mo...

blend_waters

Determine blended water quality from multiple waters based on mass bal...

calculate_activity

Calculate activity coefficients

calculate_corrosion

Calculate six corrosion and scaling indices (AI, RI, LSI, LI, CSMR, CC...

calculate_hardness

Calculate hardness from calcium and magnesium

chemdose_chloramine

Calculate chlorine and chloramine Concentrations with the breakpoint c...

chemdose_chlordecay

Calculate chlorine decay

chemdose_dbp

Calculate DBP formation

chemdose_ph

Calculate new pH and ion balance after chemical addition

chemdose_toc

Determine TOC removal from coagulation

convert_units

Calculate unit conversions for common compounds

convert_water

Convert water class object to a dataframe

correct_k

Correct acid dissociation constants

decarbonate_ph

Apply decarbonation to a water

define_water_chain

Apply define_water within a dataframe and output a column of water...

define_water_once

Apply define_water and output a dataframe

define_water

Create a water class object given water quality parameters

dissolve_cu_once

Calculate Dissolved Copper Concentration

dissolve_cu

Calculate Dissolved Copper Concentration

dissolve_pb

Simulate contributions of various lead solids to total soluble lead

modify_water

Modify a single slot in a water class object

ozonate_bromate

Calculate bromate formation

pac_toc

Calculate DOC Concentration in PAC system

pipe

Pipe operator

plot_ions

Create summary plot of ions from water class

pluck_water

Pluck out a single parameter from a water class object

solvecost_chem

Determine chemical cost

solvecost_labor

Determine labor cost

solvecost_power

Determine power cost

solvecost_solids

Determine solids disposal cost

solvect_chlorine

Determine disinfection credit from chlorine.

solvect_o3

Determine disinfection credit from ozone.

solvedose_alk

Calculate a desired chemical dose for a target alkalinity

solvedose_ph

Calculate a desired chemical dose for a target pH

solvemass_chem

Convert mg/L of chemical to lb/day

solvemass_solids

Determine solids lb/day

solveresid_o3

Determine ozone decay

summarize_wq

Create summary table from water class

tidywater-package

tidywater: Water Quality Models for Drinking Water Treatment Processes

Provides multiple water chemistry-based models and published empirical models in one standard format. As many models have been included as possible, however, users should be aware that models have varying degrees of accuracy and applicability. To learn more, read the references provided below for the models implemented. Functions can be chained together to model a complete treatment process and are designed to work in a 'tidyverse' workflow. Models are primarily based on these sources: Benjamin, M. M. (2002, ISBN:147862308X), Crittenden, J. C., Trussell, R., Hand, D., Howe, J. K., & Tchobanoglous, G., Borchardt, J. H. (2012, ISBN:9781118131473), USEPA. (2001) <https://www.epa.gov/sites/default/files/2017-03/documents/wtp_model_v._2.0_manual_508.pdf>.

  • Maintainer: Sierra Johnson
  • License: Apache License (>= 2) | MIT + file LICENSE
  • Last published: 2025-08-24