armi.reactor.blueprints.isotopicOptions module¶
Defines nuclide flags and custom isotopics via input.
Nuclide flags control meta-data about nuclides. Custom isotopics allow specification of arbitrary isotopic compositions.
- class armi.reactor.blueprints.isotopicOptions.NuclideFlag(*args, **kwargs)[source]¶
Bases:
yamlize.objects.Object
Defines whether or not each nuclide is included in the burn chain and cross sections.
Also controls which nuclides get expanded from elementals to isotopics and which natural isotopics to exclude (if any). Oftentimes, cross section library creators include some natural isotopes but not all. For example, it is common to include O16 but not O17 or O18. Each code has slightly different interpretations of this so we give the user full control here.
We also try to provide useful defaults.
There are lots of complications that can arise in these choices. It makes reasonable sense to use elemental compositions for things that are typically used without isotopic modifications (Fe, O, Zr, Cr, Na). If we choose to expand some or all of these to isotopics at initialization based on cross section library requirements, a single case will work fine with a given lattice physics option. However, restarting from that case with different cross section needs is challenging.
- Variables
~NuclideFlag.nuclideName (str) – The name of the nuclide
~NuclideFlag.burn (bool) – True if this nuclide should be added to the burn chain. If True, all reachable nuclides via transmutation and decay must be included as well.
~NuclideFlag.xs (bool) – True if this nuclide should be included in the cross section libraries. Effectively, if this nuclide is in the problem at all, this should be true.
~NuclideFlag.expandTo (list of str, optional) – isotope nuclideNames to expand to. For example, if nuclideName is
O
then this could be["O16", "O17"]
to expand it into those two isotopes (but notO18
). The nuclides will be scaled up uniformly to account for any missing natural nuclides.
- nuclideName¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- burn¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- xs¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- expandTo¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- fileAsActiveOrInert(activeSet, inertSet, undefinedBurnChainActiveNuclides)[source]¶
Given a nuclide or element name, file it as either active or inert.
If isotopic expansions are requested, include the isotopics rather than the NaturalNuclideBase, as the NaturalNuclideBase will never occur in such a problem.
- attributes = <yamlize.attribute_collection.AttributeCollection object>¶
- class armi.reactor.blueprints.isotopicOptions.NuclideFlags(*args, **kwargs)[source]¶
Bases:
yamlize.maps.KeyedList
An OrderedDict of
NuclideFlags
, keyed by theirnuclideName
.Initialize a Map.
- Parameters
*args – sequence of key/value pairs.
**kwargs – kwargs for input to OrderedDict.
- item_type¶
alias of
armi.reactor.blueprints.isotopicOptions.NuclideFlag
- key_attr¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- attributes = <yamlize.attribute_collection.KeyedListAttributeCollection object>¶
- class armi.reactor.blueprints.isotopicOptions.CustomIsotopic(*args)[source]¶
Bases:
yamlize.maps.Map
User specified, custom isotopics input defined by a name (such as MOX), and key/pairs of nuclide names and numeric values consistent with the
input format
.Initialize a Map.
- Parameters
*args – sequence of key/value pairs.
**kwargs – kwargs for input to OrderedDict.
- key_type¶
alias of
yamlize.yamlizable.Yamlizablestr
- value_type¶
alias of
yamlize.yamlizable.Yamlizablefloat
- name¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- inputFormat¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- property density¶
- classmethod from_yaml(loader, node, rtd)[source]¶
Override the
Yamlizable.from_yaml
to inject custom data validation logic, and complete initialization of the object.
- classmethod from_yaml_key_val(loader, key_node, val_node, key_attr, rtd)[source]¶
Override the
Yamlizable.from_yaml
to inject custom data validation logic, and complete initialization of the object.
- attributes = <yamlize.attribute_collection.MapAttributeCollection object>¶
- apply(material)[source]¶
Apply specific isotopic compositions to a component.
Generically, materials have composition-dependent bulk properties such as mass density. Note that this operation does not update these material properties. Use with care.
- Parameters
material (Material) – An ARMI Material instance.
- class armi.reactor.blueprints.isotopicOptions.CustomIsotopics(*args, **kwargs)[source]¶
Bases:
yamlize.maps.KeyedList
OrderedDict of CustomIsotopic objects, keyed by their name.
Initialize a Map.
- Parameters
*args – sequence of key/value pairs.
**kwargs – kwargs for input to OrderedDict.
- attributes = <yamlize.attribute_collection.KeyedListAttributeCollection object>¶
- item_type¶
alias of
armi.reactor.blueprints.isotopicOptions.CustomIsotopic
- key_attr¶
Represents an attribute of a Python class, and a key/value pair in YAML.
- Variables
name (str) – name of the attribute within the Python class
key (str) – name of the attribute within the YAML representation
type (type or ANY) – type of the attribute within the Python class. When
ANY
, the type is a pass-through and whatever YAML determines it should be will be applied.default (value or NODEFAULT) – default value if not supplied in YAML. If
default=NODEFAULT
, then the attribute must be supplied.storage_name (str) –
'_yamlized_' + name
, stored as a separate attribute for speed.
- apply(material, customIsotopicsName)[source]¶
Apply specific isotopic compositions to a component.
Generically, materials have composition-dependent bulk properties such as mass density. Note that this operation does not update these material properties. Use with care.
- Parameters
material (Material) – Material instance to adjust.
customIsotopicName (str) – String corresponding to the
CustomIsoptopic.name
.
- armi.reactor.blueprints.isotopicOptions.getDefaultNuclideFlags()[source]¶
Return a default set of nuclides to model and deplete.
Notes
The nuclideFlags input on blueprints has confused new users and is infrequently changed. It will be moved to be a user setting, but in any case a reasonable default should be provided. We will by default model medium-lived and longer actinides between U234 and CM247.
We will include B10 and B11 without depletion, sodium, and structural elements.
We will include LFPs with depletion.
- armi.reactor.blueprints.isotopicOptions.autoSelectElementsToKeepFromSettings(cs)[source]¶
Intelligently choose elements to expand based on settings.
If settings point to a particular code and library and we know that combo requires certain elementals to be expanded, we flag them here to make the user input as simple as possible.
This determines both which elementals to keep and which specific expansion subsets to use.
Notes
This logic is expected to be moved to respective plugins in time.
- Returns
elementalsToKeep (set) – Set of NaturalNuclideBase instances to not expand into natural isotopics.
expansions (dict) – Element to list of nuclides for expansion. For example: {oxygen: [oxygen16]} indicates that all oxygen should be expanded to O16, ignoring natural O17 and O18. (variables are Natural/NuclideBases)