lanl / phoebus

Phifty One Ergs Blows Up A Star
BSD 3-Clause "New" or "Revised" License
32 stars 0 forks source link

Fix FMKS #156

Closed brryan closed 1 year ago

brryan commented 1 year ago

PR Summary

FMKS, unlike MKS, is broken on the torus problem -- in 2D the disk blows up after about 200M.

This PR aims to fix that.

At the moment it looks like the issue was a bug in the singularity fix code (only being applied to theta = 0 but not theta = pi, using abs instead of fabs) This PR fixes unrelated bugs in the polar axis singularity fixup code and in using function arguments for GetNorm_

It turns out the problem is when reflecting the X2 component of the magnetic field about the polar axis in FMKS. Why this plagues phoebus but not harm is currently unknown. Outflow BCs for X2 work fine, and this is probably a moot point once we switch to face-centered fields.

We add a polar BC option for X2 but all this does is enable a special fix flux option; otherwise it looks just like reflection in GenericBC.

PR Checklist

brryan commented 1 year ago

Oops this is almost certainly a bug I introduced. Sorry about that and thanks for the fix. Is FMKS still broken after these fixes?

Yes this does not fix the FMKS issue unfortunately. I'll keep looking