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(nuclideName, burn, xs, expandTo)[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.

nuclideName

The name of the nuclide

Type

str

burn

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.

Type

bool

xs

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.

Type

bool

expandTo

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 not O18). The nuclides will be scaled up uniformly to account for any missing natural nuclides.

Type

list of str, optional

nuclideName

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

burn

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

xs

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

expandTo

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

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.

__round_trip_data
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 their nuclideName.

Initialize a Map.

Parameters
  • *args

    sequence of key/value pairs.

  • **kwargs

    kwargs for input to OrderedDict.

item_type

alias of NuclideFlag

key_attr

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

attributes = <yamlize.attribute_collection.KeyedListAttributeCollection object>
class armi.reactor.blueprints.isotopicOptions.CustomIsotopic(name, inputFormat, density)[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

_density

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

_allowedFormats = {'mass fractions', 'number densities', 'number fractions'}
name

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

inputFormat

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

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.

_initializeMassFracs()[source]
attributes = <yamlize.attribute_collection.MapAttributeCollection object>
_expandElementMassFracs()[source]

Expand the custom isotopics input entries that are elementals to isotopics.

This is necessary when the element name is not a elemental nuclide. Most everywhere else expects Nuclide objects (or nuclide names). This input allows a user to enter “U” which would expand to the naturally occurring uranium isotopics.

This is different than the isotopic expansion done for meeting user-specified modeling options (such as an MC**2, or MCNP expecting elements or isotopes), because it translates the user input into something that can be used later on.

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 CustomIsotopic

key_attr

Represents an attribute of a Python class, and a key/value pair in YAML.

name

name of the attribute within the Python class

Type

str

key

name of the attribute within the YAML representation

Type

str

type

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.

Type

type or ANY

default

default value if not supplied in YAML. If default=NODEFAULT, then the attribute must be supplied.

Type

value or NODEFAULT

storage_name

'_yamlized_' + name, stored as a separate attribute for speed.

Type

str

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)

armi.reactor.blueprints.isotopicOptions.genDefaultNucFlags()[source]

Perform all the yamlize-required type conversions.