Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9401f93
electron reactions wip
melekderman Mar 18, 2026
e994193
change the nuclide/element logic
melekderman Mar 19, 2026
3c82f69
back in black
melekderman Mar 19, 2026
92381d4
fix for regression test failure
melekderman Mar 20, 2026
7578849
Time to Converge – update the output file
melekderman Mar 20, 2026
c5c24c0
fix the scale setting
melekderman Mar 29, 2026
165965a
add lockwood as the electron transport regression test
melekderman Mar 29, 2026
bbc31ba
back in black
melekderman Mar 29, 2026
3138b6c
solve the conflict
melekderman Apr 5, 2026
0bb30ef
merge upstream/dev into feature/electron-reactions
melekderman Apr 5, 2026
6d6dfb1
Fix MCDC_LIB path in input.py for lockwood
melekderman Apr 5, 2026
467f957
Update comment for atomic weight ratio dataset
melekderman Apr 7, 2026
65ea8c8
Merge branch 'dev' of github.com:CEMeNT-PSAAP/MCDC into CEMeNT-PSAAP-dev
melekderman Apr 7, 2026
c96041e
Merge branch 'CEMeNT-PSAAP-dev' into feature/electron-reactions
melekderman Apr 7, 2026
3157118
Merge branch 'CEMeNT-PSAAP:dev' into feature/electron-reactions
melekderman Apr 8, 2026
b6280b4
add type hint
ilhamv Apr 8, 2026
4f84c4f
use set_transported_particles in lockwodd
ilhamv Apr 9, 2026
1ea1647
remove redundant basic data assignment
ilhamv Apr 9, 2026
5fe3a60
revert the MCDC_LIB check
ilhamv Apr 9, 2026
805895b
check composition time on material print
ilhamv Apr 9, 2026
0d4f440
re-add the nuclide-temperature data file check
ilhamv Apr 9, 2026
4570d5c
optimize regtest input setup
ilhamv Apr 9, 2026
1d4c8b5
minor update element creation.
ilhamv Apr 9, 2026
a1f3fbe
minor update
ilhamv Apr 9, 2026
c02acef
fix #3 - fine structure constant
melekderman Apr 9, 2026
bcf49f2
fix #6 - delete the unnecessary error catcher
melekderman Apr 9, 2026
938c2e6
reduce the runtime for lockwood
melekderman Apr 9, 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
10 changes: 10 additions & 0 deletions mcdc/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@
NEUTRON_REACTION_FISSION = 4
NEUTRON_REACTION_FISSION_PROMPT = 5
NEUTRON_REACTION_FISSION_DELAYED = 6
ELECTRON_REACTION_TOTAL = 100
ELECTRON_REACTION_ELASTIC_SCATTERING = 101
ELECTRON_REACTION_ELASTIC_SMALL_ANGLE = 102
ELECTRON_REACTION_ELASTIC_LARGE_ANGLE = 103
ELECTRON_REACTION_IONIZATION = 104
ELECTRON_REACTION_BREMSSTRAHLUNG = 105
ELECTRON_REACTION_EXCITATION = 106

# Particle types
PARTICLE_NEUTRON = 0
Expand Down Expand Up @@ -176,7 +183,10 @@
# Physics
LIGHT_SPEED = 2.99792458e10 # cm/s
NEUTRON_MASS = 939.565413e6 # eV/c^2
ELECTRON_MASS = 510.99895069e3 # eV/c^2
BOLTZMANN_K = 8.61733326e-5 # eV/K
ELECTRON_CUTOFF_ENERGY = 100 # eV
MU_CUTOFF = 0.999999
THERMAL_THRESHOLD_FACTOR = 400

# Weight Windows Methods
Expand Down
27 changes: 26 additions & 1 deletion mcdc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ def preparation():
from mpi4py import MPI

from mcdc.object_.simulation import simulation
from mcdc.object_.material import MaterialMG
from mcdc.object_.material import (
Material,
MaterialMG,
set_elements_from_nuclides,
set_nuclides_from_elements,
update_fissionable_from_nuclides,
)

# ==================================================================================
# Adjust simulation settings as needed
Expand All @@ -145,11 +151,30 @@ def preparation():
# Get settings
settings = simulation.settings

# Set material compositions based on transported particles
for material in simulation.materials:
if not isinstance(material, Material):
continue

if settings.neutron_transport and len(material.nuclides) == 0:
set_nuclides_from_elements(material)

if settings.electron_transport and len(material.elements) == 0:
set_elements_from_nuclides(material)

# Set nuclear and atomic data for transported particles
if settings.neutron_transport:
for nuclide in simulation.nuclides:
nuclide.set_neutron_data()

for material in simulation.materials:
if isinstance(material, Material):
update_fissionable_from_nuclides(material)

if settings.electron_transport:
for element in simulation.elements:
element.set_electron_data()

# Set physics mode
if len(simulation.materials) == 0:
# Default physics in dummy mode
Expand Down
12 changes: 12 additions & 0 deletions mcdc/mcdc_get/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@

import mcdc.mcdc_get.tabulated_energy_angle_distribution as tabulated_energy_angle_distribution

import mcdc.mcdc_get.electron_reaction as electron_reaction

import mcdc.mcdc_get.electron_bremsstrahlung_reaction as electron_bremsstrahlung_reaction

import mcdc.mcdc_get.electron_elastic_scattering_reaction as electron_elastic_scattering_reaction

import mcdc.mcdc_get.electron_excitation_reaction as electron_excitation_reaction

import mcdc.mcdc_get.electron_ionization_reaction as electron_ionization_reaction

import mcdc.mcdc_get.element as element

import mcdc.mcdc_get.gpu_meta as gpu_meta

import mcdc.mcdc_get.native_material as native_material
Expand Down
3 changes: 3 additions & 0 deletions mcdc/mcdc_get/electron_bremsstrahlung_reaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The following is automatically generated by code_factory.py

from numba import njit
3 changes: 3 additions & 0 deletions mcdc/mcdc_get/electron_elastic_scattering_reaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The following is automatically generated by code_factory.py

from numba import njit
3 changes: 3 additions & 0 deletions mcdc/mcdc_get/electron_excitation_reaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The following is automatically generated by code_factory.py

from numba import njit
61 changes: 61 additions & 0 deletions mcdc/mcdc_get/electron_ionization_reaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# The following is automatically generated by code_factory.py

from numba import njit


@njit
def subshell_x_IDs(index, electron_ionization_reaction, data):
offset = electron_ionization_reaction["subshell_x_IDs_offset"]
return data[offset + index]


@njit
def subshell_x_IDs_all(electron_ionization_reaction, data):
start = electron_ionization_reaction["subshell_x_IDs_offset"]
size = electron_ionization_reaction["N_subshell_x"]
end = start + size
return data[start:end]


@njit
def subshell_x_IDs_last(electron_ionization_reaction, data):
start = electron_ionization_reaction["subshell_x_IDs_offset"]
size = electron_ionization_reaction["N_subshell_x"]
end = start + size
return data[end - 1]


@njit
def subshell_x_IDs_chunk(start, length, electron_ionization_reaction, data):
start += electron_ionization_reaction["subshell_x_IDs_offset"]
end = start + length
return data[start:end]


@njit
def subshell_product_IDs(index, electron_ionization_reaction, data):
offset = electron_ionization_reaction["subshell_product_IDs_offset"]
return data[offset + index]


@njit
def subshell_product_IDs_all(electron_ionization_reaction, data):
start = electron_ionization_reaction["subshell_product_IDs_offset"]
size = electron_ionization_reaction["N_subshell_product"]
end = start + size
return data[start:end]


@njit
def subshell_product_IDs_last(electron_ionization_reaction, data):
start = electron_ionization_reaction["subshell_product_IDs_offset"]
size = electron_ionization_reaction["N_subshell_product"]
end = start + size
return data[end - 1]


@njit
def subshell_product_IDs_chunk(start, length, electron_ionization_reaction, data):
start += electron_ionization_reaction["subshell_product_IDs_offset"]
end = start + length
return data[start:end]
32 changes: 32 additions & 0 deletions mcdc/mcdc_get/electron_reaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# The following is automatically generated by code_factory.py

from numba import njit


@njit
def xs(index, electron_reaction, data):
offset = electron_reaction["xs_offset"]
return data[offset + index]


@njit
def xs_all(electron_reaction, data):
start = electron_reaction["xs_offset"]
size = electron_reaction["xs_length"]
end = start + size
return data[start:end]


@njit
def xs_last(electron_reaction, data):
start = electron_reaction["xs_offset"]
size = electron_reaction["xs_length"]
end = start + size
return data[end - 1]


@njit
def xs_chunk(start, length, electron_reaction, data):
start += electron_reaction["xs_offset"]
end = start + length
return data[start:end]
Loading
Loading