Tallying energy using temp/rescale

Hello Lammps users

I am thermosetting two region of the simulation box, one at 310K and other one at 290K. While trying to tallying/calculating energy exchange, I get negative values of energy of the region at 310K and +ve for the region at 290K while these signs should be reverse because energy is added to the region at 310K and subtracted from the region at 290K to maintain their temperatures. Why I am getting values with reverse sign?

Also one more thing, compute temp/region and compute temp are giving different values of temperatures for same region. I think the values should be same because both use same formula to calculate temperature.

Please guide

Thank you.

Rajesh

in.lang (2.59 KB)

log.lammps (14.7 KB)

Also one more thing, compute temp/region and compute temp are giving different values of temperatures for >same region. I think the values should be same because both use same formula to calculate temperature.

A couple possible reasons.

a) if atoms move in/out of the region, how do you

know compute temp is calculating a temperature

Dear Steve
Thank you for your quick response. I got the reason for different temperatures.
Could you please advise on what why energy exchange with region at 310k is negative and with 290K, energy is positive. Shouldn’t be it reverse??

Thank you
Rajesh