Title: | Connectable Separate Sewer System to Small Surface Waters - An Immission Based Assessment |
---|---|
Description: | The R package is used to define a tolerable pollutant input into small surface waters via rainwater runoff. It assigns a maximal connectable urban area to the surface water. For planning areas, different scenarios regarding the connection of surfaces to the separate sewer system and runoff water treatment can be calculated. |
Authors: | Malte Zamzow [aut, cre] , Wolfgang Seis [aut] , Andreas Matzinger [aut] , Hauke Sonnenberg [ctb] , Michael Rustler [ctb, rev] , R2Q [fnd], Kompetenzzentrum Wasser Berlin gGmbH (KWB) [cph] |
Maintainer: | Malte Zamzow <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2024-11-15 03:37:11 UTC |
Source: | https://github.com/KWB-R/r2q |
Calculate pollutant input from runoff area area within a rain event
area_from_load(load_runoff, Ci_storm, coeff_runoff, q_rain, t_rain)
area_from_load(load_runoff, Ci_storm, coeff_runoff, q_rain, t_rain)
load_runoff |
Pollutant load from urban area. Mass unit is one unit larger (factor 1000) as in concentration. For example: if Ci_storm is in ug/L, load must be in mg. |
Ci_storm |
Concentration in stormwater run-off for substance i. |
coeff_runoff |
runoff coefficient of runoff area. |
q_rain |
rain amount in mm/(ha*s) |
t_rain |
duration of rain in s |
Numeric value of the according connectable area in ha
immission_assessment()
for all substances that might
pose a risk and returns the results in three tablesRuns function immission_assessment()
for all substances that might
pose a risk and returns the results in three tables
assess_all_hazards( hazard_list, site_data, c_table, q_rain, t_rain, c_type = "average" )
assess_all_hazards( hazard_list, site_data, c_table, q_rain, t_rain, c_type = "average" )
hazard_list |
Hazard list created by function |
site_data |
Site data list created by function |
c_table |
Table with concentions in the river, in rainwater runoff and threshold values |
q_rain |
Intensity of a rain event in L/(ha*s) |
t_rain |
Length of a rain event in s |
c_type |
Character value specifiyng the type of concentration that is used for the assessment. Either "average" for median value or "worstcase" for 95th quantile concentration in rainwater runoff. |
A list of three tables. 1) General information about the whole urbanised area calculated with data of the landuse types. 2) Detailad information about connectable area of the planning area taking into account the status quo of the surrounding urbanised area. 3) Detailad information about the connectable area of the planning area, scaled down from the overall connectable area.
Uses the site data to calculate a natural stormwater run-off for a yearly rain event
calculate_tolerable_discharge( area_catch = 10, area_urban = 1, area_plan = 0, area_urban_upstream = area_catch/4, slope_catch = 0.1, Hq1pnat_catch = NULL, Hq2pnat_catch = NULL, verbose = TRUE )
calculate_tolerable_discharge( area_catch = 10, area_urban = 1, area_plan = 0, area_urban_upstream = area_catch/4, slope_catch = 0.1, Hq1pnat_catch = NULL, Hq2pnat_catch = NULL, verbose = TRUE )
area_catch |
catchment area in km2 |
area_urban |
urban area around the planning area in km2 |
area_plan |
planning area in km2 (default is 0 -> no planning area) |
area_urban_upstream |
urbanised area further upstream of the planning area in km2 (Default is 1/4 of the catchment area) |
slope_catch |
average slope of the catchment area in % (Defalut is 0.1) |
Hq1pnat_catch |
natural average catchment discharge for a yearly rain event in L/(s*km²) (Defautl is NULL) |
Hq2pnat_catch |
natural average catchment discharge for a bienneal rain event in L/(s*km²) (Defautl is NULL) |
verbose |
if TRUE returns results as informative messages, If FALSE only return numeric value for planning area. |
Table with tolerable discharge for the whole Catchment and planning area in L/s. Furthermore, x is given which is a factor for allowed discharge increase compared to the natural status and is included in the calculation for the tolerable discharges. The definition of x can be found in guideline DWA-A 102-3
Check if substances pose a risk to the surface water
check_all_substances(c_table, c_type = "average")
check_all_substances(c_table, c_type = "average")
c_table |
Table of concentration (rainwater, river, threshold value) |
c_type |
Character value specifiyng the type of concentration that is used for the assessment. Either "average" for median value or "worstcase" for 95th quantile concentration in rainwater runoff. |
A list with all substances defined in c_table and assigning either 1 or TRUE, if the substance might pose a risk, "Inf" if the substance does not constrain the seperate sewer connection, and "-Inf" if ther substance should not be discharged into the surface water at all, because concentration is already too high.
Checks if the pollutant i is a constraint for the connected area
check_pollutant_impact(Ci_river, Ci_threshold, Ci_storm)
check_pollutant_impact(Ci_river, Ci_threshold, Ci_storm)
Ci_river |
Background concentration for substance i. Concentration unit must fit to Ci_threshold and Ci_storm. |
Ci_threshold |
Threshold value for substance i. Concentration unit must fit to Ci_river and Ci_storm. |
Ci_storm |
Concentration in stormwater run-off for substance i. Concentration unit must fit to Ci_threshold and Ci_river. |
Inf if the pollutant is no constraint, -Inf if the pollutant should not be discharged at all, and TRUE if the tolerable load can be calculated
This function reduces the input tables to the columns "Substance", "Unit", renames the Value column according to the table data and combines all tables
combine_concentration_tables( threshold_table, storm_table, background_table, onlyComplete = FALSE )
combine_concentration_tables( threshold_table, storm_table, background_table, onlyComplete = FALSE )
threshold_table |
the internal threshold table loaded with "get_thresholds" |
storm_table |
the internal stormwater concentration table loaded with "get_stormwater_concentrations" |
background_table |
the filled in background pollution data table (Excel File) loaded with "load_background_data" |
onlyComplete |
If TRUE (default) only such substances remain in the data frame with complete concentration triplet (threshold, stromwater, river) in the same unit |
Caution: This function uses the Column names of the tables. Do not change the first two column names of the pollution data. Column names must be
"Substance" and 2) "Unit".
A data frame with the information threshold values, threshold value type, background concentration and stormwater concentration per substance and concentration unit.
Get allowed impervious area
get_allowed_area(f_D, Q_tol, q_rain)
get_allowed_area(f_D, Q_tol, q_rain)
f_D |
Run-off coefficient of impervious area |
Q_tol |
Tolearble discharge into the surface water in L/s |
q_rain |
presipitaion rate in L/(s * ha) |
allowed impervious area in ha
loads background concentrations based on entry by user or default values from csv table
get_default_background(SUW_type = "river")
get_default_background(SUW_type = "river")
SUW_type |
"lake" or "river", "river" is used as default |
data.frame with background concentrations
Loads the table with function IDs
get_functionsID()
get_functionsID()
data.frame with function IDs and additional 1 to 3 characterizations
This function calculates the time in minutes that is needed for the water to travel through the affected urban river stretch for a yearly rain event, based on a natural catchment discharge
get_HQ_time_interval( area_catch, river_cross_section, river_length, river_mean_flow, Hq_pnat1_catch = NULL, slope = 0.1 )
get_HQ_time_interval( area_catch, river_cross_section, river_length, river_mean_flow, Hq_pnat1_catch = NULL, slope = 0.1 )
area_catch |
The catchment area in km2 |
river_cross_section |
The average river cross section in the catchment in m2 |
river_length |
The length of the affected urban river stretch in m |
river_mean_flow |
The Average river flow in m3/s |
Hq_pnat1_catch |
the natural catchment discharge for a yearly rain event in L/(s*km2). If NULL it will be estimated by slope and area of the catchment |
slope |
Average slope of the catchment in % (Default is 0.1) |
The natural catchment discharge is estimated based on the supplementary information of DWA-A 102-3. Unlike the rain intensity of a yearly rain, the estimated natural discharge is independent of the rain duration. According to DWA-A 102-3 two more factors would increase the travel time that are not considered here: 1) The longest travel time within the sewer network of the planning area and 2) The increased water level leading to a higher river cross section and thus to a longer travel time. Instead a constant of 60 minutes is added to the calculated travel time. This also ensures that the rain duration is high enough (> 60 min) for a toxicological relevance.
Travel time of naturally discharged water within the catchment in minutes
Calculate natural runoff based on slope of landscape
get_Hq1_pnat(slope, area_catch)
get_Hq1_pnat(slope, area_catch)
slope |
slope of the planning area (unit %) |
area_catch |
catchment area (in km2) |
Once-in-a-year natural discharge flow of the catchment in L/(s*km2)
get_Hq1_pnat(slope = 0.1, area_catch = 5.62)
get_Hq1_pnat(slope = 0.1, area_catch = 5.62)
Get KOSTRA rain characteristics
get_KOSTRA(coord_vector, duration_string, location_name = NULL, plot = TRUE)
get_KOSTRA(coord_vector, duration_string, location_name = NULL, plot = TRUE)
coord_vector |
coordinates in ETRS89. See Datails for more information. |
duration_string |
Duration of precipitation in minutes |
location_name |
used for plot title. Default is NULL |
plot |
boolean (TRUE for plotting or FALSE if plotting is not required) |
The KOSTRA Data is available for a grid of x x x km. The location is given in coordinates in the ETRS89 system (For information see: https://epsg.io/3034) Longitudes and Lattidudes in WGS84 can be converted into ETRS89 here: https://epsg.io/transform#s_srs=4326&t_srs=3034
A list with elements "plot" and "data" (numeric results) and also produce a ggplot2 plot if parameter plot = TRUE)
# Example default values Herne herne <- r2q::get_KOSTRA(coord_vector = c(3813634.44, 2753912.5), duration_string = 1080, location_name = "Herne") herne$plot herne$data # Example 10 min for Berlin berlin <- get_KOSTRA(coord_vector = c(4217676.98, 2862423.69), duration_string = 10, location_name = "Berlin", plot = TRUE) berlin$plot berlin$data
# Example default values Herne herne <- r2q::get_KOSTRA(coord_vector = c(3813634.44, 2753912.5), duration_string = 1080, location_name = "Herne") herne$plot herne$data # Example 10 min for Berlin berlin <- get_KOSTRA(coord_vector = c(4217676.98, 2862423.69), duration_string = 10, location_name = "Berlin", plot = TRUE) berlin$plot berlin$data
Loads landuse specific pollutant runoff concentration obtained by the OgRe Dataset
get_landuse_runoff()
get_landuse_runoff()
A data frame with the columns "Substance", "unit", median and 95th quantile of landuses "residential_suburban", "residential_city", "commercial" and "main_road"
Load of one parameter from one specific surface
get_planningLoad( planning_data, sID, fID, q_rain, t_rain, y_rain, thresholdTable, function_c_table = NULL )
get_planningLoad( planning_data, sID, fID, q_rain, t_rain, y_rain, thresholdTable, function_c_table = NULL )
planning_data |
The Excel sheet "planning_area_details" loaded by
|
sID |
Substance ID as defined in the package substance ID table
(see |
fID |
Area function ID as defined in the package functionID table
(see |
q_rain |
Rain intensity in L/(ha*s) |
t_rain |
Rain length in s |
y_rain |
Yearly rain amount in mm |
thresholdTable |
Table of threshold values. Can be loaded with
|
function_c_table |
A table of surface specific runoff concentrations from the package. If NULL it is loaded automatically within the function. |
Pollutant load per event or per year, depending on the treshold value definition. The mass unit is either mg or ug, depending on the input concentration unit.
Calculates tolerable hydraulic burden based on natural runoff estimation
get_q_max(Hq1pnat_catch, x = 0.1, area_urban, area_catch)
get_q_max(Hq1pnat_catch, x = 0.1, area_urban, area_catch)
Hq1pnat_catch |
natural discharge of cathcment area (area_catch) in L/(s*km²) |
x |
dimensionless factor regulating tolerable additional anthropogenic discharge. default is 0.1 |
area_urban |
connected area of planning area in km2 |
area_catch |
complete catchment area in km2 upstream of point of discharge |
tolerable discharged flow of connected area in L/s
The rate of the yearly rain event depends on the prescribed duration. In this function the duration is either calculated using the natural catchment discharge, using the average river flow or entered manually.
get_rain( area_catch, river_cross_section, river_length, x_coordinate, y_coordinate, Hq_pnat1_catch = NULL, slope = 0.1, use_p1nat = TRUE, river_mean_flow = NULL, mins = NULL )
get_rain( area_catch, river_cross_section, river_length, x_coordinate, y_coordinate, Hq_pnat1_catch = NULL, slope = 0.1, use_p1nat = TRUE, river_mean_flow = NULL, mins = NULL )
area_catch |
The catchment area in km2 |
river_cross_section |
The average river cross section in the catchment in m2 |
river_length |
The length of the affected urban river stretch in m |
x_coordinate , y_coordinate
|
coordinates in ETRS89. See Datails for more information. |
Hq_pnat1_catch |
the natural catchment discharge for a yearly rain event in L/(s*km2). If NULL it will be estimated by slope and area of the catchment |
slope |
Average slope of the catchment in % (Default is 0.1) |
use_p1nat |
If TRUE, the natural catchment discharge is used (see get_Hq1_pnat) is used to define the precipitation duration. If FALSE the average river flow is used. Exception: If mins is defined, this value is used. |
river_mean_flow |
The average river flow in m³/s (only needed if use_p1nat = FALSE and min = NULL) |
mins |
The Default is NULL. In this case either natural catchment discharge or average river flow is used for precipitation duration. If not Null, mins is used and overwrites the parameter "use_p1nat". |
The KOSTRA Data is available for a grid of x x x km. The location is given in coordinates in the ETRS89 system (For information see: https://epsg.io/3034) Longitudes and Lattidudes in WGS84 can be converted into ETRS89 here: https://epsg.io/transform#s_srs=4326&t_srs=3034
A vector with the duration of precipitation in minutes and the intensity of the rain event in L/(s*ha) based on KOSTRA
Load the table with site data variable IDs
get_siteInfoID()
get_siteInfoID()
data.frame with site specific variables IDs, variable names and units
This function loads the landuse specific pollutant runoff concentration obtained by the OgRe Dataset and multiplies it with the proportion of the correspoding area type in the catchment.
get_spec_runoff()
get_spec_runoff()
A dataframe with the columns "Substance", "unit", "Mean" which is the median value and "Q95" which is the 95th quantile.
obtained by the OgRe Dataset and multiplies it with the proportion of the correspoding area type in the catchment.
get_stormwaterRunoff( runoff_effective_mix = list(c(40, 40, 20, 0), c(20, 40, 20, 20)), mix_names = c("is", "pot") )
get_stormwaterRunoff( runoff_effective_mix = list(c(40, 40, 20, 0), c(20, 40, 20, 20)), mix_names = c("is", "pot") )
runoff_effective_mix |
List of numeric vectors. Each vector must contain 4 values representing the areal proportion of "residential suburban", "residential city", "commercial" and "main road" landuse types in percent. |
mix_names |
A character vector with names for each landuse mix |
A dataframe with the columns "Substance", "unit", the median and 95th quantile concentrations of all four landuse types and for the defined landuse combinations
Load the table with substance IDs
get_subID()
get_subID()
data.frame with substance IDs, substance names within the OgRe- data set, clean substance names, substance unit and substance groups in english and german
assembles relevant thresholds depending on SUW type (river or lake) and LAWA type from csv tables
get_thresholds(SUW_type = "river", LAWA_type = "default")
get_thresholds(SUW_type = "river", LAWA_type = "default")
SUW_type |
"lake" or "river", "river" is used as default |
LAWA_type |
lake or river type as described in German OGewV. Only main type sould be indicated (e.g. insert 11 for river type 11.1 or 11 K). If unknown, "default" will return typical values valid for a range of SUW. |
data.frame with acute and annual substance threshold, suitable for a given SUW body
Calculate acceptable additional runoff factor x
get_x(Hq1_pnat, Hq2_pnat)
get_x(Hq1_pnat, Hq2_pnat)
Hq1_pnat |
potential annual natural discharge flow in L/(s*km2) |
Hq2_pnat |
potential biennial natural discharge flow in L/(s*km2) |
dimensionless factor regulating tolerable additional anthropogenic discharge
Maximal connectable impervious area based on hydrologic conditions
hydrology_assessment(site_data, q_rain)
hydrology_assessment(site_data, q_rain)
site_data |
The site specific data loaded with function "loda_site_data" |
q_rain |
characteristic rainfall in L/(s*ha) |
If the planning area is identical with the urban area lines 3, 4 and 7 are not valid. Line 8 is the required throttel for both, the urban area and the planning area. The reason for this is: for the planning area "no_runoff" landuse considered for discharge calculation (-> possible runoff areas in the future), while this is not the case for the urban area (-> Status quo assessment). If the planning area is no "real" planning area, that would not make any sense.
the combined max_area table is extend by a row with the result of the hydolic assessment.
This functions works with a site data list created by function
load_site_data()
, with a concentration table (see details), and with
a hazard list created by function check_all_substances()
immission_assessment( site_data, c_table, q_rain, t_rain, substance, hazard_list, c_type = "average" )
immission_assessment( site_data, c_table, q_rain, t_rain, substance, hazard_list, c_type = "average" )
site_data |
Site data list created by function |
c_table |
Table with concentions in the river, in rainwater runoff and threshold values |
q_rain |
Intensity of a rain event in L/(ha*s) |
t_rain |
Length of a rain event in s |
substance |
Substance name (as definied in c_table) |
hazard_list |
Hazard list created by function |
c_type |
Character value specifiyng the type of concentration that is used for the assessment. Either "average" for median value or "worstcase" for 95th quantile concentration in rainwater runoff. |
Something about the c_table
List with all R2Q Immission assessment output value for the substance
Calculate pollutant input from runoff area area within a rain event
Input_event(area_runoff, Ci_storm, coeff_runoff, q_rain, t_rain)
Input_event(area_runoff, Ci_storm, coeff_runoff, q_rain, t_rain)
area_runoff |
Connected runoff area in ha. |
Ci_storm |
Concentration in stormwater run-off for substance i. |
coeff_runoff |
runoff coefficient of runoff area. |
q_rain |
rain amount in L/(ha*s) |
t_rain |
duration of rain in s |
maximal pollutant input in mass per rain event. The mass unit depends on the runoff concentration mass unit (one unit larger: factor 1000, i.e. if concentration is in ug/L, the pollutant load is in mg/event)
Linear interpolation between two data poins
lin_interpolation(x1, x2, y1, y2, x_is)
lin_interpolation(x1, x2, y1, y2, x_is)
x1 |
x value of first data point |
x2 |
x value of second data point |
y1 |
y value of first data point |
y2 |
y value of second data point |
x_is |
corresponding x value to the searched y value |
Y-Value to the corresponding x value in the unit of the other y values
lin_interpolation(x1 = 60, x2 = 90, y1 = 30, y2 = 55, x_is = 70)
lin_interpolation(x1 = 60, x2 = 90, y1 = 30, y2 = 55, x_is = 70)
This functions loads the data from the sheet "pollution_data" within the R2Q-Excel file for data entry
load_background_data( data.dir, filename, default_for_na = TRUE, SUW_type = "river" )
load_background_data( data.dir, filename, default_for_na = TRUE, SUW_type = "river" )
data.dir |
The directory of the entry data table. |
filename |
Name of the R2Q-Excel File including ".xlsx". |
default_for_na |
If TRUE, default values are used for substances that were not measured |
SUW_type |
Only used if default_for_na is TRUE. "lake" or "river", "river" is used as default |
A data frame background concentration as defined in the Excel sheet. If default values are used this is documented in the "comment" column.
this functions loads the data from the sheet "surface_areaType" within the data entry excel file
load_landuse( data.dir = NULL, filename = NULL, residential_city = c(0.75, 0.3, 1), residential_suburban = c(0.75, 0.3, 1), commercial = c(0.75, 0.3, 1), main_road = c(0.9, 0.1, 1), no_runoff = c(0, 0, 0) )
load_landuse( data.dir = NULL, filename = NULL, residential_city = c(0.75, 0.3, 1), residential_suburban = c(0.75, 0.3, 1), commercial = c(0.75, 0.3, 1), main_road = c(0.9, 0.1, 1), no_runoff = c(0, 0, 0) )
data.dir |
The directory of the entry data table. |
filename |
Name of the R2Q-Excel File including ".xlsx". |
residential_suburban , residential_city , commercial , main_road , no_runoff
|
vectors of 3 containing 1) fD value of the landuse type, 2) the proportion of the landuse type within the catchment area in percent and 3) a value of if 1 if the landuse tyoe should be considered as connected to the separate sewer system or 0 if not. |
A vector of length 5. Entries 1 to 4 describe the proportion of the area types "residential_suburban", "residential_city", "industry" and (high- traffic) "street". The proportion is referred only to the connected area. The 5th value is the overall proportion of connected area.
This functions loads the data from the sheet "pollution_data" within the R2Q-Excel file for data entry
load_planning_details(data.dir, filename, scenario_name)
load_planning_details(data.dir, filename, scenario_name)
data.dir |
The path of the entry data table. |
filename |
Name of the R2Q-Excel File including ".xlsx". |
scenario_name |
Name of the excel sheet descbribing the planning scenario |
The Excel sheet as data frame
this functions loads the data from the sheet "site_data" within the data entry excel file and returns the specified parameters in a list
load_site_data(data.dir, filename)
load_site_data(data.dir, filename)
data.dir |
The directory of the entry data table. |
filename |
Name of the R2Q-Excel File including ".xlsx". |
A list with all parameters from the site info table as seperate list items. Per Parameter the item is a list containing the columnn names of the site_info table
Transforms the mass units ng, ug, mg and g
massUnit_tranformation(original_unit, change)
massUnit_tranformation(original_unit, change)
original_unit |
One of ng, ug ("u" instead of my), mg and g |
change |
Integers between -2 and 2. Each integer represents a factor of 1000 |
Character value of the transformed unit
Calculate connectable area to a river based on pollutant input within a heavy rain event
maxArea_event( Q_river, Ci_river, Ci_threshold, Ci_storm, coeff_runoff, q_rain, t_rain, river_length, river_cross_section, catchment_area = 100 )
maxArea_event( Q_river, Ci_river, Ci_threshold, Ci_storm, coeff_runoff, q_rain, t_rain, river_length, river_cross_section, catchment_area = 100 )
Q_river |
Average River flow in m3/s |
Ci_river |
Background concentration for substance i. Concentration unit must fit to Ci_threshold and Ci_storm. |
Ci_threshold |
Threshold value for substance i. Concentration unit must fit to Ci_river and Ci_storm. |
Ci_storm |
Concentration in stormwater run-off for substance i. Concentration unit must fit to Ci_threshold and Ci_river. |
coeff_runoff |
runoff coefficient of connected impervious area |
q_rain |
rain amount in mm/(ha*s) |
t_rain |
duration of rain in s |
river_length |
length of impacted urban river stretch in m |
river_cross_section |
average cross section of river in m2 |
catchment_area |
Catchment area in ha. |
The catchment_area is used as initial value for the optimisation algorithm. The default 100 ha should be sufficient for most problems. In that case the optimal solution between 0 and 1 000 km²
maximal connectable area in ha
Calculate connectable area in a river catchment based on a yearly regulated Substance
maxArea_year(load_max, Ci_threshold, Ci_storm, coeff_runoff, Q_rain)
maxArea_year(load_max, Ci_threshold, Ci_storm, coeff_runoff, Q_rain)
load_max |
Annual maximal input of substance i. Mass unit corresponds to concentration mass unit (two classes higher. i.e. concentration in mg/L -> load in kg/a. |
Ci_threshold |
Threshold value for substance i. Concentration unit must fit to Ci_river and Ci_storm. |
Ci_storm |
Concentration in stormwater run-off for substance i. Concentration unit must fit to Ci_threshold and Ci_river. |
coeff_runoff |
Run-off coefficient of connected impervious area |
Q_rain |
Annual amount of rain amount in mm/a |
maximal connectable area in ha
Calculate maximal yearly pollutant input
maxInput_year(Q_river, Ci_river, Ci_storm, Ci_threshold)
maxInput_year(Q_river, Ci_river, Ci_storm, Ci_threshold)
Q_river |
Annual river flow in m³/s |
Ci_river |
Background concentration for substance i. Concentration unit must fit to Ci_threshold. |
Ci_storm |
Concentration in stormwater run-off for substance i. Concentration unit must fit to Ci_threshold and Ci_river. |
Ci_threshold |
Threshold value for substance i. Concentration unit must fit to Ci_river. |
Maximum tolerable pollutant input in mass per year. The mass unit depends on the concentrations mass unit. It is transformed by 2 units. i.e. concentration in ug/L -> load in g/a or concentration in mg/L -> load in kg/a
This is a helping function for "combine_concentration_tables"
merge_by_pollutant(dataFrame1, dataFrame2)
merge_by_pollutant(dataFrame1, dataFrame2)
dataFrame1 |
A R2Q concentration data Frame |
dataFrame2 |
Another R2Q concentration data Fram |
A dataframe containing all substance measured in all units listed in dataFrame1 and dataFrame2
based on mixed reactor approach
mixed_reactor_C( Q_river, Ci_river, Ci_storm, coeff_runoff, q_rain, t_rain, Area, V_river )
mixed_reactor_C( Q_river, Ci_river, Ci_storm, coeff_runoff, q_rain, t_rain, Area, V_river )
Q_river |
Average flow of the river in m³/s |
Ci_river |
Background concentration for substance i. Concentration unit must fit to Ci_threshold and Ci_storm. |
Ci_storm |
Concentration in stormwater run-off for substance i. Concentration unit must fit to Ci_threshold and Ci_river. |
coeff_runoff |
runoff coefficient of connected impervious area |
q_rain |
Amount of rain amount in L/(s*ha) |
t_rain |
duration of the rain in seconds |
Area |
impervious, connected area in ha |
V_river |
volume of the river in m³ |
dynamic concentration after time t in the unit of the input concentrations
This functions reads specific runoff concentrations provided within the package. For all substances with concentration data, the overall discharged amount is calculated using the detailed information about area functions within the planning area (Excel sheet: "planning_area_details")
planning_area_discharge(planning_data, q_rain, t_rain, y_rain, thresholdTable)
planning_area_discharge(planning_data, q_rain, t_rain, y_rain, thresholdTable)
planning_data |
The Excel sheet "planning_area_details" loaded by
|
q_rain |
Rain intensity in L/(ha*s) |
t_rain |
Rain length in s |
y_rain |
Yearly rain amount in mm |
thresholdTable |
Table of threshold values. Can be loaded with
|
Pollutant load per event or per year, depending on the threshold value definition. The mass unit is either mg or ug, depending on the input concentration unit.
Urban area that can be connected to the seperate sewer system without exceeding the threshold values (and without further treatment)
plot_connectable_urban_area( r2q_substance, site_data, r2q_hydrology = NULL, x_type = "percent", language = "de" )
plot_connectable_urban_area( r2q_substance, site_data, r2q_hydrology = NULL, x_type = "percent", language = "de" )
r2q_substance |
Assessment output created by |
site_data |
List of site data as loaded by |
r2q_hydrology |
Assessment output created by |
x_type |
Unit of the x-axis. Default is "percent", also possible "ha" for absolute values |
language |
Either "de" or "en" for German or English language. |
Relative values in percent refer to the entire urbanised catchment area as well as to the planning area. If the plot is created with absolute values, information about the connectable area of the urbanised catchment, the already connected area, and the size of the planning area are integrated.
check_all_substances()
Plots the output of function check_all_substances()
plot_hazards( hazards, title = "", xlabels = names(hazards), ylabels = names(hazards[[1]]) )
plot_hazards( hazards, title = "", xlabels = names(hazards), ylabels = names(hazards[[1]]) )
hazards |
List created by |
title |
Optional title |
xlabels |
Character vector of the same length as Hazards to manually enter x axis labels (-> Substance names) |
ylabels |
Character vector of the same length as one vector of the Hazards list entry to manually enter y axis labels (-> Landuse names) |
Plot with coloured rectangles representing the three different output
options from function check_all_substances()
Contains 3 different colors "orange", "blue" and "green" in 6 different shades
r2q_pal
r2q_pal
Data frame with 3 columns for the colors and 6 rows for the shades
Logo of the R2Q project
Run immission-based tool
run_scenario(status_quo_list, scenario_name)
run_scenario(status_quo_list, scenario_name)
status_quo_list |
A list created by |
scenario_name |
The name of the excel sheet describing the planning. THe excel file is the one that is defined by by the status_quo_list |
Saves all the output (figures and tables) in a folder created within the file path. Furthermore, a table of maximum pollutant loads is returned that can be used for evaluation of scenarios
Run immission-based tool
run_status_quo(path, filename, c_type)
run_status_quo(path, filename, c_type)
path |
File path of R2Q-Excel |
filename |
File name of R2Q Excel (incuding .xlsx) |
c_type |
A character defining the type of pollutant concentration in runoff water. Either "average" for the median or "worstcase" for the 95th quantile. |
Saves all the output (figures and tables) in a folder created within the file path. Furthermore, a table of maximum pollutant loads is returned that can be used for evaluation of scenarios
Substance IDs within the package data tables are turned to substance names
sub_id_to_name(c_table, all_substances = TRUE)
sub_id_to_name(c_table, all_substances = TRUE)
c_table |
Data frame with column "Substance" or "substance" containing
substance IDs as defined in the package substance ID table |
all_substances |
If TRUE, all substances named in c_table or in the substance ID table are kept. A warning is given if concentrations or substance definitions are missing. |
Input table containing substance names
OgRe substance names are turned to substance names used in the tables
sub_OgRe_to_name(c_table, all_substances = TRUE)
sub_OgRe_to_name(c_table, all_substances = TRUE)
c_table |
Data frame columne "Substance" or "substance" containing OgRe substance names as defined in the OgRe data set. |
all_substances |
If TRUE, all substances named in c_table or in the substance ID table are kept. A warning is given if concentrations or substance definitions are missing. |
To get an overiew of all Substance names, run function get_subID()
c_table expanded by the column "substance"
Start counting from the string end to get a substring
substr_reverse(x, rev_start, rev_stop, keep = TRUE)
substr_reverse(x, rev_start, rev_stop, keep = TRUE)
x |
Character String |
rev_start , rev_stop
|
The first and last value counted from the end of the String. rev_stop > rev_start |
keep |
If TRUE (default) the selection is return. Otherwise everything but the selection is returend |
Character Vector