Cross-Section Generation Framework
Texas A&M University:
Center for LArge-Scale Scientific Simulations
This repository houses several scripts to generate nuclear cross sections used in computational neutron transport. Beginning with ENDF/B files, the scripts allow a user to generate consistent MG (multigroup), FEDS (see below), and continuous-energy cross sections. Currently, NJOY is used to do most of the heavy-lifting. MG/FEDS cross sections are generated in PDT (see below) format. Continuous-energy cross sections are generated in the ACE format.
At the present time, capabilities are being coalesced and enhanced. Future capabilities will include generation of cross section covariance matrices in MG/FEDS format and ability to generate custom thermal treatments, such as bound-thermal (S(alpha,beta)) treatments with custom phonon spectra.
FEDS, or Finite-Element-with-Discontiguous-Support, is a new energy discretization method for particle transport. It is essentially MG with discontiguous energy groups. FEDS shares similarities to MB (multiband) methods, but has several distinct characteristics. A library of high-energy-resolution spectra "snapshots" is used to generate the FEDS energy mesh. FEDS cross sections can be used in existing MG transport codes without modification, provided those codes can handle upscattering.
References for FEDS:
- A. T. Till. Finite Elements with Discontiguous Support for Energy Discretization in Particle Transport. Ph.D. thesis, Texas A&M University, College Station, TX (2015).
PDT is a massively-parallel discrete-ordinates research transport code under development at Texas A&M University. For more information, see
- Efficient Massively-Parallel Transport Sweeps
- Provably Optimal Parallel Transport Sweeps on Regular Grids
- Validation of Full-Domain Massively Parallel Transport Sweep Algorithms
barnfire is distributed under the MIT license
There are three major components in the repository.
- src, which is a folder of Python scripts used to generate the NJOY input decks and to create the final MG/FEDS cross sections
- Cross section / data files, which are either downloaded automatically from LANL, or are in the repository here
- Dependencies, whose sources are again not in the repository, but which are necessary to run the Python scripts; links may be found in the following section
Using the Python codes requires you have the following installed on your system:
- parallel
- wget
- Python 2 (2.7.3 or later)
- Numpy (1.8.1 or later)
- Scipy (0.13.0 or later)
- sci-kit learn (0.16.1 or later)
- uncertainties (2.4.6 or later)
- nuclide-data
- iapws (steam tables, used in materials_materials.py)
- NJOY99.364 (used with materials_njoy.py, write_njoy.py, Readgroupr.py)
An example of how to run and produce FEDS XS is given in examples/create_xs.sh. Each input has several phases, to wit, specification of PDT materials and creation of NJOY input decks, determination of FEDS energy mesh, running of NJOY, and condensation of MG cross sections (XS) from NJOY into FEDS XS. RunProb calls combinations of materials, indicators, and indicators_clustering, which call Readgroupr and write_njoy.
This directory hosts several Python codes and a few shell scripts. Of note:
- RunProb.sh -- List of several example problem inputs.
- directories.py -- specifies directory locations where input data, problems, output data, and output figures may be found. You may need to export the locations of your scratch directory (
SCRATCH_BARN
), ENDF/B data (ENDF
), and NJOY executable (NJOY
). - materials.py -- Caller for a set of scripts with names
materials_*.py
that handle material specification (--njoy
option) and cross section generation (--bonderanko
option). Material specification mixes nuclides to generate a materials and creates NJOY input scripts for each unique nuclide in the problem. Cross section generation uses material specifications and interpolates MG GENDF files produced by NJOY into FEDS XS in PDT format. To get help, run./materials.py -h
- indicators.py -- Generates spectra that are used
either as inputs to the minimization problem, which produces the FEDS energy
mesh, or as the basis functions, which are used in XS condensation. Spectra
come in three flavors: the macroscopic total cross section, and solutions to
the infinite-medium, fixed-source, slowing-down equation, with or without
escape cross section. To get help, run
./indicators.py -h
- indicators_clustering.py -- Solves the minimization problem using clustering algorithms from machine learning. Can produce discontiguous (FEDS) or contiguous (MG) energy meshes. To get help, run
./indicators_clustering.h
- Readgroupr.py -- Set of functions for reading
nuclear data files, including ENDF, PENDF, and GENDF. Can read GENDF files,
interpolate in temperature and background cross section, condense from
subelements to (dis)contiguous elements, and print in PDT format. Called by
several
materials_*.py
modules. To get help, run./Readgroupr.py -h
- write_njoy.py -- Creates NJOY input files for one nuclide. NJOY processing is done in two steps: ENDF to PENDF and PENDF to GENDF. Called by materials_njoy.py
- First, download nuclide-data and put it in
dat
:
#!bash
cd dat
git clone https://github.com/attom/nuclide-data.git
cd ..
-
Then, be sure all the dependencies are met. IAPWS can be installed with
sudo pip install iapws
If you install it yourself, be sure that Python can find it. Specifically, be sure materials_materials.py can find it. -
Change your
.bashrc
,.cshrc
, etc. file to export the variablesSCRATCH_BARN
,ENDF
, andNJOY
SCRATCH_BARN
will house your output cross sections and other temporary filesENDF
will be where the raw ENDF/B and thermal ENDF/B files are housedNJOY
points to the directory withxnjoy
(Currently, NJOY99 patched to v364 is required)
-
Peruse directories.py and be sure it is pointing to the proper locations on your system
cluster, the local compute cluster for the Nuclear Engineering Department at Texas A&M University, has been set up with all required dependencies. You need to do the following to run on cluster:
-
Compile NJOY99 (the one on cluster is currently bad) and note the path to your NJOY executable,
xnjoy
. Call this location[NJOY_PATH]
-
Log onto cluster, and put the following near the beginning of your
.cshrc
or.bashrc
file:
module load gcc-4.9.1 lapack-3.5.0-gcc-4.9.1 python-2.7.8 gnu-parallel
For .cshrc
files, use:
setenv SCRATCH_BARN "/scratch/[username]/barnfire"
setenv ENDF "/scratch/[username]/endf"
setenv NJOY "[NJOY_PATH]
For .bashrc
files, use:
export SCRATCH_BARN=/scratch/[username]/barnfire
export ENDF=/scratch/[username]/endf
export NJOY=[NJOY_PATH]
Of course, you should replace [username]
with your username and [NJOY_PATH]
with the actual path to your NJOY executable.