Skip to content

Conversation

@hsinhaoHHuang
Copy link
Contributor

@hsinhaoHHuang hsinhaoHHuang commented Dec 12, 2025

Issue

The variable par in Par_EquilibriumIC::Set_Velocity() is uninitialized if k loops to params.Cloud_MassProfNBin-1 without ever sum_mes>sum_rad in the for loop.

The resulting velocity of that particle will be polluted and become something unpredictable.
This may lead to extremely large particle velocity and extremely small time-steps.

Change

Assign a value to par when k==params.Cloud_MassProfNBin-1 in a similar way.

Note

Related Issue:

Related PR:

@hyschive hyschive added bugfix Fix bugs particle Particles labels Dec 14, 2025
@hyschive hyschive changed the title Fix the use of uninitialized variable in Par_EquilibriumIC [Bugfix] Fix the use of uninitialized variable in Par_EquilibriumIC Dec 14, 2025
@hyschive
Copy link
Contributor

@hsinhaoHHuang Thanks for the careful check and the bug fix!

@hyschive hyschive merged commit c4004fe into gamer-project:main Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix bugs particle Particles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants