Compare air dispersion results for a facility:

1) Without buildings 2) With buildings

Setup

Install AERSCREEN and supporting models to EPA folder

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

Create new aerscreen table

library(aerscreen)
aer_inp <- new_aerscreen()

library(knitr)
kable(aer_inp)

Assign source parameters

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

Set modeling distance

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

Set surface characteristics for modeling domain

aer_inp <- mutate(aer_inp,
                  surface_profile  = 7,    # Urban area
                  climate_profile  = 1)    # Average moisture conditions

No building dispersion

Write aerscreen input file

write_aerscreen(aer_inp, "EPA/no_builds.inp", out_file = "no_builds.out")

Run aerscreen on input file

no_build_results <- run_aerscreen("EPA/no_builds.inp", 
                                  out_file   = "no_build_results",
                                  exe_folder = "EPA")

View results as data frame

no_build_results <- read_aerscreen_out("no_build_results.out")

kable(no_build_results)


With building dispersion

Create new input file

# Load input file
build_inp <- read_aerscreen_inp("EPA/no_builds.inp")

Assign building parameters

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

Add building to input file

build_inp[ , names(new_build)] <- new_build[1, ]

# Turn downwash processing on
build_inp$bpip_run <- "Y"

kable(build_inp)

Run AERSCREEN on building input file

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

Dispersion comparison

Maximum concentration

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


dKvale/aerscreen documentation built on Aug. 30, 2022, 2:05 a.m.