Skip to content

Commit aaa485b

Browse files
committed
Rebase branch onto main.
2 parents 125ad15 + 6bcfa3a commit aaa485b

234 files changed

Lines changed: 40224 additions & 80690 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codespell.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ jobs:
4040
- name: Check spelling in tests
4141
run: codespell tests
4242

43-
- name: Check spelling in docs
44-
run: codespell docs
45-
4643
- name: Check spelling in tutorials
4744
run: codespell tutorials
4845

.github/workflows/deploy.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
build:
12+
name: Build Docusaurus
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: docs
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: npm
25+
cache-dependency-path: docs/package-lock.json
26+
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Install pydoc-markdown
32+
run: pip install pydoc-markdown
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
- name: Build website
37+
run: npm run build
38+
39+
- name: Upload Build Artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: docs/build
43+
44+
deploy:
45+
name: Deploy to GitHub Pages
46+
needs: build
47+
48+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
49+
permissions:
50+
pages: write # to deploy to Pages
51+
id-token: write # to verify the deployment originates from an appropriate source
52+
53+
# Deploy to the github-pages environment
54+
environment:
55+
name: github-pages
56+
url: ${{ steps.deployment.outputs.page_url }}
57+
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

.github/workflows/docs.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/isort.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: isort
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: isort-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
isort:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Install isort
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install isort
29+
30+
# Uses [tool.isort] in pyproject.toml when defined; otherwise isort defaults
31+
- name: Check import sorting with isort
32+
run: isort . --check-only --diff

.github/workflows/test-deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
test-deploy:
12+
name: Test deployment
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: docs
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: npm
25+
cache-dependency-path: docs/package-lock.json
26+
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Install pydoc-markdown
32+
run: pip install pydoc-markdown
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
- name: Test build website
37+
run: npm run build

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,7 @@ dmypy.json
133133
.pyre/
134134

135135
.DS_store
136+
examples/firedrake/getting_started/output/
137+
138+
# VSCode
139+
.vscode/

README.md

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,48 @@
1111

1212
# HydroGym: Reinforcement Learning for Fluid Dynamics
1313

14-
**88 environments | 6 solver backends | 2D & 3D | Ready for RL training**
14+
**61+ environments | 6 solver backends | 2D & 3D | Ready for RL training**
1515

1616
HydroGym is a comprehensive platform for applying reinforcement learning to fluid dynamics and flow control. With environments ranging from canonical benchmarks to turbulent flows, HydroGym provides a standardized Gymnasium-compatible interface for training RL agents on challenging CFD problems.
1717

18-
> **Paper**: Lagemann, C., et al. (2025). *HydroGym: A reinforcement learning platform for fluid dynamics.* arXiv:2512.17534 [[arxiv]](https://arxiv.org/abs/2512.17534)
19-
2018
## Key Features
2119

22-
- **Diverse Environments**: 88 pre-configured environments across 6 CFD solvers
20+
- **Diverse Environments**: 61+ pre-configured environments across 6 CFD solvers
2321
- **Standard RL Interface**: Gymnasium-compatible API works with Stable-Baselines3, RLlib, and other RL libraries
2422
- **Compute Efficient**: Highly optimized GPU & CPU backends for efficient RL deployment ranging from local workstations to exascale HPC systems
2523
- **Scalable**: MPI-parallelized solvers with distributed RL training support
2624
- **Multiple Backends**: Finite Element (Firedrake), Lattice Boltzmann (MAIA LBM), Finite Volume (MAIA FV), Spectral Element (NEK5000), Fully Differentiable solvers (JAX-Fluids)
2725
- **2D & 3D**: From simple 2D benchmarks to complex 3D turbulent flows (Re up to 400,000)
28-
- **Research-Ready**: Includes checkpoints, observation strategies, and reward formulations managed by a complementary HuggingFace repository
26+
- **Research-Ready**: Managed by a complementary HuggingFace repository
2927

3028
## Quick Start with Docker (Recommended)
3129

3230
**We strongly recommend using our pre-configured Docker containers** for hassle-free setup:
3331

3432
```bash
3533
# For NVIDIA GPUs (CUDA)
36-
docker pull clagemann/maia-cuda-12.8.1:latest
34+
docker pull clagemann/hydrogym-nvhpc-26.1_cuda-12.9_hopper_blackwell:latest
35+
# or
36+
docker pull clagemann/hydrogym-nvhpc-26.1_cuda-12.9_turing_ampere:latest
3737

3838
# For AMD GPUs (ROCm)
39-
docker pull clagemann/maia-rocm-6.3.3:latest
39+
docker pull clagemann/hydrogym-rocm-6.3.3:latest
4040

4141
# Run container
42-
docker run -it --gpus all clagemann/maia-cuda-12.8.1:latest
42+
docker run -it --gpus all clagemann/hydrogym-nvhpc-26.1_cuda-12.9_turing_ampere:latest
4343
```
4444
## Available Environments
4545

46-
HydroGym provides **88 environments** across 6 solver backends:
46+
HydroGym provides **61 environments** across 6 solver backends:
4747

4848
| Solver Backend | Count | Description | Dimensions |
4949
|----------------|-------|-------------|------------|
5050
| **Firedrake** (FEM) | 20 | Canonical flow control benchmarks | 2D |
5151
| **MAIA LBM** | 55 | Lattice Boltzmann method environments | 2D, 3D |
5252
| **MAIA Structured FV** | 8 | High-Reynolds turbulent boundary layers | 3D |
53-
| **NEK5000** | 1 | Spectral element turbulent channel flow | 3D |
53+
| **NEK5000** | 2 | Spectral element turbulent channel flow | 3D |
5454
| **JAX** | 2 | Differentiable fluid dynamics | 2D, 3D |
55-
| **JAX-Fluids** | 2 | Compressible jet engine control | 2D, 3D |
55+
| **JAX-Fluids** | 2 | Compressible shock vector control | 2D, 3D |
5656

5757
### Environment Categories
5858

@@ -65,25 +65,29 @@ HydroGym provides **88 environments** across 6 solver backends:
6565
- Square cylinder (Re=200-3900, 2D/3D)
6666
- Sphere (Re=300-3700, 3D)
6767
- Cube (Re=300-3700, 3D)
68-
- Turbulent channel flow (Re_tau=180, 3D)
68+
- Turbulent channel flow (Re_tau=206, 3D)
6969

7070
**Airfoil Control**:
7171
- NACA0012 steady (Re=100-50000, AOA=12-40°, 2D/3D)
7272
- NACA0012 with gust disturbance (Re=100-50000, 2D/3D)
7373

7474
**High Reynolds Number Flows**:
75-
- Zero-pressure-gradient turbulent boundary layer with jet/surface wave actuation (Re_Tau=1000-5000, 3D)
75+
- Zero-pressure-gradient turbulent boundary layer with jet/surface wave actuation (Re_Tau=180-2200, 3D)
7676
- DRA2303 airfoil with jet/surface wave actuation (Re=400000, Ma=0.2-0.7, 3D)
77+
- NACA0012 airfoil with jet actuation (Re=200000, 3D)
7778

7879
**Fully Differentiable Flows**:
79-
- Jet engine thrust vectoring (TVC/TVD, Ma=2.2, 2D/3D)
80-
- Kolmogorov flow (Re=1000, 2D)
80+
- Shock-Vector Control in single divergent nozzle (SVC, Ma>1.0, 2D/3D)
81+
- Turbulent channel flow (Re_tau=180, 3D)
82+
- Kolmogorov flow (up to Re=1000, 2D)
83+
84+
## Environment Checkpoints
8185

82-
See [`existing_environments.yaml`](existing_environments.yaml) for complete list with exact naming conventions.
86+
All required environment checkpoints are available via [HuggingFace](https://huggingface.co/datasets/dynamicslab/HydroGym-environments/tree/main) and are downloaded on the fly when an environment is first created (internet connection required). If no internet connection is available at runtime — e.g. on compute nodes in HPC clusters — you can pre-download the environment files as outlined in [examples/maia/README.md](examples/maia/README.md).
8387

8488
## Examples
8589

86-
HydroGym includes comprehensive examples for each solver backend:
90+
HydroGym includes comprehensive examples for each solver backend (internet connection required). We highly recommend using our provided docker containers:
8791

8892
### Firedrake Examples
8993

@@ -93,10 +97,10 @@ See [examples/firedrake/getting_started/](examples/firedrake/getting_started/) f
9397
cd examples/firedrake/getting_started
9498

9599
# Test environment interactively
96-
python test_firedrake_env.py --environment cylinder --num-steps 10
100+
./run_example_docker.sh
97101

98102
# Train with Stable-Baselines3
99-
python train_sb3_firedrake.py --env cylinder --algo PPO --total-timesteps 100000
103+
./run_example_docker.sh train
100104
```
101105

102106
### MAIA Examples
@@ -106,26 +110,52 @@ See [examples/maia/getting_started/](examples/maia/getting_started/) for MPMD co
106110
```bash
107111
cd examples/maia/getting_started
108112

109-
# Prepare workspace (downloads from Hugging Face Hub)
110-
python prepare_workspace.py --env Cylinder_2D_Re200 --work-dir ./test_run
113+
# Prepare workspace (downloads from Hugging Face Hub) and
114+
# Run with MPMD execution (1 Python + 1 MAIA process on GPU)
115+
./run_example_docker.sh
111116

112-
# Run with MPMD execution (1 Python + 1 MAIA process)
113-
cd test_run
114-
mpirun -np 1 python ../test_maia_env.py --environment Cylinder_2D_Re200 : -np 1 maia properties.toml
117+
# Prepare workspace and train with Stable-Baselines3
118+
./run_example_docker.sh train
115119
```
116120

117121
### NEK5000 Examples
118122

119123
See [examples/nek/getting_started/](examples/nek/getting_started/) for interface patterns.
120124

121125
```bash
122-
cd examples/nek/getting_started/1_nekenv_single
126+
cd examples/nek/getting_started
123127

124128
# Test single-agent environment
125-
mpirun -np 1 python test_nek_direct.py --steps 100 : -np 10 nek5000
129+
cd 1_nekenv_single
130+
./run_nekenv_docker.sh
131+
132+
# ... or train with pettinzoo wrapper and SB3
133+
cd 3_pettingzoo
134+
./run_pettingzoo_docker.sh train
135+
136+
# ... or run zero-shot transfer learning
137+
cd 6_zeroshot_wing_demo
138+
./run_pettingzoo_docker.sh
139+
```
126140

127-
# Train with SB3
128-
mpirun -np 1 python train_sb3_nek_direct.py --env TCFmini_3D_Re180 --algo PPO : -np 10 nek5000
141+
### JAX Examples
142+
143+
See [examples/jax/getting_started/](examples/jax/getting_started/) for detailed documentation.
144+
145+
```bash
146+
cd examples/jax/getting_started
147+
148+
# Test Kolmogorov flow environment
149+
cd 1_kolmogorov
150+
./run_nekenv_docker.sh
151+
152+
# ... or test channel flow environment
153+
cd 2_channel
154+
./run_channel_docker.sh strong_actuation
155+
156+
# ... or run zero-shot transfer learning
157+
cd 3_ppo
158+
./run_ppo_docker.sh --env channel --num-envs 1 --num-steps 10 --num-minibatches 5
129159
```
130160

131161
## Training RL Agents
@@ -158,6 +188,8 @@ model = PPO("MlpPolicy", env, verbose=1)
158188
model.learn(total_timesteps=100000)
159189
```
160190

191+
See also provided [examples/](examples/) for more details how to leverage individual solver backends for training.
192+
161193
## Advanced Features
162194

163195
- **Checkpoint management**: Automatic loading from Hugging Face Hub

docs/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

0 commit comments

Comments
 (0)