[lammps-users] local property

dear lammps-users,

Is there any way in a gas, for example, to move particles so that the local density around each particle and within a specific cutoff be minimized? The type of system does not matter. It can be liquid, gas, or other things. I need to design a system with different local parameters. For example, make the particles interact so that the local density around each particle is minimized or the local radial distribution function and, in general, any local property. Do you think I can design this system with lammps or liggghts, or I have to write the code myself?

best regards,

if you want to “encourage” particles to stay away from some other particles, you can define a repulsive only potential.
pair style soft is an example for that. you can tweak the degree of repulsion through the pair_coeff settings.
axel.

Thank you for your response, No I just need to encourage the particles to move in a direction that minimize a local physical property around them. Clearly it is not an equilibrium simulation.

Thank you for your response, No I just need to encourage the particles to move in a direction that minimize a local physical property around them. Clearly it is not an equilibrium simulation.

in other words you want to apply a bias, but what functional form should that bias have?
and how would you compute the “local property around them”? and then translate that into how you have to adapt the bias potential?

there is nothing like that easily doable in a classical MD code unless you have specific answers to that, since you need forces and for those you need the potential and if you want to have this in some adaptive form, you would need to describe how to couple this. even if you would have answers to this, you would need to do C++ programming to implement that.

if you don’t have them, you would need to use some other approach that does not need forces. e.g. do a Monte Carlo approach where you then have to find a suitable acceptance criterion (which usually requires some energy equivalent, but not a force). or you could look into using some genetic/evolutionary algorithm approach, but even then you would have to have a quantifiable single parameter that you can use to define the fitness of a new generation after randomly moving particles.

axel.

I appreciate your suggestion. Thank you so much.

Sorry I have another question. So I can write some of the code myself in c ++ and use the rest of the code in lammps source. How can I access the C code for a specific command. For example for atom-style.

I appreciate your suggestion. Thank you so much.

Please see the LAMMPS manual for details about modifying and extending it. https://docs.lammps.org/Modify.html

It is rarely required to program a new atom style. See pair style eam for an example that computes a local property (a density), communicates it across parallel subdomain and then computes properties and ultimately forces based on that. It also manages multiple per-atom arrays that hold data that is per-atom, but recomputed in every step.

A change to an atom style is only required if you have data that needs to be read as input parameters. But even then, this can often be “emulated” to by using fix property/atom

axel.