Benchmarking for Fluid Simulation Computational Efficiency on CPU Platform
Yuchen Zhang, Xutun Wang, Quan Wen, Bing WangThis study presents a systematic benchmarking of programming languages and computational frameworks for computational fluid dynamics (CFD) simulations on CPU platforms. Using the Sod shock tube as a representative test case, the influence of programming languages and computational frameworks on computational efficiency was systematically evaluated while maintaining consistent numerical schemes and parallelization strategies. The evaluation compared Fortran, C++, and Python implementations, as well as the AMReX (Fortran and C++ interfaces) and JAX (Python interface) frameworks, under both finite difference (FDM) and finite volume (FVM) discretization. Results show that Fortran implementations perform better than C++ in procedural‐oriented FDM simulations, whereas C++ beats Fortran in object‐oriented FVM simulations. Python, although advantageous for prototyping, exhibits limited computational efficiency for intensive CFD tasks. In terms of parallelization, both OpenMP and MPI demonstrate strong performance; however, their sweet spots lie in different computational circumstances. At the framework level, AMReX consistently outperforms JAX, with the C++ interface showing the best overall performance. These findings underscore the intertwined impact of discretization methods, programming languages, and computational frameworks on CFD efficiency. The benchmarking provides actionable insights for selecting suitable programming paradigms and frameworks, with implications for optimizing next‐generation CFD applications on emerging hybrid hardware architectures such as GPUs and NPUs.