Skip to content

Commit 1d75981

Browse files
authored
Add PNNL material composition library (#4134)
1 parent 21d0b2f commit 1d75981

5 files changed

Lines changed: 4674 additions & 10 deletions

File tree

‎docs/source/usersguide/materials.rst‎

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,87 @@ argument `enrichment_type`. For example the following would enrich Li6 to 15wo%:
7575
mat.add_element('Li', 1.0, enrichment=15.0, enrichment_target='Li6',
7676
enrichment_type='wo')
7777

78-
Often, cross section libraries don't actually have all naturally-occurring
79-
isotopes for a given element. For example, in ENDF/B-VII.1, cross section
80-
evaluations are given for O16 and O17 but not for O18. If OpenMC is aware of
81-
what cross sections you will be using (through the
82-
:envvar:`OPENMC_CROSS_SECTIONS` environment variable), it will attempt to only
83-
put isotopes in your model for which you have cross section data. In the case of
84-
oxygen in ENDF/B-VII.1, the abundance of O18 would end up being lumped with O16.
78+
Some older cross section libraries do not have all naturally-occurring isotopes
79+
for a given element. For example, in ENDF/B-VII.1, cross section evaluations are
80+
given for O16 and O17 but not for O18. If OpenMC is aware of what cross sections
81+
you will be using through ``openmc.config['cross_sections']``, it will attempt
82+
to only put isotopes in your model for which you have cross section data. In the
83+
case of oxygen in ENDF/B-VII.1, the abundance of O18 would end up being lumped
84+
with O16.
85+
86+
------------------
87+
Material Libraries
88+
------------------
89+
90+
OpenMC includes material compositions from Revision 2 of the `PNNL Compendium of
91+
Material Composition Data for Radiation Transport Modeling
92+
<https://doi.org/10.2172/1782721>`_. A material can be created from this library
93+
with :meth:`Material.from_library`, for example::
94+
95+
sodium_oxide = openmc.Material.from_library('Sodium Oxide')
96+
97+
Keyword arguments accepted by :class:`Material` can also be specified, such as
98+
a material ID or temperature::
99+
100+
salt_water = openmc.Material.from_library(
101+
'Salt Water', material_id=10, temperature=293.15)
102+
103+
Material names are case sensitive, but whitespace is normalized when looking up
104+
a name. The default bundled library is ``'pnnl_v2'``. Each call returns a new,
105+
independent material with the density and composition reported in the compendium.
106+
The available material names can be retrieved without creating any materials::
107+
108+
names = openmc.Material.get_library_material_names()
109+
110+
Natural compositions in the PNNL library are stored as elemental atom fractions
111+
and expanded using :meth:`Material.add_element`. As described above, OpenMC will
112+
account for the nuclides available in the cross section library indicated by
113+
``openmc.config['cross_sections']``. Materials that are explicitly isotopic in
114+
the compendium, such as enriched uranium or He-3 proportional gas, retain those
115+
specified nuclides. OpenMC cannot substitute for a required isotope if it is
116+
absent from the selected nuclear data library.
117+
118+
The compendium values are representative material definitions; actual density
119+
and composition can vary. Users should confirm that a library material is
120+
appropriate for their application.
121+
122+
Custom libraries can be registered from local JSON files. Registration applies
123+
to the current Python process and cannot replace a library with the same name::
124+
125+
openmc.Material.register_library('custom', 'custom_materials.json')
126+
names = openmc.Material.get_library_material_names('custom')
127+
material = openmc.Material.from_library(
128+
'My Material', library='custom', temperature=600.0)
129+
130+
Custom files use the same schema as the bundled library. A minimal library
131+
containing an elemental composition is shown below:
132+
133+
.. code-block:: json
134+
135+
{
136+
"schema_version": 1,
137+
"density_units": "g/cm3",
138+
"percent_type": "ao",
139+
"materials": {
140+
"My Material": {
141+
"density": 1.0,
142+
"elements": {
143+
"H": 0.666667,
144+
"O": 0.333333
145+
}
146+
}
147+
}
148+
}
149+
150+
Each material can contain ``elements``, ``nuclides``, or both. Elemental
151+
components are expanded using :meth:`Material.add_element` and
152+
``openmc.config['cross_sections']``. Nuclide components retain their explicitly
153+
specified isotopic composition. The top-level ``percent_type`` and
154+
``density_units`` values are passed to :class:`Material`, which validates them
155+
along with the density and components when a material is created. Component
156+
values can be relative amounts and do not need to sum to one. Additional
157+
provenance metadata, such as a top-level ``source`` or a per-material note, is
158+
permitted and ignored when constructing a material.
85159

86160
-----------------------
87161
Thermal Scattering Data
@@ -258,4 +332,3 @@ been generated, you can tell OpenMC to use this file either by setting
258332
materials.cross_sections = '/path/to/cross_sections.xml'
259333

260334
.. _MCNP: https://mcnp.lanl.gov/
261-

0 commit comments

Comments
 (0)