Just adding this to the thread for the future reference of others having a
similar problem. No need to respond.
One reason I had suspected that an error was present is because in the two
other MD codes I'm working with (Tinker and RASPA2), no COM drift occurs for
a system very similar to the one I was working with here. This led me to
suspect that something wrong was going on in the one simulation package in
which COM drift was occurring (LAMMPS).
I looked into the source code of Tinker and RASPA2, and I see that actually
those other packages would exhibit COM drift, but their source codes
automatically hide it in ways that LAMMPS allows the user to decide for
himself. In Tinker, the linear momentum of the COM is zeroed every timestep
(similar to LAMMPS's 'fix 1 all momentum 1 linear 1 1 1') and in RASPA2 the
coordinates are moved so that the COM of the framework maintains its
position (similar to LAMMPS' 'fix 1 MOF recenter INIT INIT INIT shift all).
In fact, and as Aidan pointed out, the linear momentum of the COM (P) should
not be conserved in the canonical ensemble; instead P*e^{\eta} is conserved
(see doi.org/10.1063/1.1378321). If the linear momentum is set to 0
initially, it should remain at 0 (because 0*e^{\eta}=P*e^{\eta} only when P
is 0), but if minor numerical errors bring it away from 0, it will oscillate
along with the thermostat's \eta parameter. I looked at the data from some
longer runs, and Aidan is correct that it appears to be a random walk.
I believe that when I ran the simulations with just the MOF or just the
benzene, these small numerical errors that brought the linear momentum away
from 0 didn't occur because the 'fix' was able to control for them, but when
two 'fixes' were in place the small errors crept in; in fact, when I ran a
simulation with just the MOF present (so just 1 'fix') but with an initial
non-zero linear momentum, I saw the linear momentum oscillating rather than
being kept constant. This is further evidence that the linear momentum is
not conserved with the Nose-Hoover thermostat but should in fact oscillate,
and that there's no problem with LAMMPS.
Given this, I think that it's completely proper way to put 'fix 1 all
momentum 1 linear 1 1 1' at the beginning of the run, since it will just be
making adjustments to numerical error, and the linear momentum should stay
at 0 if it starts out at 0. This makes inconsequential the decision of
whether to modify the calculated temperature to remove the bias of the COM
motion, since it will be negligibly small.
you are overlooking one detail here: the command 'fix 1 all momentum 1
linear 1 1 1' will remove energy systematically.
since a finite size system will have finite size oscillation of the
COM momentum there is an optimum period for removing the momentum with
minimal impact. but in any case, you'll have a systematic energy
removal unless you also use the "rescale". many years back, i've been
involved in a project about pseudorotations in CH5+ with
car-parrinello MD and adding removed energy back had a noticeable
effect. it may be less in your case, however, if you prefer to use fix
momentum, i would advise against calling it at every step and for
using the rescale flag.
still, since part of your system is a stationary framework, i am still
very much in favor of simply adding a weak tether to that framework
group with fix spring for two reasons: a) you are less interested in
the framework dynamics and since it would macroscopically be part of a
large stationary object, that tether is actually a quite physically
meaningful representation of the environment for your framework. and
b) the diffusing liquid should have its momentum removed automatically
through the tether of the framework, without having to modify its
dynamics directly. as i assume, that this is the dynamics you care
about, you should have the minimum taint this way, in my personal
opinion.
axel.