fix rigid/nvt unable to control torque

Hello LAMMPS users,
I’ve been having trouble controlling the torque with the rigid/nvt fix. The command line I put in is:

fix 2 top_tip rigid/nvt single temp 100 100 0.2 force * on on on torque * off off off

Obviously what I want is pure translational movement for the rigid body. But somehow the force arguments are not controlling the velocity supposedly: after several thousands time steps, the velocities of rigid-body atoms are not identical anymore. As a result the rigid body got flipped over even though the torque dumped from the fix still shows 0.

I’ve already double checked that there isn’t any repeated integration. Strange thing is: there is no such “flipping” problem if I switch this command to fix rigid/nve. Although I would really like to see what it turns out if I thermostat the rigid body.

Any ideas/suggestions on how should I investigate this issue? Thanks so much!

Hello LAMMPS users,
I've been having trouble controlling the torque with the rigid/nvt fix. The
command line I put in is:
fix 2 top_tip rigid/nvt single temp 100 100 0.2 force * on on on torque
* off off off

Obviously what I want is pure translational movement for the rigid body. But
somehow the force arguments are not controlling the velocity supposedly:
after several thousands time steps, the velocities of rigid-body atoms are
not identical anymore. As a result the rigid body got flipped over even
though the torque dumped from the fix still shows 0.
I've already double checked that there isn't any repeated
integration. Strange thing is: there is no such "flipping" problem if I
switch this command to fix rigid/nve. Although I would really like to see
what it turns out if I thermostat the rigid body.
Any ideas/suggestions on how should I investigate this issue? Thanks so
much!

have you considered that your problem may be in the parts
of the input that you don't show us?

axel.

I believe that fix rigid/nvt will respect the torque off off off setting
and not rotate a rigid body, even while thermostatting. You can
check with the author of that fix (listed at the top of the cpp file).

However, you do have to insure that each body has zero initiial
angular momentum, else it will likely continue to rotate on its
own. Just like if you set the force to 0, a particle will still
move if its initial v != 0.

Steve

Hi Steve,
I specifically set the init. velocity of each atom in the rigid body as zero. And the dumped values from the fix also showed zero torque throughout the simulation.
Thanks for the advice. I’ll contact the author later.

I'm posting an example of fix rigid which seems to do what you want
(see attached file).

I realize that it is a strange example:
In my case, the object being immobilized is a large slab of water
which spans the width of the simulation box in the x and y directions.
However it is still quite capable of small modest rotations (if you
get rid of "torque * off off off" it will rotate slightly).

I just posted a similar version of this this file in response to a
question about fix rigid and NPT, so I thought I'd post a response to
your question too. I hope this is relevant to your problem.

Cheers
Andrew

fixrigid_test_nvt.tar.gz (182 KB)

Hi,

let me have a closer look at the quaternion update in fix rigid/nvt. There might be something not working properly when torques are turned off.

-Trung

Quoting Andrew Jewett <[email protected]>:

Yuchong: Can you send me an example of a small system that produces the problem (similar to Andrew's)?

Andrew:

looking at your simulation, I see that you were using fix rigid single for the immobile group, how about not using any time integrator for that immobile group (e.g. by commenting out fix rigid); the potential energy will be the same and you could save some redundant computing. In this case, if you'd like to print out the temperature of the mobile group, then define a temperature compute for it:

compute tempMobile mobile temp

and print out via thermo:

thermo_style custom step c_tempMobile

If, for some reasons, you must use fix rigid, then forces should also be turned off, just like torques: force * off off off

Regards,
-Trung

Quoting Andrew Jewett <[email protected]>:

Yuchong: Can you send me an example of a small system that produces the
problem (similar to Andrew's)?

Andrew:

looking at your simulation, I see that you were using fix rigid single for
the immobile group, how about not using any time integrator for that
immobile group (e.g. by commenting out fix rigid); the potential energy will
be the same and you could save some redundant computing.

Good question. Glad to hear from you.

I noticed that "fix_rigid.cpp" modifies the virial (although I found
part of this code difficult to understand). So I am using fix "rigid"
because I also want to be able to run these kinds of simulations under
either NVT or NPT conditions with minimal changes to the input script.
(More on NPT later...)

I am hoping that this command:
  "neigh_modify exclude group immobile immobile"
will have avoided the redundant computation. Please let me know if I'm wrong.

In this case, if you'd like to print out the temperature of the
mobile group, then define a temperature compute for it:
compute tempMobile mobile temp
thermo_style custom step c_tempMobile

Thanks. Although I am still using fix "rigid" and "neigh_modify
exclude", I tried printing out two different versions of the
temperature using:

   "thermo_style custom step c_tempMobile temp"

There is a slight difference between the two temperatures.
"tempMobile" is allways about half a degree (0.1% or 0.2%) warmer than
"temp", however both temperatures appear to be fluctuating around the
target temperature (300 degrees +/- 7 degrees). I don't know if I
should worry about the discrepancy between these temperatures.
Overall I am relieved.

If, for some reasons, you must use fix rigid, then forces should also be
turned off, just like torques: force * off off off

Glad you brought this up...
For what it's worth, the rigid "immobile" group appears to be doing
what I asked it to do (translate but not rotate).
Please clarify: I've noticed you provided the user an option in
LAMMPS to turn off rotation and translation independently. Is there
any scenario where the user would turn off the torques, but leave the
forces on?

Thank you for the feedback by the way!
I appreciate it and I have more questions for you regarding NPT which
will be posted very soon.

Andrew