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

WIP: Stop running unnecessary UtoP at boundaries #128

Open
wants to merge 4 commits into
base: stable
Choose a base branch
from

Conversation

bprather
Copy link
Contributor

I think that when using the kharma driver, and thus syncing conserved variables, two boundary-related bugs were stacking and cancelling in terms of effects, but slowing down the code:

  1. UtoP for GRMHD fluid variables was being run when boundaries were being applied, because the Packages code didn't select out the Inverter package from being run, only the GRMHD package (where variable inversion used to live).
  2. UtoP for fluid variables didn't respect the IndexDomain it was called with, instead always using the domain of physical zones (i.e. not domain boundary ghost zones).

So, (1) was causing up to several times too many calls to UtoP, but (2) meant that each call just did exactly the same thing as the original call before treating the boundary conditions, and recovered primitive vars in the physical zones all over again (but with a perfect guess, so at least it was quick?).

afaict, the boundaries were thus treated correctly: PtoU from the GRMHD package (technically, PtoUMHD from the Flux package because KHARMA always makes perfect sense) was being called over each boundary. UtoP from the Inverter package was also called accidentally, but should have been effectively a no-op because it basically repeated a previous call. So, the boundary had primitive variables mirrored/repeated/etc, and conserved variables that reflected calling PtoU on those, as we'd expect.

I'll note again this was only with the kharma driver, when normally the conserved variables are synchronized, so the boundaries have to be treated specially. In the imex driver where all boundaries internal and external use primitive (fluid) variables, things are simpler.

@bprather bprather mentioned this pull request Oct 10, 2024
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.

1 participant