-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from fusion-energy/develop
Adding support for unit conversion of damage tallies to DPA
- Loading branch information
Showing
18 changed files
with
607 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import openmc_post_processor as opp | ||
import openmc | ||
|
||
# loads in the statepoint file containing tallies | ||
statepoint = openmc.StatePoint(filepath="statepoint.2.h5") | ||
|
||
# gets one tally from the available tallies | ||
my_tally = statepoint.get_tally(name="2_damage-energy") | ||
|
||
|
||
# returns the tally with base units | ||
result = opp.process_damage_energy_tally( | ||
tally=my_tally, required_units="eV / simulated_particle" | ||
) | ||
print(f"damage-energy base units = {result}", end="\n\n") | ||
|
||
|
||
# returns the tally with scalled based units (MeV instead of eV) | ||
result, std_dev = opp.process_damage_energy_tally( | ||
tally=my_tally, | ||
required_units="MeV / simulated_particle" | ||
# required_units="displacements per atoms" | ||
) | ||
print(f"damage-energy scaled base units = {result}", end="\n\n") | ||
|
||
# # returns the tally with scalled based units (MeV instead of eV) | ||
result, std_dev = opp.process_damage_energy_tally( | ||
tally=my_tally, | ||
required_units="MeV", | ||
source_strength=1, | ||
) | ||
print(f"damage-energy scaled base units = {result}", end="\n\n") | ||
|
||
|
||
my_mat = openmc.Material() | ||
my_mat.add_element("Fe", 1) | ||
my_mat.set_density("g/cm3", 1) | ||
|
||
result, std_dev = opp.process_damage_energy_tally( | ||
tally=my_tally, | ||
required_units="MeV per atom", | ||
source_strength=1, | ||
volume=5, | ||
material=my_mat, | ||
) | ||
print(f"damage-energy scaled base units = {result}", end="\n\n") | ||
|
||
result, std_dev = opp.process_damage_energy_tally( | ||
tally=my_tally, | ||
required_units="displacements", | ||
source_strength=1, | ||
volume=5, | ||
material=my_mat, | ||
energy_per_displacement=10, | ||
recombination_fraction=0.1, | ||
) | ||
print(f"damage-energy = {result}", end="\n\n") | ||
|
||
result, std_dev = opp.process_damage_energy_tally( | ||
tally=my_tally, | ||
required_units="displacements per pulse", | ||
source_strength=0.5, | ||
volume=5, | ||
material=my_mat, | ||
energy_per_displacement=10, | ||
recombination_fraction=0.1, | ||
) | ||
print(f"damage-energy = {result}", end="\n\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
process_tally, | ||
process_dose_tally, | ||
process_spectra_tally, | ||
scale_tally | ||
process_damage_energy_tally, | ||
scale_tally, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.