Recently, I test the fix rigid and fix rigid/nve for temperature control using the Langevin thermostatting.
The command is shown in the following.
fix 11 all rigid molecule force * on on off torque * off off on langevin 1.2 1.2 1.0 428984
or
fix 11 all rigid/nve molecule force * on on off torque * off off on langevin 1.2 1.2 1.0 428984
I used the command of " thermo_style custom step f_11 " to monitor the temperature in my system with the same initial conformation of atoms.
However, I found there exists big different output of f_11, which I believe is temperature. It is about 1.2 for fix rigid command, while it is about 1580 for fix rigid/nve.
Based on the doc, they should be the same physical quantity (Temperature). I am confused by the output results.
【 the doc of fix rigid command said "The rigid and rigid/small and rigid/nve fixes compute a global scalar which can be accessed by various output commands. The scalar value calculated by these fixes is “intensive”. The scalar is the current temperature of the collection of rigid bodies. … Degrees of freedom constrained by the force and torque keywords are removed from this calculation, but only for the rigid and rigid/nve fixes. "】
The test files (in and data) were attached, please find it.
It seems that the deviation between two temperature increase with the rigid body number in the data file, you can remove some molecules in the data file to check this.
It is possible that the temperature given by fix rigid/nve does not divide by something (body number or atom number?).
The following is my test, my test was confined in 2D , you could change to 3D.
The test files (in and data) were attached, please find it.
It seems that the deviation between two temperature increase with the rigid
body number in the data file, you can remove some molecules in the data file
to check this.
It is possible that the temperature given by fix rigid/nve does not divide
by something (body number or atom number?).
no. the situation is caused by the fact that your rigid objects are
completely flat and the temperature compute in the rigid/nve code path
doesn't account for that.
the attached patch (to be applied to the latest git/svn version)
should correct this (it does for me).
been thinking about this a bit more and it looks like we can remove
some code duplication by doing this change differently.
please check out the attached alternate patch. This defers the
calculation of the kinetic energy entirely to the base class rather
than adjusting the code.
I used the fix rigid command with Langevin thermostatting to control the dynamics of rigid body and used the fix momentum to remove the COM and angular each step.
The command is like:
fix 11 all rigid molecule langevin 1.5 1.5 10 18151444
fix 12 all momentum 1 linear 1 1 1 angular
dump 1 all custom 1000 test.lammpstrj id type x y mux muy
However, I found the existence of COM translation in the system (a short movie is attached as .gif).
Is there something wrong? The dump command was give above, I wonder the dump of x y of each atom was aritical shifted in the rigid body simulation due to the image flag problem?
By the way, I also test the fix rigid/nve, it seems a bit improved.
I used the fix rigid command with Langevin thermostatting to control the
dynamics of rigid body and used the fix momentum to remove the COM and
angular each step.
The command is like:
fix 11 all rigid molecule langevin 1.5 1.5 10 18151444
fix 12 all momentum 1 linear 1 1 1 angular
it is a *very* bad idea to call fix momentum in every step, as it
messes up the velocity verlet time integration.
momentum removal should only be used infrequently (say every 1000
steps) and momentum should only build very slowly (if at all).
otherwise, the first thing to check is the length of the time step or
other system manipulations or inhomogeneities.