- Introduction
- Install
MEDEA
- How to use
MEDEA
- Configuration file
- Working hypotheses
- Meteorological input file
- Meteorological output file
- Test files
- Algorithms and bibliographical references
- Contacts, questions and contributions
- License
MEDEA
is a command line tool to compute meteorology dependent emission files for many atmospheric pollution dispersion models.
Emissions are computed according to different schemes suitable for odour and particulate matter modelling.
Three emission schemes are currently available:
- odour emission;
- dust emission by wind erosion of piles;
- simplified dust emission by wind erosion of piles. See below for a description of the relevant algorithms and for bibliographical references.
The atmospheric dispersion models currently supported by MEDEA
are:
- CALPUFF
- AERMOD
- ARIA-Impact
- SPRAY.
MEDEA
is currently available only as a source distribution from GitHub.
The preferred way to install it, is by pipx
.
It will install medea
and its dependencies in an isolated environment and it will make the tool available in your $PATH.
- Download the source files from the GitHub repository.
- Install the command line tool with pipx:
$ cd /path/to/medea/
$ pipx install .
For development, use standard editable installs:
$ cd /path/to/medea
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install --editable .
medea
is a command line tool with many operational modes. Every aspect of its functionality is specified in the configuration file.
The included help, shows how to use the tool:
$ medea -h
usage: medea [-h] [-d] config
MEDEA: compute meteorology dependent emissions for dispersion models.
positional arguments:
config Path to input configuration toml file.
optional arguments:
-h, --help show this help message and exit
-d, --debug Activate debug mode
An example of configuration file config.toml
is included in the repository in the ./tests/
subfolder. The file is in toml format and the required keys are described hereafter:
-
mode: string (or integer) to select the dispersion model. Allowed values are:
- "spray" (or 0);
- "calpuff" (or 1);
- "impact" (or 2);
- "aermod" (or 3).
Example:
mode = "calpuff"
-
input: path to input emission file. Example:
input = "./path/to/emission_input.csv"
-
output: path to output emission file. Example:
output ="./path/to/emission_output"
-
windInputFile: path to input meteo file. Example:
windInputFile ="./path/to/meteo.csv"
-
mettype: (string) type to input meteo file (default: csv file):
- "csv" (csv file type);
- "postbin" (postbin file type).
Example:
mettype = "csv"
-
windOutputFile: path to output meteorological file where meteo and emission information for each source and species are saved. Example:
windOutputFile = "./path/to/meteo_emissions.csv"
-
pemspe: path to the pemspe file (needed only in "spray" mode). Example:
pemspe = "./path/to/pemspe"
-
sources: a toml inline table (i.e. an array delimited by
[{...}, {...}, {...}]
). Each element is a dictionary, in the form of{key1 = val1, key2 = val2, etc...}
, that describes a source. Thescheme
key defines the algorithm to apply to the given source. The keys of a source's dictionary can be different as shown in the following example:sources = [ ### scheme 1 - odour source { id = 1, scheme = 1, species = ["OU"], height = 5, terrain = "rural", vref = 0.6}, ### scheme 2 - dust emitted by wind erosion of piles with available data # asymmetric shape (2 sides and an angle) { id = 2, scheme = 2, species = ["PTS", "PM25", "PM10"], height = 4, major = 5, minor = 3, angle = 15, roughness = 0.5, tfv = 0.05}, # conical shape (radius) { id = 3, scheme = 2, species = ["PTS", "PM25", "PM10"], height = 4, radius = 3, roughness = 0.005, tfv = 0.05}, ### scheme 3 - simplified dust emission by wind erosion of piles { id = 4, scheme = 3, species = ["PTS", "PM25", "PM10"], height = 4, radius = 3.6, movh = 4} ]
Details on the mandatory keys for sources, that are common to all the schemes:
-
id: identifier string or number in the input emission file (it can also be a list, e.g.
[1, 'source1', 'source 2']
); -
scheme: integer number that identifies the emission scheme:
- 1 = odour sources,
- 2 = dust emission by wind erosion of piles, with available wind data,
- 3 = simplified dust emissions by wind erosion of piles, with no available wind data;
-
species: array of strings that identify the involved species;
-
height: source height in meters.
Description of scheme specific keys:
-
scheme 1 (odour):
- terrain: optional string with terrain type (one of
{"rural", "urban"}
); - vref: reference velocity (m/s) of the emission factor used to estimate the input emission (optional, default = 0.3).
- terrain: optional string with terrain type (one of
-
scheme 2 (dust):
- tfv: threshold friction velocity (m/s), (mandatory);
- roughness: rugosity or roughness length (cm) (optional, default = 0.5);
- Mandatory source geometry:
- Asymmetric pile shaped as a trapezoidal prism:
- major (m): length of the major side of the base rectangle on which the pile rests on the ground.
- minor (m): length of the minor side of the base rectangle on which the pile rests on the ground.
- angle (°): angle between the major side and the x-axis on the ground, measured anticlockwise with a range of -90° to +90°.
- Conic pile:
- radius (m): cone radius.
- Asymmetric pile shaped as a trapezoidal prism:
-
scheme 3 (simplified dust):
- radius: equivalent conic pile radius (m) (mandatory);
- movh: number of hourly disturbances of the erodible surface (mandatory).
Nota Bene: geometrical information specified in the configuration file does not overwrite the one provided in the emission file, and no validation is performed to ensure compatibility between the two files.
Working hypotheses forMEDEA
are hereafter summarised:
- The meteorological input file is always required. It must contain at least all the deadlines included in the emission file;
- In the
spray
model case, pemtim and pemspe input files must be provided in the format specified in./tests/pemtim
and./tests/pemspe
; - In the
calpuff
model case, calpuff input file must be provided in the format specified in./tests/calpuffpolv
; - In the
impact
model case, impact input file must be provided in the format specified in./tests/impact_input.csv
; - In the
aermod
model case, aermod input file must be provided in the format specified in./tests/aeremi.dat
; - Only hourly emissions are allowed.
The meteorological file is specified in the configuration file with the windInputFile
key.
Currently, two formats are recognised:
-
csv, with deadlines formatted as in the following:
date,ws,wd,stabclass,z 2019-01-01T00:00:00Z,4.32,111,B,10
-
postbin, test file format. In this case, the field
mettype = "postbin"
must be added to the configuration file.
The parameters z
(wind field sensor height) and stabclass
(stability class, specified with letters [A, B, C, D, E, F, G] or numbers [1, 2, 3, 4, 5, 6]) are only used by scheme 1 (odour emission), while ws
(wind speed) and wd
(wind direction) are not needed by the scheme 3 (simplified dust emission by wind erosion).
Note: the date
parameter is always necessary. Further mandatory parameters are specified in the following schemes description.
Output meteorological file, specified in the toml configuration file with the key windOutputFile
, will always be in the csv format and it will contain all input information plus all the computed emission factor or emission values (according to the selected scheme), for all specified sources and species defined in the same configuration file.
In the case of scheme 1, the meteorological output file includes the hourly correction factors for each source.
In the ./tests/
folder some input emission files are provided as examples for all four models and for the meteorology:
pemspe
andpemtim
forSPRAY
;calpuffpolv
forCALPUFF
;impact_input.csv
forIMPACT
;aeremi.dat
forAERMOD
;windinput.csv
andpostbin.dat
for meteorology.
Odour emission correction factor:
where
Terrain type / Stability class | A | B | C | D | E | F |
---|---|---|---|---|---|---|
rural | 0.07 | 0.07 | 0.1 | 0.15 | 0.35 | 0.55 |
urban | 0.15 | 0.15 | 0.2 | 0.25 | 0.3 | 0.3 |
Reference:
- Bellasio, R.; Bianconi, R. A Heuristic Method for Modeling Odor Emissions from Open Roof Rectangular Tanks. Atmosphere 2022, 13, 367. https://doi.org/10.3390/atmos13030367
Dust emission by wind erosion of storage piles is estimated according to the EPA AP-42 Sec. 13.2.5 ("Industrial wind erosion") methodology, hereafter summarized:
- Computation of the wind at 10 meters:
where
- Computation of fastest mile starting from wind speed:
-
Pile exposed surface is computed according to its shape:
- Trapezoidal prism shaped source
$$S = \frac{h (T + l_{minor})}{2} + l_{obl} l_{major} + T l_{major} + l_{obl} l_{major}+ \frac{h (T + l_{minor})}{2}$$ where
$T = l_{minor} / 2 - h$ is the top side of the trapezoid section,$l_{obl}$ is the oblique side of the trapezoid section,$h$ is the pile height,$l_{major}, l_{minor}$ are the horizontal dimensions.- Conical shaped source:
$$S = \pi r \sqrt{r^2 + h^2}$$ -
Computation of the friction velocities applied to the pile sub-areas:
$$u_1^* = \max \left(0.4 \frac{f_m}{\log \frac{25}{z_0}} 0.2, u^*_{thr}\right)$$ $$u_2^* = \max \left(0.4 \frac{f_m}{\log \frac{25}{z_0}} 0.6, u^*_{thr}\right)$$ $$u_3^* = \max \left(0.4 \frac{f_m}{\log \frac{25}{z_0}} 0.9, u^*_{thr}\right)$$ $$u_4^* = \max \left(0.4 \frac{f_m}{\log \frac{25}{z_0}} 1.1, u^*_{thr}\right)$$ $$u_5^* = \max \left(0.4 \frac{f_m}{\log \frac{25}{z_0}}, u^*_{thr}\right)$$
where
-
Computation of the erosion potential for each sub-area:
$$P_i = 58 \cdot \left( u^_i - u^{thr} \right)^{2} + 25 \cdot \left( u_i^* - u^*{thr} \right)$$
with
$i = 1, 2, 3, 4, 5$ . -
Computation of hourly emitted mass (µg/h):
a) If
$\frac{h}{base} \le 0.2$ (low pile):$$e_{r} = k S P_5 10^6$$ b) If
$\frac{h}{base} > 0.2$ (high pile):- if the shape of pile is symmetric (conical)
$$e_{r} = k S \frac{40 P_1 + 48 P_2 + 12 P_3 + 0P_4}{100} 10^6$$ -
if the shape of pile is asymmetric and the wind direction w.r.t. the orientation of the pile is between [0°,20°]:
$$e_{r} = k S \frac{36 P_1 + 50 P_2 + 14 P_3 + 0P_4}{100} 10^6$$ -
if the shape of pile is asymmetric and the wind direction w.r.t. the orientation of the pile is between (20°,40°]:
$$e_{r} = k S \frac{31 P_1 + 51 P_2 + 15 P_3 + 3P_4}{100} 10^6$$ -
if the shape of pile is asymmetric and the wind direction w.r.t. the orientation of the pile is between (40°,90°]:
$$e_{r} = k S \frac{28 P_1 + 54 P_2 + 14 P_3 + 4P_4}{100} 10^6$$
with
References:
-
EPA AP-42: Compilation of Air Emissions Factors, Section 13.2.5 Industrial Wind Erosion.
-
Davis, F. K., and H. Newstein, 1968: The variation of gust factors with mean wind speed and with height. J. Appl. Meteor., 7, 372–378 https://doi.org/10.1175/1520-0450(1968)007<0372:TVOGFW>2.0.CO;2
Simplified dust emission by wind erosion of storage piles, without wind speed time series, is estimated according to the methodology proposed by of ARPA Toscana and summarised by the following expression:
where:
-
$e_{r}$ is the emission rate (or hourly emitted pollutant mass, in kg/h). In the output emission file the emission will be written as µg/h; -
$e_{f}$ is the pollutant emitted value (in kg/m^2):-
if
$\frac{h}{2r} > 0.2$ , that is the high pile case:$e_f = 1.26 \cdot 10^{-6}$ for PM25;$e_f = 7.9 \cdot 10^{-6}$ for PM10;$e_f = 1.6 \cdot 10^{-5}$ for PTS; -
if
$\frac{h}{2r} \le 0.2$ , that is the low pile case:$e_f = 3.8 \cdot 10^{-5}$ for PM25;$e_f = 2.5 \cdot 10^{-4}$ for PM10;$e_f = 5.1 \cdot 10^{-4}$ for PTS.
-
-
$S = \pi r \sqrt{r^2 + h^2}$ is the surface of the conical shaped pile, where$h$ is the height and$r$ is the radius; -
$\mathrm{mov}_{h}$ is the number of hourly movements occurring on the erodible surface;
The simplified methodology is based on EPA AP-42 Sec. 13.2.5 with a standardized wind speed distribution.
Reference:
- ARPA Toscana, 2010: Linee guida per intervenire sulle attività che producono polveri, Section 1.4 Erosione del vento dai cumuli, in italian.
medea
was initially developed at Simularia by Massimiliano Romana.
The current maintainer is Giuseppe Carlino.
Bug fixing and feature requests: please submit and issue. Contributions should be addressed with pull requests. For any other request, find us on email.
medea
is free software whose copyright holder is Simularia s.r.l. and it is distributed under the GNU Affero General Public License v3.0 or later. See the LICENSE file for more information.