Closed floresv299 closed 3 weeks ago
When a normal EPOCH simulation is loaded, the number density in each cell is taken from your input deck, and macro-particles are loaded to achieve that density. The macro-particles are positioned randomly throughout the cell, and the weights are set such that the sum of macro-particle weights divided by the cell volume is equal to the assigned number density.
However, EPOCH macro-particles have shapes which project out from their original cell. This is done to smooth the fields interpolated to the macro-particles to reduce simulation noise, but it has the added effect of distorting the initial number densities. Weights which are calculated on a cell-by-cell basis are projected to neighbouring cells, and because macro-particle position within a cell is random, there are random projections that don't balance out. The net effect is noise similar to what you show here. It would be improved by increasing the ppc, but it would always remain.
I'm a little more confused about your sums not adding to zero though. Is this an output from the 0000.sdf
file?
Cheers, Stuart
Regarding the sums not cancelling (so presumably a net charge in the domain) - is this explained by each species having different projections into ghostcells, and thus having slightly different net contributions to the physical domain?
EPOCH loads the correct weight into each cell. The projections will smear this weight among neighbouring cells, but the total summed weight should still be correct - unless weight is being lost through the x_min
or x_max
boundaries. It does't appear that this is the case in the figure, but I've just spotted:
number_density = if((x gt slab_length) and (x lt start_ramp), 0, number_density(Electron))
in the input.deck. This line does nothing, as we cannot satisfy $x>5\mu m$ and $x < -1 \mu m$ at the same time. However, even ignoring this, the density should still be 0 on the boundaries.
My last thought is that maybe this is was taken at a different time-step, where macro-particles may have escaped the simulation window?
Edit: Maybe @floresv299 means that the total charge in a given cell isn't neutral? This would be explained by the random weight projections.
Hi all, thank you very much for your reply, this was very helpful. Yes, I do mean the total charge, here is a better graph. This is taken at 0000.sdf.
I can verify that this effect is improved by increasing the ppc, but it still remains. Just making sure I wasn't doing anything wrong. Thank you all again !
Hi @floresv299,
I've looked into it, and there are two reasons why the weights may not fully cancel out.
In practice, this means there is a net charge on the grid. The way EPOCH's field solver works is that it assumes every cell is initially neutral. Any cell with a net charge is assumed to have an immobile background charge which perfectly cancels this out. Typically this is fine when a larger number of particles per cell is used, but it's something to be aware of if all your target particles move to a different $x$ position - a fake "ghost charge" will remain at the initial position.
In most cases, this isn't an issue. I think this problem would vanish completely if you recompile the code with -DPER_SPECIES_WEIGHT
, following the compilation flag instructions. This fixes all macro-particles within a species to have the same weight, and doesn't calculate weights based on individual macro-particles. Density ramps are achieved by having fewer macro-particles in cells with lower density. There are compatability issues though with some physics packages, if you're interested in ionisation for example.
Hope this helps, Stuart
I'm going to mark this issue as closed for now, but feel free to reopen if you have more questions.
Hi all,
I'm initializing a 1d plasma slab with an exponential profile. This is a simple proton/electron plasma, that suppose to peak at 40*nc. I'm seeing a lot of fluctuations near the maximum density. I thought it might be numerical heating so I increased my ppc and grid resolution but it didn't fix the problem. I also noticed that the sum of the electron and proton densities do not sum up to zero. Is this normal ? Any help will be greatly appreciated ! Thank you
input (7).txt