Open rd1042 opened 1 year ago
This appears to be related to how the centering is performed in the term (Z/T e^(-v^2)
This is O(dz^2) centered without z upwinding (i.e. u_z=0), but it "mixes" ( e^(-v^2) ) and (
which is also O(dz^2) centered without z upwinding, but doesn't "mix" terms from adjacent gridpoints. This alternative approach is implemented in branch bugfix/Davies-linear-EM-terms-maxwellian-centering-streaming . With the same input file as above, this branch is stable. Some next steps/questions are:
Just an update that, with branch bugfix/Davies-linear-EM-terms-maxwellian-centering-streaming, numerical instability occurs if ky is reduced to e.g. 0.01. The numerical instability gets worse as the timestep increases, which is the opposite behaviour to the original instability, but the same behaviour as the master branch.
so should we interpret this as meaning that with the slight tweak to the centering in the EM implementation, the code behaves in the same way as the master branch? E.g., an electrostatic simulation with the delta phi and h formulations gives the same behaviour as master branch?
Not quite - running the same input files for both simulations, the (delta phi and h) approach is more instability-prone (i.e. for a given ky, instability occurs if the timestep exceeds a partiuclar dt_max, and dt_max is smaller for the (delta phi and h) approach).
Attached are mode structures for master & em_stella (the latter with the bugfix) showing instabilities for different dt with ky=0.01. master is stable for dt=0.004 (and 0.04, but not shown) but becomes unstable for dt=0.1. The (delta phi and h) approach is unstable for dt=0.004. The mode structures are smooth in z, but seems to change between dt=0.004 and dt=0.1 for the em branch.
Issue to track a numerical instability in the electromagnetic stella branch feature/Davies-linear-EM-terms (commit 47f9f536). Possibly related to issue #98 (which mostly concerns the master branch).
Some details of the test case I'm examining has the features:
Example input file attached. I'll provide more information/diagnostics shortly. It looks to me like some problem with the streaming algorithm. (Although there isn't an instability for the unsheared slab geometry with periodic BCs).
input.in.txt