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
Add a particle stepper for given external fields #40
Comments
This sounds wonderful! With regards to interpolation, the method I'm most familiar with is trilinear interpolation (e.g., Haynes & Parnell, 2007). I suspect that some of the interpolation routines in SciPy would do pretty much what we need them to do (e.g., RegularGridInterpolator). Another thought related to interpolation is that we should allow for flexibility in terms of the interpolation method which we'll eventually need. If we want to push test particles in a spectral or spectral element simulation, the most accurate way to interpolate would be to use the basis functions of the solution directly. However, we do not need to do this yet. A simple test would be to match against analytical results for a particle orbit in a uniform magnetic field. Another possibility for a test would be to match particle drifts in simple configurations. Thank you! |
... so this was implemented in scipy all along? Well. I really do need to read the full docs of that, scipy keeps positively surprising me. Thank you very much for the heads up, this will definitely come in handy! I'll try to make the interpolation easy to swap out. Uniform mag fields are definitely one of the tests I'm considering; another would be a harmonic potential. The drifts are a neat idea. Thanks! |
Okay, a minor point of confusion. I started doing some minor work on porting my code, and I'm noticing that we don't actually have an electric field defined in the plasma class. I know, quasineutrality, everything runs on magnetic in MHD scenarios, but in this case this means I'm kind of at a loss on how to proceed for now. I can't really interpolate a non-existant electric field. I had the idea of interpolating not the fields, but the actual momentum - scale that to the particle mass and we get a velocity for the particle. But that seems like a hack, like something you would implement in a video game where you don't actually care about the physics involved. |
Hm...some options would be to have the electric field either inputted directly, or calculated from an Ohm's law. @SolarDrew, do you have thoughts on how to address this? |
Hey, just wanted to give a heads up that I still intend to get this done, but other commitments are kind of getting in the way right now. I hope I can get back to this soon. |
As discussed on HipChat recently, I'd like to give adapting my particle stepper a try. The way I see this working would be:
ParticleSpecies
class containing their basic information such as position and velocity (as numpyndarray
s), charge and mass. This seems like a minimal necessary set of information. I would also like to save historical data on their positions and velocities every few timesteps into a larger ndarray to avoid frequent file IO (the iteration step between saving could be given by user, according to the resolution required).push
method that takes electric and magnetic fields (ndarray
s) at particle locations (so they're the same shape) and updates their positions and velocities. I have two Boris pushers, one nonrelativistic and one relativistic - I can port both. Of course, we want velocities at half timesteps to help with energy conservation - adding another methodinit_push
(without updating positions) to start that is trivial.Plasma
class is to stay Cartesian for a bit, then branch out a little, so that seems reasonable to me.I should be able to start working on this by about June 7th or so. Any help brainstorming before I get cracking on this would be much appreciated!
The text was updated successfully, but these errors were encountered: