Uniform injection instead of random injection #636
-
Hi, Is it possible to modify the code (easily) somehow to inject the particles uniformly, at least in the 1D case? I am implementing an exponentially decaying density profile and this causes the E-B field to explode over just ~ e-folding scale (10^6 times larger so definitely some artificial instability going on here). I think that maybe injecting the particles uniformly would be the fix? I saw that someone in the past was able to modify an older of EPOCH to get the following a smoother profile (see image). Is that still possible somehow? Thank you, William. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey William, It is possible to do this, but "easily" depends on how comfortable you are tweaking things under the hood. The EPOCH domain is composed of simulation cells surrounded by ghost cells. Macro-particles have a "shape", such that the EM fields on the particle are interpolated using multiple nearby cells. When this shape extends beyond the simulation cells, we can use the fields in the ghost cells, but when the particle-centre drifts into a ghost-cell (and we have outflow boundary conditions), the particle is deleted. The injectors in EPOCH work by populating these ghost cells with macro-particles describing a plasma with the parameters you specify in the injector block. These are pushed using their loaded momenta, and those which enter the simulation window during the time-step are kept, and the ones which stay in the ghost cell are deleted. The positions of these loaded injector particles are calculated in the
These lines position macro-particles such that if they all move with
Note that I do not allow this fraction to reach 1, such that we don't have the last particle on step Alternatively, you could specify the injection time and momentum of all particles by using file injectors. This may give you more control to play around with different distributions of particles, at the cost of writing long particle injection lists. I hope this mini-lecture on the EPOCH injectors was useful! |
Beta Was this translation helpful? Give feedback.
Hey William,
It is possible to do this, but "easily" depends on how comfortable you are tweaking things under the hood.
The EPOCH domain is composed of simulation cells surrounded by ghost cells. Macro-particles have a "shape", such that the EM fields on the particle are interpolated using multiple nearby cells. When this shape extends beyond the simulation cells, we can use the fields in the ghost cells, but when the particle-centre drifts into a ghost-cell (and we have outflow boundary conditions), the particle is deleted.
The injectors in EPOCH work by populating these ghost cells with macro-particles describing a plasma with the parameters you specify in the injector block. These are …