@@ -14,10 +14,15 @@ def sphere_model():
1414
1515 model .settings .particles = 100
1616 model .settings .batches = 1
17- model . settings . source = openmc .IndependentSource (
17+ src1 = openmc .IndependentSource (
1818 energy = openmc .stats .delta_function (1.0e3 ),
19- strength = 100 .0
19+ strength = 75 .0
2020 )
21+ src2 = openmc .IndependentSource (
22+ energy = openmc .stats .delta_function (1.0e3 ),
23+ strength = 25.0
24+ )
25+ model .settings .source = [src1 , src2 ]
2126 model .settings .run_mode = "fixed source"
2227 model .settings .surf_source_write = {
2328 "max_particles" : 100 ,
@@ -42,11 +47,13 @@ def test_source_weight(run_in_tmpdir, sphere_model):
4247 sphere_model .settings .uniform_source_sampling = True
4348 sphere_model .run ()
4449 particles = openmc .ParticleList .from_hdf5 ('surface_source.h5' )
45- strength = sphere_model .settings .source [0 ].strength
46- assert set (p .wgt for p in particles ) == {strength }
50+ assert set (p .wgt for p in particles ) == {0.5 , 1.5 }
4751
4852
4953def test_tally_mean (run_in_tmpdir , sphere_model ):
54+ # Use only one source
55+ sphere_model .settings .source .pop ()
56+
5057 # Run without uniform source sampling
5158 sphere_model .settings .uniform_source_sampling = False
5259 sp_file = sphere_model .run ()
0 commit comments