Allow ParticleTracker to accept analytical fields (as functions) or lists of currents/charges #2638
Labels
feature request
Issues requesting a new feature or enhancement
Projects
Feature description
Right now,
ParticleTracker
requires 3D grids of E&B fields to trace particles in. This is ideal in some cases, but in others it would be nice to have the following two optionPush particles through an analytically-defined field. I think @StanczakDominik was playing with this in ParticleTracker mechanics refactoring (again!) #1096. I propose the best way to do this would be to allow the user to provide function objects
E(x,y,z)
andB(x,y,z)
that would then be evaluated at the particle positions at each step. These should be collected in anAnalyticalGrid
object that associates a group of them together.Push particles through fields calculated in-situ by a collection of charges and/or currents. The Lorentz force on each particle should be calculated pairwise on each timestep, rather than calculating a grid of fields at the beginning from these objects.
Motivation
This eliminates interpolation, and so in theory would be much faster for field geometries that can be written analytically. It would speed up a lot of examples and tests!
This approach can be conceptually superior for some proton tracing problems. In cases with a small number of charges or currents (e.g. some examples or tests) it would also be fast. Of course, this is going to be slow when there are a great many currents/charges, but that's to be expected (a warning could be raised if
nparticles*nsources > a_large_number
).Example of 2 in literature for proton tracing: https://pubs.aip.org/aip/pop/article/27/6/063109/153510/Axial-proton-probing-of-magnetic-and-electric
Implementation strategy
I would implement objects
AnalyticalGrid
andSourceCollection
respectively, then change ParticleTracker so that instead of a list ofGrid
objects, it can take a list of any combination ofGrid
s, and the above.Additional context
Critically, ParticleTracker should accept a MIXTURE of the [Grid, AnalyticalGrid, SourceCollection] so that particles could be pushed through something like the following examples:
The text was updated successfully, but these errors were encountered: