The commands about nvt thermostating on special dimension are right or wrong

Dear lammps-users

I want to know if the nvt thermostating only be implemented on x and y dimensions when I use these command:

fix 1 gas nvt 273 273 100

compute 2 gas temp/partial 1 1 0

fix_modify 1 temp 2

Thanks for your help!

Yes, this looks right. But you should perform some kind of test to be sure. For example, assign a large fixed streaming velocity to all atoms in the z direction. The evolution of the temperature reported by compute 2 should be independent of that z velocity (assuming you have PBC in z, etc.).