[lammps-users] The format of pair_style Hybrid

Dear lammps users,\

I am trying to use a hybrid pair style of granular and DLVO. But the format of the hybrid pair style with granular models seems to be not working, and the format to write pair coefficients always run into error. Is there any example of a similar case available? Thank you!
Best regards

pair_style hybrid/overlay granular yukawa/colloid 2 2.5
pair_coeff 1 1 jkr {ysm11} 0.3 {psr11} {chs11} tangential mindlin NULL 1.0 0.2 twisting marshall pair_coeff 2 2 jkr 1e5 0.3 0.45 0.7 tangential mindlin NULL 1.0 0.2 twisting marshall pair_coeff 1 2 jkr {ysm12} 0.3 {psr12} {chs12} tangential mindlin NULL 1.0 0.2 twisting marshall
pair_coeff 1 1 yukawa/colloid 100 2.3
pair_coeff 1 2 yukawa/colloid 150 2.3

Your pair_coeff commands are only half correct. Please see the pair style hybrid docs.

Hi Axel,
Thank you for your reply. I double-checked the manual, but could not find my wrong one. Could you please help me point out further?
Best regards

Did you really check the manual page Axel pointed you to or did you only check granular and yukawa styles pages? Don’t forget to double check and compare with your input file. You did not declare one of the pair style names before the parameters.



Hi Germain
Thank you for your help.
The two pair styles I declared are “granular” and “colloid/yukawa”.
For the pair coefficient, JKR and the following parameters is one cohesion type of the granular pair style. So the pair style should be fine. The pair coeffs are the same as in the manual. I am confused.
Best Regards

Germain Clavier <[email protected]>于2021年7月2日 周五下午8:59写道:


you are confused because you are not paying attention to the details of the advice given and didn’t read the hybrid pair style docs carefully enough. pair_coeff commands have a slightly different syntax when used with a hybrid pair style and when not. That is explained with multiple examples in the pair hybrid documentation.

Please also note that LAMMPS will report syntax errors immediately and show the faulty line. If LAMMPS reports a syntax error you input must be incorrect unless you can provide convincing proof that the behavior of LAMMPS is not consistent with its documentation. From the information you have provided it is and the fault is with your input.


Thank you for the clarification. I corrected it and it works well!
Best Regards