I add “compute tc command” into lammps, the usage for it is like this:### compute tc commandSyntax:
<br>compute ID groupID tc temp c_fluxID v_factor_ac v_factor_tc portion mbig time_start out_frequency <br><br>
 ID, groupID are documented in compute command
 tc = style name of this compute command
 temp = temperature value used for thermal conductivity calculation (temperature units)
 c_fluxID = ID of a compute that calculates heat flux
 v_factor_ac = ID of a variable transform autocorrelation to the units desired
 v_factor_tc = ID of a variable transform thermal conductiviyt to the units desired
 portion = first(total heat flux: jc + jv) or second(just conductive portion
: jc only) for heat flux contribution
 mbig = the mbig value in Green Kubo thermal conductivity expression
 time_start = start timestep for “ac.dat” and “tc.dat” output(timestep units, not time units)
 out_frequency = output frequency for “ac.dat” and “tc.dat” (timestep units, not time units)
The command can output two files “ac.dat”(autocorrelation) and “tc.dat”(thermal conductivity), every “out_frequency” timesteps, and start at “time_start” timestep.
And the value returned from this command is thermal conductivity value at each timestep.
“v_factor_ac” and “v_factor_tc” can be used to transform dimensionless units to SI units for other units you desire.
For now enthalpy term has not been added to compute_heat_flux.cpp, so when computing thermal conductivity we also don’t include enthalpy term.
Usage: for example:
compute myKE all ke/atom
compute myPE all pe/atom
compute myStress all stress/atom virial
variable factor_ac equal 1.0
variable factor_tc equal 1.3806504e23*sqrt(1.67e21/6.633e26)/3.405e10^2
compute jflux all heat/flux myKE myPE myStress
compute tc all tc 0.71 c_jflux v_factor_ac v_factor_tc first 10000 500000 100000
Xiaoliang

compute_tc.cpp (9.05 KB)
compute_tc.h (1.2 KB)