Engineering
fluidsim avatar

fluidsim

Framework for high-performance computational fluid dynamics (CFD) simulations, supporting Navier-Stokes, shallow water, and stratified flows using pseudospectral methods and MPI parallelization.

Introduction

FluidSim is an advanced object-oriented Python framework designed for high-performance computational fluid dynamics (CFD) simulations. It is specifically optimized for solving periodic-domain equations using pseudospectral methods with Fast Fourier Transforms (FFT), providing computational performance levels comparable to C++ or Fortran while retaining the flexibility of the Python programming language. The skill is an ideal solution for researchers, fluid dynamicists, and engineers working on turbulence modeling, vortex dynamics, and geophysical flow studies. It simplifies the setup of complex simulations, from configuring physical parameters like viscosity and hyperviscosity to managing time-stepping schemes and initial conditions.

Key features and capabilities include:

  • Support for multiple specialized solvers including 2D/3D Navier-Stokes, stratified flows for atmospheric/oceanic modeling, and shallow water equations.
  • Native high-performance computing (HPC) features, including MPI-based parallelization for large-scale simulations and Pythran/Transonic compilation for optimized execution.
  • A complete, integrated simulation lifecycle workflow covering parameter definition, execution, output management, and post-processing.
  • Advanced diagnostic capabilities such as interactive plots for physical fields (velocity, vorticity), spatial means, and spectral energy analysis.
  • Flexible customization options allowing for user-defined forcing (e.g., time-correlated random forcing) and custom initial conditions via script injection.

Usage notes and practical implementation details:

  • Simulation data is typically exported in HDF5 format, which is compatible with industry-standard visualization tools like ParaView and VisIt.
  • Parameter configuration uses a hierarchical dot-notation object system that validates input, helping to prevent runtime errors during long-running compute jobs.
  • Users should manage simulation environments using the uv package manager and ensure appropriate feature flags (e.g., [fft, mpi]) are enabled for specific hardware requirements.
  • The workflow is designed for reproducibility, facilitating parametric studies where users can iteratively run simulations with varying viscosity or grid resolutions.
  • It is highly recommended to configure environment variables like FLUIDSIM_PATH and FLUIDDYN_PATH_SCRATCH to manage storage for simulation output directories and scratch working spaces effectively during high-throughput tasks.

Repository Stats

Stars
19,798
Forks
2,209
Open Issues
41
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
Apr 30, 2026, 04:07 PM
View on GitHub