Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuclear data threshold reaction energy plot #232

Open
shimwell opened this issue Aug 2, 2023 · 3 comments
Open

nuclear data threshold reaction energy plot #232

shimwell opened this issue Aug 2, 2023 · 3 comments

Comments

@shimwell
Copy link
Member

shimwell commented Aug 2, 2023

to help explain activation from DT neutrons at 14MeV vs activation from DD neutrons at 2.5MeV I could add a plotting script like this

import matplotlib.pyplot as plt
import openmc
from matplotlib.lines import Line2D


def plot_thresholds(nuclide="Fe56"):
    plt.clf()
    threshold_below_14 = 0
    threshold_below_2 = 0
    x = {}
    fe = openmc.data.IncidentNeutron.from_hdf5(
        # this dir would need changing to read the local nuclear data
        f"/home/jshimwell/ENDF-B-VIII.0-NNDC/h5_files/neutron/{nuclide}.h5"
    )
    for key, value in fe.reactions.items():
        reaction = fe[key]
        xs = reaction.xs["294K"]
        threshold = xs.x[0]
        name = reaction.__str__().split()[-1][:-1]
        if name not in ["heating", "damage-energy", "heating-local"]:
            # print(threshold/1e6, name)
            x[name] = threshold
            if threshold < 14.1e6:
                threshold_below_14 = threshold_below_14 + 1
                color = "blue"
                plt.plot(xs.x / 1e6, xs.y, label=name, color=color, linewidth=0.5)
            if threshold < 2.5e6:
                threshold_below_2 = threshold_below_2 + 1
                color = "red"
                plt.plot(xs.x / 1e6, xs.y, label=name, color=color, linewidth=0.5)
            print(key, name, threshold / 1e6)

    custom_lines = [
        Line2D([0], [0], color="red", lw=4),
        Line2D([0], [0], color="blue", lw=4),
    ]
    plt.legend(
        custom_lines,
        ["Reaction threshold < 2.5MeV", "Reaction threshold > 2.5 MeV and < 14 MeV"],
    )
    plt.title(
        f"Neutron reaction cross sections for {nuclide} colored by threshold energy.\n {threshold_below_2} reactions below 2.5MeV {threshold_below_14} reactions below 14.1MeV"
    )
    plt.yscale("log")
    plt.xlabel("Energy [MeV]")
    plt.ylabel("Cross sections [barns]")

    plt.xlim((0, 15))
    plt.ylim((1e-16, 1e10))
    plt.savefig(f"threshold_{nuclide}.png", dpi=200)

    # all the reactiosn sorted by energy
    all = dict(sorted(x.items(), key=lambda item: item[1]))


plot_thresholds(nuclide="Al27")
plot_thresholds(nuclide="Fe56")

threshold_Al27
threshold_Fe56

@shimwell shimwell changed the title nuclear data threshold energy plot nuclear data threshold reaction energy plot Aug 2, 2023
@py1sl
Copy link

py1sl commented Aug 25, 2023

I don't think you are plotting different reactions, i think you are plotting a few reactions (therefore a few activation products) and then lots of excitation levels. Not sure this helps the explanation.

@shimwell
Copy link
Member Author

Thanks py1sl

I guess we could group the reactions that result in the same end activation product if that is more useful

We have a list of reactions that transmutation openmc source code that might come in handy.

https://github.com/openmc-dev/openmc/blob/eea52238dac0162a8b7924b81800af4a3c78798e/openmc/deplete/chain.py#L34-L119

@py1sl
Copy link

py1sl commented Aug 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants