Reviewing the compute heat flux class
In this section, we will study the source code for the compute heat flux
class, which is contained in compute_heat_flux.cpp
and compute_heat_flux.h
.
The compute heat flux
class accepts the per-atom kinetic energy, per-atom potential energy, and per-atom stress to calculate the heat flow (J
). This can be calculated as follows:
In this equation, represents the sum of kinetic and potential energies of atom i
, represents the velocity vector of atom i
, represents the stress tensor of atom i
, and V
represents the volume occupied by the atoms in consideration. The summation of is the convective part of the heat flux, while the summation of is the virial part of the heat flux.
Therefore, this compute needs to read the kinetic energy, potential energy, and stress of atoms dynamically, and this is facilitated by feeding these quantities as other computes. So, effectively, compute heat flux
accepts three other computes as input parameters...