Search for a command to run...
In computational fluid dynamics, complex geometries can be efficiently handled by embedding their surface representation into a Cartesian grid and enforcing boundary or interface conditions using immersed boundary methods. While this approach greatly simplifies mesh generation, it introduces two major challenges in large-scale parallel simulations. First, classical mesh partitioning strategies may allocate a significant fraction of the computational domain outside the physical domain, leading to unnecessary and sometimes prohibitive computational costs. Second, the interaction between complex geometries and Cartesian meshes may produce degenerate cells, which severely limits the robustness of the ghost-cell method when mesh refinement or geometry adaptation is not possible. In this work, we address both issues within a unified parallel framework. A scalable mesh partitioning strategy is first proposed, in which partition boundaries are dynamically adjusted to exclude subdomains lying entirely outside the physical domain. This slidingpartition approach significantly reduces the number of required processors while preserving load balance and parallel efficiency. The method is applied to complex two-and three-dimensional geometries and demonstrates low computational times up to 50 billion cells distributed over 500,000 partitions. Second, we introduce a geometry modification algorithm that locally adapts arbitrary 2D and 3D geometries to a given Cartesian mesh, ensuring the complete elimination of degenerate cells. The resulting geometries intersect each mesh cell through a single line segment in 2D or a continuous surface in 3D, thereby guaranteeing the robustness of ghost-cell formulations. The algorithm is fast, parallelizable, and applicable to any geometry-mesh combination. The combined approach enables robust and scalable ghost-cell immersed boundary simulations on Cartesian meshes. Its effectiveness is demonstrated through large-scale simulations of flow in porous media and haemodynamics in complex arterial networks.