bchaber / iskra

A particle-in-cell simulator for spark simulations ("iskra" is the Polish word for spark).
GNU General Public License v3.0
3 stars 1 forks source link

Refactor surface/electrode handling to allow integration with Circuit module #3

Closed bchaber closed 4 years ago

bchaber commented 4 years ago

Here I reworked how electrode were handled. Right now both floating potential and fixed potential electrodes are created with create_electrode. Surface area, reference node and corresponding sigma DOF are automatically set for the electrode. FloatingPotentialElectrode records the total charge absorbed by the surface in the current timestep.

During updating 04_mcc I ran into a bug with too fast particles. It turned out that they weren't detected because of the bug in the code (no delta Ty was ever checked). What is more, only particles in near surfaces were checked and they were using old velocities (before pushing).

Right now when user skips creating a surface tracker and a circuit ParticleInCell will create a default one tracker and circuit for him. This way, remove_particles! is not needed anymore.