OpenMC-plasma-source
This python-based package offers a collection of pre-built OpenMC neutron sources for fusion applications.
Installation
OpenMC is required to use this package.
To install openmc-plasma-source, simply run:
pip install openmc-plasma-source
Usage
Tokamak Source
Create a source with a spatial and temperature distribution of a tokamak plasma. The OpenMC sources are ring sources which reduces the computational cost and the settings.xml file size. Each source has its own strength (or probability that a neutron spawns in this location).
The equations implemented here are taken from this paper.
from openmc_plasma_source import TokamakSource
my_source = TokamakSource(
elongation=1.557,
ion_density_centre=1.09e20,
ion_density_peaking_factor=1,
ion_density_pedestal=1.09e20,
ion_density_separatrix=3e19,
ion_temperature_centre=45.9,
ion_temperature_peaking_factor=8.06,
ion_temperature_pedestal=6.09,
ion_temperature_separatrix=0.1,
major_radius=9.06,
minor_radius=2.92258,
pedestal_radius=0.8 * 2.92258,
mode="H",
shafranov_factor=0.44789,
triangularity=0.270,
ion_temperature_beta=6
).make_openmc_sources()
For a more complete example check out the example script.
Ring Source
Create a ring source with temperature distribution of a 2000 eV plasma.
from openmc_plasma_source import FusionRingSource
my_plasma = FusionRingSource(
angles = (0., 6.28318530718), # input is in radians
radius = 400, # units in cm
temperature = 20000., # ion temperature in eV
fuel='DT' # or 'DD'
)
Point Source
Create a point source with temperature distribution of a 2000 eV plasma.
from openmc_plasma_source import FusionPointSource
my_plasma = FusionPointSource(
coordinate = (0, 0, 0),
temperature = 20000., # ion temperature in eV
fuel = 'DT' # or 'DD'
)
Testing
To run the tests, simply run
pytest tests/
Metadata
Release files for openmc-plasma-source 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| openmc_plasma_source-0.3.1.tar.gz | 21.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openmc_plasma_source-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.9 kB
Release files / openmc_plasma_source-0.3.1.tar.gz
| Download URL | openmc_plasma_source-0.3.1.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94d92e8d889a249047aadac0d230c53196cbc1fcf1b01da610ec2c4ce7381bd1
|
|
BLAKE2b-256 checksum How to use checksums |
17d9f3cdfb827e6364bc71cf252c597830a28a545aaa7af6e2637283a8edcd81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / openmc_plasma_source-0.3.1-py3-none-any.whl
| Download URL | openmc_plasma_source-0.3.1-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3ce2ae70649062eafc12078c2562f66f3b859888cb70d55f2d422506ae3268a
|
|
BLAKE2b-256 checksum How to use checksums |
bd4956852244fb543785755e344892fc5dc034a73acfba94499578f81c25da89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for openmc-plasma-source 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.