# Spatial temperature distribution

Dear LAMMPS users;

I am trying to achieve to the spatial temperature distribution (color coded visualization for the temperature of each atom) for nanometric machining. I have done this in 2 ways.

Firstly, I used kinetic energy:

compute keatom mobile ke/atom

fix fkeatom mobile ave/atom 50 4 \$n c_keatom

variable kb equal 1.3806504e-23 #Boltzmann const

dump endis mobile custom \$n endis/endis.\$f.* x y z f_fkeatom c_keatom v_tempatom

The initial temperature of workpiece was 293K (which was expected). Nevertheless, by progressing the simulation, the workpiece temperature remained around 293K and no significant change occurred. Just like this, there was not any significant changes in kinetic energy of the workpiece.

Hence, I tried to use atom velocities as a new effort:

compute velatom1 mobile property/atom vx #Calculation of atoms velocity in X direction

compute velatom2 mobile property/atom vy #Calculation of atoms velocity in Y direction

compute velatom3 mobile property/atom vz #Calculation of atoms velocity in Z direction

variable totvelatom atom “sqrt((c_velatom1)^2+(c_velatom2)^2+(c_velatom3)^2)”

fix ftotvelatom mobile ave/atom 50 4 \$n v_totvelatom

variable tempatom2 atom “293+(2/3)(1/v_kb)(1/2)28.085(f_ftotvelatom)^2 (1/v_avoqadro)(1/1000)*(10000)” ## 28.085 is the mass of workpiece atom

Again, there was no significant change in the atom temperatures. Besides, another problem had arisen. The temperature range obtained from this new definition did not match with real temperature.

I have been struggling a lot with this and currently, I have no idea what I should do now. Just looking forward your valuable advices.

Thanks,

Dear LAMMPS users;

I am trying to achieve to the spatial temperature distribution (color coded
visualization for the temperature of each atom) for nanometric machining. I
have done this in 2 ways.

Firstly, I used kinetic energy:

compute keatom mobile ke/atom

fix fkeatom mobile ave/atom 50 4 \$n c_keatom

variable kb equal 1.3806504e-23 #Boltzmann const

variable tempatom atom

why 293+... ?

axel.

Because I used “units metal” and want to have the temperature in Celsius.
Could this affect the equation??

Because I used "units metal" and want to have the temperature in Celsius.

what has that to do with adding 293???

Could this affect the equation??

of course you have to use consistent units. the documentation for the
units command lists the various settings for different choices of
units.

axel.

Sorry, my mistake.
Actually 293 is the initial temperature of my workpiece and I set it in minimization and initial running.

Sorry, my mistake.
Actually 293 is the initial temperature of my workpiece and I set it in
minimization and initial running.

that said, it will be better to first compute your temperature in
kelvin. if that one is off by multiple orders of magnitude, e.g.
through a botched unit conversion, you will not see it, as the added
constant (273.15) may hide it, which is what i suspect is happening
here. what is k_B in eV/K?

axel.

Dear Axel,
I have omitted “293” from all the equations in my script. However, I can not still see any significant difference between atom temperatures in spatial temperature distribution (actually all the atoms remain in their initial temperature and only the temperature of a few of them increased around 1K).
That is while I am sure there should be a significant temperature distribution between atoms. Since I extract the total temperature of my workpiece which increased considerably.

Thanks,

Dear Axel,
I have omitted "293" from all the equations in my script. However, I can not

well, have you also fixed the value of k_B to be in metal units?

still see any significant difference between atom temperatures in spatial
temperature distribution (actually all the atoms remain in their initial
temperature and only the temperature of a few of them increased around 1K).
That is while I am sure there should be a significant temperature
distribution between atoms. Since I extract the total temperature of my
workpiece which increased considerably.

LAMMPS will do what you program it to do. i have no time to debug your input.

if you are not certain how to do things, do not try them on a complex
input, but create a simple test input (e.g. a few atoms of liquid
argon) where you can verify your computation in the input.

axel.