-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_thermal_scattering.py
More file actions
27 lines (21 loc) · 931 Bytes
/
_thermal_scattering.py
File metadata and controls
27 lines (21 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Helper function for building a fixed-source neutron transport OpenMC model
to stress thermal scattering.
"""
import openmc
def build_model(material : openmc.Material) -> openmc.Model:
# Large sphere with a single material
sphere = openmc.Sphere(r=100, boundary_type="vacuum")
geometry = openmc.Geometry([openmc.Cell(fill=material, region=-sphere)])
# Isotropic point source of 1 eV neutrons at the origin
source = openmc.IndependentSource()
source.space = openmc.stats.Point((0.0, 0.0, 0.0))
source.angle = openmc.stats.Isotropic()
source.energy = openmc.stats.delta_function(1.0)
source.particle = "neutron"
# Settings with fixed source run and uniform source
settings = openmc.Settings()
settings.batches = 10
settings.particles = 10_000
settings.run_mode = "fixed source"
settings.source = source
return openmc.Model(geometry=geometry, settings=settings)