-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix velocity assignment in CubicGridGenerator (and others) #377
Conversation
…ce old solution did not take mass into account
Thanks for looking into this bug, it's been a pain for a very long time! I can review in a few days, but a few initial thoughts:
|
Thank you for your review!
|
I am not super deep into this part of the code and just had the chance for a very rough look. |
Description
As described in issue #376, the CubicGridGenerator uses the initCubicGrid method which uses the getRandomVelocity method.
The latter method can only handle particles with mass=1 correctly. This is fixed with the present PR by using the EqualVelocityAssigner to get the random initial velocities.
In addition, the CubicGridGenerator removes the overall drift, which is very beneficial. Unfortunately, this is not done properly as the velocities need to be scaled afterwards again to match the desired temperature. This was also fixed in the present PR.
Resolved Issues
How Has This Been Tested?
explosion
)Further improvements (not part of the present PR)
In the future, it would be nice
initCubicGrid
from the particle container to the generator/helper class.