LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

compute temp/heat/flux/layer command

Syntax:

compute ID group-ID temp/heat/flux/layer pe-ID stress-ID Nbins angmom value

Examples:

compute myFlux all temp/heat/flux/layer myKE myPE myStress Nbins angmom 

Description:

This is a modified form of compute heat/flux. Performs binning every time when the compute is invoked and then calculates the temperature of each bin, ranging from 1 to Nbins, and its x-component of heat current vector based on contributions from atoms in each bin. 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 or the Direct method or the TPI method.

See the fix thermal/conductivity command for details on how to compute thermal conductivity in an alternate way, via the Muller-Plathe method. See the fix heat command for a way to control the heat added or subtracted to a group of atoms.

The compute takes three arguments, of which two are IDs of other computes, and the third is the number of bins (layers) along the length (x-axis). Among two compute IDs, one calculates per-atom potential energy (pe-ID) and the second calcualtes per-atom stress (stress-ID). These should be defined for the same group used by compute temp/heat/flux/layer, though LAMMPS does not check for this.

The heat current J for each bin is expressed as:

where e_i in the first term of the equation for J is the per-atom energy (potential and kinetic), calculated by the compute pe-ID and the per-atom kinetic energy. S_i in the second term of the equation for J is the per-atom stress tensor calculated by the compute stress-ID. The tensor multiplies V_i as a 3x3 matrix-vector multiply to yield a vector. V_i is the velocity of particle i relative to the translational center-of-mass velocity of the bin to which the particle belongs. Using the keyword angmom, the rotational rigid-body motion can also be removed by subtracting the velocity caused by the angular velocity of the bin (layer).

IMPORTANT NOTE: The compute pe/atom and compute stress/atom 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 compute stress/atom virial so as not to include a kinetic energy term in the heat flux.

This compute calculates 2 quantities -- temperature and x-component of heat current vector -- for each bin and stores them in a (2*Nbins)-component vector. The odd elements of this vector are temperatures and the even elements are x-component of heat current vectors for all bins.


The temperature and heat current can be output every so many timesteps. Using the fix binAve/time command, the output can have the following format specified in fix binAve/time:

    1  temperature_1  heat_current_1
    2  temperature_2  heat_current_2
    . . . . . . . . . . . . . . . .  
    . . . . . . . . . . . . . . . .  
    n  temperature_n  heat_current_n
    

1 temperature_1 heat_current_1 2 temperature_2 heat_current_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . n temperature_n heat_current_n
The first column represents the bin numbers, and second and third columns refer to corresponding temperature and x-component of heat current vector. The blank line separates the temperature and heat current profiles.


Output info:

This compute calculates a global vector of length (2*Nbins) (temperature and x-component of heat current vector of each bin), which can be accessed by indices 1-(2*Nbins). These values can be used by any command that uses global vector values from a compute as input. See this section for an overview of LAMMPS output options. The use of fix binAve/time command is recommended to achieve the above format.

Heat flux for each bin can be calculated by dividing the heat current by the bin volume.

The heat current values will be in energy*velocity units. Once divided by a volume the units will be that of flux, namely energy/area/time units

Restrictions: none

Related commands:

fix thermal/conductivity, fix binAve/time, variable

Default:

The option default is angmom = no