armi.nuclearDataIO package¶
This package implements classes for reading and writing standard interface files for reactor physics codes [CCCC-IV].
This module is designed to read/write Fortran record-based binary files that comply with the format established by the Committee on Computer Code Coordination (CCCC).
- CCCC-IV
R. Douglas O’Dell, “Standard Interface Files and Procedures for Reactor Physics Codes, Version IV,” LA-6941-MS, Los Alamos National Laboratory (September 1977). Web. doi:10.2172/5369298. (OSTI)
It may also read other nuclear data I/O formats as appropriate.
-
armi.nuclearDataIO.getExpectedISOTXSFileName(cycle=None, suffix=None, xsID=None)[source]¶ Return the ISOTXS file that matches either the current cycle or xsID with a suffix.
-
armi.nuclearDataIO.getExpectedCOMPXSFileName(cycle=None)[source]¶ Return the COMPXS file that matches either the current cycle.
-
armi.nuclearDataIO.getExpectedGAMISOFileName(cycle=None, suffix=None, xsID=None)[source]¶ Return the GAMISO file that matches either the
cycleorxsIDandsuffix.- For example:
If
cycleis set to 0, thencycle0.gamisowill be returned. IfxsIDis set toAAwith asuffixoftest, thenAA-test.gamisowill be returned.
-
armi.nuclearDataIO.getExpectedPMATRXFileName(cycle=None, suffix=None, xsID=None)[source]¶ Return the PMATRX file that matches either the
cycleorxsIDandsuffix.- For example:
If
cycleis set to 0 d, thencycle0.pmatrxwill be returned. IfxsIDis set toAAwith asuffixoftest, thenAA-test.pmatrxwill be returned.
-
class
armi.nuclearDataIO.NHFLUX(fName='NHFLUX', variant=False)[source]¶ Bases:
armi.nuclearDataIO.cccc.CCCCReaderRead a binary NHFLUX or NAFLUX file from DIF3D nodal output.
Important Note: DIF3D outputs NHFLUX at every time node, but REBUS outputs NHFLUX only at every cycle.
This format is defined in DIF3D manual.
See also [VARIANT-95] and [VARIANT-2014].
- VARIANT-95
G. Palmiotti, E. E. Lewis, and C. B. Carrico, VARIANT: VARIational Anisotropic Nodal Transport for Multidimensional Cartesian and Hexagonal Geometry Calculation, ANL-95/40, Argonne National Laboratory, Argonne, IL (October 1995).
- VARIANT-2014(1,2)
Smith, M. A., Lewis, E. E., and Shemon, E. R. DIF3D-VARIANT 11.0: A Decade of Updates. United States: N. p., 2014. Web. doi:10.2172/1127298. https://publications.anl.gov/anlpubs/2014/04/78313.pdf
-
self.fc¶ The NHFLUX file control info (sort of global for this library).
- Type
file control
-
self.geodstCoordMap¶ This is an index map between DIF3D “four color” nodal and DIF3D GEODST. It is absolutely necessary for interpreting that data read by nuclearDataIO.NHFLUX.readHexPartialCurrents4D.
- Type
list of int
-
self.externalCurrentPointers¶ This is an index map for the “external hex surfaces” between DIF3D “four color” nodal indexing and DIF3D GEODST indexing. “External surfaces” are important, because they contain the INCOMING partial currents from the outer reactor boundary. This uses the same hex ordering as geodstCoordMap, except that each hex now has 6 subsequent indices. If hex of index n (0 to N-1) has a surface of index k (0 to 5) that lies on the vacuum boundary, then the index of that surface is N*6 + k + 1.
- Type
list of int
-
self.fluxMoments¶ This contains all the flux moments for all core assemblies at ONE axial position. The jth planar flux moment of assembly i is fluxMoments[i][j]. The hex assemblies are ordered according to self.geodstCoordMap.
- Type
2-D list of float
-
self.partialCurrentsHex¶ This contains all the OUTGOING partial currents for each assembly in the given axial plane. The OUTGOING partial current on surface j in assembly i is surfCurrents[i][j]. The hex assemblies are ordered according to self.geodstCoordMap.
- Type
2-D list of float
-
self.partialCurrentsHex_ext¶ This contains all the INCOMING partial currents on “external hex surfaces”, which are adjacent to the reactor outer boundary (usually vacuum). Internal reflective surfaces are NOT included in this! These “external hex surfaces” are ordered according to self.externalCurrentPointers.
- Type
1-D list of floats
-
self.partialCurrentsZ¶ This contains all the upward and downward partial currents in all assemblies on ONE whole-core axial slice. The hex assemblies are ordered according to self.geodstCoordMap.
- Type
2-D list of float
Initialize the NHFLUX or NAFLUX reader object.
- Parameters
fName (str, optional) – The file name of the NHFLUX binary file to be read.
variant (bool, optional) – Whether or not this NHFLUX/NAFLUX file has the VARIANT output format, which is a bit different than the DIF3D nodal format.
-
readAllData(numDataSetsToRead=1)[source]¶ Read everything from the DIF3D binary file NHFLUX that is necessary for pin flux and power reconstruction.
Read all surface-averaged partial currents, all planar moments, and the DIF3D “four color” nodal coordinate mapping system.
- Parameters
numDataSetsToRead (int, optional) – The number of whole-core flux data sets included in this NHFLUX/NAFLUX file that one wishes to be read. Some NHFLUX/NAFLUX files, such as NAFLUX files written by SASSYS/DIF3D-K, contain more than one flux data set. Each data set overwrites the previous one on the NHFLUX class object, which will contain only the numDataSetsToRead-th data set. The first numDataSetsToRead-1 data sets are essentially skipped over.
Outputs –
------- –
self.geodstCoordMap (list of int) – This is an index map between DIF3D “four color” nodal and DIF3D GEODST. It is absolutely necessary for interpreting that data read by nuclearDataIO.NHFLUX.readHexPartialCurrents4D.
self.externalCurrentPointers (list of int) – This is an index map for the “external hex surfaces” between DIF3D “four color” nodal indexing and DIF3D GEODST indexing. “External surfaces” are important, because they contain the INCOMING partial currents from the outer reactor boundary. This uses the same hex ordering as geodstCoordMap, except that each hex now has 6 subsequent indices. If hex of index n (0 to N-1) has a surface of index k (0 to 5) that lies on the vacuum boundary, then the index of that surface is N*6 + k + 1.
self.fluxMoments (2-D list of float) – This contains all the flux moments for all core assemblies at ONE axial position. The jth planar flux moment of assembly i is fluxMoments[i][j]. The hex assemblies are ordered according to self.geodstCoordMap.
self.partialCurrentsHex (2-D list of float) – This contains all the OUTGOING partial currents for each assembly in the given axial plane. The OUTGOING partial current on surface j in assembly i is surfCurrents[i][j]. The hex assemblies are ordered according to self.geodstCoordMap.
self.partialCurrentsHex_ext (1-D list of floats) – This contains all the INCOMING partial currents on “external hex surfaces”, which are adjacent to the reactor outer boundary (usually vacuum). Internal reflective surfaces are NOT included in this! These “external hex surfaces” are ordered according to self.externalCurrentPointers.
self.partialCurrentsZ (2-D list of float) – This contains all the upward and downward partial currents in all assemblies on ONE whole-core axial slice. The hex assemblies are ordered according to self.geodstCoordMap.
-
readBasicFileData1D()[source]¶ Read parameters from the NHFLUX 1D block (file control).
This contains a bunch of single-number integer or double values necessary to read all data from the other records of NHFLUX.
See also
nuclearDataIO.NHFLUX.__init__(),nuclearDataIO.ISOTXS.read1D(),nuclearDataIO.SPECTR.read1D()
-
readGeodstCoordMap2D()[source]¶ Read core geometry indexing from the NHFLUX 2D block (file control).
This reads the 2-D (x,y) indexing for hex assemblies. geodstCoordMap maps DIF3D “four color” nodal hex indexing to DIF3D GEODST hex indexing. This DIF3D GEODST indexing is different than (but similar to) the MCNP GEODST hex ordering. See TP1-1.9.31-RPT-0010 for more details on hex ordering.
Let N be the number of assemblies. Let M be the number of “external hex surfaces” exposed to the outer reactor boundary (usually vacuum). M does NOT include reflective surfaces!
N = self.fc[‘nintxy’] M = self.fc[‘npcxy’] - self.fc[‘nintxy’]*6 N*6 + M = self.fc[‘npcxy’]
- Returns
geodstCoordMap (list of int) – This is an index map between DIF3D “four color” nodal and DIF3D GEODST. It is absolutely necessary for interpreting that data read by nuclearDataIO.NHFLUX.readHexPartialCurrents4D.
externalCurrentPointers (list of int) – This is an index map for the “external hex surfaces” between DIF3D “four color” nodal indexing and DIF3D GEODST indexing. “External surfaces” are important, because they contain the INCOMING partial currents from the outer reactor boundary. This uses the same hex ordering as geodstCoordMap, except that each hex now has 6 subsequent indices. If hex of index n (0 to N-1) has a surface of index k (0 to 5) that lies on the vacuum boundary, then the index of that surface is N*6 + k + 1.
Examples
geodstCoordMap[fourColorNodalIndex] = geodstIndex
See also
nuclearDataIO.NHFLUX.__init__(),nuclearDataIO.NHFLUX.readHexPartialCurrents4D(),fluxRecon.computePinMGFluxAndPower(),nuclearDataIO.ISOTXS.read2D(),nuclearDataIO.SPECTR.read2D()
-
readFluxMoments3D()[source]¶ Read multigroup flux moments from the NHFLUX 3D block (file control).
This reads all 5 planar moments for each DIF3D node on ONE x,y plane. The planar moments for DIF3D nodes on different x,y planes (different axial slices) are in a different 3D record.
- Returns
fluxMoments – This contains all the flux moments for all core assemblies at ONE axial position. The jth planar flux moment of assembly i is fluxMoments[i][j]. The hex assemblies are ordered according to self.geodstCoordMap.
- Return type
2-D list of float
See also
nuclearDataIO.NHFLUX.__init__(),nuclearDataIO.NHFLUX.readBasicFileData1D(),nuclearDataIO.NHFLUX.readGeodstCoordMap2D(),fluxRecon.computePinMGFluxAndPower(),nuclearDataIO.ISOTXS.read3D()
-
readHexPartialCurrents4D()[source]¶ Read multigroup hexagonal/laterial partial currents from the NHFLUX 4D block (file control).
This reads all OUTGOING partial currents for all assembly block lateral surfaces at a fixed axial position. There are 6 surfaces per assembly axial block. The 2 axial surfaces of each block are in the 5D records.
Each 4D record contains all the hex surface (6 per assembly) partial currents on ONE x,y plane. The hex surface data on different x,y planes (different axial slices) are in a different 4D record.
NHFLUX contains only the 6 OUTGOING partial currents for each hex assembly. To obtain INCOMING partial currents and to construct NET currents, one must find the OUTGOING partial currents on the hex nearest neighbors (this is done in fluxRecon, not in nuclearDataIO.NHFLUX).
If the reactor contains N hex assemblies and M exterior hex surfaces (surfaces adjacent to vacuum boundary), this record will contain N*6 + M partial currents. The N*6 assembly OUTGOING partial currents are listed first, followed by the M INCOMING partial currents from the outer reactor edge.
N = self.fc[‘nintxy’] M = self.fc[‘npcxy’] - self.fc[‘nintxy’]*6 N*6 + M = self.fc[‘npcxy’]
- Returns
surfCurrents (2-D list of float) – This contains all the OUTGOING partial currents for each assembly in the given axial plane. The OUTGOING partial current on surface j in assembly i is surfCurrents[i][j]. The hex assemblies are ordered according to self.geodstCoordMap.
externalSurfCurrents (1-D list of floats) –
- This contains all the INCOMING partial currents on “external hex surfaces”, which are
adjacent to the reactor outer boundary (usually vacuum). Internal reflective surfaces are NOT included in this!
These “external hex surfaces” are ordered according to self.externalCurrentPointers.
See also
nuclearDataIO.NHFLUX.readBasicFileData1D(),nuclearDataIO.NHFLUX.readGeodstCoordMap2D(),nuclearDataIO.NHFLUX.readZPartialCurrents5D(),fluxRecon.computePinMGFluxAndPower(),nuclearDataIO.ISOTXS.read4D()
-
readZPartialCurrents5D()[source]¶ Read multigroup axial partial currents from the NHFLUX 5D block (file control).
All other NHFLUX data is indexed by DIF3D node (each axial core slice in its own record). HOWEVER, “top” and “bottom” surfaces of each DIF3D node are indexed by axial surface. If there are Z axial nodes, then there are Z+1 axial surfaces. Thus, there are Z+1 5D records, while there are only Z 3D and Z 4D records.
Each 5D record (each axial surface) contains two partial currents for each assembly position. The first is the UPWARD partial current, while the second is the DOWNWARD partial current. These are assigned to specific ARMI blocks in fluxRecon.computePinMGFluxAndPower.
- Returns
surfCurrents – This contains all the upward and downward partial currents in all assemblies on ONE whole-core axial slice. The hex assemblies are ordered according to self.geodstCoordMap.
- Return type
2-D list of float
See also
nuclearDataIO.NHFLUX.readBasicFileData1D(),nuclearDataIO.NHFLUX.readGeodstCoordMap2D(),fluxRecon.computePinMGFluxAndPower(),nuclearDataIO.ISOTXS.read5D()
-
class
armi.nuclearDataIO.NAFLUX(fName='NHFLUX', variant=False)[source]¶ Bases:
armi.nuclearDataIO.NHFLUXNAFLUX is similar in format to the NHFLUX, but contains adjoint flux.
It has reversed energy group ordering.
Initialize the NHFLUX or NAFLUX reader object.
- Parameters
fName (str, optional) – The file name of the NHFLUX binary file to be read.
variant (bool, optional) – Whether or not this NHFLUX/NAFLUX file has the VARIANT output format, which is a bit different than the DIF3D nodal format.
-
class
armi.nuclearDataIO.VARSRC(fName='VARSRC', variant=True)[source]¶ Bases:
armi.nuclearDataIO.NHFLUXFixed source file format for use with variant.
See [VARIANT-2014].
Initialize the VARSRC reader object.
- Parameters
fName (str, optional) – The file name of the NHFLUX binary file to be read.
variant (bool, optional) – Whether or not this NHFLUX/NAFLUX file has the VARIANT output format, which is a bit different than the DIF3D nodal format.
-
readAllData(numDataSetsToRead=1)[source]¶ Read all source moments from the DIF3D binary file VARSRC.
- Parameters
numDataSetsToRead (int, optional) – The number of whole-core flux data sets included in this NHFLUX/NAFLUX file that one wishes to be read. Some NHFLUX/NAFLUX files, such as NAFLUX files written by SASSYS/DIF3D-K, contain more than one flux data set. Each data set overwrites the previous one on the NHFLUX class object, which will contain only the numDataSetsToRead-th data set. The first numDataSetsToRead-1 data sets are essentially skipped over.
Outputs –
------- –
self.srcMoments (2-D list of float) – This contains all the flux moments for all core assemblies at ONE axial position. The jth planar flux moment of assembly i is fluxMoments[i][j]. The hex assemblies are ordered according to self.geodstCoordMap.
See also
fluxRecon.computePinMGFluxAndPower(),nuclearDataIO.NHFLUX.readFileID(),nuclearDataIO.NHFLUX.readBasicFileData1D(),nuclearDataIO.NHFLUX.readFluxMoments3D(),nuclearDataIO.ISOTXS.__init__()
-
armi.nuclearDataIO.getNodalFluxReader(adjointFlag)[source]¶ Returns the appropriate DIF3D nodal flux binary file reader class, either NHFLUX (real) or NAFLUX (adjoint).
-
class
armi.nuclearDataIO.MacroXS(_debug=False)[source]¶ Bases:
objectBasic macroscopic XS library.
This is just a thin interface over a dictionary.
Submodules¶
- armi.nuclearDataIO.cccc module
- armi.nuclearDataIO.compxs module
- armi.nuclearDataIO.dlayxs module
- armi.nuclearDataIO.endf module
- armi.nuclearDataIO.fixsrc module
- armi.nuclearDataIO.gamiso module
- armi.nuclearDataIO.isotxs module
- armi.nuclearDataIO.labels module
- armi.nuclearDataIO.nuclearFileMetadata module
- armi.nuclearDataIO.pmatrx module
- armi.nuclearDataIO.ripl module
- armi.nuclearDataIO.rtflux module
- armi.nuclearDataIO.xsCollections module
- armi.nuclearDataIO.xsLibraries module
- armi.nuclearDataIO.xsNuclides module