Package 'edwards97'

Title: Langmuir Semi-Empirical Coagulation Model
Description: Implements the Edwards (1997) <doi:10.1002/j.1551-8833.1997.tb08229.x> Langmuir-based semi-empirical coagulation model, which predicts the concentration of organic carbon remaining in water after treatment with an Al- or Fe-based coagulant. Data and methods are provided to optimise empirical coefficients.
Authors: Dewey Dunnington [aut, cre] , Benjamin Trueman [aut] , William Raseman [aut] , Marc Edwards [ctb], Tai Tseng [ctb]
Maintainer: Dewey Dunnington <[email protected]>
License: GPL-3
Version: 0.1.1.9000
Built: 2024-11-06 03:10:51 UTC
Source: https://github.com/paleolimbot/edwards97

Help Index


Low-level langmuir coagulation calculations

Description

The Edwards (1997) model is a Langmuir-based semiempirical model designed to predict OC removal during alum coagulation. The model is on a non-linear function derived from physical relationships, primarily the process of Langmuir sorptive removal (Tipping 1981, Jekyl 1986).

Usage

coagulate(data, coefs)

coagulate_base(DOC, dose, pH, UV254, K1, K2, x1, x2, x3, b, root = -1)

Arguments

data

A data frame containing columns DOC, dose, pH, and UV254.

coefs

The output of edwards_coefs() or a similar named vector containing elements K1, K2, x1, x2, x3, b and root.

DOC

The initial DOC concentration (mg/L).

dose

The coagulant metal concentration (Al3+ or Fe3+) in mmol/L.

pH

The pH of coagulation.

UV254

The absorbance of UV254 (1/cm). With DOC, used to calculate SUVA.

K1, K2

Empirical fitting coefficients relating to SUVA.

x1, x2, x3

Empirical fitting coefficients relating to pH.

b

The Langmuir term.

root

The solution to the equation presented in Edwards (1997) is a quadratic with two roots. root can be 1 or -1 to account for these roots, however we see no evidence that anything except -1 here results in realistic predictions.

Value

A vector of predicted organic carbon concentrations (in mg/L) following coagulation.

References

Edwards, M. 1997. Predicting DOC removal during enhanced coagulation. Journal - American Water Works Association, 89: 78–89. https://doi.org/10.1002/j.1551-8833.1997.tb08229.x

Jekel, M.R. 1986. Interactions of humic acids and aluminum salts in the flocculation process. Water Research, 20: 1535-1542. https://doi.org/10.1016/0043-1354(86)90118-1

Tipping, E. 1981. The adsorption of aquatic humic substances by iron oxides. Geochimica et Cosmochimica Acta, 45: 191-199. https://doi.org/10.1016/0016-7037(81)90162-9

Examples

alum_jar_tests <- edwards_data("Al")
alum_jar_tests$DOC_final_model <- coagulate(alum_jar_tests, edwards_coefs("Al"))
plot(DOC_final_model ~ DOC_final, data = alum_jar_tests)

Calculate the dose of diminishing return

Description

Calculate the dose of diminishing return

Usage

dose_of_diminishing_returns(
  dose,
  DOC_final,
  molar_mass = 297,
  threshold = 0.3/10
)

dose_for_criterion(dose, DOC_final, criterion)

Arguments

dose

The coagulant metal concentration (Al3+ or Fe3+) in mmol/L.

DOC_final

The final DOC concentration, probably modeled using fit_edwards_optim() or fit_edwards() and coagulate_grid().

molar_mass

The moalr mass of the coagulant, in grams per mol Al or Fe.

threshold

The point of diminishing return threshold, in mg/L DOC per mg/L dose. Often this is taken to be 0.3 mg/L DOC per 10 mg/L dose (Brantby 2016).

criterion

A desired final DOC concentration in mg/L

Value

The dose (in mmol/L) of diminishing returns.

References

Bratby, J. 2016. Coagulation and Flocculation in Water and Wastewater Treatment. IWA Publishing. https://books.google.ca/books?id=PabQDAAAQBAJ

Examples

dose_curve <- coagulate_grid(fit_edwards("Low DOC"), DOC = 4, UV254 = 0.2, pH = 5.5)
dose_of_diminishing_returns(dose_curve$dose, dose_curve$DOC_final)
dose_for_criterion(dose_curve$dose, dose_curve$DOC_final, criterion = 3)

Coagulation coefficients

Description

These are coefficients intended for general use. Use fit_edwards_optim() to optimise these coefficients for a specific source water.

Usage

edwards_coefs(type)

edwards_data(type)

fit_edwards(type)

Arguments

type

One of "Low DOC", "Fe", "Al", "General-Fe", "General-Al", or "empty".

Value

A named vector of empirical coefficients to be used in coagulate().

References

Edwards, M. 1997. Predicting DOC removal during enhanced coagulation. Journal - American Water Works Association, 89: 78–89. https://doi.org/10.1002/j.1551-8833.1997.tb08229.x

Examples

edwards_coefs("Low DOC")

Example Jar Tests

Description

Example Jar Tests

Usage

edwards_jar_tests

Format

An object of class tbl_df (inherits from tbl, data.frame) with 1372 rows and 7 columns.

Author(s)

Marc Edwards and Tai Tseng

References

Edwards, M. 1997. Predicting DOC removal during enhanced coagulation. Journal - American Water Works Association, 89: 78–89. https://doi.org/10.1002/j.1551-8833.1997.tb08229.x


Fit Empirical Coefficients

Description

The coefficients calculated by Edwards (1997) and returned by edwards_coefs() were designed to produce reasonable results for several general cases, however each source water will have a set of empirical coefficients that produce more accurate predictions than the general case. This function calculates the optimal coefficients given a test set of known initial values (DOC)

Usage

fit_edwards_optim(
  data,
  initial_coefs = edwards_coefs("Al"),
  optim_params = list()
)

fit_edwards_coefs(coefs, data = edwards_data("empty"))

## S3 method for class 'edwards_fit_optim'
coef(object, ...)

## S3 method for class 'edwards_fit_coefs'
coef(object, ...)

## S3 method for class 'edwards_fit_base'
predict(object, newdata = NULL, ...)

coagulate_grid(
  object,
  DOC,
  UV254,
  dose = seq(0.01, 2, length.out = 50),
  pH = seq(5, 8, length.out = 50)
)

## S3 method for class 'edwards_fit_base'
fitted(object, ...)

## S3 method for class 'edwards_fit_base'
residuals(object, ...)

## S3 method for class 'edwards_fit_base'
tidy(x, ...)

## S3 method for class 'edwards_fit_base'
glance(x, ...)

## S3 method for class 'edwards_fit_base'
print(x, ...)

## S3 method for class 'edwards_fit_base'
plot(x, ...)

Arguments

data

A data frame with columns DOC (mg/L), dose (mmol/L), pH (pH units), UV254 (1/cm), and DOC_final (mg/L). See coagulate() for more information.

optim_params

Additional arguments to be passed to stats::optim().

coefs, initial_coefs

A set of initial coefficients from which to start the optimisation. Most usefully one of the coefficient sets returned by edwards_coefs().

object, x

A fit objected created with fit_edwards_optim().

...

Not used.

newdata

A data frame with columns DOC (mg/L), dose (mmol/L), pH (pH units), and UV254 (1/cm). If omitted, the data used to fit the model is used.

DOC

The initial DOC concentration (mg/L).

UV254

The absorbance of UV254 (1/cm). With DOC, used to calculate SUVA.

dose

The coagulant metal concentration (Al3+ or Fe3+) in mmol/L.

pH

The pH of coagulation.

Value

An S3 of type "edwards_fit_optim" with components:

data, initial_coefs, optim_params

References to inputs.

fit_optim

The fit object returned by stats::optim().