How to calculate the layering COM-velocity?

Hello all. I’m going to layer the simulation box in the z direction and calculate the center of mass velocity of the water molecules in each layer. I have used commands compute chunk/atom and fix ave/chunk, however, the calculated velocity wasn’t the COM-velocity. I wonder if LAMMPS has other command to solve this problem?

Use atom-style variables to track the momenta:

variable px atom m*vx

and you can average them in your fix ave/chunk calculation. Instantaneously, the average momentum of a chunk divided by the average mass is the COM velocity.

Note that particles are presumably constantly changing chunks in your simulation and so the notion of a “chunk COM” only makes sense instantaneously, not as a continuous quantity over time.

1 Like

There is a compute vcm/chunk which computes the center of mass velocity of each chunk.

Using fix ave/chunk for per-chunk properties makes no sense. It is meant to average per-atom properties over chunks.

What you want to use for averaging your per-chunk properties would be fix ave/time instead.

1 Like

thanks for your advice.

Thanks for your quick reply, I have found the suitable command.