The FlowControl toolbox is an open-source toolbox addressing the simulation and control of 2D incompressible flows at low Reynolds number. It aims at providing a user-friendly way to simulate flows with actuators and sensors, the possibility to readily define new use-cases, and support for operators & frequency response computations.
For in-depth documentation, see docs/.
The toolbox is shipped with four benchmarks for flow control and allows for easy implementation of new cases.
The core of the toolbox is in Python and relies on FEniCS 2019.1.0 as a backend.
The conda environment required to run the code is defined in environment.yml. The proposed installation pipeline is:
conda env create -n fenics --file environment.yml
conda activate fenics
pip install -e . --no-deps --no-build-isolationAdditional path tweaking is sometimes required for FEniCS to be found through the dolfin module (see e.g. this problem with PKG_CONFIG).
- Actuators and Sensors: define any number of actuators (boundary velocity, body force, cylinder rotation) and sensors (point measurements, wall shear stress)
- Closed-loop control: built-in
Controllerclass; connect a state-space controller in a few lines - Linearized operators: compute A, B, C, D and mass matrix E for control design
- Checkpointing and restart: save snapshots and resume from any checkpoint via JSON saves
- Export: timeseries CSV and XDMF fields for Paraview visualization
- Parallel: MPI-parallel execution via FEniCS native support
- Extensible: use as a backend in optimization or data-driven pipelines
Four classic oscillator flows used for flow control are shipped with the current code.
| Use-case | Description | Suggested Reynolds number |
|---|---|---|
| Cylinder | Flow past a cylinder | Re=100 |
| Lid-driven cavity | Flow in a lid-driven cavity | Re=8000 |
| Open cavity | Flow over an open cavity | Re=7500 |
| Fluidic pinball | Flow past 3 cylinders | Re=100 |
To implement a new use-case, the workflow is the following:
- Define a new use-case: inherit the
FlowSolverabstract class - Attach
Sensors andActuators to an instance of aFlowSolversubclass - Run a simulation using an input signal
$u(t)$ , either open-loop or closed-loop via aController
See Code Basics for more information on how to perform these steps.
By default, the toolbox integrates in time the Incompressible Navier-Stokes equations. For a 2D flow defined by its velocity
The only numerical parameter of the non-dimensional equations, the Reynolds number defined as
The following articles were based on previous versions of the code:
- Jussiau, W., Leclercq, C., Demourant, F., & Apkarian, P. (2022). Learning linear feedback controllers for suppressing the vortex-shedding flow past a cylinder. IEEE Control Systems Letters, 6, 3212-3217.
- Jussiau, W., Leclercq, C., Demourant, F., & Apkarian, P. (2024). Data-driven stabilization of an oscillating flow with linear time-invariant controllers. Journal of Fluid Mechanics, 999, A86.
- Jussiau, W., Demourant, F., Leclercq, C., & Apkarian, P. (2025). Control of a Class of High-Dimensional Nonlinear Oscillators: Application to Flow Stabilization. IEEE Transactions on Control Systems Technology.
- Complete the documentation 📖
- Review and release operator and frequency-response computation tools
- Refactor utility functions
- Update the project to FEniCSx
This README has been optimized for accessibility based on GitHub's blogpost "Tips for Making your GitHub Profile Page Accessible".


