Change SMALL_NUMBER to 10^-4 in the HLLD-series Riemann solvers #457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisite checklist
Description
The SMALL_NUMBER constant was used to detect degeneracy conditions in the HLLD-series Riemann solvers (HLLD, LHLLD, and isothermal HLLD). The previous value 10^-8 was too small and failed in some situations with strong magnetic fields. This PR changes this number to 10^-4, which is more robust.
Note that the number in HLLD and LHLLD are used for comparing variables with the pressure dimension, while in the isothermal HLLD it is for comparing variables with the velocity dimension. Therefore, a different value may be more optimal for the isothermal HLLD solver.
Testing and validation
A slow-shock with perturbation. The top panel is the original implementation and the bottom is the new one. The unphysical explosions in the original are fixed with this change.