# LJ with wca in same input script

Dear Lammps Users,

I have a quick question regarding implementing WCA potential (shifted lj) with lj potential in lammps. I have three types of atoms: type-1, type-2, and type-3. I want lj interaction between type-2 and type-3 and WCA interaction between all others.

pair_style lj/cut 2.5
pair_coeff 2 3 1.0 1.0 2.5
pair_style lj/cut 2.5
pair_modify shift yes
pair_coeff 3 3 1.0 1.0 1.122462048
pair_coeff 1 3 1.0 1.0 1.122462048
pair_coeff 2 2 0.0 1.0 0.0
pair_coeff 1 1 0.0 1.0 0.0
pair_coeff 1 2 0.0 1.0 0.0

or

pair_style lj/cut 2.5
pair_coeff 2 3 1.0 1.0 2.5
pair_modify shift yes
pair_coeff 3 3 1.0 1.0 1.122462048
pair_coeff 1 3 1.0 1.0 1.122462048
pair_coeff 2 2 0.0 1.0 0.0
pair_coeff 1 1 0.0 1.0 0.0
pair_coeff 1 2 0.0 1.0 0.0

or anything else.
Please give me a proper solution with reference.
Thank you

Hi @Gokul,

First, WCA and shifted LJ are different things. WCA is only the repulsive part of LJ, and shifted LJ generally means that you set the energy value at the cut-off radius to 0 (it still includes an attractive part). Please look at the shift keyword in pair_modify command for more info.

Second, it makes no sense to set \epsilon and the cut-off radius to 0 with \sigma to 1 as you are doing in most of your pair coefficients. As far as I can tell, the values you’re using for the WCA are correct (with a reduced units potential, for example with your pair_coeff 3 3 command), but it is unclear what you are trying to do. The other commands do not make much sense.

I suggest you spend more time reading both the pair_coeff and pair style lj/cut manual pages and try to figure it out by yourself to really understand what you are doing and if this is what you are trying to achieve here. This would be more valuable than giving you a solution that might not suit your needs.

Good luck,
Germain.

Thanks @Germain, I can understand the difference between WCA and shifted LJ.My concern is how to use both WCA and LJ in the same script.I want LJ between 2,3 with a cut of 2.5 , WCA in coeff 1,3 and 3,3 and no interaction between all the other coeff like 2,2 and 1,1 and 1,2. Now my actual concern is, should I have use “pair_style lj/cut 2.5” two times or just once is sufficient.
Thanks

Now my actual concern is, should I have use “pair_style lj/cut 2.5” two times or just once is sufficient.

The pair_style command defines the type of non-bonded interaction you want for your whole system. This should only be used one time except in specific cases where you switch between models. Using a second time the command with the same parameters will do nothing with lj/cut style. Sorry for insisting but you should read the doc where this is explained in details.

I want LJ between 2,3 with a cut of 2.5 , WCA in coeff 1,3 and 3,3 and no interaction between all the other coeff like 2,2 and 1,1 and 1,2.

I think this is different to what you described initially (with WCA between ‘all other’ types). Again as I said, WCA and LJ are essentially the same potential with different cut-off values. So you would just have to set specific cut-off values to the pair you would like to interact with WCA. Edit:I also realised that setting only \epsilon to 0 (without changing the cut-off radius) for the pairs you do not want to interact with one another would result in the same as what I described below. I often go to over-complicated initial solutions, sorry for that.

If you want some atom types to not interact with one another for any reason, I think it would be more reasonable to use the pair_style hybrid in combination with the pair_style zero. This would still allow neighbours lists to be built during the simulation and make sure no atom is lost.