-
Notifications
You must be signed in to change notification settings - Fork 3
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 #39 from fusion-energy/change_from_extending_class…
…_to_functions change package to user functions instead of extending openmc classes
- Loading branch information
Showing
13 changed files
with
120 additions
and
115 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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import openmc | ||
import openmc_source_plotter # overwrites the openmc.source method | ||
from openmc_source_plotter import plot_source_direction | ||
|
||
# initializes a new source object | ||
my_source = openmc.Source() | ||
my_source = openmc.IndependentSource() | ||
|
||
# sets the direction to isotropic | ||
my_source.angle = openmc.stats.Isotropic() | ||
|
||
# plots the particle energy distribution | ||
plot = my_source.plot_source_direction(n_samples=200) | ||
plot = plot_source_direction(this=my_source, n_samples=200) | ||
|
||
plot.show() |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import openmc | ||
import openmc_source_plotter # overwrites the openmc.source method | ||
from openmc_source_plotter import plot_source_energy | ||
|
||
# initialise a new source object | ||
my_source = openmc.Source() | ||
my_source = openmc.IndependentSource() | ||
|
||
# sets the energy distribution to a Muir distribution neutrons | ||
my_source.energy = openmc.stats.Muir(e0=14080000.0, m_rat=5.0, kt=20000.0) | ||
# sets the energy distribution to a muir distribution neutrons | ||
my_source.energy = openmc.stats.muir(e0=14080000.0, m_rat=5.0, kt=20000.0) | ||
|
||
# plots the particle energy distribution | ||
plot = my_source.plot_source_energy(n_samples=10000) | ||
plot = plot_source_energy(this=my_source, n_samples=10000) | ||
|
||
plot.show() |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import openmc | ||
import openmc_source_plotter # overwrites the openmc.source method | ||
from openmc_source_plotter import plot_source_energy | ||
|
||
# initialises a new source object | ||
my_dt_source = openmc.Source() | ||
|
||
# sets the energy distribution to a Muir distribution DT neutrons | ||
my_dt_source.energy = openmc.stats.Muir(e0=14080000.0, m_rat=5.0, kt=20000.0) | ||
# sets the energy distribution to a muir distribution DT neutrons | ||
my_dt_source.energy = openmc.stats.muir(e0=14080000.0, m_rat=5.0, kt=20000.0) | ||
|
||
# initialises a new source object | ||
my_dd_source = openmc.Source() | ||
# sets the energy distribution to a Muir distribution DD neutrons | ||
my_dd_source.energy = openmc.stats.Muir(e0=2080000.0, m_rat=2.0, kt=20000.0) | ||
# sets the energy distribution to a muir distribution DD neutrons | ||
my_dd_source.energy = openmc.stats.muir(e0=2080000.0, m_rat=2.0, kt=20000.0) | ||
|
||
# plots the particle energy distribution | ||
figure1 = my_dd_source.plot_source_energy(n_samples=10000) | ||
figure2 = my_dt_source.plot_source_energy(figure=figure1, n_samples=10000) | ||
figure1 = plot_source_energy(this=my_dd_source, n_samples=10000) | ||
figure2 = plot_source_energy(this=my_dt_source, figure=figure1, n_samples=10000) | ||
|
||
figure2.show() |
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.