From 06b528f0c19ca9f7a311612c0e9ae80c0d0c1d3f Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 27 Oct 2017 18:15:29 +0200 Subject: Exposit runoff calculations for surface water --- tests/testthat/test_exposit.R | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/testthat/test_exposit.R (limited to 'tests/testthat') diff --git a/tests/testthat/test_exposit.R b/tests/testthat/test_exposit.R new file mode 100644 index 0000000..667b4ee --- /dev/null +++ b/tests/testthat/test_exposit.R @@ -0,0 +1,25 @@ +library(pfm) +context("Exposit runoff calculations") + +test_that("Runoff PECsw are as in Exposit 3.01", { + # Expected results are from the Exposit 3.01, downloaded 2017-10-27 + + # 100 g/ha, Koc = 1000 L/kg, DT50 = 1000 days + PEC_spreadsheet_1 <- data.frame(dissolved = c(0.706, 0.612, 0.525, 0.367), + total = c(0.783, 0.679, 0.546, 0.377)) + + PEC_pfm_1 <- round(PEC_sw_exposit_runoff(100, Koc = 1000, DT50 = 1000)$PEC_sw_runoff, 3)[c("dissolved", "total")] + expect_equivalent(PEC_spreadsheet_1, PEC_pfm_1) + + # 10 g/ha, Koc = 300000 L/kg, DT50 = 10 days + PEC_spreadsheet_2 <- data.frame(dissolved = c(0, 0, 0, 0), + total = c(0.141, 0.122, 0.039, 0.018)) + PEC_pfm_2 <- round(PEC_sw_exposit_runoff(10, Koc = 300000, DT50 = 10)$PEC_sw_runoff, 3)[c("dissolved", "total")] + expect_equivalent(PEC_spreadsheet_2, PEC_pfm_2) + + # 200 g/ha, Koc = 30 L/kg, DT50 = 100 days + PEC_spreadsheet_3 <- data.frame(dissolved = c(1.138, 0.986, 0.845, 0.592), + total = c(1.138, 0.986, 0.845, 0.592)) + PEC_pfm_3 <- round(PEC_sw_exposit_runoff(200, Koc = 30, DT50 = 100)$PEC_sw_runoff, 3)[c("dissolved", "total")] + expect_equivalent(PEC_spreadsheet_3, PEC_pfm_3) +}) -- cgit v1.2.1