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

call WeightedSync on emf before computing rhs #526

Open
BenWibking opened this issue Feb 6, 2024 · 1 comment
Open

call WeightedSync on emf before computing rhs #526

BenWibking opened this issue Feb 6, 2024 · 1 comment
Labels
enhancement New feature or request MHD
Milestone

Comments

@BenWibking
Copy link
Collaborator

BenWibking commented Feb 6, 2024

Describe the proposal
It appears necessary to ensure that the emf values are identical on edges shared between multiple boxes before computing the magnetic induction equation right-hand-side (rhs).

This can be done with either the OverrideSync or WeightedSync MultiFab functions:
https://amrex-codes.github.io/amrex/docs_html/Basics.html#owner-mask.

Describe alternatives you've considered
If this is not done, there will be roundoff level differences in the emf on edges that should have identical emfs, which will make the simulation dependent on the grid layout used. This can cause spurious (but small) magnetic field divergence errors.

Additional context
This is done in Athena++ (although it may be of greater importance there due to their use of curvilinear coordinates, see section 2.1.4: https://ui.adsabs.harvard.edu/abs/2020ApJS..249....4S/abstract):

  • "Even without mesh refinement, numerical errors can cause a slight mismatch between the EMFs on shared edges between MeshBlocks. With the constrained transport scheme, such errors never disappear once generated. This problem becomes more prominent when more complex grids with nonuniform mesh spacing and/or curvilinear coordinates are in use. Moreover, aggressive compiler (non-ANSI-conformant) optimizations can introduce and exacerbate differences associated with roundoff errors. Therefore, the EMF correction step is applied even when mesh refinement is not used. In this case, the EMFs on two shared edges are replaced with the arithmetic average of their values."
@BenWibking BenWibking added enhancement New feature or request MHD labels Feb 6, 2024
@BenWibking
Copy link
Collaborator Author

@AstroKriel I wanted to check if you were already doing this in your code. If not, I think it should be done. This does require creating temporary MultiFabs for the emfs (but not for anything else).

@BenWibking BenWibking mentioned this issue Jun 7, 2024
7 tasks
@BenWibking BenWibking added this to the MHD milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MHD
Projects
None yet
Development

No branches or pull requests

2 participants