Depletion into MGXS Generation for Full Reactor Sim

I am trying to generate multi-group cross sections for a simulated research reactor and need to run a depletion step first. I would like to be able to deplete each lattice element individually (they are all their own unique universes) to a desired U235 content to match real world test cases. I then need to feed the resulting fuel composition back into the simulation for each element’s fuel material and run the MGXS simulation. Is there a better way to do this than pulling the concentration for every fission product for every fuel element (thousands of lines of code)?

On a related note, I am getting this error when trying to pull the U235 content:

File “Core.py”, line 4739, in
_, n_U235 = dep_results.get_atoms(0, LEU_5, ‘U235’)

File “/home/rmclem/miniconda3/envs/openmc-py3.7/lib/python3.7/site-packages/openmc/deplete/results.py”, line 133, in get_atoms {“atoms”, “atom/b-cm”, “atom/cm3”})

File “/home/rmclem/miniconda3/envs/openmc-py3.7/lib/python3.7/site-packages/openmc/checkvalue.py”, line 191, in check_valueraise ValueError(msg)

ValueError: Unable to set “nuc_units” to “U235” since it is not in “{‘atoms’, ‘atom/cm3’, ‘atom/b-cm’}”

I suspect this error may have to do with how my materials are defined, so here’s an example of one of the fuel material definitions, where the weight percents are defined elsewhere:

LEU_5 = openmc.Material()
LEU_5.depletable = True
LEU_5.volume = 532.356 # all volumes in cm^3
LEU_5.add_nuclide(‘U235’, U235_frac_5, ‘wo’)
LEU_5.add_nuclide(‘U236’, U236_frac_5, ‘wo’)
LEU_5.add_nuclide(‘U238’, U238_frac_5, ‘wo’)
LEU_5.add_nuclide(‘Al27’, alum_frac_5, ‘wo’)
LEU_5.add_element(‘Fe’, iron_frac_5, ‘wo’)
LEU_5.set_density(‘g/cm3’, fuel_density)

1 Like

I could of course deplete the entire core down to an average depletion, then run a depletion restart for a 1 second depletion with the MGXS tallies on, but running a depletion alongside the MGXS tally would likely be very computationally inefficient.

Hi @Daedalus

Your subject is very interesting and I hope that someone more experienced could help on that, it is something that I would like also to try on one of my subject area on natural nuclear reactor.

I just want to get your attention on the syntax you did use to define your material, the names of your element/nuclide should be given as a string and also with arg “name”:

BlockquoteLEU_5 = openmc.Material()
LEU_5.depletable = True
LEU_5.volume = 532.356 # all volumes in cm^3
LEU_5.add_nuclide(‘U235’, U235_frac_5, ‘wo’) ----> name=‘U235_frac_5’,
LEU_5.add_nuclide(‘U236’, U236_frac_5, ‘wo’) ----> name=‘U236_frac_5’,
LEU_5.add_nuclide(‘U238’, U238_frac_5, ‘wo’) ----> name=‘U23__frac_5’,
LEU_5.add_nuclide(‘Al27’, alum_frac_5, ‘wo’) ----> name=‘alum_frac_5’,
LEU_5.add_element(‘Fe’, iron_frac_5, ‘wo’) ----> name=‘iron_frac_5’,
LEU_5.set_density(‘g/cm3’, fuel_density) —> name=‘fuel_density’,

in that way, OpenMC will recognize the arg ‘wo’ directly

For anyone reading this in the future, I decided on the following solution which solves a number of problems simultaneously. The idea is to create a library of fuel compositions for intervals of burnup (perhaps every 0.5%). You can get these compositions by running a depletion calculation followed by the following code described in the solution to this other post here. This returns a new materials.xml file containing your compositions with the fission products. This would of course take some time, for my needs it will be ~50 simulations, and they need to be fairly beefy for precision. However, once this library of reference compositions is done, you shouldn’t need to do any depletions anymore. Then run the python file (not openmc simulation) and replace the fuel composition data from the python file that was ported into the materials.xml file with the desired burnup sample composition for the desired elements from the library (I have a unique element universe for each lattice position). Also, make sure that the materials = openmc.Materials and materials.export_to_xml() code lines are commented out, as these will overwrite your edited materials.xml file. Now you can move elements around within the lattice and perform a “jump-in” style simulation. This also solves some issues with tallies (MGXS tallies in my case) as you will be running in ‘eigenvalue’ mode instead of ‘depletion’ mode. Also, don’t forget that power level effects compositions like Xe135. If you are varying power level, you would need to 2D matrix of burnup and power for your library.

1 Like