armi.utils.densityTools module¶
-
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[armi.nucDirectory.elements.Element, List[armi.nucDirectory.nuclideBases.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: armi.nucDirectory.elements.Element, massFrac: dict, isotopicSubset: List[armi.nucDirectory.nuclideBases.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.
- Parameters
element (Element) – The element to expand to natural isotopics
massFrac (float) – Mass fraction of the initial element
isotopicSubset (list of NuclideBases) – Natural isotopes to include in the expansion. Useful e.g. for excluding O18 from an expansion of Oxygen.
-
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.