gravity vs addforce vs setforce

Submitted by Kashminder on Tue, 11/16/2021 - 22:45

My issue is that I have ran three different codes keeping everything same but only these 3 commands different in each code

fix gravi all gravity 9.81 vector 0. 0.0 -1.0.
fix p all addforce 0 0 -9.81
fix p all setforce 0 0 -9.81

So, the code with gravity force command acts like the particle comes down very slowly but in their 2 commands i.e. (add-force and setforce) the particles leaves the box quiet early, My question is that in all three cases the particles should act similarly as the force is same in three cases? Is the issue seems to be in fix?

Daniel Queteschiner | Wed, 11/17/2021 - 11:03

in fix gravity you specify the acceleration (+ direction vector) to be multiplied by the particle mass and then added to any other forces (e.g. contact forces)
in fix addforce you specify the force vector to be added to any other forces (e.g. contact forces)
in fix setforce you specify the force vector to replace all other forces (e.g. contact forces)

Kashminder | Tue, 12/14/2021 - 22:34

Thank you for your reply, do you have an idea how to create a data file for superquadric particles