Center of mass

Dear LAMMPS users
I am simulating a system of hydrogen molecules in water. I have periodic boundary conditions.
Ensembles: NVE, NVT, NPT (equilibration)— NVT (production)
when I calculated the com of atoms (hydrogen and water), I realized that com changes during each ensemble. I have following questions:
1- how much change in com is natural?
2- what is the physical meaning of increase or decrease in com?
3- If the com changes during equilibration and production, does MSD data valid?

If you don’t share your input deck, it’s impossible to say.
I suspect you are trying to compute the MSD using the COM of individual molecules, and that’s fine. But depending on which commands you use, you may be computing the COM of your entire sample and get no meaningful information.

The total center of mass of the entire system should only fluctuate, but not exhibit a significant drift.
However, depending on the details of the model and how aggressive simulation settings are used, that may not be possible. In that case one has to use something like the fix momentum command to reset any drift. However, first preference is always to reduce any drift by using more conservative simulation settings.

The center of mass momentum will always increase and it is a side effect from using floating point match with finite precision and rounding. It is thus unphysical behavior and it can specifically cause bad side effects when also using a thermostat, since the thermostat will compute the wrong temperature and your system may be colder than expected. In the most extreme case, you system will freeze and move at very high speed as a frozen object (the so-called “flying icecube syndrome”).

You can reset the any accumulated center of mass momentum in between the different stages of your simulation. Typically, it can build rather easily during the initial equilibration, but should be negligible afterwards. If not, you should first review your simulation settings and, for example, use a smaller timestep or a larger cutoff or a better Kspace convergence.

Accumulation of a center of mass momentum is more likely during fix npt than during fix nvt.

The MSD data is invalid for too large a drift but also when fix momentum is (or needs to be) used frequently (i.e. more often than every 1000 or 10000 MD steps). In both cases, your dynamics is significantly changed and thus your results may be tainted.