Page 1 of 1

CAD-Based Neutron Transport Simulations

Posted: Tue Aug 18, 2020 11:20 pm
by Liam David
This is kind of a part 2 to the FAQ I wrote a while back: viewtopic.php?f=31&t=12906. The first section below is more an archive for my reference than a how-to, so it isn't too detailed.

I've been tinkering off and on with the neutron transport code OpenMC over the summer and decided to do a fresh install with one major upgrade: support for CAD models. As I mentioned in the original post, the standard installation of OpenMC uses constructive solid geometry (CSG) to generate models for simulation. Constructing simple shapes using boxes, cylinders, spheres, and boolean operations is simple enough, but for large, complex geometries this method quickly becomes untenable. The solution is DAGMC (Direct Accelerated Geometry Monte Carlo) which allows meshed CAD models to be used directly in neutron transport calculations and is an OpenMC/MCNP/etc. addon. It's found here: https://svalinn.github.io/DAGMC/. An additional improvement, through better package management, is that all the simulation setup, execution, and post-processing can be done through the Python interface, making for an easy-to-use system.

Installation:
It's a skip-able, boring section.
I installed Manjaro Linux on a separate drive on my computer to dual boot with Windows 10. The Anaconda package manager allows you to maintain multiple versions of software using isolated environments, which is very helpful in the event of corruption. It also links to open-source libraries containing most of the necessary code. I created a new environment called openmc_cad and installed the prerequisites listed in the following text file:

Install Steps.zip
(709 Bytes) Downloaded 256 times

It is important to note that OpenMC can be installed using Anaconda, but this version is pre-compiled and does not support CAD models. You must build OpenMC from the source to enable this feature. First, however, a number of libraries need to be symbolically linked or copied as listed in the text file. Seems to be a bug. Next, OpenMC is installed from the source. A few errors in the code, which may or may not exist due to whatever versions of OpenMC and dagmc are installed, are corrected and OpenMC is then compiled with the option -dagmc=on.

I download and extracted the standard neutron cross section libraries from https://openmc.org/official-data-libraries/.

Everything was verified working using the example models at https://docs.openmc.org/en/v0.12.0/exam ... geometries.

A few other programs are needed for the workflow:
1. CAD software such as Audodesk Fusion 360, Inventor, or SolidWorks
2. Coreform Trelis (trial for 30 days) to assign materials, imprint and merge, mesh, and export to a .cub file
3. ParaView (free) to view geometry, particle tracks, etc.

Model Preparation and Python Interface
This is also a skip-able, boring section unless you want the workflow details.
In CAD, add a thin shell surrounding the model that will act as a boundary for the simulation. Export the model as a STEP file (units must be cm) and bring it into Trelis. In the Trelis settings, set the default save file extension to .cub from .trelis. Materials are assigned using groups with the syntax "mat:name_of_material" where the name must match that defined in Python later. Assign the shell around the model to the group "mat:Graveyard". To prepare for meshing and remove duplicate surfaces and vertices, the run the following commands:

imprint body all
merge tol 5e-7
merge all

Generate a mesh first using the automatic meshing tool. If any bodies fail, use the tetmesh feature to generate a finer mesh. Run the command "compress ids" to remove any gaps in the geometry IDs and keep OpenMC happy. The model is ready for export. Save it as a .cub file, which should now be the default. In a terminal, run the command "mbconvert filename.cub dagmc.h5m". The filename must be exactly "dagmc.h5m" for OpenMC to find it. Now we are ready for the Python interface and defining the rest of the simulation parameters.

Running a simulation using Python code is pretty straightforward given the examples in the OpenMC documentation, so I won't go into that here.

Initial Simulations and Results
I modeled my fusor chamber and neutron detector and pushed it through the workflow to generate the dagmc.h5m file. The chamber is a 2.75" conflat 6-way cross with all sides blanked off (304SS). The moderator is 5cm OD x 1.9cm ID x 50.5cm L paraffin wax ([CH2]n). An aluminum housing encloses a SNM-18 tube which contains 97% 3He and 3% Ar at 4atm. A cross section of the assembly is given in the second image below. The square beams represent the 3030 aluminum frame that my fusor mounts to.

CAD model
CAD model

Green=Moderator; Teal=3He; Orange=Alumina; Black=Aluminum; Grey=304SS
Green=Moderator; Teal=3He; Orange=Alumina; Black=Aluminum; Grey=304SS

3D tally meshes were constructed enclosing the entire assembly and the moderator. Additional tallies counted (n,p) reactions in the 3He and scattering and such in the moderator. A monoenergetic, isotropic point neutron source of E = 2.4MeV was added to the center of the chamber. Two batches were run, each with 1e6 neutrons, and the results are plotted below. Tracks of 1000 particles were also generated.

Particle tracks are shown superimposed on the geometry:

Tracks
Tracks

Only neutrons that impact the moderator are displayed for clarity:

Notice scattering off the stainless steel chamber
Notice scattering off the stainless steel chamber

Scattering in the moderator is immediately apparent. Also, the stainless steel chamber scatters more neutrons per source neutron than the moderator, but normalizing by the flux removes the bias.

Non-normalized scattering
Non-normalized scattering

Normalized scattering
Normalized scattering

Normalized scattering
Normalized scattering

The reaction rate in the 3He is 0.00180 neutrons per source neutron. and its distribution within the SNM-18 tube is as follows:

(n,p) reaction rate
(n,p) reaction rate

(n,p) reaction rate
(n,p) reaction rate

Curiously, this is only about half the value obtained using the original CSG model, giving a calibration factor of TIER=9.27*CPM (i.e. 2x old TIER). The stainless chamber has an effect as the scattering plots show, but I need to do more simulations to determine the cause. Using the SNM-18 thermal neutron sensitivity of 0.7 as given by the manufacturer and Carl Willis' original moderator study as I linked in my FAQ post, I obtain a constant of 10.16, which is remarkably close. Given the different geometry (rectangular), however, using Carl's results are an order-of-magnitude check rather than a valid calibration factor. If this new factor is to be believed, my neutron rates are roughly twice what I've previously reported, giving the following as my best runs:

37kV, 11mA, 14.3mtorr, 300kCPM, 2.8e6n/s
33kV, 11mA, 17.0mtorr, 350kCPM, 3.2e6n/s
43kV, 15mA, 17.0mtorr, 300kCPM, 2.8e6n/s

If the voltages seem low for the output, I don't disagree, but these runs lasted at least 10 seconds before stuff got hot and the numbers dropped. Symmetry was also critical, as discussed in my update post. About 1" sq. indium was activated to 800CPM about 3s after shutoff at ~100kCPM output and 2 minutes exposure, so the numbers seem ballpark accurate based just off others' results.

That's all I have for the moment. I'm working on more simulations and will hopefully have some more analysis soon.

-Liam David