# Transfer rates with multiple destinations

**URL:** <https://openmc.discourse.group/t/transfer-rates-with-multiple-destinations/3207>\
**Category:** New Ideas\
**Created:** [July 13, 2023, 2:23pm UTC](https://openmc.discourse.group/t/transfer-rates-with-multiple-destinations/3207 "2023-07-13T14:23:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LukeSeifert](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@LukeSeifert](https://openmc.discourse.group/u/LukeSeifert)\
**Post date:** [July 13, 2023, 2:23pm UTC](https://openmc.discourse.group/t/transfer-rates-with-multiple-destinations/3207/1 "2023-07-13T14:23:36Z")

</div>

Hello all,

In the most recent version of OpenMC, the transfer rate functionality is implemented as a dictionary with the string source material index as the key, and a dictionary as the value. Within the value dictionary, the key is the string element symbol and the value is a tuple of the rate and destination material.

I think this may be more effective modified slightly, as currently users cannot have transfer rates from a single material lead to more than one destination. If this is attempted using `set_transfer_rate` or `add_transfer_rate`, it will simply overwrite the previous value. I’ve given a brief demonstration of what this looks like in the `integrator.transfer_rates.transfer_rates` variable.

```auto
{'2': {'Xe': (0.1, '4')}, '3': {}, '4': {'Xe': (4e-05, '3')}}
{'2': {'Xe': (0.1, '4')}, '3': {}, '4': {'Xe': (0.05, '2')}}

```

In this example, I would like xenon to be transferred from material 4 to both material 3 and material 2 simultaneously. Additionally, in this case, I cannot add the rates together and just use one destination material, as that would not provide the behavior I seek.

One way to implement this that seems the most straightforward to me would be to change the tuple into a list of tuples, as demonstrated below.

```auto
{'2': {'Xe': [(0.1, '4')]}, '3': {}, '4': {'Xe': [(4e-05, '3'), (0.05, '2')]}}

```

Has anyone already looked into implementing this?

---

<div class="post-metadata">

**Author:** ![lorenzo](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lorenzo](https://openmc.discourse.group/u/lorenzo)\
**Post date:** [July 14, 2023, 7:28am UTC](https://openmc.discourse.group/t/transfer-rates-with-multiple-destinations/3207/2 "2023-07-14T07:28:06Z")

</div>

Hi @LukeSeifert,  
You’re right, the current implementation of TransferRates only allows to set transfer between one source material and one destination material.

To implement more destinations in the code you would need to modify `form_rr_term` in `chain.py` and the transfer rates matrices definition in `pool.py`, accordingly.

Otherwise a crude way to do it with the current implementation would be to define a buffer region and set more transfer rates, in your specific case could be:

```auto
{'4': {'Xe': (4.05e-05, 'buffer')}, 'buffer': {'Xe': (4e-05, '3')}, 'buffer': {'Xe': (0.05, '2')},}

```
