Clone wiki

KROME / kexplorer

back to index

Time-dependent reaction explorer

(Note: you must have graphviz installed on your machine!)

KROME has a tool called KEXPLORER that shows the chemical network evolution while running.
To enable this, add the following call inside a time loop in your code

call krome_explore_flux(density(:), Tgas, ifile, xvar)

where density(:) is an array containing the number density of each species, Tgas the temperature, ifile a file units where the dump will be appended, xvar an independent variable, e.g. time, but it could be density or any other variable.
This subroutine saves the reaction fluxes to the file ifile every time is called.

To use these data go to krome/tools/kexplorer and open main.py.
This is the driver for the class kexplorer_network, that when constructed loads the data from the file saved by krome_explore_flux at run-time.

Now you can find the reactions with larger relative flux and/or with a given atom by using for example

network.findBest(threshold=.05,atom=None)

where the default values are shown. If you want to include all the species containing oxygen call

network.findBest(atom="O")

The threshold is the relative fraction wrt the total flux.
For example, threshold=.05 means that you are interested in all the reactions that have flux >5% wrt the total flux (i.e. more than 5% of the sum of all the fluxes) at the given time.

If you want to list all the reactions that match your criteria use

network.listBest()

and if you want to produce a list of PNG files with an evolving graph use

network.dumpBest(pngFolder="pngs/")

where pngs/ folder is the default.

Output

The output is a set of PNG files that show the network graph while evolving.
Thicker edges represent larger fluxes (note that the thickness is proportional to log10 of flux).
Light blue arrows are not-active edges.
The label at the bottom of the figure is the independent variable value.

Updated