RNMC

Logo

Reaction Network Monte Carlo

View the Project on GitHub BlauGroup/RNMC

LGMC - Lattice Gillespie Monte Carlo

A kMC implementation coupling a homogeneous (Gillespie-like) region with a lattice, enabling simulations with reactions occurring in multiple phases and capable of electrochemical reactions. Either Marcus of Butler-Volmer electron transfer theory (specified at runtime, see ‘Running LGMC’ below) can be used when calculating rates for electrochemical reactions. The lattice is periodic in the x, y direction and non-periodic in the z direction. The lattice may be static (no sites can be added or deleted) or dynamic (sites are added through adsorption and deleted through desorption reactions).

As a starting point two examples of LGMC uses are shown in Examples - LGMC with a static lattice to model CO Oxidation on Cu and LGMC with a dynamic lattice to simulate the formation and evolution of the solid electrolyte interphase in a lithium-ion battery.

Sqlite IO

Sqlite is used for input, output, and checkpointing. Before running LGMC two necessary .sqlite files must be generated - The Lattice Reaction Network Database and State Database. Examples of Python code used to generate these files are available in examples directory . Below is an outline of each .sqlite file and its necessary tables. Each .sqlite file must follow this format exactly.

The Lattice Reaction Network Database

There are two tables in the lattice reaction network database both of which must be created and filled in by the user:

The State Database

There are five tables in the initial state database all of which must be created by the user:

Running LGMC

To access the makefile, enter the LGMC folder:

$ cd LGMC

Next create an executable with the makefile. The executable will be located in the build folder.

$ make LGMC

For further help on the makefile and to view other commands:

$ make help

LGMC requires seven input arguments (either step_cutoff or time_cutoff must be specified):

When running LGMC ensure that your input file paths are correct considering the executable is inside the build folder. Below is an example of how LGMC can be run using the input files inside the examples directory (here step_cutoff is specified):

build/LGMC --lattice_reaction_database=examples/LGMC/CO_oxidation/rn.sqlite --initial_state_database=examples/LGMC/CO_oxidation/initial_state.sqlite --number_of_simulations=1000 --base_seed=1000 --thread_count=8 --step_cutoff=200 --checkpoint=1 --parameters=examples/LGMC/CO_oxidation/LGMC_params.txt

Running this command does not generate any new files or directories but will populate the initial_state_database with trajectory data.