Select a random atom kinetic energy of 10 keV in a random direction

Dir sir,

I am doing cascade overlap in SiC using LAMMPS(1 July 2012). I need to give a random Si atom kinetic energy of 10 keV in a random direction. I have generate a random number using a random function to be the id of the selected atom. I have tried to scale the atom with a high temperature of 23.2e7 K corresponding to kinetic energy of 10 keV. An Error comes which is “ERROR: Attempting to rescale a 0.0 temperature (velocity.cpp:642)”.
My question is how can i realise the object of ‘Select a random atom kinetic energy of 10 keV in a random direction’ using LAMMPS. Any suggestions? Thanks a lot.

Here is an input script of my test:

units metal #sets units to ‘metal’ units -distance Angstrom time ps
dimension 3
boundary p p p #periodic BCs on x,y,z plane faces
atom_style atomic
neighbor 1.0 bin #sets maximum neighbor search radius to cutoff+value, using bin-sort algorithm

#check if neighbor list should be rebuilt every 5 steps
neigh_modify delay 5 check yes

#Creat geometry using internal stuff
#use diamond lattice with an 8 atoms basis to construct 3C-SiC structure
lattice diamond 4.359
region box block 0 10 0 10 0 50
create_box 2 box
create_atoms 2 box basis 1 2 basis 2 2 basis 3 2 basis 4 2 basis 5 1 basis 6 1 basis 7 1 basis 8 1 #create atoms

mass 1 12.0 #type 1 = C
mass 2 28.4 #type 2 = Si

variable i loop 2 #test use
label loopa

variable randomN equal round(random(0,40000,2987659))
variable randomPKAid equal round(random(0,40000,{randomN})) group randomPKA id {randomPKAid}

velocity randomPKA scale 23.2e7

#the next loop
clear
next i
jump SELF loopa

Of course it can. Why not just use velocity create? The doc page “The scale style computes the current temperature of the group of atoms and then rescales the velocities to the specified temperature.”, since you have zero initial temperature, the command can not rescale a 0 temperature.

Ray

And you can use equal-style variables for
the values of the velocity create or velocity
set command, and variables can use
random numbers via the random() function
explained on the variable doc page.

Steve