1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
5 :link(lc,Section_commands.html#comm)
9 compute vcm/chunk command :h3
13 compute ID group-ID vcm/chunk chunkID :pre
15 ID, group-ID are documented in "compute"_compute.html command
16 vcm/chunk = style name of this compute command
17 chunkID = ID of "compute chunk/atom"_compute_chunk_atom.html command :ul
21 compute 1 fluid vcm/chunk molchunk :pre
25 Define a computation that calculates the center-of-mass velocity for
26 multiple chunks of atoms.
28 In LAMMPS, chunks are collections of atoms defined by a "compute
29 chunk/atom"_compute_chunk_atom.html command, which assigns each atom
30 to a single chunk (or no chunk). The ID for this command is specified
31 as chunkID. For example, a single chunk could be the atoms in a
32 molecule or atoms in a spatial bin. See the "compute
33 chunk/atom"_compute_chunk_atom.html doc page and "Section
34 6.23"_Section_howto.html#howto_23 for details of how chunks can be
35 defined and examples of how they can be used to measure properties of
38 This compute calculates the x,y,z components of the center-of-mass
39 velocity for each chunk. This is done by summing mass*velocity for
40 each atom in the chunk and dividing the sum by the total mass of the
43 Note that only atoms in the specified group contribute to the
44 calculation. The "compute chunk/atom"_compute_chunk_atom.html command
45 defines its own group; atoms will have a chunk ID = 0 if they are not
46 in that group, signifying they are not assigned to a chunk, and will
47 thus also not contribute to this calculation. You can specify the
48 "all" group for this command if you simply want to include atoms with
51 The simplest way to output the results of the compute vcm/chunk
52 calculation to a file is to use the "fix ave/time"_fix_ave_time.html
55 compute cc1 all chunk/atom molecule
56 compute myChunk all vcm/chunk cc1
57 fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
61 This compute calculates a global array where the number of rows = the
62 number of chunks {Nchunk} as calculated by the specified "compute
63 chunk/atom"_compute_chunk_atom.html command. The number of columns =
64 3 for the x,y,z center-of-mass velocity coordinates of each chunk.
65 These values can be accessed by any command that uses global array
66 values from a compute as input. See "Section
67 6.15"_Section_howto.html#howto_15 for an overview of LAMMPS output
70 The array values are "intensive". The array values will be in
71 velocity "units"_units.html.
75 [Related commands:] none