Compare air dispersion results for a facility:
1) Without buildings 2) With buildings
library(installEPA) install_epa(c("aerscreen", "bpip", "aermod", "makemet"), dir = "EPA", add_model_folder = FALSE) # Copy aermod.exe into AERSCREEN folder #install_dir <- paste0(getwd(), '/EPA') #relocate <- paste0(substring(getwd(), 1, 2), " & CD ", install_dir) #shell(paste0(relocate, '/', list.files(install_dir)[grepl("aermod", list.files(install_dir))][1], ' & COPY "', "aermod.exe", '" "', install_dir, '/aermod.exe"'))
library(aerscreen) aer_inp <- new_aerscreen() library(knitr) kable(aer_inp)
library(dplyr) aer_inp <- mutate(aer_inp, emit_gs = 1, # Average emissions in grams/second height_m = 9, # Stack height in meters temp_k = 300, # Exit temperature in Kelvin velocity_ms = 10, # Exit velocity in meters/second diameter_m = 1, # Inner stack diameter in meters urban_pop = 400000) # Population of surrounding urban area
aer_inp <- mutate(aer_inp, near_receptor = 1, # Distance from source to nearest modeling receptor in meters far_receptor = 400) # Distance to furthest modeling receptor in meters
aer_inp <- mutate(aer_inp, surface_profile = 7, # Urban area climate_profile = 1) # Average moisture conditions
write_aerscreen(aer_inp, "EPA/no_builds.inp", out_file = "no_builds.out")
no_build_results <- run_aerscreen("EPA/no_builds.inp", out_file = "no_build_results", exe_folder = "EPA")
no_build_results <- read_aerscreen_out("no_build_results.out") kable(no_build_results)
# Load input file build_inp <- read_aerscreen_inp("EPA/no_builds.inp")
# Set dimensions new_build <- tibble::tibble(bld_height = 16, short_side = 8, long_side = 14, bld_rotation = 15, dist_from_source = 8, angle_from_source = 10)
build_inp[ , names(new_build)] <- new_build[1, ] # Turn downwash processing on build_inp$bpip_run <- "Y" kable(build_inp)
## Write building input file write_aerscreen(build_inp, "EPA/builds.inp", out_file = "build_results") ## Run aerscreen on input file build_results <- run_aerscreen("EPA/builds.inp", out_file = "build_results", exe_folder = "EPA") ## Load results as data frame build_results <- read_aerscreen_out("build_results.out") kable(build_results)
library(ggplot2) build_results$model <- "with buildings" no_build_results$model <- "no buildings" ggplot(rbind(build_results, no_build_results), aes(model, max_1hr_conc, fill = model)) + geom_bar(stat = "identity") + labs(title = "Max 1-hour")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.