Custom potentials and multitype particles

Hi! First time user of LAMMPS. I have set of custom pair-wise dipole-dipole potential and capillary attraction potential. I want to know what are the different ways to code this up/use these in a MD simulation? I also want to be able to assign particles in my system with the two above different potentials.

So far from the documentation I see OpenKIM · Software and Projects Using KIM · Interatomic Potentials and Force Fields could be a choice? If I can somehow get my potentials onto that platform?
The other way would be to go in and add a module or edit source to include my potentials?

Please let me know if there is any documentation or if you all have any suggestions. Thank you!

You are trying to do too much to quickly. That is a recipe for disaster, frustration, and wasted time all around.

Before even thinking about programming and modifying LAMMPS, you should be sufficiently familiar with using LAMMPS. A lot of the information you are looking for is in the second part of the LAMMPS manual. But let me reiterate, many of the things talked about the the programmer’s guide assume that you are familiar with using LAMMPS, so it would be a mistake to start with your custom potentials right away. Going through OpenKIM just adds another level of indirection and complication. The benefit of having an implementation in there is that your implementation may be used by different supported MD codes, not just LAMMPS.

This sounds like an advanced programming project (compared to a simple pair-wise additive potential like LJ or Morse) and that will cause even more problems and confusion, if you are not familiar with the workings of LAMMPS.

I understand that. I don’t intend to start implementing the potentials right away. I was planning to familiarize myself with LAMMPS first and then attempt that. But it’s an investment so I wanted to know if it’s even possible and if what I want to do fits in overall LAMMPS capabilities. Thank you for the quick reply!

That is impossible to say from the outset without knowing details about the potentials and their requirements.

Sorry, I don’t know if this helps, but the potentials I am referring to are eq:1 and 2 from the following paper, [2202.02288] Tuning the rheology and microstructure of particle-laden fluid interfaces with Janus particles. I just want to know if it’s even remotely possible with the LAMMPS framework before I jump in.

There is no need of any interface or liquids. Just particles and potentials between them. At least to start off with.

Just two kinds of particles, say p1 and p2 types. Between p1 type particles it’s a dipole-dipole repulsion interaction given by Eq:1 and between p2&p2 and p2&p1 it’s a capillary attraction.

Apart from that, we would want to shear the box which I think is possible with LAMMPS already. And I also see different BC are possible.

Please let me know if any more information is needed. Thank you again!

While not straightforward, since you have to include point dipoles and use extended particles, which requires special treatment for force computation, atom style, and time integration, it should technically be possible to implement a new potential for it. It is generally simpler to implement just one pair style with both types of interactions and then control how much the different terms apply with their prefactors. There is the DIPOLE package with implementation for point dipoles with Lennard-Jones (e.g. for Stockmayer liquids, Stockmayer potential - Wikipedia).

Otherwise multiple types of interactions via multiple pair styles can be implemented via pair style hybrid or hybrid/overlay. But almost always is only the second best option.

Please note that the paper you are referring to is describing an experimental study and the potentials you are looking at are just some rationalization of the authors of the result. I am not convinced that this is a good basis for starting simulations. There should be plenty more publications on similar models in the published literature. I recall recurring questions in the past about how to implement Janus particles in LAMMPS (often by combining multiple point particles into an extended particle via fix rigid).

Thank you for your reply and suggestions. Glad to know it is possible in principle!

To your last point, we do understand the potentials were only a rationalization, especially the capillary attraction, the dipole-dipole interaction between polystyrene particles is well studied and modeled. One of the key things we want to answer is how good is this rationalization of capillary attraction and the model proposed here to start off with. Later to build off that as needed be and test it out in further experiments.

I wouldn’t trust the potential in that paper either. After all, if you model the Janus particles as dipoles, then the interparticle interaction is a dipole-dipole interaction, which goes as inverse sixth power of r and not inverse cubed. (Which is related to why the LJ potential has that same power of r as its attractive potential.)

For fast prototyping I especially recommend you look at the Python and Lepton pair styles, which will allow you to state your desired pair interactions analytically, and then use pair_write to tabulate the pair styles for running simulations. You can also just write the pair tables yourself (the format is very simple). Either way you can then run the simulation using pair_style table. This has the additional advantage of then being easy to disseminate – it is much easier for other researchers to use and cite your work if you use existing tools in LAMMPS.

1 Like

Thank you for the suggestions on how one could go about implementing it.

To your first point, please note that the dipoles here on the polystyrene or Janus particles are not just induced dipoles in the traditional sense. The oil-water interface actually causes a dispersion of charge and makes long-range dipole-dipole interactions possible which scale as r^-3 instead of just the usual expected induced dipole London force interaction which scales as r^-6. So the potential would scale as r^-3 as though they are ‘static dipoles’. A nice set of papers about this would be, Phys. Rev. Lett. 105, 048303 (2010) - Finite Ion-Size Effects Dominate the Interaction between Charged Colloidal Particles at an Oil-Water Interface and Heterogeneity of the electrostatic repulsion between colloids at the oil–water interface - Soft Matter (RSC Publishing). Lot more studies seem to say the same, when polystyrene particles are at an oil-water or similar interface, they have long range dipole-dipole repulsion that scale as r^-3.

Maybe you are familiar with all of the above already. If so, sorry about misunderstanding what you may have meant. But coming back to Janus particles in the current context, it is simply a polystyrene particle coated with platinum. The coating suppresses the repulsion/changes the effective charge and thus the repulsion between a polystyrene particle and Janus particle is still long-range (or at least expected/observed so in experiments) supposedly 10^3 times lower the usual polystyrene and polystyrene repulsion.

But if you ask me about Janus particle-Janus particle interaction, I wouldn’t know for sure. Whether it would still be a long range dipole-dipole with very suppressed interaction.

1 Like