def test_open_self_shielding2(): C = 60000000 W_180 = 741800000 sample_xs_openmc.seek(0) ods = data_source.OpenMCDataSource(cross_sections=sample_xs_openmc, src_group_struct=np.logspace(1, -9, 11)) non_ss = ods.reaction(W_180, "gamma", 300) atom_dens = {C: 1.0e22, W_180: 1.0e2} ods.atom_dens = atom_dens observed = ods.reaction(W_180, "gamma", 300) assert_array_almost_equal(observed, non_ss)
def test_openmc_bkg_none(): C_12 = 60120000 W_180 = 741800000 sample_xs_openmc.seek(0) ods = data_source.OpenMCDataSource(cross_sections=sample_xs_openmc, src_group_struct=np.logspace(1, -9, 11)) expected = ods.reaction(C_12, "total", 300) atom_dens = {C_12: 1.0e22, W_180: 1.0e22} ods.atom_dens = atom_dens observed = ods.bkg_xs(W_180, 300) assert_array_almost_equal(0.0, observed)
def test_openmc_self_shielding1(): C = 60000000 W_180 = 741800000 sample_xs_openmc.seek(0) ods = data_source.OpenMCDataSource(cross_sections=sample_xs_openmc, src_group_struct=np.logspace(1, -9, 11)) non_ss = ods.reaction(W_180, 'gamma', 300) atom_dens = {C: 1.E22, W_180: 1.E22} ods.atom_dens = atom_dens observed = ods.reaction(W_180, 'gamma', 300) assert_true(np.all(observed <= non_ss))
def test_openmc_bkg(): C = 60000000 W_180 = 741800000 sample_xs_openmc.seek(0) ods = data_source.OpenMCDataSource(cross_sections=sample_xs_openmc, src_group_struct=np.logspace(1, -9, 11)) expected = ods.reaction(C, "total", 300) atom_dens = {C: 1.0e22, W_180: 1.0e22} ods.atom_dens = atom_dens observed = ods.bkg_xs(W_180, 300) if expected is not None and observed is not None: assert_array_almost_equal(expected, observed)
def test_openmc(): ods = data_source.OpenMCDataSource(cross_sections=sample_xs_openmc, src_group_struct=np.logspace(1, -9, 11)) obs = ods.reaction('W180', 2) assert_equal(10, len(obs)) obs = ods.reaction('W180', 'total') assert_equal(10, len(obs)) obs = ods.reaction('U-235', 42) assert_is(None, obs) # threshold reactoin obs = ods.reaction('W180', 'z_3n') assert_equal(10, len(obs)) assert_true(np.all(obs >= 0.0))
def test_openmc(): sample_xs_openmc.seek(0) ods = data_source.OpenMCDataSource(cross_sections=sample_xs_openmc, src_group_struct=np.logspace(1, -9, 11)) obs = ods.reaction("W180", 2) assert_equal(10, len(obs)) obs = ods.reaction("W180", "total") assert_equal(10, len(obs)) obs = ods.reaction("U-235", 42) assert_is(None, obs) # threshold reactoin obs = ods.reaction("W180", "z_3n") assert_equal(10, len(obs)) assert_true(np.all(obs >= 0.0))