Low-efficient weight windows produced by openmc.WeightWindowGenerator

Hello, OpenMC community members. I am trying to use openmc simulate a 1D deep penetration problem with weight windows generated by openmc itself. Referring to the fusion project, I used the following codes to generate weight windows:

% create mesh for weight window
mesh = openmc.RegularMesh()
mesh.lower_left = (0.0, -1.0, -1.0)
mesh.upper_right = (220.0, 1.0, 1.0)
mesh.dimension = (88, 1, 1)

% create flux tally at mesh
mesh_filter = openmc.MeshFilter(mesh)
particle_filter = openmc.ParticleFilter(‘neutron’)
flux_ty = openmc.Tally(name=“flux tally”)
flux_ty.filters = [mesh_filter, particle_filter]
flux_ty.scores = [“flux”]
tallies.append(flux_ty, merge=True)

% add mesh flux tally to the model
model = openmc.Model(geometry, materials, settings, tallies)

% generate and reuse weight window
wwg = openmc.WeightWindowGenerator(mesh, energy_bins, particle_type=“neutron”)
model.settings.batches = 1000
model.settings.particles = 500000
model.settings.weight_window_generators = wwg

Note that I did not know how to apply weight window generator to 1D geometry, so I modified the 1D geometry to 3D by adding Y/Z reflective boundaries.

Then, I ploted the lower bounds of generated weight windows, i.e. (larger energy group indexes mean higher energy here)

In this problem, a fixed source was defined at the region from x=0 to x=170, so less particle events can be tallied at the region of x>210. Besides, the fixed source has a very small probabilities for high-energy groups, which caused large uncertainties for tallied fluxes of high-energy group.

After a simulation of 5E+08 particle histories with the weight window generator, the generated weight windows showed a large amount of meaningless lower bound values (-1). To my knowledge, the generated weight windows are updated on the fly and used during openmc’s simulation. It took more time but did not give good weight windows to lower down uncertatities. It should be my misunderstanding about how to use openmc.WeightWindowGenerator.

Besides, is it suggested to generate weight windows firstly by openmc.WeightWindowGenerator and then use the generated weight windows by openmc.WeightWindows for simulation? or just use the first one and update it on the fly during simulation?

I used ADVANTG code generate the weight windows for this problem. It tooks only several seconds and gave reasonable weight windows, i.e.

This small problem is easy to be solved by deterministic SN codes, so ADVANTG produced the good weight windows efficiently. But it seems diffucult for monte carlo codes to tally mesh and energy wised fluxes for weight window generation. I think the bad weight windows generated by OpenMC might be my mistakes.

When I applied the weigh windows by openmc.wwinp_to_wws, the openmc simulation time was increased greatly but the statistical uncertainties of tallied group-wise flux are still large with 1.5E+07 particle histories.

I am glad to get me some suggestions. Thanks!

Hi @jeff, this might not be too helpful but you might be getting bad weight windows because the mesh tally you’re getting from the analogue run is not quite helpful. One way could be to have an iterative ww generation (check out this wonderful notebook by @shimwell neutronics-workshop/tasks/task_14_variance_reduction/4_sphere_iterative_per_batch_ww.ipynb at main · fusion-energy/neutronics-workshop · GitHub). Note that there’s also other hyperparameters that could have an impact (openmc.lib.WeightWindows — OpenMC Documentation). Let me know how that goes!