[lammps-users] Best way of periodically adding and deleting atoms?

Hi, dear LAMMPS colleges:

I wish to use LAMMPS to simulate a single Carbon or Silicon system.

My plan is to make the velocity of center of mass constant and in -z direction. Periodically adding perfect crystal atoms(with some initial speed and initial temperature) from the right side and if atoms reach the left side of box, they will be deleted.

However, there’re some difficulties.

  1. I understand I can use create_atoms with the help of region command to add atoms. But I need to do this periodically, say, every 100 timesteps, I need to add 8 C-atoms. Is there a way of doing this?

  2. To delete atoms, is there a way to delete atoms whenever they’re dropping out of the left side of the box?

  3. The newly added atoms must undergo a langevin thermostat for a fixed amount of time before they eventually join the rest. Is this possible to define such behavior?

Thanks in advance for your help.

If you make the left side of the box a boundary of style 'f', then
atoms will disappear (be deleted) when they cross that boundary.
You can insert atoms whenever you wish, using create_atoms.
It's up to you to insure that you are inserting them in good
locations where there is space, and they don't overlap existing atoms.
You could do this every 100 steps, by using the run every command,
or making a loop in your code with there 2 statements:

run 100
create_atoms ...

See the variable, jump, next commands for how to make a loop.

The atoms you create will be in a group (that you choose). You can
assign a langevin thermostat to this group and it will work on the
new atoms. You could also reset the group on older atoms within
the loop above, so that they would no longer be thermostatted.