Simulating reactions on Lammps

Yup It can handle many if statements. You can get the type of an atom in the simulation using the type keyword something like this

variable type equal type[$n]

Here “type” stores the type of the atom in a simulation. Then you can do something like the following (This is a snippet of my lammps code to simulate a reaction which involves changing types and deleting bonds).

if “${type}==18” then &
“delete_bonds h_n_1 multi any remove special” &
“set group h_c type 6”

Multiple fix bond/create commands will create a mess. This can be achieved using single fix bond/create. This will also involve defining mutiple bond types (along with atom types) prior to simulation and changing bond types after fix/bond create. By defining multiple bond types you are not restricted by the maxbonds criterion stipulated by fixed bond/create.
This is going to be slightly hard. A good understanding of how fix/bond create command operates is necessary to achieve what you are trying to achieve. Also there is a problem of relaxing the bonds after bond creation.

Some of the questions (not elaborate) I would ask if I were to simulate the reactions using lammps.

  1. how many types you have in the system.
  2. With which atom types are you creating bonds ?. What is the bond type (and bond coeffs) of the new bond that is created.
  3. Do I need to change types of the atoms after fix/bond create. Do I need to define multiple bond types (some of them with same bond coefficients) ?
  4. Is the bond/deletion independent of bond/creation process. Are they interdependent ?

Coming back to your original question. This can be implemented in lammps.
If this difficult to implement using the existing lammps functionalities you can always do this outside of lammps by manipulating the data file by writing your own awk/bash/c script.