Generation of water molecules by LAMMPS

Dear all. I want to use the LAMMPS command (create_atoms…random…mol) to generate water molecules in an existing box, the system is a two-dimensional periodic boundary, and the electric potential energy is calculated using “kspace_modify slab” and “PPPM”.
I found that when I randomly generate water molecules, even if there are no other atoms in the generated region (water molecules will not overlap with other atoms), the system energy after generation is very large, which makes the minimize command unable to completely optimize the system, and “out of range atoms - cannot compute PPPM” appears.
Unless the number of water molecules generated is small, the simulation can proceed normally I want to know whether a large number of water molecules cannot be generated at one time when using the LAMMPS command, or whether there are other methods to optimize the position of generated water molecules?
The files are attached.
Test.data (955.8 KB)
Test.in (26.6 KB)
H2O_TIP3P.data (376 Bytes)

May be you can try:

  • option 1: to insert a large number of water molecules randomly, and use delete_atoms command to remove the overlapping ones. This is a bit dirty but it may do the trick.
  • option 2: to insert the water molecules on a lattice (for example a simple cubic lattice with approximately 3 Angstroms lattice parameter).
  • option 3: to create a bulk water system first at the right temperature and pressure, and add it to your system using the ‘read_data append’ command

Thanks for your reply, I also think deleting water molecules is a feasible method. Do you know the criteria for judging overlap in LAMMPS? Is it based on the atomic distance between water molecules or other criteria?

Yes it is just a distance criteria. You can choose to remove molecules if some atoms from two different molecules are closer than, let say, 2 Angstroms. Then you should still make an energy minimization to bring the molecules at proper distances from one another.

1 Like