“In my simulation of sintering between two particles, gas is simultaneously being desorbed from the particles. When I use conventional static groups for the left and right particles and apply fix recenter, the calculated center-of-mass becomes incorrect due to the gas detachment. On the other hand, using dynamic groups (which update automatically) prevents me from using fix recenter. What strategies or workarounds can I use to accurately recenter the system under these conditions?”
Why do you need to use fix recenter?
If fix recenter is not used, the two particles will shift, but I need to calculate the relevant data of the sintering neck between them, so I hope they do not shift.
Why can’t you use fix recenter
? I ported it to KOKKOS just before Xmas so I still remember how the source code works.
I double checked it has dynamic_group_allow = 1
so it should work. I can look at debugging it later this week if you’re having a problem with it.
Please provide a minimal example that fits on 4 mpi ranks and runs in <1min.
Fix recenter is not a solution to this issue because will not remove that shift but only hide it, i.e. the velocities are not affected. That will lead to computing a temperature that includes the kinetic energy of the drift and thus will lead to unphysical cooling down of your particles.
If you need you particles in place, you can do the following:
- use the “zero linear” option for the velocity command when assigning initial velocities, and then use “velocity scale” with “zero linear” after equilbration to remove any drift that has accumulated. In many situations this is sufficient and a drift only builds during equilbration
- if there is a persistent drift, you can use fix momentum (either for all atoms or once for each particle) to periodically remove the residual accumulating drift. this should work for all systems, where there is no external influence that will change the particles’ momentum.
- if fix momentum is not sufficient, then you can replace it with fix spring to tether each particle to its center of mass position after equilibration.
Note that you can use fix recenter ... shift all
to translate all particles in your simulation, not just the recentered group, to maintain your simulation’s physical validity.