Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
fe602df
inclusion of the mass attenuation data
marco-de-pietri Dec 2, 2025
6ed9020
ci test
marco-de-pietri Dec 2, 2025
66527ce
ci test 2
marco-de-pietri Dec 2, 2025
f6f8ff7
ci test 3
marco-de-pietri Dec 2, 2025
27df25b
fix in the test_data_mu_en_coefficients.py
marco-de-pietri Dec 2, 2025
cb9a0cf
fix test mu_en
marco-de-pietri Dec 2, 2025
bcca64a
fix test mu_en 2
marco-de-pietri Dec 2, 2025
b9100e7
mu_tests
marco-de-pietri Dec 5, 2025
bc73963
initial structure for gamma contact dose rate
marco-de-pietri Dec 5, 2025
5c594ef
intermediate development of the cdr integrand
marco-de-pietri Dec 8, 2025
0761158
photon attenuation file creation
marco-de-pietri Dec 9, 2025
4eb2efb
photon attenuation intermediate commit
marco-de-pietri Dec 9, 2025
11f6be6
fix typo bug in material.py
marco-de-pietri Dec 10, 2025
705a6d3
fix bug material
marco-de-pietri Dec 10, 2025
e38b15f
unit tests for the linear attenuation
marco-de-pietri Dec 10, 2025
176d2d5
unit tests for the linear attenuation - fix bug
marco-de-pietri Dec 10, 2025
f2afe1f
linear attenuation tests - specific values
marco-de-pietri Dec 10, 2025
e9ac569
linear attenuation tests - specific values - relax criteria
marco-de-pietri Dec 10, 2025
2fa91db
linear attenuation tests - specific values - relax criteria 2
marco-de-pietri Dec 10, 2025
82b7248
fix bug photon_mass_attenuation
marco-de-pietri Dec 11, 2025
9fadb2e
material.photon_mass_attenuation_coefficient tests
marco-de-pietri Dec 11, 2025
2a9cc2d
fix bug in type checking
marco-de-pietri Dec 11, 2025
2d92038
fixed bug in linear attenuation coefficient
marco-de-pietri Dec 11, 2025
bb0db16
adjust tests
marco-de-pietri Dec 11, 2025
2ad9ab3
cobalt test
marco-de-pietri Dec 11, 2025
7602c26
fix bug
marco-de-pietri Dec 11, 2025
40aeb7d
spectrum distribution tests
marco-de-pietri Dec 11, 2025
866dbd3
fix typos and polish
marco-de-pietri Dec 11, 2025
ab7c326
first draft of approximate spectrum fispact style
marco-de-pietri Dec 11, 2025
fe62a93
intermediate commit
marco-de-pietri Dec 12, 2025
d358194
temporary removal of approximate spectrum function
marco-de-pietri Dec 17, 2025
1827ba4
removal of Sum function usage
marco-de-pietri Dec 19, 2025
fd45bdd
Revert "removal of Sum function usage"
marco-de-pietri Dec 19, 2025
a8ff92d
format
marco-de-pietri Dec 21, 2025
d4da233
function name change
marco-de-pietri Dec 29, 2025
582d6b3
added linear att test
marco-de-pietri Dec 29, 2025
52cac3a
fix linear attenuation test
marco-de-pietri Dec 29, 2025
fcae999
definition of the mass_attenuation energy distribution generator
marco-de-pietri Dec 29, 2025
a6ffcbd
fix circular import
marco-de-pietri Dec 29, 2025
dc6f0f9
fix test logic
marco-de-pietri Dec 29, 2025
67d6844
simplified material method for computing the attenuation
marco-de-pietri Dec 29, 2025
e41bfde
first version of the contact gamma dose rate / gamma only
marco-de-pietri Dec 30, 2025
75bf2ce
restored decay file - formatting issue
marco-de-pietri Dec 30, 2025
40657e8
revert small formatting changes in material.py
marco-de-pietri Dec 30, 2025
4b82744
simplification of mass-energy absorption storage of tabulated data
marco-de-pietri Jan 2, 2026
9f12223
removal of temperature dependancy for computing linear attenuation
marco-de-pietri Jan 2, 2026
9d19573
reorganization of mass attenuation material method
marco-de-pietri Jan 2, 2026
8750ace
update of mass attenuation testing
marco-de-pietri Jan 2, 2026
3e75fef
inclusion of reset id function in new tests
marco-de-pietri Jan 7, 2026
8ee9cda
reset auto ids in sphere_model fixture to fix test ID mismatch
marco-de-pietri Jan 7, 2026
803993d
bug with Tabulated1D definitions
marco-de-pietri Jan 15, 2026
999fd58
remove zeros that do not affect the cdr computation
marco-de-pietri Jan 15, 2026
1cfb589
fixed issue with log log interpolation
marco-de-pietri Jan 15, 2026
039724f
finalized interpolation tabular mechanism - tested
marco-de-pietri Jan 15, 2026
173e562
implemented the capability to choose between absorbed dose in air and…
marco-de-pietri Jan 16, 2026
035d8f0
doc string
marco-de-pietri Jan 16, 2026
9206f47
test
marco-de-pietri Jan 17, 2026
ded6652
computation of continuos xs for photons with the plotter module
marco-de-pietri Jan 27, 2026
c09f0fc
inclusion of photon tests
marco-de-pietri Jan 27, 2026
00049dd
fallback if photon mts are missing
marco-de-pietri Jan 27, 2026
9484d66
replacement of material method
marco-de-pietri Jan 28, 2026
6316b4f
update of cdr method
marco-de-pietri Jan 28, 2026
ded4df8
removed prior redundant tests
marco-de-pietri Jan 28, 2026
14a979e
docstring specification
marco-de-pietri Jan 28, 2026
67299e9
fix sum xs bug
marco-de-pietri Jan 28, 2026
825cc3f
relaxed test criteria
marco-de-pietri Jan 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openmc/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
from .function import *

from .effective_dose.dose import dose_coefficients
from .mass_energy_absorption import mu_en_coefficients
1 change: 1 addition & 0 deletions openmc/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
# Unit conversions
EV_PER_MEV = 1.0e6
JOULE_PER_EV = 1.602176634e-19
BARN_PER_CM_SQ = 1.0e24

# Avogadro's constant
AVOGADRO = 6.02214076e23
Expand Down
4 changes: 3 additions & 1 deletion openmc/data/endf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
104: list(range(650, 700)),
105: list(range(700, 750)),
106: list(range(750, 800)),
107: list(range(800, 850))}
107: list(range(800, 850)),
501: [502, 504, 516, 522],
516: [515, 517]}

ENDF_FLOAT_RE = re.compile(r'([\s\-\+]?\d*\.\d+)([\+\-]) ?(\d+)')

Expand Down
93 changes: 93 additions & 0 deletions openmc/data/mass_energy_absorption.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import numpy as np

import openmc.checkvalue as cv
from openmc.data import EV_PER_MEV

# Embedded NIST-126 data
# Air (Dry Near Sea Level) — NIST Standard Reference Database 126 Table 4 (doi: 10.18434/T4D01F)
# Columns: Energy (MeV), μen/ρ (cm^2/g)
_NIST126_AIR = np.array(
[
[1.00000e-03, 3.599e03],
[1.50000e-03, 1.188e03],
[2.00000e-03, 5.262e02],
[3.00000e-03, 1.614e02],
[3.20290e-03, 1.330e02],
[3.20290e-03, 1.460e02],
[4.00000e-03, 7.636e01],
[5.00000e-03, 3.931e01],
[6.00000e-03, 2.270e01],
[8.00000e-03, 9.446e00],
[1.00000e-02, 4.742e00],
[1.50000e-02, 1.334e00],
[2.00000e-02, 5.389e-01],
[3.00000e-02, 1.537e-01],
[4.00000e-02, 6.833e-02],
[5.00000e-02, 4.098e-02],
[6.00000e-02, 3.041e-02],
[8.00000e-02, 2.407e-02],
[1.00000e-01, 2.325e-02],
[1.50000e-01, 2.496e-02],
[2.00000e-01, 2.672e-02],
[3.00000e-01, 2.872e-02],
[4.00000e-01, 2.949e-02],
[5.00000e-01, 2.966e-02],
[6.00000e-01, 2.953e-02],
[8.00000e-01, 2.882e-02],
[1.00000e00, 2.789e-02],
[1.25000e00, 2.666e-02],
[1.50000e00, 2.547e-02],
[2.00000e00, 2.345e-02],
[3.00000e00, 2.057e-02],
[4.00000e00, 1.870e-02],
[5.00000e00, 1.740e-02],
[6.00000e00, 1.647e-02],
[8.00000e00, 1.525e-02],
[1.00000e01, 1.450e-02],
[1.50000e01, 1.353e-02],
[2.00000e01, 1.311e-02],
],
dtype=float,
)

# Registry of embedded tables: (data_source, material) -> ndarray
# Table shape: (N, 2) with columns [Energy (MeV), μen/ρ (cm^2/g)]
_MUEN_TABLES = {
("nist126", "air"): _NIST126_AIR,
}


def mu_en_coefficients(
material: str, data_source: str = "nist126"
) -> tuple[np.ndarray, np.ndarray]:
"""Return tabulated mass energy-absorption coefficients.
Parameters
----------
material : {'air'}
Material compound for which to load coefficients.
data_source : {'nist126'}
Source library.
Returns
-------
energy : numpy.ndarray
Energies [eV]
mu_en_coeffs : numpy.ndarray
Mass energy-absorption coefficients [cm^2/g]
"""
cv.check_value("material", material, {"air"})
cv.check_value("data_source", data_source, {"nist126"})

key = (data_source, material)
if key not in _MUEN_TABLES:
available = sorted({m for (ds, m) in _MUEN_TABLES.keys() if ds == data_source})
raise ValueError(
f"'{material}' has no embedded μen/ρ table for data source {data_source}. "
f"Available materials for {data_source}: {available}"
)

data = _MUEN_TABLES[key]
energy = data[:, 0].copy() * EV_PER_MEV # MeV -> eV
mu_en_coeffs = data[:, 1].copy()
return energy, mu_en_coeffs
26 changes: 25 additions & 1 deletion openmc/data/photon.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from . import HDF5_VERSION, HDF5_VERSION_MAJOR
from .ace import Table, get_metadata, get_table
from .data import ATOMIC_SYMBOL, EV_PER_MEV
from .endf import Evaluation, get_head_record, get_tab1_record, get_list_record
from .endf import Evaluation, SUM_RULES, get_head_record, get_tab1_record, get_list_record
from .function import Tabulated1D


Expand Down Expand Up @@ -487,6 +487,30 @@ def atomic_relaxation(self, atomic_relaxation):
def name(self):
return ATOMIC_SYMBOL[self.atomic_number]

def get_reaction_components(self, mt):
"""Determine what reactions make up redundant reaction.
Parameters
----------
mt : int
ENDF MT number of the reaction to find components of.
Returns
-------
mts : list of int
ENDF MT numbers of reactions that make up the redundant reaction and
have cross sections provided.
"""
mts = []
if mt in SUM_RULES:
for mt_i in SUM_RULES[mt]:
mts += self.get_reaction_components(mt_i)
if mts:
return mts
else:
return [mt] if mt in self else []

@classmethod
def from_ace(cls, ace_or_filename):
"""Generate incident photon data from an ACE table
Expand Down
Loading
Loading