A gpu accelerated density based solver system and method of implementing the same

CN122691785BActive Publication Date: 2026-10-09NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511917799.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-10-09
Estimated Expiration
2045-12-18

AI Technical Summary

Technical Problem

现有GPU-CFD研究主要聚焦于单相流或压力基多相流求解器,而这些求解器缺乏可压缩两相流系统中密度基方法所涉及的复杂波-界面耦合关系与严格守恒约束

Benefits of technology

[0015]The aforementioned GPU-accelerated density-based solver system and its implementation method, firstly, break the tight coupling limitations of traditional CPU frameworks through the modular and scalable design of the general partial differential equation solving framework. Its object-oriented abstract interface design decouples the computational system from the discrete method, providing a flexible and stable infrastructure for the customized development of density-based two-phase flow solvers. This avoids the problems of poor scalability and high cost of adapting to new algorithms/models caused by functional coupling in traditional CPU frameworks, laying a modular foundation for the subsequent integration of GPU acceleration technologies. Secondly, the GPU memory management strategy, based on a pre-allocated GPU memory pool using offsets, eliminates the high overhead of frequent dynamic memory allocation in CUDA and avoids memory fragmentation. Structured data layout and pre-copying of mesh metadata ensure that GPU threads access mesh attributes and physical quantities in merged memory, maximizing memory bandwidth utilization. Simultaneously, it simplifies CPU-GPU data transfer to a one-time operation during the initialization phase, significantly reducing the time consumption of repeated data movement in traditional CPU frameworks. Finally, the discretization method based on grid cell looping allocates independent grid cells to each GPU thread, allowing each thread to traverse its assigned face to complete the computation. This avoids non-merged memory access caused by face looping and eliminates data races at the source, ensuring computational correctness without the need for atomic operations. This computational mode, highly compatible with the GPU's many-core architecture, fully unleashes the GPU's parallel computing potential, achieving orders-of-magnitude improvements in computational efficiency in core areas such as gradient calculation and throughput processing compared to the serial or inefficient parallel face looping of traditional CPU frameworks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122691785B_ABST
    Figure CN122691785B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of GPU acceleration density-based solver system and its implementation method.The system includes: model and algorithm module, based on the discrete method public interface of general partial differential equation solving framework is constructed, and integrated density-based algorithm and four-equation model and six-equation model, to realize the solution of two-phase flow problem;GPU acceleration module includes memory management unit, for creating pre-allocated GPU memory pool based on offset management, using structured data layout storage grid attribute and physical quantity with support memory merge access, pre-compute and pre-copy grid metadata to GPU, and through layered data list index physical variable;And discretization unit, for using numerical discretization method based on grid element cycle, to eliminate data race and realize memory merge access.Using this method can shorten the total calculation time of large-scale two-phase flow scene, improve computing performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multiphase fluid computing technology, and in particular to a GPU-accelerated density basis solver system and its implementation method. Background Technology

[0002] Computational fluid dynamics (CFD) has become an indispensable tool in modern engineering and scientific research, especially in the field of multiphase flow simulation. These flows are characterized by complex interactions between different phases and are widely present in key industrial processes such as chemical reactors, energy conversion systems, and environmental fluid dynamics. Accurate modeling requires capturing complex physical behaviors, including phase interface evolution and interphase heat and mass transfer, all of which rely on high-fidelity numerical methods.

[0003] Among various multiphase flow simulation methods, density-based solvers based on the diffusion-interface method (DIM) stand out in compressible or transonic flow scenarios. In 1987, Baer and Nunziato first proposed a density-based framework applicable to two-phase flows, constructing a seven-equation model containing non-equilibrium interphase source terms. Subsequent improvements, under the equilibrium assumption, have led to simplified forms: the six-equation model (velocity equilibrium) proposed by Saurel et al., the five-equation model (velocity-pressure equilibrium) proposed by Kapila et al., and the four-equation model (complete velocity-pressure-temperature equilibrium). Among these, the four-equation model, with complete conservation properties, can be extended to multiphase flow systems by adding phase fractional transport equations. Compared with pressure-based solvers, density-based methods can more accurately capture shock structures and interfaces, thus achieving more accurate simulations of interphase processes, which is crucial for complex multiphase flow scenarios.

[0004] However, the diffusion interface method has a key limitation: the interface diffusion process requires an extremely small time step. This problem, coupled with the inherent high-fidelity characteristics of density-based solvers, leads to a significant increase in computational costs; and the growing demand for higher fidelity and larger-scale simulations further drives up the computational resource requirements. Traditional CPU-based implementations, limited by serial execution architectures and limited parallel processing capabilities, often struggle to output results within real-world timeframes. This computational bottleneck not only hinders progress in multiphase flow research but also limits the industrial application of density-based solvers. Graphics processors (GPUs) have become a transformative solution in high-performance computing (HPC), possessing thousands of parallel optimization cores and extremely high throughput, which are highly compatible with the data parallelism of CFD algorithms. However, a key unresolved gap remains: effective GPU acceleration research for density-based solvers of two-phase flows based on diffusion interfaces is still relatively lacking. Existing GPU-CFD research mainly focuses on single-phase flow or pressure-based multiphase flow solvers, but these solvers lack the complex wave-interface coupling relationships and strict conservation constraints involved in density-based methods in compressible two-phase flow systems. Simply porting CPU-based density basis solvers to GPUs fails to fully realize the hardware's potential: CPU-centric data structures lead to unmerged memory accesses, wasting GPU memory bandwidth; directly adopting the CPU's "surface loop" computation mode results in data races, which must be resolved through high-latency atomic operations; and the lack of GPU-optimized memory management leads to frequent dynamic allocation overhead. Filling this gap is not simply a matter of performance improvement, but a necessary step to overcome the computational bottleneck of large-scale two-phase flow density basis solvers. Summary of the Invention

[0005] Therefore, it is necessary to provide a GPU-accelerated density basis solver system and its implementation method that can improve computing performance in response to the above-mentioned technical problems.

[0006] A GPU-accelerated density basis solver system, the system comprising: A general framework for solving partial differential equations is proposed. The framework adopts an object-oriented and extensible software architecture, and separates the computational system from the discrete method through an abstract interface, so as to transform physical equations into a computational system.

[0007] The model and algorithm module is built on the common interface of the discrete method of the general partial differential equation solution framework. The model and algorithm module integrates density basis algorithm, four-equation model and six-equation model to realize the solution of two-phase flow problem. The GPU acceleration module includes a memory management unit and a discretization unit.

[0008] The memory management unit is used to create a pre-allocated GPU memory pool based on offset management. It uses a structured data layout that supports memory-merged access to store grid attributes and physical quantities, pre-computes and pre-copyes grid metadata to the GPU, and indexes physical variables through a hierarchical data list.

[0009] Discretization cells are used to employ a numerical discretization method based on grid cell loops. By allocating a grid cell to each GPU thread, the thread traverses all grid faces associated with that cell to complete gradient calculation, flux-related source term evaluation, and sticky term processing, thereby eliminating data races and enabling memory merged access.

[0010] A method for implementing a GPU-accelerated density basis solver system, the method comprising: Based on a general partial differential equation solving framework, a model and algorithm module for a two-phase flow solver is constructed by integrating density basis algorithms, four-equation models, and six-equation models.

[0011] Configure GPU memory and data through memory management strategies, which include: creating a pre-allocated GPU memory pool based on offset management, storing grid attributes and physical quantities using a structured data layout, pre-compiling grid metadata and copying it from the CPU to the GPU, and indexing physical variables through a hierarchical data list.

[0012] A numerical discretization method based on grid cell cycles is used to perform computationally intensive tasks, including gradient calculation, flux calculation, solving of conserved variable equations, and source term evaluation.

[0013] The numerical discretization method based on grid cell looping is as follows: allocate a grid cell to each GPU thread, and the thread traverses all grid faces associated with the cell to complete the calculation.

[0014] The computation results on the GPU are transferred back to the CPU, and the GPU resources are released.

[0015] The aforementioned GPU-accelerated density-based solver system and its implementation method, firstly, break the tight coupling limitations of traditional CPU frameworks through the modular and scalable design of the general partial differential equation solving framework. Its object-oriented abstract interface design decouples the computational system from the discrete method, providing a flexible and stable infrastructure for the customized development of density-based two-phase flow solvers. This avoids the problems of poor scalability and high cost of adapting to new algorithms / models caused by functional coupling in traditional CPU frameworks, laying a modular foundation for the subsequent integration of GPU acceleration technologies. Secondly, the GPU memory management strategy, based on a pre-allocated GPU memory pool using offsets, eliminates the high overhead of frequent dynamic memory allocation in CUDA and avoids memory fragmentation. Structured data layout and pre-copying of mesh metadata ensure that GPU threads access mesh attributes and physical quantities in merged memory, maximizing memory bandwidth utilization. Simultaneously, it simplifies CPU-GPU data transfer to a one-time operation during the initialization phase, significantly reducing the time consumption of repeated data movement in traditional CPU frameworks. Finally, the discretization method based on grid cell looping allocates independent grid cells to each GPU thread, allowing each thread to traverse its assigned face to complete the computation. This avoids non-merged memory access caused by face looping and eliminates data races at the source, ensuring computational correctness without the need for atomic operations. This computational mode, highly compatible with the GPU's many-core architecture, fully unleashes the GPU's parallel computing potential, achieving orders-of-magnitude improvements in computational efficiency in core areas such as gradient calculation and throughput processing compared to the serial or inefficient parallel face looping of traditional CPU frameworks. Attached Figure Description

[0016] Figure 1 This is a block diagram of a GPU-accelerated density basis solver system in one embodiment; Figure 2 This is a flowchart illustrating an implementation method of a GPU-accelerated density basis solver system in one embodiment. Figure 3 This is a diagram of the proposed solver architecture for a general partial differential equation (PDE) solving framework in one embodiment; Figure 4 This is a data structure design diagram based on GPU-accelerated computing in one embodiment; Figure 5 This is a comparison diagram of computational pattern surface loop vs. cell loop in one embodiment, wherein, Figure 5 (a) is a graph of a surface-loop algorithm on the CPU. Figure 5 (b) is a diagram of a unit loop computation algorithm on the CPU. Figure 5 (c) is a diagram of a unit loop computation algorithm on a GPU; Figure 6 This is a block diagram of a GPU-accelerated unit loop method architecture in one embodiment. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0018] In one embodiment, such as Figure 1 As shown, a GPU-accelerated density basis solver system is provided, including: a model and algorithm module and a GPU acceleration module, wherein: A general framework for solving partial differential equations is proposed. The framework adopts an object-oriented and extensible software architecture, and separates the computational system from the discrete method through an abstract interface, so as to transform physical equations into a computational system.

[0019] The model and algorithm module 102 is built based on the common interface of the discrete method of the general partial differential equation solution framework. The model and algorithm module integrates the density basis algorithm, the four-equation model and the six-equation model to realize the solution of the two-phase flow problem. The GPU acceleration module 104 includes a memory management unit and a discretization unit.

[0020] The memory management unit 10402 is used to create a pre-allocated GPU memory pool based on offset management, store grid attributes and physical quantities using a structured data layout that supports memory merging access, pre-compute and pre-copy grid metadata to the GPU, and index physical variables through a hierarchical data list.

[0021] Discretization unit 10404 is used to employ a numerical discretization method based on grid cell loops. By allocating a grid cell to each GPU thread, the thread traverses all grid faces associated with the cell to complete gradient calculation, flux-related source term evaluation, and sticky term processing, thereby eliminating data races and enabling memory merged access.

[0022] In one embodiment, the pre-allocated GPU memory pool based on offset management of the memory management unit includes a pre-allocated GPU memory buffer and an offset variable. The offset variable is used to track the current position of the memory buffer, calculate memory addresses using a base address and the offset to divide memory regions, and complete the cyclic reuse of the buffer by resetting the offset.

[0023] In one embodiment, the structured data layout of the memory management unit is an array structure format, and the grid attributes include face normal vectors, cell center coordinates and adjacent cell indices. The grid attributes are stored in GPU memory as a contiguous array to ensure that threads within the CUDA thread block access contiguous memory addresses.

[0024] In one embodiment, in the numerical discretization method based on grid cell loop for discretization units, the threads within the GPU thread bundle process continuous grid cells. When accessing cell-specific data, the thread bundle thread accesses continuous memory addresses; when accessing surface-related data, the structured access to the grid surface to which the cell belongs is completed through a pre-computed index array.

[0025] In one embodiment, such as Figure 2 As shown, a GPU-accelerated density basis solver method is provided, which is applied to... Figure 1 Taking the system framework in [the document] as an example, the following steps are included: Step 202: Based on the general partial differential equation solution framework, the density basis algorithm, the four-equation model and the six-equation model are integrated to construct the model and algorithm module of the two-phase flow solver.

[0026] Step 204: Configure GPU memory and data through memory management strategies, including: creating a pre-allocated GPU memory pool based on offset management, using structured data layout to store grid attributes and physical quantities, pre-compiling grid metadata and copying it from the CPU to the GPU, and indexing physical variables through a hierarchical data list.

[0027] Step 206: A numerical discretization method based on grid cell cycles is used to perform computationally intensive tasks, including gradient calculation, flux calculation, solving of conserved variable equations, and source term evaluation.

[0028] Step 208, the numerical discretization method based on grid cell loop is as follows: allocate a grid cell to each GPU thread, and the thread traverses all grid faces associated with the cell to complete the calculation.

[0029] Step 210: Transfer the computation results from the GPU back to the CPU and release the GPU resources.

[0030] In the implementation method of the aforementioned GPU-accelerated density-based solver system, firstly, the modular and scalable design of the general partial differential equation solving framework breaks the tight coupling limitations of the traditional CPU framework. Its object-oriented abstract interface design decouples the computational system from the discrete method, providing a flexible and stable infrastructure for the customized development of density-based two-phase flow solvers. This avoids the problems of poor scalability and high cost of adapting to new algorithms / models caused by functional coupling in the traditional CPU framework, laying a modular foundation for the subsequent integration of GPU acceleration technologies. Secondly, the GPU memory management strategy, based on a pre-allocated GPU memory pool using offsets, eliminates the high overhead of frequent dynamic memory allocation in CUDA and avoids memory fragmentation. Structured data layout and pre-copying of mesh metadata ensure that GPU threads access mesh attributes and physical quantities in a merged memory, maximizing memory bandwidth utilization. Simultaneously, it simplifies CPU-GPU data transfer to a one-time operation during the initialization phase, significantly reducing the time consumption of repeated data movement in the traditional CPU framework. Finally, the discretization method based on grid cell looping allocates independent grid cells to each GPU thread, allowing each thread to traverse its assigned face to complete the computation. This avoids non-merged memory access caused by face looping and eliminates data races at the source, ensuring computational correctness without the need for atomic operations. This computational mode, highly compatible with the GPU's many-core architecture, fully unleashes the GPU's parallel computing potential, achieving orders-of-magnitude improvements in computational efficiency in core areas such as gradient calculation and throughput processing compared to the serial or inefficient parallel face looping of traditional CPU frameworks.

[0031] In one embodiment, mesh attributes and physical quantities are organized into a contiguous array, wherein mesh attributes include face normals, cell center coordinates, and adjacent cell indices, and physical quantities include phase fractions, pressure, and velocity, to ensure memory-merged access for CUDA threads.

[0032] In one embodiment, each GPU thread computes the global index of its assigned cell based on thread hierarchy parameters. The GPU thread then traverses all mesh faces to which the assigned cell belongs, reading pre-computed face and vector data. Gradient contributions are calculated and cell gradients are updated; during the update process, each cell value is modified only by its assigned thread to eliminate data races.

[0033] In one embodiment, computationally intensive tasks employ asynchronous execution techniques, enabling the CPU and GPU tasks to operate in parallel.

[0034] In one embodiment, the pre-computed mesh metadata includes cell volume, face ID, adjacent cell relationship, number of faces and total number of cells, etc. The mesh metadata is pre-computed on the CPU and then copied to the GPU resident array in one go.

[0035] In one embodiment, such as Figure 3As shown, a proposed solver architecture based on a general partial differential equation (PDE) solution framework is presented. Within this framework, various algorithms and models (such as compressible flow and incompressible flow models) applicable to different flow problems are developed by systematically combining basic differential operators. Correspondingly, a dedicated algorithm system has also been established, including a "pressure-based algorithm" and a "density-based algorithm." These two algorithms are designed for specific solution strategies and flow conditions, respectively, and the two-phase flow solver of this method is a core application example of the "density-based algorithm."

[0036] It is worth noting that a significant advantage of this framework (and directly benefits density-based two-phase flow solvers) lies in its multi-layered scalability. Thanks to object-oriented design, users can freely modify or extend the differential operators embedded in the dominant equations, enabling the solver to handle more complex two-phase flow phenomena, such as interface dynamics, phase transitions, or turbulence-modulated multiphase transport. This flexibility also supports numerical research in related scientific and engineering fields. Importantly, this scalability is achieved without sacrificing computational performance, ensuring that density-based two-phase flow solvers based on this framework are both powerful and computationally efficient in advanced multiphase flow simulations.

[0037] In one embodiment, such as Figure 4 As shown, a data structure for GPU-accelerated computing is provided. To maximize parallel efficiency, minimize data transfer overhead, and utilize the CUDA memory hierarchy, the GPU-accelerated implementation adopts a customized data structure design. The specific steps include: 1) Unified GPU memory pool based on offset allocation The core design employs a pre-allocated GPU memory buffer (tmp_data_buff) managed by an offset variable (tmp_data_offset), which serves as a numerical index tracking the current position within the buffer. The buffer is allocated once during initialization and has a fixed size sufficient to hold all temporary data required for computation. For variables such as surface temperature T_pos, velocity U_neg, or gradient arrays (e.g., gradT), dynamic allocation / release of GPU memory is not required. Instead, the cuda_malloc macro is used to calculate memory addresses based on the buffer's base address to divide the memory region, and the available space is tracked using offsets. The specific implementation is as follows: #define cuda_malloc(size) ((char )data.tmp_data_buff +data.tmp_data_offset); data.tmp_data_offset += (size) This design eliminates the cost of frequent calls to cudaMalloc and cudaFree (high-overhead operations) in CUDA, while avoiding memory fragmentation. The cuda_free macro "frees" memory by resetting the offset to zero, rather than actually releasing it. #define cuda_free data.tmp_data_offset=0 This mechanism supports the cyclic reuse of the buffer during iteration: by resetting the offset, the entire buffer space can be reused for subsequent temporary data storage, which is crucial for time-step-dependent CFD simulations.

[0038] 2) Structured data layout that supports in-memory merged access To maximize GPU memory throughput through memory merging (a key optimization technique for parallel threads accessing contiguous memory addresses), data structures are organized as contiguous arrays or "structure-of-arrays" aligned with the access pattern. For example, mesh attributes (including face normals (Sf), cell center coordinates (center), and neighbor indices (neighborid)) are stored as contiguous arrays in GPU memory. This alignment ensures that threads within a CUDA thread block can access contiguous memory addresses, fully utilizing available memory bandwidth. During mesh data initialization, vector data such as dvectors (distance vectors) and svectors (face vectors) are transferred from the CPU to the GPU in batches as contiguous blocks. This design reinforces the merged access pattern in computationally intensive kernel functions such as computeGrad_kernel, and a stable memory access pattern directly impacts parallel efficiency.

[0039] 3) Pre-computed and pre-replicated grid metadata Mesh-related data (such as cell volume, face ID, and neighbor cell relationships) is pre-computed on the CPU during initialization and then copied to the GPU in one go. This type of data includes static data: the number of faces nFace, the total number of cells nT, and indices that define key topological relationships for parallel template computation (such as neighbor index neighborid and face index faceid). By centrally storing the mesh data in GPU-resident arrays (such as data.neighborid and data.faceid), this implementation avoids redundant CPU-GPU data transfers while ensuring that parallel kernel functions can access topological information with low latency.

[0040] 4) Layered data list of physical quantities Physical variables (such as phase fraction alpha, pressure, and velocity) are stored in a hierarchical array (data_list) indexed by enumeration values ​​(such as alpha_cuda, pressure_cuda, and velocityU_cuda). Each entry in data_list points to a contiguous GPU array matching the problem size; for example, the array size for cell center variables such as pressure is nT, while the array size for flux variables is nFace. This structure supports unified variable access within parallel kernel functions: taking musclhancock_kernel as an example, it can access the velocity, pressure, and phase fraction arrays via data_list indexing, simplifying kernel function code while ensuring stable memory access patterns. During initialization, all entries are pre-allocated in GPU memory; since these variables are frequently accessed throughout the computation cycle, subsequent accesses can directly read GPU memory, eliminating redundant CPU-GPU data transfer overhead.

[0041] It's worth noting that these data structure innovations ensure efficient utilization of GPU resources: parallel kernel functions run in merged access mode on contiguous, pre-allocated memory; CPU-GPU data transfer is minimized to a single initialization step; and temporary data reuse is optimized through offset-based memory pools. This design lays the foundation for leveraging CUDA's asynchronous execution model, maximizing the overlap of CPU and GPU operations by decoupling memory management (based on memory pools) from computationally intensive kernel functions.

[0042] In one embodiment, in a CPU-based two-phase flow solver, gradient calculation, flux-related source term evaluation, and viscous term processing all involve summing the surface center values ​​to obtain the element center values. Mainstream software (such as OpenFOAM) employs a "surface loop" method. (Gradient calculation...) Figure 5 (a) For example: The core logic is to traverse each grid surface, calculate the contribution, and then update the gradient of the master unit by addition and update the gradient of the adjacent unit by subtraction.

[0043] A "cell loop" method is proposed: each thread is assigned a grid cell, and the thread iterates through all the grid faces associated with that cell. For example... Figure 5 (b) Figure 5 As shown in (c), the framework clarifies the underlying algorithmic logic for operations such as gradient calculation, namely, mapping the summation of face center values ​​to cell center results. The core process includes: each thread uses GPU thread-level parameters to calculate the global index of its assigned cell; traverses all mesh faces to which the cell belongs; reads the pre-computed face data and vector data of each face from the GPU resident array; calculates the corresponding gradient contribution term; and updates the cell gradient accordingly.

[0044] Furthermore, in the unit loop mode (such as...) Figure 6 As shown in the figure, threads within a thread bundle process consecutive units. When accessing unit-specific data, threads within the thread bundle access contiguous memory addresses, achieving memory merging and maximizing GPU memory bandwidth utilization. A single memory transaction can serve multiple threads within the thread bundle. Even when accessing face-related data, the pre-computed index array ensures that the access pattern of the mesh face to which the unit belongs has structured and batch-processable characteristics, further improving access efficiency. This is consistent with the memory layout and "thread-unit" mapping shown in the figure.

[0045] It's worth noting that the unit loop architecture effectively eliminates the data race risk inherent in the face loop pattern on GPUs. Unlike face loop implementations (where multiple threads concurrently access shared cell data, requiring high-overhead atomic operations to ensure memory integrity), the unit loop assigns exclusive ownership of each cell value update to a single thread. This design inherently avoids write conflicts because each cell value is modified only by its designated thread during face traversal. By eliminating the need for atomic synchronization, the unit loop preserves the fine-grained parallelism that GPU architecture is designed to leverage, avoiding the latency overhead of serial memory transactions.

[0046] Furthermore, in a well-structured mesh, each thread is allocated one cell with a uniform number of faces. Threads within a thread bundle / block have roughly equal execution time during face traversal, minimizing load imbalance. This predictable workload distribution aligns with the GPU architecture's preference for regular, batch computations, enabling efficient thread scheduling. This characteristic is achieved through… Figure 5 The visualization of the "thread-unit" model has been further enhanced.

[0047] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0048] Specific limitations regarding a GPU-accelerated density basis solver system can be found in the limitations of a GPU-accelerated density basis solver method described above, and will not be repeated here. Each module in the aforementioned GPU-accelerated density basis solver system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0049] Those skilled in the art will understand that Figure 1 , Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0050] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink, DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0051] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0052] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A GPU-accelerated density basis solver system, characterized in that, The system includes: A general framework for solving partial differential equations is proposed. The framework adopts an object-oriented and scalable software architecture and separates the computational system from the discrete method through an abstract interface, so as to transform physical equations into a computational system. The model and algorithm module is built on the common interface of the discrete method of the general partial differential equation solution framework. The model and algorithm module integrates density basis algorithm, four-equation model and six-equation model to realize the solution of two-phase flow problem. The GPU acceleration module includes a memory management unit and a discretization unit; The memory management unit is used to create a pre-allocated GPU memory pool based on offset management, store grid attributes and physical quantities using a structured data layout that supports memory merging access, pre-compute and pre-copy grid metadata to the GPU, and index physical variables through a hierarchical data list. The discretization unit is used to employ a numerical discretization method based on grid cell looping. By allocating a grid cell to each GPU thread, the thread traverses all grid faces associated with the cell to complete gradient calculation, flux-related source term evaluation, and sticky term processing, thereby eliminating data contention and achieving memory merged access. The pre-allocated GPU memory pool of the memory management unit based on offset management includes a pre-allocated GPU memory buffer and offset variables. The offset variable is used to track the current position of the memory buffer. The memory address is calculated by using the base address and the offset to divide the memory region, and the buffer is reused cyclically by resetting the offset.

2. The GPU-accelerated density basis solver system according to claim 1, characterized in that, The structured data layout of the memory management unit is in array format. The grid attributes include face normal vectors, cell center coordinates, and adjacent cell indices. The grid attributes are stored in GPU memory as a contiguous array to ensure that threads within a CUDA thread block access contiguous memory addresses.

3. A GPU-accelerated density basis solver system according to any one of claims 1 to 2, characterized in that, In the numerical discretization method based on grid cell looping of the discretization unit, the threads within the GPU thread bundle process continuous grid cells. When accessing cell-specific data, the threads in the thread bundle access continuous memory addresses. When accessing surface-related data, structured access to the mesh surface to which the cell belongs is accomplished through a pre-computed index array.

4. A method for implementing a GPU-accelerated density basis solver, characterized in that, Applied to a GPU-accelerated density basis solver system according to any one of claims 1 to 3, the method comprises: Based on the general partial differential equation solving framework, density basis algorithm and four-equation model and six-equation model are integrated to construct the model and algorithm module of two-phase flow solver; Configure GPU memory and data through a memory management strategy, wherein the memory management strategy includes: creating a pre-allocated GPU memory pool based on offset management, storing grid attributes and physical quantities using a structured data layout, pre-compiling grid metadata and copying it from the CPU to the GPU, and indexing physical variables through a hierarchical data list; A numerical discretization method based on grid cell cycles is used to perform computationally intensive tasks, including gradient calculation, flux calculation, solving of conserved variable equations, and source term evaluation. The numerical discretization method based on grid cell looping is as follows: allocate a grid cell to each GPU thread, and the thread traverses all grid faces associated with the cell to complete the calculation; The computation results on the GPU are transferred back to the CPU, and the GPU resources are released.

5. The method according to claim 4, characterized in that, A structured data layout is used to store grid attributes and physical quantities, including: Mesh properties and physical quantities are organized into contiguous arrays. Mesh properties include face normals, cell center coordinates, and adjacent cell indices. Physical quantities include phase fractions, pressure, and velocity to ensure memory-merged access for CUDA threads.

6. The method according to claim 4, characterized in that, The specific execution steps of the numerical discretization method based on grid cell loops include: Each GPU thread calculates the global index of its allocation unit based on thread hierarchy parameters; The GPU thread iterates through all the mesh faces to which the allocation unit belongs, and reads the pre-computed face data and vector data. Calculate gradient contributions and update unit gradients. During the update process, each unit value is modified only by the thread to which it is assigned to eliminate data races.

7. The method according to claim 6, characterized in that, Computationally intensive tasks employ asynchronous execution techniques, enabling the CPU and GPU to operate in parallel.

8. The method according to claim 7, characterized in that, The pre-computed mesh metadata includes cell volume, face ID, adjacent cell relationship, number of faces, and total number of cells. The mesh metadata is pre-computed on the CPU and then copied to the GPU resident array in one go.