I calculate thermal conductivity with LAMMPS version 4Mar13. From the doc page, I know that slab N/2+1 is the “hot” slab. But for some reason, I have to change the “hot” slab on slab N. Please see the sketch below.
I modified the source cpp file “fix_thermal_conductivity.cpp” in LAMMPS src folder to achieve the above purpose. The only four lines I rewritten are 134,135,162 and 163 (please see the attached cpp file). The original forms are “slabhi_lo = boxlo +(nbin/2)*binsize” and “slabhi_hi = boxlo + (nbin/2+1)*binsize”. The rewritten forms are “slabhi_lo = boxlo + (nbin-1)*binsize” and “slabhi_hi = boxlo + (nbin)*binsize”
Also the thermal conductivity is calculated as
What is different is that I do not need the factor of 2, and I use the free boundary condition in the direction of heat flow and periodic in other two directions.
The figure below is the calculated temperature profile after modified the source file
I wonder if this modification is correct .
fix_thermal_conductivity.cpp (10.8 KB)