Skip to main content
QUICK REVIEW

[Paper Review] DRLinFluids -- An open-source python platform of coupling Deep Reinforcement Learning and OpenFOAM

Qiulei Wang, Lei Yan|arXiv (Cornell University)|May 25, 2022
Model Reduction and Neural NetworksPhysics and Astronomy53 references14 citations
TL;DR

DRLinFluids is an open-source Python platform that integrates Deep Reinforcement Learning (DRL) with OpenFOAM for fluid mechanics applications, enabling efficient DRL-based active flow control. It achieves up to 13.6% drag reduction and significant lift suppression in circular and square cylinder flows with minimal hyperparameter tuning.

ABSTRACT

We propose an open-source python platform for applications of Deep Reinforcement Learning (DRL) in fluid mechanics. DRL has been widely used in optimizing decision-making in nonlinear and high-dimensional problems. Here, an agent maximizes a cumulative reward with learning a feedback policy by acting in an environment. In control theory terms, the cumulative reward would correspond to the cost function, the agent to the actuator, the environment to the measured signals and the learned policy to the feedback law. Thus, DRL assumes an interactive environment or, equivalently, control plant. The setup of a numerical simulation plant with DRL is challenging and time-consuming. In this work, a novel python platform, named DRLinFluids is developed for this purpose, with DRL for flow control and optimization problems in fluid mechanics. The simulations employ OpenFOAM as popular, flexible Navier-Stokes solver in industry and academia, and Tensorforce or Tianshou as widely used versatile DRL packages. The reliability and efficiency of DRLinFluids are demonstrated for two wake stabilization benchmark problems. DRLinFluids significantly reduces the application effort of DRL in fluid mechanics and is expected to greatly accelerates academic and industrial applications.

Motivation & Objective

  • To reduce the complexity and time required to implement Deep Reinforcement Learning (DRL) in computational fluid dynamics (CFD) simulations.
  • To bridge the gap between advanced DRL algorithms and traditional fluid mechanics research by enabling seamless integration with OpenFOAM.
  • To provide a scalable, user-friendly framework for DRL-based active flow control in both academic and industrial applications.
  • To demonstrate the reliability and efficiency of the platform through benchmark flow control problems involving drag reduction and vortex shedding suppression.

Proposed method

  • The platform uses OpenFOAM as the CFD environment for simulating fluid flow, providing high-fidelity state observations for the DRL agent.
  • It integrates with DRL backends such as Tensorforce and Tianshou to support a variety of reinforcement learning algorithms including PPO and SAC.
  • Regular expressions are employed to dynamically parse and modify OpenFOAM dictionary files for real-time control parameter updates.
  • The framework enables parallelized training by supporting both CFD simulation parallelization via OpenFOAM and higher-level parallelization of DRL episodes across multiple environments.
  • A reward function is designed to simultaneously minimize drag and lift coefficients, encouraging stable and efficient control policies.
  • The agent learns a feedback policy through continuous interaction with the OpenFOAM-simulated environment, updating its policy network to maximize cumulative reward.
Figure 1: Interaction of agent and environment in reinforcement learning
Figure 1: Interaction of agent and environment in reinforcement learning

Experimental results

Research questions

  • RQ1Can a unified, open-source platform effectively couple DRL with OpenFOAM for fluid mechanics applications?
  • RQ2How efficiently can DRLinFluids train control policies for active flow control in complex, nonlinear fluid systems?
  • RQ3To what extent can DRLinFluids reduce drag and suppress vortex shedding in canonical flow configurations like circular and square cylinders?
  • RQ4How robust are the learned control policies across different DRL algorithms and flow geometries?
  • RQ5What level of performance improvement (e.g., drag reduction) can be achieved with minimal hyperparameter tuning using DRLinFluids?

Key findings

  • DRLinFluids successfully reduces drag by up to 8% for a circular cylinder and 13.6% for a square cylinder at Re = 100.
  • Lift fluctuations are suppressed to very low levels, indicating effective stabilization of the flow field.
  • The platform achieves consistent control performance across different DRL algorithms, such as PPO and SAC, demonstrating robustness.
  • The optimal control policy requires only a small jet velocity relative to the free-stream flow—0.58% for the circular cylinder and 3.443% for the square cylinder.
  • The framework enables efficient parallelization of both CFD simulations and DRL training episodes, supporting scalability to complex flows.
  • The use of regular expressions to manipulate OpenFOAM dictionary files enables flexible and reliable data exchange between the DRL agent and the CFD solver.
Figure 2: Directory structure of an OpenFOAM case.
Figure 2: Directory structure of an OpenFOAM case.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.