NaNs for small radius with RKL #322
-
|
Hi all, I'm having trouble with the RKL integration method. The setup I'm using consists of a spherical 2D axisymmetric grid, logarithmically spaced in radius. I've just noticed that when I activate non-ideal MHD terms (ambipolar or ohmic scattering) using RKL, with rotation, and start my grid at a sufficiently small radius, NaNs appear in the magnetic field after only a few cycles. Here is my setup that reproduce that: Collapse_Setup.zip, which consists of a sphere of homogeneous density with solid rotation and a constant magnetic field. From what I've been able to test in this particular case, the crash appears for the Is this a known problem with the RKL method? And if yes, is there a solution to prevent that ? Thanks in advance for the help ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hi @Anto6453 , yes this happens sometimes with the RKL scheme, hard to know why in this precise case, but my experience is that Ambipolar diffusion can sometime render the RKL scheme unstable (as it is the case here). It could also be an issue with your boundary conditions. I'm having a look at your setup, I'll keep you posted. |
Beta Was this translation helpful? Give feedback.
Ok, I think I found the culprit: an old regularisation procedure of the pole that was fixed in the non-rkl version of the RHS, but not fixed in the RKL. This uses a "small_number" to regularise the area around the pole, that turns out to be large for your choice of grid (with delta r=1e-7!)
The easy fix is just to comment out the #ifdef block there:
idefix/src/rkl/rkl.hpp
Line 766 in 54482d5
A PR will be on its way soon.