Skip to content

Postprocessing Gallery

This page provides an overview of available postprocessing plots generated by GENOA v3 for different purposes. See test case test_process for an example of how to generate these plots.


Reaction Pathway Visualization

GENOA v3 can visualize reaction pathways for the entire mechanism or specific species in a flowchart using graphviz. For example:

Reaction Pathways of a Reduced Mechanism Generated by GENOA v3 for the degradation of Octene (U08000).

Reaction Pathways of a Specific Species (2T8000) from the Degradation Scheme of a-pinene.

Species Node Representation

As shown in the example flowcharts, reducible species are represented by nodes. Each node contains the species name and its structure (if activated).

Species are addressed in the following way:

  • Only reducible species are shown in the flowchart. Basic species are not shown currently for clarity.
  • The User-input species (a root species) are highlighted in red.
  • A maximum number of 100 species are limited to be shown in the flowchart. (This number can be adjusted in the code.)

When the structure of the species is activated, Condensable reduspecies are highlighted with a border, of which the gray scale indicates its volatility (range can be adjusted in the code):

  • light gray indicates SVOCs with a saturation vapor pressure (psat) larger than 10-6 atm.
  • dark gray indicates LVOCs with a psat between 10-9 and 10-6 atm.
  • black indicates ELVOCs and NVOCS with a psat smaller than 10-9 atm.

When the structure of the species is not activated, border with different shapes are used to indicate stable species with different volatility:

  • ellipse indicates VOCs that are not condensable.
  • box indicates SVOCs and LVOCs.
  • hexagon indicates ELVOCs.
  • octagon indicates NVOCS.

Reaction Edge Representation

The reducible reactions are represented by edges connecting the nodes, where different colors and arrowheads are used to indicate different types of reactions:

  • Blue edges with solid V shape arrowheads represent reactions with O3.
  • Red edges with hallow diamond shape arrowheads represent reactions with OH radicals.
  • Green edges with hallow triangle shape arrowheads represent reactions with NO3 radicals.
  • Orange edges with solid circle shape arrowheads represent reactions with NO radicals.
  • Yellow Green edges with solid sqaure shape arrowheads represent reactions with NO2 radicals.
  • Cyan edges with hallow circle shape arrowheads represent reactions with HO2 radicals.
  • Gray edges with solid diamond shape arrowheads represent reactions with one or a group of RO2 radicals.
  • Dark Red edges with hallow square shape arrowheads represent photolysis reactions.
  • Other reactions are represented by black edges with solid triangle shape arrowheads.

How to Generate

The parameter used for reaction pathway visualization is plot_flowchart, which need to be specified in the [postprocessing] section of the configuration file and assgin value of a list in the format of:

plot_flowchart = [["species1,species2,...", "n_up, n_down", 1], ["species3,species4,...", "n_up, n_down", 0], ...]

where each sublist contains three elements:

  • A string of species name(s) separated by , for the species group which the reaction pathways will be visualized. The more species you include, the more complex the figure will be. It is recommended to include only one or a few species to begin with.
  • A string of n_up and n_down separated by , for the number of generations of upstream and downstream reactions to be included in the visualization. E.g., "2,2" will include 2 generations of upstream and downstream reactions. "0,0" will plot all reactions involving the species group.
  • A binary value (0 or 1) to indicate whether to plot the reaction pathways with the structure of the species (1) or not (0).

The test case test_process provides an example of how to generate reaction pathways for a specific species or the entire mechanism. The flowchart will be saved as a PNG file and a text file under the same name in the output directory for postprocessing. You can modify the generated text file to make changes to the flowchart and replot using graphviz.

Example legends are providied in legend_flowchart.png for reference, not currently not included in the figure.

0D Simulation Result Visualization

GENOA v3 provides a set of postprocessing plots for 0D simulation results. The plots are generated based on the output files from the box model simulations, which need to be specified in the [postprocessing] section of the configuration file.

To generate the plots, assign mech_names and mech_label to the list of mechanism names and labels and activate the desired postprocessing variables.

The available postprocessing variables are shown as follows:

Variable Names [1] Description Available Options Example Plots
plot_time_series Line plots of time series for given species[2] on give phases[4]. Options in the format: species1,speces2+species3_phase (use , to separate species, + to sum species, and _ to separate species and phase, hereafter).[4]
E.g., U08000_gas, NO,NO2_gas, NO+NO2_gas, O3_gas, YLNO,YPNO,YLNO2,YPNO2_gas*, etc.
plot_time_series Stacked plots of time series for top nlim number of species from given groups[3] on different phases. The total concentration of this group will plot as a solid line in blue. Options in the format: group_phase
E.g., rsp_gas*, rsp_aero, pvoc, svoc_aero, etc.
plot_reactivity Line plots of time series for gas-phase reactivity of species groups with reactants: O3, NO3, OH (HO in GECKO-A), HO2, NO2, etc. Options in the format: reactant_group
E.g., HO_rsp, O3_voc, NO_rsp, NO_ro25, etc.
plot_reactivity Line plots of relative reactivity (normalized) if more than one reactants is specified. Options in the format: reactant1,reactant2_group
E.g., HO,O3,NO3_rsp, HO,O3,NO3_voc, NO,HO2_rsp, NO,HO2_ro2*, etc.
plot_ratios Line plots of organic mass to organic carbon (OM/OC), atomic oxygen to carbon ratio (O/C), hydrogen to carbon ratio (H/C), and nitrogen to carbon ratio (N/C) for group on given phase. Options in the format: group_phase
E.g., org_gas, rsp*, svoc_aero, etc.
plot_volatility Stacked plots of volatility distribution for reducible species on given phase. Options in the format: phase
E.g., gas, aero, total*, etc.
plot_functional_group Stacked plots of functional group distribution for reducible species on given phase. Options in the format: phase_type. Currently available type: GECKO-A for functional group classification based on GECKO-A mechanism and unit in number per carbon.
E.g., gas, aero, total*, etc.
plot_carbon Stacked plots of organic carbon mass distribution on given phase. Options in the format: phase
E.g., gas, aero, total*, etc.
plot_hc_nox_ratio Empirical Kinetics Modeling Approach (EKMA) like plots showing hydrocarbon (HCs) to NOx ratio over time on given phase. A line of HCs/NOx = 8 is also plotted showing chemical regime estimation. Options in the format: phase_nskip, where nskip is the number of time step to be skipped when plot. nskip set to h or not included will plot hourly values.
E.g., gas_2, total_h*, etc.

* Option used for the example plot.
[1]: Add or uncomment variable with desired options in the configuration file to generate the plot.
[2]: Species keywords are species name saved in the species list file. It will plot line plot for each fiven species.
[3]: Group keywords include: org for all organic species, inorg for all inorganic species, pvoc for primary volatile organic compounds specified by primary_vocs, rsp for all reducible organic species derived from pvoc, nrsp for all non-reducible organics (the ones exist in the basic reactions), svoc for all organic condensables, radical for all organic radicals, voc for all organic volatile compounds.
[4]: Phase keywords include: gas for gas phase , aero for aerosol phase, and total for total gas and aerosol phase. If no phase is provided, it will plot for total phase.
[5] ro2 is a special group that includes all peroxy radicals that can only be used for reactivity calculation.

Beside specifying the postprocessing variables, the following parameters can be set in the [postprocessing] section of the configuration file to control the plot generation:

  • tag_csv: Set to 1 to generate a list of CSV files containing the data used for the generated plots.
  • tag_norm: Set to 1 to generate stacked plots with normalized values for the activated postprocessing variables. An example is shown below.
  • tag_merge: Set to 1 to merge the generated plots under different conditions into one figure. They will be saved in the subdirectory merged under the output directory.

The original and normalized stacked plots for functional group distribution of reducible species on total phase (plot_functional_group = total_GECKO-A).

Original Stacked Plots Normalized Stacked Plots

Mechanism Comparison

To activate comparison plots for different mechanisms, set the following parameters in the [postprocessing] section of the configuration file:

  • plot_mech_cmp: This parameter allows you to compare multiple mechanisms. Value can be set to a list of mechanism names (from mech_names) to compare or the string all to compare all mechanisms. If activated, comparison plots will be generated for activated postprocessing plot variables shown in Table 1.
  • plot_mech_cmp2: This parameter allows you to compare two mechanisms as x and y axes. Value can be set to a list of two mechanism names (from mech_names) to compare.

When activated, comparison plots will be generated for activated postprocessing plot variables shown in Table 1. For example:

An Example of Comparison Plots with plot_mech_cmp An Example of Comparison Plots with plot_mech_cmp2

Error Calculation

GENOA v3 also allows users to calculate the differences between the simulation results of different mechanisms. To activate error calculation, set the following parameters in the [postprocessing] section of the configuration file:

  • err_types: The error type(s) to be calculated. Currently GENOA v3 supports 18 types of error calculation shown below. Use a list of error types to activate multiple error calculations. Use "all" to calculate all error types. -err_ref_mech: The reference mechanism label for error calculation.

If activated, a CSV file containing the error values calculated for all mechanisms specified in plot_mech_cmp with the specified error types and activated plot variables will be generated in the output directory under the name cmp_error.csv.

Meanwhile, plots showing the errors for all mechanisms will be generated for each error type and plotted data in a subdirectory error under the output directory.

Error Types

An example of error plot plotted with `err_types = ['fb']`.

The available error types are shown as follows:

  • re: Relative Error
  • mre: Mean Relative Error
  • mse: Mean Squared Error
  • rmse: Root Mean Squared Error
  • rmse/ave: Root Mean Squared Error to Average
  • R: Correlation Coefficient
  • R2: Correlation Coefficient Squared
  • mngb: Mean Normalized Gross Bias
  • mnge: Mean Normalized Gross Error
  • mfb: Mean Fractional Bias
  • mfe: Mean Fractional Error
  • mfew: Mean Fractional Error Weighted by the reference value
  • nmb: Normalized Mean Bias
  • nme: Normalized Mean Error
  • fb: Fractional Bias
  • fe: Fractional Error
  • few: Fractional Error Weighted by the reference value
  • mfe_[n1,n2]: Mean Fractional Error over sections specified by the defined cut-off time points (e.g., `mfe_24,48` for the maximum mfe value among 0-24, 24-48, and 48-end time points).
  • few_[n1,n2]: Fractional Error Weighted by the reference value over sections specified by the defined cut-off time points (e.g., `few_24,48` for the maximum few value among 0-24, 24-48, and 48-end time points).

Reduction Record Visualization

The training reduction process generates a record file under the name record_[mech_id].txt in the output mechanism directory. The file contains the information regarding the size and accuracy of the reduced mechanism during the reduction process, which can be visualized in a plot:

Plot showing the reduction training processes in example reduction case R.

In the plot, the x-axis represents valid reductions. The left y-axis shows the size changes during the reduction, compared to the starting-point mechanism, in terms of the number of reactions, species, and condensable species.

The accuracy of the reduced mechanisms in terms of the training errors are shown in purple and red lines for maximum and average errors, respectively, on the right y-axis. The trainnig error tolerances used in the reduction process are also shown in the gray and red areas, where the vertical line and change of color indicate different training cycles.

How to Generate

To generate the reduction record visualization plot, set plot_reduction in the [postprocessing] section of the configuration file in the format of:

[[reaction_file_path_1,start_mech_name_1,end_mech_name_1], [reaction_file_path_2,start_mech_name_2,end_mech_name_2], ...]

The value is given as a list as one complete reduction may involve multiple training in sequence.