lammps计算热导率后模型出现混乱是什么原因(错误图片如下)
个人猜测因为材料为金刚石——石墨复合材料,因此在设置晶格常数的时候出了问题
分别利用两种代码计算,一种是Green-Kubo,另一种是热流自关联函数<J(0)J(t)>,代码分别如下


variable V equal lx*ly*lz # 使用真实体积
variable dt equal 0.001
variable cor equal 10000
variable sam equal 10
variable dum equal ${cor}*${sam}
#单位转换公式
variable kB equal 8.6173324e-5 #eV/K Boltzmann
variable ev2J equal 1.60210e-19 #eV to J/mol
variable A2m equal 1.0e-10 #Angstrom to meter
variable ps2s equal 1.0e-12 #picoseconds to seconds
variable convert equal ${ev2J}/(${A2m}*${ps2s})
#计算热流
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]
variable Jy equal c_flux[2]
compute KE all ke/atom #计算单原子动能
compute PE all pe/atom #计算单原子势能
compute V all stress/atom NULL virial #计算单原子位力
compute J all heat/flux KE PE V #计算单原子热流
dump 1 all custom 10000 pbte.xyz id type x y z
#在产出阶段计算热流自关联函数<J(0)J(t)>
variable Ns equal 30
variable Nc equal 6000
variable Np equal ${Ns}*${Nc}*10
fix HAC all ave/correlate ${Ns} ${Nc} ${Np} c_J[1] c_J[2] c_J[3] type auto file hac.txt
thermo_style custom step temp press pxx pyy pzz etotal vol
variable M equal 30 #热流自关联函数个数
variable N equal ${M}*${Np} #产出步数
variable Jz equal c_flux[3]
fix JJ all ave/correlate ${sam} ${cor} ${dum} c_flux[1] c_flux[2] c_flux[3] type auto file SLG_J.J_t${temp_s}.dat ave running
#计算Green-Kubo公式系数
variable scale equal (${dt}*${sam})/(${kB}*${temp_s}^2*${V})
#计算Green-Kubo公式
variable k11 equal (trap(f_JJ[3])*${scale})*${convert}
variable k22 equal (trap(f_JJ[4])*${scale})*${convert}
variable k33 equal (trap(f_JJ[5])*${scale})*${convert}
variable k_total equal (v_k11+v_k22+v_k33)/3.0