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.ComponentType(name, bases, attrs)[source]
Bases:
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.
- 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:
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.The primitive object in an ARMI reactor is a Component. A Component is comprised of a shape and composition. This class serves as a base class which all Component types within ARMI are built upon. All primitive shapes (such as a square, circle, holed hexagon, helix etc.) are derived from this base class.
Fundamental capabilities of this class include the ability to store parameters and attributes which describe the physical state of each Component within the ARMI data model.
Implementation: Order Components by their outermost diameter (using the < operator). I_ARMI_COMP_ORDERDetermining Component order by outermost diameters is implemented via the
__lt__()
method, which is used to controlsort()
as the standard approach in Python. However,__lt__()
does not show up in the API.- Variables:
temperatureInC (float) – Current temperature of component in celcius.
inputTemperatureInC (float) – Reference temperature in C at which dimension definitions were input
temperatureInC – Temperature in C to which dimensions were thermally-expanded upon input.
material (str or material.Material) – The material object that makes up this component and give it its thermo-mechanical properties.
- DIMENSION_NAMES = ()
- INIT_SIGNATURE = ('name', 'material', 'Tinput', 'Thot', 'area', 'isotopics', 'mergeWith', 'components')
- is3D = False
- 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.
- resolveLinkedDims(components)[source]
Convert dimension link strings to actual links.
Implementation: The volume of some defined shapes depend on the solid components surrounding them. I_ARMI_COMP_FLUID1Some Components are fluids and are thus defined by the shapes surrounding them. This method cycles through each dimension defining the border of this Component and converts the name of that Component to a link to the object itself. This series of links is then used downstream to resolve dimensional information.
- applyMaterialMassFracsToNumberDensities()[source]
Set the hot number densities for the component based on material mass fractions/density.
Notes
the density returned accounts for the expansion of the component due to the difference in self.inputTemperatureInC and self.temperatureInC
After the expansion, the density of the component should reflect the 3d density of the material
- adjustDensityForHeightExpansion(newHot)[source]
Change the densities in cases where height of the block/component is changing with expansion.
Notes
Call before setTemperature since we need old hot temp. This works well if there is only 1 solid component. If there are multiple components expanding at different rates during thermal expansion this becomes more complicated and, and axial expansion should be used. Multiple expansion rates cannot trivially be accommodated. See AxialExpansionChanger.
- getHeightFactor(newHot)[source]
Return the factor by which height would change by if we did 3D expansion.
Notes
Call before setTemperature since we need old hot temp.
- getProperties()[source]
Return the active Material object defining thermo-mechanical properties.
This method returns the material object that is assigned to the Component.
This method returns the material object that is assigned to the Component.
- 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.
This method returns the area of a Component.
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.
This method returns the volume of a 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.
- 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.
- setNumberDensity(nucName, val)[source]
Set heterogeneous number density.
The method allows a user or plugin to set the number density of a Component. It also indicates to other processes that may depend on a Component’s status about this change via the
assigned
attribute.
- setNumberDensities(numberDensities)[source]
Set one or more multiple number densities. Clears out any number density not listed.
The method allows a user or plugin to set the number densities of a Component. In contrast to the
setNumberDensity
method, it sets all densities within a Component.- 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, wipe=False)[source]
Set one or more multiple number densities. Leaves unlisted number densities alone.
- Parameters:
Notes
Sometimes volume/dimensions change due to number density change when the material thermal expansion depends on the component’s composition (e.g. its plutonium fraction). In this case, changing the density will implicitly change the area/volume. Since it is difficult to predict the new dimensions, and perturbation/depletion calculations almost exclusively assume constant volume, the densities sent are automatically adjusted to conserve mass with the original dimensions. That is, the component’s densities are not exactly as passed, but whatever they would need to be to preserve volume integrated number densities (moles) from the pre-perturbed component’s volume/dimensions.
This has no effect if the material thermal expansion has no dependence on component composition. If this is not desired, self.p.numberDensities can be set directly.
- changeNDensByFactor(factor)[source]
Change the number density of all nuclides within the object by a multiplicative factor.
- 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.
Dimensions should be set considering the impact of thermal expansion. This method allows for a user or plugin to set a dimension and indicate if the dimension is for a cold configuration or not. If it is not for a cold configuration, the thermal expansion factor is considered when setting the dimension.
If the
retainLink
argument isTrue
, any Components linked to this one will also have its dimensions changed consistently. After a dimension is updated, theclearLinkedCache
method is called which sets the volume of this Component toNone
. This ensures that when the volume is next accessed it is recomputed using the updated dimensions.- 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 (bool, optional) – If True sets the component cold dimension to the specified value.
- getDimension(key, Tc=None, cold=False)[source]
Return a specific dimension at temperature as determined by key.
Due to thermal expansion, Component dimensions depend on their temperature. This method retrieves a dimension from the Component at a particular temperature, if provided. If the Component is a LinkedComponent then the dimensions are resolved to ensure that any thermal expansion that has occurred to the Components that the LinkedComponent depends on is reflected in the returned dimension.
- getBoundingCircleOuterDiameter(Tc=None, cold=False)[source]
Abstract bounding circle method that should be overwritten by each shape subclass.
- getCircleInnerDiameter(Tc=None, cold=False)[source]
Abstract inner circle method that should be overwritten by each shape subclass.
Notes
The inner circle is meaningful for annular shapes, i.e., circle with non-zero ID, hexagon with non-zero IP, etc. For shapes with corners (e.g., hexagon, rectangle, etc) the inner circle intersects the corners of the inner bound, opposed to intersecting the “flats”.
- 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.
This method enables the calculation of the thermal expansion factor for a given material. If the material is solid, the difference between
T0
andTc
is used to calculate the thermal expansion factor. If a solid material does not have a linear expansion factor defined and the temperature difference is greater than a predetermined tolerance, an error is raised. Thermal expansion of fluids or custom materials is neglected, currently.- Parameters:
Tc (float, optional) – Adjusted temperature to get the thermal expansion factor at relative to the reference temperature
- 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.
- 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
- getMgFlux(adjoint=False, average=False, volume=None, gamma=False)[source]
Return the multigroup neutron flux in [n/cm^2/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.
- Parameters:
adjoint (bool, optional) – Return adjoint flux instead of real
average (bool, optional) – If True, will return average flux between latest and previous. Doesn’t work for pin detailed.
volume (float, optional) – The volume-integrated flux is divided by volume before being returned. The user may specify a volume here, or the function will obtain the block volume directly.
gamma (bool, optional) – Whether to return the neutron flux or the gamma flux.
- Returns:
flux – multigroup neutron flux in [n/cm^2/s]
- Return type:
np.ndarray
- 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.
- getPinMgFluxes(adjoint: bool | None = False, gamma: bool | None = False) ndarray [source]
Retrieves the pin multigroup fluxes for the component.
- Parameters:
- Returns:
A
(N, nGroup)
array of pin multigroup fluxes, whereN
is the equivalent to the multiplicity of the component (self.p.mult
) andnGroup
is the number of energy groups of the flux.- Return type:
np.ndarray
- Raises:
ValueError – If the location(s) of the component are not aligned with pin indices from the block. This would happen if this component is not actually a pin.
- 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:
LumpedFissionProduct
- paramCollectionType
alias of
ComponentParameterCollection
- getPitchData()[source]
Return the pitch data that should be used to determine block pitch.
Notes
This pitch data should only be used if this is the pitch defining component in a block. The block is responsible for determining which component in it is the pitch defining component.
- finalizeLoadingFromDB()[source]
Apply any final actions after creating the component from database.
This should only be called internally by the database loader. Otherwise some properties could be doubly applied.
This exists because the theoretical density is initially defined as a material modification, and then stored as a Material attribute. When reading from blueprints, the blueprint loader sets the theoretical density parameter from the Material attribute. Component parameters are also set when reading from the database. But, we need to set the Material attribute so routines that fetch a material’s density property account for the theoretical density.
- class armi.reactor.components.component.ShapedComponent(name, material, Tinput, Thot, area=None, isotopics='', mergeWith='', components=None)[source]
Bases:
Component
A component with well-defined dimensions.
- DIMENSION_NAMES = ()
- INIT_SIGNATURE = ('name', 'material', 'Tinput', 'Thot', 'area', 'isotopics', 'mergeWith', 'components')
- paramCollectionType
alias of
ComponentParameterCollection