set_velocity command
Warning
GPU support for this command has not been tested and may not work as expected.Syntax
set_velocity id command-ID keywords values ...
id = obligatory keyword
command-ID = user-assigned name for the command call (used for referencing this command in the variable command)
at least one of the following keywords must be appended: velocity or omega
velocity vector = (vx, vy, vz) vx, vy, vz = x-, y- and z-component of velocity (velocity units), or * if it must not be set omega vector = (omegax, omegay, omegaz) omegax, omegay, omegaz = x-, y- and z-component of angular velocity (1/time units), or * if it must not be set
one or more optional keyword/value pairs can be appended
optional keyword = particle_group or region or material
particle_group value = group-ID group-ID = ID of the group of particles to apply this command to (default: all) region value = region-ID region-ID = ID of region atoms must be in to have their (angular) velocity set (default: whole domain) material value = optional keyword material_name = name of the material defined with the material_properties command (default: all materials)
Examples
set_velocity id my_vel1 velocity (*, 1, *) region my_region
set_velocity id my_vel2 particle_group my_group omega (v_ox, *, 1) material steel
set_velocity id my_vel3 omega (v_ox, *, 1) material steel
set_velocity id my_vel4 velocity (0, 7, 0) omega (0, 1, 2)
set_velocity id my_vel5 particle_group my_group velocity (0, 7, v_vz) omega (0, 1, 2)
set_velocity id my_vel6 velocity (0, *, ${vz}) material steel
Description
This command fixes one or more components of the (angular) velocity of particles contained in the particle_group (by default it is applied to all particles), a specific region and/or a specific material. The (angular) velocity must be provided as a vector, which can contain: numerical values, user defined variables, or * symbols (to indicate components that do not need to be set). The velocity and omega can be fixed in a single command.
If the optional particle_group keyword is used, the particle must also be in the specified group in order to have the (angular) velocity components to be set.
If the optional region keyword is used, the particle must also be in the specified geometric region in order to have the (angular) velocity components to be set.
If the optional material keyword is used, the particle must also be of the specified material in order to have the (angular) velocity components to be set.
Note that this command also sets the force/torque components on the particle in the specified directions to zero (except directions with a *), so that an additional integrator (such as nve/sphere) can be applied to the particles.
Restart, fix_modify, output, run start/stop
This command does not need to write data to binary restart files. None of the fix_modify options are relevant to this command. This command computes global (for all particles affected by this command) scalars of the force/torque components, used to push/rotate the particles in the desired direction. The equal-style variables can be used to access these scalar force/torque components, as shown in the example below. No parameter of this command can be used with the start/stop keywords of the run command.
variable fx equal id_my_vel4.fx
variable fy equal id_my_vel1.fy
variable fz equal id_my_vel6.fz
variable tx equal id_my_vel2.tx
variable ty equal id_my_vel4.ty
variable tz equal id_my_vel5.tz
Restrictions
This command needs to be placed in the input script before the first command which implements the initial_integrate() function. This is typically implemented by integrators, such as nve/sphere. If concave particles are applied, this command needs to be specified before the concave particle templates. The code will exit with an error if the placement is incorrect. When applied to multispheres, only the optional keyword type is permitted, group and region are not admissible.
Default
particle_group = all, region = whole simulation box, material = all materials