Which LAMMPS command can give me short range attractive force and long range (nearly) no interaction?

Dear LAMMPS users,

I am trying to assign certain kind of interaction to monodisperse particles (2D system). In the short range, the interaction is the attractive force while in the long range, there is nearly no interaction. For example, a step force

F(x) = positive_const, x<x_0
0, x>=x_0

or a force like below,

F(x) = 1/x^7

Is there any built-in function can work like what I described above? Or should I write a new force from scratch?

Thank you very much.

Best regards,
zjgbz

If F is a positive constant, the force is repulsive, not attractive. That is, particles will move away from each other at a short range. Is that what you want?

The most standard approach for that is using a simple Lennard-Jones potential, truncating it at the minimum, and shifting it so that the energy is continuous.

See “pair lj/cut” and “pair_modify” on how to do that.

Dear LAMMPS users,

I am trying to assign certain kind of interaction to monodisperse
particles (2D system). In the short range, the interaction is the
attractive force while in the long range, there is nearly no interaction.
For example, a step force

F(x) = positive_const, x<x_0
          0, x>=x_0

or a force like below,

F(x) = 1/x^7

Is there any built-in function can work like what I described above? Or
should I write a new force from scratch?

​as of LAMMPS version ​19 May 2017, there are two ways to define custom
pairwise additive interactions:
- you can tabulate your interaction and use pair style table. the
documentation for pair style table explains the format of the tabulation.
- you can define your interaction as a python class and use pair style
python. see the documentation and the examples in the examples/python
folder.

actually, you can combine the two use the pair_write command to generate
the table in the compatible format from the python function and then use
the (much faster) tabulated potential for your production run. in both
cases, beware of artifacts due to energy/force functions that are not
continuous when interpolating or when using splines.

axel.

Thank you, Stefan!

I made a mistake, F should be a negative constant. I indeed need the short range attractive force rather than a short range repulsive force. The Lennard-Jones interaction will give me a short range repulsive force, right? So is it possible to modify the LJ potential by reflecting the LJ interaction with respect to x-axis? Thank you very much.

Best regards,
zjgbz

Thank you, Stefan!

I made a mistake, F should be a negative constant. I indeed need the short
range attractive force rather than a short range repulsive force. The Lennard-Jones
interaction will give me a short range repulsive force, right? So is it
possible to modify the LJ potential by reflecting the LJ interaction with
respect to x-axis? Thank you very much.

​what is the point of having a short range, constant or otherwise
attractive force? the particles wi​ll all collapse on top of each other.

before modifying source code, please consider making some experiments with
the features i suggested in my other mail. you'll save yourself a massive
amount of time by validating your model before starting to modify sources
(and struggling with issues related to it).

axel.

Thank you, Axel, for the two emails in this thread!

Yes, I agree with you - they will collapse to a chunk if the running time is long enough. The one reason why I intend to do this is that I hope to learn to customize the force, and the system under this force is easy to predict. Another reason is that, after the isotropic short range attractive force simulation, I intend to create particles attracting each other only in their two poles – just like a particle with two patches on its two poles, and only the patches can attract patches, and one patch can maximally connect to one another patch. In this sense, I guess directly creating patchy particles might not be proper, because one patch can connect to more than one patches. So I am wondering if I can limit the isotropic short range attractive force just happen on the poles of the particle. Thanks again.

Best regards,
zjgbz

Thank you, Axel, for the two emails in this thread!

Yes, I agree with you - they will collapse to a chunk if the running time
is long enough. The one reason why I intend to do this is that I hope to
learn to customize the force, and the system under this force is easy to
predict. Another reason is that, after the isotropic short range attractive
force simulation, I intend to create particles attracting each other only
in their two poles -- just like a particle with two patches on its two
poles, and only the patches can attract patches, and one patch can
maximally connect to one another patch. In this sense, I guess directly
creating patchy particles might not be proper, because one patch can
connect to more than one patches. So I am wondering if I can limit the
isotropic short range attractive force just happen on the poles of the
particle. Thanks again.

​two comments:​

- the intention of ​pair style python was ​exactly to allow people to
quickly experiment with arbitrary pairwise force models.

- the kind of dipolar interactions you describe, are frequently implemented
for small polar molecules by overlaying lj/cut and coul/cut or coul/long.
the coulomb interaction will drive the orientation and the lj/cut (there
can be multiple lj sites to define the shape) makes certain, that there is
no "coulomb catastrophe" by keeping particles at a minimum distance. the
intensity of the orientational preference can be tuned by adjusting the
location of the charged points (i.e. moving them closer to the center or
further away). the effective radius of the LJ interactions will also
determine, how many oppositely charged neighbors can get how close to the
poles. of course, you can use any kind of custom potential, and this can
also be represented by just atom types with potential functions that
combine those different terms.

axel.

Thanks Axel! I will try it.

Best regards,
zjgbz

Hi Axel,

I am trying to write new pair_style by pair_style python. I am using LAMMPS from Homebrew, and update it via Homebrew last month. So I think the LAMMPS I am using is the latest stable version. But based on the LAMMPS official website, the latest stable version of tarball is March/2017 which is earlier then 19 May 2017 as you mentioned. In this sense, does it mean that the LAMMPS from the Homebrew I am using cannot realize the pair_style python you introduced, and I need to install the latest development version of tarball? Thank you very much.

Best regards,
zjgbz

Hi Axel,

I am trying to write new pair_style by pair_style python. I am using LAMMPS
from Homebrew, and update it via Homebrew last month. So I think the LAMMPS
I am using is the latest stable version. But based on the LAMMPS official
website, the latest stable version of tarball is March/2017 which is earlier
then 19 May 2017 as you mentioned. In this sense, does it mean that the
LAMMPS from the Homebrew I am using cannot realize the pair_style python you
introduced, and I need to install the latest development version of tarball?

didn't you just answer your own question already?

axel.

Hi Axel,

I see. Thank you very much.

Best regards,
zjgbz