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
See also
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.
_flattenScatteringVector
(colVector, group, numUpScatter, numDownScatter)[source]¶
-
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.
-
armi.nuclearDataIO.cccc.compxs.
_compareRegionXS
(region1, region2, tolerance, verbose)[source]¶ Compare the macroscopic cross sections between two homogenized regions.
-
class
armi.nuclearDataIO.cccc.compxs.
_CompxsIO
(fileName, lib, fileMode, getRegionFunc)[source]¶ Bases:
armi.nuclearDataIO.cccc.cccc.Stream
Semi-abstract stream used for reading to/writing from a COMPXS file.
- Parameters
fileName (str) – path to compxs file
lib (armi.nuclearDataIO.xsLibrary.CompxsLibrary) – Compxs library that is being written to or read from fileName
fileMode (str) – string indicating if
fileName
is being read or written, and in ascii or binary formatgetRegionFunc (function) – function that returns a
CompxsRegion
object given the name of the region.
Create an instance of a
Stream
.- Parameters
-
_METADATA_TAGS
= ('numComps', 'numGroups', 'fileWideChiFlag', 'numFissComps', 'maxUpScatterGroups', 'maxDownScatterGroups', 'numDelayedFam', 'maxScatteringOrder')¶
-
readWrite
()[source]¶ Read from or write to the COMPXS file.
See also
armi.nuclearDataIO.cccc.isotxs._IsotxsIO.readWrite()
reading/writing ISOTXS files
-
class
armi.nuclearDataIO.cccc.compxs.
_CompxsRegionIO
(region, compxsIO, lib)[source]¶ Bases:
object
Specific object assigned a single region to read/write composition information.
Used with _COMPXS object to read/write 3D and 4D records - composition specifications and compsosition macroscopic cross sections.
Cross sections are read/written in order of decreasing energy.
This differs from the _COMPXS object, as this object acts on a single region, but uses the file mode and file path from the _COMPXS region that instantiated this object.
-
_ORDERED_PRIMARY_XS
= ('absorption', 'total', 'removal', 'transport')¶
-
-
class
armi.nuclearDataIO.cccc.compxs.
_CompxsScatterMatrix
(shape)[source]¶ Bases:
object
When reading COMPXS scattering blocks, store the data here and then reconstruct after.
-
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 ofXSNuclide
. This allows instances ofCompxsLibrary
to read from and write toCOMPXS
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 thefileWideChi
, 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]
-
_primaryXS
= ('absorption', 'total', 'removal', 'transport', 'n2n')¶
-
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.
See also
-
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
-