git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@16053 f3b2605a-c512-4ea7-a41b...
[lammps.git] / doc / src / compute_temp_body.txt
blob04b707bcce2d770aa10c52a042c829fcbfbecdae
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/body command :h3
11 [Syntax:]
13 compute ID group-ID temp/body keyword value ... :pre
15 ID, group-ID are documented in "compute"_compute.html command :ulb,l
16 temp/body = style name of this compute command :l
17 zero or more keyword/value pairs may be appended :l
18 keyword = {bias} or {dof} :l
19   {bias} value = bias-ID
20     bias-ID = ID of a temperature compute that removes a velocity bias
21   {dof} value = {all} or {rotate}
22     all = compute temperature of translational and rotational degrees of freedom
23     rotate = compute temperature of just rotational degrees of freedom :pre
24 :ule
26 [Examples:]
28 compute 1 all temp/body
29 compute myTemp mobile temp/body bias tempCOM
30 compute myTemp mobile temp/body dof rotate :pre
32 [Description:]
34 Define a computation that calculates the temperature of a group of
35 body particles, including a contribution from both their
36 translational and rotational kinetic energy.  This differs from the
37 usual "compute temp"_compute_temp.html command, which assumes point
38 particles with only translational kinetic energy.
40 Only body particles can be included in the group.  For 3d particles,
41 each has 6 degrees of freedom (3 translational, 3 rotational).  For 2d
42 body particles, each has 3 degrees of freedom (2 translational, 1
43 rotational).
45 NOTE: This choice for degrees of freedom (dof) assumes that all body
46 particles in your model will freely rotate, sampling all their
47 rotational dof.  It is possible to use a combination of interaction
48 potentials and fixes that induce no torque or otherwise constrain some
49 of all of your particles so that this is not the case.  Then there are
50 less dof and you should use the "compute_modify
51 extra"_compute_modify.html command to adjust the dof accordingly.
53 The translational kinetic energy is computed the same as is described
54 by the "compute temp"_compute_temp.html command.  The rotational
55 kinetic energy is computed as 1/2 I w^2, where I is the inertia tensor
56 for the aspherical particle and w is its angular velocity, which is
57 computed from its angular momentum.
59 A kinetic energy tensor, stored as a 6-element vector, is also
60 calculated by this compute.  The formula for the components of the
61 tensor is the same as the above formula, except that v^2 and w^2 are
62 replaced by vx*vy and wx*wy for the xy component, and the appropriate
63 elements of the inertia tensor are used.  The 6 components of the
64 vector are ordered xx, yy, zz, xy, xz, yz.
66 The number of atoms contributing to the temperature is assumed to be
67 constant for the duration of the run; use the {dynamic} option of the
68 "compute_modify"_compute_modify.html command if this is not the case.
70 This compute subtracts out translational degrees-of-freedom due to
71 fixes that constrain molecular motion, such as "fix
72 shake"_fix_shake.html and "fix rigid"_fix_rigid.html.  This means the
73 temperature of groups of atoms that include these constraints will be
74 computed correctly.  If needed, the subtracted degrees-of-freedom can
75 be altered using the {extra} option of the
76 "compute_modify"_compute_modify.html command.
78 See "this howto section"_Section_howto.html#howto_16 of the manual for
79 a discussion of different ways to compute temperature and perform
80 thermostatting.
82 :line
84 The keyword/value option pairs are used in the following ways.
86 For the {bias} keyword, {bias-ID} refers to the ID of a temperature
87 compute that removes a "bias" velocity from each atom.  This allows
88 compute temp/sphere to compute its thermal temperature after the
89 translational kinetic energy components have been altered in a
90 prescribed way, e.g. to remove a flow velocity profile.  Thermostats
91 that use this compute will work with this bias term.  See the doc
92 pages for individual computes that calculate a temperature and the doc
93 pages for fixes that perform thermostatting for more details.
95 For the {dof} keyword, a setting of {all} calculates a temperature
96 that includes both translational and rotational degrees of freedom.  A
97 setting of {rotate} calculates a temperature that includes only
98 rotational degrees of freedom.
100 :line
102 [Output info:]
104 This compute calculates a global scalar (the temperature) and a global
105 vector of length 6 (KE tensor), which can be accessed by indices 1-6.
106 These values can be used by any command that uses global scalar or
107 vector values from a compute as input.  See "this
108 section"_Section_howto.html#howto_15 for an overview of LAMMPS output
109 options.
111 The scalar value calculated by this compute is "intensive".  The
112 vector values are "extensive".
114 The scalar value will be in temperature "units"_units.html.  The
115 vector values will be in energy "units"_units.html.
117 [Restrictions:]
119 This compute is part of the BODY package.  It is only enabled if
120 LAMMPS was built with that package.  See the "Making
121 LAMMPS"_Section_start.html#start_3 section for more info.
123 This compute requires that atoms store angular momementum and a
124 quaternion as defined by the "atom_style body"_atom_style.html
125 command.
127 [Related commands:]
129 "compute temp"_compute_temp.html
131 [Default:] none