initial velocity

Hi Dear lammps users
I have confused with the basic command of lammps.
For example in the following commands in the “flow” example of lammps:

Compute mobile flow temp
Velocity flow create 1.10 482748 temp mobile

As we know, the “velocity” command sets initial velocities in special temperature that is computed with “compute” command.
Now my question is this: for computing the temperature of system we need velocity according to kinetic energy…. so how can “compute” command generate temperature while the initial velocities have not produced yet?
Thanks for any discussion

Hi Dear lammps users
I have confused with the basic command of lammps.
For example in the following commands in the "flow" example of lammps:

Compute mobile flow temp
Velocity flow create 1.10 482748 temp mobile

As we know, the "velocity" command sets initial velocities in special temperature that is computed with "compute" command.

No, it does not.

Now my question is this: for computing the temperature of system we need velocity according to kinetic energy…. so how can "compute" command generate temperature while the initial velocities have not produced yet?

The velocity command just sets the velocities from random numbers
following a given distribution. All it needs to know for that are the
number of degrees of freedom and the atom masses. Please look up in
your MD textbook how temperature is being calculated in atomistic MD
simulations.

Axel

thanks a lot.
I have another question.
in this way, why the temperature computed with "compute" command was
used in"velocity command" via "temp" keyword? and what does it mean?
thanks
Elena

thanks a lot.
I have another question.
in this way, why the temperature computed with "compute" command was
used in"velocity command" via "temp" keyword? and what does it mean?

this is easiest found out by reading the source code.

as i wrote in my previous response, one needs to know
the number of degrees of freedom in order to compute
the (instantaneous) temperature and the velocity command
does this by *first* assigning random velocities according to
the selected distribution and then using the temperature
computed from this to scale the velocities to exactly
produce the desired temperature.

check out the Velocity::create() method in velocity.cpp
starting at line 149.

axel.