Use MEDEA
to compute meteorology dependent emission input files for many atmospheric pollution dispersion models.
Emissions are computed according to different schemes suitable for odour and particulate matter modelling.
See below for a description of the relevant algorithms and for bibliographical references.
The tool currently works with the following atmospheric dispersion models: CALPUFF, ARIA-IMPACT, SPRAY, AERMOD.
To generate a PDF document from this file, type this command in the terminal:
$ pandoc --to=pdf README.md -V geometry:margin=25mm -o README.pdf
In order to run MEDEA
, some python packages are required. These can be installed inside a virtual environment as in the following:
$ virtualenv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
The included help, shows how to use the tool:
(venv) $ ./medea.py -h
usage: medea.py [-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
The configuration file is in toml format. An example config.toml
is included in the repository.
The keys of configuration file are described in the following:
input
: string containing the path to the input emission file (="./test/pemtim"
);output
: string containing the path to the output emission file (="./test/pemtimout"
);windInputFile
: string containing the path to the input meteo file (="./test/met.csv"
or="postbin.dat"
);mettype
: string containing the type of the input meteo file:- = "postbin" : it tries to read a postbin file.
- = "csv" : it tries to read a csv file.
- by default (by omitting the field or filling it with an invalid value) it tries to read a csv file.
windOutputFile
: string containing the path to the output file where meteo and emission information for each source and species are saved (="./test/metout.csv"
);mode
: (integer number or string) MEDEA mode for the model choice:- 0 or "spray" ⟶ spray;
- 1 or "calpuff" ⟶ calpuff;
- 2 or "impact" ⟶ impact;
- 3 or "aermod" ⟶ aermod.
pemspe
: string containing the path to the pemspe file: it is needed only in spray mode (mode = 0)sources
: it is a toml inline table, that is an array delimited by[{...}, {...}, {...}]
, and each element is a "dictionary", in this form{key1 = val1, key2 = val2, etc...}
, that describes a source. The keyscheme
defines the algorithm to apply to a 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 - wind erosion of dust cumulus 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 - wind erosion of dust cumulus with no available data
{ id = 4, scheme = 3, species = ["PTS", "PM25", "PM10"],
height = 4, radius = 3.6, movh = 4}
]
Details on the mandatory keys 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
: = {1,2,3} integer number that identifies the scheme:- 1 = scheme for odour sources,
- 2 = scheme for dust cumulus with available wind data,
- 3 = scheme for dust cumulus with no available wind data;
species
: array of strings that identify the involved species;height
: source height in meters.
Description of specific keys for each scheme:
-
terrain
: {"rural", "urban"} terrain type (optional)vref
: reference velocity (m/s) of the emission factor used to estimate the emission in the input file (optional, default = 0.3)
-
tfv
: threshold friction velocity (m/s) (mandatory);roughness
: rugosity or roughness length (cm) (optional, default = 0.5);- source geometry (mandatory):
- asymmetric (trapezoidal prism):
major
,minor
,angle
, sides of the base rectangle (m) and angle between the major side and the x-axis (anticlockwise, range -90°,+90°); - conic:
radius
, cone radius (m).
- asymmetric (trapezoidal prism):
-
radius
: equivalent cumulus radius (m) (mandatory);movh
: hourly movement of cumulus number (mandatory).
Note: geometrical information in the config.toml
will not substitute that present in the emission file and no compatibility control is performed 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
./test/pemtim
and./test/pemspe
; - In the CALPUFF model case, calpuff input file must be provided in the format specified in
./test/calpuffpolv
; - In the IMPACT model case, impact input file must be provided in the format specified in
./test/impact_input.csv
; - In the AERMOD model case, aermod input file must be provided in the format specified in
./test/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:
- A csv file with deadlines formatted as in the following:
date,ws,wd,stabclass,z 2019-01-01T00:00:00Z,4.32,111,B,10
- A text file in the postbin format. In this case, the field
mettype
has to be filled up with the stringpostbin
in the toml configuration file.
The 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) parameters are employed only with scheme number 1, while ws
(wind speed) and wd
(wind direction) are not needed by the scheme number 3.
Note: the date
parameter is always necessary. Further mandatory parameters are specified in the scheme 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 and 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 ./test/
folder some input emission files are provided as examples for all four models and for the meteorology:
pemspe
andpemtim
for SPRAY;calpuffpolv
for CALPUFF;impact_input.csv
for IMPACT;aeremi.dat
for AERMOD;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
The algorithm according to the EPA AP-42 methodology is here summarized:
- Computation of the wind at 10 meters:
where
- Computation of fastest mile starting from wind speed:
-
Cumulus 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 cumulus 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 cumulus 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 cumulus):$$e_{r} = k S P_5 10^6$$ b) If
$\frac{h}{base} > 0.2$ (high cumulus):- if the shape of cumulus 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 cumulus is asymmetric and the wind direction w.r.t. the orientation of the cumulus 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 cumulus is asymmetric and the wind direction w.r.t. the orientation of the cumulus 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 cumulus is asymmetric and the wind direction w.r.t. the orientation of the cumulus 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
The algorithm proposed in the simplified methodology of ARPA Toscana is summarized with the following formula:
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 cumulus 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 cumulus 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 cumulus, where$h$ is the height and$r$ is the radius; -
$\mathrm{mov}_{h}$ is the number of hourly movements occurring on the cumulus;
Reference:
- ARPA Toscana, 2010: Linee guida per intervenire sulle attività che producono polveri, Section 1.4 Erosione del vento dai cumuli, in italian.
medea
is developed at Simularia by Massimiliano Romana (maintainer) and 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.