Table of Contents
Fetching ...

Learning second-order TVD flux limiters using differentiable solvers

Chenyang Huang, Amal S. Sebastian, Venkatasubramanian Viswanathan

TL;DR

This work tackles oscillations in high-order schemes for hyperbolic conservation laws by learning a second-order TVD flux limiter within a differentiable finite-volume solver. The limiter is parameterized as a convex neural combination of the Minmod and Superbee limiters, with a neural network determining the convex weight from the local slope ratio and constrained to maintain TVD and symmetry. Through differentiable simulations and gradient-based training, the approach achieves strong generalization across linear advection, Burgers’ equation, Euler Sod’s problem, and even a 2D Riemann test, often matching or surpassing classical limiters while remaining compatible with production codes like OpenFOAM. The method enables data-driven, physically constrained design of flux limiters and paves the way for end-to-end optimization of CFD solvers for complex flows.

Abstract

This paper presents a data-driven framework for learning optimal second-order total variation diminishing (TVD) flux limiters via differentiable simulations. In our fully differentiable finite volume solvers, the limiter functions are replaced by neural networks. By representing the limiter as a pointwise convex linear combination of the Minmod and Superbee limiters, we enforce both second-order accuracy and TVD constraints at all stages of training. Our approach leverages gradient-based optimization through automatic differentiation, allowing a direct backpropagation of errors from numerical solutions to the limiter parameters. We demonstrate the effectiveness of this method on various hyperbolic conservation laws, including the linear advection equation, the Burgers' equation, and the one-dimensional Euler equations. Remarkably, a limiter trained solely on linear advection exhibits strong generalizability, surpassing the accuracy of most classical flux limiters across a range of problems with shocks and discontinuities. The learned flux limiters can be readily integrated into existing computational fluid dynamics codes, and the proposed methodology also offers a flexible pathway to systematically develop and optimize flux limiters for complex flow problems.

Learning second-order TVD flux limiters using differentiable solvers

TL;DR

This work tackles oscillations in high-order schemes for hyperbolic conservation laws by learning a second-order TVD flux limiter within a differentiable finite-volume solver. The limiter is parameterized as a convex neural combination of the Minmod and Superbee limiters, with a neural network determining the convex weight from the local slope ratio and constrained to maintain TVD and symmetry. Through differentiable simulations and gradient-based training, the approach achieves strong generalization across linear advection, Burgers’ equation, Euler Sod’s problem, and even a 2D Riemann test, often matching or surpassing classical limiters while remaining compatible with production codes like OpenFOAM. The method enables data-driven, physically constrained design of flux limiters and paves the way for end-to-end optimization of CFD solvers for complex flows.

Abstract

This paper presents a data-driven framework for learning optimal second-order total variation diminishing (TVD) flux limiters via differentiable simulations. In our fully differentiable finite volume solvers, the limiter functions are replaced by neural networks. By representing the limiter as a pointwise convex linear combination of the Minmod and Superbee limiters, we enforce both second-order accuracy and TVD constraints at all stages of training. Our approach leverages gradient-based optimization through automatic differentiation, allowing a direct backpropagation of errors from numerical solutions to the limiter parameters. We demonstrate the effectiveness of this method on various hyperbolic conservation laws, including the linear advection equation, the Burgers' equation, and the one-dimensional Euler equations. Remarkably, a limiter trained solely on linear advection exhibits strong generalizability, surpassing the accuracy of most classical flux limiters across a range of problems with shocks and discontinuities. The learned flux limiters can be readily integrated into existing computational fluid dynamics codes, and the proposed methodology also offers a flexible pathway to systematically develop and optimize flux limiters for complex flow problems.

Paper Structure

This paper contains 22 sections, 41 equations, 10 figures, 5 tables.

Figures (10)

  • Figure 1: A sketch of the second-order TVD region (shaded area), together with the classical flux limiters Minmod, Superbee, and van Leer.
  • Figure 2: A schematic diagram of the differentiable simulation for learning second-order TVD flux limiters. The black solid arrows represent the forward pass to calculate the loss while the gray and red dashed arrows represent the backward pass to compute the gradients to update the parameters of the neural network $f_{\theta}$. At each time step, the smoothness measure $r^{n}$ at cell interfaces is calculated using the current states $Q^{n}$. The neural network $f_{\theta}$ takes $r^{n}$ as input and outputs the value $\phi^{n}$, which is used to evaluate the second-order correction term added to the underlying first-order flux. The states $Q^{n+1}$ at the next time step is then updated by the total flux $F^{n}$. The solution trajectory is propagated until prescribed time steps and the loss is evaluated with respect to the exact solution. The loss can be backpropagated through time using automatic differentiation to update the parameters of the neural flux limiter $f_{\theta}$ as all parts of the solution algorithm are fully differentiable.
  • Figure 3: Visualization of the final density, velocity, and pressure profiles of the training dataset on Sod's shock tube problem with different initial states. All of the solutions in the dataset contain three different characteristics including the rarefaction wave, the contact discontinuity, and the shock discontinuity.
  • Figure 4: The learned flux limiter for the linear advection problem trained on the dataset from PDEBench takamoto2022pdebench. (a) Comparison of the neural flux limiter with several classical flux limiters: Minmod, van Leer, and Superbee. Its position within the second-order TVD region demonstrates that the neural flux limiter is both second-order accurate and TVD-compliant. (b) The neural flux limiter function $\phi(r)$ shows perfect agreement with the curve $r\phi(1/r)$, indicating that the symmetry property $\phi(r)/r = \phi(1/r)$ is satisfied. This suggests that the neural network can learn symmetry purely from the data.
  • Figure 5: The performance of the neural flux limiter on linear advection equation with in-distribution initial conditions compared to other classical flux limiters. The solutions are obtained by advecting the initial conditions over one time period with 128 cells. (a) A single sinusoidal wave. (b) A superposition of two sinusoidal waves with absolute value function applied. (c) A superposition of two sinusoidal waves with absolute value function and window function applied.
  • ...and 5 more figures