Scenarios

Scenarios

library(keys.lid)

paths_list <- list(
  swmm_exe = "C:/Program Files (x86)/EPA SWMM 5.1.015/swmm5.exe"
  )

paths <- kwb.utils::resolve(paths_list)


scenarios <- keys.lid::read_scenarios()

DT::datatable(scenarios)

Simulate Performance

The SWMM simulations (years: 2008 - 2019) and calculation of performance metrics (volume rainfall retended, rainfall event sums/max) for four LIDs with different parameterisations and for five different climate zones in China (in total: 575 model runs, which takes about 30 seconds per run, i.e. in total 5 hours -12 minutes on my laptop).


### takes about 2.5h for all four LIDs to simulate
catchment_area_m2 <- 1000
lid_area_fractions <- c(0,0.25,0.5,0.75,1)

### Bioretention Cell
br <- keys.lid::simulate_performances(
  lid_selected = scenarios[scenarios$lid_name_tidy == "bioretention_cell",],
  lid_area_fractions = lid_area_fractions,
  catchment_area_m2 = catchment_area_m2,
  swmm_exe = paths$swmm_exe
)

### Green Roof
gr <- keys.lid::simulate_performances(
  lid_selected = scenarios[scenarios$lid_name_tidy == "green_roof",],
  lid_area_fractions = lid_area_fractions,
  catchment_area_m2 = catchment_area_m2,
  swmm_exe = paths$swmm_exe
)

### Permeable Pavement
pp <- keys.lid::simulate_performances(
  lid_selected = scenarios[scenarios$lid_name_tidy == "permeable_pavement",],
  lid_area_fractions = lid_area_fractions,
  catchment_area_m2 = catchment_area_m2,
  swmm_exe = paths$swmm_exe
)


performances <- br %>%
  dplyr::bind_rows(gr) %>%
  dplyr::bind_rows(pp)

Evaluate Performance

Median Volume Rainfall Retended per Year

Bioretention Cell


keys.lid::plot_vrr_median("bioretention_cell")
#> Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
#> ℹ Please use tidy evaluation idioms with `aes()`.
#> ℹ See also `vignette("ggplot2-in-packages")` for more information.
#> ℹ The deprecated feature was likely used in the keys.lid package.
#>   Please report the issue at <https://github.com/KWB-R/keys.lid/issues>.
#> This warning is displayed once per session.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Green Roof


keys.lid::plot_vrr_median("green_roof")

Permeable Pavements


keys.lid::plot_vrr_median("permeable_pavement")

Boxplots

Volume Rainfall Retended

Bioretention Cell

Zone 1


keys.lid::boxplot_vrr(lid = "bioretention_cell", zone_id = 1)
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors

Zone 2


keys.lid::boxplot_vrr(lid = "bioretention_cell", zone_id = 2)
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors

Zone 3

performances <- keys.lid::performances %>%  dplyr::filter(lid_area_fraction == 1)
keys.lid::boxplot_vrr("bioretention_cell", zone_id = 3, performances = performances)
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors

Zone 4


keys.lid::boxplot_vrr(lid = "bioretention_cell", zone_id = 4)
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors

Zone 5


keys.lid::boxplot_vrr("bioretention_cell", zone_id = 5, performances = performances)
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors
#> Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors
Green Roof

Zone 1


keys.lid::boxplot_vrr(lid = "green_roof", zone_id = 1)

Zone 2


keys.lid::boxplot_vrr(lid = "green_roof", zone_id = 2)

Zone 3


keys.lid::boxplot_vrr(lid = "green_roof", zone_id = 3, performances = performances)

Zone 4


keys.lid::boxplot_vrr(lid = "green_roof", zone_id = 4)

Zone 5


keys.lid::boxplot_vrr(lid = "green_roof", zone_id = 4, performances = performances)
Permeable Pavement

Zone 1


keys.lid::boxplot_vrr(lid = "permeable_pavement", zone_id = 1)

Zone 2


keys.lid::boxplot_vrr(lid = "permeable_pavement", zone_id = 2)

Zone 3


keys.lid::boxplot_vrr(lid = "permeable_pavement", zone_id = 3, performances = performances)

Zone 4


keys.lid::boxplot_vrr(lid = "permeable_pavement", zone_id = 4)

Zone 5


keys.lid::boxplot_vrr(lid = "permeable_pavement", zone_id = 5, performances = performances)

Runoff Maximum per Event

Zone 1


keys.lid::boxplot_runoff_max(lid = "green_roof", zone_id = 1)

Zone 5


keys.lid::boxplot_runoff_max(lid = "green_roof", zone_id = 5)

Runoff Volume per Event

Zone 1


keys.lid::boxplot_runoff_volume(lid = "green_roof", zone_id = 1)

Zone 5


keys.lid::boxplot_runoff_volume(lid = "green_roof", zone_id = 5)

Export Results to Excel


keys.lid::export_performances()