Units of Diffusion_Coefficient?

Hi there,

I’m just wondering what the units of the diffusion coefficient are in OpenMC? I would assume it is just cm but thought I’d double check.

Many thanks

Hi @bakingbad and welcome to the forum. If you are talking about the openmc.mgxs.DiffusionCoefficient class, then yes, I believe the units are just cm. @mkreher13 can you confirm?

Hello! Yes, that’ right. The diffusion coefficient in openmc.mgxs.DiffusionCoefficient is calculated with the inverse of the transport cross section. The details about the calculation can be found here.

Thank you very much!

As a follow up, when generating the diffusion coefficients one obtains both P0 and P1 Legendre coefficients. What is the difference between these?

Hello! The P0 and P1 tallies represent two different Legendre scattering approximation tallies that are useful for calculating the diffusion coefficient. When you are ready to obtain the value of the diffusion coefficient (using for example mgxs_lib['diffusion-coefficient'].get_xs()), The P1 tally will be sliced and used to correct the total cross section. Finally, that transport-corrected cross section will be used to calculate the diffusion coefficient.

Hi there, can I ask for a bit more clarification on how to extract the diffusion coefficient?

I have 3 energy groups in my simulation (with edges [0.025, 1, 1E3, 14E6]) and two cells (water_cell and air_cell) and would like the diffusion coefficient for each group in each cell. I have followed the procedure for the fuel cell in the ‘Extracting and Storing MGXS Data’ section of Multigroup Cross Section Generation Part III: Libraries — OpenMC Documentation however it still prints the P0 and P1 tallies separately. I should also note that performing DiffusionCoefficient.print_xs() raises a TypeError.

Many thanks again for your help! :slight_smile:

You may have uncovered a small formatting bug. I wrote this code, and as I am looking at it, it seems that two of my functions need to get switched so that the slicing occurs correctly. Thank you so much for being a user! Without users, we can’t catch this sort of thing.

It might take some time for me to make the appropriate changes, test them for accuracy, etc. In the meantime, I think you can just use the values given by the P1 tally. That’s the sole answer that should be provided once the slicing is fixed, but for now, the formatting issue still shows P0 and P1.

Thank you for this! So even after all the corrections are made, it will still be the case that the diffusion coefficient is equal to the P1 result?

Sorry, I’ll have to get back to you on this! The Legendre filter was added to the Transport XS after the DiffusionCoefficient was originally written, so there’s been some back-fitting that I need to get to the bottom of.

OK, no worries. Thanks a lot!

Hello again! I can confirm you just use the P1 result. I fixed the issue and that was merged into the OpenMC develop branch. So you can install the latest OpenMC to get the fix. Please note that there are inherent flaws associated with using diffusion as 1/(3*transport), but that is the only method currently available in OpenMC.

OK great, thank you! Just for further information, what is it about using diffusion as 1/(3*transport) that is inherently flawed? Are there alternative ways of calculating it, perhaps deterministically?

Many thanks! :slight_smile:

Keep in mind that I am still learning about this myself, but basically the transport cross section is an approximation that requires a very fine energy mesh to resolve correctly. So, if you tally the diffusion coefficient as 1/(3tr) on a coarse energy grid, the result is not very accurate. Right now, in OpenMC, even if you tally the diffusion coefficient on a fine energy grid, when you go to condense it to the coarse energy grid, it will actually condense all the underlying tallies, including the transport cross section, and then just re-calculate D=1/(3tr).

I am working on a function that will actually collapse the diffusion coefficient directly instead of the transport cross section, which is more accurate (preserves leakage better). With this function, you could tally the diffusion coefficient on a fine grid, and then condense D directly, which is better.

For further information about computing diffusion coefficients, this paper by an alumni of my group is a great explanation of alternate methods!

I am really enjoying this discussion, so please don’t hesitate to ask further questions.