Skip to content
Tech News
← Back to articles

The HydroGym reinforcement learning platform for fluid dynamics

read original more articles
Why This Matters

HydroGym introduces a reinforcement learning platform tailored for fluid dynamics, enabling control of complex flow phenomena through AI-driven techniques. Its solver-independent design simplifies integration with various CFD solvers, fostering collaboration between machine learning experts and fluid researchers. This advancement accelerates the development of intelligent flow control solutions, with potential applications in energy, aerospace, and environmental sectors.

Key Takeaways

The HydroGym platform formulates flow control problems as discrete-time Markov decision processes, defined by the tuple \(({\mathcal{S}},{\mathcal{A}},{\mathcal{P}},{\mathcal{R}})\). At each control step t, the agent: receives an observation state \({s}_{t}\in {\mathcal{S}}\), which represents flow measurements; executes an action \({a}_{t}\in {\mathcal{A}}\), which represents actuator inputs; and receives a scalar reward \({r}_{t}\in {\mathcal{R}}\) that quantifies the control objective (for example, drag reduction or flow stabilization). The transition probability \({\mathcal{P}}\) is governed implicitly by the underlying Navier–Stokes equations integrated by the fluid solver.

To bridge the gap between machine learning and fluid dynamics, HydroGym uses the Farama Foundation Gymnasium interface44, abstracting the complexity of the CFD execution. This abstraction is illustrated by the straightforward initialization and interaction pattern for an open cavity control example:

# Swap one line to switch backend solvers

import hydrogym.firedrake as hgym

# import hydrogym.maia as hgym

# import hydrogym.nek as hgym

# import hydrogym.jax as hgym

# import hydrogym.jaxfluids as hgym

# initialize environment

env = hgym.FlowEnv('Cavity_2D_Re7500', **kwargs)

... continue reading