[lammps-users] fix ave/spatial

Hi Lammps Users,

I am simulating a poiseuille type flow. I want to calculate the average value of Vx or Vy across the channel cross section by binning the system in XY-direction. To my knowledge, fix ave/spatial can only bin the system in 1 direction. I want bin them in X & Y directions simultaneously. Is there a way that this can be done using LAMMPS?

I mean something like this

**fix 1 flow ave/spatial 10 1000000 1000000 x lower 0.5 y lower 0.5 vx norm all file vel.profile**

With possible output something like this

X                 Y          Vx
0.0             0.0           v1
0.0             0.5           v2
0.0             1.0           v3
  :                 :              :
  :                 :              :

  :                 :              :
0.5             0.0            vn 
0.5             0.5            vn+1
  :                 :              :
  :                 :              :
  :                 :              :
  :                 :              :

  :                 :              :
  :                 :              :
xmax        ymax          v 

Presently, I am outputting the atom X, Y and Vx values at each time step and calculating the average quantities using a small program. But the files are very big at times when I want to take more averages.

Any suggestions would be of great help.



Looks to me like you’re stuck either writing your own fix or post-processing to get the information you want. I’d recommend the latter. But if you do write your own fix, you could certainly use fix ave/spatial as your starting point.


As Paul says, LAMMPS will not do binning in 2 dimensions. You'd
have to add this feature yourself.