region-ID = ID of region atoms must be in to have added force
</pre>
</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples</h2>
<pre class="literal-block">
fix 3 qin heat 1 1.0
fix 3 qin heat 10 v_flux
fix 4 qout heat 1 -1.0 region top
</pre>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>Add non-translational kinetic energy (heat) to a group of atoms in a
manner that conserves their aggregate momentum. Two of these fixes
can be used to establish a temperature gradient across a simulation
domain by adding heat (energy) to one group of atoms (hot reservoir)
and subtracting heat from another (cold reservoir). E.g. a simulation
sampling from the McDLT ensemble.</p>
<p>If the <em>region</em> keyword is used, the atom must be in both the group
and the specified geometric <a class="reference internal" href="region.html"><span class="doc">region</span></a> in order to have
energy added or subtracted to it. If not specified, then the atoms in
the group are affected wherever they may move to.</p>
<p>Heat addition/subtraction is performed every N timesteps. The <em>eflux</em>
parameter can be specified as a numeric constant or as a variable (see
below). If it is a numeric constant or equal-style variable which
evaluates to a scalar value, then the <em>eflux</em> determines the change in
aggregate energy of the entire group of atoms per unit time, e.g. in
eV/psec for <a class="reference internal" href="units.html"><span class="doc">metal units</span></a>. In this case it is an
“extensive” quantity, meaning its magnitude should be scaled with the
number of atoms in the group. Note that since <em>eflux</em> has per-time
units (i.e. it is a flux), this means that a larger value of N will
add/subtract a larger amount of energy each time the fix is invoked.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The heat-exchange (HEX) algorithm implemented by this fix is
known to exhibit a pronounced energy drift. An improved algorithm
(eHEX) is available as a <a class="reference internal" href="fix_ehex.html"><span class="doc">fix ehex</span></a> command and might be
preferable if energy conservation is important.</p>
</div>
<p>If <em>eflux</em> is specified as an atom-style variable (see below), then
the variable computes one value per atom. In this case, each value is
the energy flux for a single atom, again in units of energy per unit
time. In this case, each value is an “intensive” quantity, which need
not be scaled with the number of atoms in the group.</p>
<p>As mentioned above, the <em>eflux</em> parameter can be specified as an
equal-style or atom_style <a class="reference internal" href="variable.html"><span class="doc">variable</span></a>. If the value is a
variable, it should be specified as v_name, where name is the variable
name. In this case, the variable will be evaluated each timestep, and
its value(s) used to determine the flux.</p>
<p>Equal-style variables can specify formulas with various mathematical
functions, and include <a class="reference internal" href="thermo_style.html"><span class="doc">thermo_style</span></a> command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent flux.</p>
<p>Atom-style variables can specify the same formulas as equal-style
variables but can also include per-atom values, such as atom
coordinates. Thus it is easy to specify a spatially-dependent flux
with optional time-dependence as well.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If heat is subtracted from the system too aggressively so that
the group’s kinetic energy would go to zero, or any individual atom’s
kinetic energy would go to zero for the case where <em>eflux</em> is an
atom-style variable, then LAMMPS will halt with an error message.</p>
</div>
<p>Fix heat is different from a thermostat such as <a class="reference internal" href="fix_nh.html"><span class="doc">fix nvt</span></a>
or <a class="reference internal" href="fix_temp_rescale.html"><span class="doc">fix temp/rescale</span></a> in that energy is
added/subtracted continually. Thus if there isn’t another mechanism
in place to counterbalance this effect, the entire system will heat or
cool continuously. You can use multiple heat fixes so that the net
energy change is 0.0 or use <a class="reference internal" href="fix_viscous.html"><span class="doc">fix viscous</span></a> to drain
energy from the system.</p>
<p>This fix does not change the coordinates of its atoms; it only scales
their velocities. Thus you must still use an integration fix
(e.g. <a class="reference internal" href="fix_nve.html"><span class="doc">fix nve</span></a>) on the affected atoms. This fix should
not normally be used on atoms that have their temperature controlled
by another fix - e.g. <a class="reference internal" href="fix_nh.html"><span class="doc">fix nvt</span></a> or <a class="reference internal" href="fix_langevin.html"><span class="doc">fix langevin</span></a> fix.</p>
<p><strong>Restart, fix_modify, output, run start/stop, minimize info:</strong></p>
<p>No information about this fix is written to <a class="reference internal" href="restart.html"><span class="doc">binary restart files</span></a>. None of the <a class="reference internal" href="fix_modify.html"><span class="doc">fix_modify</span></a> options
are relevant to this fix.</p>
<p>This fix computes a global scalar which can be accessed by various
<a class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">output commands</span></a>. This scalar is the
most recent value by which velocites were scaled. The scalar value
calculated by this fix is “intensive”. If <em>eflux</em> is specified as
an atom-style variable, this fix computes the average value by which
the velocities were scaled for all of the atoms that had their
velocities scaled.</p>
<p>No parameter of this fix can be used with the <em>start/stop</em> keywords of
the <a class="reference internal" href="run.html"><span class="doc">run</span></a> command. This fix is not invoked during <a class="reference internal" href="minimize.html"><span class="doc">energy minimization</span></a>.</p>
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>.