neutronics_material_maker
A tool for making reproducible materials and standardizing use across several neutronics codes
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 25 committers (8.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.6%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A tool for making reproducible materials and standardizing use across several neutronics codes
Basic Info
- Host: GitHub
- Owner: fusion-energy
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://neutronics-material-maker.readthedocs.io
- Size: 28.3 MB
Statistics
- Stars: 24
- Watchers: 2
- Forks: 13
- Open Issues: 2
- Releases: 10
Topics
Metadata Files
README.md
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.
bash
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.
bash
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.
bash
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.
python
import neutronics_material_maker as nmm
all_materials = nmm.AvailableMaterials()
print(all_materials.keys())
Usage - Material()
python
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.
python
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 neutronicsmaterialmaker 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)
python
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 neutronicsmaterialmaker.
python
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 frommixture method. This
accepts a list of ```neutronicsmaterial_maker.Materialsor
openmc.Material``` objects along with the material fractions (fracs).
python
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.
python
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.
```python import neutronicsmaterialmaker as nmm mymat = nmm.Materialfromlibrary('tungsten')
openmc
mymat.openmcmaterial
mcnp - required a material_id to be set
mymat.materialid = 1 mymat.mcnpmaterial
serpent
mymat.serpentmaterial
fispact - requires volume to be specified
mymat.volumeincm3 = 1 / mymat.density mymat.fispactmaterial ```
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.
Owner
- Name: Fusion Energy
- Login: fusion-energy
- Kind: organization
- Repositories: 29
- Profile: https://github.com/fusion-energy
A collection of software projects related to fusion energy
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Shimwell" given-names: "Jonathan" orcid: "https://orcid.org/0000-0001-6909-0946" - family-names: "Billingsley" given-names: "John" - family-names: "Coleman" given-names: "Matti" - family-names: "Whan Bae" given-names: "Jin" - family-names: "León Hernández" given-names: "Daniel" - family-names: "Worrall" given-names: "Ross" - family-names: "Katie" given-names: "Taylor" - family-names: "Anurag" given-names: "Saigiridhari" - family-names: "Ariful" given-names: "Islam Pranto" title: "Neutronics Material Maker: A tool for making reproducible materials and standardizing use across several neutronics codes " version: 1.0.2 date-released: 2021-9-13 url: "https://github.com/fusion-energy/neutronics_material_maker"
GitHub Events
Total
- Watch event: 4
- Fork event: 1
Last Year
- Watch event: 4
- Fork event: 1
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Jon | m****l@j****m | 192 |
| Jonathan Shimwell | j****l@u****k | 125 |
| Jonathan Shimwell | j****l@u****a | 66 |
| shimwell | s****l@y****m | 65 |
| autopep8 | a****8@u****m | 54 |
| Jonathan Shimwell | j****l@u****k | 41 |
| billingsley-john | j****6@y****m | 20 |
| Matti Coleman | m****n@g****m | 15 |
| Matti Coleman | m****6@g****k | 9 |
| Ross Worrall | r****l@u****k | 5 |
| shimwell | s****l@u****m | 4 |
| Jin Whan Bae | n****e@g****m | 3 |
| daleher | d****3@g****m | 3 |
| Ross Allen | 3****o@u****m | 2 |
| Ross Worrall | r****l@e****) | 2 |
| Steve Bradnam | s****m@e****) | 2 |
| Steve Lilley | p****l@u****m | 2 |
| katie-taylor | 5****r@u****m | 1 |
| Ariful Islam Pranto | p****3@g****m | 1 |
| Jin Whan Bae | b****j@o****v | 1 |
| Jonathan Shimwell | d****l@g****m | 1 |
| katet | k****r@u****k | 1 |
| Ross Worrall | 3****l@u****m | 1 |
| Saigiridhari, Anurag | a****i@u****k | 1 |
| DanShort12 | 6****2@u****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 7
- Total pull requests: 38
- Average time to close issues: about 14 hours
- Average time to close pull requests: 10 days
- Total issue authors: 6
- Total pull request authors: 8
- Average comments per issue: 2.29
- Average comments per pull request: 0.68
- Merged pull requests: 33
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: about 11 hours
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- py1sl (2)
- shimwell (1)
- RemDelaporteMathurin (1)
- P-S-S-M (1)
- repositony (1)
Pull Request Authors
- shimwell (30)
- RossWorrall (3)
- repositony (2)
- paulromano (2)
- mwart-cfs (1)
- generein (1)
- py1sl (1)
- Allentro (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 2,166 last-month
-
Total dependent packages: 1
(may contain duplicates) -
Total dependent repositories: 4
(may contain duplicates) - Total versions: 55
- Total maintainers: 4
pypi.org: neutronics-material-maker
A tool for making reproducible materials and standardizing use across several neutronics codes
- Homepage: https://github.com/fusion-energy/neutronics_material_maker
- Documentation: https://neutronics-material-maker.readthedocs.io/
- License: MIT License Copyright (c) 2020 UKAEA and neutronics-material-maker contributors Copyright (c) 2021 neutronics-material-maker contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 1.2.1
published over 1 year ago
Rankings
Maintainers (4)
conda-forge.org: 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.
- Homepage: https://github.com/fusion-energy/neutronics_material_maker
- License: MIT
-
Latest release: 1.1.1
published almost 4 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- stefanzweifel/git-auto-commit-action v4 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- continuumio/miniconda3 4.9.2 build
- asteval >=0.9.20
- actions/checkout v4 composite
- conda-incubator/setup-miniconda v3 composite
- openmc
- python 3.8.*
- openmc
