fix ave/histo/weight

Dear lammps user,

I have a simulation box containing spce water Na and Cl, I wanto to output averaged velocities of this components as function of position in the simulation box along the z axes. I am using lammps version 5 jun 2019

For Cl and Na i have use the comput chunk/atom command in combination with fix ave/chunk.
Nevertheless for water is a bit more complicate because the histograms need to be make with the velocities of the center of mass of the molecules and the position of the center of mass. I red the lammps manual and these combination of commands should do the work

group sv type 1 2

compute svchunk sv chunk/atom molecule compress yes
compute comsv sv com/chunk svchunk
compute vcmsv sv vcm/chunk svchunk

fix 1c sv ave/histo/weight 1 10 10 {loo} {hii} ${nbin} c_comsv[3] c_vcmsv[3] file “vel_sv_com_forhist_norm_all.dat” mode vector

nevertheless fix/ave/histo/weight does not work when used like this.

I can output an histogram of number of water molecules along the z direction in the simulation box based on their com with just fix ave/histo, but when weighted by the velocity the output just doesn’t make sense

I am attaching a simple example, “in_test.run” , to see if someone can reproduce this error. I also attached the outputs I am getting

Thanks in advance

Matias

in_test.run (1.72 KB)

log.lammps (6.32 KB)

vel_his_na.dat (8.48 KB)

vel_his_cl.dat (8.6 KB)

spce_nalc.data (575 KB)

vel_sv_com_hist.dat (6.44 KB)

why not just use the position and velocities of the water oxygen?
given the geometry of water molecules and the fact that you are doing averaging, I would expect that the impact of that kind of approximation would be small relative to the overall error (e.g. of the force field as such and the statistical convergence).

Axel.

Hi Axel.

Thanks for the suggestions, yes I i will do that. Sounds like a good workaround

Does the . fix/ave/weight has some kind of bug ? … just curious

Bye
Matias

Hi Axel.

Thanks for the suggestions, yes I i will do that. Sounds like a good workaround

Does the . fix/ave/weight has some kind of bug ? … just curious

i don’t know, i haven’t had time to look at your example.

you should make sure that you have the latest (stable) version of LAMMPS. the latest bugfix to the code in fix ave/histo/weight was commit 4a55e9dd0c860e8c1f420eb274ea3fc91d6ff498 which happened on August 6 2019.

axel.