Skip to content

Commit

Permalink
use Maxwell-Boltzmann velocity distribution in reaction ensemble
Browse files Browse the repository at this point in the history
  • Loading branch information
thepith committed Nov 16, 2018
1 parent c5ce8a7 commit 3141151
Showing 1 changed file with 3 additions and 3 deletions.
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();
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

0 comments on commit 3141151

Please sign in to comment.