Getting Started with NEK5000
This section covers HydroGym's NEK5000-based environments, from a simple single-agent setup to multi-agent training and zero-shot policy deployment. Each sub-page corresponds to a numbered subdirectory in examples/nek/gettingstarted/ and focuses on a distinct interface pattern.
Single Agent Interface
NekEnv is HydroGym's standard single-agent interface for NEK5000 environments. It follows the Gymnasium API exactly, returning a flat NumPy array for observations and accepting a flat array for actions. This makes it directly compatible with Stable-Baselines3 without any additional wrapper code.
Parallel Multi-Agent Interface
NekParallelEnv wraps a base NekEnv and exposes a dictionary-based multi-agent API in which each actuator is treated as an independent agent. Every agent receives its own observation array, produces its own scalar action, and can be assigned a per-agent reward signal.
PettingZoo Interface
The PettingZoo wrapper provides a standardised multi-agent API and, through SuperSuit, a production-ready path to Stable-Baselines3 training on multi-agent NEK5000 environments.
Loading Environments from HuggingFace Hub
NekEnv.fromhf() is the recommended way to create a NEK5000 environment for most users. Rather than constructing an envconfig dictionary manually, you provide only the environment name and the number of solver processes. The method automatically locates the configuration file, prepares the workspace, and returns a ready-to-use NekEnv instance.
Time-Stepping with integrate()
The integrate() function provides a convenient time-stepping loop that drives a HydroGym environment with an arbitrary controller. The controller can be a trained SB3 model, a classical feedback law, or any Python callable that maps (t, obs, env) to an action array. This makes integrate() the natural tool for evaluating trained policies on longer rollouts and for comparing RL and classical control strategies under identical conditions.
Zero-Shot Wing Deployment
This demo shows how to deploy multiple pre-trained control policies simultaneously on the NACA4412 small-wing NEK5000 case using a PettingZoo rollout. Different policies are mapped to spatially distinct subsets of the wing actuators by chordwise position and pressure/suction side, and executed together in a single simulation without any additional training.