input-class: Class '"input"'

Description Objects from the Class Slots Methods Author(s) Examples

Description

The class provides a container for inputs required to invoke EmiStatR method.

Objects from the Class

Objects can be created by calls of the form input() or new("input").

Slots

spatial:

Object of class "numeric", 0 (default ) for non-spatial input, 1 for spatial input (not implemented).

zero:

Object of class "numeric", aproximation to zero value. Default 1E-5.

folder:

Object of class "character", path for the output. Default getwd()

cores:

Object of class "numeric", number of CPU cores to be used in parallel computing. If cores = 0 no parallel computation is done. Default 1.

ww:

Object of class "list". This list contains three numeric elements for the wastewater characteristics. First element qs, individual water consumption of households [l/(PE d)]. Second element CODs, sewage pollution - COD concentration [g/(PE d)]. Third element NH4s, sewage pollution - NH4 concentration [g/(PE d)].

inf:

Object of class "list". This list contains three numeric elements for infiltration water characteristics. First element qf, infiltration water inflow [l/(s ha)]. Second element CODf, infiltration water pollution - COD concentration [g/(PE d)]. Third element NH4f, infiltration water pollution - NH4 concentration [g/(PE d)].

rw:

Object of class "list". This list contains three elements for rainwater characteristics. First element CODr (numeric), rainwater pollution - COD concentration [mg/l]. Second element NH4r (numeric), rainwater pollution - NH4 concentration [mg/l]. Third element stat (character), name of the rain measurement station.

P1:

Object of class "data.frame" with two columns named 1. "time" for specifying the date and time in format YYYY-m-d HH:MM:SS, 2. "P [mm]" for specifying the depth values of the rainfall time series in millimeters. Optionally, instead of rainfall depth values can be provided values of direct runoff in cubic meters entering in the system. If runoff values are provided then the second column containing these values should be named as "Runoff_Volume" or "runoff_volume", otherwise this column is treated as rainfall depth.

st:

Object of class "list". This object contains n lists, where n is the number of structures to simulate. Every list should contain 18 elements: id, numeric, identification number [-]; ns, character, name of the structure [-]; nm, character, name of the municipality [-]; nc, character, name of the catchment [-]; numc, numeric, number of the catchment [-]; use, character, use of the soil [-]; Atotal, numeric, total area [ha]; Aimp, numeric, impervious area [ha]; tfS, numeric, time flow structure [time step]; pe, numeric, population equivalent [PE]; V, numeric, volume [m3]; lev2vol, list of 2, lev and vol, defining the curve lev (level [m]) to vol (volume [m3]); Qd, numeric, maximum throttled outflow [l/s]; Dd, numeric, orifice diameter [m]; Cd, numeric, orifice coefficient [-]; Cimp, numeric, coefficient for impervious area [-]; and Cper, numeric, coefficient for pervious area [-].

pe.ts.file:

Object of class "character" with the path and file name of the comma separated value (csv) file that contains the montly (seasonal) factors for population equivalent (pe). The first column of this file should be "time" in format "Y-m-d H:M:S" and should span for the entire length of the desired time series. The second column should contain the population equivalent as numeric class for the specified time, i.e. the desired pe time series with daily, weekly and monthly factors already applied. Default empty string (""). If not empty string is defined then pe.daily.file, pe.weekly, pe.seasonal are omitted.

pe.daily.file:

Object of class "data.frame" that contains the daily factors for population equivalent. The first column should be the time in format "H:M:S" and should span for 24 hours. The second column should contain the factors as numeric class for the specified time. These factors must average to 1.

pe.weekly:

Object of class "list" that contains the factors for population equivalent per day of the week with 7 elements called "mon" for Monday, "tue" for Tuesday, "wed" for Wednesday, "thu" for Thursday, "fri" for Friday, "sat" for Saturday, and "sun" for Sunday. These factors must average to 1.

pe.seasonal:

Object of class "list" that contains the factors for population equivalent per month of the year with 12 elements called with the three first lower case letters of the month from "jan" for January to "dec" for December. These factors must average to 1.

qs.ts.file:

Object of class "character" with the path and file name of the comma separated value (csv) file that contains the monthly (seasonal) factors for water consumption (qs). The first column of this file should be "time" in format "Y-m-d H:M:S" and should span for the entire length of the desired time series. The second column should contain the population equivalent as numeric class for the specified time, i.e. the desired qs time series with daily, weekly and monthly factors already applied. Default empty string (""). If not empty string is defined then pe.daily.file, pe.weekly, pe.seasonal are omitted.

qs.daily.file:

Object of class "character" with the path and file name of the comma separated value (csv) file that contains the daily factors for water consumption. The first column of this file should be the time in format "H:M:S" and should span for 24 hours. The second column should contain the factors as numeric class for the specified time. These factors must average to 1.

qs.weekly:

Object of class "list" that contains the factors for water consumption per day of the week with 7 elements called "mon" for Monday, "tue" for Tuesday, "wed" for Wednesday, "thu" for Thursday, "fri" for Friday, "sat" for Saturday, and "sun" for Sunday. These factors must average to 1.

qs.seasonal:

Object of class "list" that contains the factors for water consumption per month of the year with 12 elements called with the three first lower case letters of the month from "jan" for January to "dec" for December. These factors must average to 1.

export:

Object of class "numeric". If 1 (default) then the results are saved in folderOutput. Set to 0 for not writing in output files.

Methods

EmiStatR

signature(x = "input"): execute EmiStatR function

Author(s)

J.A. Torres-Matallana

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## loading EmiStatR
library("EmiStatR")
showClass("input")

## running EmiStatR with user defined input
data("Esch_Sure2010")
P1 <- Esch_Sure2010[1:1000,]  # selecting just the first 1,000 rows
station <- "Esch-sur-Sure"

# defining estructures E1
E1 <- list(id = 1, ns = "FBH Goesdorf", nm = "Goesdorf", nc = "Obersauer", numc = 1, 
           use = "R/I", Atotal = 36, Aimp = 25.2, Cimp = 0.80, Cper = 0.30,
           tfS = 1, pe = 650, Qd = 5, 
           Dd = 0.15, Cd = 0.18, V = 190, lev.ini = 0.10,
           lev2vol = list(lev = c(.06, 1.10, 1.30, 3.30), 
                          vol = c(0.5, 31, 45, 190))
           )

# defining Input objet
input.user <- input(spatial = 0, zero = 1e-5, folder = getwd(),
                    cores = 1,
                    ww = list(qs = 150, CODs = 104, NH4s = 4.7), 
                    inf = list(qf= 0.04, CODf = 0, NH4f =0),
                    rw = list(CODr = 0, NH4r = 0, stat = station), 
                    P1 = P1, st = list(E1=E1), export = 0)

str(input.user)

# invoking EmiStatR
sim <- EmiStatR(input.user)

## a visualisation example 
dev.new()
par(mfrow=c(2,2), oma = c(0,0,2,0))
plot(x=sim[[1]][[1]][[2]], y=sim[[1]][[1]][[3]], typ="l", col="blue", 
     xlab = "time", ylab = colnames(sim[[1]][[1]])[3], main = "Precipitation")
plot(x=sim[[1]][[1]][[2]], y=sim[[1]][[1]][[10]], typ="l", col="blue", 
     xlab = "time", ylab = colnames(sim[[1]][[1]])[10], main = "CSO, volume")
plot(x=sim[[1]][[1]][[2]], y=sim[[1]][[1]][[13]], typ="l", col="blue", 
     xlab = "time", ylab = colnames(sim[[1]][[1]])[13], main = "CSO, COD concentration")
plot(x=sim[[1]][[1]][[2]], y=sim[[1]][[1]][[14]], typ="l", col="blue", 
     xlab = "time", ylab = colnames(sim[[1]][[1]])[14], main = "CSO, NH4 concentration")
mtext(paste("Structure", sim[[1]][[3]][[1]]), outer=TRUE, cex = 1.5)

EmiStatR documentation built on Sept. 28, 2021, 9:08 a.m.