LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Issues with CNT Thermal Conductivity Calculations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Issues with CNT Thermal Conductivity Calculations

From: Santosh Mogurampelly <vedhava@...24...>
Date: Thu, 31 Aug 2017 02:05:52 -0400

On Wed, Aug 30, 2017 at 4:26 PM, Daksha, Chaitanya Mrityunjay <daksha@...43...437...> wrote:

Thank you for your response. If you don't mind, I have a few questions:

Would it be possible for you to provide any reference(s) for this subtraction? The sources I've looked through don't apply this subtraction, at least to the best of my knowledge. I have attached them for viewing purpose. But, please correct me if I am wrong.

Subtracting average quantity while calculating time correlation functions is a general requirement, not specific to HCACF, but may not make any difference in many cases. Specific to HCACF, you may want to see the definitions in Eq. 2 and 3 of However, when I tested on a different system using my code, I found no difference with and without subtracting the average energy. So lammps code must give you the same answer without the need of subtracting the average energy.

My suggestion in the previous reply was in fact based on an apparently wrong data you provided, in which the HCACF fluctuates around non-zero value even at long time. I suspect you wrongly interpreted J0Jt.dat output.

With sufficiently long enough correlation length of few picoseconds (attached input), I got the following HCACF with your input file. 

Regarding your other questions, (1) your HCACF was not decaying to zero because you possibly used a short correlation length of 0.0002*100*10 = 0.2 ps (despite generating a nanosecond long trj); (2) you can see that the attached HCACF decays to zero in about 2 ps and as a general rule of thumb, you must need at least 10 such correlations long trj to get a decent estimate of thermal conductivity.

Inline image 1

Also, if I wanted to implement the subtraction, could you suggest ways it may be possible in my script? I do not think it is possible to implement the subtraction prior to the 'compute flux' command, since it requires arguments that are also computes. Therefore, I would be unable to create variables for the new potential and kinetic energies, post subtraction.

Thank you once again,

Chad Daksha

From: Santosh Mogurampelly <vedhava@...24...>
Sent: Tuesday, August 29, 2017 4:39:08 PM
To: Daksha, Chaitanya Mrityunjay
Subject: Re: [lammps-users] Issues with CNT Thermal Conductivity Calculations
You should subtract the average of total energy from particle's total energy for the HCACF to decay to zero.

On Tue, Aug 29, 2017 at 3:06 PM, Daksha, Chaitanya Mrityunjay <daksha@...2437...> wrote:

Dear LAMMPS Users,


I am trying to calculate the thermal conductivity of a (10,10) CNT that is 5 nm in length using the Green-Kubo formalism.  I modified the liquid Argon LAMMPS thermal conductivity example for CNT.  First, I equilibrated the CNT structure at 300K, and then I ran the simulation to get the heat flux, heat current auto correlation function (HCACF) and thermal conductivity. To plot the HCACF, I averaged columns 4, 5, and 6 in the ‘J0Jt.dat’ file for every 1000 timesteps (which is my dump interval). 



Currently I am having two problems -

  1. The HCACF does not decay to zero. I have tried running the simulation for up to 1200 ps, but the HCACF still did not decay to zero. 
  2. The thermal conductivity value I attain differs based on the correlation length parameter I use in the ‘fix ave/correlate’ command.  Should the conductivity be independent of correlation length? If not, then how should I determine the appropriate correlation length?


I checked the LAMMPS email archive, but I was not able to find anything specific to my issues. Attached is the LAMMPS script, as well as other input data files. There is also a graph of the HCACF over time attached.


I would appreciate any insights as to why the HCACF does not decay to zero. 



Thank you,


Chad Daksha


Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list

Be Cool Be Happy

Post Doctoral Fellow; Office: SERC, 701C; +1-215-204-4221
Prof. Michael L. Klein group
Institute for Computational Molecular Science
Temple University
1925 N. 12th St
Philadelphia, PA 19122, USA

Be Cool Be Happy

Post Doctoral Fellow; Office: SERC, 701C; +1-215-204-4221
Prof. Michael L. Klein group
Institute for Computational Molecular Science
Temple University
1925 N. 12th St
Philadelphia, PA 19122, USA
 # input script for SWNT simulation in LAMMPS

# Variables
variable input index coordi-cnt.txt

units		    metal
boundary            p p p 
atom_style          atomic

variable	T equal 300.0
variable 	dt equal 0.0002 		# ps
variable    p equal 40000     		# correlation length
variable    s equal 5      		# sample interval
variable	d equal $p*$s 			# dump interval

thermo ${d}
timestep ${dt}            # ps


read_data           ${input}


pair_style     airebo 3.0 1 1
pair_coeff     * * CH.airebo C

neighbor	    1.0 bin
neigh_modify	    delay 1

# Calculating Volume

variable 	diameter equal (sqrt(3)*1.42*sqrt(10^2+10*10+10^2))/PI			#(10,10) armchair CNT; assuming C-C bond distance of 1.42
variable 	radius equal ${diameter}/2
variable 	height equal "lz"												#Height is equal to z-dimension length
variable 	V equal 2*PI*${radius}*3.4*${height}							

# Convert from metal units to SI

variable    kB equal 1.3806504e-23    # [J/K] Boltzmann
variable    eV2J equal 1.602176565e-19
variable    A2m equal 1.0e-10
variable    ps2s equal 1.0e-12
variable    convert equal ${eV2J}*${eV2J}/${ps2s}/${A2m}

group Carbon type 1

# ------------------------------------------------------------------------------
variable temp equal temp

# output for VMD
dump 		1 all custom 10000 dump.uhmwpe-coord id type x y z
dump 		2 all xyz 10000 dump.uhmwpe-xyz-format
dump_modify 	2 element C 

## --- Relaxation ---
fix 51 all nvt temp $T $T 0.1
run 200000

## --- Thermal Conductivity Calculation ---
unfix 51
fix 51 all nve

reset_timestep 0
compute      myKE all ke/atom
compute      myPE all pe/atom
compute      myStress all stress/atom NULL virial
compute      flux all heat/flux myKE myPE myStress
variable     Jx equal c_flux[1]/$V
variable     Jy equal c_flux[2]/$V
variable     Jz equal c_flux[3]/$V
fix          JJ all ave/correlate $s $p $d &
             c_flux[1] c_flux[2] c_flux[3] type auto file J0Jt.dat ave running
variable     scale equal ${convert}/${kB}/$T/$T/$V*$s*${dt}
variable     k11 equal trap(f_JJ[3])*${scale}
variable     k22 equal trap(f_JJ[4])*${scale}
variable     k33 equal trap(f_JJ[5])*${scale}
thermo_style custom step temp cpu v_Jx v_Jy v_Jz v_k11 v_k22 v_k33

run          2000000

variable     k equal (v_k11+v_k22+v_k33)/3.0
print        "average conductivity: $k[W/mK] @ $T K"
unfix 51

print "Run is complete!"