Mini-chem is a kinetic chemistry network solver primarily for gas giant atmospheric modelling, pared down from the large chemical networks. This makes use of 'net forward reaction tables', which reduce the number of reactions and species required to be evolved in the ODE solvers significantly. Mini-chem's NCHO network currently consists of only 12 species with 10 reactions, making it a lightweight and easy to couple network to large scale 3D GCM models, or other models of interest (such as 1D or 2D kinetic modelling efforts).
These are the papers describing mini-chem methods so far:
Tsai et al. (2022) - A Mini-Chemical Scheme with Net Reactions for 3D GCMs I.: Thermochemical Kinetics - A&A Volume 664, id.A82, 16 pp. - arXiv:2204.04201
Lee et al. (2023) - A Mini-Chemical Scheme with Net Reactions for 3D GCMs II.: 3D thermochemical modelling of WASP-39b and HD 189733b - A&A Volume 672, id.A110, 13 pp. - arXiv: arXiv:2302.09525
This repository contains the standalone version of mini-chem, containing the source code and testing modules for users to use for their own purposes.
The src_mini_chem_dlsode is the recommended version (and typically fastest) for most purposes. The src_mini_chem_seulex and src_mini_chem_dvode contain seulex and dvode solver standalone variants as an alternative. These haven't been checked for threadsafe yet, so only use for non-OpenMP applications, MPI only codes should be ok.
Other directories are currently experimental.
All codes use the Kahan-Babushka-Neumaier compensated sum algorithm to calculate the sum of the forward and backward rates of each species. This is generally slower than the (in previous versions) Pairwise Summation method for small timesteps, but is more accurate and actually faster when longer timesteps are considered. This behavior is also seen in the FRECKLL kinetic code, which uses a 'distillation' technique to reduce the condition number. Naive summation typically produces the wrong answer, showing the importance of considering more accurate summation methods.
This code is in active development and aims to have continual improvements to stability and speed, please report bugs or improvements you find.
All source code has been tested with the gcc (gfortran) and intel (ifx) compilers. Other compilers are under testing.
The namelist that describes the simulation set up:
- Network - 'HO', 'CHO' or 'NCHO' select network
- T_in - input temperature [K]
- P_in - input pressure [Pa]
- t_step - timestep [s]
- n_step - number of steps
- data_file - path to _data file
- sp_file - path to _sp file
- net_dir - path to net reaction files
- met - metallicity of net reaction tables
- VMR - initial VMR of each species (in the species order of the _sp file).
Contains a standalone version using the dlsode ODE solver (recommended).
Contains a standalone version using the dvode ODE solver (alternative).
Contains a standalone version using the dlsodes ODE solver (experimental).
Contains a standalone version using the seulex ODE solver (alternative).
Contains a standalone version using the radau5 ODE solver (experimental).
Contains a standalone version using the rodas ODE solver (experimental).
Contains a standalone version using the ros4 ODE solver (experimental).
Contains a standalone version using the limex ODE solver (experimental).
Contains the outputs and plotting scripts for the 0D test code.
Mini-chem formatted data files for each network _sp contains the species data, _data contains the reaction network, 1x, 10x directories etc- contains the netrate tables in mini-chem format for that metallicity and C/O ratio.
A workspace for converting the Jacobian from VULCAN python to the fortran format - typically is required to be done manually. Feel free to e-mail if new Jacobians are required.
Contains python code to produce contour plots of the net forward reaction rate tables.
Original VULCAN formatted data for each kinetic network net reaction tables for different metallicity and C/O ratio - typically reformatted using the provided python script.
Contains some benchmarking data from VULCAN.
TODO: mini-photochemistry.
Improve equilibrium condition detection.
The fortran code can be compiled by altering the makefiles in each src_ directory. The executable is then in the main directory. Compiled code can be removed by entering 'make clean'. You will need to clean and recompile if any changes to the source code are made.