openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
745 stars 482 forks source link

Define Gamma Source via Isotopes #1935

Closed cfichtlscherer closed 1 year ago

cfichtlscherer commented 2 years ago

Maybe somebody is already working on that:

Defining a gamma source from radioactive isotopes directly is currently not possible (to the best of my knowledge). To do so, you need to figure out the gammas created in the decay chain (for example, with PyNE material.gammas()) and then use the source.energy = openmc.stats.Discrete(energy_list, intensity_list) functionality. The entries of the first list indicate the respective energies of the photons, and the entries of the second list indicate which relative intensity these particles have.

When I am doing this, I am working with PyNE or using the LANA data from http://www.lnhb.fr/donnees-nucleaires/donnees-nucleaires-tableau/.

I think it could be a helpful feature to extend the Python API to have the option to specify gamma sources as radioactive isotopes. We could define the source material as the other materials are defined in OpenMC. Probably at one point we need to state which total amount of material we have.

There are some things I am not sure about:

Best Christopher

eepeterson commented 2 years ago

Hi @cfichtlscherer thanks for posting this! We are actually working on something along these lines and this brings up another reason why we should put together a regular dev meeting per @paulromano's suggestion. I think the first task here is to extend the OpenMC hdf5 library format with better decay particle emission data and spectra. Then, as you suggested, I think adding a method to the openmc.Material class to calculate the particle emission spectra just based on the isotopic composition and density would be the way to go. For actually using these sources you could use the volume of your source to get absolute emission rates (this could be a Cell or Mesh element or analytic expression given the statistical distributions OpenMC supports which is also part of the scope of our work). The standard source specification would likely work for small numbers of sources. However, I'm not sure how scalable this strategy is for the millions of cells we would need to consider as independent sources for the shutdown dose rate workflows we're developing. If @paulromano or @pshriwise have additional thoughts on that or corrections to what I said, they can chime in.

pshriwise commented 2 years ago

Hi @cfichtlscherer! Nice to hear from you. I like the approach using the source definition capabilities already present in OpenMC and, as @eepeterson said, we'll need to look into how those will scale with a large number of sources in the domain. For example, we may want to group our sources by relative intensity to more quickly narrow the search for our next source to sample.

Then, as you suggested, I think adding a method to the openmc.Material class to calculate the particle emission spectra just based on the isotopic composition and density would be the way to go.

I also like this approach. Another nice method to add would be openmc.Material.decay which uses library data to update the material composition for decay over a specified time before generating the gamma spectrum of interest, another item on our list.

As for the data, @paulromano is the expert here, but yes I'd expect we'll incorporate the gamma spectra into our hdf5 libraries and provide new versions at openmc.org once their updated. Still, what you have already done for conversion of the data into Python objects would be useful to see I'm sure!

cfichtlscherer commented 2 years ago

Yes, of course. I am happy if this can help anyone, but please be careful. I do not give any warranty.

I think there is still a factor of 100 wrong in the gamma function: https://github.com/pyne/pyne/issues/1433#issuecomment-996993755 therefore, here is my procedure for the LARA data.

You can download all the data from http://www.lnhb.fr/donnees-nucleaires/donnees-nucleaires-tableau/.

With the jupyter notebook lana_conversion.ipynb (changed the extension to .txt to be able to upload it here), you can generate a python dictionary (stored as a pickle file) from this data. The keys of this dictionary are the names of the isotopes, and the values are the energies and their intensities (per atom*s). The last value is the half-life time.

I have attached the generated pickle file (change the extension in the lana_emissions_dic from .txt to .pickle).

Then with the file generate_openmc_source_input.py(again, change extension from .txt to .py), you can generate the energy and the intensity list directly in the python file.

The function generate_openmc_source_input takes as an input an isotope dictionary whose keys are the names of the isotopes and whose values are the concentrations of the isotopes in atom fraction. For example: isotope_dic = {"Ga66": 0.5, "Cs137": 1}

I calculate the total intensity in a separate step after the simulation.

Please let me know if there are any questions.

lana_emissions_dic.txt lana_conversion.txt generate_openmc_source_input.txt

shimwell commented 2 years ago

Hi all, I'm also interested in seeing this feature. Wondering if it is a bit closer now as there have been a couple of PRs merged in recently

I guess the next step is to join up the gamma emission data and the nuclide activity in openmc

Perhaps we can add this lana data set as a dictionary of nuclide_name with tuples of gamma energies and gamma intensities to the openmc/data folder in the repo. What do people think would this be too large a file to include in the source code?

paulromano commented 2 years ago

@shimwell I've been actively working on an ability to get decay spectra and should have a PR soon.