Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ParticleTracker to accept analytical fields (as functions) or lists of currents/charges #2638

Open
pheuer opened this issue Apr 15, 2024 · 0 comments
Assignees
Labels
feature request Issues requesting a new feature or enhancement

Comments

@pheuer
Copy link
Member

pheuer commented Apr 15, 2024

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 option

  1. Push 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) and B(x,y,z) that would then be evaluated at the particle positions at each step. These should be collected in an AnalyticalGrid object that associates a group of them together.

  2. 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

  1. 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!

  2. 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 and SourceCollection respectively, then change ParticleTracker so that instead of a list of Grid objects, it can take a list of any combination of Grids, 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:

  • A simulated field grid with an additional applied analytical field
  • A simulated field grid with a few additional sources added.
@pheuer pheuer added the feature request Issues requesting a new feature or enhancement label Apr 15, 2024
@pheuer pheuer self-assigned this Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues requesting a new feature or enhancement
Projects
HEDP Diagnostics
Awaiting triage
Development

No branches or pull requests

1 participant