armi.physics.neutronics.crossSectionSettings module

The data structures and schema of the cross section modeling options.

These are advanced/compound settings that are carried along in the normal cs object but aren’t simple key/value pairs.

The cs object could either hold the base data (dicts) and create instances of these data structure objects as needed, or the settings system could actually hold instances of these data structures. It is most convenient to let the cs object hold actual instances of these data.

See detailed docs in :doc: Lattice Physics <reference/physics/neutronics/latticePhysics/latticePhysics>.

class armi.physics.neutronics.crossSectionSettings.XSGeometryTypes(value)[source]

Bases: Enum

Data structure for storing the available geometry options within the framework.

ZERO_DIMENSIONAL = 1
ONE_DIMENSIONAL_SLAB = 2
ONE_DIMENSIONAL_CYLINDER = 4
TWO_DIMENSIONAL_HEX = 8
classmethod getStr(typeSpec: Enum)[source]

Return a string representation of the given typeSpec.

Examples

XSGeometryTypes.getStr(XSGeometryTypes.ZERO_DIMENSIONAL) == “0D” XSGeometryTypes.getStr(XSGeometryTypes.TWO_DIMENSIONAL_HEX) == “2D hex”

class armi.physics.neutronics.crossSectionSettings.XSSettings(*args, **kwargs)[source]

Bases: dict

Container for holding multiple cross section settings based on their XSID.

This is intended to be stored as part of a case settings and to be used for cross section modeling within a run.

Notes

This is a specialized dictionary that functions in a similar manner as a defaultdict where if a key (i.e., XSID) is missing then a default will be set. If a missing key is being added before the setDefaults method is called then this will produce an error.

This cannot just be a defaultdict because the creation of new cross section settings are dependent on user settings.

setDefaults(blockRepresentation, validBlockTypes)[source]

Set defaults for current and future xsIDs based user settings.

This must be delayed past read-time since the settings that effect this may not be loaded yet and could still be at their own defaults when this input is being processed. Thus, defaults are set at a later time.

Parameters:
  • blockRepresentation (str) – Valid options are provided in CrossSectionGroupManager.BLOCK_COLLECTIONS

  • validBlockTypes (list of str or bool) – This configures which blocks (by their type) that the cross section group manager will merge together to create a representative block. If set to None or True then all block types in the XS ID will be considered. If this is set to False then a default of [“fuel”] will be used. If this is set to a list of strings then the specific list will be used. A typical input may be [“fuel”] to just consider the fuel blocks.

class armi.physics.neutronics.crossSectionSettings.XSModelingOptions(xsID, geometry=None, xsFileLocation=None, fluxFileLocation=None, validBlockTypes=None, blockRepresentation=None, driverID=None, criticalBuckling=None, nuclideReactionDriver=None, externalDriver=None, useHomogenizedBlockComposition=None, numInternalRings=None, numExternalRings=None, mergeIntoClad=None, meshSubdivisionsPerCm=None, xsExecuteExclusive=None, xsPriority=None, xsMaxAtomNumber=None, averageByComponent=False, minDriverDensity=0.0)[source]

Bases: object

Cross section modeling options for a particular XS ID.

Variables:
  • xsID (str) – Cross section ID that is two characters maximum (i.e., AA).

  • geometry (str) – The geometry modeling approximation for regions of the core with this assigned xsID. This is required if the xsFileLocation attribute is not provided. This cannot be set if the xsFileLocation is provided.

  • xsFileLocation (list of str or None) – This should be a list of paths where the cross sections for this xsID can be copied from. This is required if the geometry attribute is not provided. This cannot be set if the geometry is provided.

  • fluxFileLocation (str or None) – This should be a path where a pre-calculated flux solution for this xsID can be copied from. The geometry attribute must be provided with this input.

  • validBlockTypes (str or None) – This is a configuration option for how the cross section group manager determines which blocks/regions to manage as part of the same collection for the current xsID. If this is set to None then all blocks/regions with the current xsID will be considered.

  • blockRepresentation (str) – This is a configuration option for how the cross section group manager will select how to create a representative block based on the collection within the same xsID. See: crossSectionGroupManager.BLOCK_COLLECTIONS.

  • driverID (str) – This is a lattice physics configuration option used to determine which representative block can be used as a “fixed source” driver for another composition. This is particularly useful for non-fuel or highly subcritical regions.

  • criticalBuckling (bool) – This is a lattice physics configuration option used to enable or disable the critical buckling search option.

  • nuclideReactionDriver (str) – This is a lattice physics configuration option that is similar to the driverID, but rather than applying the source from a specific representative block, the neutron source is taken from a single nuclides fission spectrum (i.e., U235). This is particularly useful for configuring SERPENT 2 lattice physics calculations.

  • externalDriver (bool) – This is a lattice physics configuration option that can be used to determine if the fixed source problem is internally driven or externally driven by the driverID region. Externally driven means that the region will be placed on the outside of the current xsID block/region. If this is False then the driver region will be “inside” (i.e., an inner ring in a cylindrical model).

  • useHomogenizedBlockComposition (bool) – This is a lattice physics configuration option that is useful for modeling spatially dependent problems (i.e., 1D/2D). If this is True then the representative block for the current xsID will be be a homogenized region. If this is False then the block will be represented in the geometry type selected. This is mainly used for 1D cylindrical problems.

  • numInternalRings (int) – This is a lattice physics configuration option that is used to specify the number of grid-based rings for the representative block.

  • numExternalRings (int) – This is a lattice physics configuration option that is used to specify the number of grid-based rings for the driver block.

  • mergeIntoClad (list of str) – This is a lattice physics configuration option that is a list of component names to merge into a “clad” component. This is highly-design specific and is sometimes used to merge a “gap” or low-density region into a “clad” region to avoid numerical issues.

  • meshSubdivisionsPerCm (float) – This is a lattice physics configuration option that can be used to control subregion meshing of the representative block in 1D problems.

  • xsExecuteExclusive (bool) – The mpi task that results from this xsID will reserve a full processor and no others will allocate to it. This is useful for time balancing when you have one task that takes much longer than the others.

  • xsPriority – The priority of the mpi tasks that results from this xsID. Lower priority will execute first. starting longer jobs first is generally more efficient.

  • xsMaxAtomNumber (int) – The maximum atom number to model for infinite dilute isotopes in lattice physics. This is used to avoid modeling isotopes with a large atomic number (e.g., fission products) as a depletion product of an isotope with a much smaller atomic number.

  • minDriverDensity (float) – The minimum number density for nuclides included in driver material for a 1D lattice physics model.

Notes

Not all default attributes may be useful for your specific application and you may require other types of configuration options. These are provided as examples since the base latticePhysicsInterface does not implement models that use these. For additional options, consider subclassing the base Setting object and using this model as a template.

property xsType

Return the single-char cross section type indicator.

property buGroup

Return the single-char burnup group indicator.

property xsIsPregenerated

True if this points to a pre-generated XS file.

property fluxIsPregenerated

True if this points to a pre-generated flux solution file.

serialize()[source]

Return as a dictionary without CONF_XSID and with None values excluded.

validate()[source]

Performs validation checks on the inputs and provides warnings for option inconsistencies.

Raises:

ValueError – When the mutually exclusive xsFileLocation and geometry attributes are provided or when neither are provided.

setDefaults(blockRepresentation, validBlockTypes)[source]

This sets the defaults based on some recommended values based on the geometry type.

Parameters:
  • blockRepresentation (str) – Valid options are provided in CrossSectionGroupManager.BLOCK_COLLECTIONS

  • validBlockTypes (list of str or bool) – This configures which blocks (by their type) that the cross section group manager will merge together to create a representative block. If set to None or True then all block types in the XS ID will be considered. If this is set to False then a default of [“fuel”] will be used. If this is set to a list of strings then the specific list will be used. A typical input may be [“fuel”] to just consider the fuel blocks.

Notes

These defaults are application-specific and design specific. They are included to provide an example and are tuned to fit the internal needs of TerraPower. Consider a separate implementation/subclass if you would like different behavior.

armi.physics.neutronics.crossSectionSettings.serializeXSSettings(xsSettingsDict: Union[XSSettings, Dict]) Dict[str, Dict][source]

Return a serialized form of the XSSettings as a dictionary.

Notes

Attributes that are not set (i.e., set to None) will be skipped.

class armi.physics.neutronics.crossSectionSettings.XSSettingDef(name)[source]

Bases: Setting

Custom setting object to manage the cross section dictionary-like inputs.

Notes

This uses the xsSettingsValidator schema to validate the inputs and will automatically coerce the value into a XSSettings dictionary.

dump()[source]

Return a serialized version of the XSSetting object.

armi.physics.neutronics.crossSectionSettings.xsSettingsValidator(xsSettingsDict: Dict[str, Dict]) XSSettings[source]

Returns a XSSettings object if validation is successful.

Notes

This provides two levels of checks. The first check is that the attributes provided as user input contains the correct key/values and the values are of the correct type. The second check uses the XSModelingOptions.validate method to check for input inconsistencies and provides warnings if there are any issues.