How to set the gas molecular velocity from Maxwell-Boltzman distribution

Dear Lammps users,
I want to add gas molecular above a substrate. The substrate atom velocities has been scaled to 900K by using fix nve and langevin method. Then I need to add new gas moleculars above it. How could I set the gas molecualr velocities from Maxwell-Boltzman distribution according to the substrate temperature?

Xi’an Jiaotong University

There have been several Qs lately about depositing

atoms/molecules. Not sure if this one was already
answered. The fix deposit command lets you deposit
atoms or molecules. You can set the x,y,z velocities
to randomized values within a range. You need vz to
be negative, i.e, down into the substrate to effectively
deposit. You can’t set a MB distribution per se, but
randomized should be good enough. What should happen
is that the velocity components of the atom/molecule
will be rapidly re-distributed when it interacts with

the surface.