Expand description
Materials: compositions, mixing, and serialization for nuclear engineering.
A Material is a map from NuclideId to a stored mass in grams,
plus an optional mass density (g/cm3 by convention) and free-form JSON
metadata. Density lives outside the composition: it is a property of
the stream rather than part of the composition itself.
Atomic-mass-dependent conversions (Material::from_atom_frac and
Material::atom_fractions) take a MassProvider so the material
crate stays independent of the nuclear-data tables; wire up
nucleide_nuclei::data once it lands.
use nucleide_material::{MassProvider, Material, NoMasses};
use nucleide_nuclei::NuclideId;
let mut mat = Material::new();
mat.add_nuclide(NuclideId::from_name("U235").unwrap(), 19.0);
mat.add_nuclide(NuclideId::from_name("U238").unwrap(), 1.0);
assert_eq!(mat.mass(), 20.0);
// Atom conversions need atomic masses:
let atoms = mat.atom_fractions(&NoMasses);
assert!(atoms.is_err());Structs§
- Ame2020
MassProviderbacked by the AME2020 tables innucleide_nuclei::data.- Analytics
- Provider bundle for radioanalytic quantities.
- Audit
Issue - One conservation problem found by
audit. - Chain
Decays DecayProviderbacked by the ENDF/B-VIII.0 half-life table innucleide_nuclei::data.- Collision
- One truncated label form claimed by more than one nuclide.
- Compendium
Element - One elemental constituent.
- Compendium
Entry - One compendium material entry.
- Compendium
Isotope - One isotope row of an element inside a compendium material.
- Decay
Energies DecayEnergyProviderbacked by the ENDF/B-VII.1 prompt-decay-energy table innucleide_nuclei::data(mean-field evaluation values, generated byscripts/gen-nuclear-data.py— see the table docs before quoting heat numbers).- Material
- A nuclear material: nuclide masses plus optional density and metadata.
- Materials
Doc - A
<materials>document bundling namedMaterials, optionally pointing at a cross-sections file via the rootcross_sectionsattribute — the container shape of a materials collection document. - Materials
Library - The full parsed compendium with fast lookups.
- Natural
Abundances AbundanceProviderbacked by the natural-abundance table innucleide_nuclei::data.- NoAbundances
- An
AbundanceProviderthat knows no isotopes. - NoDecay
- A
DecayProviderthat knows no decays. - NoDecay
Energies - A
DecayEnergyProviderthat knows no decay energies. - NoMasses
- A
MassProviderthat knows no masses.
Enums§
- Analytics
Error - Errors from radioanalytics beyond the shared [
crate::Error] set. - Audit
Kind - The class of a conservation problem found by
audit. - Compendium
Error - Errors from compendium loading.
- Error
- Errors produced by material construction, conversion, and export.
- Formula
Error - Errors from formula parsing and element expansion.
Constants§
- AVOGADRO
- Avogadro constant, atoms per mole (exact, 2019 SI).
- DEFAULT_
WIDTHS - Default truncation widths probed by
check_labels: 6 (DIF3D label limit) and 8 (MC2-3 label limit). - GRAMS_
PER_ U - One unified atomic mass unit in grams (2022 CODATA).
- MEV_
TO_ JOULES - One MeV in joules (exact, 2019 SI: 1 eV = 1.602176634e-19 J).
Traits§
- Abundance
Provider - Source of natural-isotope composition data, element by element.
- Decay
Energy Provider - Source of per-nuclide mean recoverable decay energies in MeV per decay.
- Decay
Provider - Source of per-nuclide decay constants λ in inverse seconds.
- Mass
Provider - Source of per-nuclide atomic masses in g/mol.
Functions§
- audit
- Validate mass-fraction normalization, mass signs, key uniqueness, and atomic-mass availability.
- check_
labels - Truncate every member’s cross-code labels to each of
widthsand report every truncated form claimed by more than one nuclide. - parse_
formula - Parse a chemical formula into per-element atom counts.
Type Aliases§
- Formula
Result - Result alias for formula parsing and expansion.
- Result
- Result alias for the material crate.