Optimizing physical parameters in 1-D particle-in-cell simulations with Python
Abstract A particle-in-cell (PIC) simulation tool, OOPD1, is wrapped in the Python programming language, enabling automated algorithmic optimization of physical and numerical parameters. The Python-based environment exposes internal variables, enabling modification of simulation parameters, as well as run-time generation of new diagnostics based on calculations with internal data. For problems requiring an iterative optimization approach, this enables a programmable interactive feedback loop style simulation model, where the input to one simulation is a programmable function of the output of the previous one. This approach is applied to field-emission of electrons in a diode, in order to explore space charge effects in bipolar flow. We find an analytical solution for maximizing the space-charge limited current through a diode with an upstream ion current, and confirm the result with simulations, demonstrating the efficacy of the feedback scheme. We also demonstrate and analyze a modeling approach for scaling the ion mass, which can shorten simulation time without changing the ultimate result. The methods presented can be generalized to handle other applications where it is desirable to evolve simulation parameters based on algorithmic results from the simulation, including models in which physical or numerical parameter tuning is used to converge or optimize a system in one or more variables.