WorksPhysics and Astronomy
Cross-Model Verification of Wall-Bounded Flows using Finite-JAX
Abstract
Accurate prediction of wall-bounded flows remains central to advancing both theoretical understanding and computational methods in fluid mechanics. In this study, we perform a numerical simulation of channel flow using a complementary approach: a high-performance, differentiable finite-difference solver developed in JAX (Finite-JAX), and an analytical solution derived from the Navier-Stokes Equations, also known as the Hagen-Poiseuille equation. The solver is applied to the incompressible Navier-Stokes equations, along with appropriate boundary conditions, to capture canonical flow features, including velocity profiles and pressure gradients. Cross-model verification is conducted by systematically comparing numerical results between Finite-JAX and the analytical solution, with a focus on velocity distributions. In addition, numerical results are benchmarked against analytical solutions for the laminar regime, allowing direct quantification of the verification accuracy. Our findings demonstrate that cross-model verification not only strengthens confidence in simulation fidelity but also provides a pathway for integrating differentiable solvers with established computational fluid dynamics platforms, paving the way for future fluid flow research. The performance of Finite-JAX on Wall-Bounded Flows is 0.014765 in the L2 norm.
Nomenclature
| Variables | Subscripts and Superscripts | ||||
| velocity vector | x-coordinate | ||||
| time | y-coordinate | ||||
| density | ana | analytical solution | |||
| pressure | L2 norm | ||||
| kinematic viscosity | x-index | ||||
| forcing | y-index | ||||
| velocity in the x-direction | m/s | time-index | |||
| velocity in the y-direction | m/s | max | max value | ||
| x-component of direction | m | ||||
| y-component of direction | m | ||||
| PDE solution of the x-component | |||||
| dynamic viscosity | Pa·s | ||||
| y-direction of the channel/pipe | M | ||||
| loss | |||||
| courant number | |||||
| solution of the y-component |
Table 2.
Introduction
The accuracy of continuous-wall flow modeling poses a challenge in fluid mechanics, with applications ranging from aerospace vehicle design and pipe flow transport to biomedical flows and energy systems. Despite the simplicity of canonical configurations, channel flow demonstrates the complexities of boundary-layer physics, including the interplay between viscous and inertial forces, the development of velocity gradients, and the dependence of flow behavior on the Reynolds number [1, 2, 3]. As such, it frequently serves as a validation case for numerical methods and the use of turbulence models [4].
In recent decades, advances in computational fluid dynamics (CFD) have significantly enhanced the accuracy of simulations of wall-bounded flows [5]. Commercial software, such as ANSYS Fluent, has been widely adopted in industry and academia due to its mature finite-volume method, robust solvers, and extensions to turbulence models [6]. In parallel, advancements in programming have introduced a new class of solvers, facilitated by platforms such as JAX, TensorFlow, and PyTorch, which are designed for high-performance computing and support machine learning workflows [7, 8]. These solvers are particularly attractive for modern applications involving uncertainty quantification, data assimilation, and physics-informed neural networks (PINNs) [9, 10, 11, 12].
The emergence of numerical solvers, such as Finite-JAX—a high-performance, finite-difference CFD code developed in JAX—offers a way to integrate traditional numerical methods with differentiable programming capabilities [13, 14, 15, 16, 17, 18]. However, the reliability of these frameworks first requires systematic verification and validation against established commercial solvers and analytical solutions. Model-to-model verification provides a structured approach to evaluating new high-fidelity tools, ensuring that predictions are consistent with those of validated CFD software across scenarios from a range of canonical flows.
*Corresponding Author: [email protected]
METHODS & EQUATIONS
We solve the incompressible Navier-Stokes equations in 2-D (channel flow with periodicity in the stream direction, no-slip walls above and below), with the streamwise constant a body force (equivalent to a uniform pressure gradient):
Where , density , kinematic viscosity , and is a constant acceleration in the x-direction. In a fully developed laminar channel driven by a constant , the code sets so that the forcing term represents the pressure gradient.
Chorin Projection Operator Splitting Method
To enforce incompressibility at each step, the code uses a projection-splitting method introduced by Chorin, which uses the Poisson equation, which discretizes the source term b and assembles it with the following discretization:
On the grid (interior),
With this b, the pressure Poisson equation is discretised (five-point stencil) as:
Rearranged for Jacobi/Gauss-Seidel iteration:
*Corresponding Author: [email protected]
Boundary conditions for :
Periodic in : values at and wrap to and (implemented explicitly for the first/last columns).
Neumann at walls : .
Velocity – Momentum Step
After solving pressure, we proceed to calculate velocities explicitly using Euler's method, employing central differences for convection, the pressure gradient, and diffusion. For interior nodes:
Boundary conditions for :
No-slip walls : at and .
Periodic in : values at and are updated using wrapped neighbors.
Stopping Criterion
Analytical Benchmark | Plane Poiseuille Profile
With constant and no-slip at , the steady laminar solution is:
The code compares the numerical solution at a mid-plane to , and reports the error:
Stability
Spatial operators are second-order accurate (central differences); time integration is first-order.
Stability requires a suitable step obeying a CFL-like restriction combining convection and diffusion:
With typical choices, , for robustness.
Results and Discussion
Figure 1 shows the numerical solution of the streamwise velocity component, , in the canonical two-dimensional channel flow. The color map displays the velocity magnitude, with the darkest color indicating low velocity near the wall, where the velocity is zero, and the lightest color representing the stream flow velocity. The distribution reveals a parabolic velocity profile, consistent with the classical pressure-driven Poiseuille flow solution. The velocity decreases near the walls due to the no-slip condition, increases monotonically through the shearing layers, and reaches a maximum velocity at the channel center.
Figure 1. Channel Flow Contour in m/s
What is particularly interesting in this figure is the invariance of the velocity contours along the flow direction. They are spatially uniform and reflect the fully developed flow state, in which streamwise gradients vanish, and the dynamics reduce to a balance between pressure forcing and viscous dissipation. The color bar quantifies the velocity magnitude, ranging from zero at the wall to the free stream at the center, which agrees with the theoretically derived analytical solution and the expectations of the forcing.
This result highlights the solver's ability to recover the fundamental benchmark of incompressible fluid mechanics. The parabolic structure here evidently serves not only to verify the numerical discretization and boundary conditions, but also to demonstrate that simple geometries capture the essence of viscous transport phenomena. Broadly speaking, this simulation serves as a step toward more complex scenarios—such as unsteady, turbulent, or non-Newtonian—where deviations from parabolic patterns enrich the Multiphysics scale of wall-bounded flows.
| L2 Norm | Max Norm | Min Norm |
| 1.4765e-02 m/s | 2.1140e-02 m/s | 0.0000e+00 m/s |
Table 1. Error Norms
Figure 2 illustrates a direct comparison between the analytical solution of a developed Poiseuille flow and the numerical solution obtained by a JAX-based CFD solver. The horizontal axis represents the velocity component , and the vertical axis represents the wall-normal coordinate , extending from to , corresponding to the channel height. The analytical profile consists of discrete points, whereas the numerical solution represents a continuous curve.
Figure 2. Channel Flow Numerical vs. Analytical Solutions
The parabolic shape of the velocity distribution is immediately apparent. The velocity vanishes at the surfaces, reflecting the no-slip condition, and increases to a maximum at the channel center. This demonstrates pressure-driven laminar channel flow, where the balance between viscous diffusion and the pressure gradient is evident, with a quadratic dependence on . What is notable is the agreement between the two curves: the numerical solution obtained by coupling pressure and velocity reproduces the analytical results almost exactly, with a deviation that is imperceptible to the eye.
The agreement not only validates the correctness of the discretization and boundary conditions but also the implementation in the JAX solver, which precisely captures the pressure of the Poisson scheme and thereby preserves the incompressibility of fluid dynamics. This figure provides a strong benchmark; if the solver can replicate the canonical profile with high accuracy, one gains confidence in its application in more complex settings where analytical solutions do not exist. In computational fluid dynamics, verifying fundamental solutions is essential before extending numerical methods to the transition and turbulent regimes.
*Corresponding Author: [email protected]
Figure 3 presents a quantitative comparison of the wall times for computing the Euler discretization on different hardware accelerators. The left figure shows GPU-based performance, while the right shows TPU and CPU execution times. The vertical axis shows wall time in seconds, a measure of computational efficiency, and the horizontal axis identifies the hardware platform on which the code runs.
Figure 3. (a) Euler: GPU Compute Wall-Times and (b) Euler: TPU and CPU Compute Wall-Times
In the computing benchmarks, three architectures are examined: the A100, L4, and T4 GPUs. Somewhat counterintuitively, the A100, the flagship of GPU performance, takes the longest to compute, approximately 6.2 seconds, whereas the smaller T4 card yields faster results at approximately 4.4 seconds. The L4 takes approximately 4.7 seconds, which is in the middle of the two. The inversion of expectations demonstrates the interplay between algorithm structure, memory access patterns, and GPU architecture. This reflects the fact that capability does not translate directly into speedups, particularly in the structure of discrete Euler PDE solvers. These tests were performed using 64-bit double precision.
The TPU and CPU benchmarks reveal a complementary comparison. The v6e-1 TPU achieves the shortest computational time, approximately 0.935 seconds, which is less than the v5e-1 TPU (1.133 seconds) and
*Corresponding Author: [email protected] the CPU (1.585 seconds). Here, hierarchical preemption is preserved: tensor processing is faster than general-purpose CPUs. The difference between v6e-1 and v5e-1 illustrates the gains in the hierarchy of successive generations of TPUs, offering reduced computation time for PDEs.
Together with the figures, this lesson is essential for scientific computing: performance is not only determined by peak FLOP counts, but also by hardware design, memory hierarchy, and algorithm structure. For PDE solvers, these results demonstrate the need for portable algorithms that efficiently adapt to heterogeneous architectures, thereby enhancing the fidelity and speed of flow and other simulation applications.
Conclusion
A two-dimensional incompressible Navier–Stokes solver based on the Chorin projection method was developed and validated for wall-bounded flows. The numerical formulation successfully captured velocity gradients in the boundary layer, with plane Poiseuille flow serving as a verification case. The stability limits imposed by the CFL condition were confirmed, and the efficiency of Jacobi and Gauss–Seidel iterations in solving the pressure Poisson equation was demonstrated.
Beyond classical CFD methods, this work highlights the advantages of integrating modern computational frameworks, such as JAX, into traditional solvers. These platforms enable scalable, differentiable simulations and provide a pathway toward machine learning-accelerated CFD. Future studies will extend the solver to three-dimensional turbulence, incorporate GPU-based acceleration, and develop hybrid ML–CFD strategies for large-scale wall-bounded flow applications.
Acknowledgment
This project utilized Prof. Arturo Rodriguez's Startup funds, which Texas A&M University-Kingsville, the Department of Mechanical and Industrial Engineering, and the College of Engineering granted. This project was also supported by the DOE NNSA/MSIPP Grande CARES Consortium (GRANT13584020).
Appendix
| Name | Symbol | Value | Units | Notes |
| Grid points in x | nx | 41 | - | Number of nodes along x |
| Grid points in y | ny | 41 | - | Number of nodes along y |
| Pressure Poisson Iterations | nit | 80 | - | Jacobi-like iterations per pressure solve |
| Domain Height | H | 2.0 | m | Domain spans |
| Grid spacing in x | dx | 0.05 | length | Uniform spacing |
| Grid spacing in y | dy | 0.05 | length | Uniform spacing |
| Density | rho | 2.0 | kg/m^3 | Fluid density |
| Kinematic viscosity | nu | 0.01 | m^2/s | Viscosity is used in momentum diffusion |
| Dynamic viscosity | mu | 0.02 | Pa-s | Appears in analytical solution |
Table 3.
*Corresponding Author: [email protected]
| Body-force acceleration | F | 1.0 | m/s^2 | Constant x-direction forcing |
| Pressure gradient | dpdx | 2.0 | Pa/m | Equivalent constant dpdx driving the flow |
| Time step | dt | 0.1 | s | Explicit update step for u,v |
| Initial u field | u0 | zeros((ny,nx)) | - | Starts at rest |
| Initial v field | v0 | zeros((ny,nx)) | - | Starts at rest |
| Initial pressure | p0 | ones((ny,nx)) | - | Uniform initial guess |
| Convergence tolerance | tol | 1e-6 | - | Relative change threshold on sum(u) |
| Max iteration steps | max_steps | 100000 | - | Safety cap for while-loop convergence |
| JAX precision | jax_enable_x64 | True | - | Use float64 for better stability |
| JAX platform | jax_platform_name | cpu | - | Can be changed to “gpu” if available |
Table 4.
References
- [1]Moser, R. D., Kim, J., & Mansour, N. N. (1999). Direct numerical simulation of turbulent channel flow up to Re= 590. Phys. fluids, 11(4), 943-945.
- [2]Kim, J., Moin, P., & Moser, R. (1987). Turbulence statistics in fully developed channel flow at low Reynolds number. Journal of fluid mechanics, 177, 133-166.DOI
- [3]Tatsumi, T., & Yoshimura, T. (1990). Stability of the laminar flow in a rectangular duct. Journal of Fluid Mechanics, 212, 437-449.DOI
- [4]Tsukahara, T., & Kawamura, H. (2014). Turbulent heat transfer in a channel flow at transitional Reynolds numbers. arXiv preprint arXiv:1406.0959.arxiv.org/abs/1406.0959
- [5]Bose, S. T., & Park, G. I. (2018). Wall-modeled large-eddy simulation for complex turbulent flows. Annual review of fluid mechanics, 50, 535-561.DOI
- [6]Jia, R., Kamel, M. S., Wu, C., & Agrawal, B. (2025). Ansys Fluent HPC for Large-Scale CFD Simulations. In AIAA SCITECH 2025 Forum (p. 1950).DOI
- [7]Brunton, S. L., Noack, B. R., & Koumoutsakos, P. (2020). Machine learning for fluid mechanics. Annual review of fluid mechanics, 52(1), 477-508.
- [8]Rodriguez, A., Chattopadhyay, A., Kumar, P., Rodriguez, L. F., & Kumar, V. (2024). Partition of Unity Physics-Informed Neural Networks (POU-PINNs): An Unsupervised Framework for Physics-Informed Domain Decomposition and Mixtures of Experts. arXiv preprint arXiv:2412.06842.arxiv.org/abs/2412.06842
- [9]Eivazi, H., Tahani, M., Schlatter, P., & Vinuesa, R. (2022). Physics-informed neural networks for solving Reynolds-averaged Navier–Stokes equations. Physics of Fluids, 34(7).DOI
- [10]Wu, J. L., Xiao, H., & Paterson, E. (2018). Physics-informed machine learning approach for augmenting turbulence models: A comprehensive framework. Physical Review Fluids, 3(7), 074602.
- [11]Yang, X. I. A., Zafar, S., Wang, J. X., & Xiao, H. (2019). Predictive large-eddy-simulation wall modeling via physics-informed neural networks. Physical Review Fluids, 4(3), 034602.DOI
- [12]Raissi, M., Perdikaris, P., & Karniadakis, G. E. (2019). Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational physics, 378, 686-707.DOI
- [13]Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary, C., Maclaurin, D., ... & Zhang, Q. (2018). JAX: composable transformations of Python+ NumPy programs.
- [14]Shang, W., Zhou, J., Panda, J. P., Xu, Z., Liu, Y., Du, P., ... & Luo, T. (2025). JAX-BTE: a GPU-accelerated differentiable solver for phonon Boltzmann transport equations. npj Computational Materials, 11(1), 129.arxiv.org/abs/2503.23657
- [15]Bezgin, D. A., Buhendwa, A. B., & Adams, N. A. (2023). JAX-Fluids: A fully-differentiable high-order computational fluid dynamics solver for compressible two-phase flows. Computer Physics Communications, 282, 108527.DOI
- [16]Bezgin, D. A., Buhendwa, A. B., & Adams, N. A. (2025). JAX-Fluids 2.0: towards HPC for differentiable CFD of compressible two-phase flows. Computer Physics Communications, 308, 109433.
- [17]Xue, T., Liao, S., Gan, Z., Park, C., Xie, X., Liu, W. K., & Cao, J. (2023). JAX-FEM: A differentiable GPU-accelerated 3D finite element solver for automatic inverse design and mechanistic data science. Computer Physics Communications, 291, 108802.DOI
- [18]Wang, W., Zhang, X., Bezgin, D., Buhendwa, A., Chu, X., & Weigand, B. (2024). JAX-based differentiable fluid dynamics on GPU and end-to-end optimization. arXiv preprint arXiv:2406.19494.arxiv.org/abs/2406.19494