[lammps-users] Use of hybrid/overlay with Tersoff and LJ when several atom types are present

Dear All,

I am trying to run a simulation of a polymer and a nanotube, requiring a total of 9 atom types.

The polymer uses a quite complicated force field with 8 atom types (see file below). The polymer by itself has been tested carefully, and worked well.
I define the C atoms in the carbon nanotube as atoms type 9.
I want to give Tersoff interaction within the nanotube (only amongst atoms type 9), and LJ to all other pairs (including type 9 atoms)
each pair with different coefficients, that I specify in the input file.

For this, I tried hybrid/overlay, and after a few tries the input file is read correctly (i know it bc i put a little error at the end, and fixed other things until that point was reached), but the simulation stops immediately saying:
“All pair coeffs are not set” .
I am attaching below the input file, the header of the data file, and the C.tersoff file for the tersoff potential.

Do you know how I can get this to work, using the force field for the polymer with 8atom types, tersoff for the nanotube (C type 9), and LJ interaction between the polymer and the molecule?
I appreciate your help.
Best Regards,

Marco

INPUT FILE:
units real
newton on
boundary p p p

atom_style full

bond_style class2

angle_style class2

dihedral_style opls

improper_style harmonic

read_data data.150c_20p

pair_style hybrid/overlay tersoff buck/coul/cut 12.0 #angstrom units for cutoff

#atom-types #sub-style for hybr/over #A #rho #C

pair_coeff 1 1 buck/coul/cut 10304 0.163 7.143
pair_coeff 2 2 buck/coul/cut 10304 0.163 7.143
pair_coeff 3 3 buck/coul/cut 10304 0.163 7.143
pair_coeff 4 4 buck/coul/cut 4968 0.17 4.378
pair_coeff 5 5 buck/coul/cut 4968 0.17 4.378
pair_coeff 6 6 buck/coul/cut 3680 0.135 0.813
pair_coeff 7 7 buck/coul/cut 3680 0.135 0.813
pair_coeff 8 8 buck/coul/cut 37168 0.179 44.89
pair_coeff 1 2 buck/coul/cut 10304 0.163 7.143
pair_coeff 1 3 buck/coul/cut 10304 0.163 7.143
pair_coeff 1 4 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 1 5 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 1 6 buck/coul/cut 6157.817 0.149 2.476
pair_coeff 1 7 buck/coul/cut 6157.817 0.149 2.476
pair_coeff 1 8 buck/coul/cut 19569.851 0.171 18.028
pair_coeff 2 3 buck/coul/cut 10304 0.163 7.143
pair_coeff 2 4 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 2 5 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 2 6 buck/coul/cut 6157.817 0.149 2.476
pair_coeff 2 7 buck/coul/cut 6157.817 0.149 2.476
pair_coeff 2 8 buck/coul/cut 19569.851 0.171 18.022
pair_coeff 3 4 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 3 5 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 3 6 buck/coul/cut 6157.817 0.149 2.476
pair_coeff 3 7 buck/coul/cut 6157.817 0.149 2.476
pair_coeff 3 8 buck/coul/cut 19569.851 0.171 18.022
pair_coeff 4 5 buck/coul/cut 4968 0.17 4.378
pair_coeff 4 6 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 4 7 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 4 8 buck/coul/cut 13588.621 0.174 14.048
pair_coeff 5 6 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 5 7 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 5 8 buck/coul/cut 13588.621 0.174 14.048
pair_coeff 6 7 buck/coul/cut 3680 0.135 0.813
pair_coeff 6 8 buck/coul/cut 11695.223 0.157 6.415
pair_coeff 7 8 buck/coul/cut 11695.223 0.157 6.415

pair_coeff 1 9 buck/coul/cut 7154.737 0.166 5.599 #interaction of nanotube with molecule
pair_coeff 2 9 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 3 9 buck/coul/cut 7154.737 0.166 5.599
pair_coeff 4 9 buck/coul/cut 4968 0.17 4.378
pair_coeff 6 9 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 7 9 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 8 9 buck/coul/cut 13588.621 0.174 14.048

pair_coeff * * tersoff C.tersoff NULL NULL NULL NULL NULL NULL NULL NULL C # interaction between C atoms in the nanotube (first 8 types set to null so they dont interact through tersoff)

neighbor 2.0 bin
neigh_modify delay 5

timestep 1 #femtoseconds

#fix 1 all nvt 275.0 275.0 100.0
#fix 1 all nve
#fix 2 all temp/rescale 100 300 300 5 1.0 #temp-rescale can be used only with NVE ensemble!!

#OUTPUTS
thermo 100 #output thermodyanmics every N steps
dump 1 all atom 1 dump.1p3ht #output atoms coordinates every N timesteps
dump_modify 1 scale no

minimize 0.0 1.0e-6 100 5000

C.tersoff file:

comments

C C C 3.0 1.0 0.0 38049 4.3484 -.57058 .72751
0.00000015724 2.2119 7995.9527 1.95 0.15 3.4879 32136.9316

HEADER OF DATA FILE (then file continues specifying all the topology/interaction in the molecule; this was already tested carefully, and worked).

LAMMPS data file.
8082 atoms
1041 bonds
1960 angles
2830 dihedrals
160 impropers

9 atom types
11 bond types
25 angle types #types 11,12,16,17 actually not present, since atoms type 3&5 not bound to each other!!
33 dihedral types # 4 of them not used in a single unit cell; others all used
2 improper types

-1000.000000 1000.000000 xlo xhi
-1000.000000 1000.000000 ylo yhi
-2000.000000 2000.000000 zlo zhi

Masses

1 12.010700 # C z
2 12.010700 # C r-H
3 12.010700 # C r-subst
4 12.010700 # C ch-first
5 12.010700 # C ch-others
6 1.007940 # H ch
7 1.007940 # H r
8 32.064999 # S
9 12.010700 # C SWNT

Dear All,

dear marco,

I define the C atoms in the carbon nanotube as atoms type 9.
I want to give Tersoff interaction within the nanotube (only amongst
atoms type 9), and LJ to all other pairs (including type 9 atoms)
each pair with different coefficients, that I specify in the input
file.

that means that you don't need hybrid/overlay but
plain "pair_style hybrid" should do.

For this, I tried hybrid/overlay, and after a few tries the input file
is read correctly (i know it bc i put a little error at the end, and
fixed other things until that point was reached), but the simulation
stops immediately saying:
"All pair coeffs are not set" .

because for hybrid overlay you'd have to

I am attaching below the input file, the header of the data file, and
the C.tersoff file for the tersoff potential.

there is another potential problem. the tersoff files require that you
use "metal" units. so you have to convert the rest, or the tersoff file.

ciao,
    axel.

Dear Axel,

thanks for your prompt response. Actually, it turned out that i had forgotten to define LJ between 5-9 atoms.
The problem now is that after I fix this, the simulation runs both with “plain” hybrid and with hybrid\overlay!

–Is it computing the same thing in the two cases? How so? for my specific problem (atoms 9 interact among themselves with tersoff, atoms 9 interact through LJ with all others, atoms 1*8 interact LJ) which is the right hybrid type? (input file below)

–A last one: if I convert the two energies in the tersoff file to Kcal/mol, can I use it with real units?

Ciao and thanks,

Marco

INPUT FILE:
units real


pair_style hybrid/overlay tersoff buck/coul/cut 12.0 #angstrom units for cutoff

pair_coeff 1 1 buck/coul/cut 10304 0.163 7.143
pair_coeff 2 2 buck/coul/cut 10304 0.163 7.143


pair_coeff 4 9 buck/coul/cut 4968 0.17 4.378
pair_coeff 5 9 buck/coul/cut 4968 0.17 4.378
pair_coeff 6 9 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 7 9 buck/coul/cut 4275.773 0.152 1.963
pair_coeff 8 9 buck/coul/cut 13588.621 0.174 14.048
pair_coeff * * tersoff C.tersoff NULL NULL NULL NULL NULL NULL NULL NULL C # between C(9) atoms in the nanotube (other 8 types set to null as they dont interact through tersoff)

Dear Axel,

thanks for your prompt response. Actually, it turned out that i had
forgotten to define LJ between 5-9 atoms.
The problem now is that after I fix this, the **simulation runs both with
"plain" hybrid and with hybrid\overlay!**
--Is it computing the same thing in the two cases? How so? for my specific

if it produces the same energies, it is the same; if not, it isn't..
in hybrid you can only have one (non-bonded) interaction per
pair of particle types. in hybrid/overlay interactions are added.
if you add to a zero interaction the result is the same.

problem (atoms 9 interact among themselves with tersoff, atoms 9 interact
through LJ with all others, atoms 1*8 interact LJ) which is the right hybrid
type? (input file below)

plain hybrid.

--A last one: if I convert the two energies in the tersoff file to Kcal/mol,
can I use it with real units?

not sure. those files are notoriously complex. it would be easier
to convert the others to metal units. again, the resulting energies
for both cases will tell you, whether your conversion is correct.

ciao,
   axel