Skip to main content

A toolkit for modeling nuclides and nuclear reactions.

Project description

OKLO: A toolkit for modeling nuclides and nuclear reactions
===========================================================

The OKLO package provides a set of convenient tools for modeling
nuclides and the reactions between them. It provides methods to
uniquely identify the known nuclides, define unique reactions which
allow transitions from one nuclide to another, associate arbitrary
user-specified data to these objects, and treat collections of
nuclides and reactions as a single network.

While this package was initially designed for the purpose of
calculating the flux of antineutrinos emitted by nuclear reactors, it
is designed in a generic fashion for a broad range of applications
(e.g. solar physics, supernova physics, etc.).


Installation:
=============

Installion is most convenient via the pip utility:
::
$ pip install oklo

Description:
============

Here follows a brief description of the core tools provided by the
OKLO package.

Nuclide:
--------

A nuclide is a unique nuclear state identified by the number of
protons and number of neutrons in the nucleus, as well as an optional
metastable isomeric energy level. Each nuclide serves as a data
'whiteboard'. Users can associate arbitrary data with a nuclide using
a standard (key, value) approach.
::
>>> from oklo.core.ids import NuclideId
>>> from oklo.core.nuclide import Nuclide
>>> C_12_id = NuclideId(Z=6,A=12,M=0) # Create unique ID for Carbon-12
>>> C_12 = Nuclide(nucl_id=C_12_id) # Create nuclide object
>>> C_12.Z
6
>>> C_12.A
12
>>> C_12.M
0
>>> C_12.N
6
>>> C_12.name
'Carbon_12'
>>> C_12.element_name
'Carbon'
>>> C_12.element_abbrev
'C'
>>> C_12['current_abundance'] = 0.8 # Associate user-defined data
>>> C_12['current_abundance']
0.8


Reaction:
---------

A reaction is a unique type of nuclear transition between nuclides,
such as the beta decay of 12B to 12C. Each reaction serves as a data
'whiteboard'. Users can associate arbitrary data with a reaction
using a standard (key, value) approach.
::
>>> from oklo.core.ids import NuclideId, ReactionId
>>> from oklo.core.defs import ReactionType
>>> from oklo.core.reaction import Reaction
>>> B_12_beta_decay_id = ReactionId(init_nucl_id=NuclideId('Boron_12'), \
reac_type=ReactionType.BetaDecay)
>>> B_12_beta_decay = Reaction(reac_id=B_12_beta_decay_id)
>>> B_12_beta_decay.initial_nuclide_id.name
Boron_12
>>> B_12_beta_decay.final_nuclide_id.name
Carbon_12
>>> from oklo.core.units import Hz
>>> B_12_beta_decay['current_rate'] = 1.0 * Hz
>>> B_12_beta_decay['current_rate'] / Hz
1.0


ReactionNetwork:
----------------

A ReactionNetwork is a collection of nuclides and reactions relating
these nuclides. This class serves as a standard entry point for
calculation of quantities of interest. For example, users can iterate
over the nuclides and reactions within the network to calculate total
quantities for the network.

This class is effectively a 'graph' data structure in computer science
lingo, where a set of nodes (nuclides) are connected by a set of links
(reactions).

Physical Models (NuclideModel and ReactionModel):
-------------------------------------------------

A physical model is a user-defined class which defines rules for
automating the addition of user-specified data to the whiteboards
Nuclides or Reactions. For example, you could specify the relative
abundance of each nuclide present within the sun according to your
preferred physical model.

Users should define their own physical model class which inherits from
either NuclideModel or ReactionModel base classes, and implements a
'process(nuclide)' or 'process(reaction)' function which adds the
appropriate data to the whiteboard based on the unique nuclide or
reaction ID.

Factories (NuclideFactory and ReactionFactory):
-----------------------------------------------

Factories provide a convenient method to populate a ReactionNetwork
given one or a set of physical models.

Examples:
=========

For a more advance example, demonstrating the use of models and
factories, execute the following::
$ python -i oklo/examples/antineutrino_spectrum_endf.py

This builds a reaction network for modeling a nominal commercial PWR
reactor. The network is populated with tabulated nuclear data on
cumulative fission yields and beta decay spectra. The network is then
used to estimate the average antineutrino energy spectrum emitted per
fission in the reactor.

If matplotlib is installed, then associated figures will also be
generated.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

oklo-0.1-py2.py3-none-any.whl (626.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file oklo-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for oklo-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 362f4696f06faa2c8d732c6dfc2f9647e1f2f18b6034e7102c7dc216164c60b7
MD5 ac7c12c4ba24be96f0f67fda7b29330a
BLAKE2b-256 eed5e2e967c2e272ef236ea036e3956eb81456700affb72539ddb8726f030ef8

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