REACTER: Suggested Workflow
For veteran LAMMPS users, please find LAMMPS-style documentation here.
1) Identify a reaction to be simulated.
2) Build a molecule template of the reaction site before the reaction has occurred.
3) Build a molecule template of the reaction site after the reaction has occurred.
4) Create a map relating each atom between pre- and post-reaction templates.
5) Fill a simulation box with molecules and run a simulation with fix bond/react.
Prerequisite: Familiarity with the open-source software package LAMMPS.
Identify a reaction to be simulated.
This is the fun part. Determine the reaction you would like to simulate and review its mechanism in a polymer handbook or organic chemistry textbook. Keep in mind that the mechanism must already be known.
Build a molecule template of the reaction site before the reaction has occurred.
In LAMMPS, small molecules can be modeled with molecule templates. In our case, we will use them to model a reaction site, which may include several molecules and/or parts of molecules. Molecule templates have a format very similar to LAMMPS data files, so you can often utilize your favorite method for generating data files.
NOTE: You should include just enough atoms in this molecule template such that any atoms which change type or connectivity have fully defined topology. For example, if the force field you are using includes improper dihedrals, atoms within 3 bonds of reacting atoms should be included.
Prerequisite: Familiarity with LAMMPS molecule templates. For example, care must be taken to correctly sync atom types between molecule templates and simulation.
Build a molecule template of the reaction site after the reaction has occurred.
Follow the same procedure as Step 2. This molecule template must contain the same amount of atoms as the pre-reaction template, because atoms between the two must map to each other. Do not try to complete complex reactions in one step: this will lead to unstable simulations. Instead, each step of a complex reaction mechanism can be treated as an independent 'reaction' by repeating this workflow (Steps 2-4). An arbitrary number of independent reactions may be active in a running simulation (see Step 5 below for how this is treated).
Create a map relating each atom between pre- and post-reaction templates.
Each atom in the pre-reaction template must correspond to an atom in the post-reaction template. To inform LAMMPS of this mapping, we read in a mapping file, which also contains other information such as which atoms to use for triggering the reaction. The format of the mapping file is discussed in detail in the LAMMPS-style documentation.
Create an initial configuration for your simulation. Typically, start with a stoichiometric ratio of the reactants involved your reaction equilibrated at your chosen temperature. Many programs offer options with which to fill a simulation box with small molecules, such as the create_atoms command in LAMMPS or the Solvation Box plugin in VMD. You should be familiar with one such option in order to build a stable initial configuration for your simulation.
You are now ready to use fix bond/react in order to build a polymerized or crosslinked system. See the official documentation for command syntax and details on how to use this command. Fix bond/react supports any number of reactions to be stably simulated in parallel by ensuring that atoms only participate in one reaction at a time. This command offers the option to dynamically relax reacting atoms over a certain number of time steps, which is almost always necessary to ensure a stable simulation.
Further details are given in LAMMPS-style documentation here.
Fill a simulation box with molecules and run a simulation with fix bond/react.