[lammps-users] How to create angles between two group of atoms

Hello All,

I am using the version 27 May 2021. I am currently working on creating an amorphous H2O model for further simulation. Below are the relevant codes:

region 1 prism -51.3425 40.9055 -4.23577 50.4014 -28.5905 41.6218 -30.416 -0.01851 3.03E-15

create_box 5 1 bond/types 3 angle/types 1 extra/bond/per/atom 1 extra/angle/per/atom 1 extra/special/per/atom 1

create_atoms 4 random 10000 10000 1
create_atoms 5 random 20000 20000 1
mass 4 1.008
mass 5 15.994

bond_coeff 2 0.0 1.0

Angle_coeff 1 0 109.47

group Hatom id 5201:25200
group Oatom id 25201:35200

create_bonds many Hatom Oatom 2 0.5 3.0

Basically, I created the atoms and define the bond and angle coefficients for water. Then, I created bonds between the H atom group and the O atom group. However, I cannot find a code to create angles between two groups of atoms. Is there a command to achieve this? Or is there any other methods to construct the amorphous water model with bonds and angles?


LAMMPS is not particularly good at creating structures other than atom lattices.

what is “amorphous water”? just liquid water frozen without crystallization?
how can your approach with just placing atoms in random places get you proper water molecules? and no OH or H3O or isolated H or O fragments?
also, you can get overlapping atoms. i don’t see any provisions to avoid that.
You also have too little space reserved for special neighbors.

The best way to create such a system is usually to use some external tool that produces a data file.
Like writing a custom script and then have it output such a data file.
Or use a tool like packmol to create the geometry and then some scripting in VMD with the topotools plugin to add the bonds and angles.
Or use the moltemplate tool.

If you want to construct such a system in LAMMPS the best starting point would be to use a molecule file for a single water molecule.
and then create_atoms. mind you that you need to leave a lot of space to avoid crashes due to overlapping atoms since the molecules will have random orientations and that also means you will have to spend some time and trickery to get the system to the desired density, which must be done gradually.

If i need to set up a water system, I usually use the data file from the “tally” examples and then use replicate to bring it to a suitable size and then either heat or quench it to the desired conditions.
If you need it more disordered then heating it beyond the critical point and then properly quenching it to low temperature should do the trick.

Hello Axel,

Thanks for your reply! What I need is a water system without crystallization. Could you please tell me where to find the “tally” example you mentioned and how to replicate it in LAMMPS?


Hello Axel,

Thanks for your reply! What I need is a water system without crystallization.

Could you please tell me where to find the “tally” example you mentioned

in the top-level folder of the LAMMPS sources type the command (assuming you are on a Linux machine):

find examples -name tally -print

or go and download:


that is for SPC/E but you can use it with any 3-site water potential or TIP4P

and how to replicate it in LAMMPS?



Thanks!And for the heating and quench,what commands can help me to achieve them in Lammps?

Axel Kohlmeyer <[email protected]>于2021年9月8日 周三下午5:51写道:

Please familiarize yourself with the manual and overall how to run simulations with LAMMPS.
There is a lot of information there.
I don’t have the time to be your personal search engine.