Skip to main content

A tool for making neutronics material cards for use in OpenMC, MCNP, Serpent, Shift and Fispact

Project description

N|Python CircleCI 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

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 install neutronics_material_maker -c conda-forge

Alternatively the code can be easily installed using pip (which doesn't currently include OpenMC)

pip install neutronics_material_maker

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 - Basic Material

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('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('H2O', temperature_in_C=300, pressure_in_Pa=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('Li4SiO4', enrichment=60)
my_mat2.openmc_material

Usage - MultiMaterial (Mixed Materials))

Materials can also be mixed together using the MultiMaterial class. 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('Li4SiO4', enrichment=60)
my_mat2 = nmm.Material('Be12Ti')
my_mat3 = MultiMaterial(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.Material('tungsten')
my_mat.openmc_material()
my_mat.mcnp_material(id=1, zaid_suffix='.31c)
my_mat.serpent_material(zaid_suffix='.31c))
my_mat.fispact_material(volume=100)

Further Examples

Further examples can be found in the UKAEA OpenMC 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.

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

neutronics_material_maker-0.1.16.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

neutronics_material_maker-0.1.16-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file neutronics_material_maker-0.1.16.tar.gz.

File metadata

  • Download URL: neutronics_material_maker-0.1.16.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for neutronics_material_maker-0.1.16.tar.gz
Algorithm Hash digest
SHA256 24231f055e386de03f53339057236a98c0881b265cd5a762f8af60a531acd223
MD5 515d42418a005c82dad1142385976c2a
BLAKE2b-256 1df612565cbb8c7733fc9f761232a0525282b3bc6622997ab545dbe3790344dd

See more details on using hashes here.

File details

Details for the file neutronics_material_maker-0.1.16-py3-none-any.whl.

File metadata

  • Download URL: neutronics_material_maker-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 46.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for neutronics_material_maker-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 93e4fa6257d9050a524a99873717a12580421ba1fe7ec75c45bce751bc519c44
MD5 4faa435301e87e55b628428e46c8e3e3
BLAKE2b-256 f36d976f8daeea00fb1a86290c304a3e6065cc53e79ebc0c27a17138418d62b3

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