Hi all, I’m trying to generate mgxs library for dagmc geometry.
The cad geometry has several different materials, and I want to get mgxs for each one.
So I’ve tried to use ‘material’ and ‘cell’ options in mgxs lib domain type, but it seems that geometry does not have such info. if I made it just by ‘geometry = openmc.Geometry(root=dagmc_univ)’. Is there any way to solve?
Any reply will be appreciated!
I believe you should be able to generate MGXS on a DAGMC geometry by specifying the materials. If you are using the mgxs.Library class, the issue is that it tries to call geometry.get_all_materials() to determine the materials. However, you can try to manually specify the materials as:
I’ve tried it, but didn’t work.
I’m using CAD-to-OpenMC, and when I convert cad file, it returns material_tags what I give correctly.
materials.xml also shows the tags, and I can check them in openmc-plotter either after run without mgxs tally.
but printing dagmc_univ.material_names gives just OrderedDict(), and geometry.xml only shows below.
It looks like the block of code for setting the domains might be a little too restrictive with some of the checks for DAGMC geometries. You should be able to get around this for now with the following:
library = openmc.mgxs.Library(geometry, ...)
library.domain_type = 'material'
library._domains = openmc.Materials.from_xml() # Note the extra underscore
I am also trying to generate MGXS on a DAGMC geometry and was wondering how it differed from generating MGXS on a more standard OpenMC geometry. Any help would be appreciated!
Pretty much the same. Setting energy group structure and mgxs types, building library and tallies and so on… you can just follow the examples for standard geometry.
Only difference is the way to define library domain. As you can see above, the mgxs library domain should be defined as below (I didn’t try other domain types like cell, universe or others).
library = openmc.mgxs.Library(geometry, …)
library.domain_type = ‘material’
library._domains = openmc.Materials.from_xml() # Note the extra underscore
Replacing your code with the above should work for DAGMC geometry