Package 'r2q'

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

Help Index


Calculate pollutant input from runoff area area within a rain event

Description

Calculate pollutant input from runoff area area within a rain event

Usage

area_from_load(load_runoff, Ci_storm, coeff_runoff, q_rain, t_rain)

Arguments

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

Value

Numeric value of the according connectable area in ha


Runs function immission_assessment() for all substances that might pose a risk and returns the results in three tables

Description

Runs function immission_assessment() for all substances that might pose a risk and returns the results in three tables

Usage

assess_all_hazards(
  hazard_list,
  site_data,
  c_table,
  q_rain,
  t_rain,
  c_type = "average"
)

Arguments

hazard_list

Hazard list created by function check_all_substances()

site_data

Site data list created by function load_site_data()

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.

Value

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.


Calculate tolerable discharge

Description

Uses the site data to calculate a natural stormwater run-off for a yearly rain event

Usage

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
)

Arguments

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.

Value

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

Description

Check if substances pose a risk to the surface water

Usage

check_all_substances(c_table, c_type = "average")

Arguments

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.

Value

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.


Check Pollutant Impact

Description

Checks if the pollutant i is a constraint for the connected area

Usage

check_pollutant_impact(Ci_river, Ci_threshold, Ci_storm)

Arguments

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.

Value

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


Combine the three R2Q concentration tables (treshold values, background and stromwater)

Description

This function reduces the input tables to the columns "Substance", "Unit", renames the Value column according to the table data and combines all tables

Usage

combine_concentration_tables(
  threshold_table,
  storm_table,
  background_table,
  onlyComplete = FALSE
)

Arguments

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

Details

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

  1. "Substance" and 2) "Unit".

Value

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

Description

Get allowed impervious area

Usage

get_allowed_area(f_D, Q_tol, q_rain)

Arguments

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)

Value

allowed impervious area in ha


get background concentrations for SUW before rain events

Description

loads background concentrations based on entry by user or default values from csv table

Usage

get_default_background(SUW_type = "river")

Arguments

SUW_type

"lake" or "river", "river" is used as default

Value

data.frame with background concentrations


Loads the table with function IDs

Description

Loads the table with function IDs

Usage

get_functionsID()

Value

data.frame with function IDs and additional 1 to 3 characterizations


get_HQ_time_intterval

Description

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

Usage

get_HQ_time_interval(
  area_catch,
  river_cross_section,
  river_length,
  river_mean_flow,
  Hq_pnat1_catch = NULL,
  slope = 0.1
)

Arguments

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)

Details

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.

Value

Travel time of naturally discharged water within the catchment in minutes


Calculate natural runoff based on slope of landscape

Description

Calculate natural runoff based on slope of landscape

Usage

get_Hq1_pnat(slope, area_catch)

Arguments

slope

slope of the planning area (unit %)

area_catch

catchment area (in km2)

Value

Once-in-a-year natural discharge flow of the catchment in L/(s*km2)

Examples

get_Hq1_pnat(slope = 0.1, area_catch = 5.62)

Get KOSTRA rain characteristics

Description

Get KOSTRA rain characteristics

Usage

get_KOSTRA(coord_vector, duration_string, location_name = NULL, plot = TRUE)

Arguments

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)

Details

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

Value

A list with elements "plot" and "data" (numeric results) and also produce a ggplot2 plot if parameter plot = TRUE)

Examples

# 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

Description

Loads landuse specific pollutant runoff concentration obtained by the OgRe Dataset

Usage

get_landuse_runoff()

Value

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

Description

Load of one parameter from one specific surface

Usage

get_planningLoad(
  planning_data,
  sID,
  fID,
  q_rain,
  t_rain,
  y_rain,
  thresholdTable,
  function_c_table = NULL
)

Arguments

planning_data

The Excel sheet "planning_area_details" loaded by load_planning_details()

sID

Substance ID as defined in the package substance ID table (see get_subID())

fID

Area function ID as defined in the package functionID table (see get_functionsID())

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 get_thresholds().

function_c_table

A table of surface specific runoff concentrations from the package. If NULL it is loaded automatically within the function.

Value

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

Description

Calculates tolerable hydraulic burden based on natural runoff estimation

Usage

get_q_max(Hq1pnat_catch, x = 0.1, area_urban, area_catch)

Arguments

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

Value

tolerable discharged flow of connected area in L/s


get_rain

Description

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.

Usage

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
)

Arguments

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".

Details

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

Value

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

Description

Load the table with site data variable IDs

Usage

get_siteInfoID()

Value

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.

Description

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.

Usage

get_spec_runoff()

Value

A dataframe with the columns "Substance", "unit", "Mean" which is the median value and "Q95" which is the 95th quantile.


Load landuse specific pollutant runoff concentration

Description

obtained by the OgRe Dataset and multiplies it with the proportion of the correspoding area type in the catchment.

Usage

get_stormwaterRunoff(
  runoff_effective_mix = list(c(40, 40, 20, 0), c(20, 40, 20, 20)),
  mix_names = c("is", "pot")
)

Arguments

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

Value

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

Description

Load the table with substance IDs

Usage

get_subID()

Value

data.frame with substance IDs, substance names within the OgRe- data set, clean substance names, substance unit and substance groups in english and german


get substance thresholds for SUW during rain events

Description

assembles relevant thresholds depending on SUW type (river or lake) and LAWA type from csv tables

Usage

get_thresholds(SUW_type = "river", LAWA_type = "default")

Arguments

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.

Value

data.frame with acute and annual substance threshold, suitable for a given SUW body


Calculate acceptable additional runoff factor x

Description

Calculate acceptable additional runoff factor x

Usage

get_x(Hq1_pnat, Hq2_pnat)

Arguments

Hq1_pnat

potential annual natural discharge flow in L/(s*km2)

Hq2_pnat

potential biennial natural discharge flow in L/(s*km2)

Value

dimensionless factor regulating tolerable additional anthropogenic discharge


Maximal connectable impervious area based on hydrologic conditions

Description

Maximal connectable impervious area based on hydrologic conditions

Usage

hydrology_assessment(site_data, q_rain)

Arguments

site_data

The site specific data loaded with function "loda_site_data"

q_rain

characteristic rainfall in L/(s*ha)

Details

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.

Value

the combined max_area table is extend by a row with the result of the hydolic assessment.


Automated immission assessment

Description

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()

Usage

immission_assessment(
  site_data,
  c_table,
  q_rain,
  t_rain,
  substance,
  hazard_list,
  c_type = "average"
)

Arguments

site_data

Site data list created by function load_site_data()

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 check_all_substances()

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.

Details

Something about the c_table

Value

List with all R2Q Immission assessment output value for the substance


Calculate pollutant input from runoff area area within a rain event

Description

Calculate pollutant input from runoff area area within a rain event

Usage

Input_event(area_runoff, Ci_storm, coeff_runoff, q_rain, t_rain)

Arguments

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

Value

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)


lin_interpolation

Description

Linear interpolation between two data poins

Usage

lin_interpolation(x1, x2, y1, y2, x_is)

Arguments

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

Value

Y-Value to the corresponding x value in the unit of the other y values

Examples

lin_interpolation(x1 = 60, x2 = 90, y1 = 30, y2 = 55, x_is = 70)

Loading local background concentration

Description

This functions loads the data from the sheet "pollution_data" within the R2Q-Excel file for data entry

Usage

load_background_data(
  data.dir,
  filename,
  default_for_na = TRUE,
  SUW_type = "river"
)

Arguments

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

Value

A data frame background concentration as defined in the Excel sheet. If default values are used this is documented in the "comment" column.


Loading all details about catchment area types

Description

this functions loads the data from the sheet "surface_areaType" within the data entry excel file

Usage

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)
)

Arguments

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.

Value

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.


Loads Excel sheet "planning_area_details"

Description

This functions loads the data from the sheet "pollution_data" within the R2Q-Excel file for data entry

Usage

load_planning_details(data.dir, filename, scenario_name)

Arguments

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

Value

The Excel sheet as data frame


Loading site specific information

Description

this functions loads the data from the sheet "site_data" within the data entry excel file and returns the specified parameters in a list

Usage

load_site_data(data.dir, filename)

Arguments

data.dir

The directory of the entry data table.

filename

Name of the R2Q-Excel File including ".xlsx".

Value

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

Description

Transforms the mass units ng, ug, mg and g

Usage

massUnit_tranformation(original_unit, change)

Arguments

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

Value

Character value of the transformed unit


Calculate connectable area to a river based on pollutant input within a heavy rain event

Description

Calculate connectable area to a river based on pollutant input within a heavy rain event

Usage

maxArea_event(
  Q_river,
  Ci_river,
  Ci_threshold,
  Ci_storm,
  coeff_runoff,
  q_rain,
  t_rain,
  river_length,
  river_cross_section,
  catchment_area = 100
)

Arguments

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.

Details

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²

Value

maximal connectable area in ha


Calculate connectable area in a river catchment based on a yearly regulated Substance

Description

Calculate connectable area in a river catchment based on a yearly regulated Substance

Usage

maxArea_year(load_max, Ci_threshold, Ci_storm, coeff_runoff, Q_rain)

Arguments

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

Value

maximal connectable area in ha


Calculate maximal yearly pollutant input

Description

Calculate maximal yearly pollutant input

Usage

maxInput_year(Q_river, Ci_river, Ci_storm, Ci_threshold)

Arguments

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.

Value

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


How to merge two R2Q concentration tables

Description

This is a helping function for "combine_concentration_tables"

Usage

merge_by_pollutant(dataFrame1, dataFrame2)

Arguments

dataFrame1

A R2Q concentration data Frame

dataFrame2

Another R2Q concentration data Fram

Value

A dataframe containing all substance measured in all units listed in dataFrame1 and dataFrame2


Calculate the dynamic concentration in a river stretch

Description

based on mixed reactor approach

Usage

mixed_reactor_C(
  Q_river,
  Ci_river,
  Ci_storm,
  coeff_runoff,
  q_rain,
  t_rain,
  Area,
  V_river
)

Arguments

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³

Value

dynamic concentration after time t in the unit of the input concentrations


Calculates the pollutants load from the planning area into the surface water

Description

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")

Usage

planning_area_discharge(planning_data, q_rain, t_rain, y_rain, thresholdTable)

Arguments

planning_data

The Excel sheet "planning_area_details" loaded by load_planning_details()

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 get_thresholds().

Value

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.


Plot of connectable area

Description

Urban area that can be connected to the seperate sewer system without exceeding the threshold values (and without further treatment)

Usage

plot_connectable_urban_area(
  r2q_substance,
  site_data,
  r2q_hydrology = NULL,
  x_type = "percent",
  language = "de"
)

Arguments

r2q_substance

Assessment output created by assess_all_hazards()

site_data

List of site data as loaded by load_site_data()

r2q_hydrology

Assessment output created by hydrology_assessment(). Is NULL by default, so that the plot can be created for substances only

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.

Details

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.


Plots the output of function check_all_substances()

Description

Plots the output of function check_all_substances()

Usage

plot_hazards(
  hazards,
  title = "",
  xlabels = names(hazards),
  ylabels = names(hazards[[1]])
)

Arguments

hazards

List created by check_all_substances()

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)

Value

Plot with coloured rectangles representing the three different output options from function check_all_substances()


Color palette for R2Q Plots

Description

Contains 3 different colors "orange", "blue" and "green" in 6 different shades

Usage

r2q_pal

Format

Data frame with 3 columns for the colors and 6 rows for the shades

Source

Logo of the R2Q project


Run immission-based tool

Description

Run immission-based tool

Usage

run_scenario(status_quo_list, scenario_name)

Arguments

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

Value

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

Description

Run immission-based tool

Usage

run_status_quo(path, filename, c_type)

Arguments

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.

Value

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

Description

Substance IDs within the package data tables are turned to substance names

Usage

sub_id_to_name(c_table, all_substances = TRUE)

Arguments

c_table

Data frame with column "Substance" or "substance" containing substance IDs as defined in the package substance ID table get_subID()

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.

Value

Input table containing substance names


OgRe substance names are turned to substance names used in the tables

Description

OgRe substance names are turned to substance names used in the tables

Usage

sub_OgRe_to_name(c_table, all_substances = TRUE)

Arguments

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.

Details

To get an overiew of all Substance names, run function get_subID()

Value

c_table expanded by the column "substance"


Start counting from the string end to get a substring

Description

Start counting from the string end to get a substring

Usage

substr_reverse(x, rev_start, rev_stop, keep = TRUE)

Arguments

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

Value

Character Vector