Skip to main content

Plug-and-Play Benchmarking of Reinforcement Learning Algorithms for Large-Scale Flow Control

Project description

FluidGym Logo FluidGym Logo

PyPI version PyPI - Python Version PyTorch CUDA License Linters


Key Features

  • Standalone, GPU-accelerated fluid dynamics implemented fully in PyTorch — no external CFD solvers required.
  • Fully differentiable environments, enabling both reinforcement learning and gradient-based control methods.
  • Gymnasium-like API with seamless integration into common RL frameworks.
  • Standardized benchmarks with fixed train/validation/test splits for fair and reproducible evaluation.
  • Diverse AFC environments (2D & 3D) with multiple difficulty levels, covering different regimes.
  • Single-agent and multi-agent support for centralized and decentralized control.
  • Reference baselines and experiments provided for widely used RL algorithms PPO and SAC.

Models & Data

  • All trained models are publicly available on HuggingFace.
  • Complete training and test datasets with results for all experimental runs are released for transparent comparison and reproducibility via our HuggingFace dataset.

Introducing FluidGym v0.1

We are happy to announce that FluidGym v0.1 comes with many updates and improvements, mainly focusing on more convenient usage and integration with RL frameworks:

  • Unified SARL and MARL interface: Previously, MARL environments implemented public reset_marl() and step_marl() functions. These have been removed and directly integrated with the reset() and step() functions. When creating an environemtn via fluidgym.make(), you can now pass a use_marl=True flag, to enable MARL and use the reset() and step() as before. The only difference is that they now return a batch of observations and rewards. This has also been updated for the integrations with PettingZoo and SB3.
  • Gymnasium spaces: FluidEnv now has action_space and observation_space attributes consistent with gymnasium. Additionally, the previous flattened observations have been replaced by Dict observation space containing indivdual fields, such as as velocity and pressure fields, as indivual keys. Furthermore, the indivual observations are now shaped according to the spatial structure of the sensors, enabling the use of methods that leverage the spatial structure of the domain, e.g. CNNs, equivariant networks, etc.
  • Environment wrappers: Following the new observation spaces, we introduce FluidWrappers, namely FlattenObservation, ObsExtraction, ActionNoise, and SensorNoise. The general wrapper interface enables easy integration of new wrappers as needed.
  • Parallelization: Using the new FluidEnvLike protocol, the ParallelFluidEnv can now seamlessly be used with all FluidGym wrappers and integration wrappers. We updated the example to show how you can use FluidGym across multiple GPUs.

Important: The FlattenObservation ensure direct compatiblity with our models on HuggingFace (trained with FluidGym v0.0.2). If you want to use the models, make sure to install the FluidGym v0.0.2 or use the FlattenObservation wrapper. In case you encounter any issues, please report these via an Issue on GitHub. Thank you!


Installation

📦 Installation from PyPi

  1. Ensure the correct PyTorch version is installed (compatible with CUDA 12.8):
pip install torch --index-url https://download.pytorch.org/whl/cu128
  1. Install
pip install fluidgym

🐳 Using Docker

Instead of installing FluidGym you can use one of our Docker containers:

Both containers come with the following Miniconda environments:

  • py310: Python 3.10
  • py311: Python 3.11
  • py312: Python 3.12
  • py313: Python 3.13

Start the containers with:

docker run -it --gpus all fluidgym-runtime bash
docker run -it --gpus all fluidgym-devel bash

🧱 Build from Source

  1. Create a new conda environment and activate it:
conda create -n fluidgym python=3.10
conda activate fluidgym
  1. Install gcc:
conda install pip "gcc_linux-64>=6.0,<=11.5" "gxx_linux-64>=6.0,<=11.5"
  1. Install the latest Pytorch for CUDA 12.8 via pip:
pip install torch --index-url https://download.pytorch.org/whl/cu128
  1. Install the matching cuda toolkit via conda:
conda install cuda-toolkit=12.8 -c nvidia/label/cuda-12.8.1
  1. Clone the repository and enter the directory, then compile the custom CUDA kernels and install the package (this might take several minutes):
make install

Getting Started

For an easy start refer to our documentation and the examples directory. FluidGym provides a gymnasium-like interface that can be used as follows:

import fluidgym

env = fluidgym.make(
    "CylinderJet2D-easy-v0",
)
obs, info = env.reset(seed=42)

for _ in range(50):
    action = env.sample_action()
    obs, reward, term, trunc, info = env.step(action)
    env.render()

    if term or trunc:
        break

License & Citation

This repository is published under the MIT license. If you use FliudGym in your work, please cite us:

@misc{becktepe-fluidgym26,
      title={Plug-and-Play Benchmarking of Reinforcement Learning Algorithms for Large-Scale Flow Control}, 
      author={Jannis Becktepe and Aleksandra Franz and Nils Thuerey and Sebastian Peitz},
      year={2026},
      eprint={2601.15015},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2601.15015}, 
      note={GitHub: https://github.com/safe-autonomous-systems/fluidgym}, 
}

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

fluidgym-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fluidgym-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fluidgym-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

fluidgym-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file fluidgym-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fluidgym-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9c079b3517b0eb5439324e9e2e4c3e0f83194ebdc6c2500a79c28805ab7d1d82
MD5 e0bf4dcb1c13e8069e2825587285915f
BLAKE2b-256 4bdb485a90a5f77cf2578abec7f3f23a5e91b39db12532b276d4302d986f636f

See more details on using hashes here.

File details

Details for the file fluidgym-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fluidgym-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c37127ed3f8e5b4abe6fb32dda87330b33091f912c138bdf2bc0967f490520fe
MD5 251a522aa2c0a3266cf7d416c4ed1a20
BLAKE2b-256 426319168d034858b2f7debc9d10b0deaaa018b85ef7d1c799d59ecd3284e13c

See more details on using hashes here.

File details

Details for the file fluidgym-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fluidgym-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a6cab01e3d88304d6ce601c5cb37a239680972cd9429135b37e97febcace823
MD5 b0f9aaba9c6ae605f8e9fef5f331d0ec
BLAKE2b-256 9699e69252c39fa06e49695bee0be710713cdcaa035c2f77f4dbf3e60d84c0c1

See more details on using hashes here.

File details

Details for the file fluidgym-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fluidgym-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 18e25f251e2ea4b63e571025642b07fdba82983010fc0e1730b19033ec27a5b6
MD5 98d2efe1b611ff1d3e378b1d20d83b3a
BLAKE2b-256 1eafe60b28a19fbb7a3ce8f0b330010eb63d7d25a0aacbbe960e9df2afebb431

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