Error : One or more bodies are single particles

Hello lammps-users,

I am simulating methane and water in a cube of 20 Angstrom to study their interactions. For first attempt, I tried ‘fix 1 rigid/npt …’

  1. Any intra molecular interactions are not to be considered.
  2. I have considered both hydrogens (in water and methane) as distinct i.e. different atom types.
  3. The energy shoots to infinity after certain steps.

What am I doing wrong?

Questions:

  1. Are the atoms placed too close? ( I have tried with different box sizes varying from 10 angstrom to 30 angstrom)
  2. What is the difference between ‘fix 1 all rigid/npt molecule temp 283.0 283.0 1.0 iso 30.0 30.0 10.0’ and 'fix 2 rigid/npt/small … '. reading the documentation does not help much. If I use ‘fix 1 all rigid/npt/small molecule temp 283.0 283.0 1.0 iso 30.0 30.0 10.0’ … still the energy gets ‘nan’ after certain steps.
  3. Is it a right way to define rigid molecules? However I don’t get any error with ‘fix rigid/npt’ command. Still, the energy is ‘nan’. (but no ERROR)
  4. Visualising the molecule via VMD show the Hydrogen running away after certain steps (possibly when energy is nan?)

Please find the files below.

input file

Hello lammps-users,

I am simulating methane and water in a cube of 20 Angstrom to study their
interactions. For first attempt, I tried 'fix 1 rigid/npt ...'

1. Any intra molecular interactions are not to be considered.

i don't see any indication of that.

2. I have considered both hydrogens (in water and methane) as distinct i.e.
different atom types.
3. The energy shoots to infinity after certain steps.

What am I doing wrong?

most likely your force field parameter assignments are wrong. most of
the LJ interactions seem to be set to 0.0, thus there is no repulsion
to balance the coulomb interaction. so atoms may get very close and
have very large (unphysically large forces).
look at your pressure! for two molecules in a large box, it is *huge*.

the rest, i.e. NaNs is just the consequence.

Questions:
1. Are the atoms placed too close? ( I have tried with different box sizes
varying from 10 angstrom to 30 angstrom)

you can easily measure compute the distance and judge yourself.

2. What is the difference between 'fix 1 all rigid/npt molecule
temp 283.0 283.0 1.0 iso 30.0 30.0 10.0' and 'fix 2 rigid/npt/small ... '.
reading the documentation does not help much. If I use 'fix 1 all
rigid/npt/small molecule temp 283.0 283.0 1.0 iso 30.0 30.0 10.0' ... still
the energy gets 'nan' after certain steps.

the difference is in the communication of the rigid body information.
the /small variant is optimized for having many small rigid objects.

3. Is it a right way to define rigid molecules? However I don't get any
error with 'fix rigid/npt' command. Still, the energy is 'nan'. (but no
ERROR)

how to define rigid objects is explained in the documentation. there
are three ways. two of those are applicable in your case. i doubt that
this is the problem here.

4. Visualising the molecule via VMD show the Hydrogen running away after
certain steps (possibly when energy is nan?)

which is a confirmation that the problem is more likely with the
potential parameters, although an incorrect data file can contribute
to this as well, if your molecule id assignments are incorrect.

axel.

1. added 'neigh_modify exclude molecule all' before 'pair_style * *
0.0 0.0' command -> for ignoring intra-molecular interactions.
2. Removed 'pair_style * * 0.0 0.0' and ran the code. But it results
in error -> ''All pair_coeffs are not defined.''

So, how to define rigid bodies with no intra-molecular interactions? I
understand it can be achieved using the following instructions:
1. to make rigid, use 'fix 1 rigid/npt (or nvt or whatever one needs)
...' . For small atoms, 'fix 1 rigid/npt/small ... ' is useful.
2. to exclude intra-molecular interactions, use 'neigh_modify exclude
molecule all'
3. Define required pair_coeff (based on the pair_style chosen).
4. What about pair_coeff's of the atoms whose interactions have to be
ignored (i.e. intramolecular interactions' pair_coeff) . I put them
zero, else I get the error : "All pair_coeffs are not defined.''
5. If I do pair_coeff zero for intra-molecular interactions, like Axel
explained, I get energy and pressure as 'nan'.

Please highlight the way to exclude the intra molecular interactions
for a rigid body. I am doing something wrong with pair_coeffs, I
believe.

Thank you,

1. added 'neigh_modify exclude molecule all' before 'pair_style * *
0.0 0.0' command -> for ignoring intra-molecular interactions.
2. Removed 'pair_style * * 0.0 0.0' and ran the code. But it results
in error -> ''All pair_coeffs are not defined.''

because you are missing the parameters for *intermolecular*
interactions, including interactions with periodic images.
parameters have to be set to meaningful values for all pairs.

So, how to define rigid bodies with no intra-molecular interactions? I
understand it can be achieved using the following instructions:
1. to make rigid, use 'fix 1 rigid/npt (or nvt or whatever one needs)
...' . For small atoms, 'fix 1 rigid/npt/small ... ' is useful.
2. to exclude intra-molecular interactions, use 'neigh_modify exclude
molecule all'
3. Define required pair_coeff (based on the pair_style chosen).
4. What about pair_coeff's of the atoms whose interactions have to be
ignored (i.e. intramolecular interactions' pair_coeff) . I put them
zero, else I get the error : "All pair_coeffs are not defined.''

that is wrong.

5. If I do pair_coeff zero for intra-molecular interactions, like Axel
explained, I get energy and pressure as 'nan'.

as mentioned in the previous e-mail, you still have coulomb
interactions. you removed only LJ and your removed too many of them.

Please highlight the way to exclude the intra molecular interactions
for a rigid body. I am doing something wrong with pair_coeffs, I
believe.

how about you practice with an even simpler model? just use two pairs
of LJ particles with argon parameters that you group into
(hypothetical) diatomics via fix rigid.
there you can use the same LJ parameters for everything. once you get
this working correctly, you can gradually convert that system to your
intended system.

the general strategy is straightforward: if you don't understand why
something doesn't work, make the test system simpler, until it is so
simple that it works. then work your way backwards, use different
routes, if needed.

axel.