Hello sir,
i want interaction between active brownian particles and substrate particles in 2 dimension… but I did not found this potential in unbond style
harmonic potential =1/2 k(r-r0)^2
but I found it in bond style…
plz help me to consider this potential…
thank you
As you have found, there is no pair style implemented for that.
You would either write a custom pair style (e.g. based on lj/cut) to realize this ( 3. Modifying & extending LAMMPS — LAMMPS documentation )
implement this via pair style python with a python class ( pair_style python command — LAMMPS documentation )
or use a tabulated potential ( pair_style table command — LAMMPS documentation ).
The tabulation can also created from the Python variant using the pair_write command — LAMMPS documentation
Please carefully review the linked documentation.
Or you could create a feature request issue describing the specifics at: Issues · lammps/lammps · GitHub
and hope that somebody volunteers to implement the potential you are looking for.
Thank you so much for your kind suggestions…
Can’t this interaction be obtained by setting appropriate values for the parameters of the harmonic types from one of the granular pair styles? Is this new style primarily for ease of use, because this simple interaction is used fairly often? Or is there more to it that can’t be achieved via the granular styles?
Granular pair style require a per-atom diameter and have a per-atom mass and many other quirks. Most don’t support atom types.
As of the 17 February version of LAMMPS (released today, obviously), there is a new pair style that implements exactly what was asked for: pair_style harmonic/cut command — LAMMPS documentation
It is likely much more efficient than (ab-)using a granular pair style.
As mentioned in a previous post in this thread the simplest way to implement the requested interaction with an older LAMMPS version is to use the pair_style table command — LAMMPS documentation
Hello Sir,
I want to know about the pair style that was added in the latest version (17-02-2022).
Is still giving this error… Illegal pair_style command
plz, consider this problem…
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
units lj
dimension 2
boundary p p p
atom_style sphere
lattice sq 1.0
Lattice spacing in x,y,z = 1 1 1
region mybox block 0 36 0 36 0 0.5
create_box 2 mybox
Created orthogonal box = (0 0 0) to (36 36 0.5)
1 by 1 by 1 MPI processor grid
region box block 0 36 0 36 0 0.5 units box
create_atoms 1 region box
Created 1296 atoms
using lattice units in orthogonal box = (0 0 0) to (36 36 0.5)
create_atoms CPU = 0.005 seconds
group mobile type 1
1296 atoms in group mobile
region plane block 0 36 0 36 0 0.5 units box
lattice sq 0.2
Lattice spacing in x,y,z = 2.236068 2.236068 2.236068
create_atoms 2 region plane
Created 289 atoms
using lattice units in orthogonal box = (0 0 0) to (36 36 0.5)
create_atoms CPU = 0.001 seconds
group substrate type 2
289 atoms in group substrate
pair_style harmonic/cut 2.5
ERROR: Illegal pair_style command (src/EXTRA-PAIR/pair_harmonic_cut.cpp:149)
Last command: pair_style harmonic/cut 2.5
The error message is correct. The harmonic/cut pair style takes no arguments and thus your input is incorrect. The documentation says so, too, but unfortunately it’s example is incorrect as well.
Thank you… you are saying right… The example is wrong…
It is 3 years old. Anyway, the subject interests me. Perhaps I will get a comment?
This is a repulsive potential. I have been looking for an attractive one. Finally I made it with table style. My potential acts like a spring between atoms.
Creating my potential is described in this: Harmonic interlayer potential with no higher-order contributions. - Mendeley Data
and there: [2411.07633] Stretched-exponential stress dynamics in chain of springs and masses model of crystals: analytical results and MD simulations
Why I find my way of doing this better? The reason is that I want to have potential with power different than 2 as well.
But there is another reason, too. I am interested in harmonic potential between layers in crystal (FCC), when layers move in a coherent way. In that case the potential between them is not harmonic anymore, it contains higher order corrections.
Please confirm that there is still no other way to do this?
You can now try out different analytical forms of potentials with pair styles in the LEPTON package. Of course, lepton being interpreted, makes it slow, so using pair_write to create a table for pair style table, is still the way to go (unless there are very few pairs of atoms affected).
For inter-layer interactions, you may check out the potentials in the INTERLAYER package.
So how do you make your potential energy and force continuous at the cutoff?
So why not define bonds and use bond style harmonic?
Thank you, Alex,
I will have a look to LEPTON and INTERLAYER packages and analyze what is there. For now, I am grateful for these suggestions.
So how do you make your potential energy and force continuous at the cutoff?
I do not. I care that conditions are that atoms do not go outside of cutoff. My potential is good for relatively low temperatures (not more than 100-500 K) and not too large stress (a few GPa) (depending on some other parameters)
So why not define bonds and use bond style harmonic?
Hm, I will need to study bonds…
It appears that my table style (as mentioned in the message of Feb. 3) is about 2 times faster than lepton. However, my tests were not very extensive. The speed of lepton depends strongly on the complexity of equations, I guess.
I have however another problem. It is loosely related to the main subject here. It is very important to me. Frustrating. I have no ideas anymore how to understand and solve it.
Namely, I checked both on my table style potentials and by using lepton potential that the problem is identical in both cases, hence it is not a problem of my table style, as I thought initially.
A tar file with lammps input script, resulting lammps logs, a sample, and a png drawing of results is here: http://nanophysics.pl/displace.tar
The lammps script computes the change of potential energy when one group of atoms is moved relative to another group. This is a typical setup I am using for testing of potential energy between atoms (layers).
The outcome of computation is fine when the relative displacement is larger than around 0.001 A. However, a very strange effect results below that value. It looks like that the potential curve becomes parabolic, regardless of the form of the function (in my table style or in lepton). The attached png shows results in log-log scale and you will see there change of slope when x (step) becomes larger than 1000.
The change of slope (power exponent of potential) is observed when psp boundary is used. It does not happen when ppp is used. I need however to use psp in my simulations.
It might seem that 0.001 A is a very small value and I do not need to care for that. This is not really so. A displacement of that value It may cause stress as large as let say 100 MPa in some situations.
Why there is a difference between ppp and psp results. Or perhaps I am doing something wrong? I tested already a lot different scenarios and am left clueless.
boundary p p p
has periodic interactions along the y-axis while boundary p s p
does not. Using boundary p f p
should give more concordant results to the latter.
I need p s p working, not p f p.
I however found a solution, though do not understand it.
In the scripts I used I had a something like this:
boundary p p p
read_data 4atoms.lmp
change_box all boundary p s p remap units box
After changing that to this:
boundary p s p
read_data 4atoms.lmp
things work fine.