aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/PEC_sw_focus.R31
-rw-r--r--R/PELMO_runs.R2
2 files changed, 25 insertions, 8 deletions
diff --git a/R/PEC_sw_focus.R b/R/PEC_sw_focus.R
index 21ed514..c614593 100644
--- a/R/PEC_sw_focus.R
+++ b/R/PEC_sw_focus.R
@@ -15,19 +15,24 @@
#' http://esdac.jrc.ec.europa.eu/projects/stepsonetwo
#' @note The formulas for input to the waterbody via runoff/drainage of the
#' parent and subsequent formation of the metabolite in water is not
-#' documented in the model description coming with the calculator
-#' @note Step 2 is not implemented
+#' documented in the model description coming with the calculator. As one would
+#' expecte, this additional input appears to be (as we get the same results)
+#' calculated by multiplying the application rate with the molar weight
+#' correction and the formation fraction in water/sediment systems.
+#' @note Step 2 is not implemented.
#' @export
-#' @param parent A list containing substance specific parameters
+#' @param parent A list containing substance specific parameters, e.g.
+#' conveniently generated by \code{\link{chent_focus_sw}}.
#' @param rate The application rate in g/ha. Overriden when
#' applications are given explicitly
#' @param n The number of applications
#' @param i The application interval
-#' @param met A list containing metabolite specific parameters. If not NULL,
+#' @param met A list containing metabolite specific parameters. e.g.
+#' conveniently generated by \code{\link{chent_focus_sw}}. If not NULL,
#' the PEC is calculated for this compound, not the parent.
#' @param f_drift The fraction of the application rate reaching the waterbody
#' via drift. If NA, this is derived from the scenario name and the number
-#' of applications via the drift data defined by the
+#' of applications via the drift data defined by the
#' \code{\link{FOCUS_Step_12_scenarios}}
#' @param f_rd The fraction of the amount applied reaching the waterbody via
#' runoff/drainage. At Step 1, it is assumed to be 10%, be it the
@@ -138,8 +143,20 @@ PEC_sw_focus <- function(parent, rate, n = 1, i = NA,
PEC[as.character(t_out[-1]), "PECsed"] = PEC_sed_0_part * exp( - k_ws * t_out[-1])
# TWA concentrations
- PEC["1", "TWAECsw"] = (PEC_sw_0 + PEC["1", "PECsw"]) / 2
- PEC["1", "TWAECsed"] = (PEC_sed_0 + PEC["1", "PECsed"]) / 2
+ PEC_sw_1 = PEC["1", "PECsw"]
+ PEC_sed_1 = PEC["1", "PECsed"]
+ TWAEC_sw_1 = (PEC_sw_0 + PEC_sw_1) / 2
+ TWAEC_sed_1 = (PEC_sed_0 + PEC_sed_1) / 2
+
+ TWAEC_after = function(TWAEC_1, PEC_1, t) {
+ (TWAEC_1 + PEC_1 * (1 - exp(- k_ws * (t - 1))) / k_ws) / t
+ }
+
+ PEC["1", "TWAECsw"] = TWAEC_sw_1
+ PEC["1", "TWAECsed"] = TWAEC_sed_1
+
+ PEC[as.character(t_out[-1]), "TWAECsw"] = TWAEC_after(TWAEC_sw_1, PEC_sw_1, t_out[-1])
+ PEC[as.character(t_out[-1]), "TWAECsed"] = TWAEC_after(TWAEC_sed_1, PEC_sed_1, t_out[-1])
# Check if PEC_sw_max is above water solubility
PEC_sw_max = max(PEC[, "PECsw"])
diff --git a/R/PELMO_runs.R b/R/PELMO_runs.R
index b152b4d..c0d1266 100644
--- a/R/PELMO_runs.R
+++ b/R/PELMO_runs.R
@@ -26,7 +26,7 @@
#' @param cores The number of cores to execute PELMO runs in parallel
#' @param evaluate Should the results be returned?
#' @param overwrite Should existing run directories be overwritten?
-#' @references PELMO.installeR \url{https://jranke.github.io/PELMO.installeR}
+#' @references PELMO.installeR \url{https://pkgdown.jrwb.de/PELMO.installeR}
#'
#' Wine \url{https://winehq.org}
#'

Contact - Imprint