What you are requesting is an oft-proposed capability: the ability to do something between depletion steps. There have been some other good discussions in the following links
- change the material in individual cells during a depletion calculation · Issue #1519 · openmc-dev/openmc · GitHub
- Stop depletion between each timestep · Issue #1631 · openmc-dev/openmc · GitHub
- Geometry can change during depletion calculation?
What @Pranto has suggested (performing a single step, extracting materials.xml
, modifying via python API, re-starting) is the closest thing we have to supported changing materials through depletion.
We don’t have a proper analogue for Intergrator.integrate
like openmc.lib.run
directly in the openmc
C++ library, since the depletion and transport frameworks are intentionally separated.
If you wanted to develop a more tightly-coupled approach, I would recommend creating a subclass of your depletion scheme of choice (e.g., CECMIntegrator
) that modifies the internals of the integrate
method, specifically, CECMIntegrator.__call__
. You may also want to create a custom Operator subclass that updates non-burnable materials through the openmc.lib
API.
I have not tested any of this but it’s at least where I would start on this process.
One thing to be wary of with this approach is being careful when re-evaluating a depletion step before moving forward in time. That could get tricky as we essentially append new simulation results to the data file, meaning that you could end up with multiple sets of data (multiplication factor, reaction rates, concentrations, etc.) corresponding to the same depletion step.
Regards,
Andrew