CFD boundary processing acceleration method based on GPU parallelism
By integrating boundary surface cell data for parallel computation, the problem of low computational efficiency in CFD boundary processing methods is solved, achieving faster GPU boundary processing speed and higher computational efficiency.
Patent Information
- Application Number
- CN202511616352.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-06
AI Technical Summary
Existing CFD boundary handling methods are computationally inefficient in GPU parallel computing, especially under complex models and multi-boundary conditions where kernel function calls are frequent, leading to performance bottlenecks and additional time overhead.
By integrating boundary surface cell data, establishing a boundary pointer array, and utilizing the GPU for parallel computation, virtual functions are used to handle boundary conditions, reducing kernel function calls, and thus achieving unified parallel computation of boundary surface cells.
It improves computation speed, reduces kernel function call overhead, fully utilizes GPU computing power, is applicable to meshes of various boundary types, and has the advantages of versatility and ease of implementation.
Smart Images

Figure CN121480368A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for accelerating CFD boundary processing, and more particularly to a GPU-parallel method for accelerating CFD boundary processing, belonging to the field of computational technology related to fluid mechanics. Background Technology
[0002] Computational fluid dynamics (CFD) simulation involves numerically solving various fluid dynamics governing equations to simulate fluid flow. CFD calculations primarily focus on two aspects: computational accuracy and computational speed. As CPU manufacturing processes become increasingly complex, Moore's Law for CPU performance growth is gradually slowing. Due to persistently high power consumption, supercomputer performance development has encountered a bottleneck. Adopting heterogeneous computing architectures to accelerate computation and reduce power consumption has become a development trend for supercomputers. Especially in the current phase of rapid development in the field of artificial intelligence, the advantages of graphics processing units (GPUs) are even more pronounced. To adapt to new processor architectures, developing GPU-based parallel CFD software has become paramount.
[0003] Compared to the distributed memory model of the Message Passing Interface (MPI), the Unified Computing Device Architecture (CUDA) features shared memory parallelism. In the entire solution process, sub-functions can be categorized into four types. To achieve GPU-based CFD software acceleration, different processing methods are needed depending on the characteristics of each sub-function. The first type is independent computation between cells, such as calculating local time steps and updating flow field physical quantities. This allows each thread to be mapped to data from each cell, fully leveraging the parallel processing capabilities of the GPU. The second type is flux computation, such as inviscid flux computation, viscous flux computation, and derivative computation, which considers unstructured networks. The characteristics of lattice solvers are as follows: During flux calculation, each facet requires operations such as element number indexing, element data indexing, and face data indexing. Excessive GPU memory reads degrade performance, necessitating data structure alignment to reduce data I / O time. The third category is reduction computation, such as residual value calculation and aerodynamic calculation. Since reduction operations operate on each element in an array and ultimately yield a unique value, in data-parallel scenarios, it's crucial that threads cannot modify the unique value simultaneously; they must modify it in a specific order. Reduction computation methods can utilize the GPU's __syncthreads... Shared memory enables thread synchronization within thread blocks and shared data access operations within thread blocks. The fourth type is fragmented data computation, which is easily overlooked. For example, boundary condition updates require traversing all boundary surface cells and updating the physical quantities of virtual cells according to different boundary conditions. The usual approach is to traverse all boundaries and call different kernel functions to complete parallel computation based on the boundary type, such as far-field kernel functions, object surface kernel functions, and symmetry surface kernel functions. However, due to the uneven number of boundary surfaces and repeated calls to kernel functions, the software cannot fully utilize the large-scale data parallelism capabilities of the GPU and incurs additional time overhead. At the same time, as the complexity of the model increases and the number of components monitoring aerodynamics increases, the number of boundaries in the flow field simulated by CFD can reach tens or hundreds, which leads to a high degree of data fragmentation in parallel computation. In addition, repeated calls to kernel functions bring high kernel function startup time overhead, GPU thread scheduling, and context switching time overhead.
[0004] In summary, a GPU-based parallel CFD boundary processing acceleration method is needed. Summary of the Invention
[0005] A brief overview of the invention is given below to provide a basic understanding of certain aspects of it. It should be understood that this overview is not an exhaustive summary of the invention. It is not intended to identify key or essential parts of the invention, nor is it intended to limit the scope of the invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to the more detailed description that follows.
[0006] In view of this, in order to solve the problem of low computational efficiency of traditional CFD boundary processing acceleration methods in the prior art, the present invention provides a GPU-parallel CFD boundary processing acceleration method.
[0007] The technical solution is as follows: A GPU-parallel CFD boundary processing acceleration method, comprising the following steps:
[0008] S1. Generate the computational grid required for simulating the flow field, and read the grid information and boundary condition information for the computational simulation;
[0009] S2. Initialize the flow field according to the calculation parameters, copy the flow field data and flow field boundary information from main memory to video memory, create a boundary pointer array in video memory, and instantiate the boundary pointed to by each pointer;
[0010] S3. Based on the boundary pointer array, flow field data, and flow field boundary information, the GPU is used to perform time-step loop calculations to update the physical quantities of the virtual units corresponding to the boundaries of the threads;
[0011] S4. After the time-step loop calculation converges, copy the flow field data from the video memory to the main memory to complete the flow field simulation calculation.
[0012] Furthermore, step S2 includes the following steps:
[0013] S21. Initialize the flow field according to the calculation parameters, and copy the calculation parameters, mesh information, flow field information, and boundary information from main memory to video memory;
[0014] S22. Based on boundary information, establish the data structure required for GPU parallel computing, which includes two one-dimensional arrays;
[0015] Specifically: integrate the arrays of face cells from different boundaries into a one-dimensional array A containing all the face cells of all boundaries, and create a one-dimensional array B containing the number of face cells of each boundary face, resulting in two one-dimensional arrays;
[0016] S23. Use classes to encapsulate data and functions under different boundary conditions, and use the boundary class as the base class;
[0017] Specifically: Boundary class data includes the current boundary type, current boundary number, and current number of boundary faces; boundary class includes virtual functions.
[0018] S24. Instantiate the class in video memory, that is, create an array of boundary pointers in video memory, and construct the boundary pointed to by each pointer by calling the kernel function.
[0019] Furthermore, step S3 includes the following steps:
[0020] S31. Utilize GPU for time-step cyclic calculation, which includes parallel residual calculation, flow field update, and boundary condition update;
[0021] S32. During the boundary condition update process, the thread uses the pointer corresponding to the boundary surface to call the virtual function, jumps into the boundary condition processing method in the boundary subclass to update the physical quantity of the corresponding boundary virtual unit;
[0022] Specifically, the boundary condition handling method involves calling a kernel function to perform GPU parallel computation on all boundary surface units. In the kernel function, each thread determines the position of the boundary surface unit in the one-dimensional array A by mapping its own thread number to the boundary surface unit. The boundary surface corresponding to the thread is determined by the position information and the one-dimensional array B.
[0023] The beneficial effects of this invention are as follows: In the flow field initialization stage, this invention integrates the surface element data of different boundary surfaces and utilizes kernel functions to complete parallel computing on the GPU. By increasing the scale of processed data, it more fully leverages the GPU's computing power and improves the computing speed. This invention completes parallel computing of all boundary surface elements using only one kernel function call, reducing kernel function call overhead compared to the frequent kernel function calls in traditional methods, thus making the computing speed no longer affected by the number of boundary surfaces. The method proposed in this invention uses meshes including but not limited to one-dimensional, two-dimensional, and three-dimensional meshes, and the boundary conditions used are applicable to all boundary types, possessing universality. The method proposed in this invention requires less modification than the original GPU boundary condition update method, is simple in principle, and easy to implement. Attached Figure Description
[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0025] Figure 1 This is a flowchart example of a GPU-parallel CFD boundary processing acceleration method;
[0026] Figure 2 This is a schematic diagram of an embodiment of a GPU-based parallel CFD boundary processing acceleration method;
[0027] Figure 3 This is a comparative diagram showing the single-step time for processing different numbers of boundary grid cells using the method of this invention and the original method, given a fixed number of boundaries.
[0028] Figure 4 This diagram illustrates a comparison of the single-step time for processing different numbers of boundaries using the method of this invention and the original method, given a fixed number of boundary grid cells. Detailed Implementation
[0029] To make the technical solutions and advantages of the embodiments of the present invention clearer, the exemplary embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0030] refer to Figures 1-4 This embodiment describes a GPU-parallel CFD boundary processing acceleration method, which specifically includes the following steps:
[0031] S1. Generate the computational grid required for simulating the flow field using mesh generation software, and read the mesh information and boundary condition information for the computational simulation;
[0032] S2. Initialize the flow field according to the calculation parameters, copy the flow field data and flow field boundary information from main memory to video memory, create a boundary pointer array (base class) in video memory, and instantiate (subclass) the boundary pointed to by each pointer.
[0033] S3. Based on the boundary pointer array, flow field data, and flow field boundary information, the GPU is used to perform time-step loop calculations to update the physical quantities of the virtual units corresponding to the boundaries of the threads;
[0034] S4. After the time-step loop calculation converges, copy the flow field data from the video memory to the main memory to complete the flow field simulation calculation.
[0035] Specifically, the computational grid is generated based on the physical model. The computational grid discretizes the continuous fluid domain into finite element geometry; the boundary conditions are physical constraints defined on the boundary of the computational domain to describe the behavior of the fluid at the boundary.
[0036] The computational grids generated in step one for flow field simulation include, but are not limited to, one-dimensional, two-dimensional, and three-dimensional grids.
[0037] Furthermore, step S2 includes the following steps:
[0038] S21. Initialize the flow field according to the calculation parameters, and copy the calculation parameters, mesh information, flow field information, and boundary information from main memory to video memory;
[0039] S22. Based on boundary information, establish the data structure required for GPU parallel computing, which includes two one-dimensional arrays;
[0040] Specifically: integrate the arrays of face cells with different boundaries into a one-dimensional array A containing all the face cells of all boundaries, and create a one-dimensional array B containing the number of face cells of each boundary face, resulting in two one-dimensional arrays used to determine the boundary conditions corresponding to the face cells;
[0041] S23. Use classes to encapsulate data and functions under different boundary conditions, and use the boundary class as the base class;
[0042] Specifically: The boundary class data includes the current boundary type, the current boundary number, and the current number of boundary faces. The boundary class includes virtual functions for updating boundary conditions. Different boundary conditions, such as far-field boundaries, object surface boundaries, and symmetry surface boundaries, are subclasses that inherit from the boundary class. Different boundary classes contain corresponding data and methods. For example, the far-field boundary class contains far-field data and far-field boundary update functions.
[0043] S24. Instantiate the class in video memory, that is, create an array of boundary pointers (base class) in video memory, and construct the boundary pointed to by each pointer by calling the kernel function (subclass).
[0044] Furthermore, step S3 includes the following steps:
[0045] S31. Utilize GPUs for time-step cyclic calculations, including parallel residual calculations, flow field updates, and boundary condition updates;
[0046] S32. During the boundary condition update process, the thread uses the pointer corresponding to the boundary surface to call the virtual function, jumps into the boundary condition processing method in the boundary subclass to update the physical quantity of the corresponding boundary virtual unit;
[0047] Specifically, the boundary condition handling method involves calling a kernel function to perform GPU parallel computation on all boundary surface units. In the kernel function, each thread determines the position of the boundary surface unit in the one-dimensional array A by mapping its own thread number to the boundary surface unit. The boundary surface corresponding to the thread is determined by the position information and the one-dimensional array B.
[0048] Specifically, to illustrate the application and acceleration effect of the present invention, numerical simulations of three models are used as examples: two-dimensional airfoil RAE2822, three-dimensional model ONERAM6, and three-dimensional high-lift model HiLift. The computing hardware uses NVIDIA GPU cards.
[0049] Computational mesh and boundary information: RAE2822 airfoil standard model, 59589 mesh elements, 1114 boundary mesh elements, 3 boundary conditions; ONERAM6 3D model, 4113971 mesh elements, 84338 boundary mesh elements, 3 boundary conditions; HiLift 3D high-lift model, 21868681 mesh elements, 473201 boundary mesh elements, 3, 7, and 11 boundary conditions;
[0050] refer to Figure 2 The diagram shows a comparison of the single-step time for processing different numbers of boundary grid cells using the method of this invention and the original method under the condition of a certain number of boundaries (three boundaries). The horizontal axis represents the number of boundary surface grid cells, and the vertical axis represents the time spent on boundary processing in a single step. It can be seen from the figure that, regardless of the model, even when the number of boundaries is small, the method of this invention takes less time than the original boundary processing method, and has a good acceleration effect.
[0051] refer to Figure 3 The diagram shows a comparison of the single-step time for processing different numbers of boundaries using the method of this invention and the original method under a certain boundary mesh element (473,201 elements) in the 3D high-lift model HiLift. The horizontal axis represents the number of boundaries, and the vertical axis represents the time spent on boundary processing in a single step. As can be seen from the figure, as the number of boundaries increases, the time spent on the original boundary processing method increases significantly. The method of this invention takes less time than the original method, and the time is basically unchanged with the number of boundaries.
[0052] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A GPU parallel-based CFD boundary processing acceleration method, characterized in that, The method comprises the following steps: S1. generating a calculation grid required for simulating a flow field, reading grid information and boundary condition information for calculation simulation; S2. initializing the flow field according to calculation parameters, copying flow field data and flow field boundary information from the main memory to the display memory, establishing a boundary pointer array in the display memory, and instantiating each boundary pointed to by the pointer; S3. performing time step loop calculation by using the GPU according to the boundary pointer array, the flow field data and the flow field boundary information, and realizing physical quantity updating of a thread corresponding to a boundary virtual unit; S4. after the time step loop calculation converges, copying the display memory flow field data to the main memory, and completing flow field simulation calculation.
2. The GPU parallel-based CFD boundary processing acceleration method according to claim 1, wherein, In S2, the following steps are included: S21. initializing the flow field according to calculation parameters, and copying calculation parameters, grid information, flow field information and boundary information from the main memory to the display memory; S22. establishing a data structure required for GPU parallel calculation based on the boundary information, which includes two one-dimensional arrays; Specifically: integrating face unit arrays of different boundaries into a one-dimensional array A containing face units of all boundaries, establishing a one-dimensional array B of the number of face units contained by each boundary face, and obtaining two one-dimensional arrays; S23. encapsulating data and functions of different boundary conditions by using a class, and taking the boundary class as a base class; Specifically: the data of the boundary class includes a current boundary type, a current boundary number and a current boundary face number, and the boundary class includes a virtual function; S24. instantiating the class in the display memory, that is, establishing a boundary pointer array in the display memory, and completing construction of the boundary pointed to by each pointer by calling a kernel function.
3. The GPU parallel-based CFD boundary processing acceleration method according to claim 2, wherein, In S3, the following steps are included: S31. performing time step loop calculation by using the GPU, which includes residual parallel calculation, flow field updating and boundary condition updating; S32. in the boundary condition updating process, a thread calls a virtual function by using a pointer corresponding to the boundary face, jumps into a boundary condition processing method in a boundary subclass, and realizes physical quantity updating of the thread corresponding to the boundary virtual unit; Specifically: the boundary condition processing method is a kernel function for GPU parallel calculation of all boundary face units, in which each thread judges a position of the boundary face unit in the one-dimensional array A through a mapping relationship between the thread number and the boundary face unit, and judges a boundary face corresponding to the thread through position information and the one-dimensional array B.
Citation Information
Cited By
Large volume grid block data structure based on GPU and subdivision acceleration method
CN121980061A
A large body grid partitioning data structure and subdivision acceleration method based on GPU
CN121980061B