Using MCNP ADVANTG weight windows

Hi there,
I’ve got an ADVANTG weight windows file for a MCNP model that I’m converting to OpenMC. Do you have a way that I can import this file and use it with the WeightWindows class?

Hi @sjcrs. If you have a wwinp file, you can convert and use it in OpenMC as follows:

wws = openmc.wwinp_to_wws('wwinp')

settings = openmc.Settings()
settings.weight_windows = wws

The wwinp_to_wws function returns a list of WeightWindows objects.

1 Like

Hi,
I’d like to follow up on this. I’m loading a wwinp file and can see that it’s loading:

print(wws)

[WeightWindows
	ID             =	5
	Mesh:          =	RectilinearMesh
	ID             =	7
	Name           =	
	Dimensions     =	3
	N X pnts:      =	57
	X Min:         =	-130.0
	X Max:         =	720.0
	N Y pnts:      =	57
	Y Min:         =	-252.0
	Y Max:         =	252.0
	N Z pnts:      =	59
	Z Min:         =	-315.0
	Z Max:         =	285.0

	Particle Type  =	neutron
	Energy Bounds  =	<list of length 84>
...

And when I inspect the other elements of the WeightWindows object it all seems OK:

print(len(wws[0].energy_bounds))
print(len(wws[0].lower_ww_bounds))
print(len(wws[0].lower_ww_bounds[0]))
print(len(wws[0].lower_ww_bounds[0][0]))
print(len(wws[0].lower_ww_bounds[0][0][0]))

84
56
56
58
83

However when I run I see the error:

ERROR: In weight window domain 4 the number of spatial energy/spatial bins (83) does not match the number of weight bins (0)

In weight_windows.cpp the number of weight bins is pulled from the size of the lower weight bin edges, lower_ww_. This seems inconsistent with the print statements above. Do you have any suggestions?

Thanks

Looks like this is a bug. Thanks for reporting! I just submitted a potential fix for it: