armi.utils.densityTools module
Assorted utilities to help with basic density calculations.
- armi.utils.densityTools.getNDensFromMasses(rho, massFracs, normalize=False)[source]
Convert density (g/cc) and massFracs vector into a number densities vector (#/bn-cm).
- armi.utils.densityTools.getMassFractions(numberDensities)[source]
Convert number densities (#/bn-cm) into mass fractions.
- armi.utils.densityTools.calculateNumberDensity(nucName, mass, volume)[source]
Calculates the number density.
- Parameters:
mass (float) –
volume (volume) –
nucName (armi nuclide name -- e.g. 'U235') –
- Returns:
number density – number density (#/bn-cm)
- Return type:
See also
armi.reactor.blocks.Block.setMass
- armi.utils.densityTools.getMassInGrams(nucName, volume, numberDensity=None)[source]
Gets mass of a nuclide of a known volume and know number density.
- armi.utils.densityTools.formatMaterialCard(densities, matNum=0, minDens=1e-15, sigFigs=8, mcnp6Compatible=False, mcnpLibrary=None)[source]
Formats nuclides and densities into a MCNP material card.
- armi.utils.densityTools.filterNuclideList(nuclideVector, nuclides)[source]
Filter out nuclides not in the nuclide vector.
- armi.utils.densityTools.normalizeNuclideList(nuclideVector, normalization=1.0)[source]
Normalize the nuclide vector.
- armi.utils.densityTools.expandElementalMassFracsToNuclides(massFracs: dict, elementExpansionPairs: Tuple[Element, List[NuclideBase]])[source]
Expand elemental mass fractions to natural nuclides.
Modifies the input
massFracs
in place to contain nuclides.Notes
This indirectly updates number densities through mass fractions.
- Parameters:
massFracs (dict(str, float)) – dictionary of nuclide or element names with mass fractions. Elements will be expanded in place using natural isotopics.
elementExpansionPairs ((Element, [NuclideBase]) pairs) – element objects to expand (from nuclidBase.element) and list of NuclideBases to expand into (or None for all natural)
- armi.utils.densityTools.expandElementalNuclideMassFracs(element: Element, massFrac: float, isotopicSubset: Optional[List[NuclideBase]] = None)[source]
Return a dictionary of nuclide names to isotopic mass fractions.
If an isotopic subset is passed in, the mass fractions get scaled up s.t. the total mass fraction remains constant.
- armi.utils.densityTools.getChemicals(nuclideInventory)[source]
Groups the inventories of nuclides by their elements.
- armi.utils.densityTools.applyIsotopicsMix(material, enrichedMassFracs: Dict[str, float], fertileMassFracs: Dict[str, float])[source]
Update material heavy metal mass fractions based on its enrichment and two nuclide feeds.
This will remix the heavy metal in a Material object based on the object’s
class1_wt_frac
parameter and the input nuclide information.This can be used for inputting mixtures of two external custom isotopic feeds as well as for fabricating assemblies from two closed-cycle collections of material.
See also