<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 <a class="reference internal" href="fix_thermal_conductivity.html"><span class="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 <a class="reference internal" href="fix_heat.html"><span class="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
<a class="reference internal" href="compute.html"><span class="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>).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">These other computes should provide values for all the atoms in
the group this compute specifies. That means the other computes could
use the same group as this compute, or they can just use group “all”
(or any group whose atoms are superset of the atoms in this compute’s
group). LAMMPS does not check for this.</p>
</div>
<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>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The <a class="reference internal" href="compute_pe_atom.html"><span class="doc">compute pe/atom</span></a> and <a class="reference internal" href="compute_stress_atom.html"><span class="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 <a class="reference internal" href="compute_stress_atom.html"><span class="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>
<hr class="docutils" />
<p>The heat flux can be output every so many timesteps (e.g. via the
<a class="reference internal" href="thermo_style.html"><span class="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 <a class="reference internal" href="fix_ave_correlate.html"><span class="doc">fix ave/correlate</span></a> command can calclate
the autocorrelation. The trap() function in the
<a class="reference internal" href="variable.html"><span class="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>
<hr class="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 <a class="reference internal" href="Section_howto.html#howto-15"><span class="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 <a class="reference internal" href="units.html"><span class="doc">units</span></a>. Once
divided by a volume the units will be that of flux, namely
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.