armi.physics.neutronics.crossSectionGroupManager module¶
Cross section group manager handles burnup-dependent properties of microscopic cross sections.
Blocks are specified to be in a certain cross section type and burnup group. Together, these form the cross section group. By advancing blocks by their burnup into different groups, we capture some of the physical effects related to depletion.
XS types are typically single capital letters like A
BU groups are also capital letters.
A XS group of AB is in XS type A
and burnup group B
.
This module groups the blocks according to their XS groups and can determine which block is to be deemed representative of an entire set of blocks in a particular xs group. Then the representative block is sent to a lattice physics kernel for actual physics calculations.
Generally, the cross section manager is a attribute of the lattice physics code interface (e.g.
the mc2Interface
.
Examples
csm = CrossSectionGroupManager() csm._setBuGroupBounds(cs[‘buGroups’]) csm._addXsGroupsFromBlocks(blockList) csm.createRepresentativeBlocks() representativeBlockList = csm.representativeBlocks.values() blockThatRepresentsBA = csm.representativeBlocks[‘BA’]
The class diagram is provided in xsgm-class-diagram
-
armi.physics.neutronics.crossSectionGroupManager.
describeInterfaces
(cs)[source]¶ Function for exposing interface(s) to other code
-
armi.physics.neutronics.crossSectionGroupManager.
getXSTypeNumberFromLabel
(xsTypeLabel: str) → int[source]¶ Convert a XSID label (e.g. ‘AA’) to an integer.
Useful for visualizing XS type in XTVIEW.
2-digit labels are supported when there is only one burnup group.
-
armi.physics.neutronics.crossSectionGroupManager.
getXSTypeLabelFromNumber
(xsTypeNumber: int) → int[source]¶ Convert a XSID label (e.g. 65) to an XS label (e.g. ‘A’).
Useful for visualizing XS type in XTVIEW.
2-digit labels are supported when there is only one burnup group.
-
class
armi.physics.neutronics.crossSectionGroupManager.
BlockCollection
(allNuclidesInProblem, validBlockTypes=None)[source]¶ Bases:
list
Controls which blocks are representative of a particular cross section type/BU group
This is a list with special methods.
-
_getNewBlock
()[source]¶ Create a new block instance.
Notes
Should only be used by average because of name (which may not matter)
-
_checkValidWeightingFactors
()[source]¶ Verify the validity of the weighting parameter.
Warning
Don’t mix unweighted blocks (flux=0) w/ weighted ones
-
calcAvgNuclideTemperatures
()[source]¶ Calculate the average nuclide temperatures in this collection based on the blocks in the collection.
If a nuclide is in multiple components, that’s taken into consideration.
\[T = \frac{\sum{n_i v_i T_i}}{\sum{n_i v_i}}\]where \(n_i\) is a number density, \(v_i\) is a volume, and \(T_i\) is a temperature.
See also
terrapower.physics.neutronics.mc2.mc2Writers.Mc2Writer._getAllNuclideDensities()
uses these values
-
_getNucTempHelper
()[source]¶ Get temperature averaging numerator and denominator for block collection.
This is abstract; you must override it.
-
getCandidateBlocks
()[source]¶ Get blocks in this collection that are the valid representative type.
Often, peripheral non-fissile blocks (reflectors, control, shields) need cross sections but cannot produce them alone. You can approximate their cross sections by placing them in certain cross section groups. However, we do not want these blocks to be included in the spectrum calculations that produce cross sections. Therefore the subset of valid representative blocks are used to compute compositions, temperatures, etc.
Tip
The proper way to treat non-fuel blocks is to apply a leakage spectrum from fuel onto them.
-
-
class
armi.physics.neutronics.crossSectionGroupManager.
MedianBlockCollection
(allNuclidesInProblem, validBlockTypes=None)[source]¶ Bases:
armi.physics.neutronics.crossSectionGroupManager.BlockCollection
Returns the median burnup block. This is a simple and often accurate approximation.
-
_getNucTempHelper
()[source]¶ Return the Median block nuclide temperature terms.
In this case, there’s only one block to average, so return its averaging terms.
See also
calcAvgNuclideTemperatures()
-
_getMedianBlock
()[source]¶ Return the median burnup Block.
Build list of items for each block when sorted gives desired order
Last item in each tuple is always the block itself (for easy retrieval).
For instance, if you want the median burnup, this list would contain tuples of (burnup, blockName, block). Blockname is included so the order is consistent between runs when burnups are equal (e.g. 0).
-
-
class
armi.physics.neutronics.crossSectionGroupManager.
AverageBlockCollection
(allNuclidesInProblem, validBlockTypes=None)[source]¶ Bases:
armi.physics.neutronics.crossSectionGroupManager.BlockCollection
Block collection that builds a new block based on others in collection
Averages number densities, fission product yields, and fission gas removal fractions.
-
_getAverageNumberDensities
()[source]¶ Get weighted average number densities of the collection.
- Returns
numberDensities – nucName, ndens data (atoms/bn-cm)
- Return type
-
-
armi.physics.neutronics.crossSectionGroupManager.
getBlockNuclideTemperatureAvgTerms
(block, allNucNames)[source]¶ Compute terms (numerator, denominator) of average for this block.
This volume-weights the densities by component volume fraction.
It’s important to count zero-density nuclides (i.e. ones like AM242 that are expected to build up) as trace values at the proper component temperatures.
-
class
armi.physics.neutronics.crossSectionGroupManager.
SlabComponentsAverageBlockCollection
(allNuclidesInProblem, validBlockTypes=None)[source]¶ Bases:
armi.physics.neutronics.crossSectionGroupManager.BlockCollection
Creates a representative 1D slab block.
Notes
Ignores lumped fission products since there is no foreseeable need for burn calculations in 1D slab geometry since it is used for low power neutronic validation.
Checks for consistent component dimensions for all blocks in a group and then creates a new block.
Iterates through components of all blocks and calculates component average number densities. This calculation takes the first component of each block, averages the number densities, and applies this to the number density to the representative block.
-
_makeRepresentativeBlock
()[source]¶ Build a representative fuel block based on component number densities.
-
_getNucTempHelper
()[source]¶ Get temperature averaging numerator and denominator for block collection.
This is abstract; you must override it.
-
static
_checkComponentConsisteny
(b, repBlock, components=None)[source]¶ Verify that all components being homogenized are rectangular and have consistent dimensions.
- Raises
ValueError – When the components in a candidate block do not align with the components in the representative block. This check includes component area, component multiplicity, and nuclide composition.
TypeError – When the shape of the component is not a rectangle.
. warning: – This only checks
consistentNucs
for ones that are important in ZPPR and BFS.:
-
static
_reverseComponentOrder
(block)[source]¶ Move the lattice component to the end of the components list.
-
static
_removeLatticeComponents
(repBlock)[source]¶ Remove the lattice component from the representative block.
Notes
This component does not serve any purpose for XS generation as it contains void material with zero area.
Removing this component does not modify the blocks within the reactor.
-
class
armi.physics.neutronics.crossSectionGroupManager.
FluxWeightedAverageBlockCollection
(*args, **kwargs)[source]¶ Bases:
armi.physics.neutronics.crossSectionGroupManager.AverageBlockCollection
Flux-weighted AverageBlockCollection
-
class
armi.physics.neutronics.crossSectionGroupManager.
CrossSectionGroupManager
(r, cs)[source]¶ Bases:
armi.interfaces.Interface
Looks at the reactor and updates burnup group information based on current burnup.
Contains a
BlockCollection
for each cross section group.Notes
The representative blocks created in the CrossSectionGroupManager are ordered alphabetically by key.
Construct an interface.
The
r
andcs
arguments are required, but may beNone
, where appropriate for the specificInterface
implementation.- Parameters
r (Reactor) – A reactor to attach to
cs (Settings) – Settings object to use
- Raises
RuntimeError – Interfaces derived from Interface must define their name
-
name
= 'xsGroups'¶
-
_REPR_GROUP
= 'represented'¶
-
_NON_REPR_GROUP
= 'non-represented'¶
-
_PREGEN_GROUP
= 'pre-generated'¶
-
interactBOC
(cycle=None)[source]¶ Update representative blocks and block burnup groups.
Notes
The block list each each block collection cannot be emptied since it is used to derive nuclide temperatures.
-
interactEOC
(cycle=None)[source]¶ EOC interaction.
Clear out big dictionary of all blocks to avoid memory issues and out-of-date representers.
-
interactCoupled
(iteration)[source]¶ Update XS groups on each physics coupling iteration to get latest temperatures.
-
_setBuGroupBounds
(upperBuGroupBounds)[source]¶ Set the burnup group structure
- Parameters
upperBuGroupBounds (list) – List of upper burnup values in percent.
- Raises
ValueError – If the provided burnup groups are invalid
-
_updateBurnupGroups
(blockList)[source]¶ Update the burnup group of each block based on its burnup
If only one burnup group exists, then this is skipped so as to accomodate the possibility of 2-character xsGroup values (useful for detailed V&V models w/o depletion).
-
_addXsGroupsFromBlocks
(blockCollectionsByXsGroup, blockList)[source]¶ Build all the cross section groups based on their XS type and BU group
Also ensures that their BU group is up to date with their burnup.
-
_getPregeneratedXsFileLocationData
(xsID)[source]¶ Gather the pregenerated cross section file data and check that the files exist.
Notes
Multiple files can exist on the file location setting for a single XS ID. This checks that all files exist and returns a list of tuples (file path, fileName).
-
createRepresentativeBlocks
()[source]¶ Get a representative block from each cross section ID managed here.
-
createRepresentativeBlocksUsingExistingBlocks
(blockList, originalRepresentativeBlocks)[source]¶ Create a new set of representative blocks using provided blocks.
This uses an input list of blocks and creates new representative blocks for these blocks based on the compositions and temperatures of their original representative blocks.
Notes
This is required for computing Doppler, Voided-Doppler, Temperature, and Voided-Temperature reactivity coefficients, where the composition of the representative block must remain the same, but only the temperatures within the representative blocks are to be modified.
- Parameters
- Returns
blockCollectionByXsGroup (dict) – Mapping between XS IDs and the new block collections
modifiedReprBlocks (dict) – Mapping between XS IDs and the new representative blocks
- Raises
ValueError – If passed list arguments are empty
-
_getModifiedReprBlocks
(blockList, originalRepresentativeBlocks)[source]¶ Create a new representative block for each unique XS ID on blocks to be modified.
- Returns
modifiedReprBlocks (dict) – Mapping between the new XS IDs and the new representative blocks
origXSIDsFromNew (dict) – Mapping between the new representative block XS IDs and the original representative block XS IDs
-
getNextAvailableXsTypes
(howMany=1, excludedXSTypes=None)[source]¶ Return the next however many available xs types.
- Parameters
- Raises
ValueError – If there are no available XS types to be allocated
-
_getUnrepresentedBlocks
(blockCollectionsByXsGroup)[source]¶ gets all blocks with suffixes not yet represented (for blocks in assemblies in the blueprints but not the core).
Notes
Certain cases (ZPPR validation cases) need to run cross sections for assemblies not in the core to get by region cross sections and flux factors.
-
makeCrossSectionGroups
()[source]¶ Make cross section groups for all blocks in reactor and unrepresented blocks from blueprints.
-
_modifyUnrepresentedXSIDs
(blockCollectionsByXsGroup)[source]¶ adjust the xsID of blocks in the groups that are not represented
Try to just adjust the burnup group up to something that is represented (can happen to structure in AA when only AB, AC, AD still remain).
-
disableBuGroupUpdates
()[source]¶ Turn off updating bu groups based on burnup
Useful during reactivity coefficient calculations to be consistent with ref. run.
See also
-
getNucTemperature
(xsID, nucName)[source]¶ Return the temperature (in C) of the nuclide in the group with specified xsID.
Notes
Returns None if the xsID or nucName are not in the average nuclide temperature dictionary self.avgNucTemperatures
-
updateNuclideTemperatures
(blockCollectionByXsGroup=None)[source]¶ Recompute nuclide temperatures for the block collections within the core.
- Parameters
blockCollectionByXsGroup (dict, optional) – Mapping between the XS IDs in the core and the block collections. Note that providing this as an arugment will only update the average temperatures of these XS IDs/block collections and will result in other XS ID average temperatures not included to be discarded.
Notes
This method does not update any properties of the representative blocks. Temperatures are obtained from the BlockCollection class rather than the representative block.