Package: thunderboltz
ThunderBoltzThunderBoltz is a 0D Direct Simulation Monte-Carlo code for the calculation of transport
coefficients and 0D gas modeling. This repository contains the ThunderBoltz C++ source code (C22063)
and ThunderBoltz Python API code (O4674), which are released with a GPL v3 license.
The overarching goal of this project is to provide
transport coefficients for electrons, ions and neutrals, and to model energy transfer
between charged particles and neutral gases. These processes are not modeled by
commonly used Boltzmann solvers such as Bolsig+ or MagBoltz since these solvers only
track electron transport (either via trajectories in the MC case, or through modeling
of the EEDF) due to collisions with a stationary neutral background.To reference this code and work, please cite the arXiv article:https://arxiv.org/abs/2310.07913DocumentationThe ThunderBoltz C++ source code manual is found in the home directory
"cpp_manual.pdf", and the Python API code manual is found in the home directory
"api_manual.pdf". The online API documentation can be found athere.InstallationPip InstallationThe Python API can be installed viapip.pip install thunderboltzClone the repositoryThe code can also be downloaded from the repository.git clone https://github.com/lanl/ThunderBoltz.gitYou may need to set up SSH keys in order to access Github. See theGitlab SSH Guideto set up access to Github repositories.The basic ThunderBoltz functionality will be available either
as an executable inbin/thunderboltz.binor can be compiled from the
source insrc/thunderboltz/cpp. To install the Python interface, run theinstall.shscript from the root directory../install.shThis will upgradepipand install specific versions of Python packages,
so create an environment if you are concerned with Python package overwrite.UsageFor ease of use, we recommend using the Python interface to setup, run,
and process simulations (see here).
Alternatively, one can use the stand-alone C++
code to run calculations (below).Manual compilation and execution (ThunderBoltz code only)The C++ source files are located insrc/thunderboltz/cpp/.
ThunderBoltz requires a g++ of clang compiler and should be compiled
from source directories asg++ -std=c++17 -o thunderboltz.bin DSMC0D.cppThen run with./thunderboltz.bin inputfile.into use a manually constructed indeck file. The code is maintained with the
standard-Walland-Werrorcompiler options.Here is an example of how to run a simple ThunderBoltz calculation.# Make a directory for testing
mkdir example_sim
cd example_sim
# Copy the source over
cp ../src/thunderboltz/cpp/* .
# Copy example input files over
cp -r ../indecks/N2/* .
# Compile
g++ -std=c++17 -o thunderboltz.bin DSMC0D.cpp
# Run
./thunderboltz.bin N2vib.inSimulation parameters can be adjusted in theN2vib.infile for this example.Using the Python wrapperWe also include a Python wrapper that allows for automated compilation
and extended input/output processing. To install the Python API from
the online Python index (PYPI), runpip install thunderboltzTo install the Python API from the
repository, run theinstall.shscript from the root directory:./install.shThis will upgradepipand install specific versions of Python packages,
so create an environment if you are concerned with Python package overwrite.Seerun.pyfor implementations of the tests found in the paper
using the API wrapper.Testing and code syncMake sure a version of pytest is installed:pip install pytestTo run unit tests on the Pythonthunderboltz,
make surethunderboltzhas been installed, andpython -m pytest testing/*.py --verboseTo recompile the standalone binary version, rung++ -std=c++17 src/thunderboltz/cpp/DSMC0D.cpp -o bin/thunderboltz.bin -Wall -Werror -Wsign-compareLicenseThunderBoltz is distributed under a GNU GPLv3 license. Seehttp://www.gnu.org/licenses/gpl-3.0.en.htmlfor more details.RoadmapRegression testing of internal ThunderBoltz codeDiffusion post processingRandom deletion after ionization optionAddition of photon transportOptional particle reweigting