armi.reactor.components.component module¶
Components represent geometric objects within an assembly such as fuel, bond, coolant, ducts, wires, etc.
This module contains the abstract definition of a Component.
-
armi.reactor.components.component.
componentTypeIsValid
(component, name)[source]¶ Checks that the component assigned component type is valid
Notes
Coolant components are can no longer be defined as a general Component and should be specfied as a DerivedShape if the coolant dimensions are not provided.
-
class
armi.reactor.components.component.
_DimensionLink
[source]¶ Bases:
tuple
A linked dimension, where one component uses a dimension from another.
Useful when the boundaries are physically shared and should move together.
The tuple contains (linkedComponent, linkedDimensionName).
In equating two components, we need the linked dimensions to resolve responsibly/precisely.
-
class
armi.reactor.components.component.
ComponentType
[source]¶ Bases:
armi.reactor.composites.CompositeModelType
ComponetType is a metaclass for storing and initializing Component subclass types.
The construction of Component subclasses is being done through factories for ease of user input. As a consequence, the
__init__
methods’ arguments need to be known in order to conform them to the correct format. Additionally, the constructors arguments can be used to determine the Component subclasses dimensions.Warning
The import-time metaclass-based component subclass registration was a good idea, but in practice has caused significant confusion and trouble. We will replace this soon with an explicit plugin-based component subclass registration system.
-
TYPES
= {'circle': <class 'armi.reactor.components.basicShapes.Circle'>, 'component': <class 'armi.reactor.components.component.Component'>, 'cube': <class 'armi.reactor.components.volumetricShapes.Cube'>, 'derivedshape': <class 'armi.reactor.components.DerivedShape'>, 'differentialradialsegment': <class 'armi.reactor.components.volumetricShapes.DifferentialRadialSegment'>, 'helix': <class 'armi.reactor.components.complexShapes.Helix'>, 'hexagon': <class 'armi.reactor.components.basicShapes.Hexagon'>, 'holedhexagon': <class 'armi.reactor.components.complexShapes.HoledHexagon'>, 'holedrectangle': <class 'armi.reactor.components.complexShapes.HoledRectangle'>, 'holedsquare': <class 'armi.reactor.components.complexShapes.HoledSquare'>, 'nullcomponent': <class 'armi.reactor.components.NullComponent'>, 'positiveornegativevolumecomponent': <class 'armi.reactor.components.PositiveOrNegativeVolumeComponent'>, 'radialsegment': <class 'armi.reactor.components.volumetricShapes.RadialSegment'>, 'rectangle': <class 'armi.reactor.components.basicShapes.Rectangle'>, 'shapedcomponent': <class 'armi.reactor.components.component.ShapedComponent'>, 'solidrectangle': <class 'armi.reactor.components.basicShapes.SolidRectangle'>, 'sphere': <class 'armi.reactor.components.volumetricShapes.Sphere'>, 'square': <class 'armi.reactor.components.basicShapes.Square'>, 'torus': <class 'armi.reactor.components.volumetricShapes.Torus'>, 'triangle': <class 'armi.reactor.components.basicShapes.Triangle'>, 'unshapedcomponent': <class 'armi.reactor.components.UnshapedComponent'>, 'unshapedvolumetriccomponent': <class 'armi.reactor.components.UnshapedVolumetricComponent'>, 'zeromasscomponent': <class 'armi.reactor.components.ZeroMassComponent'>}¶
-
NON_DIMENSION_NAMES
= ('Tinput', 'Thot', 'isotopics', 'mergeWith', 'material', 'name', 'components', 'area')¶
-
-
class
armi.reactor.components.component.
Component
(name, material, Tinput, Thot, area=None, isotopics='', mergeWith='', components=None)[source]¶ Bases:
armi.reactor.composites.Composite
A primitive object in a reactor that has definite area/volume, material and composition.
Could be fuel pins, cladding, duct, wire wrap, etc. One component object may represent multiple physical components via the
multiplicity
mechanism.-
inputTemperatureInC
¶ Reference temperature in C at which dimension definitions were input
- Type
-
temperatureInC
Temperature in C to which dimensions were thermally-expanded upon input.
- Type
-
material
¶ The material object that makes up this component and give it its thermo-mechanical properties.
- Type
-
DIMENSION_NAMES
= ()¶
-
INIT_SIGNATURE
= ('name', 'material', 'Tinput', 'Thot', 'area', 'isotopics', 'mergeWith', 'components')¶
-
is3D
= False¶
-
_COMP_REPORT_GROUPS
= {'bond': <armi.bookkeeping.report.data.Table object>, 'clad': <armi.bookkeeping.report.data.Table object>, 'coolant': <armi.bookkeeping.report.data.Table object>, 'duct': <armi.bookkeeping.report.data.Table object>, 'fuel': <armi.bookkeeping.report.data.Table object>, 'gap': <armi.bookkeeping.report.data.Table object>, 'intercoolant': <armi.bookkeeping.report.data.Table object>, 'liner': <armi.bookkeeping.report.data.Table object>, 'wire': <armi.bookkeeping.report.data.Table object>}¶
-
_TOLERANCE
= 1e-10¶
-
THERMAL_EXPANSION_DIMS
= {}¶
-
pDefs
= <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>¶
-
property
temperatureInC
Return the hot temperature in Celsius.
-
property
temperatureInK
¶ Current hot temperature in Kelvin.
-
__lt__
(other)[source]¶ True if a circle encompassing this object has a smaller diameter than one encompassing another component.
This allows sorting because the Python sort functions only use this method.
-
applyMaterialMassFracsToNumberDensities
()[source]¶ Set initial (hot) number densities of this component based Material composition.
Notes
We apply the hot-height density reduction here to account for pre-expanded block heights in blueprints. Future temperature changes can be handled by multiplications of 1/(1+dLL)**2 instead of 1/(1+dLL)**3 since we have pre-expanded in the axial direction.
-
property
liquidPorosity
¶
-
property
gasPorosity
¶
-
setLumpedFissionProducts
(lfpCollection)[source]¶ Sets lumped fission product collection on a lfp compatible material if possible
-
getArea
(cold=False)[source]¶ Get the area of a component in cm^2.
See also
block.getVolumeFractions()
component coolant is typically the “leftover” and is calculated and set here
-
getVolume
()[source]¶ Return the volume [cm^3] of the component.
Notes
self.p.volume
is not set until this method is called, so under most circumstances it is probably not safe to accessself.p.volume
directly. This is because not all components (e.g.,DerivedShape
) can compute their volume during initialization.
-
clearCache
()[source]¶ Invalidate the volume so that it will be recomputed from current dimensions upon next access.
The updated value will be based on its shape and current dimensions. If there is a parent container and that container contains a DerivedShape, then that must be updated as well since its volume may be changing.
See also
clearLinkedCache()
Clears cache of components that depend on this component’s dimensions.
-
_checkNegativeArea
(area, cold)[source]¶ Check for negative area and warn/error when appropriate.
Negative component area is allowed for Void materials (such as gaps) which may be placed between components that will overlap during thermal expansion (such as liners and cladding and annular fuel).
Overlapping is allowed to maintain conservation of atoms while sticking close to the as-built geometry. Modules that need true geometries will have to handle this themselves.
-
getComponentArea
(cold=False)[source]¶ Get the area of this component in cm^2.
- Parameters
cold (bool, optional) – Compute the area with as-input dimensions instead of thermally-expanded
-
setTemperature
(temperatureInC)[source]¶ Adjust temperature of this component.
This will cause thermal expansion or contraction of solid or liquid components and will accordingly adjust number densities to conserve mass.
Liquids still have a number density adjustment, but some mass tends to expand in or out of the bounding area.
Since some composites have multiple materials in them that thermally expand differently, the axial dimension is generally left unchanged. Hence, this a 2-D thermal expansion.
Number density change is proportional to mass density change \(\frac{d\rho}{\rho}\). A multiplicative factor \(f_N\) to apply to number densities when going from T to T’ is as follows:
\[\begin{split}N^{\prime} = N \cdot f_N \\ \frac{dN}{N} = f_N - 1\end{split}\]Since \(\frac{dN}{N} \sim\frac{d\rho}{\rho}\), we have:
\[f_N = \frac{d\rho}{\rho} + 1 = \frac{\rho^{\prime}}{\rho}\]
-
getNuclides
()[source]¶ Return nuclides in this component.
This includes anything that has been specified in here, including trace nuclides.
-
getNumberDensity
(nucName)[source]¶ Get the number density of nucName, return zero if it does not exist here.
-
getNuclideNumberDensities
(nucNames)[source]¶ Return a list of number densities for the nuc names requested.
-
_getNdensHelper
()[source]¶ Return a number densities dict with unexpanded lfps.
Notes
This is implemented more simply on the component level.
-
setNumberDensities
(numberDensities)[source]¶ Set one or more multiple number densities. Clears out any number density not listed.
- Parameters
numberDensities (dict) – nucName: ndens pairs.
Notes
We don’t just call setNumberDensity for each nuclide because we don’t want to call
getVolumeFractions
for each nuclide (it’s inefficient).
-
updateNumberDensities
(numberDensities)[source]¶ Set one or more multiple number densities. Leaves unlisted number densities alone.
- Parameters
numberDensities (dict) – nucName: ndens pairs.
-
getMassEnrichment
()[source]¶ Get the mass enrichment of this component, as defined by the material.
Notes
Getting mass enrichment on any level higher than this is ambiguous because you may have enriched boron in one pin and enriched uranium in another and blending those doesn’t make sense.
-
getMass
(nuclideNames=None)[source]¶ Determine the mass in grams of nuclide(s) and/or elements in this object.
\[\text{mass} = \frac{\sum_i (N_i \cdot V \cdot A_i)}{N_A \cdot 10^{-24}}\]- where
\(N_i\) is number density of nuclide i in (1/bn-cm),
\(V\) is the object volume in \(cm^3\)
\(N_A\) is Avogadro’s number in 1/moles,
\(A_i\) is the atomic weight of of nuclide i in grams/mole
-
setDimension
(key, val, retainLink=False, cold=True)[source]¶ Set a single dimension on the component.
- Parameters
key (str) – The dimension key (op, ip, mult, etc.)
val (float) – The value to set on the dimension
retainLink (bool, optional) – If True, the val will be applied to the dimension of linked component which indirectly changes this component’s dimensions.
cold (book, optional) – If True sets the component to the dimension that would cause the hot dimension to be the specified value.
-
getDimension
(key, Tc=None, cold=False)[source]¶ Return a specific dimension at temperature as determined by key
-
getBoundingCircleOuterDiameter
(Tc=None, cold=False)[source]¶ Abstract bounding circle method that should be overwritten by each shape subclass.
-
getDimensionNamesLinkedTo
(otherComponent)[source]¶ Find dimension names linked to the other component in this component.
-
getThermalExpansionFactor
(Tc=None, T0=None)[source]¶ Retrieves the material thermal expansion fraction.
- Parameters
Tc (float, optional) – Adjusted temperature to get the thermal expansion factor at relative to the reference temperature
- Returns
- Return type
Thermal expansion factor as a percentage (1.0 + dLL), where dLL is the linear expansion factor.
-
printContents
(includeNuclides=True)[source]¶ Print a listing of the dimensions and composition of this component.
-
mergeNuclidesInto
(compToMergeWith)[source]¶ Set another component’s number densities to reflect this one merged into it.
You must also modify the geometry of the other component and remove this component to conserve atoms.
-
iterComponents
(typeSpec=None, exact=False)[source]¶ Return an iterator of armi.reactor.component.Component objects within this Composite.
- Parameters
typeSpec (TypeSpec) – Component flags. Will restrict Components to specific ones matching the flags specified.
exact (bool, optional) – Only match exact component labels (names). If True, ‘coolant’ will not match ‘interCoolant’. This has no impact if typeSpec is None.
- Returns
items matching typeSpec and exact criteria
- Return type
iterator of Component
-
backUp
()[source]¶ Create and store a backup of the state.
This needed to be overridden due to linked components which actually have a parameter value of another ARMI component.
-
restoreBackup
(paramsToApply)[source]¶ Restore the parameters from perviously created backup.
This needed to be overridden due to linked components which actually have a parameter value of another ARMI component.
-
adjustMassEnrichment
(massFraction)[source]¶ Change the mass fraction of this component.
The nuclides to adjust are defined by the material. This changes whichever nuclides are to be enriched vs. the baseline nuclides of that element while holding mass constant. For example it might adjust boron or uranium enrichment.
Conceptually, you could hold number of atoms, volume, or mass constant during this operation. Historically ARMI adjusted mass fractions which was meant to keep mass constant.
If you have 20 mass % Uranium and adjust the enrichment, you will still have 20% Uranium mass. But, the actual mass actually might change a bit because the enriched nuclide weighs less.
See also
Material.enrichedNuclide()
-
getIntegratedMgFlux
(adjoint=False, gamma=False)[source]¶ Return the multigroup neutron tracklength in [n-cm/s]
The first entry is the first energy group (fastest neutrons). Each additional group is the next energy group, as set in the ISOTXS library.
-
getLumpedFissionProductCollection
()[source]¶ Get collection of LFP objects. Will work for global or block-level LFP models.
- Returns
lfps – lfpName keys , lfp object values
- Return type
-
getReactionRates
(nucName, nDensity=None)[source]¶ - Parameters
- str (nucName) – nuclide name – e.g. ‘U235’
- float (nDensity) – number Density
- Returns
dictionary of reaction rates (rxn/s) for nG, nF, n2n, nA and nP
- Return type
rxnRates - dict
Note
if you set nDensity to 1/CM2_PER_BARN this makes 1 group cross section generation easier
-
paramCollectionType
¶ alias of
armi.reactor.parameters.parameterCollections.ComponentParameterCollection
-
-
class
armi.reactor.components.component.
ShapedComponent
(name, material, Tinput, Thot, area=None, isotopics='', mergeWith='', components=None)[source]¶ Bases:
armi.reactor.components.component.Component
A component with well-defined dimensions.
-
DIMENSION_NAMES
= ()¶
-
INIT_SIGNATURE
= ('name', 'material', 'Tinput', 'Thot', 'area', 'isotopics', 'mergeWith', 'components')¶
-
paramCollectionType
¶ alias of
armi.reactor.parameters.parameterCollections.ComponentParameterCollection
-
-
armi.reactor.components.component.
getReactionRateDict
(nucName, lib, xsType, mgFlux, nDens)[source]¶ - Parameters
- str (xsType) – nuclide name – e.g. ‘U235’
- isotxs (lib) – cross section library
- str – cross section type – e.g. - ‘A’
- numpy.nArray (mgFlux) – integrated mgFlux (n-cm/s)
- float (nDens) – number density (at/bn-cm)
- Returns
dictionary of reaction rates (rxn/s) for nG, nF, n2n, nA and nP
- Return type
rxnRates - dict
Note
assume there is no n3n cross section in ISOTXS