Simulations are necessary when wanting to predict the nuclear response.
The best way to predict the future is to create it
The relative ease of install, permissive MIT licensing and Python API have contributed to the rising popularity of OpenMC.
Conda downloads
Paper citations
The workshop documentation is the best source of installation instructions.
https://fusion-energy.github.io/neutronics-workshop/docs/install_pip.html
Download the workshop.
git clone https://github.com/fusion-energy/neutronics-workshop.git cd neutronics-workshop
bash postBuild
Downloads the nuclear data cross sections and the decay data chain file to ~/nuclear_data.
~/nuclear_data
Materials can be made from:
In Jupyter Lab / Notebook try
Scores such as heating, heating-local (eV-barn) and damage-energy (eV-barn) are also available.
Try plotting the neutron energy distribution of an (n,2n) reaction.
github.com/fusion-energy/neutronics-workshop/issues/228
The simplest region is a single surface and a cell defined as below (-) that surface.
import openmc surface_sphere = openmc.Sphere(r=10.0) inside_sphere = -surface_sphere cell_sphere = openmc.Cell(region=inside_sphere) cell_sphere.fill = steel
Cells can also be constrained by multiple surfaces. This example is above (+) one surface and (&) below (-) another.
import openmc surf_sphere1 = openmc.Sphere(r=10.0) surf_sphere2 = openmc.Sphere(r=20.0) between_spheres = +surf_sphere1 & -surf_sphere2 cell_sphere = openmc.Cell(region=between_spheres) cell_sphere.fill = steel
The outermost surface of the model should have a boundary_type set to "vacuum" to indicate that neutrons should not be tracked beyond this surface.
boundary_type
"vacuum"
import openmc surf_sphere = openmc.Sphere(r=10.0, boundary_type="vacuum") region_inside_sphere = -surf_sphere cell_inside_sphere = openmc.Cell(region=region_inside_sphere) cell_inside_sphere.fill = steel
OpenMC supports classic CSG surface families, and there are many built in ways to view the geometry.
model.plot()
geometry.plot()
cell.plot()
region.plot()
RayTracePlot
There are also extra packages for viewing geometry:
Plot created with fusion-neutron-utils
A minimal settings object for fusion simulations.
Settings objects also accept variance reduction configurations, weight windows and volume calculation settings.
Link to OpenMC docs
settings = openmc.Settings( batches=10, particles=10000, photon_transport=True, run_mode='fixed source', source=my_source, )
A tally can record different scores. Many scores are available:
See the documentation for more information.
Tally filters are used to refine how and what a tally records.
The CellFilter tells the tally to record on a specific cell.
CellFilter
openmc.CellFilter([cell_1])
Modify task 6 so that you can access the tally.mean using apply_tally_results.
tally.mean
apply_tally_results
model.run(apply_tally_results=True)
openmc.model.Model documentation
Tally filters refine how and what a tally records.
EnergyFilter
ParticleFilter
openmc.EnergyFilter(np.linspace(0, 15e6, 719)) openmc.ParticleFilter(['neutron'])
The EnergyFunctionFilter tells the tally to multiply by a factor when scoring the particle, for example to convert flux to dose.
EnergyFunctionFilter
energy_function_filter = openmc.EnergyFunctionFilter( energy=energy_bins, y=dose_coeffs, interpolation="cubic", )
Two options for making the mesh, then use it in the tally as another filter type.
mesh = openmc.RegularMesh().from_domain( domain=geometry, dimension=[100, 100, 100], ) mesh_filter = openmc.MeshFilter(mesh) flux_tally.filters = [mesh_filter]
OpenMC supports:
OpenMC can generate weight windows using:
DAGMC lets OpenMC transport particles through CAD geometry converted to a surface mesh.
open_stellarator_models
Today simulation on CAD in OpenMC uses:
In the future, XDG will offer another option.
In addition to slice plots, the OpenMC plotter and the OpenMC geometry plot, there are two options specifically for DAGMC geometry viewing:
Unstructured meshes are currently available via two libraries.
In the future XDG will offer another option.
Perhaps the best part of OpenMC is the community.
Many more topics are covered in the neutronics workshop.
We are also considering making a 2 day fusion neutronics analysis workshop depending on demand and availability.
