A tool for making neutronics material cards for use in OpenMC
Project description
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
Installation
To use the code you will need to have OpenMC installed OpenMC
The code can be easily installed using pip
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 isotopes 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 access a material from the internal collection called eurofer which has about 60 isotopes of and 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 caluclated either by an 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 slightly 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
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
File details
Details for the file neutronics_material_maker-0.1.3.tar.gz
.
File metadata
- Download URL: neutronics_material_maker-0.1.3.tar.gz
- Upload date:
- Size: 37.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43f89bc94ca76bd45fe26cb59b1a17c801ccf0db1578d304589f050175070def |
|
MD5 | 032d93946f00f8a4346d1f2a3bcf265c |
|
BLAKE2b-256 | 9d7b7358772bc7cd8234f861047d1d77c64650126d39bb8d5324f0ffe2f56a37 |
File details
Details for the file neutronics_material_maker-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: neutronics_material_maker-0.1.3-py3-none-any.whl
- Upload date:
- Size: 42.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c36852de7601876260da87db12fbc8d78b089814c3be7e741bd40227f1fc1719 |
|
MD5 | 920f132364b081f58a831fba9a5b9e7a |
|
BLAKE2b-256 | fa844d24ffe1e2ae655b401b3952b8bd28c98816abc2de9de9183e01c4309188 |