sxs-collaboration / spectre

SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.
https://spectre-code.org
Other
161 stars 191 forks source link

HLL flux FPEs when all speeds are zero #1841

Open fmahebert opened 4 years ago

fmahebert commented 4 years ago

Bug reports:

Expected behavior:

HLL flux works generally.

Current behavior:

When all speeds are 0 the HLL computation FPE's, presumably on this line (Hll.hpp:176):

const DataVector one_over_cp_minus_cm =
    1.0 / (get(max_signal_speed) - get(min_signal_speed));

However, because the HLL flux also has factors of the speeds in the numerator, the 0-speed case should be handled to return (presumably) 0, rather than FPE.

For a concrete example of when this arises: when evolving the NewtonianEuler system in a vacuum region where density = velocity = energy = 0, and all characteristic speeds are 0.

nilsdeppe commented 2 years ago

Isn't the more fundamental issue here that the hydro approximation isn't valid in vacuum? You assume something like Avogadro's number of particles, which is just not true in vacuum.

fmahebert commented 2 years ago

I agree about the fundamental issue. Still, it might be nice for the code to fail more gracefully than by FPE...