git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@16053 f3b2605a-c512-4ea7-a41b...
[lammps.git] / doc / src / compute_temp_region.txt
blob3e4a80db8dd1ff4cf2c0cee248754bf2f2721158
1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
4 :link(ld,Manual.html)
5 :link(lc,Section_commands.html#comm)
7 :line
9 compute temp/region command :h3
11 [Syntax:]
13 compute ID group-ID temp/region region-ID :pre
15 ID, group-ID are documented in "compute"_compute.html command
16 temp/region = style name of this compute command
17 region-ID = ID of region to use for choosing atoms :ul
19 [Examples:]
21 compute mine flow temp/region boundary :pre
23 [Description:]
25 Define a computation that calculates the temperature of a group of
26 atoms in a geometric region.  This can be useful for thermostatting
27 one portion of the simulation box.  E.g. a McDLT simulation where one
28 side is cooled, and the other side is heated.  A compute of this style
29 can be used by any command that computes a temperature,
30 e.g. "thermo_modify"_thermo_modify.html, "fix
31 temp/rescale"_fix_temp_rescale.html, etc.
33 Note that a {region}-style temperature can be used to thermostat with
34 "fix temp/rescale"_fix_temp_rescale.html or "fix
35 langevin"_fix_langevin.html, but should probably not be used with
36 Nose/Hoover style fixes ("fix nvt"_fix_nh.html, "fix
37 npt"_fix_nh.html, or "fix nph"_fix_nh.html), if the
38 degrees-of-freedom included in the computed T varies with time.
40 The temperature is calculated by the formula KE = dim/2 N k T, where
41 KE = total kinetic energy of the group of atoms (sum of 1/2 m v^2),
42 dim = 2 or 3 = dimensionality of the simulation, N = number of atoms
43 in both the group and region, k = Boltzmann constant, and T =
44 temperature.
46 A kinetic energy tensor, stored as a 6-element vector, is also
47 calculated by this compute for use in the computation of a pressure
48 tensor.  The formula for the components of the tensor is the same as
49 the above formula, except that v^2 is replaced by vx*vy for the xy
50 component, etc.  The 6 components of the vector are ordered xx, yy,
51 zz, xy, xz, yz.
53 The number of atoms contributing to the temperature is calculated each
54 time the temperature is evaluated since it is assumed atoms can
55 enter/leave the region.  Thus there is no need to use the {dynamic}
56 option of the "compute_modify"_compute_modify.html command for this
57 compute style.
59 The removal of atoms outside the region by this fix is essentially
60 computing the temperature after a "bias" has been removed, which in
61 this case is the velocity of any atoms outside the region.  If this
62 compute is used with a fix command that performs thermostatting then
63 this bias will be subtracted from each atom, thermostatting of the
64 remaining thermal velocity will be performed, and the bias will be
65 added back in.  Thermostatting fixes that work in this way include
66 "fix nvt"_fix_nh.html, "fix temp/rescale"_fix_temp_rescale.html, "fix
67 temp/berendsen"_fix_temp_berendsen.html, and "fix
68 langevin"_fix_langevin.html.  This means that when this compute
69 is used to calculate the temperature for any of the thermostatting
70 fixes via the "fix modify temp"_fix_modify.html command, the thermostat
71 will operate only on atoms that are currently in the geometric
72 region.
74 Unlike other compute styles that calculate temperature, this compute
75 does not subtract out degrees-of-freedom due to fixes that constrain
76 motion, such as "fix shake"_fix_shake.html and "fix
77 rigid"_fix_rigid.html.  This is because those degrees of freedom
78 (e.g. a constrained bond) could apply to sets of atoms that straddle
79 the region boundary, and hence the concept is somewhat ill-defined.
80 If needed the number of subtracted degrees-of-freedom can be set
81 explicitly using the {extra} option of the
82 "compute_modify"_compute_modify.html command.
84 See "this howto section"_Section_howto.html#howto_16 of the manual for
85 a discussion of different ways to compute temperature and perform
86 thermostatting.
88 [Output info:]
90 This compute calculates a global scalar (the temperature) and a global
91 vector of length 6 (KE tensor), which can be accessed by indices 1-6.
92 These values can be used by any command that uses global scalar or
93 vector values from a compute as input.  See "this
94 section"_Section_howto.html#howto_15 for an overview of LAMMPS output
95 options.
97 The scalar value calculated by this compute is "intensive".  The
98 vector values are "extensive".
100 The scalar value will be in temperature "units"_units.html.  The
101 vector values will be in energy "units"_units.html.
103 [Restrictions:] none
105 [Related commands:]
107 "compute temp"_compute_temp.html, "compute
108 pressure"_compute_pressure.html
110 [Default:] none