Closed MatthewGrim closed 5 years ago
The first thing I am going to do is replicate Figure 2, 5, and 6 with the code as it stands. Let's just see where we are right now.
I still observe the order of magnitude slower time scale in figure 2 and 5, while seeing a faster timescale for the plot of electron energy. I am not sure why.
I'm going to run the sims again with two separate changes. One is to change the time step so that it is an order of magnitude lower. The other is to change the particle distribution so that it is uniformly distributed across a sphere (this should be identical to the Gummersall paper). Let's see what these two tests show.
Neither change seems to have fixed the problem. Naively I'll try a combination of both, and fix the simulation time to be larger
It's also interesting that the spherical distribution didn't change my result. The points of the cube that I was initialising particles in before, might have been stuck in the high magnetic field lines.
The next thing to do is vary the particles in exactly the way Gummersall does them. I should have done this a while back as it is the clearest test of whether it's the initial conditions or something else.
Still overshooting with the gummersall initialisation...
Going back to my original code, for a single loop, I validated the magnetic field along axis with the following plot:
There are variations in the x and y direction, but the z axis matches the analytic theory very well.
The fields here generally make sense. The lines move out through the rings, whereas in Carr 2011, they move inward, but this should not make a difference. I am not surprised that the cusps are clearer for the coils that are close together, as the B field magnitude should have a sharper gradient when it reaches the coils. Overall, the qualitative result seems reasonable. I don't know if the magnitude is off.
My remaining tests are the visualisation of single particle trajectories, a smaller initialisation region, and a two order of magnitude smaller time step.
No change - it doesn't look like it can be me exceeding the magnetic null. It looks like the time step or the magnetic field is still the main theory but I can't see how I've gone wrong.
I added a scripts to compare against the normalisation Gummersall carries out on his fields. The difference between mine and his magnetic fields is close to zero. This should not affect the result for the same resolution.
So our magnetic fields are the same. The resolution of his fields is about half that of mine, so it could be to do with resolution.
Closed by accident - I still don't know the cause for discrepancy
A comparison of the unit field produced at 56 grid points per dimension and 130 shows there is some deviation but it isn't the orders of magnitude expected to make a difference.
No change again. I'm going to create a mesh with less loop points than I used previously.
I exclude the 100kA curves because the simulation is too slow.
Even with the time step fixed. The results converge to the same value. The values have move slightly from other plots but not as would be necessary.
The results above have shown that, despite all my tests, my results are not aligning with previous work. The magnetic field calculation seems to match mine (at least the normalisation works). The change in distribution does not help, even with the biasing that is in Gummersall's initialisation.
There is not much more I can go on with the information I have. I need to know the exact initialisation used to get the field in previous work, and the stopping criterion. It's really strange that my plots line so well with results that are an order of magnitude below in current.
There's limited gains in flogging this any more.
The green curve decays more quickly in this initalisation, where I have made the initialisation a wedge not a cube. This makes me think it could be something to do with the way we set up the particles.
Even at a high resolution (1e-11) the results do not diverge. It's not a timestep issue.
The results below are what I presented at a conference on the IEC:
I just committed a bug in the magnetic field that makes the face cusps have a slight gradient in the radial direction near the face. Hopefully this can be used to explain the current discrepancy my results have with past work. I will need to regenerate the conference plots...
I'm now going to re-run the validation with the fix to the magnetic field. The first run is at 60 points, and I will do another over the weekend with 130. I have fixed the time step to 1e-9 * radius as in the original paper.
Even with the fix to the B field, the results still differ ...
So it's seriously not the magnetic field ... and I've already tried to lower the timestep several orders of magnitude with no change... now I'm lost.
The results are pretty much exactly an order of magnitude off - where could I have lost an order of magnitude?
My mu_0 is correct. Is line 83 of generic_b_fields correct? That is a factor of 10 but it reduces the confining force by having it...
The other thing is that my currents are running in the opposite direction, but this should not change anything.
I'm going to look at the global trends and see what I can see after that.
Because of a mistake in my code on the remote repository, the mesh generator for the final validation above is not correct. This needs to be re-run.
I've done everything I can to replicate the results, but still find a discrepancy. At least in the closed loop of my simulations, everything seems to be validated, so I cannot waste any more time on this. I have to move on.
Based on feedback, several things should be done to test, and validate the single particle model I have been using.
Regenerate figures from Gummersall
Re-considering the plots I've already generated, there seems to be a discrepancy between the results. Figure 6 shows shorter confinement times, while 2 and 5 show longer. To get to the bottom of this, I need to regenerate the plots. The reason for this may be because I changed the stopping condition halfway through generating these results.
Change stopping condition and particle initialisation
This should be done in such a way that the particles are initialised within the non-adiabatic region of simulations, and the stopping distance extends beyond the coil faces to the point of highest magnetic field.
Plot vectors of magnetic field
Though the contours for the shell-like structure I expect, I should figure out how to store the velocity components in vti files, so that I can visualise them better.
Re-assess timestep
Maybe this should be lower than 1e-5 delta_x for high energy to field ratios. I need to check.
This issue documents the the above tests.