Calcualtion of velocity profile in lammps

Dear Lammps users,

I know that the velocity profile can be calculated using the following command, as shown in the document:

“fix 1 flow ave/chunk 100 10 1000 molchunk vx vz norm sample file vel.profile”.

However, when I use “norm all” instead of “norm sample” for plane poiseuille flow simulation, I found that the maximum velocity is one to two orders greater than the value computed using “norm sample”. Also, with the velocity profile computed using “norm sample”, the viscosity of the flow particles calculated from the Hagen-Poiseuille equation (with the slip velocity) is much greater than the bulk viscosity (calculated from MD). On the other hand, the viscosity calculated from the velocity profile using “norm all” is within the same order of the bulk viscosity. I wonder why this is the case, and I am not sure which velocity profile I should use now. Could you please share your ideas or experiences on this?

Many thanks!


If your system is in equilibrium over the time window (1000 steps) you are doing
the time averaging and there are sufficient particle counts per chunk, I don’t think
the choice of sample vs all should be very different. When you say “one to two
orders” greater do you mean up to 2x larger, or do you mean orders of magnitude?
If you vary the “10” in your command you can also see if that changes things.
In the limit of 10 --> 1, sample vs all should be identical.


Thank you Steve for your reply.

I found the issue. You are right that the sample and all should be identical. It was just that the average was done differently. The ‘norm all’ considers the average over atom counts, i.e. it gives the velocity per particle in each chunk for time average, while the ‘norm sample’ gives the total velocity for all the particles counted in a chunk averaged over time. If I use the velocity profile in ‘norm all’ multiplies by the atom count for each chunk, it gives almost the same results as ‘norm sample’. In my case, the atom count is less than one (~0.1-0.01 for gas particles), so the maximum velocity from ‘norm all’ is one to two orders of magnitude greater than the value from ‘norm sample’. Hence, I think that the ‘norm sample’ does not do the average over atom counts for the sample average.