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

MHD shearing box has artifacts with SMR #571

Open
3 tasks
c-white opened this issue Mar 13, 2024 Discussed in #569 · 3 comments
Open
3 tasks

MHD shearing box has artifacts with SMR #571

c-white opened this issue Mar 13, 2024 Discussed in #569 · 3 comments
Labels
MHD Relating to components involving the B field SMR/AMR Relating to static and adaptive mesh refinement

Comments

@c-white
Copy link
Contributor

c-white commented Mar 13, 2024

Summary

The combination of MHD, SMR, and shear-periodic boundary conditions produces some artifacts and isn't fully supported right now. I propose the following, from short-term to long-term:

  • Clarify in the documentation that this is not supported.
  • Issue a runtime warning at least if this is detected.
  • Figure out how to sync the flux corrections at the shearing boundary between different refinement levels.
    • If it makes the task easier, we might consider restricting refinement so that the shear boundary isn't too poorly behaved (perhaps by only allowing refinement variations in z there).

Discussed in #569

Originally posted by jonosquire March 7, 2024
I have been trying to run an MHD shearing box with static mesh refinement and been running into issues. I add SMR in the vertical direction only for the usual shearing domain with shear_periodic boundary conditions in x. After a short time (~0.5 orbits), the integrator goes unstable with the timestep dropping to zero because of a very large radial magnetic field that develops in the 2-3 cells around the refinement location at the radial boundaries. Just 1 level of refinement causes the issue, but the blowup/instability occurs faster if higher levels are added.

In order to diagnose the issue I have tried (in various combinations): the vl2, rk2, and rk3 time integrators with various conservative CFLs; order 2, 2c and 3 reconstruction; different initial conditions (from the strat.cpp pgen) and different field strengths; different orbital advection schemes (including no orbital advection); setting qshear=0 (still with the shear_periodic BCs); different mesh refinement locations, meshblock configurations and resolutions; different sound speeds and density floors. The problem persists with all of these. Turning off the magnetic field (pure hydro shearing box), or using periodic (rather than shear_periodic) boundary conditions in x1 removes the issue, and the grid setup appears to be as expected with all of the meshblocks at the same z facing the x1 shear-periodic boundaries having the same level.

Has anybody come across similar problems? I'm at a loss for what to try at this point – is there an issue with with shear_periodic BCs and SMR? I've attached an input file that should reproduce the issue with the strat.cpp pgen in the current athena version (this is effectively the default input file with different units, a finer grid, and the SMR added). I've also attached a screenshot showing the radial field blowup at the boundary (the colormap is saturated; the points right on the boundary at z=+-2.5 continue growing to infinity).

Thanks in advance for the help.
athinput.strat.txt
Screenshot 2024-03-07 at 5 45 45 PM

@c-white c-white added SMR/AMR Relating to static and adaptive mesh refinement MHD Relating to components involving the B field labels Mar 13, 2024
@felker felker mentioned this issue Apr 1, 2024
@felker
Copy link
Contributor

felker commented Apr 30, 2024

I can't think about how/where to add the more nuanced error condition you mentioned in #578 (comment) .

I plan on minting a release today. If you aren't able to add the runtime warning today, I can either add a dumb warning in bvals.cpp that just checks the global setting of pmy_mesh_->shear_periodic and MHD+SMR and emits a warning, or we can delay it until a future release

@c-white
Copy link
Contributor Author

c-white commented Apr 30, 2024

I think a simple shear+mhd+refinement warning should suffice for now.

@felker
Copy link
Contributor

felker commented May 7, 2024

to be absolutely clear, this issue should be renamed to "MHD shearing box has artifacts with refinement at shear boundaries", right? That is, both AMR and SMR are liable to refine at the shear boundaries unless you are careful

AMR+shear+hydro/MHD is already forbidden in the code, so it is covered by another safety check. But we need to add an exclusion for SMR+shear+MHD while continuing to allow SMR+shear+hydro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MHD Relating to components involving the B field SMR/AMR Relating to static and adaptive mesh refinement
Projects
None yet
Development

No branches or pull requests

2 participants