Chapter 3 Structuring an Emissions Inventory
The elaboration of vehicular emissions inventories in VEIN consists of four stages:
- pre-processing activity data,
- preparing emissions factors,
- estimating the emissions and
- post-processing of emissions in maps and databases.
VEIN provides functions to each of the stages. However, to follow these stages, a structure of directories with scripts including vein functions is necessary. Therefore, the vein function inventory
creates this structure of directories.
3.1 Overview of emissions inventorying using VEIN
3.2 The inventory
function
The inventory function creates a structure of directories and scripts to run VEIN. This structure is a suggestion, and the user can use any other. The following code shows the arguments of the function using the args
function with inventory
.
args(inventory)
## function (name,
## vehcomp = c(PC = 1, LCV = 1, HGV = 1, BUS = 1, MC = 1),
## show.main = TRUE, scripts = TRUE, show.dir = TRUE,
## show.scripts = FALSE, clear = TRUE, rush.hour = FALSE)
The arguments are name
, vehcomp
, show.main
, scripts
, show.dir
, show.scripts
and clear
.
- The argument
name
The argument name is a word to be used as the main directory where directories and scripts are stored. It consists in one word with ASCII characters. It is also recommended to exclude any special character or accents, for instance:
name = file.path(tempdir(), "YourCity")
inventory(name = name, show.dir = TRUE, show.scripts = TRUE)
- The argument
vehcomp
This argument is critical and comes from Vehicular Composition, which is the classification of the fleet by type of use, type of fuel, size of engine and gross weight, based on definitions of Corvalán, Osses, and Urrutia (2002). There is also the technological composition of the fleet which relates the technological modifications of the car to accomplish the emissions standards. However, vein uses a distribution by the age of use as 4 shows.
The vehicular composition vehcomp
has 5 types of vehicles:
- Passenger Cars (PC).
- Light Commercial Vehicles (LCV).
- Heavy Good Vehicles or trucks (HGV).
- Buses (BUS).
- Motorcycles (MC).
The default value of this argument is: c(PC = 1, LCV = 1, HGV = 1, BUS = 1, MC = 1)
, which means that there are 1 types of PC, 1 of LCV, 1 of trucks, 1 of buses and 1 types of motorcycles. This vehicular composition is only for illustrating that the user can change these values according to its data. Appendix B shows the vehicular composition from the vehicular emissions inventory of the Environmental Agency of São Paulo, Brazil (CETESB 2015). In Brazil, the fuel used in vehicles is blended with ethanol with and biodiesel. The user can use any vehicular composition that represents its fleet with up to 99 types of vehicles per category. For instance, if there are 4 types of PC in a fleet, PC = 4
, and each one has aa age of use distribution.
- The argument
scripts
This argument adds scripts into the directories. The default is TRUE. The type of scripts create are:
- main.R: Adds the
setwd("YourCity")
,library(vein)
,source(traffic.R)
, some comments and a loop to source all inputs. It is recommended not using the loop till it is certain that all scripts are correct. - traffic.R: Includes two lines with examples of how to use the
age_ldv
function and saving the output in the directory veh. input.R: Each file has the scripts for reading the network, vehicles, emission factors and estimating emissions.
The argument
show.main
This argument is to open automatically the file main.R. Default value is TRUE.
- The argument
show.dir
This is a logical argument to decide if the output of the function will return print the new directories or not. The use is:
name = file.path(tempdir(), "YourCity")
inventory(name = name, show.main = FALSE,
show.dir = TRUE, show.scripts = FALSE)
files at /tmp/RtmpT5bNtr/YourCity
Directories:
[1] "/tmp/RtmpT5bNtr/YourCity"
[2] "/tmp/RtmpT5bNtr/YourCity/ef"
[3] "/tmp/RtmpT5bNtr/YourCity/emi"
[4] "/tmp/RtmpT5bNtr/YourCity/emi/BUS_01"
[5] "/tmp/RtmpT5bNtr/YourCity/emi/HGV_01"
[6] "/tmp/RtmpT5bNtr/YourCity/emi/LCV_01"
[7] "/tmp/RtmpT5bNtr/YourCity/emi/MC_01"
[8] "/tmp/RtmpT5bNtr/YourCity/emi/PC_01"
[9] "/tmp/RtmpT5bNtr/YourCity/est"
[9] "/tmp/RtmpT5bNtr/YourCity/images"
[11] "/tmp/RtmpT5bNtr/YourCity/network"
[12] "/tmp/RtmpT5bNtr/YourCity/post"
[13] "/tmp/RtmpT5bNtr/YourCity/post/df"
[14] "/tmp/RtmpT5bNtr/YourCity/post/grids"
[15] "/tmp/RtmpT5bNtr/YourCity/post/streets"
[16] "/tmp/RtmpT5bNtr/YourCity/profiles"
[17] "/tmp/RtmpT5bNtr/YourCity/veh"
inventory
creates the directory “YourCity” and the subdirectories: daily, ef, emi, est, images, network, and veh.
- daily: Directory for storing the profiles saved as .csv files. For instance,
data(pc_profile)
is a matrix that could be saved as .csv. - ef: Directory for storing the emission factors data-frame, similar to
data(fe2015)
but including one column for each of the categories of the vehicular composition. For instance, if PC = 5, there should be 5 columns with emission factors in this file. If LCV = 5, another 5 columns should be present, and so on. - emi: Directory with subdirectories matching the vehicular composition for saving the estimates. It is suggested to use .rds extension instead of .rda.
- est: Directory with subdirectories matching the vehicular composition for storing the scripts named
input.R
. - images: Directory for saving images.
- network: Directory for saving the road network with the required attributes. This file will include the vehicular flow per street to be used by functions
age_ldv
,age_hdv
,age_moto
ormy_ldv
. - post: Directory for storing the processed emissions. It includes the directories df for emissions by the age of use, hour and other parameters, streets for storing the total emissions by streets and grids for storing total gridded emissions by pollutant.
veh: Directory for storing the distribution by the age of use of each category of the vehicular composition. Those are data-frames with each column as the age of use, and the number of rows as the number of streets. The class of these objects is “Vehicles”.
The argument
show.scripts
This argument prints the scripts created:
name = file.path(tempdir(), "YourCity")
inventory(name = name, show.main = FALSE,
show.dir = FALSE, show.scripts = TRUE)
files at /tmp/RtmpT5bNtr/YourCity
Scripts:
[1] "est/BUS_01_input.R" "est/HGV_01_input.R" "est/LCV_01_input.R"
[4] "est/MC_01_input.R" "est/PC_01_input.R" "main.R"
[7] "post.R" "traffic.R"
- The argument
clear
This is a logical argument that deletes recursively when TRUE, or not when FALSE, the directory and creates another one. The default is TRUE.
The following chapters show the use of other vein functions inside a structure of directories and scripts with the name inventory("YourCity")
.
References
Corvalán, Roberto M, Mauricio Osses, and Cristian M Urrutia. 2002. “Hot Emission Model for Mobile Sources: Application to the Metropolitan Region of the City of Santiago, Chile.” Journal of the Air & Waste Management Association 52 (2). Taylor & Francis: 167–74.
CETESB. 2015. “Emissões Veiculares No Estado de São Paulo 2014.”