Closed JunoRavin closed 1 month ago
I'm recording this comment here regarding a conversation @JunoRavin and I just had: I think it would be interesting to see (if only as an error quantification scheme, e.g. in a unit test or something) what the timelike components of the bulk four-velocity look like, when computed from the spatial components that are now being used in the LTE moment and correction routines. As far as I can tell from an initial glance, that seems like the primary thing that might potentially go wrong (even though I understand that it's already far more stable than it used to be) with the algorithm as described.
Design review merged with https://github.com/ammarhakim/gkylzero/pull/429
This design review encompasses the two key improvements contained in the branch: https://github.com/ammarhakim/gkylzero/tree/dg_10m_sr_refactor
I have verified that with this construction our scheme is now energy conserving using the relativistic two-stream instability, and we obtain third order accuracy in the convergence of the energy due to the SSP RK3 method employed for time-stepping. See attached figure from the 1x1v regression test.
To solve this issue, I have changed the relativistic solver to utilize the spatial component of the bulk four-velocity in the LTE moment calculator and correction algorithm. The spatial component of the bulk four-velocity is guaranteed to be well behaved as it does not have to be bounded from above, and computing the needed Lorentz boost factor from this quantity is also guaranteed to be positive definite. To achieve this refactor the steps are now:
Utilize this relativistic bulk four-velocity to obtain needed quantities for the pressure computation and LTE distribution, e.g., GammaV = sqrt(1 + |u_i|^2). Note that the pressure velocity moment is now modified to
gamma GammaV^2 - 2 GammaV (u_i . p) + 1/gamma ((u_i . p)^2 - 1)
where u_i is the four-velocity GammaV*V_drift_i, p is the particle velocity, and gamma = sqrt(1 + p^2) is the particle Lorentz boost factor.
I have also rearranged things such that the SR moment calculator does not take a significant number of auxiliary variables anymore, only gamma (since you only ever need gamma or you compute the derivative of gamma inside the kernel) and instead moved the pressure computation to the "sr_vars" updater (https://github.com/ammarhakim/gkylzero/blob/dg_10m_sr_refactor/zero/dg_calc_sr_vars.c). This "sr_vars" updater is principally used by the LTE Moments routine to get the rest-frame density and rest-frame pressure, but it also provides the necessary routines for getting the initial continuous projections of gamma and 1/gamma.
This new formulation now can run the Vlasov SR BGK Sod Shock at higher resolution and has further generalized the LTE moments to be computable in 2x and 3x simulations.
SR_Vlasov_Notes.pdf![Figure_2](https://github.com/ammarhakim/gkylzero/assets/7997308/6caf8c6a-cb16-4989-8c82-f95c76eb897c)