NS2D is a Python package for simulating two-dimensional turbulence on the torus.
-
NS2D is transparent. The core modules are written in high-level Python, meaning it's easy to see how the model works. Users specify explicitly which mechanisms they want in their model, such as types of dissipation and forcing, allowing for a range of model variations. In geophysical terms we solve the barotropic vorticity equation with the option of a beta plane configuration.
-
GPU compatibility. NS2D runs on GPU. Pseudo-spectral solvers like this one rely on fast FFT implementations to be fast. Through CuPy we exploit NVIDIA's highly optimised cuFFT library without any complicated bookkeeping.
NS2D borrows heavily from existing pseudo-spectral turbulence models, especially the pyqg project. While it is currently a single layer model with a square domain, its extension to general rectangular n-layer configurations would likely be straightforward.
Note that an earlier (much slower) CPU version of NS2D, which relies on pyfftw, is available as v1.0.0.