Temperature Profile

Hi LAMMPS community,

I want temperature profile in flowing system system, as I know it’s possible doing it by fix ave/spatial but I need to feed it with a variable. Basically, what comes to my mind is to obtain the center of mass velocity for each atom in the bin and then calculate 1/2m(V-Vcm)^2 for that bin and sum them up. Here I have two problems: 1. I don’t know how to get the Vcm of each atom in the bin, I know that there’s a region function vcm(group,dim,region) which can give me Vcm in specified dimension but in a predefined region, do I need to define regions which coincides with the bins in fix ave/spatial? or is there a better way to do that? 2. I also need each atom velocity in that bin to subtract the Vcm from how I can do that?

Thank you,


What is the Vcm of a single atom?

You can look at the compute temp/profile command which
may do what you want.