Velocity Command

Dear all,

I want to use velocity command after the system was reached to equilibrium. this is in order to give a velocity to a nanoparticle and throw it. but after equilibrium the velocity command not work. how to do it?

Thanks
Yasti

Dear all,

I want to use velocity command after the system was reached to equilibrium. this is in order to give a velocity to a nanoparticle and throw it. but after equilibrium the velocity command not work. how to do it?

Of course it works. But you have to use it correctly.

Axel

Thank you Axel,

I used in the second run the velocity command:

.

.
run 500
.
.
velocity cylinder2 set 0 -10 0 units box
dump dump_id1 all xyz 200 dump02-air.xyz
run 1000000

Apparently it is not matter whether there is velocity command or not.
and it not works, please find the attached file.

Thank you

water_collapse.lmp (6.18 KB)

sorry, also there is no change in kinetic energy with velocity command and without it.

Try writing a dump file before and after the velocity

command that includes particle velocities (e.g. dump custom).

Or if you know an atom ID in the affected group, do something

like this

print “Before (vy[100])" velocity ... print "After (vy[100])”

I think you will find that velocities were changed.

Steve

Dear Steve, thanks

I checked as you said, but i did not see any change in velocity!

Please help. please see my input file in previous file and attached dump file for after and before.

Thank you

dump.after (12.8 KB)

dump.after (12.8 KB)

Dear Yasti,

The problem is caused by the “fix rigid” command. If you add “unfix rigid” before setting velocities, they will be assigned properly. You have to use fix rigid once again after setting velocities to have the rigid body again. I don’t know if this is a bug or a feature. [:

Cheers,
Michal

1 Like

oh! You are right. thank you very very much :slight_smile:

Yasti

Dear Yasti,

The problem is caused by the "fix rigid" command. If you add "unfix rigid"
before setting velocities, they will be assigned properly. You have to use
fix rigid once again after setting velocities to have the rigid body again.
I don't know if this is a bug or a feature. [:

​well spotted. it is documented behavior, though, so you could call it a
feature. the documentation for fix rigid has several Warnings/IMPORTANT
NOTEs. here is the one relevant to this case:

The aggregate properties of each rigid body are calculated one time at the
start of the first simulation run after this fix is specified. The
properties include the position and velocity of the center-of-mass of the
body, its moments of inertia, and its angular momentum. This is done using
the properties of the constituent atoms of the body at that point in time
(or see the infile keyword option). Thereafter, changing properties of
individual atoms in the body will have no effect on a rigid body’s
dynamics, unless they effect the pair_style interactions that individual
particles are part of. For example, you might think you could displace the
atoms in a body or add a large velocity to each atom in a body to make it
move in a desired direction before a 2nd run is performed, using the set or
displace_atoms or velocity command. But these commands will not affect the
internal attributes of the body, and the position and velocity or
individual atoms in the body will be reset when time integration starts

​axel.​