Table of Contents
Fetching ...

A Convolutional Neural Network Based Framework for Linear Fluid Dynamics

Kwame Agyei-Baah, Muhammad Rizwanur Rahman, E. R. Smith

TL;DR

This work addresses the challenge of making data-driven fluid dynamics models both generalisable and interpretable by training a CNN kernel to act as a numerical operator for finite-difference schemes. By using data from the 1D diffusion problems (Couette flow and Stokes’ second problem) and testing across numerical, analytical, and molecular-dynamics data, the authors demonstrate that the CNN can recover forward-Euler stencils and generalise to unseen boundary conditions while maintaining a transparent link to FD theory. The study shows that numCNN exactly reproduces FD coefficients and generalises well, anCNN can approximate analytical solutions with some limitations, and mdCNN can learn from noisy MD data, offering potential avenues to estimate effective viscosities. The results highlight the potential of interpretable ML-driven operators to bridge ML with classical CFD, while outlining limitations that motivate future work on nonlinear dynamics, Navier–Stokes, and PINN-based constraint enhancements.

Abstract

Fluid dynamics, for its strength in describing physical phenomena across vastly different scales from the cheerios effect on the breakfast table to the evolution of cosmic and quantum systems, has been called the 'queen mother' of science (Bush, 2015). However, a central challenge remains: ensuring the generalisability, interpretability and reliability of the machine learned models when applied to physical systems. To address this, we present a transparent approach that provides insights into how data-driven fluid dynamics and machine learning (ML) work. This is achieved by training a convolutional neural network (CNN) on data from a simple laminar fluid flow to behave as an operator that exactly matches the finite-difference numerics. Importantly, the model demonstrates strong generalisation capability by reproducing the dynamics for a wide range of distinct and unseen flow conditions within the same flow category. The CNN learns the forward Euler three-point stencil weights, capturing physical principles such as consistency and symmetry despite having only three tunable weights. Going beyond pure numerical training (numCNN), the approach is shown to work when trained on analytical (anCNN) and even molecular dynamics (mdCNN) data. In some cases, the physics is not captured, and thanks to the simple and interpretable form, these CNNs provide insight into the limits, pitfalls and best practice of data-driven fluid models. Because the approach is based on finite-difference operators and demonstrated with diffusive flow, it naturally extends to many structured-grid computational fluid dynamics (CFD) problems, including turbulent, multiphase, and multiscale flows.

A Convolutional Neural Network Based Framework for Linear Fluid Dynamics

TL;DR

This work addresses the challenge of making data-driven fluid dynamics models both generalisable and interpretable by training a CNN kernel to act as a numerical operator for finite-difference schemes. By using data from the 1D diffusion problems (Couette flow and Stokes’ second problem) and testing across numerical, analytical, and molecular-dynamics data, the authors demonstrate that the CNN can recover forward-Euler stencils and generalise to unseen boundary conditions while maintaining a transparent link to FD theory. The study shows that numCNN exactly reproduces FD coefficients and generalises well, anCNN can approximate analytical solutions with some limitations, and mdCNN can learn from noisy MD data, offering potential avenues to estimate effective viscosities. The results highlight the potential of interpretable ML-driven operators to bridge ML with classical CFD, while outlining limitations that motivate future work on nonlinear dynamics, Navier–Stokes, and PINN-based constraint enhancements.

Abstract

Fluid dynamics, for its strength in describing physical phenomena across vastly different scales from the cheerios effect on the breakfast table to the evolution of cosmic and quantum systems, has been called the 'queen mother' of science (Bush, 2015). However, a central challenge remains: ensuring the generalisability, interpretability and reliability of the machine learned models when applied to physical systems. To address this, we present a transparent approach that provides insights into how data-driven fluid dynamics and machine learning (ML) work. This is achieved by training a convolutional neural network (CNN) on data from a simple laminar fluid flow to behave as an operator that exactly matches the finite-difference numerics. Importantly, the model demonstrates strong generalisation capability by reproducing the dynamics for a wide range of distinct and unseen flow conditions within the same flow category. The CNN learns the forward Euler three-point stencil weights, capturing physical principles such as consistency and symmetry despite having only three tunable weights. Going beyond pure numerical training (numCNN), the approach is shown to work when trained on analytical (anCNN) and even molecular dynamics (mdCNN) data. In some cases, the physics is not captured, and thanks to the simple and interpretable form, these CNNs provide insight into the limits, pitfalls and best practice of data-driven fluid models. Because the approach is based on finite-difference operators and demonstrated with diffusive flow, it naturally extends to many structured-grid computational fluid dynamics (CFD) problems, including turbulent, multiphase, and multiscale flows.
Paper Structure (31 sections, 18 equations, 12 figures, 6 tables)

This paper contains 31 sections, 18 equations, 12 figures, 6 tables.

Figures (12)

  • Figure 1: Top panel illustrates the architecture of a 1D CNN and how CNN operation can be likened to a Forward Euler 3 point (FE3) stencil with respect to $u^t \to u^{t+1}$. The bottom panel shows how CNNs use convolution similar to the FE3 stencil which learns the differentiation operator as a form of edge detection in image processing.
  • Figure 2: Illustrations of two cases studied: (a) Wall-driven flow (Couette flow) and (b) Stokes' second problem. Simulation parameters for cases (a) and (b): $\mu=0.02$, $\Delta t=0.1$, $L_x=4.0$, $n_x=80$, total time $T=5000\,\Delta t$. Profiles at $t=\{0,T/6,T/2,T,2T\}$ are shown for both cases. (a) Wall-driven flow: top wall moves in $+x$ with $U_0=\sin((1.125 x+0.5)\pi)$; boundary values $u(0)=bBC=1$, $u(L_x)=tBC=0$. Curve labeled $t\to\infty$ is the steady Couette solution. For the Stokes' second problem in panel (b), $\omega=1$ and $\kappa = 0.7$.
  • Figure 3: A perspective view of the full MD system is illustrated in the left panel, with the red box shown in the middle highlighting the region used in the schematic, where the corresponding MD cells line up with the velocities (symbols) on the plot on the right at a range of times as multiples of $T=400 \Delta t$ compared to the analytical solution (lines). The start of the fluid domain is shown as zero to match the analytical solution with 3 MD cells below and 3 above. The analytical solution is matched to the MD fluid part in y with $L_{y_{fluid}}=37.4$, with half cell $\Delta y=1.44$ extra at top and bottom and $\mu=2.14$ with lines plotted at the same times in reduced units.
  • Figure 4: Time‐integration stencils and their coefficients: (a) Forward Euler uses a 3-point stencil, [1, –2, 1] and (b) a 5-point stencil, [–1, 16, –30, 16, –1] finite-difference scheme. The 3-point versions are second-order accurate in space, whereas, the 5-point versions achieve fourth-order spatial accuracy. The multi-timestep Adams–Bashforth employs analogous (c) 3-point, and (d) 5-point stencils, which offers second order temporal accuracy
  • Figure 5: (a) The contour plot shows the reference case studied here with initial condition : $u_0=\sin (2 \pi x)$ with boundary conditions, $bBC=0$ and $tBC=1.0$ trained on numerical solution (b) Training loss (left $y-$axis) and coefficient values for $u$ terms showing expecetd values $\boldsymbol{k} \to [0.0451,1-0.0902, 0.0451]$ (right $y-$axis) for 3-point Forward Euler kernel, (c) Evolution of training trajectories for 5 randomly initialised weights. For all these cases, parameters used for the reference case simulations are: $\mu = 0.02$, $\Delta t=0.1$, $n_x=20$, $L_x=4.0$, $N_t=200$, $bBC=0.0$, $tBC=1.0$ & $u(x,0) = \sin(2.0\pi x)$,
  • ...and 7 more figures