lammps gcmc

variable tstart equal 1.0

variable tend equal 1.0

variable tdamp equal 10.0

variable nstep equal 10 # do gcmc atom insertion/removal every nstep steps

variable natom equal 1 # on average insert/remove natom atoms during nstep steps

variable nmove equal 0 # number of MC moves during nstep steps

variable mu equal -1.2 # chemical potential

variable dr equal dr # MC translational move step

group substrate type 1 # substrate atoms of type 1 with fixed number

group gas type 2 # gas atoms of type 2 to be inserted/removed

compute_modify thermo_temp dynamic yes # update atom number when calculating the temperature

fix 1 substrate nvt temp ${tstart} ${tend} ${tdamp}

fix 2 gas nvt temp ${tstart} ${tend} ${tdamp}

fix 3 gas gcmc ${nstep} ${natom} ${nmove} 1234567 2 ${tstart} ${mu} ${dr}

fix_modify 1 temp thermo_temp # used to update the temperature in NVT thermostat

fix_modify 2 temp thermo_temp

run 100000