Skip to main content

N|Python CI testing codecov PyPI version Documentation Status Code Quality Score Code Grade

Neutronics Material Maker

The aim of this project is to facilitate the creation of materials for use in neutronics codes such as OpenMC, Serpent, MCNP and Fispact.

The hope is that by having this collection of materials it is easier to reuse materials across projects, use a common source with less room for user error.

One nice aspect of this material maker is the ability to change the density of a material based on isotope enrichment (e.g. inbuild lithium ceramics), temperature and pressure.

:point_right: Documentation

:point_right: Video presentation

Installation

Conda

To use the code you will need to have OpenMC installed OpenMC.

The recommended method is to install from Conda Forge which also installs all the dependencies including OpenMC.

conda create --name new_env python=3.8
conda activate new_env
conda install neutronics_material_maker -c conda-forge

Pip

Alternatively the code can be easily installed using pip. This method doesn't currently include OpenMC so that will have to be installed separately using Conda or compiled.

pip install neutronics_material_maker

To include the optional capability of calculating the density of coolants additional packages are needed (CoolProp). A slightly modified pip install is required in this case.

pip install "neutronics_material_maker[density]"

Features

Materials for using in neutronics codes have two main aspects; a list of isotopes along with their abundance and the material density.

This code contains an internal collection of materials with their isotope abundances and densities (sometimes temperature, pressure and enrichment dependant), but you may also import your own materials collection.

Usage - Finding Available Materials

Each of the materials available is stored in an internal dictionary that can be accessed using the AvailableMaterials() command.

import neutronics_material_maker as nmm
all_materials = nmm.AvailableMaterials()
print(all_materials.keys())

Usage - Material()

import neutronics_material_maker as nmm
my_mat = nmm.Material(
    name='my_custom_material',
    isotopes={'Li6':0.5, 'Li7':0.5},
    density=2.01,
    percent_type='ao',
    density_unit='g/cm3'
)
my_mat.openmc_material

Usage - Material from library

Here is an example that accesses a material from the internal collection called eurofer which has about 60 isotopes of a density of 7.78g/cm3.

import neutronics_material_maker as nmm
my_mat = nmm.Material.from_library('eurofer')
my_mat.openmc_material

Usage - Hot Pressurised Material

For several materials within the collection the temperature and the pressure impacts the density of the material. The neutronics_material_maker adjusts the density to take temperature and the pressure into account when appropriate. Densities are calculated either by a material specific formula (for example FLiBe) or using CoolProps (for example coolants)

import neutronics_material_maker as nmm
my_mat1 = nmm.Material.from_library(name='H2O', temperature=600, pressure=15e6)
my_mat1.openmc_material

For several materials within the collection the density is adjusted when the material is enriched. For breeder blankets in fusion it is common to enrich the lithium 6 content.

Usage - Enriched Material

Lithium ceramics used in fusion breeder blankets often contain enriched lithium-6 content. This slight change in density is accounted for by the neutronics_material_maker.

import neutronics_material_maker as nmm
my_mat2 = nmm.Material.from_library(name='Li4SiO4', enrichment=60)
my_mat2.openmc_material

Usage - Material.from_mixture

Materials can also be mixed together using the from_mixture method. This accepts a list of neutronics_material_maker.Materials or openmc.Material objects along with the material fractions (fracs).

import neutronics_material_maker as nmm
my_mat1 = nmm.Material.from_library(name='Li4SiO4', packing_fraction=0.64)
my_mat2 = nmm.Material.from_library(name='Be12Ti')
my_mat3 = nmm.Material.from_mixture(materials=[my_mat1, my_mat2],
                        fracs=[0.4, 0.6],
                        percent_type='vo')
my_mat3.openmc_material

Usage - Importing Your Own Material Library

Assuming you have a JSON file saved as mat_lib.json containing materials defined in the same format as the exisiting materials then you can import this file into the package using AddMaterialFromFile(). Another option is to use AddMaterialFromDir() to import a directory of json files.

import neutronics_material_maker as nmm
nmm.AddMaterialFromFile('mat_lib.json')
nmm.AvailableMaterials() # this will print the new larger list of materials

Usage - Exporting To Different Neutronics Codes

You can export to OpenMC, Serpent, MCNP and Fispact with the appropiate arguments.

import neutronics_material_maker as nmm
my_mat = nmm.Materialfrom_library('tungsten')

# openmc
my_mat.openmc_material

# mcnp - required a material_id to be set
my_mat.material_id = 1
my_mat.mcnp_material

# serpent
my_mat.serpent_material

# fispact - requires volume to be specified
my_mat.volume_in_cm3 = 1 / my_mat.density
my_mat.fispact_material

Further Examples

Further examples can be found in the neutronics workshop task 11 and in the Documentation

Acknowledgement

Inspired by software projects Pyne and making use of OpenMC functionality and the JSON file format and PNNL for many definitions.

Metadata

Release files for neutronics-material-maker 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neutronics-material-maker 1.2.3
File Size Uploaded
neutronics_material_maker-1.2.3.tar.gz 62.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neutronics-material-maker 1.2.3
File Interpreter ABI Platform
neutronics_material_maker-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 107.6 kB

Release files / neutronics_material_maker-1.2.3.tar.gz

Download URL neutronics_material_maker-1.2.3.tar.gz
Size 62.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c7a8f289cdcbf30b5281cfaae403b7e189ea87db7609b0aada528333ade8da93
BLAKE2b-256 checksum
How to use checksums
81151602dff37b4c161a306caa54a5296fb11e4d41d7bafe0a8fe88022d39eca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release files / neutronics_material_maker-1.2.3-py3-none-any.whl

Download URL neutronics_material_maker-1.2.3-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba8d609f53a8f0fd9109b84cbc39e34a45c703922999fbb564c118f93038a685
BLAKE2b-256 checksum
How to use checksums
2be5463bd9a62fa00e9462bf3cebda31b57d7fd9c92bcc7178f461c7436cbbd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.3.7

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

1 release file

0.2.7

2 release files

0.2.6

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.1.16

2 release files

0.1.13

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page