TNL-SPH is an implementation of the Smoothed Particle Hydrodynamics Method using the Template Numerical Library. This repository contains a general framework for writing SPH-based solvers and a several simple examples that show ho to adapt the code for particular problem.
TNL-SPH is a high-performance Smoothed Particle Hydrodynamics code for simulations of free surface flow. It is verified an validated on standard SPH benchmarks, comparing the provided results with available experimental data. The main features are:
- Modular architecture with pluggable components (formulations, schemes, diffusive terms, viscous terms, boundary conditions etc).
-
$\delta$ -WCSPH, Boundary Integrals WCSPH and Riemann SPH formulations - Inlet and outlet boundary conditions.
-
- Optimized and efficient framework for general particle simulations allowing implementation of other particle methods.
- MultiGPU computations based on CUDA-aware MPI
- 1D domain decomposition using domain overlaps
-
Install Git.
-
Clone the repository:
git clone https://gitlab.com/tnl-project/tnl-sph -
Install the necessary tools and dependencies:
- CMake build system (version 3.28 or newer)
- CUDA toolkit (version 11 or newer)
- CUDA-aware MPI library – for distributed computing (tested with OpenMPI)
- compatible host compiler (e.g. GCC or Clang)
- Python 3 (including development header files)
- Python modules NumPy and Python VTK
- zlib (available in most Linux distributions)
-
Configure the build using
cmakein the root path of the Git repository:cmake -B build -S . <additional_configure_options...>This will use
buildin the current path as the build directory. The path for the-Soption corresponds to the root path of the project. You may use additional options to configure the build:-DCMAKE_BUILD_TYPE=<type>where<type>is one ofDebug,Release-DCMAKE_CUDA_ARCHITECTURES=<arch>– to build for a CUDA architecture other than "native"
-
Build the targets using
cmake:cmake --build build -
Run the example problem:
./examples/WCSPH-DBC/damBreak2D_WCSPH-DBC/run.pyThis will initialize the example using the default configuration prepared in the template file. Use the
--helpoption to see the options available ininit.pyandrun.py.
The TNL project welcomes and encourages participation by everyone. While most of the work for TNL involves programming in principle, we value and encourage contributions even from people proficient in other areas.
This section provides several areas where both new and experienced TNL users can contribute to the project. Note that this is not an exhaustive list.
- Join the code development. Our GitLab issues tracker collects ideas for new features, or you may bring your own.
- Help with testing and reporting problems. Testing is an integral part of agile software development which refines the code development. Constructive critique is always welcome.
- Contact us and provide feedback on GitLab. We are interested to know how and where you use TNL and the TNL-LBM module.
TNL-SPH is provided under the terms of the MIT License.