Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
bc25267
decode_ace_name works for protons
ethan-lame Apr 10, 2026
216440c
generate hdf5 files for proton data
ethan-lame Apr 14, 2026
a7e1d6b
Merge remote-tracking branch 'upstream/dev' into proton-dev
ethan-lame Apr 14, 2026
cd3a63a
proton values in constant.py
ethan-lame Apr 15, 2026
6a08870
add proton_reaction
ethan-lame Apr 15, 2026
aacb60d
add proton reactions to nuclide.py
ethan-lame Apr 15, 2026
e3869d9
add protons to mcdc/transport/physics
ethan-lame Apr 15, 2026
3e37c29
fixed an issue with ProtonReactionBase's MT assignment
ethan-lame Apr 23, 2026
ea7873a
use ACEtk to generate the hdf5 files from the proton ENDF70PROT data
ethan-lame Apr 23, 2026
d05ef5c
more proton stuff
ethan-lame Apr 23, 2026
488eb85
numba_types for proton stuff
ethan-lame Apr 23, 2026
815d521
get proton particle speed
ethan-lame Apr 23, 2026
9a1295a
initialize Nuclide attributes to reduce errors when running with only…
ethan-lame Apr 24, 2026
06b40c6
more proton capabilities; elastic & nonelastic rxns
ethan-lame May 8, 2026
420a6fb
proton energy cutoff
ethan-lame May 11, 2026
f6d88dc
CSDA support for proton transport
ethan-lame May 26, 2026
eee719a
refactored the CSDA functions to deposit energy every time the partic…
ethan-lame May 27, 2026
2f5e487
added CSDA setting to input deck
ethan-lame May 27, 2026
9702889
added a setting to change csda max fractional energy loss in the inpu…
ethan-lame May 28, 2026
45427f7
reformatting with black
ethan-lame Jun 3, 2026
127070f
file to generate h5 files from ACE & PSTAR; also, proton beam example
ethan-lame Jun 3, 2026
d47e06c
cleaning up examples & tools
ethan-lame Jun 3, 2026
c916643
cleaning up tools/data_library_generator
ethan-lame Jun 3, 2026
1e08474
remove proton secondary particle channel, for now
ethan-lame Jun 4, 2026
f602dac
updating documentation
ethan-lame Jun 4, 2026
0b981ed
Merge branch 'dev' into proton-dev
ethan-lame Jun 4, 2026
a610769
decode_ace_name works for protons
ethan-lame Apr 10, 2026
0f76772
generate hdf5 files for proton data
ethan-lame Apr 14, 2026
5e2e7e4
proton values in constant.py
ethan-lame Apr 15, 2026
ec8212f
add proton_reaction
ethan-lame Apr 15, 2026
6b521a8
add proton reactions to nuclide.py
ethan-lame Apr 15, 2026
21a2cc1
add protons to mcdc/transport/physics
ethan-lame Apr 15, 2026
69e4310
fixed an issue with ProtonReactionBase's MT assignment
ethan-lame Apr 23, 2026
e574ce0
use ACEtk to generate the hdf5 files from the proton ENDF70PROT data
ethan-lame Apr 23, 2026
e5bff22
more proton stuff
ethan-lame Apr 23, 2026
8e2d060
numba_types for proton stuff
ethan-lame Apr 23, 2026
f68b607
get proton particle speed
ethan-lame Apr 23, 2026
70b80b0
initialize Nuclide attributes to reduce errors when running with only…
ethan-lame Apr 24, 2026
8660d6a
more proton capabilities; elastic & nonelastic rxns
ethan-lame May 8, 2026
0a3b14c
proton energy cutoff
ethan-lame May 11, 2026
1e382eb
CSDA support for proton transport
ethan-lame May 26, 2026
5319497
refactored the CSDA functions to deposit energy every time the partic…
ethan-lame May 27, 2026
035e1a4
added CSDA setting to input deck
ethan-lame May 27, 2026
74dfef8
rebasing
ethan-lame Jun 4, 2026
69ad406
reformatting with black
ethan-lame Jun 3, 2026
521b71d
file to generate h5 files from ACE & PSTAR; also, proton beam example
ethan-lame Jun 3, 2026
966122a
cleaning up examples & tools
ethan-lame Jun 3, 2026
519a6b3
cleaning up tools/data_library_generator
ethan-lame Jun 3, 2026
25e9dc8
remove proton secondary particle channel, for now
ethan-lame Jun 4, 2026
40ac721
updating documentation
ethan-lame Jun 4, 2026
3924790
Merge branch 'proton-dev' of https://github.com/ethan-lame/MCDC-ethan…
ethan-lame Jun 4, 2026
1415321
csda functions now inside a conditional
ethan-lame Jun 8, 2026
4f2fa94
add mass number to proton data
ethan-lame Jun 8, 2026
479cc4d
minor fix to ww
ethan-lame Jun 8, 2026
76c2942
fixing stopping power initialization
ethan-lame Jun 8, 2026
04e1906
fixed initialization of stopping power
ethan-lame Jun 8, 2026
4b1caf8
add support for isotopes without cross section data
ethan-lame Jun 10, 2026
2bdff29
range straggling for protons
ethan-lame Jun 16, 2026
1e4a1e1
fix small-number errors with csda-only proton transport
ethan-lame Jun 16, 2026
39ec210
better energy deposition for protons
ethan-lame Jul 1, 2026
ae110ac
updated proton reactions to include capture & inelastic scatter (inst…
ethan-lame Jul 1, 2026
357fea9
updates to proton transport
ethan-lame Jul 15, 2026
c70ecf6
Merge remote-tracking branch 'upstream/dev' into proton-dev
ethan-lame Jul 15, 2026
945431c
refactor proton/native.py; update proton data generator
ethan-lame Jul 22, 2026
d4387c2
updated radiation length handling
ethan-lame Jul 23, 2026
2f3133c
remove old proton generator function
ethan-lame Jul 24, 2026
14a219e
cleaned up radiation_length calculation; added distribution handling …
ethan-lame Aug 6, 2026
74c50b5
cleaned up proton/generate.py
ethan-lame Aug 6, 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
11 changes: 9 additions & 2 deletions mcdc/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
# Miscellanies
EVENT_TIME_CENSUS = 1 << 5
EVENT_TIME_BOUNDARY = 1 << 6
EVENT_CSDA_EDEP = 1 << 7

# Materials
MATERIAL = 0
Expand All @@ -115,6 +116,10 @@
ELECTRON_REACTION_IONIZATION = 104
ELECTRON_REACTION_BREMSSTRAHLUNG = 105
ELECTRON_REACTION_EXCITATION = 106
PROTON_REACTION_TOTAL = 200
PROTON_REACTION_ELASTIC_SCATTERING = 201
PROTON_REACTION_CAPTURE = 202
PROTON_REACTION_INELASTIC_SCATTERING = 203

# Particle types
PARTICLE_NEUTRON = 0
Expand All @@ -138,12 +143,12 @@
DISTRIBUTION_TABULATED_ENERGY_ANGLE = 8
DISTRIBUTION_N_BODY = 9

# Anguler distribution type
# Angular distribution type
ANGLE_ISOTROPIC = 0
ANGLE_DISTRIBUTED = 1
ANGLE_ENERGY_CORRELATED = 2

# Referance frame
# Reference frame
REFERENCE_FRAME_LAB = 0
REFERENCE_FRAME_COM = 1

Expand Down Expand Up @@ -193,8 +198,10 @@
LIGHT_SPEED = 2.99792458e10 # cm/s
NEUTRON_MASS = 939.565413e6 # eV/c^2
ELECTRON_MASS = 510.99895069e3 # eV/c^2
PROTON_MASS = 938.27208943e6 # eV/c^2
BOLTZMANN_K = 8.61733326e-5 # eV/K
ELECTRON_CUTOFF_ENERGY = 100 # eV
PROTON_CUTOFF_ENERGY = 250000 # eV
MU_CUTOFF = 0.999999
THERMAL_THRESHOLD_FACTOR = 400

Expand Down
4 changes: 4 additions & 0 deletions mcdc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ def preparation():
if isinstance(material, Material):
update_fissionable_from_nuclides(material)

if settings.proton_transport:
for nuclide in simulationPy.nuclides:
nuclide.set_proton_data()

if settings.electron_transport:
for element in simulationPy.elements:
element.set_electron_data()
Expand Down
8 changes: 8 additions & 0 deletions mcdc/mcdc_get/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,18 @@

import mcdc.mcdc_get.neutron_inelastic_scattering_reaction as neutron_inelastic_scattering_reaction

import mcdc.mcdc_get.proton_capture_reaction as proton_capture_reaction

import mcdc.mcdc_get.proton_elastic_scattering_reaction as proton_elastic_scattering_reaction

import mcdc.mcdc_get.proton_inelastic_scattering_reaction as proton_inelastic_scattering_reaction

import mcdc.mcdc_get.collision_data as collision_data

import mcdc.mcdc_get.particle_bank as particle_bank

import mcdc.mcdc_get.proton_reaction as proton_reaction

import mcdc.mcdc_get.settings as settings

import mcdc.mcdc_get.global_weight_roulette as global_weight_roulette
Expand Down
58 changes: 58 additions & 0 deletions mcdc/mcdc_get/native_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,61 @@ def element_densities_chunk(start, length, native_material, data):
start += native_material["element_densities_offset"]
end = start + length
return data[start:end]


@njit
def stopping_power(index, native_material, data):
offset = native_material["stopping_power_offset"]
return data[offset + index]


@njit
def stopping_power_all(native_material, data):
start = native_material["stopping_power_offset"]
size = native_material["stopping_power_length"]
end = start + size
return data[start:end]


@njit
def stopping_power_last(native_material, data):
start = native_material["stopping_power_offset"]
size = native_material["stopping_power_length"]
end = start + size
return data[end - 1]


@njit
def stopping_power_chunk(start, length, native_material, data):
start += native_material["stopping_power_offset"]
end = start + length
return data[start:end]


@njit
def stopping_power_energy_grid(index, native_material, data):
offset = native_material["stopping_power_energy_grid_offset"]
return data[offset + index]


@njit
def stopping_power_energy_grid_all(native_material, data):
start = native_material["stopping_power_energy_grid_offset"]
size = native_material["stopping_power_energy_grid_length"]
end = start + size
return data[start:end]


@njit
def stopping_power_energy_grid_last(native_material, data):
start = native_material["stopping_power_energy_grid_offset"]
size = native_material["stopping_power_energy_grid_length"]
end = start + size
return data[end - 1]


@njit
def stopping_power_energy_grid_chunk(start, length, native_material, data):
start += native_material["stopping_power_energy_grid_offset"]
end = start + length
return data[start:end]
Loading