lammps/doc/velocity.txt

161 lines
6.8 KiB
Plaintext
Raw Normal View History

"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
velocity command :h3
[Syntax:]
velocity group-ID style args keyword value ... :pre
group-ID = ID of group of atoms whose velocity will be changed :ulb,l
style = {create} or {set} or {scale} or {ramp} or {zero} :l
{create} args = temp seed
temp = temperature value (temperature units)
seed = random # seed (8 digits or less)
{set} args = vx vy vz
vx,vy,vz = velocity value or NULL (velocity units)
{scale} args = temp
temp = temperature value (temperature units)
{ramp} args = vdim vlo vhi dim clo chi
vdim = {vx} or {vy} or {vz}
vlo,vhi = lower and upper velocity value (velocity units)
dim = {x} or {y} or {z}
clo,chi = lower and upper coordinate bound (distance units)
{zero} args = {linear} or {angular}
{linear} = zero the linear momentum
{angular} = zero the angular momentum :pre
zero or more keyword/value pairs may be appended to the args :l
keyword = {dist} or {sum} or {mom} or {rot} or {temp} or {loop} or {units} :l
{dist} value = {uniform} or {gaussian}
{sum} value = {no} or {yes}
{mom} value = {no} or {yes}
{rot} value = {no} or {yes}
{temp} value = temperature ID
{loop} value = {all} or {local} or {geom}
{units} value = {box} or {lattice} :pre
:ule
[Examples:]
velocity all create 300.0 4928459 rot yes dist gaussian
velocity border set NULL 4.0 3.0 sum yes units box
velocity flow scale 300.0
velocity flow ramp lattice vx 0.0 5.0 y 5 20 temp mytemp
velocity all zero linear :pre
[Description:]
Set or change the velocities of a group of atoms in one of several
styles. For each style, there are required arguments and optional
keyword/value parameters. Not all options are used by each style.
Each option has a default as listed below.
The {create} style generates an ensemble of velocities using a random
number generator with the specified seed as the specified temperature.
The {set} style sets the velocities of all atoms in the group to the
specified values. If any component is specified as NULL, then it is
not set.
The {scale} style computes the current temperature of the group of
atoms and then rescales the velocities to the specified temperature.
The {ramp} style is similar to that used by the
"temperature"_temperature.html ramp command. Velocities ramped
uniformly from vlo to vhi are applied to dimension vx, or vy, or vz.
The value assigned to a particular atom depends on its relative
coordinate value (in dim) from clo to chi. For the example above, an
atom with y-coordinate of 10 (1/4 of the way from 5 to 20), would be
assigned a x-velocity of 1.25 (1/4 of the way from 0.0 to 5.0). Atoms
outside the coordinate bounds (less than 5 or greater than 20 in this
case), are assigned velocities equal to vlo or vhi (0.0 or 5.0 in this
case).
The {zero} style adjusts the velocities of the group of atoms so that
the aggregate linear or angular momentum is zero. No other changes
are made to the velocities of the atoms.
All temperatures specified in the velocity command are in temperature
units; see the "units"_units.html command. The units of velocities and
coordinates depend on whether the {units} keyword is set to {box} or
{lattice}, as discussed below.
The keyword/value option pairs are used in the following ways by the
various styles.
The {dist} option is used by {create}. The ensemble of generated
velocities can be a {uniform} distribution from some minimum to
maximum value, scaled to produce the requested temperature. Or it can
be a {gaussian} distribution with a mean of 0.0 and a sigma scaled to
produce the requested temperature.
The {sum} option is used by all styles, except {zero}. The new
velocities will be added to the existing ones if sum = yes, or will
replace them if sum = no.
The {mom} and {rot} options are used by {create}. If mom = yes, the
linear momentum of the newly created ensemble of velocities is zeroed;
if rot = yes, the angular momentum is zeroed.
The {temp} option is used by {create} and {scale} to specify a
user-defined way of computing temperature. If this option is not
used, {create} and {scale} compute temperature with the style "full"
for the group of atoms whose velocity is being altered. See the
"temperature"_temperature.html command for details. If the computed
temperature should have degrees-of-freedom removed due to fix
constraints (e.g. SHAKE or rigid-body constraints), then the
appropriate fix command must be specified before the velocity command
is issued.
The {loop} option is used by {create}. If loop = all, then each
processor loops over all atoms in the simulation to create velocities,
but only stores velocities for atoms it owns. This can be a slow loop
for a large simulation. It will produce the same set of velocities,
independent of the number of processors, if atoms were read from a
data file. It will not produce such independent velocities if atoms
were created using the "create_atoms"_create_atoms.html command. If
loop = local, then each processor loops over only its atoms to produce
velocities. The random number seed is adjusted to give a different
set of velocities on each processor. This is a fast loop, but will
always produce different sets of velocities when a simulation is run
on a different number of processors. If loop = geom, then each
processor loops over only its atoms. For each atom a unique random
number seed is created, based on the atom's xyz coordinates. A
velocity is generated using that seed. This is a fast loop and will
always give the same set of velocities, independent of how many
processors are used. However, the generated velocities may be more
correlated than if the {all} or {local} options are used. Note that
the {loop geom} option will not necessarily assign identical
velocities for two simulations run on different machines. This is
because the computations based on xyz coordinates are sensitive to
tiny differences in the double-precision value for a coordinate as
stored on a particular machine.
The {units} option is used by {set} and {ramp}. If units = box,
the velocities and coordinates specified in the velocity command are
in the standard units described by the "units"_units.html command
(e.g. Angstroms/fmsec for real units). If units = lattice, velocities
are in units of lattice spacings per time (e.g. spacings/fmsec) and
coordinates are in lattice spacings. The "lattice"_lattice.html
command must have been previously used to define the lattice spacing.
For all styles, no atoms are assigned z-component velocities if the
simulation is 2d; see the "dimension"_dimension.html command.
[Restrictions:] none
[Related commands:]
"fix shake"_fix_shake.html, "lattice"_lattice.html
[Default:]
The option defaults are dist = uniform, sum = no, mom = yes, rot = no,
temp = full style on group-ID, loop = all, and units = lattice.