modified fix_ thermal_conductivity.cpp

Dear all

    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 .


        Chenglong Wang




fix_thermal_conductivity.cpp (10.8 KB)


    I wonder if this modification is correct .

what difference does it make whether anybody here says "yes" or "no"?
you can't put in a paper "this person on this mailing list said it was
ok". it is *your* credibility that you put to the test. do you want to
make it subject to some person, who may just decide to play a
practical joke on you?

so *you* have to prove it to yourself that it is correct. ...and for
something like your case it is simple enough: pick some systems for
which the results are known with the original implementation,
reproduce them with the original implementation and then reproduce
them with your modification. if this all works. you are good (or as
bad as the original, depending on how you look at it). no external
"seal of approval" needed anymore.