Skip to main content

A 0D Direct Simulation Monte-Carlo code for the calculation of transport coefficients and 0D gas modeling.

Project description

ThunderBoltz

CI/CD PyPI Latest Release License - BSD 3-Clause Documentation Status

ThunderBoltz 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 article: Ryan Park et al 2024 Plasma Sources Sci. Technol. 33 095007.

Documentation

The 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 at here.

Installation

Pip Installation

The Python API can be installed via pip.

pip install thunderboltz

This package ships with the C++ ThunderBoltz source and requires only a gcc compiler to run complete calculations.

Clone the repository

The code can also be downloaded from the repository.

git clone https://github.com/lanl/ThunderBoltz.git

You may need to set up SSH keys in order to access Github. See the Gitlab SSH Guide to set up access to Github repositories.

The basic ThunderBoltz functionality will be available either as an executable in bin/thunderboltz.bin or can be compiled from the source in src/thunderboltz/cpp. To install the Python interface, run the install.sh script from the root directory.

./install.sh

This will upgrade pip and install specific versions of Python packages, so create an environment if you are concerned with Python package overwrite.

Usage

For 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 in src/thunderboltz/cpp/. ThunderBoltz requires a g++ of clang compiler and should be compiled from source directories as

g++ -std=c++17 -o thunderboltz.bin DSMC0D.cpp

Then run with

./thunderboltz.bin inputfile.in

to use a manually constructed indeck file. The code is maintained with the standard -Wall and -Werror compiler 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/ac_field/* .
# Compile
g++ -std=c++17 -o thunderboltz.bin DSMC0D.cpp
# Run
./thunderboltz.bin N2vib.in

Simulation parameters can be adjusted in the N2vib.in file for this example.

Using the Python wrapper

We 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), run

pip install thunderboltz

To install the Python API from the repository, run the install.sh script from the root directory:

./install.sh

This will upgrade pip and install specific versions of Python packages, so create an environment if you are concerned with Python package overwrite.

See run.py for implementations of the tests found in the paper using the API wrapper.

Testing and code sync

Make sure a version of pytest is installed:

pip install pytest

To run unit tests on the Python thunderboltz, make sure thunderboltz has been installed, and

python -m pytest testing/*.py --verbose

To recompile the standalone binary version, run

g++ -std=c++17 src/thunderboltz/cpp/DSMC0D.cpp -o bin/thunderboltz.bin -Wall -Werror -Wsign-compare

License

ThunderBoltz is distributed under a GNU GPLv3 license. See http://www.gnu.org/licenses/gpl-3.0.en.html for more details.

Roadmap

  • Regression testing of internal ThunderBoltz code
  • Random deletion after ionization option
  • Addition of photon transport
  • Optional particle re-weigting
  • Disorder-induced heating

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thunderboltz-0.4.4.tar.gz (130.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thunderboltz-0.4.4-py3-none-any.whl (136.4 kB view details)

Uploaded Python 3

File details

Details for the file thunderboltz-0.4.4.tar.gz.

File metadata

  • Download URL: thunderboltz-0.4.4.tar.gz
  • Upload date:
  • Size: 130.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for thunderboltz-0.4.4.tar.gz
Algorithm Hash digest
SHA256 bc7c7d197b9def624df5508c9b1fb8d79ddeebf8807d97c97dd8b8df17529606
MD5 6e6e1f325fa30475b0f657c26c32d845
BLAKE2b-256 e6c54d421e060caeec463e1e887304c300736fe10863582f1919df724aab7789

See more details on using hashes here.

File details

Details for the file thunderboltz-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: thunderboltz-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 136.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for thunderboltz-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7a96733c95ab3b6154232e97c0ece1e2be6df049d03ffeae7e5605b42d95f88a
MD5 45222b97a7bd2cb774917ffc1ad10714
BLAKE2b-256 c6f5402719714e15737f2e800bf620d3888842be22f33987b2a8cbda446b1a37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page