[lammps-users] Problem in simulating rigid dumbbell using rigid/nvt/small

Hi LAMMPS users,

I am attempting to simulate rigid dumbbells that interact via LJ-12-6 potential in two dimensions.

fix 1 all rigid/nve/small molecule
fix 2 all enforce2d
run 5000

fix 1 all rigid/nvt/small molecule temp 1.0 1.0 10
fix 2 all enforce2d
run 5000

I am reading the initial configuration from a data file and then time integrations are done through two fixes, namely rigid/nve/small and then rigid/nvt/small

The first NVE fix runs smoothly, but the latter NVT fix is not running properly. I tried to vary many parameters that are involved as shown in the attached infile script. Required data file, infile and an execution log file is attached for reference.

Now I have two questions in mind for my comrades to help me out with:

  1. Is there other/better/alternative way(s) to simulate dumbbells using LAMMPS?
  2. Is there any fundamental way that the rigid nve and nvt fixes differ from usual nve and nvt fixes, which is probably responsible for the nan values for the thermo in log file.

data.rigid.dumbbell.2d (36.5 KB)

in.rigid.dumbbell.2d (663 Bytes)

log.rigid.dumbbell.2d (6.08 KB)

Hi LAMMPS users,

I am attempting to simulate rigid dumbbells that interact via LJ-12-6 potential in two dimensions.

fix 1 all rigid/nve/small molecule
fix 2 all enforce2d
run 5000

fix 1 all rigid/nvt/small molecule temp 1.0 1.0 10
fix 2 all enforce2d
run 5000

[…]

Now I have two questions in mind for my comrades to help me out with:

  1. Is there other/better/alternative way(s) to simulate dumbbells using LAMMPS?

you could try for time integration to use:

fix 1 all rigid/small molecule langevin 1.0 1.0 0.1 4363426

  1. Is there any fundamental way that the rigid nve and nvt fixes differ from usual nve and nvt fixes, which is probably responsible for the nan values for the thermo in log file.

I suspect the fix rigid/nvt/small Nose-Hoover chain coupling has not been tested with 2d systems.
a Langevin thermostat as used in my suggestion above is much more robust.

axel.

As suspected, there was a bug in the code related to the nose-hoover fictitious time integration for 2d systems. The following change should fix the bug and also recover using fix rigid/nvt/small for your system.

diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp
index 105b24f83b…8b773a30ea 100644
— a/src/RIGID/fix_rigid_nh_small.cpp
+++ b/src/RIGID/fix_rigid_nh_small.cpp
@@ -1192,13 +1192,7 @@ void FixRigidNHSmall::compute_dof()
for (int k = 0; k < dimension; k++)
if (fabs(b->inertia[k]) < EPSILON) nf_r–;
}

  • } else if (dimension == 2) {
  • nf_r = nlocal_body;
  • for (int ibody = 0; ibody < nlocal_body; ibody++) {
  • Body *b = &body[ibody];
  • if (fabs(b->inertia[2]) < EPSILON) nf_r–;
  • }
  • }
  • } else if (dimension == 2) nf_r = nlocal_body;

double nf[2], nfall[2];
nf[0] = nf_t;

Thank you so much for the suggestions and edits.

I have now two things to report:

  • The langevin fix is working like a charm.
  • the suggested bug fix still not solved the issue with rigid/nvt/small fix. I edited the fix_rigid_nh_small.cpp file accordingly and remade the lmp_serial but still the NaN values are there as mentioned earlier.
    Looking at the second point above, can anyone please suggest any idea that I should check out so that I may use the rigid/nvt/small fix?

Thank you so much for the suggestions and edits.

I have now two things to report:

  • The langevin fix is working like a charm.
  • the suggested bug fix still not solved the issue with rigid/nvt/small fix. I edited the fix_rigid_nh_small.cpp file accordingly and remade the lmp_serial but still the NaN values are there as mentioned earlier.

which copy of the file did you change. you may have forgotten to do “make package-update” to copy the modified version from src/RIGID to src

Looking at the second point above, can anyone please suggest any idea that I should check out so that I may use the rigid/nvt/small fix?

Unless there is another bug that I have not noticed, the modified source code is working as it should and the issue that was causing the NaNs has been eliminated completely. It is not possible to get this after the modification. The only way to get NaNs would be due to incorrect choice of pdamp, but yours was acceptable.

Axel.

Thanks for the clarification.

Yes you were right. I forgot to do the package-update, how silly of me.

Now everything is fine. All rigid nve/nvt/npt (small) are running fine.

Thanks and best regards