[lammps-users] Different pair atom in hybrid overlay gran/hertz and colloid

Dear all,

I am using hertzian spring with vdW interaction with the help of hybrid/overlay of gran/hertz/histroy and colloid.

I have two types of particles - with (1,1) - I want to use COR of 0.94 and (2,*) I want to use COR of 0.99.

I read that - gran/hertz/history is a global command and defines same coefficient for all the atoms. Do we have an option to do such that, So, I can define different gran/hertz coefficients with (2,*)

Following is my script where I am defining my potential -

pair_style hybrid/overlay gran/hertz/history 10.9 NULL 2.14 NULL 0.0 0 colloid 550.0

pair_coeff 2 2 gran/hertz/history
pair_coeff 1 2 gran/hertz/history
pair_coeff 1 1 gran/hertz/history
pair_coeff 1 1 colloid 60 1.0 49.4 49.4 550.0

Above script is working fine - Just I am not able to add different coefficients in pair_coeff 1 2 and 2 2 .

I am using the 14 May 2021 version.

Thank you in advance!.


Dear users,

I guess this mail is missed. If I am not clear with my query, Pls let me know.


since the parameters are stored with the pair style globally and not with individual pairs of atom types, you cannot, of course, change them with a pair_coeff command for different pairs of atom types. that is just logical.

thus you would have to use the sub-style multiple times in the pair_style hybrid/overlay command with different settings and then use the sub-style indexing as explained in the pair style hybrid documentation to map specific pairs of atom types to the two different sub-styles. However, I am not certain, if this can actually work for technical reasons. the gran/hertz/history pair style was most certainly not designed to be used that way.

instead, have you looked into using pair style granular instead? it is a more flexible and more recently developed DEM pair style that does allow designating different settings to pairs of atom types via pair_coeff. it is supposed to be a superset of the other granular pair styles (and then some).


Sorry Axel, my mistake Ill make sure to do in future.

I have looked into this a bit closer. The error message you report shows that your input was not correct.
If you were using the correct input you would get a different error message (about re-using a fix-ID).

With a small modification to the source code, however, this can be avoided and it looks that this will enable using the gran/hooke/history and gran/hertz/history multiple times or a combination of those in a hybrid pair style.

This modification will be made available in the next LAMMPS patch release.


Thanks Axel.

I also tried doing it with the new pair_style granular command.
I used granular with colloid using hybrid/overlay

I did with the following script -

LAMMPS is already telling you where the error is, you should not need somebody else to tell you.

The first pair_coeff command is only correct without a hybrid pair style. You must change it with. “hertz” is not a hybrid substyle. Details are in the documentation.

This is a really trivial error with an obvious fix. Please consult the manual more carefully and try more systematically to solve it yourself.
I will respond to people asking such kind of questions only a limited number of times.

Hi Alok,
It should be “pair_coeff * * granular hertz …”

Alok Tiwari <[email protected]>于2021年8月9日 周一下午10:33写道:

Thank you so much, Ting :slight_smile: You saved me!

I just realised what a stupid mistake I was doing.

Thank you Axel! You made me realise patience and a careful look at problems would have solved it.