please help me!propelled particles

Dear all,
Hello,I am a student from China,I would like to ask you some questions.
How can I add force to particles to make them become self-propelled particles.Followings are more specific descriptions:
1.I want to add force to every particle,the force is a constant,but it’s direction is random,with a small angle to the particle velocity.
2.I found that whether addforce or setforce can’t satisfy the condition.Because the force change every step!The addforce would add more and more force if I create a loop,while the setforce would clear my potential energy.
3.I know how to extract a atom variable by python but I don’t know how to turn a python variable into a atom variable in lammps.
4.I would appreciate it if you tell me how to achieve my condition.
Thanks,
yuantonghui

Dear all,
Hello,I am a student from China,I would like to ask you some questions.
How can I add force to particles to make them become self-propelled particles.Followings are more specific descriptions:
1.I want to add force to every particle,the force is a constant,but it’s direction is random,with a small angle to the particle velocity.

not easily possible with the existing functionality in LAMMPS. there is a pending pull request on github, that is trying to do something similar.

2.I found that whether addforce or setforce can’t satisfy the condition.Because the force change every step!The addforce would add more and more force if I create a loop,while the setforce would clear my potential energy.

that is not a correct interpretation. if you want to add a force in every step, then you do exactly what addforce does. in combination with an atom style variable, fix addforce would be a correct way to add the kind of force that you want. the problem is, that the variable command in LAMMPS does not have the features required to compute the necessary values for a suitable atom style variable. hence the need to do a fix (or a compute that only computes the force per/atom and then is used in an atom style variable).

3.I know how to extract a atom variable by python but I don’t know how to turn a python variable into a atom variable in lammps.

that is not supported. python style variables are like equal style variables. they cannot function like atom style variables.

4.I would appreciate it if you tell me how to achieve my condition.

as mentioned above, you would have to program (in c++) a custom compute (to compute the per atom force components) or a custom fix (to compute and apply the desired per-atom force components). the fix would be very similar to fix addforce.

axel.

Hi,

Skipping most content, see below.

> Hello,I am a student from China,I would like to ask you some
> questions.
> How can I add force to particles to make them become self-propelled
> particles.Followings are more specific descriptions:

There are several models for self-propelled particles. Please provide a
reference publication on what model you would like to simulate.

The pull request currently open aims at providing two models: one where the
propulsion direction follows a random walk for the orientation quaternion (I am
skipping the details here, it is actually an inertial noisy rotator here) and
the force is aligned with the quaternion ; and one where the propulsive force is
aligned with the total velocity of the particle.

Without a mathematical description of what you wish to achieve, there is not
enough information for us to help.

Best regards,

Pierre