Skip to content

HammerLabML/RBC-Gym

Repository files navigation

Rayleigh-Bènard Convection Simulation

Setup

We use uv to manage python dependencies. Install virtual environment via:

uv sync
source .venv/bin/activate

The simulation is based on Julia. Please install according to their docs or via their standalone installer:

curl -fsSL https://install.julialang.org | sh

Get started

Run plain environment

Small example to run a 2D Rayleigh-Benard Convection simulation wrapped in a gym environment:

python example/run.py

Run in parallel utilizing vectorized envs

python example/run_vectorized.py

Run with wrappers

python example/run_wrappers.py

Gym environment

env = gym.make(
        "rbc_gym/RayleighBenardConvection2D-v0",
        render_mode="human",
    )

Roadmap

  • Timing analysis

  • vectorized environments

  • Wrappers

  • Checkpoints

  • Make installable

  • Normalize Reward Wrapper

  • Reward Shaping Wrapper

  • generate Checkpoints for train and test for all Ra

  • Docs

  • Make more parameters accessible to the gym env

  • GPU compatibility

  • Create Dataset from python gym

  • PyTests

  • 3D simulation

  • Multi-Agent Environment via PettingZoo

Time efficiency

Time comparison vs a shenfun based simulation. Averaged over 1000 iterations on an apple sillicone based system.

Julia based simulation

Julia init time: 7.68 seconds
Average time to reset env: 0.02 seconds
Average time to step one timestep (dt=1): 0.12 seconds (sim dt=0.03)
Average time to step with rendering: 0.12 seconds
Shenfun based simulation

Shenfun init time: 0.00 seconds
Average time to reset env: 0.19 seconds
Average time to step one timestep (dt=1): 0.56 seconds (sim dt=0.03)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published