Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at core GR infrastructure #354

Merged
merged 40 commits into from
May 6, 2024
Merged

First pass at core GR infrastructure #354

merged 40 commits into from
May 6, 2024

Conversation

JonathanGorard
Copy link
Collaborator

This PR adds prototype support for general relativistic/curved spacetime hydrodynamics to the moment app (in the form of the wv_gr_euler equation object), along with core infrastructural support for broader numerical relativity functionality in Gkeyll. It introduces the gr_spacetime object, with two specific instances (gr_minkowski, for special relativity, and gr_blackhole, for both static and spinning black holes in Kerr-Schild coordinates) implemented for the time being. It also adds basic unit tests for flat and curved spacetime functionality, and regression tests for relativistic hydrodynamics in both the SR and GR limits (including full Bondi-Hoyle-Lyttleton accretion tests onto both static and spinning black holes). Although all current test cases use stationary spacetime metrics (either Minkowski or Kerr-Schild), the underlying infrastructure has been designed to support fully dynamic spacetimes, as evolved through the Bona-Massó equations or their equivalent - to this end, the wv_gr_equation object actually consists of 29 equations, with the usual 5 for the fluid variables, 18 for the (spatial) metric and inverse (spatial) metric components, 1 for the (spatial) metric determinant, 1 for the ADM lapse function, 3 for the ADM shift vector components, and 1 for the excision boundary condition. For now, only the first 5 are actually evolved. Currently, the gauge conditions on the lapse and shift parameters are enforced as part of the gr_spacetime object, but going forward (and especially as we transition to dynamic spacetimes) we will likely want to solve the constraint equations via the moment app directly, and so we have designed the wv_gr_euler object with this in mind.

This functionality should still be considered highly experimental, and, in particular, the fluid solver currently supports only Lax fluxes (with a partially-implemented general relativistic Roe solver that currently does not work). No one should (yet) be basing real research results on this code! Nevertheless, I would like to merge this PR sooner rather than later, for several reasons:

  • This new functionality does not/should not conflict with any aspect of the Gkeyll codebase, and so is perfectly safe to merge.
  • We (@JunoRavin and I) would ideally like to begin prototyping a new design for the handling of sources in the moment app, and having the GR hydrodynamics code already merged into main will make it much easier to do this.
  • I would also like to begin gradually deprecating/removing the existing SR hydrodynamics code in the moment app, migrating those features and tests over to the new GR hydrodynamics system in the process. Of course this will not happen until the Roe solver is fully robustified and validated.
  • The utility functions in the gr_spacetime object for calculating Christoffel symbols, extrinsic curvature tensors, etc. may prove useful in other parts of the Gkeyll code (e.g. for the work that @johnson452 is doing on curved spacetime kinetics), and these have been accordingly validated via reasonably extensive unit tests for both flat and black hole spacetimes.
  • I would gradually like to repurpose the gr-prototyping branch for forthcoming work on dynamic spacetime functionality and other, related things.

… wave problem now work! (With Lax fluxes only, for now.)
…stic shock test now runs with gkyl_gr_spacetime set to Minkowski. Still need to update other tests, add excision boundary conditions, and update wave speed estimation algorithm.
…hock, strong relativistic blast and 2D quadrants tests. All checks pass, and all tests are correct in the SR/flat spacetime limit. Still need to update wave-speed estimator using GRHD eigenvalues.
…with SR without introducing shock heating or any spurious waves.
…ponents, in preparation for implementation of the full GRHD eigensystem.
…ess stable that the trivial SR wave-speed estimator. I'll probably add a fallback to that fast SR estimator when the code detects (locally) flat spacetime at some point...
… features still not implemented (correctly), including extrinsic curvature, derivatives, etc., and several things are still fundamentally wrong with the output. But the regression test is at least taking time-steps...
…al bugfixes. Ring accretion onto static (Schwarzschild) and spinning (Kerr) black hole now stable, and working as expected. Code is still horrendous.
…detected. Also made SR time-stepper more stable.
…e-Lyttleton accretion tests for both the Schwarzschild and Kerr cases.
…ives correct output at high resolution, but of course with Lax fluxes only it looks diffusive as... a very diffusive thing.
…is shaping up to be more complicated than anticipated, so I'm going to come back to it later.
…ll. Like, every simulation crashes after a single time-step. But it compiles, and runs for one step, and structurally represents more-or-less what I think the GR Roe solver should look like.
…er is still completely buggered, but at least flat spacetime tests now take time-steps...
…, although wave-speeds (and qualitative behavior) remain incorrect.
…d support for calculation of extrinsic curvature tensors in black hole spacetimes.
…holes, and fixed minor error in SR Roe solver.
…unit test (confirming metric compatibility of the covariant derivative), and fixed segfault issue in gr_blackhole.c
…und through Valgrinding. Also refactored and finalized flat spacetime regression tests.
…neral memory leak when initializing relativistic test data.
@JonathanGorard JonathanGorard linked an issue Apr 26, 2024 that may be closed by this pull request
…servative->primitive variable conversion in both flat and curved spacetimes, quantifying robustness in the presence of near-speed-of-light fluid velocities and low fluid pressures).
…ions to gr_spacetime, and updated corresponding unit test. I intend to factor out the finite-difference code for computing these quantities from the gr_blackhole source file into a separate API shortly, to avoid ludicrous code duplication (and to facilitate the automatic generation of code for e.g. black hole spacetimes from GkylCAS). Also should need to write some tensor calculus utility functions, if these features are to be usable...
…antities (Christoffels, curvature tensors, scalar invariants, etc.) from gr_blackhole.c to a separate container for helper functions.
…ial future work on gravitational wave extraction) for both Minkowski and black hole spacetimes, plus updated unit test to confirm that (a) Minkowski space is conformally-flat; and (b) in black hole spacetimes, the Riemann and Weyl tensors are equal.
@ammarhakim ammarhakim merged commit cd5cb28 into main May 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement curved spacetime hydrodynamics
2 participants