villano-lab / ntransporter

Neutron transport code for background analysis.
MIT License
0 stars 0 forks source link

ntransporter v2.0

Neutron transport code for background analysis.

Overview

This code calculates the neutron flux in an infinite slab of material using the multigroup diffusion approximation with zeroth-order evaluated group constants (see below for description of this approximation).

Directory Structure

This repository is divided into several directories by functionality. The overall repository structure is:

|- ntransporter/
|---- boundary_conditions/
|---- cross_sections/
|---- include/
|---- process_reader/
|---- sources/
|---- src/

More details on each top-level subdirectory can be found in individual README's.

Build Instructions

Dependencies

The following packages must be installed/configured before building ntransporter:

[!NOTE] Geant4 must be built in multithreaded mode in order to interface correctly with ntransporter. One should set the cmake flag GEANT4_BUILD_MULTITHREADED=ON during compilation of Geant4

Depending on the system, SuperSim may require some additional packages to be correctly installed/configured. See also the external package guide. These include:

Environment variables

A few environment variables (denoted by $ before the variable name) must be set before compiling ntransporter (in addition to the ones either set or required by the SuperSim configuration process, e.g., $CDMS_INSTALL, $ROOTSYS, or $G4WORKDIR). These are:

cmake variables

cmake requires some variables giving paths to important files or other programs be set correctly in order to compile:

Some other optional cmake options can be used to personalize the build:

These options can be set when calling cmake or by modifying the CMakeCache.txt file in the build directory directly. All but REGEN_CDMSVERSION will be saved in CMakeCache.txt for subsequent calls of cmake.

Building the program

The ntransporter program uses cmake utility to compile and build the executables in the program. Note that several steps in the cmake script require using the linux shell.

To build the program, make a build directory. For these examples, it's assumed the build directory is located inside the top-level ntransporter directory:

$ cd ntransporter
$ mkdir build
$ cd build

Once the environment variables are correctly set up, the dependencies configured, and the necessary cmake variables set, cmake can be run, e.g.,

cmake -DFORCE_LIBUUID_LINK=ON -DCVODE_LIB_FOLDER="lib64" -DCXX_STD=17 ../

If this is successful, make all targets:

make all

This will build all executables in ntransporter into the build directory.

Alternatively, one can build each executable individually, e.g.,

make NT_Src

Executables Quick Guide

An overview of the executables built by ntransporter is given here. In general, the executables built by ntransporter begin with "NT_".

Note About Outputs

The repository currently includes many output files from the executables in data/V1 and data/V2 directories under the subdirectory of the corresponding executable, e.g., ntransporter/sources/data/V1 contains files generated with the NT_Src executable.

Top-level files

The top-level ntransporter/ directory contains the following files:

Version 2 Physics - Zero-Temperature Multigroup Diffusion Approximation with Zeroth-Order Evaluated Group Constants

The full neutron transport equation is:

$\frac{1}{v}\frac{\partial \psi}{\partial t} + \boldsymbol{\hat{\Omega}} \cdot \nabla \psi + \Sigmat \psi = s + \int{4\pi} d\boldsymbol{\Omega'} \int_0^\infty dE' \Sigma_s(E'\rightarrow E, \boldsymbol{\hat{\Omega}'}\rightarrow\boldsymbol{\hat{\Omega}}) \psi (E',\boldsymbol{\hat{\Omega}'})$

where

$\boldsymbol{r}=$ position

$E =$ energy

$\boldsymbol{\hat{\Omega}} =$ direction of neutron travel

$t =$ time

$v=$ neutron velocity

$\psi = \psi(\boldsymbol{r}, E, \boldsymbol{\hat{\Omega}},t) =$ angular neutron flux (neutrons per unit time per unit area per unit energy per unit solid angle)

$\Sigma_t = \Sigma_t(\boldsymbol{r}, E) =$ total neutron cross section (scattering plus absorption), units of inverse length

$s=s(\boldsymbol{r},E,\boldsymbol{\hat{\Omega}})=$ neutron source (neutrons per unit time per unit volume per unit energy per unit solid angle)

$\Sigma_s(E'\rightarrow E,\boldsymbol{\hat{\Omega}'}\rightarrow\boldsymbol{\hat{\Omega}})$ $=\Sigma_s(E,E',\boldsymbol{\hat{\Omega}'}\cdot\boldsymbol{\hat{\Omega}})=$ scattering cross section from primed to unprimed state (differential over final direction and final energy)

To move to the neutron diffusion equation, we first define the scalar flux $\phi$:

$\phi(E) \equiv \int_{4\pi} \psi(E,\boldsymbol{\hat{\Omega}}) d\boldsymbol{\Omega} $

and the neutron current density $\boldsymbol{J}$:

$\boldsymbol{J}(E) \equiv \int_{4\pi} \boldsymbol{\hat{\Omega}} \psi(E,\boldsymbol{\hat{\Omega}}) d\boldsymbol{\Omega}$

(both with units neutrons per unit time per unit area per unit energy) and make two physical assumptions.

First, assume the angular flux $\psi$ can be modelled sufficiently with linear anisotropy:

$\psi(\boldsymbol{\hat{\Omega}}) \approx \frac{1}{4\pi} \phi + \frac{3}{4\pi} \boldsymbol{J}\cdot \boldsymbol{\hat{\Omega}}$

Second, assume the neutron current density $\boldsymbol{J}$ is proportional to the gradient of the scalar flux ("Fick's Law"):

$\boldsymbol{J} = [3(\Sigma_t-\bar{\mu}_0\Sigma_s)]^{-1} \nabla \phi \equiv -D(E)\nabla\phi(E)$

Additional physical assumptions: isotropic scattering and isotropic sources:

$\Sigma_s(E'\rightarrow E, \boldsymbol{\hat{\Omega}'}\rightarrow\boldsymbol{\hat{\Omega}}) = \frac{1}{4\pi}\Sigma_s(E'\rightarrow E)$

$s(\boldsymbol{\hat{\Omega}},E) = \frac{1}{4\pi}S(E)$

where $S(E)=S(\boldsymbol{r}, E, t)$ is the scalar source.

Now if we integrate over solid angle $\boldsymbol{\Omega}$, the transport equation becomes the diffusion equation:

$\frac{1}{v}\frac{\partial \phi}{\partial t} - \nabla D(E) \nabla \phi(E) + \Sigma_t(E) \phi(E) = S(E) + \int_0^\infty dE' \Sigma_s(E'\rightarrow E) \phi (E')$

The Multigroup Approximation

We now define a series of $G$ energy intervals called "groups" delineated by the energies $Eg$, where $0\leq g\leq G$, such that $E{g+1} < Eg \forall g$. Group $g$ refers to the range of energies $E{g} \leq E \leq E_{g-1}$. $E_0$ corresponds to the maximum energy attainable by neutrons in the system (for radiogenic neutrons, $E_0\sim$ 20 MeV), and $E_G$ corresponds to the minimum energy of interest, typically thermal energies. Introduce the notation for integrating over group $g$:

$\intg dE \cdots \equiv \int{E{g}}^{E{g-1}} dE \cdots$

Integrating the diffusion equation over group $g$ then yields the multigroup diffusion equation:

$\frac{1}{v_g}\frac{\partial \phi_g}{\partial t} - \nabla \cdot D_g \nabla \phig + \Sigma{tg} \phi_g = Sg + \sum\limits{g'=1}^{\infty} \Sigma{sg'g} \phi{g'}$

where we've defined the group flux $\phi_g$:

$\phi_g \equiv \int_g dE \phi(E)$

and the group source $S_g$:

$S_g \equiv \int_g dE S(E)$

and where we've defined the following "group constants:"

$\hspace{5ex}\Sigma_{tg} \equiv \frac{1}{\phi_g} \int_g dE \Sigma_t(E) \phi(E)$

$\hspace{5ex}D_{gj} \equiv \frac{\int_g dE D(E) \nabla_j \phi(E) }{\int_g dE \nabla_j \phi(E)}$

$\hspace{5ex}\frac{1}{v_g} \equiv \frac{1}{\phi_g}\int_g dE \frac{1}{v}\phi(E)$

$\hspace{5ex}\Sigma{sg'g} \equiv \frac{1}{\phi{g'}} \intg dE \int{g'} dE' \Sigma_s(E'\rightarrow E) \phi(E')$

Also note the spatial derivative term should be expanded as the following:

$\nabla \cdot D_g \nabla \phi_g = \sum\limits_j \nablaj D{gj} \nabla_j \phi_g$

Note on Group Structure

We consider a group structure with fast groups between 0.1 eV and 20 MeV and a single thermal group below 0.1 eV. The actual numerical value of the lower bound of the thermal group is set to 1e-7 eV

Given these specifications, a grouping (set of group boundaries) is specified by the number of fast groups. In the code this is what G refers to, while $G$ in the derivations here usually refers to the total number of groups, G+1.

With these in place, the bounds of the fast groups are $E_G$ = 0.1 eV and $E_0$ = 20 MeV, and any particular group boundary can be calculated as $E_g=E_0\beta^g$, where $\beta=(E_G/E_0)^{1/G}$

The Slowing-Down Equation

From the neutron diffusion equation, we consider the steady-state, infinite medium case, and so can drop the time and spatial derivatives, resulting in the "slowing down equation:"

$\Sigma_t(E) \phi(E) = S(E) + \int_0^{\infty} dE' \Sigma_s(E'\rightarrow E) \phi (E')$

where now everything is only a function of energy.

Once again integrating over group $g$, we arrive at the multigroup slowing down equation:

$\Sigma_{tg} \phi_g = Sg + \sum\limits{g'=1}^{\infty} \Sigma{sg'g} \phi{g'}$

Zero-Temperature Approximation

In the zero-temperature approximation, it is impossible for a neutron to increase in energy (decrease in group number) after a collision, so the multigroup slowing down equation becomes:

$(\Sigma{tg} -\Sigma{sgg})\phi_g = Sg + \sum\limits{g'=1}^{g-1} \Sigma{sg'g} \phi{g'}$

Evaluating Group Constants

The evaluation of most group constants requires knowledge of the flux $\phi(E)$. We use a zeroth-order approximation for fast groups of $\phi(E)\propto 1/E$, the derivation of which relies on the following approximations:

These above assumptions result in an asymptotic solution $\phi(E)\propto \frac{1}{\Sigma_s(E) E}$ (note also this is the form used to derive the approximations for the self-scattering fraction $q$ above). We then neglect the variation in $\Sigma_s(E)$ over the group: $\phi(E)\propto \frac{1}{E}$.

For the thermal group, we assume a Maxwell-Boltzmann distribution at room temperature (0.0257 eV).

More details on evaluating the differential cross sections $\Sigma_{sg'g}$ can be found in the cross_sections documentation.