Skip to main content

A non-thermal electron deposition (Spencer-Fano equation) solver.

Project description

pynonthermal

Build and test codecov

pynonthermal is a non-thermal energy deposition (Spencer-Fano equation) solver.

When high-energy leptons (electron and positrons) are injected into a plasma, they slow down by ionising and exciting atoms and ions, and Coulomb scattering with free (thermal) electrons. Keeping track of the rates of the processes is important for example, when modelling Type Ia supernovae at late times (>100 days). At late times, ionisation by high-energy non-thermal leptons (seeded by radioactive decay products) generally overtakes photoionisation, and the non-thermal contribution to ionisation is needed to obtain reasonable agreement with observed emission lines of singly- and doubly-ionised species.

The numerical details of the solver are similar to the Spencer-Fano solver in the ARTIS radiative transfer code (Shingles et al. 2020), which itself is an independent implementation of the Kozma & Fransson (1992) solution to the Spencer & Fano (1945) equation. A similar solver is also applied in the CMFGEN code.

The impact ionisation cross sections are formula fits from Arnaud & Rothenflug (1985) and Arnaud & Raymond (1992).

If the internal set of levels and transitions are applied (e.g., using add_ion_ltepopexcitation()), these are imported from the CMFGEN atomic data compilation. See the individual source files for atomic data references.

Example output

The following plot shows the energy distribution of contributions to ionisation, excitation, and heating for a pure oxygen plasma (electron fraction 1e-2), reproducing figure 2 of KF92. The area under each curve gives the fraction of deposited energy going into that particular channel.

Emission plot

Installation

For the latest experimental version, pynonthermal can be installed with:

python3 -m pip install git+git://github.com/lukeshingles/pynonthermal.git

If this version crashes or causes problems, you can try dropping back to a released version.

python3 -m pip install pynonthermal

Usage

See the quickstart notebook Binder for an example of how to set up the composition and use the solver to determine ionisation and heating rates.

Advanced Usage

Advanced users will likely want to control the particular excitation transitions that are included in the solver. Individual excitation transitions can be added with:

SpencerFanoSolver.add_excitation(Z, ion_stage, n_level, xs_vec, epsilon_trans_ev, transitionkey=(lower, upper))

Z is the atomic number. ion_stage is the one more than the ion charge (e.g., Fe I or ion stage 1 has charge zero). The argument xs_vec is a numpy array of cross sections [cm2] defined at every energy in the sf.engrid array [eV]. The transition key can be almost anything that is unique within the ion and is used to refer back to the level pair when requesting the excitation rate coefficient.

nt_exc = SpencerFanoSolver.get_excitation_ratecoeff(Z, ion_stage, transitionkey)

Meta

Distributed under the MIT license. See LICENSE for more information.

https://github.com/lukeshingles/pynonthermal

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynonthermal-2024.7.4.tar.gz (9.7 MB view details)

Uploaded Source

Built Distribution

pynonthermal-2024.7.4-py3-none-any.whl (9.7 MB view details)

Uploaded Python 3

File details

Details for the file pynonthermal-2024.7.4.tar.gz.

File metadata

  • Download URL: pynonthermal-2024.7.4.tar.gz
  • Upload date:
  • Size: 9.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pynonthermal-2024.7.4.tar.gz
Algorithm Hash digest
SHA256 480c3eaa43d3fe3a11b57faa4542ab1d4da85d9e0245fa9650fb430636b910c6
MD5 3fd421102de16d09545c40de3d2ee814
BLAKE2b-256 e007f920a6638fe1a6f3560b9ea0c5793257b1339854d7bccff80aa7ad974849

See more details on using hashes here.

File details

Details for the file pynonthermal-2024.7.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pynonthermal-2024.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1cc38ea1c4aa719f55276d95ef99edd43f928dac73dee9068de8a3ca61892109
MD5 80ec79ef58c9630baeb631a69c430b7f
BLAKE2b-256 5438f93f77fc138a694a94b1d17f1f15bd2bd3dcb2899f71bf3543bd8aa8d8da

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page