Skip to content

improved neutron energy #88

Open
Open
@shimwell

Description

@shimwell

instead of a 14MeV or a 2.5MeV Muir distribution we could have a distribution that accounts for DD, TT and DT reactions

import NeSST as nst

def create_neutron_source_term(
        ion_temperature: float,
        fuel: dict = {'D':0.5, 'T':0.5},
) -> openmc.stats.Discrete:
    """Finds the energy distribution
"""

    ion_temperature = ion_temperature / 1e3  # convert eV to keV

    sum_fuel_isotopes = sum(fuel.values())
    if sum_fuel_isotopes > 1.:
        raise ValueError(f'isotope fractions within the fuel must sum to be below 1. Not {sum_fuel_isotopes}')

    if sum_fuel_isotopes < 0.:
        raise ValueError(f'isotope must sum to be above 0. Not {sum_fuel_isotopes}')

    for k, v in fuel.dict:
        if k not in ['D', 'T']:
            raise ValueError('Fuel dictionary keys must be either "D" or "T" not "{k}".)
        if v < 0
            raise ValueError('Fuel dictionary values must be above 0 not "{k}".)
        if v > 1
            raise ValueError('Fuel dictionary values must be below 1 not "{k}".)

    #Set atomic fraction of D and T in scattering medium and source
    if 'D' in fuel.keys():
        nst.frac_D_default = fuel['D']
    else:
        nst.frac_D_default = 0

    if 'T' in fuel.keys():
        nst.frac_T_default = fuel['T']
    else:
        nst.frac_T_default = 0

    # 1.0 neutron yield, all reactions scaled by this value
    num_of_vals = 500
    # single grid for DT, DD and TT grid
    E_pspec = np.linspace(0, 20, num_of_vals)  # accepts MeV units

    dNdE_DT_DD_TT = np.zeros(num_of_vals)
    if 'D' in fuel.keys() and 'T' in fuel.keys():
        DTmean, DTvar = nst.DTprimspecmoments(ion_temperature)
        Y_DT = 1.0
        dNdE_DT = Y_DT * nst.Qb(E_pspec, DTmean, DTvar)  # Brysk shape i.e. Gaussian
        dNdE_DT_DD_TT= dNdE_DT_DD_TT + dNdE_DT
    if 'D' in fuel.keys()
        DDmean, DDvar = nst.DDprimspecmoments(ion_temperature)
        Y_DD = nst.yield_from_dt_yield_ratio("dd", 1.0, ion_temperature)
        dNdE_DD = Y_DD * nst.Qb(E_pspec, DDmean, DDvar)  # Brysk shape i.e. Gaussian
        dNdE_DT_DD_TT= dNdE_DT_DD_TT + dNdE_DD
    if 'T' in fuel.keys()
        Y_TT = nst.yield_from_dt_yield_ratio("tt", 1.0, ion_temperature)
        dNdE_TT = Y_TT * nst.dNdE_TT(E_pspec, ion_temperature)
        dNdE_DT_DD_TT= dNdE_DT_DD_TT + dNdE_TT

    return openmc.stats.Discrete(E_pspec * 1e6, dNdE_DT_DD_TT)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions