mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Updates to object lifecycle for WeightWindows and WeightWindowGenerators (#2582)
This commit is contained in:
parent
36f229eb01
commit
382bcb2e8e
6 changed files with 275 additions and 211 deletions
|
|
@ -28,13 +28,20 @@ def test_ww_generator(run_in_tmpdir):
|
|||
energy_bounds = np.linspace(0.0, 1e6, 70)
|
||||
particle = 'neutron'
|
||||
|
||||
# include another tally to make sure user-specified tallies and those automaticaly
|
||||
# created by weight window generators can coexist
|
||||
tally = openmc.Tally()
|
||||
ef = openmc.EnergyFilter(energy_bounds)
|
||||
tally.filters = [ef]
|
||||
tally.scores = ['flux']
|
||||
model.tallies = [tally]
|
||||
|
||||
wwg = openmc.WeightWindowGenerator(mesh, energy_bounds, particle)
|
||||
wwg.update_parameters = {'ratio' : 5.0, 'threshold': 0.8, 'value' : 'mean'}
|
||||
wwg.update_parameters = {'ratio': 5.0, 'threshold': 0.8, 'value': 'mean'}
|
||||
|
||||
model.settings.weight_window_generators = wwg
|
||||
model.export_to_xml()
|
||||
|
||||
model.run()
|
||||
|
||||
# we test the effectiveness of the update method elsewhere, so
|
||||
# just test that the generation happens successfully here
|
||||
assert os.path.exists('weight_windows.h5')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue