SearcharxivSearch

arXiv subjects

Bernat Font

Publications and source records attributed to Bernat Font.

17 recordsLinked to original sources

Scaling WaterLily.jl with MPI and an improved geometric multigrid solver

We present recent performance-oriented developments in WaterLily, a scale-resolving incompressible flow solver written in pure Julia that runs seamlessly on CPUs and GPUs of any vendor. Supported by the newly added MPI-based parallelism, strong-scalability tests display a near-ideal linear trend, and weak-scaling efficiency is kept above 85% before node memory-concurrency contention dominates parallel performance. Inter-node weak scalability is sustained above 96% with grid size up to 1 billion cells. We further benchmark improvements to the geometric multigrid Poisson solver enabled by an adaptive under-relaxed red-black Gauss-Seidel smoother together with anisotropic coarsening operators.

physics.comp-ph

Acceleration of an algebraic multigrid pressure solver using graph neural networks

Solving the pressure-Poisson equation remains the primary computational bottleneck in incompressible unstructured flow solvers primarily due to the inherent sensitivity of traditional linear solvers to mesh irregularities. This work introduces a data-driven algebraic multigrid (AMG) smoother that uses a modified graph convolutional isomorphism network (GCIN). The graph neural network predicts optimal polynomial coefficients to construct a sparse pseudo-inverse operator across diverse grid topologies. The coefficients are optimized to reduce the residual after each V-cycle iteration. By directly capturing the algebraic structure of the system from the sparse coefficient matrix, the proposed method maintains the solver's linearity while adapting to local anisotropies in unstructured grids. Our framework demonstrates significant performance gains by reducing the number of V-cycles required for a given tolerance and delivering wall-clock speedups from 4% to 37% across diverse benchmarks. Notably, the model exhibits robust generalization by maintaining efficiency on meshes up to 128 times larger than those seen in training, and by accelerating the solver's convergence on unseen industry-relevant problems such as the AirfRANS dataset.

physics.comp-ph

High-lift Wing Separation Control via Bayesian Optimization and Deep Reinforcement Learning

This study investigates active flow control (AFC) of a 30P30N high-lift wing at a Reynolds number Re$_c$ = 450,000 and angle of attack $\alpha$ = 23$^\circ$ using wallresolved large-eddy simulations (LES). Two optimization strategies are explored: open-loop Bayesian optimization (BO) and closed-loop deep reinforcement learning (DRL), both targeting the mitigation of stall and the improvement of aerodynamic efficiency via synthetic jets on the slat, main, and flap elements. The uncontrolled configuration was validated against literature data, confirming the reliability of the LES setup. The BO framework successfully identified steady jet velocities that increased efficiency by +10.9% through a -9.7% drag reduction while maintaining lift. In contrast, the DRL agent, despite leveraging instantaneous flow information from distributed sensors, achieved only minor improvements in lift and drag, with negligible efficiency gain. Training analysis indicated that the penalty-dominated reward constrained exploration. These results highlight the need for carefully designed rewards and computational acceleration strategies in DRL-based flow control at high Reynolds numbers.

physics.flu-dyn

Can Explicit Subgrid Models Enhance Implicit LES Simulations? A Very High-Order Solver Perspective

High-order discontinuous Galerkin (DG) methods offer excellent accuracy for turbulent-flow simulations and are increasingly attractive on GPU-oriented architectures, where high polynomial orders can improve arithmetic intensity. However, very high-order under-resolved simulations remain sensitive to the balance between numerical and modeled dissipation. We investigate how explicit Vreman subgrid-scale (SGS) modeling interacts with dissipation from split-form stabilization and Riemann solvers in a DGSEM framework. Using the three-dimensional Taylor-Green vortex at Re=1600 and in the inviscid limit, we assess kinetic-energy dissipation, spectral accuracy, and stability across well-resolved, under-resolved viscous, and strongly under-resolved regimes, comparing lower- and very high-order configurations at similar degrees of freedom. The usefulness of explicit SGS modeling depends strongly on resolution, polynomial order, and the numerical dissipation already present. In the well-resolved cases considered, Vreman modeling does not improve accuracy because its active wavenumber range overlaps with the scheme's inherent dissipation. At similar degrees of freedom, lower-order simulations introduce stronger damping near the smallest resolved scales, whereas very high-order simulations preserve more spectral content but are more susceptible to high-wavenumber energy accumulation when dissipation is insufficient. Under stronger under-resolution, a weak SGS contribution can control this accumulation, while excessive SGS dissipation degrades intermediate scales. These results identify regimes in which explicit SGS modeling is beneficial, neutral, or detrimental, and provide practical guidance for selecting dissipation mechanisms in very high-order DG turbulence simulations suited to modern GPU architectures.

physics.flu-dyn

Deep Reinforcement Learning in Action: Real-Time Control of Vortex-Induced Vibrations

This study showcases an experimental deployment of deep reinforcement learning (DRL) for active flow control (AFC) of vortex-induced vibrations (VIV) in a circular cylinder at a high Reynolds number (Re = 3000) using rotary actuation. Departing from prior work that relied on low-Reynolds-number numerical simulations, this research demonstrates real-time control in a challenging experimental setting, successfully addressing practical constraints such as actuator delay. When the learning algorithm is provided with state feedback alone (displacement and velocity of the oscillating cylinder), the DRL agent learns a low-frequency rotary control strategy that achieves up to 80% vibration suppression which leverages the traditional lock-on phenomenon. While this level of suppression is significant, it remains below the performance achieved using high-frequency rotary actuation. The reduction in performance is attributed to actuation delays and can be mitigated by augmenting the learning algorithm with past control actions. This enables the agent to learn a high-frequency rotary control strategy that effectively modifies vortex shedding and achieves over 95% vibration attenuation. These results demonstrate the adaptability of DRL for AFC in real-world experiments and its ability to overcome instrumental limitations such as actuation lag.

cs.LG

SmartFlow: A CFD-solver-agnostic deep reinforcement learning framework for computational fluid dynamics on HPC platforms

Deep reinforcement learning (DRL) is emerging as a powerful tool for fluid-dynamics research, encompassing active flow control, autonomous navigation, turbulence modeling and discovery of novel numerical schemes. We introduce SmartFlow, a CFD-solver-agnostic framework for both single- and multi-agent DRL algorithms that can easily integrate with MPI-parallel CPU and GPU-accelerated solvers. Built on Relexi and SmartSOD2D, SmartFlow uses the SmartSim infrastructure library and our newly developed SmartRedis-MPI library to enable asynchronous, low-latency, in-memory communication between CFD solvers and Python-based DRL algorithms. SmartFlow leverages PyTorch's Stable-Baselines3 for training, which provides a modular, Gym-like environment API. We demonstrate its versatility via three case studies: single-agent synthetic-jet control for drag reduction in a cylinder flow simulated by the high-order FLEXI solver, multi-agent cylinder wake control using the GPU-accelerated spectral-element code SOD2D, and multi-agent wall-model learning for large-eddy simulation with the finite-difference solver CaLES. SmartFlow's CFD-solver-agnostic design and seamless HPC integration is promising to accelerate RL-driven fluid-mechanics studies.

physics.flu-dyn

Mesh-free sparse identification of nonlinear dynamics

Identifying the governing equations of a dynamical system is one of the most important tasks for scientific modeling. However, this procedure often requires high-quality spatio-temporal data uniformly sampled on structured grids. In this paper, we propose mesh-free SINDy, a novel algorithm which leverages the power of neural network approximation as well as auto-differentiation to identify governing equations from arbitrary sensor placements and non-uniform temporal data sampling. We show that mesh-free SINDy is robust to high noise levels and limited data while remaining computationally efficient. In our implementation, the training procedure is straight-forward and nearly free of hyperparameter tuning, making mesh-free SINDy widely applicable to many scientific and engineering problems. In the experiments, we demonstrate its effectiveness on a series of PDEs including the Burgers' equation, the heat equation, the Korteweg-De Vries equation and the 2D advection-diffusion equation. We conduct detailed numerical experiments on all datasets, varying the noise levels and number of samples, and we also compare our approach to previous state-of-the-art methods. It is noteworthy that, even in high-noise and low-data scenarios, mesh-free SINDy demonstrates robust PDE discovery, achieving successful identification with up to 75% noise for the Burgers' equation using 5,000 samples and with as few as 100 samples and 1% noise. All of this is achieved within a training time of under one minute.

cs.LG

Deep-reinforcement-learning-based separation control in a two-dimensional airfoil

The aim of this study is to discover new active-flow-control (AFC) techniques for separation mitigation in a two-dimensional NACA 0012 airfoil at a Reynolds number of 3000. To find these AFC strategies, a framework consisting of a deep-reinforcement-learning (DRL) agent has been used to determine the action strategies to apply to the flow. The actions involve blowing and suction through jets at the airfoil surface. The flow is simulated with the numerical code Alya, which is a low-dissipation finite-element code, on a high-performance computing system. Various control strategies obtained through DRL led to 43.9% drag reduction, while others yielded an increase in aerodynamic efficiency of 58.6%. In comparison, periodic-control strategies demonstrated lower energy efficiency while failing to achieve the same level of aerodynamic improvements as the DRL-based approach. These gains have been attained through the implementation of a dynamic, closed-loop, time-dependent, active control mechanism over the airfoil.

physics.flu-dyn

Towards Active Flow Control Strategies Through Deep Reinforcement Learning

This paper presents a deep reinforcement learning (DRL) framework for active flow control (AFC) to reduce drag in aerodynamic bodies. Tested on a 3D cylinder at Re = 100, the DRL approach achieved a 9.32% drag reduction and a 78.4% decrease in lift oscillations by learning advanced actuation strategies. The methodology integrates a CFD solver with a DRL model using an in-memory database for efficient communication between

cs.LG

WaterLily.jl: A differentiable and backend-agnostic Julia solver for incompressible viscous flow around dynamic bodies

Integrating computational fluid dynamics (CFD) solvers into optimization and machine-learning frameworks is hampered by the rigidity of classic computational languages and the slow performance of more flexible high-level languages. In this work, we introduce WaterLily.jl: an open-source incompressible viscous flow solver written in the Julia language. An immersed boundary method is used to enforce the effect of solid boundaries on flow past complex geometries with arbitrary motions. The small code base is multidimensional, multiplatform and backend-agnostic, ie. it supports serial and multithreaded CPU execution, and GPUs of different vendors. Additionally, the pure-Julia implementation allows the solver to be fully differentiable using automatic differentiation. The computational cost per time step and grid point remains constant with increasing grid size on CPU backends, and we measure up to two orders of magnitude speed-up on a supercomputer GPU compared to serial CPU execution. This leads to comparable performance with low-level CFD solvers written in C and Fortran on research-scale problems, opening up exciting possible future applications on the cutting edge of machine-learning research.

physics.flu-dyn

Active flow control of a turbulent separation bubble through deep reinforcement learning

The control efficacy of classical periodic forcing and deep reinforcement learning (DRL) is assessed for a turbulent separation bubble (TSB) at $Re_\tau=180$ on the upstream region before separation occurs. The TSB can resemble a separation phenomenon naturally arising in wings, and a successful reduction of the TSB can have practical implications in the reduction of the aviation carbon footprint. We find that the classical zero-net-mas-flux (ZNMF) periodic control is able to reduce the TSB by 15.7%. On the other hand, the DRL-based control achieves 25.3% reduction and provides a smoother control strategy while also being ZNMF. To the best of our knowledge, the current test case is the highest Reynolds-number flow that has been successfully controlled using DRL to this date. In future work, these results will be scaled to well-resolved large-eddy simulation grids. Furthermore, we provide details of our open-source CFD-DRL framework suited for the next generation of exascale computing machines.

physics.flu-dyn

Active flow control for three-dimensional cylinders through deep reinforcement learning

This paper presents for the first time successful results of active flow control with multiple independently controlled zero-net-mass-flux synthetic jets. The jets are placed on a three-dimensional cylinder along its span with the aim of reducing the drag coefficient. The method is based on a deep-reinforcement-learning framework that couples a computational-fluid-dynamics solver with an agent using the proximal-policy-optimization algorithm. We implement a multi-agent reinforcement-learning framework which offers numerous advantages: it exploits local invariants, makes the control adaptable to different geometries, facilitates transfer learning and cross-application of agents and results in significant training speedup. In this contribution we report significant drag reduction after applying the DRL-based control in three different configurations of the problem.

physics.flu-dyn

WaterLily.jl: A differentiable fluid simulator in Julia with fast heterogeneous execution

Integrating computational fluid dynamics (CFD) software into optimization and machine-learning frameworks is hampered by the rigidity of classic computational languages and the slow performance of more flexible high-level languages. WaterLily.jl is an open-source incompressible viscous flow solver written in the Julia language. The small code base is multi-dimensional, multi-platform and backend-agnostic (serial CPU, multi-threaded, & GPU execution). The simulator is differentiable and uses automatic-differentiation internally to immerse solid geometries and optimize the pressure solver. The computational time per time step scales linearly with the number of degrees of freedom on CPUs, and we see up to a 182x speed-up using CUDA kernels. This leads to comparable performance with Fortran solvers on many research-scale problems opening up exciting possible future applications on the cutting edge of machine-learning research.

physics.flu-dyn

Deep reinforcement learning for flow control exploits different physics for increasing Reynolds-number regimes

Deep artificial neural networks (ANNs) used together with deep reinforcement learning (DRL) are receiving growing attention due to their capabilities to control complex problems. This technique has been recently used to solve problems related to flow control. In this work, an ANN trained through a DRL agent is used to perform active flow control. Two-dimensional simulations of the flow around a cylinder are conducted and an active control based on two jets located on the walls of the cylinder is considered. By gathering information from the flow surrounding the cylinder, the ANN agent is able to learn effective control strategies for the jets, leading to a significant drag reduction. In the present work, a Reynolds-number range beyond those previously considered is studied and compared with results obtained using classical flow-control methods. Significantly different nature in the control strategies is identified by the DRL as the Reynolds number Re increases. For Re <= 1000 the classical control strategy based on an opposition control relative to the wake oscillation is obtained. For Re = 2000 the new strategy consists of an energisation of the boundary layers and the separation area, which modulate the flow separation and reduce drag in a fashion similar to that of the drag crisis, through a high frequency actuation. A cross-application of agents is performed for a flow at Re = 2000, obtaining similar results in terms of drag reduction with the agents trained at Re = 1000 and 2000. The fact that two different strategies yield the same performance make us question whether this Reynolds number regime (Re = 2000) belongs to a transition towards a nature-different flow which would only admit a high-frequency actuation strategy to obtain drag reduction. This finding allows the application of ANNs trained at lower Reynolds numbers but comparable in nature, saving computational resources.

physics.flu-dyn

Modelling of Flow Past Long Cylindrical Structures

Turbulent flows are fundamental in engineering and the environment, but their chaotic and three-dimensional (3-D) nature makes them computationally expensive to simulate. In this work, a dimensionality reduction technique is investigated to exploit flows presenting an homogeneous direction, such as wake flows of extruded two-dimensional (2-D) geometries. First, we examine the effect of the homogeneous direction span on the wake turbulence dynamics of incompressible flow past a circular cylinder at $Re=10^4$. It is found that the presence of a solid wall induces 3-D structures even in highly constricted domains. The 3-D structures are rapidly two-dimensionalised by the large-scale K\'{a}rm\'{a}n vortices if the cylinder span is 50\% of the diameter or less, as a result of the span being shorter than the natural wake Mode B instability wavelength[...]. With this physical understanding, a 2-D data-driven model that incorporates 3-D effects, as found in the 3-D wake flow, is presented. The 2-D model is derived from a novel flow decomposition based on a local spanwise average of the flow, yielding the spanwise-averaged Navier-Stokes (SANS) equations[...]. A machine-learning (ML) model is employed to provide closure to the SANS equations. In the a-priori framework, the ML model yields accurate predictions of the SSR terms, in contrast to a standard eddy-viscosity model which completely fails to capture the closure term structures[...]. In the a-posteriori analysis, while we find evidence of known stability issues with long-time ML predictions for dynamical systems, the closed SANS equations are still capable of predicting wake metrics and induced forces with errors from 1-10%. This results in approximately an order of magnitude improvement over standard 2-D simulations while reducing the computational cost of 3-D simulations by 99.5%.

physics.flu-dyn

Span effect on the turbulence nature of flow past a circular cylinder

Turbulent flow evolution and energy cascades are significantly different in two-dimensional (2D) and three-dimensional (3D) flows. Studies have investigated these differences in obstacle-free turbulent flows, but solid boundaries have an important impact on the cross-over between 3D to 2D turbulence dynamics. In this work, we investigate the span effect on the turbulence nature of flow past a circular cylinder at Re=10000. It is found that even for highly anisotropic geometries, 3D small-scale structures detach from the walls. Additionally, the natural large-scale rotation of the K\'arm\'an vortices rapidly two-dimensionalises those structures if the span is 50% of the diameter or less. We show this is linked to the span being shorter than the Mode B instability wavelength. The conflicting 3D small-scale structures and 2D K\'arm\'an vortices result in 2D and 3D turbulence dynamics which can coexist at certain locations of the wake depending on the domain geometric anisotropy.

physics.flu-dyn

Deep learning of the spanwise-averaged Navier-Stokes equations

Simulations of turbulent fluid flow around long cylindrical structures are computationally expensive because of the vast range of length scales, requiring simplifications such as dimensional reduction. Current dimensionality reduction techniques such as strip-theory and depth-averaged methods do not take into account the natural flow dissipation mechanism inherent in the small-scale three-dimensional (3-D) vortical structures. We propose a novel flow decomposition based on a local spanwise average of the flow, yielding the spanwise-averaged Navier-Stokes (SANS) equations. The SANS equations include closure terms accounting for the 3-D effects otherwise not considered in 2-D formulations. A supervised machine-learning (ML) model based on a deep convolutional neural network provides closure to the SANS system. A-priori results show up to 92% correlation between target and predicted closure terms; more than an order of magnitude better than the eddy viscosity model correlation. The trained ML model is also assessed for different Reynolds regimes and body shapes to the training case where, despite some discrepancies in the shear-layer region, high correlation values are still observed. The new SANS equations and ML closure model are also used for a-posteriori prediction. While we find evidence of known stability issues with long time ML predictions for dynamical systems, the closed SANS simulations are still capable of predicting wake metrics and induced forces with errors from 1-10%. This results in approximately an order of magnitude improvement over standard 2-D simulations while reducing the computational cost of 3-D simulations by 99.5%.

physics.flu-dyn