Transfer rates warning for destination material

Hello all,

I am using OpenMC version 0.13.4-dev for the transfer rate functionality, and I have noticed some strange behavior. When I use a destination material in the transfer rates for the script below, I get the following warnings:

/usr/local/lib/python3.9/dist-packages/openmc/deplete/chain.py:737: UserWarning: Material 2 is not defined as a destination material for Material 1. Setting transfer rate to 0.0

warn(f'Material {destination_material} is not defined '

However, this warning does not seem to be accurate, as the destination material is defined and the transfer rate is still applied. This can be seen in the figure below which is the xenon in the destination material, which should not increase if the transfer rate is set to 0.0.

Xe135_ccwaste

I’ve also included below the script I used for testing, which is based on the regression test for transfer rates.

If anyone can help me figure out what is happening here, it would be greatly appreciated.

import openmc
import numpy as np
import openmc.deplete
from openmc.deplete import CoupledOperator

def model():
    f = openmc.Material(name="f")
    f.add_element("U", 1, percent_type="ao", enrichment=4.25)
    f.add_element("O", 2)
    f.set_density("g/cc", 10.4)

    w = openmc.Material(name="w")
    w.add_element("O", 1)
    w.add_element("H", 2)
    w.set_density("g/cc", 1.0)
    w.depletable = True

    radii = [0.42, 0.45]
    f.volume = np.pi * radii[0] ** 2
    w.volume = np.pi * (radii[1]**2 - radii[0]**2)

    materials = openmc.Materials([f, w])

    surf_f = openmc.Sphere(r=radii[0])
    surf_w = openmc.Sphere(r=radii[1], boundary_type='reflective')
    cell_f = openmc.Cell(fill=f, region=-surf_f)
    cell_w = openmc.Cell(fill=w, region=+surf_f & -surf_w)
    geometry = openmc.Geometry([cell_f, cell_w])

    settings = openmc.Settings()
    settings.particles = 100
    settings.inactive = 0
    settings.batches = 10

    return openmc.Model(geometry, materials, settings), f, w


if __name__ == "__main__":
    power = 174.0
    rate = 1E-05
    chain_file = f'../../data/chain_casl_pwr.xml'

    transfer_elements = ['Xe']
    model, fuel, water = model()

    dest_mat = 'w'


    op = CoupledOperator(model, chain_file)
    integrator = openmc.deplete.PredictorIntegrator(
        op, [1], power, timestep_units = 'd')
    integrator.add_transfer_rate('f', transfer_elements, rate,
                                destination_material=dest_mat)
    integrator.integrate()

Hi @LukeSeifert, thanks for reporting this.
The warn message you’re seeing is definitely misleading. What is set to 0.0 is not the transfer rate of the element you’ve defined but for all other elements present in the material, for which, as expected, a null transfer rate gets set. Don’t even know why is there and will be removed. Note however that the transfer rate for Xenon from material 1 to 2 gets set correctly as you’ve defined as the results you’ve plot suggests.
Thanks again.
Lorenzo

1 Like

@lorenzo Can you submit a pull request removing that warning message?

2 Likes