Question about compute temp/chunk

Dear Lammps Users,

I want to compute the temperature profile in a system including gas molecules confined between two solid walls. I want to subtract the velocity of the center of mass for each chunk, and going through the LAMMPS documentation I noticed that “compute temp/chunk” does what I want.
To find out how this compute works I used it on a system without any stream velocity and compared the results with the output of fix ave/chunk as follows:
%-----------------------------------------------------------LAMMPS input
variable N_bin equal 10
variable Bin_Length equal 1/${N_bin}

compute layers Argon chunk/atom bin/1d y lower ${Bin_Length} units reduced
compute myChunk Argon temp/chunk layers temp com yes
fix 1 Argon ave/time 100 100 10000 c_myChunk file temp_c.txt mode vector

fix 2 Argon ave/chunk 100 100 10000 layers temp file temp_fix.txt
%----------------------------------------------------------------------------------------------
First of all, according to the LAMMPS documentation for compute temp/chunk: “This compute calculates a global array and the number of rows in the array=the number of chunks Nchunk, as calculated by the specified, compute chunk/atom”. The thing is in my case the output of fix ave/time (as you can see in the following) has always 6 rows and changing the number of bins in compute chunk/atom does not have any effect on it. I was expecting since I specified Nbin=10, temp_c.txt should have 10 rows, am I wrong here?
#-------------------------------------compute temp/chunk+ fix ave/time output

Time-averaged data for fix 1

TimeStep Number-of-rows

Row c_myChunk

1510000 6
1 289.143
2 306.101
3 284.518
4 3.147
5 -3.76361
6 -5.95348

-------------------------------------------------------------------------------------- Secondly, I compared the results for temperature computed by "**compute temp/chunk+ fix ave/time"** with the one computed by **fix ave/chunk (**you can see it in the following). Since there is no stream velocity here and I am using the same Nfreq for both fixes, I was expecting that the output temperatures should be in the same range. But as you can see the results from **compute temp/chunk+ fix ave/time** are very weird and I am getting negative values for temperature! ---------------------------------------fix ave/chunk output

Chunk-averaged data for fix ave 2 and group file

Timestep Number-of-chunks Total-count

Chunk Coord1 Ncount temp

1510000 10 1500
1 0.05 0 0
2 0.15 362.54 320.979
3 0.25 164.19 303.946
4 0.35 148.48 298.835
5 0.45 161.15 305.061
6 0.55 146.88 329.105
7 0.65 146.36 321.014
8 0.75 132.49 334.138
9 0.85 237.91 341.474
10 0.95 0 0
%-----------------------------------------------------------------------------------------
I highly appreciate if someone could tell me what I am doing wrong here.

Best regards,

Shahin Mohammadnejad

you are leaving out an important part of the documentation for compute temp/chunk:

This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6.

to access the scalar, you need to use “mode scalar”, with “mode vector” your fix ave/time command will access the global vector. if you want to access the global array properties, you have to specific which the index to the array row, i.e. if you change c_myChunk to c_myChunk[1] you will tell fix ave/time that you want to access the first row of the array, not the vector and you will have Nchunk items, i.e. 10 in your case.

axel.