PrincetonUniversity / athena

Athena++ radiation GRMHD code and adaptive mesh refinement (AMR) framework
https://www.athena-astro.app
BSD 3-Clause "New" or "Revised" License
235 stars 127 forks source link

1D MHD SMR fields wrong at refinement boundaries with more than 2 ghost zones #209

Closed c-white closed 5 years ago

c-white commented 5 years ago

I was running 1D shock tubes with refinement, and I noticed problems with one test where a magnetized rarefaction passed from fine to coarse cells. I first noticed this in SR, but the problem is entirely reproducible in Newtonian MHD. The problem seems to very much show up in By first (there is no Bx or Bz in this problem), eventually affecting all the variables.

To reproduce, first make athena/temp/ and place shock.txt as shock.athinput and plot_shock.txt as plot_shock.py there.

Next, compile and run two executables with different numbers of ghost zones:

./configure.py -b --prob shock_tube --coord cartesian --flux hlld --nghost 2 -hdf5
make clean
make -j
mv bin/athena bin/athena_2
bin/athena_2 -d temp -i temp/shock.athinput job/problem_id=shock_2

./configure.py -b --prob shock_tube --coord cartesian --flux hlld --nghost 4 -hdf5
make clean
make -j
mv bin/athena bin/athena_4
bin/athena_4 -d temp -i temp/shock.athinput job/problem_id=shock_4

Finally, overplot the results:

temp/plot_shock.py shock 8 Bcc2
open temp/shock.Bcc2.00008.png

shock bcc2 00008

The refined region runs from 0.3 to 0.7, and as the rarefaction passes 0.3 the transverse field glitches. Note we don't need all 4 ghost cells, since this is using PLM reconstruction. The problem persists when using PPM. It also exists when using PLM and 3 ghost zones (or even 10 ghost zones).

felker commented 5 years ago

163 related. (NGHOST=3 will never be allowed for SMR/AMR)

tomidakn commented 5 years ago

I have never guaranteed that SMR/AMR works with NGHOST != 2.

tomidakn commented 5 years ago

@c-white, please send me the pgen and input files to reproduce it.

c-white commented 5 years ago

@tomidakn The input file is this: https://github.com/PrincetonUniversity/athena/files/2801128/shock.txt, and the pgen is just the standard shock_tube.cpp.

tomidakn commented 5 years ago

Oh sorry I was not reading your post carefully.

tomidakn commented 5 years ago

@c-white I tested it only in 1D. As I have a lot of things to do including a telecon in 20 minutes, could you do the same test in 2D and 3D?

tomidakn commented 5 years ago

ng4

jmstone commented 5 years ago

Congrats!

On Jan 28, 2019, at 8:48 PM, Kengo TOMIDA notifications@github.com wrote:

https://user-images.githubusercontent.com/7672598/51878550-117f2300-233e-11e9-91fb-5d523b4ad803.png — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PrincetonUniversity/athena/issues/209#issuecomment-458374947, or mute the thread https://github.com/notifications/unsubscribe-auth/AEO7zrulZ8-MJ8ANLMe4oN2DnTwV6iOeks5vH6hzgaJpZM4aVFRA.