fluidsim

Framework for computational fluid dynamics simulations using Python. Use when running fluid dynamics simulations including Navier-Stokes equations (2D/3D), shallow water equations, stratified flows, or when analyzing turbulence, vortex dynamics, or geophysical flows. Provides pseudospectral methods with FFT, HPC support, and comprehensive output analysis.

Install

Hot:6

Download and extract to your skills directory

Copy command and send to AI Agent for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-skills-fluidsim&locale=en&source=copy

FluidSim – A High-Performance Python Computational Fluid Dynamics Framework

Overview of Capabilities

FluidSim is an object-oriented, high-performance Python computational fluid dynamics (CFD) framework. It provides equation solvers for periodic domains based on pseudo-spectral methods and FFTs, delivering near-Fortran/C++ computational performance while retaining Python’s ease of use.

Applicable Scenarios

1. Turbulence and Vortex Dynamics Research

When studying phenomena such as 2D or 3D turbulence, vortex evolution, and energy cascades, FluidSim provides complete Navier–Stokes solvers and supports an end-to-end workflow ranging from low-resolution validation to high-resolution production runs. Its built-in energy spectrum analysis and spatial statistics tools can be used directly to characterize turbulence.

2. Ocean and Atmospheric Flow Simulation

For scenarios such as stratified flows, shallow-water equation simulations, and geophysical flows, FluidSim provides specialized solvers (such as ns2d.strat and sw1l). It supports configuration of key parameters including the Brunt–Väisälä frequency and Coriolis force, making it suitable for oceanographic and atmospheric science research.

3. High-Performance Computing and Parallel Simulation

When large-scale fluid simulations need to run on supercomputing clusters or workstations, FluidSim supports MPI parallel computing and compilation-based acceleration through Pythran/Transonic. Combined with its parameter-sweep capabilities, it can efficiently perform batch simulations across multiple parameter sets.

Core Features

1. Multi-Equation Solver System

FluidSim provides a variety of solvers for 2D/3D Navier–Stokes equations, stratified flows, shallow-water equations, and more, with a unified workflow and parameter configuration interface. Each solver is optimized for specific physical problems and supports multiple types of initial conditions, including noise fields, dipoles, and vortices. Initial fields can also be customized using in_script mode.

2. High-Performance Numerical Computing

FluidSim uses pseudo-spectral methods and FFTs to achieve high-accuracy spatial discretization. Through Pythran/Transonic JIT compilation, Python code is compiled into machine code, delivering near-compiled-language performance along critical computational paths. MPI parallel computing is supported, enabling large-scale simulations with hundreds of processes.

3. Complete Simulation and Analysis Workflow

FluidSim provides a complete workflow spanning parameter configuration, simulation execution, and result analysis. Parameter objects support hierarchical access and type checking to prevent configuration errors. During simulations, various outputs—including physical fields, spatial statistics, and energy spectra—are saved automatically. Historical data can be loaded for post-processing and analysis, with Python plotting interfaces as well as advanced visualization support through ParaView and VisIt.

Frequently Asked Questions

Is FluidSim free? Does it require a license?

FluidSim is released under the CeCILL free software license and is fully open source and free of charge, with no licensing fees required. Unlike commercial CFD software such as ANSYS Fluent and COMSOL, FluidSim has no license management overhead and can be freely deployed on personal computers, workstations, and supercomputing clusters.

Will a Python-based CFD tool be too slow?

FluidSim ensures high performance through several technologies: core computations use pseudo-spectral methods and FFTs; critical paths are compiled into optimized machine code through Pythran/Transonic; and MPI parallel computing is supported. In practice, its performance is close to that of traditional Fortran/C++ implementations while retaining Python’s ease of use and flexibility. For typical 2D turbulence simulations, a 512×512 grid can perform long-time integration within a reasonable period.

How do I run FluidSim in parallel on a supercomputing cluster?

MPI support must be enabled during installation:

uv pip install "fluidsim[fft,mpi]"

After preparing the simulation script, launch the parallel task with mpirun -np N. FluidSim automatically handles domain decomposition and communication, while parameter configuration remains exactly the same as in single-process mode. It is recommended to choose the number of processes based on the solver dimensionality and the total number of grid points. More processes can be used for 3D simulations. The params.output parameter series can be used to control output frequency and balance I/O overhead.