As the need for handling complex geometries in computational fluid dynamics (CFD) grows, efficient and accurate mesh generation techniques become paramount. This study presents an adaptive mesh refinement (AMR) technology based on cell-based Cartesian grids, employing a distance-weighted least squares interpolation for finite difference discretization and utilizing immersed boundary methods for wall boundaries. This facilitates effective management of both transient and steady flow problems. Validation through supersonic flow over a forward-facing step, subsonic flow around a high Reynolds number NHLP airfoil, and supersonic flow past a sphere demonstrated AMR’s efficacy in capturing essential flow characteristics while wisely refining and coarsening meshes, thus optimizing resource utilization without compromising accuracy. Importantly, AMR simplified the capture of complex flows, obviating manual mesh densification and significantly improving the efficiency and reliability of CFD simulations.
To address the limitations of poor robustness, low efficiency, and memory waste in traditional Cartesian grid generation, this paper proposes targeted improvements focusing on three key aspects: the surface mesh data structure, the Cartesian grid data structure, and the determination of the spatial relationship between the grid and the object surface. Specifically, a nested bounding box-based binary tree is established to store discrete triangles, enhancing the efficiency and accuracy of triangle data access. Secondly, a “member packaging and neighbor threading” Cartesian grid structure is constructed, improving generation speed while reducing memory consumption. Thirdly, a comprehensive Cartesian cell classification method is developed, integrating intersection checks, interior/exterior classification, and intersected cell center assessment; three strategies are further proposed to accelerate intersection checks for large-scale grids. The performance of Cartesian grid generation is compared with traditional methods and the commercial CFD code. The results demonstrate a grid generation efficiency of less than two seconds per million cells, significantly outperforming traditional methods, with a 20% reduction in memory consumption. Finally, an airflow simulation past a train illustrates the suitability of the generated grids for practical computational applications.