You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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).
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
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
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:
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
The text was updated successfully, but these errors were encountered: