def _applyIsotopicsMixFromCustomIsotopicsInput(self, customIsotopics): """ Apply a Class 1/Class 2 mixture of custom isotopics at input. Only adjust heavy metal. This may also be needed for building charge assemblies during reprocessing, but will take input from the SFP rather than from the input external feeds. """ class1Isotopics = customIsotopics[self.p.class1_custom_isotopics] class2Isotopics = customIsotopics[self.p.class2_custom_isotopics] densityTools.applyIsotopicsMix(self, class1Isotopics, class2Isotopics)
def test_applyIsotopicsMix(self): """Ensure isotopc classes get mixed properly.""" uo2 = UO2() massFracO = uo2.p.massFrac["O"] uo2.p.class1_wt_frac = 0.2 enrichedMassFracs = {"U235": 0.3, "U234": 0.1, "PU239": 0.6} fertileMassFracs = {"U238": 0.3, "PU240": 0.7} densityTools.applyIsotopicsMix(uo2, enrichedMassFracs, fertileMassFracs) self.assertAlmostEqual(uo2.p.massFrac["U234"], (1 - massFracO) * 0.2 * 0.1) # HM blended self.assertAlmostEqual(uo2.p.massFrac["U238"], (1 - massFracO) * 0.8 * 0.3) # HM blended self.assertAlmostEqual(uo2.p.massFrac["O"], massFracO) # non-HM stays unchanged