armi.reactor.converters.uniformMesh module

Converts reactor with arbitrary axial meshing (e.g. multiple assemblies with different axial meshes) to one with a global uniform axial mesh.

Useful for preparing inputs for physics codes that require structured meshes from a more flexible ARMI reactor mesh.

This is implemented generically but includes a concrete subclass for neutronics-specific parameters. This is used for build input files for codes like DIF3D which require axially uniform meshes.

Requirements

  1. Build an average reactor with aligned axial meshes from a reactor with arbitrarily unaligned axial meshes in a way that conserves nuclide mass

  2. Translate state information computed on the uniform mesh back to the unaligned mesh.

  3. For neutronics cases, all neutronics-related block params should be translated, as well as the multigroup real and adjoint flux.

Examples

converter = uniformMesh.NeutronicsUniformMeshConverter() converter.convert(reactor) uniformReactor = converter.convReactor # do calcs, then: converter.applyStateToOriginal()

The mesh mapping happens as described in the figure:

../_images/axial_homogenization.png
class armi.reactor.converters.uniformMesh.UniformMeshGeometryConverter(cs=None)[source]

Bases: armi.reactor.converters.geometryConverters.GeometryConverter

This geometry converter can be used to change the axial mesh structure of the reactor core.

Notes

There are several staticmethods available on this class that allow for:
  • Creation of a new reactor without applying a new uniform axial mesh. See: <UniformMeshGeometryConverter.initNewReactor>

  • Creation of a new assembly with a new axial mesh applied. See: <UniformMeshGeometryConverter.makeAssemWithUniformMesh>

  • Resetting the parameter state of an assembly back to the defaults for the provided block parameters. See: <UniformMeshGeometryConverter.clearStateOnAssemblies>

  • Mapping number densities and block parameters between one assembly to another. See: <UniformMeshGeometryConverter.setAssemblyStateFromOverlaps>

REACTOR_PARAM_MAPPING_CATEGORIES = []
BLOCK_PARAM_MAPPING_CATEGORIES = []
convert(r=None)[source]

Create a new reactor core with a uniform mesh.

static initNewReactor(sourceReactor, cs)[source]

Build a new, yet empty, reactor with the same settings as sourceReactor

Parameters
  • sourceReactor (Reactor object.) – original reactor to be copied

  • cs (CaseSetting object) – Complete settings object

applyStateToOriginal()[source]

Apply the state of the converted reactor back to the original reactor, mapping number densities and block parameters.

static makeAssemWithUniformMesh(sourceAssem, newMesh, blockParamNames=None, mapNumberDensities=True)[source]

Build new assembly based on a source assembly but apply the uniform mesh.

Notes

This creates a new assembly based on the provided source assembly, applies a new uniform mesh and then maps number densities and block-level parameters to the new assembly from the source assembly.

Parameters
  • sourceAssem (Assembly <armi.reactor.assemblies.Assembly> object) – Assembly that is used to map number densities and block-level parameters to a new mesh structure.

  • newMesh (List[float]) – A list of the new axial mesh coordinates of the blocks. Note that these mesh coordinates are in cm and should represent the top axial mesh coordinates of the new blocks.

  • blockParamNames (List[str], optional) – A list of block parameter names to map between the source assembly and the newly created assembly with the provided newMesh.

  • mapNumberDensities (bool, optional) – If True, number densities will be mapped from the source assembly to the new assembly. This is True by default, but this can be set to False to only map block-level parameters if the names are provided in blockParamNames. It can be useful to set this to False in circumstances where the setNumberDensitiesFromOverlaps does not conserve mass and for some edge cases. This can show up in specific instances with moving meshes (i.e., control rods) in some applications. In those cases, the mapping of number densities can be treated independent of this more general implementation.

See also

setAssemblyStateFromOverlaps

This can be used to reverse the number density and parameter mappings between two assemblies.

static setAssemblyStateFromOverlaps(sourceAssembly, destinationAssembly, blockParamNames=None, mapNumberDensities=True)[source]

Set state data (i.e., number densities and block-level parameters) on a assembly based on a source assembly with a different axial mesh.

This solves an averaging equation from the source to the destination.

\[<P> =\]

rac{int_{z_1}^{z_2} P(z) dz}{int_{z_1}^{z_2} dz}

which can be solved piecewise for z-coordinates along the source blocks.

sourceAssemblyAssembly

assem that has the state

destinationAssemblyAssembly

assem that has is getting the state from sourceAssembly

blockParamNamesList[str], optional

A list of block parameter names to map between the source assembly and the destination assembly.

mapNumberDensitiesbool, optional

If True, number densities will be mapped from the source assembly to the destination assembly. This is True by default, but this can be set to False to only map block-level parameters if the names are provided in blockParamNames. It can be useful to set this to False in circumstances where the setNumberDensitiesFromOverlaps does not conserve mass and for some edge cases. This can show up in specific instances with moving meshes (i.e., control rods) in some applications. In those cases, the mapping of number densities can be treated independent of this more general implementation.

setNumberDensitiesFromOverlaps : does this but does smarter caching for number densities.

static clearStateOnAssemblies(assems, blockParamNames=None, cache=True)[source]

Clears the parameter state of blocks for a list of assemblies.

Parameters
  • assems (List[Assembly <armi.reactor.assemblies.Assembly>]) – List of assembly objects.

  • blockParamNames (List[str], optional) – A list of block parameter names to clear on the given assemblies.

  • cache (bool) – If True, the block parameters that were cleared are stored and returned as a dictionary of {b: {param1: val1, param2: val2}, b2: {...}, ...}

plotConvertedReactor()[source]

Generate a radial layout image of the converted reactor core.

reset()[source]

Clear out stored attributes and reset the global assembly number.

class armi.reactor.converters.uniformMesh.NeutronicsUniformMeshConverter(cs=None, calcReactionRates=True)[source]

Bases: armi.reactor.converters.uniformMesh.UniformMeshGeometryConverter

A uniform mesh converter that specifically maps neutronics parameters.

Notes

If a case runs where two mesh conversions happen one after the other (e.g. a fixed source gamma transport step that needs appropriate fission rates), it is essential that the neutronics params be mapped onto the newly converted reactor as well as off of it back to the source reactor.

Parameters
  • cs (obj, optional) – Case settings object.

  • calcReactionRates (bool, optional) – Set to True by default, but if set to False the reaction rate calculation after the neutron flux is remapped will not be calculated.

REACTOR_PARAM_MAPPING_CATEGORIES = ['neutronics']
BLOCK_PARAM_MAPPING_CATEGORIES = ['detailedAxialExpansion', 'multi-group quantities']
class armi.reactor.converters.uniformMesh.BlockParamMapper[source]

Bases: object

Namespace for parameter setters/getters that can be used when transferring data from one assembly to another during the mesh conversion process.

static paramSetter(block, vals, paramNames)[source]

Sets block parameter data.

static paramGetter(block, paramNames)[source]

Returns block parameter values as an array in the order of the parameter names given.

armi.reactor.converters.uniformMesh.setNumberDensitiesFromOverlaps(block, overlappingBlockInfo)[source]

Set number densities on a block based on overlapping blocks

A conservation of number of atoms technique is used to map the non-uniform number densities onto the uniform neutronics mesh. When the number density of a height \(H\) neutronics mesh block \(N^{\prime}\) is being computed from one or more blocks in the ARMI mesh with number densities \(N_i\) and heights \(h_i\), the following formula is used:

\[N^{\prime} = \sum_i N_i \frac{h_i}{H}\]