DPA calculation

I am trying to calculate DPA values for mix materials using openmc. However, in my case I want to use energy vs flux values rather than the fixed DT source (not as in example it is taken 14MeV for Fe case). Can you please guide me how to implement the same in openmc.

Thanks for your help and regards

Anil

Hi @aktyagiprl

I’m not sure if this works or gives the right answers but @nuclearbae and myself have been trying to get reactions from flux spectra working to provide inventory code capabilities. More details on our efforts over here

For this code you would need to either make the one line change shown in this PR on your local version of openmc or make use of this PR branch directly.

import openmc
import openmc.deplete

# you might want to change these to use specific xml files to use particular decay data or transport cross sections
# the chain file was downloaded with
# pip install openmc_data
# download_endf_chain -r b8.0
openmc.config['chain_file'] = '/home/j/chain-endf-b8.0.xml'
# openmc.config['cross_sections'] = 'cross_sections.xml'

# makes a simple material from Silver
my_material = openmc.Material() 
my_material.add_element('Fe', 1, percent_type='ao')
my_material.set_density('g/cm3', 7)
materials = openmc.Materials([my_material])

# this is the precalculated neutron spectra in units of n/cm2
flux_in_each_group=[0.1]*709

micro_xs = openmc.deplete.MicroXS.from_multigroup_flux(
    energies='CCFE-709', # different group structures are available, see this file for others https://github.com/openmc-dev/openmc/blob/develop/openmc/mgxs/__init__.py
    multigroup_flux=flux_in_each_group,
    temperature=294, # endf 8.0 has ['1200K', '2500K', '250K', '294K', '600K', '900K']
    chain_file= openmc.config['chain_file'],
    nuclides=my_material.get_nuclides(),
    reactions=['damage-energy']
)

print(micro_xs.reactions)
print(micro_xs.nuclides)
print(micro_xs.data)

Then to convert from damage energy to DPA there are a few methods. This example has a clear guide for two popular methods many thanks to @Oliverator for improving the DPA example.

Hi @aktyagiprl,

I understand that you want to define your own source from an histogram where you have different values of flux for each bin of energy. In OpenMC you can do so very easily but you first need to normalise the dataset by dividing each flux by the total flux and the energy bin width.

Then you can define your source as

my_source.energy = openmc.stats.Tabular(energy_bins, normalised_flux, interpolation='histogram')

@paulromano explains it very well here.

Dear Dr. @Shimwell I get the following error related to MicroXS

micro_xs = openmc.deplete.MicroXS.from_multigroup_flux(
… energies=‘CCFE-709’,
… multigroup_flux=flux_in_each_group,
… temperature=294,
… chain_file= openmc.config[‘chain_file’],
… nuclides=my_material.get_nuclides(),
… reactions=[‘damage-energy’]
… )
Traceback (most recent call last):
File “”, line 1, in
AttributeError: type object ‘MicroXS’ has no attribute ‘from_multigroup_flux’

Can you please suggest to solve this?

You would need to use the branch mentioned in the previous reply. This branch has the one line change for damage-eneregy but also it is based on the current develop branch so it includes the recently added class method from_multigroup_flux

I have openmc installed in conda environment (openmc-env) and have made the changes as suggested by you in the following file by adding _valid_rxns.append(‘damage-energy’)

/home/solps/anaconda2/envs/openmc-env/pkgs/openmc-0.13.3-dagmc_mpi_openmpi_py310h956dc85_100/lib/python3.10/site-packages/openmc/deplete/microxs.py

however getting same error. Is the change made at correct location? can you please suggest.

You also need the changes from the develop branch.

Here are the instructions for installing from source , you would need to checkout the PR branch as well with the git checkout command.

https://docs.openmc.org/en/latest/quickinstall.html#installing-from-source-on-ubuntu

Hi @Oliverator,
thanks yes what you have suggested, I want to use this definition in the calculation. Thanks to you and @Shimwell I am now trying to compare things with some benchmark case.

Dear Dr. @Shimwell,

I could get the damage-energy data for the Fe isotpes. However, this is one value (mean). can I extract the energy and cross-section data for each isotope. For example for energies CCFE-709 I should have 709 values of cross-section.
Also I have used energies in 100 group structure, does the openmc.deplete method regroup the cross-section data for these energies. Jupyter-notebook code is below

example from Dr. Shimwel

import openmc
import openmc.deplete
import numpy as np
openmc.config[‘chain_file’] = ‘/home/solps/OPENMC/CROSS_SECTIONS/chain-endf-b8.0.xml’
openmc.config[‘cross_sections’] = ‘/home/solps/OPENMC/CROSS_SECTIONS/endfb-viii.0-hdf5/cross_sections.xml’

Fe as material

my_material = openmc.Material()
my_material.add_element(‘Fe’, 1, percent_type=‘ao’)
my_material.set_density(‘g/cm3’, 7)
materials = openmc.Materials([my_material])
precalculated neutron spectra in units of n/cm2
flux_in_each_group=[0.01]*100

using 100 energy group structure

micro_xs = openmc.deplete.MicroXS.from_multigroup_flux(
energies= np.array([1.000E-10, 1.000E-09, 1.000E-08, 2.300E-08, 5.000E-08, 7.600E-08, 1.150E-07, 1.700E-07,
2.550E-07, 3.800E-07, 5.500E-07, 8.400E-07, 1.275E-06, 1.900E-06, 2.800E-06, 4.250E-06,
6.300E-06, 9.200E-06, 1.350E-05, 2.100E-05, 3.000E-05, 4.500E-05, 6.900E-05, 1.000E-04,
1.350E-04, 1.700E-04, 2.200E-04, 2.800E-04, 3.600E-04, 4.500E-04, 5.750E-04, 7.600E-04,
9.600E-04, 1.275E-03, 1.600E-03, 2.000E-03, 2.700E-03, 3.400E-03, 4.500E-03, 5.500E-03,
7.200E-03, 9.200E-03, 1.200E-02, 1.500E-02, 1.900E-02, 2.550E-02, 3.200E-02, 4.000E-02,
5.250E-02, 6.600E-02, 8.800E-02, 1.100E-01, 1.350E-01, 1.600E-01, 1.900E-01, 2.200E-01,
2.550E-01, 2.900E-01, 3.200E-01, 3.600E-01, 4.000E-01, 4.500E-01, 5.000E-01, 5.500E-01,
6.000E-01, 6.600E-01, 7.200E-01, 7.800E-01, 8.400E-01, 9.200E-01, 1.000E+00, 1.200E+00,
1.400E+00, 1.600E+00, 1.800E+00, 2.000E+00, 2.300E+00, 2.600E+00, 2.900E+00, 3.300E+00,
3.700E+00, 4.100E+00, 4.500E+00, 5.000E+00, 5.500E+00, 6.000E+00, 6.700E+00, 7.400E+00,
8.200E+00, 9.000E+00, 1.000E+01, 1.100E+01, 1.200E+01, 1.300E+01, 1.400E+01, 1.500E+01,
1.600E+01, 1.700E+01, 1.800E+01, 1.900E+01, 2.000E+01]),
multigroup_flux=flux_in_each_group,
temperature=294, # endf 8.0 has [‘1200K’, ‘2500K’, ‘250K’, ‘294K’, ‘600K’, ‘900K’]
chain_file= openmc.config[‘chain_file’],
nuclides=my_material.get_nuclides(),
reactions=[‘damage-energy’]
)
print(micro_xs.reactions)
print(micro_xs.data)

I don’t think the code is setup to give a break down of DPA per energy bin. But you could loop through each energy bin each time call openmc.deplete.MicroXS.from_multigroup_flux with a list that contains single enery bin value and a list that contains a single flux value. Not very efficient but this is all I can think of given that you want DPA from a flux without particle transport. The openmc.deplete.MicroXS.from_multigroup_flux collapses the values so the DPA per bin is not available. Perhaps a multiplication of the cross section plot and the flux values should could also relative amounts.

OK thanks I shall try that.

That PR i mented has been merged in