armi.reactor.converters.geometryConverters module¶
Change a reactor from one geometry to another.
Examples may include going from Hex to R-Z or from Third-core to full core. This module contains converters (which create new reactor objects with different geometry), and changers (which modify a given reactor in place) in this module.
Generally, mass is conserved in geometry conversions.
Warning
These are mostly designed for hex geometry.
-
class
armi.reactor.converters.geometryConverters.
GeometryChanger
(cs=None, quiet=False)[source]¶ Bases:
object
Geometry changer class that updates the geometry (number of assems or blocks per assem) of a given reactor.
-
class
armi.reactor.converters.geometryConverters.
GeometryConverter
(cs=None, quiet=False)[source]¶ Bases:
armi.reactor.converters.geometryConverters.GeometryChanger
Base class for GeometryConverter which makes a new converted reactor.
Examples
To convert a hex case to a R-Z case, do this:
>>> geomConv = armi.reactorConverters.HexToRZConverter(useMostCommonXsId=False, expandReactor=False) >>> geomConv.convert(r) >>> newR = geomConv.convReactor >>> dif3d = dif3dInterface.Dif3dInterface('dif3dRZ', newR) >>> dif3d.o = self.o >>> dif3d.writeInput('rzGeom_actual.inp')
-
class
armi.reactor.converters.geometryConverters.
FuelAssemNumModifier
(cs)[source]¶ Bases:
armi.reactor.converters.geometryConverters.GeometryChanger
Modify the number of fuel assemblies in the reactor.
Notes
The number of fuel assemblies should ALWAYS be set for the third-core regardless of the reactor geometry model.
The modification is only valid for third-core and full-core geometry models.
-
convert
(r=None)[source]¶ Set the number of fuel assemblies in the reactor.
Notes
While adding fuel, does not modify existing fuel/control positions, but does overwrite assemblies in the overwriteList (e.g. reflectors, shields)
Once specified amount of fuel is in place, removes all assemblies past the outer fuel boundary
To re-add reflector/shield assemblies around the new core, use the ringsToAdd attribute
-
addRing
(assemType='big shield')[source]¶ Add a ring of fuel assemblies around the outside of an existing core
Works by first finding the assembly furthest from the center, then filling in all assemblies that are within one pitch further with the specified assembly type
- Parameters
assemType (str) – Assembly type that will be added to the outside of the core
-
class
armi.reactor.converters.geometryConverters.
HexToRZThetaConverter
(cs, converterSettings, expandReactor=False, strictHomogenization=False)[source]¶ Bases:
armi.reactor.converters.geometryConverters.GeometryConverter
Convert hex-based cases to an equivalent R-Z-Theta full core geometry.
- Parameters
converterSettings (dict) –
Settings that specify how the mesh of the RZTheta reactor should be generated. Controls the number of theta regions, how to group regions, etc.
- uniformThetaMesh
bool flag that determines if the theta mesh should be uniform or not
- thetaBins
Number of theta bins to create
- radialConversionType
Ring Compositions
– to convert by composition
- axialConversionType
Axial Coordinates
– usearmi.reactor.converters.meshConverters._RZThetaReactorMeshConverterByAxialCoordinates
Axial Bins
– usearmi.reactor.converters.meshConverters._RZThetaReactorMeshConverterByAxialBins
- expandReactorbool
If True, the HEX-Z reactor will be expanded to full core geometry prior to converting to the RZT reactor. Either way the converted RZTheta core will be full core.
- strictHomogenizationbool
If True, the converter will restrict HEX-Z blocks with dissimilar XS types from being homogenized into an RZT block.
-
_GEOMETRY_TYPE
= 3¶
-
_SYMMETRY_TYPE
= <armi.reactor.geometry.SymmetryType object>¶
-
_BLOCK_MIXTURE_TYPE_MAP
= {'mixture axial shield': ['shield'], 'mixture control': ['control'], 'mixture duct': ['duct'], 'mixture fuel': ['fuel'], 'mixture plenum': ['plenum'], 'mixture radial shield': ['radial shield'], 'mixture structure': ['grid plate', 'reflector', 'inlet nozzle', 'handling socket']}¶
-
_BLOCK_MIXTURE_TYPE_EXCLUSIONS
= ['control', 'fuel', 'radial shield']¶
-
_MESH_BY_RING_COMP
= 'Ring Compositions'¶
-
_MESH_BY_AXIAL_COORDS
= 'Axial Coordinates'¶
-
_MESH_BY_AXIAL_BINS
= 'Axial Bins'¶
-
convert
(r)[source]¶ Run the conversion to 3 dimensional R-Z-Theta.
-
r
¶ The reactor to convert.
- Type
Reactor object
Notes
As a part of the RZT mesh converters it is possible to obtain a radial mesh that has repeated ring numbers. For instance, if there are fuel assemblies and control assemblies within the same radial hex ring then it’s possible that a radial mesh output from the byRingComposition mesh converter method will look something like:
self.meshConverter.radialMesh = [2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 8, 8, 9, 10]
In this instance the hex ring will remain the same for multiple iterations over radial direction when homogenizing the hex core into the RZT geometry. In this case, the converter needs to keep track of the compositions within this ring so that it can separate this repeated ring into multiple RZT rings. Each of the RZT rings should have a single composition (fuel1, fuel2, control, etc.)
-
-
_setNextAssemblyTypeInRadialZone
(lowerRing, upperRing)[source]¶ Change the currently-active assembly type to the next active one based on a specific order.
If this is called with the same (lowerRing, upperRing) twice, the next assembly type will be applied. This is useful, for instance, in putting control zones amidst fuel.
-
_getSortedAssemblyTypesInRadialZone
(lowerRing, upperRing)[source]¶ Retrieve assembly types in a radial zone between (lowerRing, upperRing), sort from highest occurrence to lowest.
Notes
Assembly types are based on the assembly names and not the direct composition within each assembly. For instance, if two assemblies are named fuel 1 and fuel 2 but they have the same composition at some reactor state then they will still be separated as two different assembly types.
-
_setAssemsInRadialZone
(radialIndex, lowerRing, upperRing)[source]¶ Retrieve a list of assemblies in the reactor between (lowerRing, upperRing)
Notes
self._assemsInRadialZone keeps track of the unique assemblies that are in each radial ring. This ensures that no assemblies are duplicated when using self._getAssemsInRadialThetaZone()
-
static
_getAssembliesInSector
(core, theta1, theta2)[source]¶ Locate assemblies in an angular sector.
- Parameters
theta2 (theta1,) – The angles (in degrees) in which assemblies shall be drawn.
- Returns
aList – List of assemblies in this sector
- Return type
-
_getAssemsInRadialThetaZone
(lowerRing, upperRing, lowerTheta, upperTheta)[source]¶ Retrieve list of assemblies in the reactor between (lowerRing, upperRing) and (lowerTheta, upperTheta).
-
_selectAssemsBasedOnType
(assems)[source]¶ Retrieve a list of assemblies of a given type within a subset of an assembly list.
- Parameters
assems (list) – Subset of assemblies in the reactor.
-
_createRadialThetaZone
(innerDiameter, thetaIndex, radialIndex, lowerTheta, upperTheta, zoneAssems)[source]¶ Add a new stack of circles to the TRZ reactor by homogenizing assems
- innerDiameter:
The current innerDiameter of the radial-theta zone
- thetaIndex:
The theta index of the radial-theta zone
- radialIndex:
The radial index of the radial-theta zone
- lowerTheta:
The lower theta bound for the radial-theta zone
- upperTheta:
The upper theta bound for the radial-theta zone
- Returns
outerDiameter – The outer diameter (in cm) of the radial zone just added
- Return type
-
_calcRadialRingVolume
(lowerZ, upperZ, radialIndex)[source]¶ Compute the total volume of a list of assemblies within a ring between two axial heights.
-
_checkVolumeConservation
(newBlock)[source]¶ Write the volume fractions of each hex block within the homogenized RZT block.
-
createHomogenizedRZTBlock
(homBlock, lowerAxialZ, upperAxialZ, radialThetaZoneAssems)[source]¶ Create the homogenized RZT block by computing the average atoms in the zone.
Additional calculations are performed to determine the homogenized block type, the block average temperature, and the volume fraction of each hex block that is in the new homogenized block.
-
_getHomogenizedBlockType
(numHexBlockByType)[source]¶ Generate the homogenized block mixture type based on the frequency of hex block types that were merged together.
Notes
- self._BLOCK_MIXTURE_TYPE_EXCLUSIONS:
The normal function of this method is to assign the mixture name based on the number of occurrences of the block type. This list stops that and assigns the mixture based on the first occurrence. (i.e. if the mixture has a set of blocks but it comes across one with the name of ‘control’ the process will stop and the new mixture type will be set to ‘mixture control’
- self._BLOCK_MIXTURE_TYPE_MAP:
A dictionary that provides the name of blocks that are condensed together
-
_createBlendedXSID
(newBlock)[source]¶ Generate the blended XS id using the most common XS id in the hexIdList
-
_writeRadialThetaZoneInfo
(axIdx, axialSegmentHeight, blockObj)[source]¶ Create a summary of the mapping between the converted reactor block ids to the hex reactor block ids
-
_expandSourceReactorGeometry
()[source]¶ Expansion of the reactor geometry to build the R-Z-Theta core model
-
plotConvertedReactor
(fNameBase=None)[source]¶ Generate plots for the converted RZT reactor.
- Parameters
fNameBase (str, optional) – A name that will form the basis of the N plots that are generated by this method. Will get split on extension and have numbers added. Should be like
coreMap.png
.
Notes
XTView can be used to view the RZT reactor but this is useful to examine the conversion of the hex-z reactor to the rzt reactor.
This makes plots of each individual theta mesh
-
class
armi.reactor.converters.geometryConverters.
HexToRZConverter
(cs, converterSettings, expandReactor=False, strictHomogenization=False)[source]¶ Bases:
armi.reactor.converters.geometryConverters.HexToRZThetaConverter
Create a new reactor with R-Z coordinates from the Hexagonal-Z reactor
This is a subclass of the HexToRZThetaConverter. See the HexToRZThetaConverter for explanation and setup of the converterSettings.
-
_GEOMETRY_TYPE
= 4¶
-
-
class
armi.reactor.converters.geometryConverters.
ThirdCoreHexToFullCoreChanger
(cs=None, quiet=False)[source]¶ Bases:
armi.reactor.converters.geometryConverters.GeometryChanger
Change third-core models to full core in place
Does not generate a new reactor object.
Examples
>>> converter = ThirdCoreHexToFullCoreChanger() >>> converter.convert(myReactor)
-
EXPECTED_INPUT_SYMMETRY
= <armi.reactor.geometry.SymmetryType object>¶
-
-
class
armi.reactor.converters.geometryConverters.
EdgeAssemblyChanger
(cs=None, quiet=False)[source]¶ Bases:
armi.reactor.converters.geometryConverters.GeometryChanger
Add/remove “edge assemblies” for Finite difference or MCNP cases
Examples
edgeChanger = EdgeAssemblyChanger() edgeChanger.removeEdgeAssemblies(reactor.core)
-
addEdgeAssemblies
(core)[source]¶ Add the assemblies on the 120 degree symmetric line to 1/3 symmetric cases
Needs to be called before a finite difference (DIF3D, DIFNT) or MCNP calculation
- Parameters
reactor (Reactor) – Reactor to modify
See also
removeEdgeAssemblies()
removes the edge assemblies
-
removeEdgeAssemblies
(core)[source]¶ remove the edge assemblies in preparation for the nodal diffusion approximation
This makes use of the assemblies knowledge of if it is in a region that it needs to be removed.
See also
addEdgeAssemblies()
adds the edge assemblies
-
static
scaleParamsRelatedToSymmetry
(reactor, paramsToScaleSubset=None)[source]¶ Scale volume-dependent params like power to account for cut-off edges
These params are at half their full hex value. Scale them right before deleting their symmetric identicals. The two operations (scaling them and then removing others) is identical to combining two half-assemblies into a full one.
See also
armi.reactor.converters.geometryConverter.EdgeAssemblyChanger.removeEdgeAssemblies()
,armi.reactor.blocks.HexBlock.getSymmetryFactor()
-
-
armi.reactor.converters.geometryConverters.
_generateListOfParamsToScale
(r, paramsToScaleSubset)[source]¶