armi.nuclearDataIO.cccc.compxs module

COMPXS is a binary file that contains multigroup macroscopic cross sections for homogenized regions in a full core. The file format can be found in [DIF3D].

[DIF3D]

Derstine, K. L. DIF3D: A Code to Solve One-, Two-, and Three-Dimensional Finite-Difference Diffusion Theory Problems, report, April 1984; Argonne, Illinois. (https://digital.library.unt.edu/ark:/67531/metadc283553/: accessed October 17, 2019), University of North Texas Libraries, Digital Library, https://digital.library.unt.edu; crediting UNT Libraries Government Documents Department.

The file structure is listed here

      RECORD TYPE                           PRESENT IF
      ===================================   ==========
      SPECIFICATIONS                        ALWAYS
      COMPOSITION INDEPENDENT DATA          ALWAYS
********* (REPEAT FOR ALL COMPOSITIONS)
*     COMPOSITION SPECIFICATIONS            ALWAYS
*  ****** (REPEAT FOR ALL ENERGY GROUPS
*  *       IN THE ORDER OF DECREASING
*  *       ENERGY)
*  *  COMPOSITION MACROSCOPIC GROUP         ALWAYS
*  *  CROSS SECTIONS
*********
      POWER CONVERSION FACTORS              ALWAYS

Examples

>>> from armi.nuclearDataIO import compxs
>>> lib = compxs.readBinary('COMPXS')
>>> r0 = lib.regions[0]
>>> r0.macros.fission
# returns fission XS for this region
>>> r0.macros.higherOrderScatter[1]
# returns P1 scattering matrix
>>> r0.macros.higherOrderScatter[5] *= 0  # zero out P5 scattering matrix
>>> compxs.writeBinary(lib, 'COMPXS2')

Notes

Power conversion factors are used by some codes to determine how to scale the flux in a region to a desired power based on either fissions/watt-second or captures/watt-second. If the user does not plan on using these values, the COMPXS format indicates the values should be set to -1E+20.

The value of powerConvMult “times the group J integrated flux for the regions containing the current composition yields the total power in those regions and energy group J due to fissions and non-fission absorptions.”

The d<1,2,3>Multiplier values are the first, second, and third dimension directional diffusion coefficient multipliers, respectively. Similary, the d<1,2,3>Additive values are the first, second, and third dimension directional diffusion coefficient additive terms, respectively.

armi.nuclearDataIO.cccc.compxs.compare(lib1, lib2, tolerance=0.0, verbose=False)[source]

Compare two COMPXS libraries and return True if equal, or False if not equal.

Parameters:
  • lib1 (XSLibrary) – first library

  • lib2 (XSLibrary) – second library

  • tolerance (float) – Disregard errors that are less than tolerance.

  • verbose (bool) – show the macroscopic cross sections that are not equal

Returns:

equals – True if libraries are equal, else false

Return type:

bool

class armi.nuclearDataIO.cccc.compxs.CompxsRegion(lib, regionNumber)[source]

Bases: object

Class for creating/tracking homogenized region information.

Notes

Region objects are created from reading COMPXS files through readWrite() and connected to the resulting library, similar to instances of XSNuclide. This allows instances of CompxsLibrary to read from and write to COMPXS files, access region information by name, and plot macroscopic cross sections from the homogenized regions.

The main attributes for an instance of Region are the macroscopic cross sections, macros, and the metadata. The metadata deals primarily with delayed neutron information and use of the fileWideChi, if that option is set.

Examples

>>> lib = compxs.readBinary('COMPXS')
>>> lib.regions
    <Region REG00>
    <Region REG01>
    <Region REG02>
    ...
    <Region RegNN>
>>> r0 = lib.regions[0]
>>> r10 = lib.regions[10]
>>> r0.isFissile
    False
>>> r10.isFissile
    True
>>> r10.macros.fission
    array([0.01147095,  0.01006284,  0.0065597,  0.00660079,  0.005587,
           ...
           0.08920149,  0.13035864,  0.16192732]
initMetadata(groups)[source]

Initialize the metadata for this region.

property isFissile
allocateXS(numGroups)[source]

Allocate the cross section arrays.

When reading in the cross sections from a COMPXS file, the cross sections are read for each energy group, i.e. ..math:

\Sigma_{a,1},\Sigma_{t,1},\Sigma_{rem,1}, \cdots,
\Sigma_{a,2},\Sigma_{t,2},\Sigma_{rem,2}, \cdots,
\Sigma_{a,G},\Sigma_{t,G{,\Sigma_{rem,G}

Since the cross sections can not be read in with a single read command, the arrays are allocated here to be populated later.

Scattering matrices are read in as columns of a sparse scattering matrix and reconstructed after all energy groups have been read in.

makeScatteringMatrices()[source]

Create the sparse scattering matrix from components.

The scattering matrix \(S_{i,j}=\Sigma_{s,i\rightarrow j}\) is read in from the COMPXS as segments on each column in three parts: ..math:

XSCATU_J = \lbrace S_{g', J}\vert g'=J+NUP(J), J+NUP(J)-1, cdots, J+1\rbrace

XSCATJ_J = S_{J,J}

XSCATD_J = \lbrace S_{g', J}\vert g'=J-1, J-2, \cdots, J_NDN(J) \rbrace

where \(NUP(J)\) and \(NDN(J)\) are the number of group that upscatter and downscatter into energy group \(J\)

See also

scipy.sparse.csc_matrix

getXS(interaction)[source]

Get the macroscopic cross sections for a specific interaction.

See also

armi.nucDirectory.XSNuclide.getXS()

merge(other)[source]

Merge attributes of two homogenized Regions.