Material dependent multi group cross sections using mgxs

Hello
snre_fuel_pin_2d.py (4.2 KB)

I’m trying to generate cross-sections and fluxes for each of the 4 materials, and for 6 energy groups using the mgxs class. I was under the impression that you could specify a material as the domain for the xs generation but it doesn’t seem to be working for my file (attached). I’m not sure if I’m defining the input parameters wrong?

Thanks in advance.

Hi,

When initializing fuel_cap, the script is passing [material] as the domain_type argument. This is incorrect as domain_type expects a string. Alternatively, if you don’t provide the domain_type, it will be autodetected from the type of the domain argument.

So your options are one of the following:

  1. domain_type=“material”
  2. Delete the domain_type argument altogether.

This was the first mistake I saw, there may be others so let us know if it works and we can take a deeper dive.
Adam

Thank you very much. I’ve deleted the domain type and believe that part of the input is now working. It’s now coming up with another error when I try to run:

/home/jack/miniconda3/envs/openmc-env/lib/python3.10/site-packages/openmc/mixin.py:67: IDWarning: Another Filter instance already exists with id=1.
warn(msg, IDWarning)
/home/jack/miniconda3/envs/openmc-env/lib/python3.10/site-packages/openmc/mixin.py:67: IDWarning: Another Filter instance already exists with id=3.
warn(msg, IDWarning)
/home/jack/miniconda3/envs/openmc-env/lib/python3.10/site-packages/openmc/mixin.py:67: IDWarning: Another Filter instance already exists with id=9.
warn(msg, IDWarning)
Traceback (most recent call last):
File “/home/emmajstewart/Dropbox/openmc_calculations/snre_calculations/fuel_pin/2d_calculations/snre_fuel_pin_2d.py”, line 153, in
openmc_run()
NameError: name ‘openmc_run’ is not defined

I’m not sure exactly what the ID warning is referring to. I have uploaded the updated file:
snre_fuel_pin_2d.py (4.3 KB)

Thanks in advance,

Emma

@es2517 The IDWarnings can be safely ignored – those happen when the MGXS automation is creating tally filters and joins some of them together.

The NameError you’re seeing is because you should be calling openmc.run(), not openmc_run().