GPU (Graphics Processing Unit) calculation method for computational fluid mechanics simulation
By adopting a hybrid programming framework and OpenFOAM-GPU data structure of CPU/GPU heterogeneous system in computational fluid mechanics, the thermal physical quantity calculation is migrated to the GPU and the array structure is reconstructed, and the problem of low data communication between CPU and GPU is solved. , and the calculation speed and resource utilization rate have been improved.
Patent Information
- Application Number
- CN202411204059.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In computational fluid mechanics, the data communication between the CPU and the GPU is inefficient, resulting in the numerical simulation method that consumes a lot of computing resources. Especially when calculating thermal physical quantities, traditional two-dimensional array structures lead to inefficient memory access on the GPU. Impacts computing performance.
Adopting a hybrid programming framework based on CPU/GPU heterogeneous system, establishing OpenFOAM-GPU data structure, migrating stoichiometric calculations and thermal physical quantity calculations to GPU, and adopting parallel computing strategies to improve memory copy logic and reconstruct two-dimensional array structures It is a one-dimensional array structure, reduces data exchange frequency and optimizes memory access.
It significantly improves computing speed, reduces the number of communication times between CPU and GPU, reduces communication costs, and improves the efficiency and data throughput of parallel computing.
Smart Images

Figure CN119271366A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of high-performance computing of computational fluid dynamics (CFD), and in particular to CFD computing methods and structural optimization on large-scale CPU / GPU heterogeneous high-performance computing systems. The present invention mainly focuses on GPU accelerated computing of thermal physical quantities, data transmission optimization, and adaptive transformation of array structures, and can be applied to the rapid calculation of flow fields in wide-range combined engines, in order to achieve higher computing efficiency and resource utilization. Background Art
[0002] In the history of computational fluid dynamics (CFD), with the increasing demand for computing, traditional CPU-centric computing methods have gradually become incapable of keeping up. Wide-band combination engines are an important source of power for future high-speed aircraft. However, the more stringent working performance requires a large amount of numerical calculations to meet the design requirements during the design process. For the solution of finite element grids of millions or tens of millions, the current numerical simulation needs to be achieved through parallel computing of hundreds of CPUs. Due to the data communication problem between CPUs, the parallel efficiency is not high, which leads to the conventional numerical simulation method consuming a lot of computing resources. Especially in the field of calculation of thermal physical quantities, accurate simulation of key parameters such as temperature, pressure, entropy, etc. is crucial for predicting fluid behavior and design optimization. However, these computing tasks often require processing large amounts of data and complex numerical methods, resulting in time-consuming and resource-intensive calculations.
[0003] As the computing control core of a computer, the CPU is good at complex logical operations; while as a graphics processor, the GPU has a large number of stream processors (SP) and is good at parallel processing of image data. As the outstanding ability of GPU in parallel processing is widely recognized, its application potential in the field of CFD is gradually being explored. GPU not only provides more computing cores than CPU, but also its design is more suitable for performing large-scale parallel computing tasks. This makes GPU an ideal choice for accelerating CFD simulation, especially when dealing with highly parallel tasks such as thermal physical quantity calculations.
[0004] However, migrating CFD calculations from CPU to GPU is not barrier-free. On the one hand, the problem of data structure adaptation needs to be solved. The traditional two-dimensional array structure runs more efficiently on the CPU, but may lead to inefficient memory access and index conflicts on the GPU. On the other hand, the frequent data exchange between the CPU and GPU has become a bottleneck affecting computing performance. How to effectively manage these data exchanges and reduce communication costs is the key to improving CFD computing performance. Summary of the invention
[0005] In response to the above problems, the present invention provides a GPU computing method for computational fluid dynamics simulation, which solves the problem that the numerical simulation method needs to consume a large amount of computing resources due to the low parallel efficiency caused by the data communication problem between the CPU and the GPU. It reduces the number of communications between the CPU and the GPU, reduces the communication cost, and improves the efficiency of parallel computing and data throughput.
[0006] The present invention adopts the following technical scheme to achieve the purpose: a GPU computing method for computational fluid dynamics simulation, comprising:
[0007] (1) Build a hybrid programming framework based on CPU / GPU heterogeneous systems;
[0008] (2) Based on the OpenFOAM open source computing framework, establish the OpenFOAM-GPU data structure;
[0009] (3) Migrate chemical computing to GPU;
[0010] (4) Migrate the thermal physical quantity calculation tasks from the CPU to the GPU for execution and adopt a parallel computing strategy;
[0011] (5) Improve memory copy logic to reduce the frequency of data exchange between GPU memory and CPU during the calculation process;
[0012] (6) Reconstruct the two-dimensional array structure originally used on the CPU into a one-dimensional array structure suitable for GPU parallel computing;
[0013] Wherein, in the step (1), the building of a hybrid programming framework based on a CPU / GPU heterogeneous system includes optimizing linear algebra operations using the CUBLAS and CUSPARSE function libraries of the CUDA version of the basic linear algebra subroutine library provided by NVIDIA, using CULATools and MAGMA to decompose matrices, and programming through the Thrust parallel algorithm library to establish a hybrid programming framework for CPU / GPU heterogeneous systems;
[0014] In the step (2), the OpenFOAM-GPU data structure is established based on the OpenFOAM open source computing framework, including rewriting the native classes of OpenFOAM for GPU, and combining the hybrid programming framework of the CPU / GPU heterogeneous system built in step (1), so that the GPU has a data structure that meets the OpenFOAM computing requirements, and can edit and calculate the data structure;
[0015] In the step (3), the chemical calculation includes the calculation of chemical reaction-related data based on thermal correlation; specifically: the chemical calculation is migrated to the GPU, including the calculation of chemical source terms and optimization of reaction rate parameters on the original chemistryModel class of OpenFOAM, the solution of chemical reaction source terms, and the parallel reconstruction of pressure P, temperature T, and density rho parameters;
[0016] In the step (4), the thermal physical quantity calculation task is migrated from the CPU to the GPU for execution, and a parallel computing strategy is adopted, including: firstly, the relevant physical quantity fields are stored in the GPU memory, then the parallel algorithm of the thrust library is used to distribute the calculation task to multiple GPU threads, and finally the parallel processing of the grid data points is realized through the transform function, make_zip_iterator and counting_iterator;
[0017] In the step (5), improving the memory copy logic includes: before calculation, uniformly copying the necessary data to the CPU memory, and uniformly copying it back to the GPU memory after the calculation is completed;
[0018] In the step (6), the two-dimensional array structure originally used on the CPU is converted into a one-dimensional array structure suitable for GPU parallel computing, including using labelgpuList to store the converted data to achieve parallel computing of field interpolation from cells to points.
[0019] Optionally, the OpenFOAM-GPU data structure established in step (2) includes constructing data fields of the scalargpuField type, including enthalpy, pressure, temperature, specific volume, viscosity and thermal conductivity.
[0020] Optionally, the step (3) further specifically includes defining a chemistryModelCaculateFunctor<DeltaTType,ThermoType> The function object named func of the class provides corresponding processing methods for pressure P, temperature T, and density rho, and then performs parallel computing acceleration through functions in the Thrust parallel algorithm library.
[0021] Optionally, the step (4) further specifically includes a calculate() function of the thermal physical quantity hePsiThermo class responsible for processing scalargpuField type data in the GPU memory.
[0022] Optionally, the step (5) further specifically includes first transferring the enthalpy, pressure and temperature field data from the CPU memory to the GPU memory, and then using a unified data copy strategy to copy the mass, momentum and enthalpy source item data from the GPU memory back to the host storage. Optionally, when the GPU parallel calculation is performed, the step (6) further specifically includes flattening the two-dimensional array into a one-dimensional array through data structure reconstruction, using labelgpuList to store the converted data, and implementing parallel calculation on the GPU, and implementing parallel calculation of field interpolation from cells to points through thrust::for_each combined with a counting iterator.
[0023] Optionally, in step (5), the field data is transferred from the CPU memory to the GPU memory using cudaMemcpyAsync and cudaMemcpySync functions for data transfer.
[0024] Compared with the prior art, the present invention has the following beneficial effects: first, by migrating the calculation of thermal physical quantities to the GPU and utilizing its parallel computing capability, the calculation speed is significantly improved; second, by introducing a data batch copy method, the number of communications between the CPU and the GPU is reduced, thereby reducing the communication cost; finally, by reconstructing the two-dimensional array structure into a one-dimensional array structure, the memory access mode is optimized, thereby improving the efficiency of parallel computing and data throughput. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The figure is a flow chart of a GPU computing method for computational fluid dynamics simulation provided according to an embodiment. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0027] like Figure 1 As shown, a GPU computing method for computational fluid dynamics simulation includes:
[0028] (1) Build a hybrid programming framework based on CPU / GPU heterogeneous systems;
[0029] (2) Based on the OpenFOAM open source computing framework, establish the OpenFOAM-GPU data structure;
[0030] (3) Migrate chemical computing to GPU;
[0031] (4) Migrate the thermal physical quantity calculation tasks from the CPU to the GPU for execution and adopt a parallel computing strategy;
[0032] (5) Improve memory copy logic to reduce the frequency of data exchange between GPU memory and CPU during the calculation process;
[0033] (6) Reconstruct the two-dimensional array structure originally used on the CPU into a one-dimensional array structure suitable for GPU parallel computing;
[0034] Wherein, in the step (1), the building of a hybrid programming framework based on a CPU / GPU heterogeneous system includes optimizing linear algebra operations using the CUBLAS and CUSPARSE function libraries of the CUDA version of the basic linear algebra subroutine library provided by NVIDIA, using CULATools and MAGMA to decompose matrices, and programming through the Thrust parallel algorithm library to establish a hybrid programming framework for CPU / GPU heterogeneous systems;
[0035] In the step (2), the OpenFOAM-GPU data structure is established based on the OpenFOAM open source computing framework, including rewriting the native classes of OpenFOAM for GPU, and combining the hybrid programming framework of the CPU / GPU heterogeneous system built in step (1), so that the GPU has a data structure that meets the OpenFOAM computing requirements, and can edit and calculate the data structure;
[0036] In the step (3), the chemical calculation includes the calculation of chemical reaction-related data based on thermal correlation; specifically: the chemical calculation is migrated to the GPU, including the calculation of chemical source terms and optimization of reaction rate parameters on the original chemistryModel class of OpenFOAM, the solution of chemical reaction source terms, and the parallel reconstruction of pressure P, temperature T, and density rho parameters;
[0037] In the step (4), the thermal physical quantity calculation task is migrated from the CPU to the GPU for execution, and a parallel computing strategy is adopted, including: firstly, the relevant physical quantity fields are stored in the GPU memory, then the parallel algorithm of the thrust library is used to distribute the calculation task to multiple GPU threads, and finally the parallel processing of the grid data points is realized through the transform function, make_zip_iterator and counting_iterator;
[0038] In the step (5), improving the memory copy logic includes: before calculation, uniformly copying the necessary data to the CPU memory, and uniformly copying it back to the GPU memory after the calculation is completed;
[0039] In the step (6), the two-dimensional array structure originally used on the CPU is converted into a one-dimensional array structure suitable for GPU parallel computing, including using labelgpuList to store the converted data to achieve parallel computing of field interpolation from cells to points.
[0040] This embodiment will introduce the details of each step in detail according to the step sequence of the above method.
[0041] In step (1), the following function library used by the present invention builds a CPU / GPU heterogeneous system:
[0042] (a) CUBLAS and CUSPARSE
[0043] CUBLAS and CUSPARS provide parallel acceleration of the most basic linear algebra operations such as addition, subtraction, multiplication and division of vectors and matrices. The difference is that CUBLAS is optimized for dense linear algebra operations, while CUSPARSE is optimized for sparse linear algebra operations.
[0044] (b) CULATools and MAGMA
[0045] CULATools is a GPU-accelerated version of the LAPACK library function, which can be used to solve multivariate linear equations, the least square solution of linear system equations, calculate eigenvectors and perform QR decomposition. MAGMA supports multi-core and multi-GPU, and is mainly used for dense matrix calculations.
[0046] (c)THRUST
[0047] Thrust is a general parallel algorithm library that provides a set of interfaces similar to the C++ Standard Template Library (STL). Thrust provides a flexible high-level language interface for programming on GPUs. The emergence of Thrust has greatly improved the productivity of general programming on GPUs. In order to improve compatibility and portability, Thrust currently not only supports GPU parallelism implemented by CUDA, but also specifies the use of OpenMPI to implement CPU parallelism.
[0048] (d)CUSP
[0049] CUSP is an open source CUDA library for sparse linear algebra and graph computing. It complies with Apache License 2.0. CUSP uses a generic programming method based on Thrust. It not only supports basic operations of sparse linear algebra, but also provides several basic sparse equation solvers.
[0050] In the step (2), a data structure that can be used for GPU device calculation is established based on the OpenFOAM basic data structure.
[0051] The optimization contents of OpenFOAM-GPU data structure are as follows:
[0052] (a)DeviceMemory
[0053] The main function of this function is to copy data between the host and data ends and allocate memory on the device end, so that the read data can be copied to the GPU device for calculation. The main functional functions used are:
[0054] ① Apply for and release device memory
[0055] ②Copy host data to the device
[0056] ③Copy device data to the host
[0057] ④Device-to-device data copying
[0058] It implements the functions of allocating and releasing memory on the device and copying data between the host and the device. It creates a custom MemoryPool class to create and manage memory pools for cached data, which is used to dynamically allocate and release memory blocks. It implements two cache strategies: timeout release and small memory blocks that are time-consuming to put into the cache. The program can dynamically allocate and release these memory blocks during operation to reduce the performance overhead caused by frequent memory allocation and release operations.
[0059] (b)GPUList
[0060] It is basically the same as the List class in OpenFOAM, which is a one-dimensional array of a specified type and has similar functions to vector arrays. However, it is rewritten using GPU parallel computing methods to support device-side operations and IO operations (input and output operations). The specific implementation of the functions uses DeviceMemory for device-side memory operations. In this array, three templates, List, UList, and gpuList, are first declared in the namespace Foam and used as pointers to manage device memory on the GPU.
[0061] Defines the template class gpuList for managing arrays on the GPU, and implements methods and functions for operating arrays, such as implementing a series of functions such as memory pointers on the GPU, checking and setting array sizes, or returning specific locations of arrays through member variables or member functions.
[0062] (c) field gpuField
[0063] The field gpuField is also used to store velocity domain, pressure domain, etc., and directly inherits gpuList <type>, rewrite the functional functions of the List class:
[0064] Constructors and Destructors
[0065] =, +=, *=, / =, <<, >> operator redefinition
[0066] (d) DimensionedField
[0067] Based on gpuField, DimensionedField is rewritten to represent a field with physical dimensions. The DimensionedField class combines the value and unit to ensure the physical meaning and consistency during the calculation process. It contains not only the numerical data of the field, but also the physical size, unit, coordinate system and other information associated with the field.
[0068] By specifying the appropriate physical dimensions for the field, DimensionedField can be automatically converted in various calculations and solvers, and provide more accurate and consistent results. It can also be used for calculations, interpolation and other common operations between field quantities. All fields in the original Field class of OpenFOAM can be replaced by gpuField, and DimensionedField can be used directly in the upper layer without other modifications, so as to achieve seamless replacement.
[0069] In step (3), since the Chemistry class is a class related to chemical reactions, it is based on the class related to thermal reactions. GPU parallel computing is used to optimize and accelerate this part. A chemistryModelCaculateFunctor is defined.<DeltaTType,ThermoType> The function object named func of the class provides corresponding processing methods for pressure P, temperature T, and density rho, and then uses the functions in the Thrust library for parallel computing acceleration: first, the thrust::transform function applies the elements in a range to the given function object one by one, and stores the results in the output iterator, and then uses the thrust::make_zip_iterator function to package multiple input sequences, and then calls the previously defined func function to start iterative calculations for P, T, and rho, and finally stores the results in this->deltachem_.getField. This method can greatly improve the computing efficiency when processing large amounts of data in parallel.
[0070] The calculate() function of the hePsiThermo class in step (4) is responsible for processing the scalargpuField type data in the GPU memory to calculate thermal physical quantities such as enthalpy, pressure, temperature, specific volume, viscosity and thermal conductivity. This process uses the parallel computing function of the thrust library to achieve parallel processing of grid data points through the transform function, make_zip_iterator and counting_iterator. It includes the following sub-steps:
[0071] a. Data preparation: The relevant physical quantity fields are stored in the GPU memory to ensure fast access.
[0072] b. Parallel computing framework: Use the parallel algorithm of the thrust library to distribute computing tasks to multiple GPU threads.
[0073] c. Temperature calculation: Use the transport equation of enthalpy and update the thermal physical quantities through the **thermo.correct() function. The calculate()** function of hePsiThermo calculates the temperature and other thermal physical quantities of each grid cell.
[0074] d. Computational performance optimization: The temperature calculation of each grid cell is processed independently and in parallel to improve efficiency.
[0075] The calculation logic is as follows:
[0076] T celli =mixture.THE(h celli ,p celli ,T celli )
[0077] ψ celli = mixture.ψ(p celli ,T celli )
[0078] μ celli =mixture.μ(p celli ,T celli )
[0079] α celli =mixture.α h (p celli ,T celli )
[0080] In this framework, T celli ,ψ celli ,μ celli , and α celli Represents the temperature, specific volume, viscosity and thermal conductivity of the grid cell (celli) respectively. The mixture object determines the corresponding thermal physical quantity according to the enthalpy, pressure and temperature of each grid cell. This realizes the migration of thermal physical quantity calculation tasks from CPU to GPU and optimizes the calculation process of CFD simulation.
[0081] In step (5), a new memory copy logic is used (using the example of calculating spray combustion in a specific embodiment) to optimize the data transmission between the CPU and the GPU. The scheme includes the following sub-steps:
[0082] a. Memory copy logic: Before calculation, necessary data is copied to CPU memory and then copied back to GPU memory after calculation.
[0083] b. Reduced communication overhead: The new copy strategy reduces the number of memory swaps and reduces communication overhead.
[0084] c. Data transfer function: Use cudaMemcpyAsync and cudaMemcpySync functions for efficient data transfer.
[0085] d. Performance improvement: The implementation of a unified data copy strategy further improves the performance of granular computing.
[0086] Its core logic is:
[0087] dm=np·dMass[i]
[0088] tmp=td.rhoTrans_[gid][cellI].get(cellI)+dm
[0089] tmpVec=td.cloud().UTrans().getField().get(cellI)+dm·UO
[0090] tmp=td.cloud().hsTrans().getField().get(cellI)+dm·hs
[0091] Where dm represents the mass change, tmp and tmpVec represent the updated density and velocity vectors respectively. These calculations involve fetching and assigning values from GPU memory, as well as particle calculations in the lagrangian module.
[0092] The step (6) converts the two-dimensional array structure originally used in the serial calculation logic into a one-dimensional array structure suitable for GPU parallel calculation. By reconstructing the data structure, the two-dimensional array is flattened into a one-dimensional array, and labelgpuList is used to store the converted data, thereby achieving more efficient parallel calculation on the GPU. The thrust::for_each combined with the counting iterator realizes the parallel calculation of the field interpolation from the cell to the point.
[0093] pointCells=calcPointCells(cells,faces)
[0094]
[0095] The calcPointCells function is responsible for calculating the grid to which each point belongs. It traverses all grids and marks the grid associated with each point. pointCells is a two-dimensional array that stores the grid information associated with the point. In GPU parallel computing, since each calculation is independent and has no context dependency, the two-dimensional array structure is converted to a one-dimensional array structure to facilitate parallel computing.
[0096] Specific implementation example application calculation:
[0097] Based on the present invention, CFD calculations of 20 million, 10 million, and 6 million grids are performed respectively, and the acceleration effects are compared for two types of problems: gas phase flow combustion and spray flow combustion. The following Table 1 is a comparison of the single round calculation time of spray flow combustion and Table 2 is a comparison of the single round calculation time of gas phase flow combustion under each grid example. It can be seen that in the spray flow combustion example of 20 million grids, the time for parallel calculation of one round using 128-core CPU is 2.66s, and the time for parallel calculation using 4 4090GPU cards is 1s, and the acceleration ratio is 2.66 times; in the gas phase flow combustion example of 2000w grids, the time for parallel calculation of one round using 128-core CPU is 1.64s, and the time for parallel calculation using 4 3080GPU cards is 0.45s, and the acceleration ratio is 3.64 times.
[0098] Table 1 Spray combustion calculation results
[0099]
[0100]
[0101] Table 2 Gas phase combustion calculation results
[0102] Gas phase flow combustion 20 million 10 million 6 million 320-core CPU 0.53s 0.2s 0.07s 128-core CPU 1.64s 0.75s 0.3s GPU-A100 0.81s 0.45s 0.34s GPU-4090 Insufficient video memory 0.48s 0.26s GPU-4090*2 0.51s 0.33s 0.18s GPU-3080*4 0.45s 0.28s 0.18s < / type>
Claims
1. A GPU computing method for computational fluid dynamics simulation, characterized in that: include: (1) Build a hybrid programming framework based on CPU / GPU heterogeneous systems; (2) Based on the OpenFOAM open source computing framework, establish the OpenFOAM-GPU data structure; (3) Migrate chemical computing to GPU; (4) Migrate the thermal physical quantity calculation tasks from the CPU to the GPU for execution and adopt a parallel computing strategy; (5) Improve memory copy logic to reduce the frequency of data exchange between GPU memory and CPU during the calculation process; (6) Reconstruct the two-dimensional array structure originally used on the CPU into a one-dimensional array structure suitable for GPU parallel computing; Wherein, in the step (1), the building of a hybrid programming framework based on a CPU / GPU heterogeneous system includes optimizing linear algebra operations using the CUBLAS and CUSPARSE function libraries of the CUDA version of the basic linear algebra subroutine library provided by NVIDIA, using CULATools and MAGMA to decompose matrices, and programming through the Thrust parallel algorithm library to establish a hybrid programming framework for CPU / GPU heterogeneous systems; In the step (2), the OpenFOAM-GPU data structure is established based on the OpenFOAM open source computing framework, including rewriting the native classes of OpenFOAM for GPU, and combining the hybrid programming framework of the CPU / GPU heterogeneous system built in step (1), so that the GPU has a data structure that meets the OpenFOAM computing requirements, and can edit and calculate the data structure; In the step (3), the chemical calculation includes the calculation of chemical reaction-related data based on thermal correlation; specifically: the chemical calculation is migrated to the GPU, including the calculation of chemical source terms and optimization of reaction rate parameters on the original chemistryModel class of OpenFOAM, the solution of chemical reaction source terms, and the parallel reconstruction of pressure P, temperature T, and density rho parameters; In the step (4), the thermal physical quantity calculation task is migrated from the CPU to the GPU for execution, and a parallel computing strategy is adopted, including: firstly, the relevant physical quantity fields are stored in the GPU memory, then the parallel algorithm of the thrust library is used to distribute the calculation task to multiple GPU threads, and finally the parallel processing of the grid data points is realized through the transform function, make_zip_iterator and counting_iterator; In the step (5), improving the memory copy logic includes: before calculation, uniformly copying the necessary data to the CPU memory, and uniformly copying it back to the GPU memory after the calculation is completed; In the step (6), the two-dimensional array structure originally used on the CPU is converted into a one-dimensional array structure suitable for GPU parallel computing, including using labelgpuList to store the converted data to achieve parallel computing of field interpolation from cells to points.
2. The GPU computing method for computational fluid dynamics simulation according to claim 1, characterized in that: The OpenFOAM-GPU data structure established in step (2) includes constructing data fields of the scalargpuField type, including enthalpy, pressure, temperature, specific volume, viscosity and thermal conductivity.
3. The GPU computing method for computational fluid dynamics simulation according to claim 1, characterized in that: The step (3) further specifically includes defining a chemistryModelCaculateFunctor<DeltaTType,ThermoType> The function object named func of the class provides corresponding processing methods for pressure P, temperature T, and density rho, and then performs parallel computing acceleration through functions in the Thrust parallel algorithm library.
4. The GPU computing method for computational fluid dynamics simulation according to claim 1, characterized in that: The step (4) also specifically includes a calculate() function of the thermal physical quantity hePsiThermo class that is responsible for processing scalargpuField type data in the GPU memory.
5. The GPU computing method for computational fluid dynamics simulation according to claim 1, characterized in that: The step (5) further specifically includes first transferring the enthalpy, pressure and temperature field data from the CPU memory to the GPU memory, and then, using a unified data copy strategy, copying the mass, momentum and enthalpy source item data from the GPU memory back to the host storage.
6. The GPU computing method for computational fluid dynamics simulation according to claim 1, characterized in that: The step (6) of GPU parallel computing also specifically includes flattening the two-dimensional array into a one-dimensional array through data structure reconstruction, using labelgpuList to store the converted data, and implementing parallel computing on the GPU. The parallel computing of field interpolation from cells to points is implemented through thrust::for_each combined with a counting iterator.
7. The GPU computing method for computational fluid dynamics simulation according to claim 5, characterized in that: In step (5), the field data is transferred from the CPU memory to the GPU memory using the cudaMemcpyAsync and cudaMemcpySync functions for data transfer.
Citation Information
Patent Citations
Character string matching method and system based on graphic processing unit (GPU) heterogeneous computing platform
CN103559017A
fluid machinery simulation program heterogeneous acceleration method based on a GPU
CN109522127A
CPU + GPU heterogeneous parallel optimization method in gas dynamic theory unified algorithm
CN111858066A
Cited By
OpenFoam data recombination method, medium and system
CN122614586A
An OpenFoam data reorganization method, medium and system
CN122614586B