picongpu icon indicating copy to clipboard operation
picongpu copied to clipboard

Particle injection

Open ervw12 opened this issue 4 years ago • 7 comments

Hi, is there an implementation of particle injection in PIConGPU?

Motivation: Since you recently implemented a reflecting wall, one useful setup would be of a collisionless shock front. For example by letting a positron-electron species propagate against the reflecting wall so that it counter-propagates with its own species. Unfortunately, I cannot find a way to have an species, which is quasi infinite in the direction opposite to the reflecting wall.

Possible method: Having an injecting wall (e.g. cathode), either static or moving at light speed in one direction, where a species gets injected into the simulation box.

ervw12 avatar Nov 12 '21 10:11 ervw12

Hello @ervw12 . We currently do not have a special feature for particle injection. The scheme you described could probably be done on the user side as well, in the iteration start pipeline (it's kinda same to the init pipelize in speciesInitialization.param, but run every iteration), with a CreateDensity<> followed up by a Manipulate<>.

We could maybe add this as a ready-to-use feature, depending on the implementation specifics. I personally do not have a working understanding of how it's done, but perhaps someone in the team does?

sbastrakov avatar Nov 12 '21 11:11 sbastrakov

So a scheme like described in SMILEI should be possible via an iteration start pipeline, like this:

  • E.g. we are injecting electrons
  • Declare another species injected_electrons to be used for injection, that has all the same attributes and flags as electrons
  • Set reflecting BC with some positive offset for electrons, and absorbing BC at same offset for injected_electrons
  • In the iteration start pipeline:
    • Convert all injected_electon macroparticles to "normal" electrons (derive electrons from existing macroparticles, mark the old ones for deletion, then call delete as next pipeline stage)
    • Create new injected_electrons just outside the boundary, initialize attributes the normal way (e.g. create density + manipulate to set temperature / momentum)

Then the newly created injected_electrons will be pushed as usual, and then those left outside of the boundary will get absorbed. Those that crossed the boundary will be converted to normal electrons at start of next step.

This isn't a very pretty solution, but I think could be implemented with quite reasonable effort. I could try doing it myself next week if I have time.

sbastrakov avatar Nov 12 '21 11:11 sbastrakov

@sbastrakov Wouldn't be this somehow similar to how I'm injecting photons at the simulation boundary? Maybe you can reuse some of the code.

pordyna avatar Nov 12 '21 12:11 pordyna

@pordyna probably? In case it's somewhere in your branch, could you link it?

sbastrakov avatar Nov 12 '21 12:11 sbastrakov

https://github.com/pordyna/picongpu/tree/topic-RTSplitting so I pushed the branch that I'm currently using. Most of it is in particles/externalBeam. I use there some stuff which for now are in plugins/externalBeam which is mostly stuff that was previosuly in plugins/xrayScattering/ but probably you won't need it. There is also externalBeam.param and here is an example for iterationStart.param.

Let me know if you have some questions.

pordyna avatar Nov 12 '21 13:11 pordyna

https://github.com/pordyna/picongpu/tree/topic-RTSplitting so I pushed the branch that I'm currently using. Most of it is in particles/externalBeam. I use there some stuff which for now are in plugins/externalBeam which is mostly stuff that was previosuly in plugins/xrayScattering/ but probably you won't need it. There is also externalBeam.param and here is an example for iterationStart.param.

Let me know if you have some questions.

Take care this branch is experimental and is running on GPU only. There are some abstractions missing to make it generic.

psychocoderHPC avatar Nov 15 '21 06:11 psychocoderHPC

Hei @ervw12, the use case you describe sounds very similar to the existing KHI example. It seems you just want to have two species of electrons and positrons were one pair of electrons and positrons has a drift along a given direction and the other pair just has some initial temperature without drift. If you combine this with periodic boundary boundary conditions along the axis of the drift you have exactly what you described: An electron-positron distribution propagating along one direction and colliding "with itself".

steindev avatar Nov 25 '21 08:11 steindev

No further questions here, closing. @ervw12 feel free to reopen/post a comment if your issue is not resolved.

steindev avatar Jan 19 '23 16:01 steindev