armi.nuclearDataIO.cccc.rtflux module

Read and write the Regular Total flux from a RTFLUX CCCC interface file.

RTFLUX is a CCCC standard data file for storing multigroup total flux on a mesh of any geometry type. It is defined in [CCCC-IV].

ATFLUX is in the same format but holds adjoint flux rather than regular flux.

Examples

>>> flux = rtflux.RtfluxStream.readBinary("RTFLUX")
>>> rtflux.RtfluxStream.writeBinary(flux, "RTFLUX2")
>>> adjointFlux = rtflux.AtfluxStream.readBinary("ATFLUX")

See also

NHFLUX

Reads/write nodal hex flux moments

RZFLUX

Reads/writes total fluxes from zones

class armi.nuclearDataIO.cccc.rtflux.RtfluxData[source]

Bases: armi.nuclearDataIO.cccc.cccc.DataContainer

Multigroup flux as a function of i,j,k and g indices.

The metadata also contains the power and k-eff.

This is the data structure that is read from or written to a RTFLUX file.

groupFluxes: numpy.ndarray

Maps i,j,k,g indices to total real or adjoint flux in n/cm^2-s

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

Bases: armi.nuclearDataIO.cccc.cccc.StreamWithDataContainer

Stream for reading/writing a RTFLUX or ATFLUX file.

Parameters
  • flux (RtfluxData) – Data structure

  • fileName (str) – path to RTFLUX file

  • fileMode (str) – string indicating if fileName is being read or written, and in ascii or binary format

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]

Step through the structure of the file and read/write it.

getEnergyGroupIndex(g)[source]

Real fluxes stored in RTFLUX have “normal” (or “forward”) energy groups. Also see the subclass method ATFLUX.getEnergyGroupIndex().

0 based, so if NG=33 and you want the third group, this return 2.

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

Bases: armi.nuclearDataIO.cccc.rtflux.RtfluxStream

This is a subclass for the ATFLUX file, which is identical in format to the RTFLUX file except that it contains the adjoint flux and 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.

getEnergyGroupIndex(g)[source]

Adjoint fluxes stored in ATFLUX have “reversed” (or “backward”) energy groups.

0 based, so if NG=33 and you want the third group (g=2), this returns 30.

armi.nuclearDataIO.cccc.rtflux.getFDFluxReader(adjointFlag)[source]

Returns the appropriate DIF3D FD flux binary file reader class, either RTFLUX (real) or ATFLUX (adjoint).

armi.nuclearDataIO.cccc.rtflux.plotTriangleFlux(rtfluxData: armi.nuclearDataIO.cccc.rtflux.RtfluxData, axialZ, energyGroup, hexPitch=1.7320508075688772, hexSideSubdivisions=1, imgFileExt='.png')[source]

Plot region total flux for one core-wide axial slice on triangular/hexagonal geometry.

Warning

This will run on non-triangular meshes but will look wrong.

Parameters
  • rtfluxData (RtfluxData object) – The RTFLUX/ATFLUX data object containing all read file data. Alternatively, this could be a FIXSRC file object, but only if FIXSRC.fixSrc is first renamed FIXSRC.triangleFluxes.

  • axialZ (int) – The DIF3D axial node index of the core-wide slice to plot.

  • energyGroup (int) – The energy group index to plot.

  • hexPitch (float, optional) – The flat-to-flat hexagonal assembly pitch in this core. By default, it is sqrt(3) so that the triangle edge length is 1 if hexSideSubdivisions=1.

  • hexSideSubdivisions (int, optional) – By default, it is 1 so that the triangle edge length is 1 if hexPitch=sqrt(3).

  • imgFileExt (str, optional) – The image file extension.