armi.nuclearDataIO.xsCollections module
Cross section collections contain cross sections for a single nuclide or region.
Specifically, they are used as attributes of XSNuclide
,
which then are combined as a XSLibrary
.
These may represent microscopic or macroscopic neutron or photon cross sections. When they are macroscopic, they generally represent a whole region with many nuclides, though this is not required.
See also
armi.nuclearDataIO.xsCollection.XSCollection
object that gets created.
Examples
# creating a MicroscopicXSCollection by loading one from ISOTXS. microLib = armi.nuclearDataIO.ISOTXS(‘ISOTXS’) micros = myLib.nuclides[‘U235AA’].micros
# creating macroscopic XS: mc = MacroscopicCrossSectionCreator() macroCollection = mc.createMacrosFromMicros(microLib, block) blocksWithMacros = mc.createMacrosOnBlocklist(microLib, blocks)
- class armi.nuclearDataIO.xsCollections.XSCollection(parent)[source]
Bases:
object
A cross section collection.
Construct a NuclideCollection.
- Parameters:
parent (object) – The parent container, which may be a region, a nuclide, a block, etc.
- getAbsorptionXS()[source]
Return total absorption XS, which is the sum of capture + fission + others.
- getTotalScatterMatrix()[source]
Sum up scatter matrices to produce total scatter matrix.
Multiply reaction-based n2n scatter matrix by 2.0 to convert to production-based.
Warning
Not all lattice codes store (n,2n) matrices consistently. Some are production-based and some are absorption-based. If you use an absorption-based one, your scatter matrix will be off, generally leading to about a percent error in your neutron balance.
Notes
The total scattering matrix is produced by summing the elastic, inelastic, and n2n scattering matrices. If a specific scattering matrix does not exist for a composition (nuclide or region) then it is skipped and a warning is displayed stating that the scattering reaction is not available and is not included in the total scattering matrix.
Example: When producing macroscopic cross sections in MC2-3 the code internally merges the elastic and inelastic scattering matrices into a single elastic scattering matrix.
- static collapseCrossSection(crossSection, weights)[source]
Collapse a cross section into 1-group.
This is extremely useful for many analyses such as doing a shielding efficacy survey or computing one-group reaction rates.
\[\bar{\sigma} = \frac{\sum_g{\sigma_g \phi_g}}{\sum_g{\phi_g}}\]
- compare(other, flux, relativeTolerance=0, verbose=False)[source]
Compare the cross sections between two XSCollections objects.
- merge(other)[source]
Merge the cross sections of two collections.
Notes
This can only merge if one hasn’t been assigned at all, because it doesn’t try to figure out how to account for overlapping cross sections.
Update the current library (self) with values from the other library if all attributes in the library except ones in attributesToIgnore are None.
Libraries are already merged if all attributes in the other library are None (This is nothing to merge!).
- class armi.nuclearDataIO.xsCollections.MacroscopicCrossSectionCreator(buildScatterMatrix=True, buildOnlyCoolant=False, minimumNuclideDensity=0.0)[source]
Bases:
object
Create macroscopic cross sections from micros and number density.
Object encapsulating all high-level methods related to the creation of macroscopic cross sections.
- createMacrosOnBlocklist(microLibrary, blockList, nucNames=None, libType='micros')[source]
Create macroscopic cross sections for a list of blocks.
- createMacrosFromMicros(microLibrary, block, nucNames=None, libType='micros')[source]
Creates a macroscopic cross section set based on a microscopic XS library using a block object.
Micro libraries have lots of nuclides, but macros only have 1.
- Parameters:
microLibrary (xsCollection.XSCollection) – Input micros
block (Block) – Object whos number densities should be used to generate macros
nucNames (list, optional) – List of nuclides to include in the macros. Defaults to all in block.
libType (str, optional) – The block attribute containing the desired microscopic XS for this block: either “micros” for neutron XS or “gammaXS” for gamma XS.
- Returns:
macros – A new XSCollection full of macroscopic cross sections
- Return type:
xsCollection.XSCollection
- armi.nuclearDataIO.xsCollections.computeBlockAverageChi(b, isotxsLib)[source]
Return the block average total chi vector based on isotope chi vectors.
This is defined by eq 3.4b in DIF3D manual [DIF3D], which corresponds to 1 in A.HMG4C card.
\[\chi_g = \frac{\sum_{n} \chi_{g,n} N_n V \sum_{g'}(\nu_{g'}*\sigma_{f,g'})}{\sum_n N_n V \sum_{g'}(\nu_{g'}*\sigma_{f,g'} )}\]To evaluate efficiently, assume that if \(\chi_{g,n}=0\), there will be no contributions
Volume is not used b/c it is already homogenized in the block.
Notes
This methodology is based on option 1 in the HMG4C utility (named total fission source weighting).
- armi.nuclearDataIO.xsCollections.computeNeutronEnergyDepositionConstants(numberDensities, lib, microSuffix)[source]
Compute the macroscopic neutron energy deposition group constants.
These group constants can be multiplied by the flux to obtain energy deposition rates.
- Parameters:
numberDensities (dict) – nucName keys, number density values (atoms/bn-cm) of all nuclides in the composite for which the macroscopic group constants are computed. See composite getNuclideNumberDensities method.
lib (library object) – Microscopic cross section library.
microSuffix (str) – Microscopic library suffix (e.g. ‘AB’) for this composite. See composite getMicroSuffix method.
- Returns:
energyDepositionConsts – Neutron energy deposition group constants. (J/cm)
- Return type:
np.ndarray
Notes
PMATRX documentation says units will be eV/s when multiplied by flux but it’s eV/s/cm^3. (eV/s/cm^3 = eV-bn * 1/cm^2/s * 1/bn-cm.)
Converted here to obtain J/cm (eV-bn * 1/bn-cm * J / eV)
- armi.nuclearDataIO.xsCollections.computeGammaEnergyDepositionConstants(numberDensities, lib, microSuffix)[source]
Compute the macroscopic gamma energy deposition group constants.
These group constants can be multiplied by the flux to obtain energy deposition rates.
- Parameters:
numberDensities (dict) – nucName keys, number density values (atoms/bn-cm) of all nuclides in the composite for which the macroscopic group constants are computed. See composite getNuclideNumberDensities method.
lib (library object) – Microscopic cross section library.
microSuffix (str) – Microscopic library suffix (e.g. ‘AB’) for this composite. See composite getMicroSuffix method.
- Returns:
energyDepositionConsts – gamma energy deposition group constants. (J/cm)
- Return type:
np.ndarray
Notes
PMATRX documentation says units will be eV/s when multiplied by flux but it’s eV/s/cm^3. (eV/s/cm^3 = eV-bn * 1/cm^2/s * 1/bn-cm.)
Convert here to obtain J/cm (eV-bn * 1/bn-cm * J / eV)
- armi.nuclearDataIO.xsCollections.computeFissionEnergyGenerationConstants(numberDensities, lib, microSuffix)[source]
Get the fission energy generation group constant of a block.
\[E_{generation_fission} = \kappa_f \Sigma_f\]Power comes from fission and capture reactions.
- Parameters:
numberDensities (dict) – nucName keys, number density values (atoms/bn-cm) of all nuclides in the composite for which the macroscopic group constants are computed. See composite getNuclideNumberDensities method.
lib (library object) – Microscopic cross section library.
microSuffix (str) – Microscopic library suffix (e.g. ‘AB’) for this composite. See composite getMicroSuffix method.
- Returns:
fissionEnergyFactor – Fission energy generation group constants (in Joules/cm)
- Return type:
np.ndarray
- armi.nuclearDataIO.xsCollections.computeCaptureEnergyGenerationConstants(numberDensities, lib, microSuffix)[source]
Get the energy generation group constant of a block.
\[E_{generation capture} = \kappa_c \Sigma_c\]Typically, one only cares about the flux* this XS (to find total power), but the XS itself is required in some sensitivity studies.
Power comes from fission and capture reactions.
- Parameters:
numberDensities (dict) – nucName keys, number density values (atoms/bn-cm) of all nuclides in the composite for which the macroscopic group constants are computed. See composite getNumberDensities method.
lib (library object) – Microscopic cross section library.
microSuffix (str) – Microscopic library suffix (e.g. ‘AB’) for this composite. See composite getMicroSuffix method.
- Returns:
captureEnergyFactor – Capture energy generation group constants (in Joules/cm)
- Return type:
np.ndarray
- armi.nuclearDataIO.xsCollections.computeMacroscopicGroupConstants(constantName, numberDensities, lib, microSuffix, libType=None, multConstant=None, multLib=None)[source]
Compute any macroscopic group constants given number densities and a microscopic library.
- Parameters:
constantName (str) – Name of the reaction for which to obtain the group constants. This name should match a cross section name or an attribute in the collection.
numberDensities (dict) – nucName keys, number density values (atoms/bn-cm) of all nuclides in the composite for which the macroscopic group constants are computed. See composite getNuclideNumberDensities method.
lib (library object) – Microscopic cross section library.
microSuffix (str) – Microscopic library suffix (e.g. ‘AB’) for this composite. See composite getMicroSuffix method.
libType (str, optional) – The block attribute containing the desired microscopic XS for this block: either “micros” for neutron XS or “gammaXS” for gamma XS.
multConstant (str, optional) – Name of constant by which the group constants will be multiplied. This name should match a cross section name or an attribute in the collection.
multLib (library object, optional) – Microscopic cross section nuclide library to obtain the multiplier from. If None, same library as base cross section is used.
- Returns:
macroGroupConstant – Macroscopic group constants for the requested reaction.
- Return type:
np.ndarray