Skip to content

Low-energy charged particles' dynamics simulation using particle-in-cell method (Ef, python version)

License

Notifications You must be signed in to change notification settings

epicf/ef_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ef is a software for simulation of charged particles dynamics. It's primary areas of application are accelerator science and plasma physics.

About ef

Examples


Single particle in uniform magnetic field;       Widening of a ribbon beam during the propagation



Ribbon beam in uniform magnetic field



Potential of electron beam inside conducting tube;       Volt-Ampere characteristic of a planar diode

Physics

Motivation

Ef focuses on non-relativistic energies. Particular emphasis is placed on low-energy beams, such that can be found in ion sources and electron guns. A motivation behind the program, the scope and the general goals are discussed here.

Particle-in-cell

Particles dynamics is traced under action of external electromagnetic fields. Particle self-interaction is taken into account with particle-in-cell method. Detailed description of the mathematical model can be found here.

CAD plans

Attention is given to integration with CAD software to allow for simulation of complex real-life experimental setups. An experimental plugin for FreeCAD exists.

Versions

Ef is a free software -- it's source code is open and avaible for modification and redistribution. Python (this one) and C++ versions are available. Python version is easy to install and experiment with. It's speed should be sufficient to perform example computations and small-scale simulations but for large-scale simulations C++ version is the choice.

Status

Current features are described in detail in appropriate wiki sections, as well as installation procedure. Some usage examples are also given.

For users

Install

It's advisable to use a virtual python environment:

virtualenv --python=python3 ef_venv
. ef_venv/bin/activate

EF is not available in pypi yet, install from github:

pip install 'git+https://github.com/epicf/ef_python.git'

Run

Start simulation defined by my_config.conf:

ef my_config.conf

Continue simulation from hdf5 file my_0005.h5:

ef my_0005.h5

For developers

Install for development

git clone https://github.com/epicf/ef_python.git
cd ef_python
virtualenv --python=python3 venv
. venv/bin/activate
pip install -r requirements.txt
pip install -e .

Test

Install pytest:

pip install pytest pytest-mock

Run fast unittests:

pytest

Run more tests (including slower examples)

pytest -m 'not (slow)'

Run every test (including slow simulation examples)

pytest -m ''

Run tests with tox

More python versions and test types.

  • Install tox: pip install tox
  • Run tox

Can also run in parallel with detox.

Run

Start simulation defined by my_config.conf:

ef my_config.conf

Continue simulation from hdf5 file my_0005.h5:

ef my_0005.h5

About

Low-energy charged particles' dynamics simulation using particle-in-cell method (Ef, python version)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages