This repository contains data and code to accompany "Fate of organic peroxy radicals in the atmosphere, combustion systems, and everywhere in between" by Mark Jacob Goldman, William H Green, and Jesse H Kroll.
The goal of this repository is to help others reproduce and build off of our work.
The structure of the folders in this repository are as followed:
- code-code to generate figures
- figure_3_4.ipynb - an IPython notebook with code to generate figures 3 and 4. Requires generating data in
data\fig_4_data\
- figure_5.ipynb - an IPython notebook with code to generate figure 5.
- figure_6.ipynb - an IPython notebook with code to generate figure 6. Requires RMG installation to work.
- *carter_atkinson_NO_branching.ipynb - code to calculate the branching of NO + RO2 described in Carter and Atkinson 1989 Journal of Atmospheric Chemistry
- simulation.py - methods used to simulate reaction systems in the IPython notebooks
- figure_3_4.ipynb - an IPython notebook with code to generate figures 3 and 4. Requires generating data in
- data-contains data used to make the figures
- mechanism - cantera, chemkin, and RMG files for the mechanisms used in this work
- merchant-full_w_NO.cti - propane model - pressure-dependent RO2
- gamma_i_butanol.cti - butanol model - pressure-dependent RO2
- aramcomech2_modified.cti - butane model
- butanol_high_p.inp - butanol model at high pressure limit
- species_dictionary_butanol.txt - file for RMG to read butanol model
- fig_4_data - place for calculated data to generate figure 4. Data is generated by running the
make_diagram.py
files within this folder.
- mechanism - cantera, chemkin, and RMG files for the mechanisms used in this work
- LICENSE - information on usage of code and data within this repository
- Dockerfile - contains information for creating a virtual environment that can replicate the calculations in this work
- environment.yml - contains a list of python packages used by the Dockerfile to generate the python environment
A file Dockerfile
contains instructions to generate an image with all the dependencies for simulating the results of the model. The instructions here were tested on Ubuntu 18.04 and Ubuntu 20.04, but will likely work on other linux distributions and operating systems. The instructions below reference unix terminal commands to generate the image and complete the calculations. You will first have to install the docker package. Once that is installed, build the docker image with:
docker build . -t peroxy
You can then create a container from the image and then launch a terminal session with it.
docker container run -it -p 8888:8888 peroxy
If you are generating figure 4, then you will have to run initial calculations. You can do this in the container by:
cd /home/paper_repo/data/fig_4_data/butanol_1bar/
python make_diagram.py
cd ../butanol_1ppb/
python make_diagram.py
cd ../propane_1ppb/
python make_diagram.py
cd ../propane_1bar/
python make_diagram.py
Figures are generated and analysis conducted within the jupyter notebooks within the code
folder. To access jupyter notebooks inside the container, create and run the server with
cd /home/paper_repo/code/
jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --allow-root
You can view the notebook in your web browser on the same device as the container with the URL localhost:8888
or by copying the URL given in the terminal window and pasting it into a web browser. You can open the various notebooks and run the the code by going to Cell -> Run All. This will save the figures within the container. Plenty of online tutorials discuss more advanced usage of IPython notebooks and docker.