# Temperature Profile in LAMMPS

Dear all,

I have calculated in two different ways the temperature profile of my system (liquid which is in x- and y- direction periodic and has surfaces from above and below it along z-direction).

1. Firstly, I used “compute temp/profile” which I then averaged using “fix ave/time”. The result looks awkward. Firstly the temperature values are higher than the reference temperature and secondly the temperature values oscillate one to one as the density profile (along z-direction) of my liquid.

2. Second way was via post processing. I just wrote a simple program that analyzes the particle velocities from the dump file. The temperature in every bin was calculated like:

T_bin = 2/(3k_b) * <E_k>_bin / _bin, where _bin is the average number of the particles in the bin and <E_k>_bin is respectively the average kinetic energy in the bin. If there was no single particle in the bin over the whole period of averaging than T_bin was set simply to zero. At the attached graph of the temperature profiles one can notice that in such a way calculated temperature profile is quite reasonable and the temperature fluctuates around the reference temperature.

My question is the following.

What might be the reason that “compute temp/profile” yields such a strange temperature profile?

Temperature rescaling was used for the thermostating, but in the the case of the Nose-Hoover thermostat one gets the similar behaviour from “compute temp/profile”.

Thanks,
Anton

in.nodd (1.38 KB)

temperatur.eps (27.8 KB)

data.Hg.dp.N1000.lxlz.d13.69.relaxed (49.3 KB)

The first line of the compute temp/profile doc page is:

calculates the temperature of a group of atoms, after subtracting out a spatially-averaged center-of-mass velocity field,
before computing the kinetic energy.

Your formula doesn’t do that, so you are computing
two different things.

If you want to calcalate your formula in LAMMPS,
you don’t need compute temp/profile. Rather you
should use compute ke/atom and fix ave/spatial
and/or an atom-style variable that defines your formula.

Steve

Dear Steve,

Thank you for the reply!

Yes, sure I saw that line in the manual.

Do you mean that temp/profile calculates the centre of mass velocity for a group of atoms in specific bin and then subtracts it from the velocities of the atoms in that bin?
The centre of mass velocity of my system as a whole is 0.

Thanks!
Anton

Do you need to divide by "<N>_bin" in your formula? Because you're already using the average kinetic energy in the bin.

Kasra.

yes, compute temp/profile is designed to
use with a streaming system where you want to
subtract the streaming profile velocity from the
atoms and just compute the reamining thermal
temperature. If the COM motion (in every bin)
is 0.0, then it is probably the same as your formula,
That will undoubtably not be the case if you
have a small # of atoms in some bins.

Steve

Dear Steve, now I see. Thank you.

Dear Kasra, “the average kinetic energy” means the average over time (MD steps).

Ok, I see Anton...Thanks for clarification.