Creates tokamak plasma sources for OpenMC
Project description
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/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for openmc_plasma_source-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e67322b2eb7254ffdb62994bcffcbf81feef11911e856392d96a14413904b26 |
|
MD5 | f94f8a7cd3d7d008e0aff4f39c0b462d |
|
BLAKE2b-256 | efaf5e8200b07812608aeaa12bf9ed568123a798dcd6ad9f5d6f57817c39a0bc |
Hashes for openmc_plasma_source-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 838f5f21a473ab1c99ffb766f8a902f0f7c607b1882658953db2d23b68eb7f61 |
|
MD5 | 35b012ab5e28370bf50ad35a3a3a6a54 |
|
BLAKE2b-256 | 52b8bbe6bd103bced464708b4b831fba50d4c9c6ffcf88e664e6eaf703d7622e |