A Reinforcement Learning Benchmarking Environment for Fluid Dynamics
Project description
About this Package
HydroGym is an open-source library of challenge problems in data-driven modeling and control of fluid dynamics.
Features
- Hierarchical: Designed for analysis and controller design from a high-level black-box interface to low-level operator access
- High-level:
hydrogym.env.FlowEnv
classes implement the OpenAIgym.Env
interface - Intermediate: Typical CFD interface with
hydrogym.FlowConfig
andhydrogym.TransientSolver
classes - Low-level: Access to linearized operators and sparse scipy or PETSc CSR matrices
- High-level:
- Modeling and anlysis tools: Global stability analysis (via SLEPc) and modal decompositions (via modred)
- Scalable: Individual environments parallelized with MPI with a highly scalable Ray backend reinforcement learning training.
Installation
To begin using Hydrogym we can install its latest release via PyPI with pip
pip install hydrogym
which provides the core functionality, and is able to launch reinforcement learning training on a Ray-cluster without an underlying Firedrake install. If you want to play around with Hydrogym locally on e.g. your laptop, we recommend a local Firedrake install. The instructions for which can be found in the Installation Docs.
Quickstart Guide
Having installed Hydrogym into our virtual environment experimenting with Hydrogym is as easy as starting the Python interpreter
python
and then setting up a Hydrogym environment instance
import hydrogym as hgym
env = hgym.env.CylEnv(Re=100) # Cylinder wake flow configuration
for i in range(num_steps):
action = 0.0 # Put your control law here
(lift, drag), reward, done, info = env.step(action)
To test that you can run individual environment instances in a multithreaded fashion, run the steady-state Newton solver on the cylinder wake with 4 processors:
cd /path/to/hydrogym/examples/cylinder
mpiexec -np 4 python pd-control.py
For more detail, check out:
- A quick tour of features in
notebooks/overview.ipynb
- Example codes for various simulation, modeling, and control tasks in
examples
- The ReadTheDocs
Flow configurations
There are currently a number of main flow configurations, the most prominent of which are:
- Periodic cyclinder wake at Re=100
- Chaotic pinball at Re=130
- Open cavity at Re=7500
with visualizations of the flow configurations available in the docs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hydrogym-0.1.2.1.tar.gz
.
File metadata
- Download URL: hydrogym-0.1.2.1.tar.gz
- Upload date:
- Size: 18.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.9.16 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0f6b645da787e4d25c1b4ba2b55bf422265ad1f8d6aef5e7b88c5484b2e45f0 |
|
MD5 | 1fd586fe8fd02b8ff889dca04f36d7ee |
|
BLAKE2b-256 | f35eb67df9f0afede81d01f9c7f238bfe6c55b769c1e0bd33c91afe085b5c9a4 |
File details
Details for the file hydrogym-0.1.2.1-py3-none-any.whl
.
File metadata
- Download URL: hydrogym-0.1.2.1-py3-none-any.whl
- Upload date:
- Size: 18.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.9.16 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e98c3545e0cbd968efb5bc542d7f31591903b6e239f11e1da7552148dd21ac |
|
MD5 | 1fe1f5a0582cc7a66111dd6126e67bc4 |
|
BLAKE2b-256 | c12c758ba75286a74786fdcceccf91fd2d4d171503200709967bed1d81878d12 |