initial velocity of inserted atoms using fix_deposit

Thank you.Ray.

I modified the temperature control method to fix_langevin command with time fix-NVE ensemble and set the velocity vz into -0.1~-0.5.

Still, I want insert oxygen atoms in the vacuum region (the region ID is “up”) above substrate with fix_deposit. But the keyword “vz” seems can only be set to a variable or a constant number. When I use the commands below to scale velocity of the inserted atoms inregion up:
if “${consumer}==0” then “fix 3 oxygen deposit 2 2 1 12345 region upadd near 1 vz -0.1 -0.5” &
"velocity up scale 900"
an error will occur: ERROR: Attempting to rescale a 0.0 temperature (…/velocity.cpp:663)
I do not understand this.

How can I set the initial velocities of the inserted oxygens satisfy the ambient temperature(my case is 900K)along the z direction ?

My input script:

1. Initialization

units real
dimension 3
boundary p p f
atom_style charge

2. Atom definition

lattice bcc 2.8700
region box block 0 11 0 11 0 27.875
create_box 2 box
create_atoms 1 box

region up block INF INF INF INF 19.2 INF
region down block INF INF INF INF INF 8.0
region substrate block INF INF INF INF 8.0 19.2
group up region up
group down region down
delete_atoms group up
delete_atoms group down
group substrate region substrate

3. Settings

pair_style reax/c NULL checkqeq yes
pair_coeff * * ffield.reax.Fe_O_C_H Fe O
mass 1 55.8450
mass 2 15.9994

neighbor 2 bin
neigh_modify every 1 delay 0 check yes

#=================relaxation==================

timestep 1

use the temperature of the substrate atoms as reference

group Fe type 1
group oxygen type 2

compute mtemp up temp
compute_modify mtemp dynamic yes

variable T equal 900
fix 1 substrate nve
fix 2 substrate langevin $T $T 100 587283
fix charge all qeq/reax 1 0.0 10.0 1e-6 reax/c

thermo 1

dump relax1 all custom 100 dump.Featom id type xs ys zs q

dump_modify relax1 pad 5

dump relax2 all image 100 image.*.png type type axes yes 0.8 0.02 view 80 -30 zoom 1.6 adiam 2
dump_modify relax2 pad 5
dump_modify relax2 acolor 1 blue
dump_modify relax2 backcolor white

run 1
reset_timestep 0

#=================end relaxation=================

#=================oxidation kinetics==================

variable Nsubtot equal count(all,substrate)
variable Naddtot equal count(oxygen)

region upadd block 0 11 0 11 24 25

fix 4 oxygen nve
fix ref oxygen wall/reflect zhi EDGE

variable consumer equal count(oxygen,up) #上半真空层内的氧原子数
thermo_style custom step atoms temp etotal press v_Nsubtot v_Naddtot v_consumer
thermo_modify temp mtemp

variable t loop 1000000
label loopt
if “${consumer}==0” then “fix 3 oxygen deposit 2 2 1 12345 region upadd near 1 vz -0.1 -0.5” &
“velocity up scale 900”

compute FeFerdf all rdf 100 1 1
fix FeFe all ave/time 100 1 100 c_FeFerdf file FeFerdf.txt mode vector
compute OOrdf all rdf 100 2 2
fix OO all ave/time 100 1 100 c_OOrdf file OOrdf.txt mode vector
compute FeOrdf all rdf 100 1 2
fix FeO all ave/time 100 1 100 c_FeOrdf file FeOrdf.txt mode vector

uncompute FeFerdf
unfix FeFe
uncompute OOrdf
unfix OO
uncompute FeOrdf
unfix FeO

dump 1 all custom 100 dump.atom id type xs ys zs q
dump 2 all image 100 image2.*.jpg type type axes yes 0.8 0.02 view 80 -30 zoom 1.6 adiam 1.8
dump_modify 2 pad 5
dump_modify 2 backcolor white
dump_modify 2 adiam 2 1.2
dump_modify 2 acolor 1 blue
dump_modify 2 acolor 2 red

dump 4 all movie 50 movie.mpg type type axes yes 0.8 0.02 view 80 -30 zoom 1.6 zoom 1.6 adiam 1.5
dump_modify 4 adiam 2 1.1
dump_modify 4 acolor 1 blue
dump_modify 4 acolor 2 red
dump_modify 4 pad 5
run 1

undump 1
undump 2
undump 4

next t
jump in.process loopt

write_restart restart.oxidation

Thank you.Ray.

I modified the temperature control method to fix_langevin command with time fix-NVE ensemble and set the velocity vz into -0.1~-0.5.

Still, I want insert oxygen atoms in the vacuum region (the region ID is “up”) above substrate with fix_deposit. But the keyword “vz” seems can only be set to a variable or a constant number. When I use the commands below to scale velocity of the inserted atoms inregion up:
if “${consumer}==0” then “fix 3 oxygen deposit 2 2 1 12345 region upadd near 1 vz -0.1 -0.5” &
“velocity up scale 900”
an error will occur: ERROR: Attempting to rescale a 0.0 temperature (…/velocity.cpp:663)
I do not understand this.

This is not a good way to deposit atoms/molecules. The conventional way to do this is to deposit every N steps where N steps will give you a reasonable relaxation time. See rich literature on this topic.

How can I set the initial velocities of the inserted oxygens satisfy the ambient temperature(my case is 900K)along the z direction ?

You can not have it both ways. The temperature of the incident atoms is directly related to their initial velocities by the equation KE = 3/2 k T = 1/2 m v^2. If you change their T to 900K, they lose their initial velocities.

Ray