SPARTA WWW Site - SPARTA Documentation - SPARTA Commands

### compute temp command

**Syntax:**

compute ID temp

- ID is documented in compute command
- temp = style name of this compute command

**Examples:**

compute 1 temp
compute myTemp temp

**Description:**

Define a computation that calculates the temperature of all particles.

The temperature is calculated by the formula KE = dim/2 N kB T, where
KE = total kinetic energy of the particles (sum of 1/2 m v^2), dim =
dimensionality of the simulation, N = number of particles, kB =
Boltzmann constant, and T = temperature.

Note that this definition of temperature does not subtract out a net
streaming velocity for particles, so it is not a thermal temperature
when the particles have a non-zero streaming velocity. See the
compute thermal/grid command for
calculation of thermal temperatures on a per grid cell basis.

**Output info:**

This compute calculates a global scalar (the temperature). This value
can be used by any command that uses global scalar values from a
compute as input. See Section 4.4 for an
overview of SPARTA output options.

The scalar value will be in temperature units.

**Restrictions:** none

**Related commands:** none

**Default:** none