Some mathematical question about velocity command

Hi everyone,

i use velocity command in my script and set the gaussian parameter as follows.

velocity all create 700.0 902144 dist gaussian
  1. my question is, does initial velocity probability density function obey the following maxwell-boltzmann distribution?
f(v) = \frac{1}{\sqrt{2 \pi} \sqrt{\frac{kT}{m}}} \exp{(- \frac{v^2}{2 \frac{kT}{m}})}

in other words, v \sim Normal(0, \frac{kT}{m}). I used to try to understand source code about velocity command in lammps, but i was unable to do it at last. I want to know what the initial velocity of each atom is derived from.

  1. another question is, what’s rmass variable meaning? the rmass variable has confused me for a long time.

I would appreciate it if you reply to me.

yours sincerely,
clain

No. The documentation is quite clear about this:

The dist keyword is used by create. The ensemble of generated velocities can be a uniform distribution from some minimum to maximum value, scaled to produce the requested temperature. Or it can be a gaussian distribution with a mean of 0.0 and a sigma scaled to produce the requested temperature.

There is no mention of rmass in the documentation of the velocity command. …and there is no mention of “rmass” in the variable command documentation either. If you want help, you first have to ask questions that provide the necessary context so that people that cannot read your mind know what you are talking about.

  1. it’s difficult for me to understand scaled to produce the requested temperature of gaussian distribution. is it the process that \epsilon is generated from Normal(0, 1) at first, then velocity = sigma * \epsilon?

  2. i would try to be clear for my question 2. row 319 and 320 of lammps/src/velocity.cpp file in lammps codes. what is the different bewteen rmass[i] and mass[type[i]]?

thank you for answer my questions, Mr.akohlmey

This is a very simple process. LAMMPS first creates a velocity distribution based on the various requirements, rules and constraints, then it computes which temperature that would correspond to, and then calls the “rescale()” function to scale all assigned velocities so that instead of the computed temperature they correspond to the desired temperature.

For most atom styles the mass of an atom is determined by the atom type, i.e. mass[type[i]]. For granular particles, however, and a few other cases (including the use of fix property/atom to model isotopes) the masses are per-atom. That is where the “rmass” property is used. Granular media (which is a model for macroscopic objects) can be poly-disperse where you have the same material (i.e. the same density), but different radii and thus different masses, i.e. rmass[i]. The latter usually takes precedence, if both are defined.