-
Notifications
You must be signed in to change notification settings - Fork 665
Add delayed fission neutron emission #2898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e5cf31f
add mg speed access, adjust fission emission time
ilhamv ef0869b
clang-format
ilhamv 508fa13
fix traveled distance at time futoff
ilhamv ad07c3d
add delayed fission time
ilhamv c72f753
update docs: sampling delay time
ilhamv 08c883e
add settings:max_secondaries
ilhamv 14f96c9
update default max_secondaries at in finalize.cpp
ilhamv b548606
Merge branch 'openmc-dev:develop' into transient
ilhamv e388596
Update docs/source/methods/neutron_physics.rst
ilhamv 8c76b05
Merge branch 'openmc-dev:develop' into transient
ilhamv 5b665eb
Merge branch 'openmc-dev:develop' into transient
ilhamv f729e6a
add pulsed pincell example
ilhamv 9a922df
Merge branch 'transient' of https://github.com/ilhamv/openmc into tra…
ilhamv 9b17fa5
Merge branch 'openmc-dev:develop' into transient
ilhamv 6ca1ae0
debug mg_mode + collision_estimator + survival_biasing
ilhamv 718356f
Small fixes/updates
paulromano 960ed7d
Merge branch 'develop' into pr/ilhamv/2898
paulromano 6b2a92a
Add max_secondaries on settings unit test
paulromano 74c82c2
Fix C++ formatting on settings.cpp
paulromano aec938d
Merge branch 'openmc-dev:develop' into transient
ilhamv fb88089
Merge branch 'develop' into transient
ilhamv 447a6b1
Merge branch 'develop' into transient
ilhamv 3b6f4df
Merge branch 'develop' into transient
ilhamv cb73ddc
Merge branch 'develop' into transient
ilhamv a226095
Merge branch 'transient' of https://github.com/ilhamv/openmc into tra…
ilhamv b611eda
Merge branch 'openmc-dev:develop' into transient
ilhamv 5706fb7
Merge branch 'develop' into transient
ilhamv aac0168
Merge branch 'develop' into transient
ilhamv 2287d70
Merge branch 'develop' into pr/ilhamv/2898
paulromano 37c1f81
Update versionadded directive
paulromano 6c1df3b
Combine scripts in pincell_pulsed example
paulromano 2eed04e
Make sure parent/progeny_id are available when fission bank is stored
paulromano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,101 @@ | ||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
| import openmc | ||
|
|
||
| ############################################################################### | ||
| # Create materials for the problem | ||
|
|
||
| uo2 = openmc.Material(name="UO2 fuel at 2.4% wt enrichment") | ||
| uo2.set_density("g/cm3", 10.29769) | ||
| uo2.add_element("U", 1.0, enrichment=2.4) | ||
| uo2.add_element("O", 2.0) | ||
|
|
||
| helium = openmc.Material(name="Helium for gap") | ||
| helium.set_density("g/cm3", 0.001598) | ||
| helium.add_element("He", 2.4044e-4) | ||
|
|
||
| zircaloy = openmc.Material(name="Zircaloy 4") | ||
| zircaloy.set_density("g/cm3", 6.55) | ||
| zircaloy.add_element("Sn", 0.014, "wo") | ||
| zircaloy.add_element("Fe", 0.00165, "wo") | ||
| zircaloy.add_element("Cr", 0.001, "wo") | ||
| zircaloy.add_element("Zr", 0.98335, "wo") | ||
|
|
||
| borated_water = openmc.Material(name="Borated water") | ||
| borated_water.set_density("g/cm3", 0.740582) | ||
| borated_water.add_element("B", 2.0e-4) # 3x the original pincell | ||
| borated_water.add_element("H", 5.0e-2) | ||
| borated_water.add_element("O", 2.4e-2) | ||
| borated_water.add_s_alpha_beta("c_H_in_H2O") | ||
|
|
||
| ############################################################################### | ||
| # Define problem geometry | ||
|
|
||
| # Create cylindrical surfaces | ||
| fuel_or = openmc.ZCylinder(r=0.39218, name="Fuel OR") | ||
| clad_ir = openmc.ZCylinder(r=0.40005, name="Clad IR") | ||
| clad_or = openmc.ZCylinder(r=0.45720, name="Clad OR") | ||
|
|
||
| # Create a region represented as the inside of a rectangular prism | ||
| pitch = 1.25984 | ||
| box = openmc.model.RectangularPrism(pitch, pitch, boundary_type="reflective") | ||
|
|
||
| # Create cells, mapping materials to regions | ||
| fuel = openmc.Cell(fill=uo2, region=-fuel_or) | ||
| gap = openmc.Cell(fill=helium, region=+fuel_or & -clad_ir) | ||
| clad = openmc.Cell(fill=zircaloy, region=+clad_ir & -clad_or) | ||
| water = openmc.Cell(fill=borated_water, region=+clad_or & -box) | ||
|
|
||
| # Create a model and assign geometry | ||
| model = openmc.Model() | ||
| model.geometry = openmc.Geometry([fuel, gap, clad, water]) | ||
|
|
||
| ############################################################################### | ||
| # Define problem settings | ||
|
|
||
| # Set the mode | ||
| model.settings.run_mode = "fixed source" | ||
|
|
||
| # Indicate how many batches and particles to run | ||
| model.settings.batches = 10 | ||
| model.settings.particles = 10000 | ||
|
|
||
| # Set time cutoff (we only care about t < 100 seconds, see tally below) | ||
| model.settings.cutoff = {"time_neutron": 100} | ||
|
|
||
| # Create the neutron pulse source (by default, isotropic direction, t=0) | ||
| space = openmc.stats.Point() # At the origin (0, 0, 0) | ||
| energy = openmc.stats.delta_function(14.1e6) # At 14.1 MeV | ||
| model.settings.source = openmc.IndependentSource(space=space, energy=energy) | ||
|
|
||
| ############################################################################### | ||
| # Define tallies | ||
|
|
||
| # Create time filter | ||
| t_grid = np.insert(np.logspace(-6, 2, 100), 0, 0.0) | ||
| time_filter = openmc.TimeFilter(t_grid) | ||
|
|
||
| # Tally for total neutron density in time | ||
| density_tally = openmc.Tally(name="Density") | ||
| density_tally.filters = [time_filter] | ||
| density_tally.scores = ["inverse-velocity"] | ||
|
|
||
| # Add tallies to model | ||
| model.tallies = openmc.Tallies([density_tally]) | ||
|
|
||
|
|
||
| # Run the model | ||
| model.run(apply_tally_results=True) | ||
|
|
||
| # Bin-averaged result | ||
| density_mean = density_tally.mean.ravel() / np.diff(t_grid) | ||
|
|
||
| # Plot particle density versus time | ||
| fig, ax = plt.subplots() | ||
| ax.stairs(density_mean, t_grid) | ||
| ax.set_xscale("log") | ||
| ax.set_yscale("log") | ||
| ax.set_xlabel("Time [s]") | ||
| ax.set_ylabel("Total density") | ||
| ax.grid() | ||
| plt.show() |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.