LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

temperature command

Syntax:

temperature ID group-ID style args keyword value ... 

Examples:

temperature mine peptide full
temperature new flow partial 1 1 0
temperature mine flow region boundary
temperature 2nd middle ramp vx 0 8 y 2 12 units lattice 

Description:

Define a method for computing the temperature of a group of atoms.

The ID of the temperature can be referred to in other commands, such as thermo_modify, velocity, fix_modify, temp_modify. Note that certain fixes create their own temperatures with the same ID as the fix, e.g. fix temp/rescale, fix nvt, fix npt, etc.

The style determines how the temperature is computed. The full style means KE = dim/2 N k T, where KE = total kinetic energy of the group of atoms (sum of 1/2 m v^2), dim = 2 or 3 = dimensionality of the simulation, N = number of atoms in the group, k = Boltzmann constant, and T = temperature.

The partial style uses the same formula as full, except entire dimensions can be eliminated from the kinetic energy computation. This can be useful for systems where atoms are flowing, and only the thermal temperature in the non-flow directions is desired. A "0" means do not use the component of velocity in that dimension when computing KE. In the example above with arguments 1 1 0, only x and y velocities (not z) would be used in computing KE and temperature.

The ramp style can be used to eliminate an imposed velocity on a system before computing thermal KE. The meaning of these arguments is the same as for the velocity command which was presumably used to impose the velocity.

The region style is the same as full except that only atoms in the specified geometric region contribute to the temperature. Since atoms can enter/leave a region, this test is performed each time the temperature is computed. This can be useful for thermostatting one portion of the simulation box. E.g. a McDLT simulation where one side is cooled, and the other side is heated.

Note that a region-style temperature can be used to thermostat with fix temp/rescale or fix langevin, but should probably not be used with Nose/Hoover style fixes (>fix nvt, fix npt, or fix nph), if the degrees-of-freedom included in the computed T varies with time.

The units keyword determines the meaning of the distance units used for coordinates (c1,c2) and velocities (vlo,vhi) defined for the ramp style. A box value selects standard distance units as defined by the units command, e.g. Angstroms for units = real or metal. A lattice value means the distance units are in cubic lattice spacings; e.g. lattice spacings / tau. The lattice command must first be used to define a lattice.

LAMMPS defines a temperature with ID = default which computes a full style on the all group of atoms. This is the temperature used for thermodynamic output of quantities like temperature, pressure, kinetic energy (see the thermo_style command) unless you change it via the thermo_modify command.

All temperature styles (except region) subtract out degrees-of-freedom (DOF) due to fixes that constrain molecular motion. Currently, these are fix shake and fix rigid. DOF is the N * dim factor in the above equation for the full style. This means the temperature of groups of atoms that include these constraints will be computed correctly. If needed, the subtracted degrees-of-freedom can be tweaked using the temp_modify command.

Restrictions: none

Related commands:

thermo_modify, velocity, fix_modify, temp_modify

Default:

A temperature with ID = default is defined by LAMMPS, as if it had been specified as "temperature default all full". The option default is units = lattice.