<p>Define a computation that calculates the heat flux vector based on
contributions from atoms in the specified group. This can be used by
itself to measure the heat flux into or out of a reservoir of atoms,
or to calculate a thermal conductivity using the Green-Kubo formalism.</p>
<p>See the <aclass="reference internal"href="fix_thermal_conductivity.html"><spanclass="doc">fix thermal/conductivity</span></a>
command for details on how to compute thermal conductivity in an
alternate way, via the Muller-Plathe method. See the <aclass="reference internal"href="fix_heat.html"><spanclass="doc">fix heat</span></a> command for a way to control the heat added or
subtracted to a group of atoms.</p>
<p>The compute takes three arguments which are IDs of other
<aclass="reference internal"href="compute.html"><spanclass="doc">computes</span></a>. One calculates per-atom kinetic energy
(<em>ke-ID</em>), one calculates per-atom potential energy (<em>pe-ID)</em>, and the
third calcualtes per-atom stress (<em>stress-ID</em>). These should be
defined for the same group used by compute heat/flux, though LAMMPS
does not check for this.</p>
<p>The Green-Kubo formulas relate the ensemble average of the
auto-correlation of the heat flux J to the thermal conductivity kappa:</p>
<p>Ei in the first term of the equation for J is the per-atom energy
(potential and kinetic). This is calculated by the computes <em>ke-ID</em>
and <em>pe-ID</em>. Si in the second term of the equation for J is the
per-atom stress tensor calculated by the compute <em>stress-ID</em>. The
tensor multiplies Vi as a 3x3 matrix-vector multiply to yield a
vector. Note that as discussed below, the 1/V scaling factor in the
equation for J is NOT included in the calculation performed by this
compute; you need to add it for a volume appropriate to the atoms
included in the calculation.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">The <aclass="reference internal"href="compute_pe_atom.html"><spanclass="doc">compute pe/atom</span></a> and <aclass="reference internal"href="compute_stress_atom.html"><spanclass="doc">compute stress/atom</span></a> commands have options for which
terms to include in their calculation (pair, bond, etc). The heat
flux calculation will thus include exactly the same terms. Normally
you should use <aclass="reference internal"href="compute_stress_atom.html"><spanclass="doc">compute stress/atom virial</span></a>
so as not to include a kinetic energy term in the heat flux.</p>
</div>
<p>This compute calculates 6 quantities and stores them in a 6-component
vector. The first 3 components are the x, y, z components of the full
heat flux vector, i.e. (Jx, Jy, Jz). The next 3 components are the x,
y, z components of just the convective portion of the flux, i.e. the
first term in the equation for J above.</p>
<hrclass="docutils"/>
<p>The heat flux can be output every so many timesteps (e.g. via the
<aclass="reference internal"href="thermo_style.html"><spanclass="doc">thermo_style custom</span></a> command). Then as a
post-processing operation, an autocorrelation can be performed, its
integral estimated, and the Green-Kubo formula above evaluated.</p>
<p>The <aclass="reference internal"href="fix_ave_correlate.html"><spanclass="doc">fix ave/correlate</span></a> command can calclate
the autocorrelation. The trap() function in the
<aclass="reference internal"href="variable.html"><spanclass="doc">variable</span></a> command can calculate the integral.</p>
<p>An example LAMMPS input script for solid Ar is appended below. The
result should be: average conductivity ~0.29 in W/mK.</p>
<hrclass="docutils"/>
<p><strong>Output info:</strong></p>
<p>This compute calculates a global vector of length 6 (total heat flux
vector, followed by convective heat flux vector), which can be
accessed by indices 1-6. These values can be used by any command that
uses global vector values from a compute as input. See <aclass="reference internal"href="Section_howto.html#howto-15"><spanclass="std std-ref">this section</span></a> for an overview of LAMMPS output
options.</p>
<p>The vector values calculated by this compute are “extensive”, meaning
they scale with the number of atoms in the simulation. They can be
divided by the appropriate volume to get a flux, which would then be
an “intensive” value, meaning independent of the number of atoms in
the simulation. Note that if the compute is “all”, then the
appropriate volume to divide by is the simulation box volume.
However, if a sub-group is used, it should be the volume containing
those atoms.</p>
<p>The vector values will be in energy*velocity <aclass="reference internal"href="units.html"><spanclass="doc">units</span></a>. Once
divided by a volume the units will be that of flux, namely
<divclass="highlight-default"><divclass="highlight"><pre><span></span><spanclass="c1"># thermal conductivity calculation, switch to NVE if desired</span>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.