[lammps-users] Increasing number of atoms while doing 'fix gcmc'

Hello,

I am using the LAMMPS version 29Oct2020. I am currently attempting to do a hybrid MD/MC simulation to calculate the diffusion coefficient of a LJ liquid using LAMMPS. I went through the documentation for ‘fix gcmc’ and there is a mention of the fluctuating number of atoms in the system while using this fix. I used the ‘compute_modify mdtemp dynamic/dof yes’ command to ensure that the number of atoms does not change with each timestep as per the documentation. But still, the number of atoms keeps increasing with each timestep. What could possibly be the reason for this happening? I am attaching my code along with this.

Regards,
Rajesh

SETTINGS

variable x equal 20
variable y equal 20
variable z equal 10

variable rho equal 0.6
variable t equal 1.0
variable rc equal 2.5

problem setup

units lj
dimension 3
atom_style atomic
neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes

lattice custom ${rho} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 &

basis 0.0 0.0 0.0 basis 0.5 0.5 0.5

region simbox block 0 $x 0 $y 0 $z
create_box 1 simbox
create_atoms 1 box

pair_style lj/cut ${rc}
pair_coeff * * 1 1

group mdatoms type 1

timestep 0.0001

dump 4 all atom 50000 LJ_Diff.lammpstrj
dump_modify 4 sort id

mass * 1.0

velocity all create $t 97287

compute mdtemp mdatoms temp

compute_modify mdtemp dynamic/dof yes
fix mdnvt mdatoms nvt temp 1.0 1.0 0.1
fix_modify mdnvt temp mdtemp

thermo 1000

unfix mdnvt

##---------------RELAXATION--------------------------------------

run 50000

##-------------------------MC STEP-------------------------------

fix 7 mdatoms gcmc 20 1000 1000 1 29494 1.0 0.0 0.01

timestep 0.0001

run 2000000

Hello,

I am using the LAMMPS version 29Oct2020. I am currently attempting to do a hybrid MD/MC simulation to calculate the diffusion coefficient of a LJ liquid using LAMMPS. I went through the documentation for ‘fix gcmc’ and there is a mention of the fluctuating number of atoms in the system while using this fix.

I used the ‘compute_modify mdtemp dynamic/dof yes’ command to ensure that the number of atoms does not change with each timestep as per the documentation.

where does the documentation say that? the opposite is the case! this command makes the temperature compute aware of the changing number of degrees of freedoms (as should be rather obvious by the command name already). to turn something off, you would expect a command with a “no” anyway.

But still, the number of atoms keeps increasing with each timestep. What could possibly be the reason for this happening? I am attaching my code along with this.

the reason is that your reading and understanding of the documentation has room for improvement.

Regards,
Rajesh

##-------------------------MC STEP-------------------------------

fix 7 mdatoms gcmc 20 1000 1000 1 29494 1.0 0.0 0.01

here is your fix gcmc command. please look up what each argument means and you should be able to answer your question yourself.