def test_sets(self): xs = CrossSection() xs.set_d(0, 1.0) xs.set_siga(0, 2.0) xs.set_nusigf(0, 3.0) xs.set_xi(0, 1.0) xs.set_d(1, 11.0) xs.set_siga(1, 12.0) xs.set_nusigf(1, 13.0) xs.set_xi(1, 0.0) xs.set_smat([[1.0, 2.0], [3.0, 4.0]]) # sm(kg, kkg) # # kkg # 0 1 # kg 0 1.0 2.0 # 1 3.0 4.0 self.assertEqual(xs.dif(0), 1.0) self.assertEqual(xs.siga(0), 2.0) self.assertEqual(xs.nusigf(0), 3.0) self.assertEqual(xs.xi(0), 1.0) self.assertEqual(xs.dif(1), 11.0) self.assertEqual(xs.siga(1), 12.0) self.assertEqual(xs.nusigf(1), 13.0) self.assertEqual(xs.xi(1), 0.0) self.assertEqual(xs.sigs(0, 0), 1.0) self.assertEqual(xs.sigs(0, 1), 2.0) self.assertEqual(xs.sigs(1, 0), 3.0) self.assertEqual(xs.sigs(1, 1), 4.0)
def test_sets(self): xs = CrossSection() xs.set_d(1.0) xs.set_siga(2.0) xs.set_nusigf(3.0) self.assertEqual(xs.dif(), 1.0) self.assertEqual(xs.siga(), 2.0) self.assertEqual(xs.nusigf(), 3.0)
self.flux = f_nume / f_deno #net current by Eq(29) jnet_XM = -coef1 * (4.0 * self.jin[XM] - self.flux) / coef3 jnet_XP = -coef1 * (4.0 * self.jin[XP] - self.flux) / coef3 #out-goinnt by Eq(30) self.jout[XM] = jnet_XM + self.jin[XM] self.jout[XP] = jnet_XP + self.jin[XP] def debug(self): print("-" * 3 + " Node " + "-" * 40) print(" jin_XM \t", self.jin[XM]) print(" jin_XP \t", self.jin[XP]) print(" jout_XM\t", self.jout[XM]) print(" jout_XP\t", self.jout[XP]) print(" flux \t", self.flux) print(" keff \t", self.keff) self.xs.debug() print("-" * 50) if __name__ == '__main__': node = Node() xs = CrossSection() xs.set_d(1.0) xs.set_siga(2.0) xs.set_nusigf(3.0) node.set_xs(xs) node.debug()