armi.reactor.blocks module¶
Defines blocks, which are axial chunks of assemblies. They contain most of the state variables, including power, flux, and homogenized number densities.
Assemblies are made of blocks.
Blocks are made of components.
-
class
armi.reactor.blocks.Block(name, height=1.0, location=None)[source]¶ Bases:
armi.reactor.composites.CompositeA homogenized axial slab of material.
Blocks are stacked together to form assemblies.
Builds a new ARMI block
- caseSettingsSettings object, optional
The settings object to use to build the block
- namestr, optional
The name of this block
- heightfloat, optional
The height of the block in cm. Defaults to 1.0 so that getVolume assumes unit height.
-
inerts= []¶
-
uniqID= 0¶
-
PITCH_DIMENSION= 'op'¶
-
PITCH_COMPONENT_TYPE= None¶
-
LOCATION_CLASS= None¶
-
pDefs= <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>¶
-
__deepcopy__(memo)[source]¶ Custom deepcopy behavior to prevent duplication of macros and _lumpedFissionProducts.
We detach the recursive links to the parent and the reactor to prevent blocks carrying large independent copies of stale reactors in memory. If you make a new block, you must add it to an assembly and a reactor.
-
property
core¶
-
property
r¶ A block should only have a reactor through a parent assembly.
It may make sense to try to factor out usage of
b.r.For now, this is presumptive of the structure of the composite hierarchy; i.e. the parent of a CORE must be the reactor. Fortunately, we probably don’t ultimately want to return the reactor in the first place. Rather, we probably want the core anyways, since practically all b.r calls are historically b.r.core. It may be prefereable to remove this property, replace with self.core, which can return the core. Then refactor all of the b.r.cores, to b.core.
-
property
location¶ Patch to keep code working while location system is refactored to use spatialLocators.
Just creates a new location object based on current spatialLocator.
-
makeName(assemNum, axialIndex)[source]¶ Generate a standard block from assembly number.
This also sets the block-level assembly-num param.
Examples
>>> makeName(120, 5) 'B0120E'
-
makeUnique()[source]¶ This function assigns a unique id (integer value) for each block. This should be called whenever creating a block that is intended to be treated as a unique object. For example, if you were to broadcast or pickle a block it should have the same ID across all nodes. Likewise, if you deepcopy a block for a temporary purpose to it should have the same ID. However, ARMI’s assembly construction also uses deepcopy, and in order to keep that functionality, this method needs to be called after creating a fresh assembly (from deepcopy).
-
getSmearDensity(cold=True)[source]¶ Compute the smear density of this block.
Notes
- 1 - Smear density is the area of the fuel divided by the area of the space available for fuel
inside the cladding. Other space filled with solid materials is not considered available. If all the area is fuel, it has 100% smear density. Lower smear density allows more room for swelling.
- 2 - Negative areas can exist for void gaps in the fuel pin. A negative area in a gap represents overlap area
between two solid components. To account for this additional space within the pin cladding the abs(negativeArea) is added to the inner cladding area.
- Parameters
cold (bool, optional) – If false, returns the smear density at hot temperatures
- Returns
smearDensity – The smear density as a fraction
- Return type
float
-
getTemperature(key, sigma=0)[source]¶ Return the best temperature for key in degrees C.
Uses thInterface values if they exist
- Parameters
key (str) – a key identifying the object we want the temperature of. Options include cladOD, cladID,
sigma (int) – Specification of which sigma-value we want. 0-sigma is nominal, 1-sigma is + 1 std.dev, etc.
- Returns
tempInC (float) – temperature in C
SingleWarnings will be issued if a non-zero sigma value is requested but does not exist.
Nominal Thermo values will be returned in that case.
-
getEnrichment()[source]¶ Return the mass enrichment of the fuel in the block.
If multiple fuel components exist, this returns the average enrichment.
-
getMgFlux(adjoint=False, average=False, volume=None, gamma=False)[source]¶ Returns 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.
It is stored integrated over volume on self.p.mgFlux
- 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 yet
volume (float, optional) – If average=True, 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
- Return type
multigroup neutron flux in [n/cm^2/s]
-
setPinMgFluxes(fluxes, numPins, adjoint=False, gamma=False)[source]¶ Store the pin-detailed multi-group neutron flux
The [g][i] indexing is transposed to be a list of lists, one for each pin. This makes it simple to do depletion for each pin, etc.
- Parameters
fluxes (2-D list of floats) – The block-level pin multigroup fluxes. fluxes[g][i] represents the flux in group g for pin i. Flux units are the standard n/cm^2/s. The “ARMI pin ordering” is used, which is counter-clockwise from 3 o’clock.
numPins (int) – The number of pins in this block.
adjoint (bool, optional) – Whether to set real or adjoint data.
gamma (bool, optional) – Whether to set gamma or neutron data.
Outputs –
------- –
self.p.pinMgFluxes (2-D array of floats) – The block-level pin multigroup fluxes. pinMgFluxes[g][i] represents the flux in group g for pin i. Flux units are the standard n/cm^2/s. The “ARMI pin ordering” is used, which is counter-clockwise from 3 o’clock.
-
getPowerPinName()[source]¶ Determine the component name where the power is being produced.
- Returns
powerPin – The name of the pin that is producing power, if any. could be ‘fuel’ or ‘control’, or anything else.
- Return type
str
Notes
If there is fuel and control, this will return fuel based on hard-coded priorities.
Examples
>>> b.getPowerPinName() 'fuel'
>>> b.getPowerPinName() 'control'
>>> b.getPowerPinName() None
-
getMicroSuffix()[source]¶ Returns the microscopic library suffix (e.g. ‘AB’) for this block.
DIF3D and MC2 are limited to 6 character nuclide labels. ARMI by convention uses the first 4 for nuclide name (e.g. U235, PU39, etc.) and then uses the 5th character for cross-section type and the 6th for burnup group. This allows a variety of XS sets to be built modeling substantially different blocks.
Notes
The single-letter use for xsType and buGroup limit users to 26 groups of each. ARMI will allow 2-letter xsType designations if and only if the buGroups setting has length 1 (i.e. no burnup groups are defined). This is useful for high-fidelity XS modeling of V&V models such as the ZPPRs.
-
setNumberDensity(nucName, newHomogNDens)[source]¶ Adds an isotope to the material or changes an existing isotope’s number density
- Parameters
nuc (str) – a nuclide name like U235, PU240, FE
newHomogNDens (float) – number density to set in units of atoms/barn-cm, which are equal to atoms/cm^3*1e24
See also
getNumberDensity()gets the density of a nuclide
-
setNumberDensities(numberDensities)[source]¶ Update number densities.
Any nuclide in the block but not in numberDensities will be set to zero.
Special behavior for blocks: update block-level params for DB viewing/loading.
-
updateNumberDensities(numberDensities)[source]¶ Set one or more multiple number densities. Leaves unlisted number densities alone.
-
setNDensParam(nucName, ndens)[source]¶ Set a block-level param with the homog. number density of a nuclide.
This can be read by the database in restart runs.
-
setMass(nucName, mass, **kwargs)[source]¶ Sets the mass in a block and adjusts the density of the nuclides in the block.
- Parameters
nucName (str) – Nuclide name to set mass of
mass (float) – Mass in grams to set.
-
setHeight(modifiedHeight, conserveMass=False, adjustList=None)[source]¶ Set a new height of the block.
- Parameters
modifiedHeight (float) – The height of the block in cm
conserveMass (bool, optional) – Conserve mass of nuclides in
adjustList.adjustList (list, optional) – Nuclides that will be conserved in conserving mass in the block. It is recommended to pass a list of all nuclides in the block.
Notes
There is a coupling between block heights, the parent assembly axial mesh, and the ztop/zbottom/z params of the sibling blocks. When you set a height, all those things are invalidated. Thus, this method has to go through and update them via
parent.calculateZCoords. This could be inefficient though it has not been identified as a bottleneck. Possible improvements include deriving z/ztop/zbottom on the fly and invalidating the parent mesh with some kind of flag, signaling it to recompute itself on demand. Developers can get around some of the O(N^2) scaling of this by settingp.heightdirectly but they must know to update the dependent objects after they do that. Use with care.See also
reactors.Core.updateAxialMesh()May need to be called after this.
assemblies.Assembly.calculateZCoords()Recalculates z-coords, automatically called by this.
-
getFlowAreaPerPin()[source]¶ Return the flowing coolant area in cm^2.
NumPins looks for max number of fuel, clad, control, etc. .. seealso:
:meth:`getNumPins` figures out numPins.
-
getHydraulicDiameter()[source]¶ Return the hydraulic diameter in this block in cm.
Hydraulic diameter is 4A/P where A is the flow area and P is the wetted perimeter. In a hex assembly, the wetted perimeter includes the cladding, the wire wrap, and the inside of the duct. The flow area is the inner area of the duct minus the area of the pins and the wire.
To convert the inner hex pitch into a perimeter, first convert to side, then multiply by 6.
- p=sqrt(3)*s
l = 6*p/sqrt(3)
-
adjustUEnrich(newEnrich)[source]¶ Adjust U-235/U-238 mass ratio to a mass enrichment
- Parameters
newEnrich (float) – New U-235 enrichment in mass fraction
must be run because adjusting the enrichment actually (completeInitialLoading) –
the mass slightly and you can get negative burnups, which you do not want. (changes) –
-
adjustSmearDensity(value, bolBlock=None)[source]¶ modifies the cold smear density of a fuel pin by adding or removing fuel dimension.
Adjusts fuel dimension while keeping cladding ID constant
sd = fuel_r**2/clad_ir**2 =(fuel_od/2)**2 / (clad_id/2)**2 = fuel_od**2 / clad_id**2 new fuel_od = sqrt(sd*clad_id**2)
useful for optimization cases
- Parameters
value (float) – new smear density as a fraction. This fraction must evaluate between 0.0 and 1.0
bolBlock (Block, optional) – See completeInitialLoading. Required for ECPT cases
-
adjustCladThicknessByOD(value)[source]¶ Modifies the cladding thickness by adjusting the cladding outer diameter.
-
adjustCladThicknessByID(value)[source]¶ Modifies the cladding thickness by adjusting the cladding inner diameter.
Notes
This WILL adjust the fuel smear density
-
getLocationObject()[source]¶ Return a new location object based on current position.
Notes
This is slated for deletion, to be replaced by spatialGrid operations.
-
setBuLimitInfo(cs)[source]¶ Sets burnup limit based on igniter, feed, etc. (will implement general grouping later)
-
getMaxVolume()[source]¶ The maximum volume of this object if it were totally full.
- Returns
vol – volume in cm^3.
- Return type
float
-
getArea(cold=False)[source]¶ Return the area of a block for a full core or a 1/3 core model.
Area is consistent with the area in the model, so if you have a central assembly in a 1/3 symmetric model, this will return 1/3 of the total area of the physical assembly. This way, if you take the sum of the areas in the core (or count the atoms in the core, etc.), you will have the proper number after multiplying by the model symmetry.
- Parameters
cold (bool) – flag to indicate that cold (as input) dimensions are required
Notes
This might not work for a 1/6 core model (due to symmetry line issues).
- Returns
area
- Return type
float (cm^2)
See also
getMaxArea()return the full area of the physical assembly disregarding model symmetry
-
getAverageTempInC()[source]¶ Returns the average temperature of the block in C using the block components
This supercedes self.getAvgFuelTemp()
-
getVolume()[source]¶ Return the volume of a block.
- Returns
volume – Block or component volume in cm^3
- Return type
float
-
getSymmetryFactor()[source]¶ Return a scaling factor due to symmetry on the area of the block or its components.
Takes into account assemblies that are bisected or trisected by symmetry lines
In 1/3 symmetric cases, the central assembly is 1/3 a full area. If edge assemblies are included in a model, the symmetry factor along both edges for overhanging assemblies should be 2.0. However, ARMI runs in most scenarios with those assemblies on the 120-edge removed, so the symmetry factor should generally be just 1.0.
See also
armi.reactor.reactors.Core.addEdgeAssemblies(),terrapower.physics.neutronics.dif3d.dif3dInterface.Dif3dReader.scaleParamsRelatedToSymmetry()
-
isOnWhichSymmetryLine()[source]¶ Block symmetry lines are determined by the reactor, not the parent.
-
adjustDensity(frac, adjustList, returnMass=False)[source]¶ adjusts the total density of each nuclide in adjustList by frac.
- Parameters
frac (float) – The fraction of the current density that will remain after this operation
adjustList (list) – List of nuclide names that will be adjusted.
returnMass (bool) – If true, will return mass difference.
- Returns
mass
- Return type
float
Mass difference in grams. If you subtract mass, mass will be negative. If returnMass is False (default), this will always be zero.
-
completeInitialLoading(bolBlock=None)[source]¶ Does some BOL bookkeeping to track things like BOL HM density for burnup tracking.
runs after this block is loaded up at BOC (called from Reactor.initialLoading(Axial))
original purpose of this was to get the moles HM at BOC for the moles Pu/moles HM at BOL calculation
This also must be called after modifying something like the smear density or zr fraction in an optimization case. In ECPT cases, a BOL block must be passed or else the burnup will try to get based on a pre-burned value.
- Parameters
bolBlock (Block, optional) – A BOL-state block of this block type, required for perturbed equilibrium cases. Must have the same enrichment as this block!
- Returns
hmDens – The heavy metal number density of this block.
- Return type
float
See also
Reactor.importGeom(),depletion._updateBlockParametersAfterDepletion()
-
replaceBlockWithBlock(bReplacement)[source]¶ Replace the current block with the replacementBlock.
Typically used in the insertion of control rods.
-
static
plotFlux(core, fName, bList=None, peak=False, adjoint=False, bList2=None)[source]¶ Produce energy spectrum plot of real and/or adjoint flux in one or more blocks.
- coreCore
Core object
- fNamestr
the name of the plot file to produce. If none, plot will be shown
- bListiterable, optional
is a single block or a list of blocks to average over. If no bList, full core is assumed.
- peakbool, optional
a flag that will produce the peak as well as the average on the plot.
- adjointbool, optional
plot the adjoint as well.
- bList2 :
a separate list of blocks that will also be plotted on a separate axis on the same plot. This is useful for comparing flux in some blocks with flux in some other blocks.
-
getDominantMaterial(typeSpec)[source]¶ compute the total volume of each distinct material type in this object.
- Parameters
typeSpec (Flags or iterable of Flags) – The types of components to consider (e.g. [Flags.FUEL, Flags.CONTROL])
- Returns
mats (dict) – keys are material names, values are the total volume of this material in cm*2
samples (dict) – keys are material names, values are Material objects
See also
getComponentsOfMaterial()gets components made of a particular material
getComponent()get component of a particular type (e.g. Flags.COOLANT)
getNuclides()list all nuclides in a block or component
armi.reactor.reactors.Core.getDominantMaterial()gets dominant material in core
-
getComponentsThatAreLinkedTo(comp, dim)[source]¶ Determine which dimensions of which components are linked to a specific dimension of a particular component.
Useful for breaking fuel components up into individuals and making sure anything that was linked to the fuel mult (like the cladding mult) stays correct.
- Parameters
comp (Component) – The component that the results are linked to
dim (str) – The name of the dimension that the results are linked to
- Returns
linkedComps – A list of (components,dimName) that are linked to this component, dim.
- Return type
list
-
getComponentsInLinkedOrder(componentList=None)[source]¶ Return a list of the components in order of their linked-dimension dependencies.
- Parameters
components (list, optional) – A list of components to consider. If None, this block’s components will be used.
Notes
This means that components other components are linked to come first.
-
hasComponents(typeSpec)[source]¶ Return true if all of the named components exist on this block.
- Parameters
typeSpec (Flags or iterable of Flags) – Component types to check for. If None, will check for any components
-
getComponentByName(name)[source]¶ Gets a particular component from this block, based on its name
- Parameters
name (str) – The blueprint name of the component to return
-
getComponent(typeSpec, exact=False, returnNull=False, quiet=False)[source]¶ Gets a particular component from this block.
- Parameters
typeSpec (flags.Flags or list of Flags) – The type specification of the component to return
exact (boolean, optional) – Demand that the component flags be exactly equal to the typespec. Default: False
quiet (boolean, optional) – Warn if the component is not found. Default: False
with multiple similar names in one block (Careful) –
- Returns
Component
- Return type
The component that matches the critera or None
-
getComponentsOfShape(shapeClass)[source]¶ Return list of components in this block of a particular shape.
- Parameters
shapeClass (Component) – The class of component, e.g. Circle, Helix, Hexagon, etc.
- Returns
param – List of components in this block that are of the given shape.
- Return type
list
-
getComponentsOfMaterial(material=None, materialName=None)[source]¶ Return list of components in this block that are made of a particular material
Only one of the selectors may be used
- Parameters
material (Material object, optional) – The material to match
materialName (str, optional) – The material name to match.
- Returns
componentsWithThisMat
- Return type
list
-
getSortedComponentsInsideOfComponent(component)[source]¶ Returns a list of components inside of the given component sorted from innermost to outermost.
- Parameters
component (object) – Component to look inside of.
Notes
If you just want sorted components in this block, use
sorted(self). This will never include anyDerivedShapeobjects. Since they have a derived area they don’t have a well-defined dimension. For now we just ignore them. If they are desired in the future some knowledge of their dimension will be required while they are being derived.
-
getNumComponents(typeSpec)[source]¶ Get the number of components that have these flags, taking into account multiplicity. Useful for getting nPins even when there are pin detailed cases.
- Parameters
typeSpec (Flags) – Expected flags of the component to get. e.g. Flags.FUEL
- Returns
total – the number of components of this type in this block, including multiplicity.
- Return type
int
-
mergeWithBlock(otherBlock, fraction)[source]¶ Turns this block into a mixture of this block and some other block
- Parameters
otherBlock (Block) – The block to mix this block with. The other block will not be modified.
fraction (float) – Fraction of the other block to mix in with this block. If 0.1 is passed in, this block will become 90% what it originally was and 10% what the other block is.
Notes
This merges on a high level (using number densities). Components will not be merged.
This is used e.g. for inserting a control block partially to get a very tight criticality control. In this case, a control block would be merged with a duct block. It is also used when a control rod is specified as a certain length but that length does not fit exactly into a full block.
-
getComponentAreaFrac(typeSpec, exact=True)[source]¶ Returns the area fraction of the specified component(s) among all components in the block.
- Parameters
typeSpec (Flags or list of Flags) – Component types to look up
exact (bool, optional) – Match exact names only
Examples
>>> b.getComponentAreaFrac(Flags.CLAD) 0.15
- Returns
The area fraction of the component.
- Return type
float
-
getDim(typeSpec, dimName)[source]¶ Search through blocks in this assembly and find the first component of compName. Then, look on that component for dimName.
- Parameters
typeSpec (Flags or list of Flags) – Component name, e.g. Flags.FUEL, Flags.CLAD, Flags.COOLANT, …
dimName (str) – Dimension name, e.g. ‘od’, …
- Returns
dimVal – The dimension in cm.
- Return type
float
Examples
>>> getDim(Flags.WIRE,'od') 0.01
-
getPinPitch(cold=False)[source]¶ Get the pin pitch in cm.
- Parameters
cold (boolean) – Determines whether the dimensions should be cold or hot
- Returns
pinPitch – pin pitch in cm
- Return type
float
-
getPinCenterFlatToFlat(cold=False)[source]¶ Return the flat-to-flat distance between the centers of opposing pins in the outermost ring.
-
getPitch(returnComp=False)[source]¶ Return the center-to-center hex pitch of this block.
- Parameters
returnComp (bool, optional) – If true, will return the component that has the maximum pitch as well
- Returns
pitch (float or None) – Hex pitch in cm, if well-defined. If there is no clear component for determining pitch, returns None
component (Component or None) – Component that has the max pitch, if returnComp == True. If no component is found to define the pitch, returns None
Notes
The block stores a reference to the component that defines the pitch, making the assumption that while the dimensions can change, the component containing the largest dimension will not. This lets us skip the search for largest component. We still need to ask the largest component for its current dimension in case its temperature changed, or was otherwise modified.
See also
setPitch()sets pitch
-
getLargestComponent(dimension)[source]¶ Find the component with the largest dimension of the specified type.
- Parameters
dimension (str) – The name of the dimension to find the largest component of.
- Returns
largestComponent – The component with the largest dimension of the specified type.
- Return type
armi.reactor.components.Component
-
setPitch(val, updateBolParams=False, updateNumberDensityParams=True)[source]¶ Sets outer pitch to some new value.
This sets the settingPitch and actually sets the dimension of the outer hexagon.
During a load (importGeom), the setDimension doesn’t usually do anything except set the setting See Issue 034
But during a actual case modification (e.g. in an optimization sweep, then the dimension has to be set as well.
See also
getPitch()gets the pitch
-
getMfp(gamma=False)[source]¶ calculates the mean free path for neutron or gammas in this block.
Sum_E(flux_e*macro_e*dE) Sum_E(flux_e*d*sum_type(micro_e) * dE)
- <Macro> = ————————— = ————————————-
Sum_E (flux_e*dE) Sum_E (flux_e*dE)
Block macro is the sum of macros of all nuclides.
phi_g = flux*dE already in multigroup method.
- Returns
mfp, mfpAbs, diffusionLength
- Return type
tuple(float, float float)
-
setComponentDimensionsReport()[source]¶ Makes a summary of the dimensions of the components in this block.
-
printDensities(expandFissionProducts=False)[source]¶ Get lines that have the number densities of a block.
-
buildNumberDensityParams(nucNames=None)[source]¶ Copy homogenized density onto self.p for storing in the DB.
-
calcReactionRates()[source]¶ Computes 1-group reaction rates for this block.
Notes
Values include: Fission nufission n2n capture maybe scatter (will take a long time)
Rxn rates are Sigma*Flux = Sum_Nuclides(Sum_E(Sigma*Flux*dE)) S*phi n*s*phiV/V [#/bn-cm] * [bn] * [#/cm^2/s] = [#/cm^3/s]
(Integral_E in g(phi(E)*sigma(e) dE)
- sigma_g = ———————————
Int_E in g (phi(E) dE)
-
expandElementalToIsotopics(elementalNuclide)[source]¶ Expands the density of a specific elemental nuclides to its natural isotopics.
- Parameters
elementalNuclide (
armi.nucDirectory.nuclideBases.NaturalNuclide) – natural nuclide to replace.
-
enforceBondRemovalFraction(bondRemovedFrac)[source]¶ Update the distribution of coolant in this block to agree with a fraction
This pulls coolant material out of the bond component and adds it to the other coolant-containing components while conserving mass.
Useful after db load with sodium bond. See armi.bookkeeping.db.database.updateFromDB
\(N_{hom} = \sum_{i} a_i N_i\)
We want \(f = \frac{a_{bond} N_{bond}}{N_{hom}}\) So we can solve this for \(N_{bond}\) and reduce the other number densities accordingly.
Should work for coolants with more than 1 nuclide (e.g. H2O, Pb-Bi, NaK,…)
- Parameters
bondRemovedFrac (float) – Fraction of the bond that has been removed.
See also
armi.reactor.assemblies.Assembly.applyBondRemovalFractions()does this in the original case
-
getBurnupPeakingFactor()[source]¶ Get the radial peaking factor to be applied to burnup and DPA
This may be informed by previous runs which used detailed pin reconstruction and rotation. In that case, it should be set on the cs setting
burnupPeakingFactor.Otherwise, it just takes the current flux peaking, which is typically conservatively high.
- Returns
burnupPeakingFactor – The peak/avg factor for burnup and DPA.
- Return type
float
See also
armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxInterface.updateFluenceAndDPA()uses this
terrapower.physics.neutronics.depletion.depletion.DepletionInterface._updateBlockParametersAfterDepletion()also uses this
-
getBlocks()[source]¶ This method returns all the block(s) included in this block its implemented so that methods could iterate over reactors, assemblies or single blocks without checking to see what the type of the reactor-family object is.
-
updateComponentDims()[source]¶ This method updates all the dimensions of the components
Notes
This is VERY useful for defining a ThRZ core out of differentialRadialSegements whose dimensions are connected together some of these dimensions are derivative and can be updated by changing dimensions in a Parameter Component or other linked components
See also
armi.reactor.components.DifferentialRadialSegment.updateDims(),armi.reactor.components.Parameters(),armi.physics.optimize.OptimizationInterface.modifyCase()
-
breakFuelComponentsIntoIndividuals()[source]¶ Split block-level components (in fuel blocks) into pin-level components.
The fuel component will be broken up according to its multiplicity.
Order matters! The first pin component will be located at a particular (x, y), which will be used in the fluxRecon module to determine the interpolated flux.
The fuel will become fuel001 through fuel169 if there are 169 pins.
-
getIntegratedMgFlux(adjoint=False, gamma=False)[source]¶ Return the volume integrated 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.
- Parameters
adjoint (bool, optional) – Return adjoint flux instead of real
gamma (bool, optional) – Whether to return the neutron flux or the gamma flux.
- Returns
integratedFlux – multigroup neutron tracklength in [n-cm/s]
- Return type
numpy.array
-
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
rxnRates – dictionary of reaction rates (rxn/s) for nG, nF, n2n, nA and nP
- Return type
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.BlockParameterCollection
-
class
armi.reactor.blocks.HexBlock(name, height=1.0, location=None)[source]¶ Bases:
armi.reactor.blocks.BlockBuilds a new ARMI block
- caseSettingsSettings object, optional
The settings object to use to build the block
- namestr, optional
The name of this block
- heightfloat, optional
The height of the block in cm. Defaults to 1.0 so that getVolume assumes unit height.
-
LOCATION_CLASS¶ alias of
armi.reactor.locations.HexLocation
-
PITCH_COMPONENT_TYPE= (<class 'armi.reactor.components.shapes.UnshapedComponent'>, <class 'armi.reactor.components.basicShapes.Hexagon'>)¶
-
setPinPowers(powers, numPins, imax, jmax, gamma=False, removeSixCornerPins=False, powerKeySuffix='')[source]¶ Updates the pin powers of this block for the current rotation.
- Parameters
powers (list of floats) – The block-level pin linear power densities. pinPowers[i] represents the average linear power density of pin i. Power units are Watts/cm (Watts produced per cm of pin length). The “ARMI pin ordering” is used, which is counter-clockwise from 3 o’clock.
Notes
This handles rotations using the pinLocation parameters.
- self.p.pinPowerslist of floats
The block-level pin linear power densities. pinPowers[i] represents the average linear power density of pin i. Power units are Watts/cm (Watts produced per cm of pin length). The “ARMI pin ordering” is used, which is counter-clockwise from 3 o’clock.
-
rotatePins(rotNum, justCompute=False)[source]¶ Rotate an assembly, which means rotating the indexing of pins.
Notes
Changing (x,y) positions of pins does NOT constitute rotation, because the indexing of pin atom densities must be re-ordered. Re-order indexing of pin-level quantities, NOT (x,y) locations of pins. Otherwise, subchannel input will be in wrong order.
How rotations works is like this. There are pins with unique pin numbers in each block. These pin numbers will not change no matter what happens to a block, so if you have pin 1, you always have pin 1. However, these pins are all in pinLocations, and these are what change with rotations. At BOL, a pin’s pinLocation is equal to its pin number, but after a rotation, this will no longer be so.
So, all params that don’t care about exactly where in space the pin is (such as depletion) can just use the pin number, but anything that needs to know the spatial location (such as fluxRecon, which interpolates the flux spatially, or subchannel codes, which needs to know where the power is) need to map through the pinLocation parameters.
This method rotates the pins by changing the pinLocations.
- Parameters
rotNum (int) – An integer from 0 to 5, indicating the number of counterclockwise 60-degree rotations from the CURRENT orientation. Degrees of counter-clockwise rotation = 60*rot
justCompute (Boolean, optional) – If True, rotateIndexLookup will be returned but NOT assigned to the object variable self.rotateIndexLookup. If False, rotateIndexLookup will be returned AND assigned to the object variable self.rotateIndexLookup. Useful for figuring out which rotation is best to minimize burnup, etc.
- Returns
rotateIndexLookup – This is an index lookup (or mapping) between pin ids and pin locations The pin indexing is 1-D (not ring,pos or GEODST). The “ARMI pin ordering” is used for location, which is counter-clockwise from 3 o’clock. Pin numbers start at 1, pin locations also start at 1.
- Return type
dict of ints
Examples
rotateIndexLookup[i_after_rotation-1] = i_before_rotation-1
-
getPinToDuctGap(cold=False)[source]¶ Returns the distance in cm between the outer most pin and the duct in a block.
- Parameters
cold (boolean) – Determines whether the results should be cold or hot dimensions.
- Returns
pinToDuctGap – Returns the diameteral gap between the outer most pins in a hex pack to the duct inner face to face in cm.
- Return type
float
-
getRotationNum()[source]¶ Get index 0 through 5 indicating number of rotations counterclockwise around the z-axis.
-
setRotationNum(rotNum)[source]¶ Set orientation based on a number 0 through 5 indicating number of rotations counterclockwise around the z-axis.
-
getSymmetryFactor()[source]¶ Return a factor between 1 and N where 1/N is how much cut-off by symmetry lines this mesh cell is.
Reactor-level meshes have symmetry information so we have a reactor for this to work. That’s why it’s not implemented on the grid/locator level.
When edge-assemblies are included on both edges (i.e. MCNP or DIF3D-FD 1/3-symmetric cases), the edge assemblies have symmetry factors of 2.0. Otherwise (DIF3D-nodal) there’s a full assembly on the bottom edge (overhanging) and no assembly at the top edge so the ones at the bottom are considered full (symmetryFactor=1).
If this block is not in any grid at all, then there can be no symmetry so return 1.
-
getPinCoordinates()[source]¶ Compute the centroid coordinates of any pins in this block.
- Returns
localCoordinates – list of (x,y,z) pairs representing each pin in the order they are listed as children
- Return type
list
Notes
This assumes hexagonal pin lattice and needs to be upgraded once more generic geometry options are needed.
A block with fully-defined pins could just use their individual spatialLocators in a block-level 2-D grid. However most cases do not have this to minimize overhead and maximize speed. Thus we want to just come up with a uniform mesh of pins if they’re not explicitly placed in the grid.
-
getPinCenterFlatToFlat(cold=False)[source]¶ Return the flat-to-flat distance between the centers of opposing pins in the outermost ring.
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.BlockParameterCollection
-
class
armi.reactor.blocks.CartesianBlock(name, height=1.0, location=None)[source]¶ Bases:
armi.reactor.blocks.BlockBuilds a new ARMI block
- caseSettingsSettings object, optional
The settings object to use to build the block
- namestr, optional
The name of this block
- heightfloat, optional
The height of the block in cm. Defaults to 1.0 so that getVolume assumes unit height.
-
LOCATION_CLASS¶
-
PITCH_DIMENSION= 'widthOuter'¶
-
PITCH_COMPONENT_TYPE= (<class 'armi.reactor.components.shapes.UnshapedComponent'>, <class 'armi.reactor.components.basicShapes.Rectangle'>)¶
-
setPitch(val, updateBolParams=False, updateNumberDensityParams=True)[source]¶ Sets outer pitch to some new value.
This sets the settingPitch and actually sets the dimension of the outer hexagon.
During a load (importGeom), the setDimension doesn’t usually do anything except set the setting See Issue 034
But during a actual case modification (e.g. in an optimization sweep, then the dimension has to be set as well.
See also
getPitch()gets the pitch
-
getSymmetryFactor()[source]¶ Return a factor between 1 and N where 1/N is how much cut-off by symmetry lines this mesh cell is.
-
getPinCenterFlatToFlat(cold=False)[source]¶ Return the flat-to-flat distance between the centers of opposing pins in the outermost ring.
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.BlockParameterCollection
-
class
armi.reactor.blocks.ThRZBlock(name, height=1.0, location=None)[source]¶ Bases:
armi.reactor.blocks.BlockBuilds a new ARMI block
- caseSettingsSettings object, optional
The settings object to use to build the block
- namestr, optional
The name of this block
- heightfloat, optional
The height of the block in cm. Defaults to 1.0 so that getVolume assumes unit height.
-
LOCATION_CLASS¶
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.BlockParameterCollection
-
class
armi.reactor.blocks.Point(name=None)[source]¶ Bases:
armi.reactor.blocks.BlockPoints quack like blocks. This Point object represents a single point in space within a Block. The Point object masquerades as a Block so that any Block parameter (such as DPA) can be assigned to it with the same functionality.
Builds a new ARMI block
- caseSettingsSettings object, optional
The settings object to use to build the block
- namestr, optional
The name of this block
- heightfloat, optional
The height of the block in cm. Defaults to 1.0 so that getVolume assumes unit height.
-
LOCATION_CLASS¶ alias of
armi.reactor.locations.HexLocation
-
getVolume()[source]¶ Return the volume of a block.
- Returns
volume – Block or component volume in cm^3
- Return type
float
-
getBurnupPeakingFactor()[source]¶ Get the radial peaking factor to be applied to burnup and DPA
This may be informed by previous runs which used detailed pin reconstruction and rotation. In that case, it should be set on the cs setting
burnupPeakingFactor.Otherwise, it just takes the current flux peaking, which is typically conservatively high.
- Returns
burnupPeakingFactor – The peak/avg factor for burnup and DPA.
- Return type
float
See also
armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxInterface.updateFluenceAndDPA()uses this
terrapower.physics.neutronics.depletion.depletion.DepletionInterface._updateBlockParametersAfterDepletion()also uses this
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.BlockParameterCollection