armi.nuclearDataIO.cccc.nhflux module

NHFLUX is a CCCC interface file that handles nodal hexagonal flux moments.

Examples

>>> nhfluxData = NfluxStream.readBinary("NHFLUX")
>>> NhfluxStream.writeAscii(nhfluxData, "nhflux.ascii")
class armi.nuclearDataIO.cccc.nhflux.NHFLUX(fName='NHFLUX', variant=False, numDataSetsToRead=1)[source]

Bases: armi.nuclearDataIO.cccc.cccc.DataContainer

An abstraction of a NHFLUX file.

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

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

Variables
  • self._metadata (file control) – The NHFLUX file control info (sort of global for this library).

  • 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.

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.cccc.nhflux.NhfluxStream(data: armi.nuclearDataIO.cccc.cccc.DataContainer, fileName: str, fileMode: str)[source]

Bases: armi.nuclearDataIO.cccc.cccc.StreamWithDataContainer

Create an instance of a Stream.

Parameters
  • fileName (str) – name of the file to be read

  • fileMode (str) – the file mode, i.e. ‘w’ for writing ASCII, ‘r’ for reading ASCII, ‘wb’ for writing binary, and ‘rb’ for reading binary.

readWrite()[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.

Notes

This method should be private but conflicts with _readWrite so we need a better name.

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.

class armi.nuclearDataIO.cccc.nhflux.NafluxStream(data: armi.nuclearDataIO.cccc.cccc.DataContainer, fileName: str, fileMode: str)[source]

Bases: armi.nuclearDataIO.cccc.nhflux.NhfluxStream

NAFLUX is similar in format to the NHFLUX, but contains adjoint flux.

It has reversed energy group ordering.

Create an instance of a Stream.

Parameters
  • fileName (str) – name of the file to be read

  • fileMode (str) – the file mode, i.e. ‘w’ for writing ASCII, ‘r’ for reading ASCII, ‘wb’ for writing binary, and ‘rb’ for reading binary.

class armi.nuclearDataIO.cccc.nhflux.NhfluxStreamVariant(data: armi.nuclearDataIO.cccc.cccc.DataContainer, fileName: str, fileMode: str)[source]

Bases: armi.nuclearDataIO.cccc.nhflux.NhfluxStream

Stream for VARIANT version of NHFLUX.

Notes

Can be deleted after have the NHFLUX data container be the public interface

Create an instance of a Stream.

Parameters
  • fileName (str) – name of the file to be read

  • fileMode (str) – the file mode, i.e. ‘w’ for writing ASCII, ‘r’ for reading ASCII, ‘wb’ for writing binary, and ‘rb’ for reading binary.

class armi.nuclearDataIO.cccc.nhflux.NafluxStreamVariant(data: armi.nuclearDataIO.cccc.cccc.DataContainer, fileName: str, fileMode: str)[source]

Bases: armi.nuclearDataIO.cccc.nhflux.NafluxStream

Stream for VARIANT version of NAFLUX.

Notes

Can be deleted after have the NHFLUX data container be the public interface

Create an instance of a Stream.

Parameters
  • fileName (str) – name of the file to be read

  • fileMode (str) – the file mode, i.e. ‘w’ for writing ASCII, ‘r’ for reading ASCII, ‘wb’ for writing binary, and ‘rb’ for reading binary.

armi.nuclearDataIO.cccc.nhflux.getNhfluxReader(adjointFlag, variantFlag)[source]

Returns the appropriate DIF3D nodal flux binary file reader class, either NHFLUX (real) or NAFLUX (adjoint).