<p align="center">
<a rel="nofollow">
<img src="docs/source/_static/imgs/logo.svg" />
</a>
</p>
# 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 OpenAI `gym.Env` interface
- Intermediate: Typical CFD interface with `hydrogym.FlowConfig` and `hydrogym.TransientSolver` classes
- Low-level: Access to linearized operators and sparse scipy or PETSc CSR matrices
* __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](https://github.com/ray-project/ray) backend reinforcement learning training**.
# Installation
To begin using Hydrogym we can install its latest release via [PyPI](https://pypi.org/project/hydrogym/) with pip
```bash
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](https://hydrogym.readthedocs.io/en/latest/installation.html).
# Quickstart Guide
Having installed Hydrogym into our virtual environment experimenting with Hydrogym is as easy as starting the Python interpreter
```bash
python
```
and then setting up a Hydrogym environment instance
```python
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:
```bash
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](https://hydrogym.readthedocs.io/en/latest/)
# 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](docs/FlowConfigurations.md).
Raw data
{
"_id": null,
"home_page": "https://github.com/dynamicslab/hydrogym",
"name": "hydrogym",
"maintainer": "Jared Callaham",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "jared.callaham@gmail.com",
"keywords": "Reinforcement Learning,Scientific Machine Learning,Benchmarking,Computational Fluid Dynamics",
"author": "Jared Callaham et al.",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/f3/5e/b67df9f0afede81d01f9c7f238bfe6c55b769c1e0bd33c91afe085b5c9a4/hydrogym-0.1.2.1.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n\t<a rel=\"nofollow\">\t\n\t\t<img src=\"docs/source/_static/imgs/logo.svg\" />\n\t</a>\n</p>\n\n# About this Package\n\nHydroGym is an open-source library of challenge problems in data-driven modeling and control of fluid dynamics.\n\n## Features\n* __Hierarchical:__ Designed for analysis and controller design **from a high-level black-box interface to low-level operator access**\n - High-level: `hydrogym.env.FlowEnv` classes implement the OpenAI `gym.Env` interface\n - Intermediate: Typical CFD interface with `hydrogym.FlowConfig` and `hydrogym.TransientSolver` classes\n - Low-level: Access to linearized operators and sparse scipy or PETSc CSR matrices\n* __Modeling and anlysis tools:__ Global stability analysis (via SLEPc) and modal decompositions (via modred)\n* __Scalable:__ Individual environments parallelized with MPI with a **highly scalable [Ray](https://github.com/ray-project/ray) backend reinforcement learning training**.\n\n# Installation\n\nTo begin using Hydrogym we can install its latest release via [PyPI](https://pypi.org/project/hydrogym/) with pip\n\n```bash\npip install hydrogym\n```\n\nwhich 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](https://hydrogym.readthedocs.io/en/latest/installation.html).\n\n# Quickstart Guide\n\n Having installed Hydrogym into our virtual environment experimenting with Hydrogym is as easy as starting the Python interpreter\n \n ```bash\n python\n ```\n \n and then setting up a Hydrogym environment instance\n \n```python\nimport hydrogym as hgym\nenv = hgym.env.CylEnv(Re=100) # Cylinder wake flow configuration\nfor i in range(num_steps):\n action = 0.0 # Put your control law here\n (lift, drag), reward, done, info = env.step(action)\n```\n\nTo 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:\n\n```bash\ncd /path/to/hydrogym/examples/cylinder\nmpiexec -np 4 python pd-control.py\n```\n\nFor more detail, check out:\n\n* A quick tour of features in `notebooks/overview.ipynb`\n* Example codes for various simulation, modeling, and control tasks in `examples`\n* The [ReadTheDocs](https://hydrogym.readthedocs.io/en/latest/)\n\n# Flow configurations\n\nThere are currently a number of main flow configurations, the most prominent of which are:\n\n- Periodic cyclinder wake at Re=100\n- Chaotic pinball at Re=130\n- Open cavity at Re=7500\n\nwith visualizations of the flow configurations available in the [docs](docs/FlowConfigurations.md).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Reinforcement Learning Benchmarking Environment for Fluid Dynamics",
"version": "0.1.2.1",
"split_keywords": [
"reinforcement learning",
"scientific machine learning",
"benchmarking",
"computational fluid dynamics"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "1fe1f5a0582cc7a66111dd6126e67bc4",
"sha256": "b1e98c3545e0cbd968efb5bc542d7f31591903b6e239f11e1da7552148dd21ac"
},
"downloads": -1,
"filename": "hydrogym-0.1.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1fe1f5a0582cc7a66111dd6126e67bc4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 18449890,
"upload_time": "2022-12-26T02:30:32",
"upload_time_iso_8601": "2022-12-26T02:30:32.798162Z",
"url": "https://files.pythonhosted.org/packages/c1/2c/758ba75286a74786fdcceccf91fd2d4d171503200709967bed1d81878d12/hydrogym-0.1.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "1fd586fe8fd02b8ff889dca04f36d7ee",
"sha256": "b0f6b645da787e4d25c1b4ba2b55bf422265ad1f8d6aef5e7b88c5484b2e45f0"
},
"downloads": -1,
"filename": "hydrogym-0.1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "1fd586fe8fd02b8ff889dca04f36d7ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 18311514,
"upload_time": "2022-12-26T02:30:35",
"upload_time_iso_8601": "2022-12-26T02:30:35.792948Z",
"url": "https://files.pythonhosted.org/packages/f3/5e/b67df9f0afede81d01f9c7f238bfe6c55b769c1e0bd33c91afe085b5c9a4/hydrogym-0.1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-26 02:30:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "dynamicslab",
"github_project": "hydrogym",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hydrogym"
}