Energy Deposition With Photon Transport

Hello, I am trying to do some verification work involving some depletion calculations. I am specifically looking at the normalization mode and comparing: Fission Q, Energy Deposition with photon transport enabled, and Energy Deposition without photon transport. When doing my depletion calculations, I found that the Fission Q and the Energy Deposition WITHOUT photon transport produce similar results, showing a U235 depletion over time that’s roughly the same. However, when using Energy Deposition with photon transport enabled, U235 depletes noticeably more over time. I have investigated into this quite a bit and have found confirmations that energy deposition seems to be subtracting the energy from photons from the system and never adds it back in, resulting in a higher U235 depletion rate due to a lower eV/fission. This is what I believe is happening, but is there something I am missing or is there a way to show what exactly openMC is doing when photon transport is enabled? Any help would be greatly appreciated!

Hello, I figured it out, the error lies within this line of code from OpenMC Depletion:

def initial_condition(self):
“”"Performs final setup and returns initial condition.

    Returns
    -------
    list of numpy.ndarray
        Total density for initial conditions.

    """

    # Create XML files
    if comm.rank == 0:
        self.model.geometry.export_to_xml()
        self.model.settings.export_to_xml()
        if self.model.plots:
            self.model.plots.export_to_xml()
        if self.model.tallies:
            self.model.tallies.export_to_xml()
        self._generate_materials_xml()

    # Initialize OpenMC library
    comm.barrier()
    if not openmc.lib.is_initialized:
        openmc.lib.init(intracomm=comm)

    # Generate tallies in memory
    materials = [openmc.lib.materials[int(i)] for i in self.burnable_mats]

    return super().initial_condition(materials)

The error lies in the “Initialize OpenMC Library” check, where it will check to see if openmc.lib is initialized. When running one depletion case, there should be no error here because the model you initialize shouldn’t change. However, if you are running depletion cases back to back, the model unique to the second case will not be initialized because openmc.lib was already initialized for the first case. So OpenMC will produce the correct XML files, but because openmc.lib was already initialized, it will not use them with the correct model. For my case, I was comparing normalization modes and their effects on depletion, I was using Energy Deposition with Photon Transport off, immediately followed by Energy Deposition with Photon Transport On. The Photon Transport off case was correct because the openmc.lib had to initialize for the case, but for Photon Transport on, openmc.lib was already initialized, so while the proper XML files for Photon Transport were created, openmc.lib was already initialized for the Photon Transport off case, so openmc.lib did not reinitialize and resulted in an incorrect depletion result.

Ultimately, the depletion module isn’t necessarily safe because there is a possibility for the python/depletion module to differ from the C/transport module on run settings. The transport is not always initialized and therefore one can adjust the model on the python side without that change being reflected in the transport. I believe if within the “Initialize OpenMC Library” there were a check for if openmc.lib was initialized, and if so, reinitialize before continuing instead of checking for initialization and moving on, this would fix the problem and make this miscommunication between python and C no longer a possibility.