armi.nuclearDataIO.rtflux module

RTFLUX is a CCCC standard data file for storing multigroup flux on a triangular mesh.

[CCCC-IV]

class armi.nuclearDataIO.rtflux.RTFLUX(fName='RTFLUX')[source]

Bases: armi.nuclearDataIO.cccc.CCCCReader

Read a binary RTFLUX or ATFLUX file from DIF3D output.

While NHFLUX stores nodal flux output data, RTFLUX stores finite difference flux output data. While NHFLUX stores data by hexagon, RTFLUX stores data by triangle. This can also read ATFLUX, which stores the finite difference adjoint flux output data.

Initialize the RTFLUX or ATFLUX reader object.

Parameters

fName (str, optional) – The file name of the RTFLUX/ATFLUX binary file to be read.

readAllData()[source]

Read multigroup fluxes from the original DIF3D FD triangular-z mesh points. RTFLUX contains the real fluxes, while ATFLUX contains the adjoint fluxes.

read1D()[source]

Read parameters from the RTFLUX/ATFLUX 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 RTFLUX/ATFLUX. See the comments following each quantity in the code.

See also

rtflux.RTFLUX.__init__(), nuclearDataIO.ISOTXS.read1D(), nuclearDataIO.SPECTR.read1D()

readTriangleFluxes()[source]

Read finite difference triangle-z fluxes from the RTFLUX/ATFLUX 3D block (file control).

This reads all volume-averaged triangle fluxes in ONE energy group on ONE x, y plane of the core. The fluxes on different x, y planes (different axial slices) and different groups are in a different 3D record.

If the reactor has 1/3 core symmetry, these triangles are indexed in “rhomboid” order. If the reactor is full-core, these triangles are indexed in “rectangular” order. However, this distinction should not matter for this function.

Returns

triangleFluxes – 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.

Return type

list of float

See also

RTFLUX.read1D(), perturbationTheory.readTriangleFDFluxes()

getEnergyGroupIndex(g)[source]

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

class armi.nuclearDataIO.rtflux.ATFLUX(fName='RTFLUX')[source]

Bases: armi.nuclearDataIO.rtflux.RTFLUX

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.

Initialize the RTFLUX or ATFLUX reader object.

Parameters

fName (str, optional) – The file name of the RTFLUX/ATFLUX binary file to be read.

getEnergyGroupIndex(g)[source]

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

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

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

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

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

Parameters
  • rtfluxFile (RTFLUX object) – The RTFLUX/ATFLUX file 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.

armi.nuclearDataIO.rtflux.assignARMIBlockFluxFromRTFLUX(r, adjoint=False)[source]

Read whichever RTFLUX (real) or ATFLUX (adjoint) files exist in the current case directory. Then average the finite difference triangle fluxes in each ARMI block and assign the resulting multigroup flux to the ARMI block object. This can be convenient when the DIF3D output reader fails for any reason while the RTFLUX/ATFLUX DIF3D output files were created.

Note: It is the user’s responsibility to ensure that the correct RTFLUX/ATFLUX files exist in the case directory. If they don’t exist, this method will fail. If the wrong ones exist, this method will either fail or assign wrong fluxes to ARMI blocks.

WARNING: This function has never been verified to work correctly. Therefore, use it at your own risk.

Parameters
  • r (Reactor object) – A reactor object with the same geometry as the RTFLUX/ATFLUX file.

  • adjoint (bool, optional) – If True, block adjoint fluxes are assigned from ATFLUX data. If False, block real fluxes are assigned from RTFLUX data.

armi.nuclearDataIO.rtflux.getDif3dGeodstIndicesFromArmiIndices(fullcore, i, j, i_geodst_max, j_geodst_max, rotated, rotatedFlag=True)[source]

Convert an ARMI (i, j) = (ring, position) assembly index pair into a DIF3D (i_geodst, j_geodst) assembly index pair. This allows one to locate an ARMI assembly in the SASSYS/DIF3D-K text output file..

Parameters
  • i (int) – The ARMI hexagonal assembly ring index (starts with 0, not 1).

  • j (int) – The ARMI hexagonal assembly position index within ring i (starts with 0, not 1).

  • i_geodst_max (int) – The maximum number of “first dimension” hexagonal mesh cells in this DIF3D(-K) core model. This number can be found in the same line as the string ‘NO. OF FIRST DIMENSION MESH INTERVALS’ in the SASSYS/DIF3D-K output text file. GEODST is a common hexagonal assembly indexing scheme in DIF3D(-K).

  • j_geodst_max (int) – The minimum number of “second dimension” hexagonal mesh cells in this DIF3D(-K) core model. This number can be found in the same line as the string ‘NO. OF SECOND DIMENSION MESH INTERVALS’ in the SASSYS/DIF3D-K output text file. GEODST is a common hexagonal assembly indexing scheme in DIF3D(-K).

  • rotated (list of ints) – Stores whether or not each assembly has been rotated in its transformation from DIF3D “four color” nodal to ARMI nodal hex orderings. This is a remnant/vestige of previously-existing funcationality in fluxRecon.

  • rotatedFlag (Boolean, optional) – Whether or not THIS assembly has been rotated in its transformation from DIF3D “four color” nodal to ARMI nodal hex orderings. This is a remnant/vestige of previously-existing funcationality in fluxRecon.

Returns

  • i_geodst+1 (int) – The DIF3D-K hexagonal assembly “first dimension” index in the GEODST indexing scheme.

  • j_geodst+1 (int) – The DIF3D-K hexagonal assembly “second dimension” index in the GEODST indexing scheme.

  • rotated (list of ints) – Stores whether or not each assembly has been rotated in its transformation from DIF3D “four color” nodal to ARMI nodal hex orderings. This is a remnant/vestige of previously-existing funcationality in fluxRecon.