# Compute heat/flux contributions

Hello all,

I am using GK algorithm to calculate the thermal conductivity of a polymer melt system. I would like to separate the different contributions to thermal conductivity (ke, pe, and stress) as given by the expression in the lammps documentation page. To my surprise, I find that the sum of the contributions is not equal to the total. I went back to the example given for Argon and found the same issue. Here is a summary of what I have done:

1. Created “0” computes for ke, pe and stress using and empty group (myKE, … are computed for all atoms):

group empty type 9999

compute zKE empty ke/atom
compute zPE empty pe/atom improper
compute zStress empty stress/atom NULL virial

1. Use those to compute kinetic, potential and stress fluxes:

compute flux all heat/flux myKE myPE myStress

compute Kflux all heat/flux myKE zPE zStress
compute Pflux all heat/flux zKE myPE zStress
compute Sflux all heat/flux zKE zPE myStress

1. Use those to calculate the heat fluxes and autocorrelation funtions
variable Jx equal c_flux[1]/vo

variable KJx equal c_Kflux[1]/vol

fix KJJ all ave/correlate \$s \$p \$d &
c_Kflux[1] c_Kflux[2] c_Kflux[3] type auto file KJ0Jt.dat ave running

1. Use trap to calculate the thermal conductivities:

variable Kk11 equal trap(f_KJJ[3])*\${scale}

I find that Jx, KJx, PJx and SJx (the y and z components as well) add up correctly (Jx-KJx -PJx -SJx ~ 1E-13), however the autocorrelation function and the thermal conductivities differ by more (i.e. k11 -Kk11 -Pk11 -Sk11 ~ 0.5E-2, which is significant given that k ~0.35)

Is there any reason why the components should not add up? I am missing some subtlety with the fix ave/correlate? If so how do I adjust it to get the correct contributions to TC?

Thank you in advance for your help!

David

Hi David,

In your step 3 above, under fix ave/correlate, I presume the auto correlation line is repeated 3 times, for KE PE and stress fluxes.

Think of the 3 terms in the flux decomposition as a 3x3 matrix that sums to the total. You have the diagonal values but are missing the 6 cross-correlations.

best
Tim

Hi Timothy,

Thanks for your response. Yes, I repeat the fix ave/correlate for KE, PE and Stress and the 3 of them together. I think I could use the fix auto/upper to get all the 6 terms of the tensor but it is not clear to me how those should/could be combined to obtain something like:

k_{11}(total) = k_{11}(KE) + k_{11}(PE) + k_{11}(Stress)

Maybe it just makes more sense to think in terms of heat fluxes where Jx(total) = Jx(KE) + Jx(PE) + Jx(Stress).

Best,

David