aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-10-27 18:15:29 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2017-10-27 18:15:29 +0200
commit06b528f0c19ca9f7a311612c0e9ae80c0d0c1d3f (patch)
tree4a848f6f825289cdd12d4ff10c26f582854cb792 /tests
parent2cd464455a22791c0450ada45a0e0128c637fade (diff)
Exposit runoff calculations for surface water
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/test_exposit.R25
1 files changed, 25 insertions, 0 deletions
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)
+})

Contact - Imprint