mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
updated docs to use IndependentSource (#2604)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
50c3103ca3
commit
6de37ebc0b
2 changed files with 10 additions and 8 deletions
|
|
@ -225,7 +225,7 @@ distributed over a cube centered at the origin with an edge length of 10 cm, and
|
|||
emitting a pulse of particles from 0 to 10 µs, one
|
||||
would run::
|
||||
|
||||
source = openmc.Source()
|
||||
source = openmc.IndependentSource()
|
||||
source.space = openmc.stats.Box((-5, -5, -5), (5, 5, 5))
|
||||
source.angle = openmc.stats.Isotropic()
|
||||
source.energy = openmc.stats.Discrete([10.0e6], [1.0])
|
||||
|
|
@ -237,11 +237,11 @@ that indicates the relative strength of a source distribution if multiple are
|
|||
used. For example, to create two sources, one that should be sampled 70% of the
|
||||
time and another that should be sampled 30% of the time::
|
||||
|
||||
src1 = openmc.Source()
|
||||
src1 = openmc.IndependentSource()
|
||||
src1.strength = 0.7
|
||||
...
|
||||
|
||||
src2 = openmc.Source()
|
||||
src2 = openmc.IndependentSource()
|
||||
src2.strength = 0.3
|
||||
...
|
||||
|
||||
|
|
@ -251,7 +251,7 @@ Finally, the :attr:`Source.particle` attribute can be used to indicate the
|
|||
source should be composed of particles other than neutrons. For example, the
|
||||
following would generate a photon source::
|
||||
|
||||
source = openmc.Source()
|
||||
source = openmc.IndependentSource()
|
||||
source.particle = 'photon'
|
||||
...
|
||||
|
||||
|
|
@ -266,7 +266,7 @@ File-based Sources
|
|||
OpenMC can use a pregenerated HDF5 source file by specifying the ``filename``
|
||||
argument to :class:`openmc.Source`::
|
||||
|
||||
settings.source = openmc.Source(filename='source.h5')
|
||||
settings.source = openmc.IndependentSource(filename='source.h5')
|
||||
|
||||
Statepoint and source files are generated automatically when a simulation is run
|
||||
and can be used as the starting source in a new simulation. Alternatively, a
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ def sphere_model():
|
|||
model.settings.batches = 5
|
||||
model.settings.particles = 100
|
||||
model.settings.photon_transport = True
|
||||
model.settings.source = openmc.Source(space=openmc.stats.Point(),
|
||||
energy=openmc.stats.Discrete([1e6],[1]),
|
||||
particle='photon')
|
||||
model.settings.source = openmc.IndependentSource(
|
||||
space=openmc.stats.Point(),
|
||||
energy=openmc.stats.Discrete([1e6], [1]),
|
||||
particle='photon'
|
||||
)
|
||||
|
||||
# Define tallies
|
||||
tally = openmc.Tally(name="pht tally")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue