IAS-Astrophysics / athenak

Performance-portable version of the Athena++ astrophysical AMR-MHD code using Kokkos.
BSD 3-Clause "New" or "Revised" License
36 stars 26 forks source link

Time dependence and AMR for ADM #610

Open jfields7 opened 1 month ago

jfields7 commented 1 month ago

This merge request adds a new function pointer, SetADMVariables, to the ADM class. By default it uses ADM::SetADMVariablesToKerrSchild, which uses the existing Kerr-Schild infrastructure. By setting coord/minkowski = true in the parameter file, this reverts to flat Minkowski space as it would for anything else using the Kerr-Schild functions. This has the added benefit that many of the shared pgens using Minkowski or Kerr-Schild coordinates are cleaned up and replaced with a single call to padm->SetADMVariables() instead.

This API is intended to fix #600. When AMR is enabled, SetADMVariables is called at the end of MeshRefinement::RedistAndRefineMeshBlocks, which means that the ADM metric will be completely defined everywhere on the new grid, allowing AMR evolution with DynGRMHD without needing to enable Z4c as well. Other metrics can be defined by pointing SetADMVariables to a different function; it should be a void function that takes the MeshBlockPack as a single argument.

An additional task has been added to the DynGRMHD task list to allow for dynamical ADM evolution, and examples are contained in an extension to the blast pgen with an FLRW metric and the new dynbbh pgen, which superposes two Kerr-Schild black holes and moves them along a circular orbit. Dynamical evolution in the task list can be enabled with adm/is_dynamic = true.

Draft to-do list: