lanl / phoebus

Phifty One Ergs Blows Up A Star
BSD 3-Clause "New" or "Revised" License
46 stars 2 forks source link

Switch primitive velocity and add conservative energy option #54

Closed brryan closed 2 years ago

brryan commented 3 years ago

This PR switches primitive velocity variables from v^i = u^i/Gamma + beta^i/alpha to vp^i = u^i + Gamma beta^i / alpha. This latter definition, commonly used in GRMHD codes, has the advantage that it is valid in the range (-infinity, infinity), rather than ~(-1, 1).

I also add a compile-time option, PHOEBUS_VALENCIA=ON/OFF, to switch from the Valencia non-conservative energy equation to the covariant conservative energy equation, in the hope that the hydrostatic torus will behave better.

brryan commented 3 years ago

Thanks @Yurlungur for taking a look. Also since this is astrophysics, "what about B fields" which I will add before merge