units real boundary p p p atom_style full variable T equal 400 variable V equal vol pair_style buck/coul/long 15.0 kspace_style ewald/disp 1.0e-4 ############# fix and minimize section ########################## velocity all create $T 12323 mom yes rot yes minimize 0.001 0.001 1000 10000 min_style cg fix nvt all nvt temp $T $T 100 ######## thermo section ########### thermo 2000 thermo_style custom step etotal temp timestep 1 dump 1 all atom 100 dump.lammpstrj run 6000 reset_timestep 0 unfix nvt fix NVE all nve run 10000 #################################################### ######### thermal conductivity Section ############## # thermal conductivity calculation, switch to NVE if desired #unfix NVT #fix NVE all nve variable p equal 200 # correlation length variable s equal 10 # sample interval variable d equal $p*$s # dump interval # convert from LAMMPS real units to SI variable kB equal 1.3806504e-23 # [J/K] Boltzmann variable kCal2J equal 4186.0/6.02214e23 variable A2m equal 1.0e-10 variable fs2s equal 1.0e-15 variable convert equal ${kCal2J}*${kCal2J}/${fs2s}/${A2m} 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]/vol variable Jy equal c_flux[2]/vol variable Jz equal c_flux[3]/vol 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*0.01 variable k11 equal trap(f_JJ[3])*${scale} variable k22 equal trap(f_JJ[4])*${scale} variable k33 equal trap(f_JJ[5])*${scale} variable k equal (v_k11+v_k22+v_k33)/3.0 thermo_style custom step temp v_Jx v_Jy v_Jz v_k11 v_k22 v_k33 v_k run 250000 variable k equal (v_k11+v_k22+v_k33)/3.0 print "average conductivity: $k[W/mK] @ 400K"