Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct Maxwell-Boltzmann velocity distribution in reaction ensemble #2377

Merged
merged 7 commits into from
Nov 30, 2018
6 changes: 3 additions & 3 deletions src/core/reaction_ensemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,9 @@ int ReactionAlgorithm::create_particle(int desired_type) {
// for components
double vel[3];
// we use mass=1 for all particles, think about adapting this
vel[0] = std::pow(2 * PI * temperature, -3.0 / 2.0) * gaussian_random();
vel[1] = std::pow(2 * PI * temperature, -3.0 / 2.0) * gaussian_random();
vel[2] = std::pow(2 * PI * temperature, -3.0 / 2.0) * gaussian_random();
vel[0] = std::sqrt(temperature) * gaussian_random();
thepith marked this conversation as resolved.
Show resolved Hide resolved
vel[1] = std::sqrt(temperature) * gaussian_random();
vel[2] = std::sqrt(temperature) * gaussian_random();
#ifdef ELECTROSTATICS
double charge = charges_of_types[desired_type];
#endif
Expand Down