OpenMPCD
Public Member Functions | List of all members
OpenMPCD::MaxwellBoltzmannDistribution Class Reference

Represents a Maxwell-Boltzmann distribution. More...

#include <MaxwellBoltzmannDistribution.hpp>

Public Member Functions

template<typename RNG >
FP getRandomMaxwell (const FP m, const FP kT, RNG &rng)
 Generates a random number drawn from the Maxwell-Boltzmann distribution. More...
 
template<typename RNG >
OpenMPCD::FP getRandomMaxwell (const FP m, const FP kT, RNG &rng)
 

Detailed Description

Represents a Maxwell-Boltzmann distribution.

Definition at line 16 of file MaxwellBoltzmannDistribution.hpp.

Member Function Documentation

◆ getRandomMaxwell()

template<typename RNG >
FP OpenMPCD::MaxwellBoltzmannDistribution::getRandomMaxwell ( const FP  m,
const FP  kT,
RNG rng 
)

Generates a random number drawn from the Maxwell-Boltzmann distribution.

The Maxwell-Boltzmann distribution is given by \( \left(v\right) = \left( \frac{m}{2\pi kT} \right)^{\frac{3}{2}} \cdot 4\pi v^2 \exp\left(- \frac{m v^2}{2 kT} \right) \)

Template Parameters
RNGThe type of the random number generator.
Parameters
[in]mThe mass parameter.
[in]kTThe Boltzmann constant times the temperature.
[in]rngThe random number generator to use.

The documentation for this class was generated from the following files: