A multiphase flow simulation method and system based on heterogeneous mixed precision acceleration

Through the heterogeneous mixed-precision acceleration framework, sensitive areas in multiphase flow simulations are dynamically identified. Combined with GPU parallel processing and Kahan cumulative error compensation, the problems of error diffusion and numerical oscillation in multiphase flow simulations are solved, and efficient and accurate multiphase flow interface dynamics simulation is achieved.

CN120257893BActive Publication Date: 2025-09-05QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510740554.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-05
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

Existing multiphase flow simulation methods are unable to achieve both high precision and efficient calculation under limited hardware resources. In particular, they are prone to error diffusion and numerical oscillation in the simulation of multiphase flow interface dynamics, and cannot meet the reliability requirements of industrial-grade simulation.

Method used

A heterogeneous mixed-precision acceleration framework is adopted to dynamically identify sensitive areas through the gradient-curvature collaborative criterion, combine double-precision and single-precision mixed-precision calculations, utilize GPU parallel processing, and combine Kahan cumulative error compensation technology to optimize storage and communication processing.

Benefits of technology

In multiphase flow simulations, video memory usage was significantly reduced by 40%, communication efficiency was increased by 77%, performance was improved by approximately 30 times, and the mass conservation error was stabilized within 0.1%, ensuring simulation accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120257893B_ABST
    Figure CN120257893B_ABST
Patent Text Reader

Abstract

The present disclosure provides a multiphase flow simulation method and system based on heterogeneous mixed precision acceleration, which relates to the field of multiphase flow simulation, including: obtaining target object information to be simulated; using the target object information to establish a fluid mechanics model through the lattice Boltzmann method, discretizing the continuous fluid macroscopic behavior into tiny grids and time steps, and simulating the fluid macroscopic behavior by the collision and migration of several particles in the gridded fluid area; based on the initial density distribution function, iterating the fluid mechanics model in time steps, and simulating the fluid macroscopic behavior of all particles in parallel in each time step until the iteration stop condition is met, thereby obtaining a multiphase flow simulation result; the present disclosure provides a feasible solution that takes into account both efficiency and accuracy for industrial-grade multiphase flow interface dynamics simulation through dynamic threshold recognition and multi-level collaborative optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of multiphase flow simulation, and in particular to a multiphase flow simulation method and system based on heterogeneous mixed precision acceleration. Background Art

[0002] Multiphase flow interface dynamics simulation has important application value in fields such as chemical reactor design and energy equipment optimization. For example, in scenarios such as oil-water separation and nuclear reactor cooling, accurate simulation of droplet collision and bubble fusion behavior is key to ensuring equipment efficiency and safety. However, achieving high-precision and efficient calculations with limited hardware resources poses a great challenge to existing methods.

[0003] Based on the advantages of mesoscopic-scale modeling and its natural parallelism, the lattice Boltzmann method (LBM) has become the mainstream approach for simulating multiphase flow interface dynamics. However, existing LBM frameworks generally adopt a static storage strategy and a global double-precision design. This "global double-precision in sensitive areas" approach lacks real-time perception and feedback of local physical characteristics such as gradients and curvature, and cannot dynamically adjust the accuracy distribution according to the transient characteristics of the flow field. This static strategy is prone to error diffusion or numerical oscillation when dealing with interface mutations and flow coupling, which in turn affects the reliability of engineering-level simulations. Therefore, existing multiphase flow simulation methods still cannot effectively balance video memory requirements and computational accuracy. Summary of the Invention

[0004] In order to solve the above problems, this paper proposes a multiphase flow simulation method and system based on heterogeneous mixed precision acceleration. Through dynamic threshold recognition and multi-level collaborative optimization, it provides a feasible solution that takes into account both efficiency and accuracy for industrial-grade multiphase flow interface dynamics simulation.

[0005] According to some embodiments, the present disclosure adopts the following technical solutions:

[0006] A multiphase flow simulation method based on heterogeneous mixed-precision acceleration, including:

[0007] Obtain information about the target object to be simulated;

[0008] Using the target object information, a fluid dynamics model is established through the lattice Boltzmann method. The continuous macroscopic behavior of the fluid is discretized into tiny grids and time steps. The macroscopic behavior of the fluid is simulated by the collision and migration of several particles in the gridded fluid area.

[0009] Based on the initial density distribution function, the fluid mechanics model is iterated in time steps. In each time step, the macroscopic behavior of the fluid is simulated in parallel for all particles until the iteration stop condition is met to obtain the multiphase flow simulation result.

[0010] Among them, the parallel simulation of fluid macroscopic behavior adopts a heterogeneous mixed precision acceleration framework, dynamically identifies sensitive areas in the fluid area through the gradient-curvature collaborative criterion, and performs double-precision and single-precision mixed precision calculations based on the identification results, thereby parallelizing the collision process in the multiphase flow simulation.

[0011] According to some embodiments, the present disclosure adopts the following technical solutions:

[0012] A multiphase flow simulation system based on heterogeneous mixed-precision acceleration, including:

[0013] The acquisition module is configured to: acquire information of a target object to be simulated;

[0014] The modeling module is configured to: utilize target object information to establish a fluid dynamics model through the lattice Boltzmann method, discretize the continuous fluid macroscopic behavior into tiny grids and time steps, and simulate the fluid macroscopic behavior by colliding and migrating a number of particles in the gridded fluid region;

[0015] The simulation module is configured to: iterate the fluid dynamics model in time steps based on the initial density distribution function, simulate the macroscopic behavior of the fluid for all particles in parallel in each time step until the iteration stop condition is met, and obtain the multiphase flow simulation result;

[0016] Among them, the parallel simulation of fluid macroscopic behavior adopts a heterogeneous mixed precision acceleration framework, dynamically identifies sensitive areas in the fluid area through the gradient-curvature collaborative criterion, and performs double-precision and single-precision mixed precision calculations based on the identification results, thereby parallelizing the collision process in the multiphase flow simulation.

[0017] According to some embodiments, the present disclosure adopts the following technical solutions:

[0018] A computer program product includes a computer program, which, when executed by a processor, implements a multiphase flow simulation method based on heterogeneous mixed precision acceleration.

[0019] According to some embodiments, the present disclosure adopts the following technical solutions:

[0020] A non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, a multiphase flow simulation method based on heterogeneous mixed precision acceleration is implemented.

[0021] According to some embodiments, the present disclosure adopts the following technical solutions:

[0022] An electronic device comprises: a processor, a memory, and a computer program; wherein the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device implements the multiphase flow simulation method based on heterogeneous mixed precision acceleration.

[0023] Compared with the prior art, the present invention has the following beneficial effects:

[0024] This disclosure provides a multiphase flow simulation method and system based on heterogeneous mixed-precision acceleration. Through dynamic threshold recognition and multi-level collaborative optimization, it provides a feasible solution for industrial-grade multiphase flow interface dynamics simulation that balances efficiency and accuracy. Specifically:

[0025] 1) Adaptive dynamic precision allocation: The system uses a gradient-curvature synergy criterion to identify sensitive areas, maintaining double-precision FP64 computation in high-gradient regions and single-precision FP32 computation in low-gradient regions. Combined with Kahan cumulative error compensation, the mass conservation error is stabilized within 0.1%.

[0026] 2) Full-stack optimization of storage, communication, and computing: By reconstructing the compressed storage architecture and double-buffered communication, mixed-precision data is more efficiently organized and coordinated with subsequent communication processing. In a calculation example with 141.4 million grid cells under the D3Q19 discrete model, video memory usage was reduced by approximately 40%, communication efficiency was increased by 77%, and performance acceleration of up to 30 times was achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings, which constitute a part of the present disclosure, are used to provide a further understanding of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation to the present disclosure.

[0028] Figure 1 This is a flow chart of the multiphase flow simulation method of Example 1.

[0029] Figure 2 This is a diagram of the heterogeneous mixed-precision acceleration framework of Example 1.

[0030] Figure 3 Flowchart for generating a tag array for Example 1.

[0031] Figure 4 This is a schematic diagram of the mark-driven compression mapping principle of Example 1.

[0032] Figure 5 This is a schematic diagram of the storage layout reconstruction principle of Example 1.

[0033] Figure 6 The overall speedup diagram of GDHP-SAF in Example 1 with grid scales ranging from 64³ to 521³ is shown.

[0034] Figure 7 Speedup plot of the collision kernel (excluding communication) across various resolutions for Example 1.

[0035] Figure 8 This is a comparison chart of video memory usage in Example 1.

[0036] Figure 9 This is a diagram showing the influence of the threshold coefficient on the mass conservation error in Example 1.

[0037] Figure 10 This is the droplet interface morphology diagram under the original Palabos version of Example 1.

[0038] Figure 11 This is a diagram of the droplet interface morphology under the GDHP-SAF framework of Example 1. DETAILED DESCRIPTION

[0039] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.

[0040] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present disclosure belongs.

[0041] Example 1

[0042] In one embodiment of the present disclosure, a multiphase flow simulation method based on heterogeneous mixed precision acceleration is provided, such as Figure 1 Shown, including:

[0043] Step S1: Obtain information of the target object to be simulated;

[0044] Step S2: Using the target object information, a fluid dynamics model is established through the lattice Boltzmann method, which discretizes the continuous fluid macroscopic behavior into tiny grids and time steps, and uses the collision and migration of several particles in the gridded fluid area to simulate the fluid macroscopic behavior;

[0045] Step S3: Based on the initial density distribution function, the fluid mechanics model is iterated in time steps, and the macroscopic behavior of the fluid is simulated in parallel for all particles in each time step until the iteration stop condition is met to obtain the multiphase flow simulation result;

[0046] Among them, the parallel simulation of fluid macroscopic behavior adopts a heterogeneous mixed precision acceleration framework, dynamically identifies sensitive areas in the fluid area through the gradient-curvature collaborative criterion, and performs double-precision and single-precision mixed precision calculations based on the identification results, thereby parallelizing the collision process in the multiphase flow simulation.

[0047] As an embodiment, the present invention discloses a multiphase flow simulation method based on heterogeneous mixed precision acceleration, which provides a feasible solution that balances efficiency and accuracy for industrial-grade multiphase flow interface dynamics simulation through dynamic threshold recognition and multi-level collaborative optimization. The specific implementation process is described below.

[0048] Early single-phase flow research has confirmed the feasibility of single-precision FP32 for single-phase flow; however, in liquid-gas interface simulations, single-precision FP32 is prone to introduce interfacial tension error accumulation, resulting in non-physical oscillations. In recent years, research trends in the field of scientific computing have gradually shifted to the development of mixed-precision algorithms.

[0049] Current research on mixed precision is mainly focused on single-phase flow scenarios, where FP64 / FP32 computing resources are usually allocated using a fixed partitioning strategy, which cannot be dynamically switched according to transient interface evolution. This approach has two drawbacks in multiphase flow simulation: first, fixed precision cannot meet the stringent double-precision requirements of transient high-gradient interface regions, resulting in interfacial tension errors exceeding 1.5% and continuously accumulating; second, relying solely on FP32 in low-gradient regions will cause the global mass conservation deviation to exceed the industrial standard (<1%

[18] ) due to the continuous accumulation of truncation errors.

[0050] Crucially, existing methods lack real-time perception and feedback of local physical characteristics such as gradients and curvature, making it impossible to dynamically adjust the accuracy distribution based on the transient characteristics of the flow field. This static strategy is prone to error diffusion or numerical oscillation when dealing with sudden interface changes and flow coupling, which in turn affects the reliability of engineering-level simulations. Therefore, there is an urgent need to develop adaptive mixed-precision solutions based on dynamic perception of physical field characteristics to synergistically optimize memory efficiency and numerical stability.

[0051] To address these issues, this paper proposes a gradient-driven heterogeneous mixed-precision acceleration framework (GDHP-SAF) for parallel collision calculations in multiphase flow simulations. This framework uses dynamic threshold recognition to employ double-precision (FP64) computations in high-gradient regions to ensure accurate capture of interfacial tension, while using single-precision (FP32) computations in low-gradient regions. Combined with Kahan compensation technology, this effectively reduces video memory usage and truncation errors. Based on the Palabos platform, this framework extends dynamic precision awareness and a three-stage mixed-precision pipeline, and restructures compressed storage and double-buffered communication protocols. This reduces video memory usage by 40% and improves performance by approximately 30x in a 141 million-grid grid case.

[0052] First, a brief description of the multiphase flow simulation based on the Lattice Boltzmann (LBM) is given:

[0053] The Lattice Boltzmann Method (LBM) is a fluid simulation method based on a microscopic dynamic model. It simulates macroscopic fluid behavior through a discretized velocity space and simple collision-migration rules. The following are the core steps of LBM simulation:

[0054] (1) Discretize velocity space (select discrete model)

[0055] LBM uses discrete velocity directions to describe particle motion and discretizes the macroscopic behavior of the fluid through the n-dimensional m-velocity DnQm discrete model. For example, D2Q9 is a 2-dimensional space with 9 velocity directions (including stationary particles), while D3Q19 is a 3-dimensional space with 19 velocity directions. Each direction has a corresponding weight coefficient and velocity vector. This embodiment uses D3Q19.

[0056] (2) Initialize the distribution function

[0057] Define the distribution function , represents the particle density along direction i at grid x and time step t. Usually, the initial distribution function is set to equilibrium distribution.

[0058] (3) Collision step

[0059] Particles interact locally at the grid nodes, and the distribution function after the collision is calculated:

[0060] (1)

[0061] in, is the particle density along direction i at the grid x at the tth time step, that is, the distribution function before collision, is the multiple relaxation time (MRT) collision operator.

[0062] (4) Migration steps (Streaming)

[0063] The distribution function after the collision Along the velocity direction Move to the adjacent node and update the distribution function of the next time step, which can be expressed as:

[0064] (2)

[0065] in, are the 19 discrete velocity directions of the D3Q19 model, is the time step.

[0066] This step explicitly updates the distribution function without solving partial differential equations.

[0067] (5) Calculation of macroscopic quantities

[0068] The macro variables are calculated by the zero-order and first-order moments of the distribution function, which can be expressed as follows:

[0069]

[0070]

[0071] in, is the density, Macro speed.

[0072] (6) Iterative advancement

[0073] The collision-transfer-calculation macroscopic steps are repeated until a steady state or the desired time step is reached.

[0074] In the above simulation process, this embodiment uses the heterogeneous mixed precision acceleration framework (GDHP-SAF) to accelerate the collision step on the GPU. The GPU is good at parallel processing of highly localized and data-independent computing tasks. In the collision step, the distribution function on each grid is updated independently, relying only on the distribution function of the grid itself and the local macroscopic quantity (i.e., density). , macro speed ), in line with the requirements of "high localization and no data dependency", all grids can be calculated synchronously and in parallel without cross-grid dependency. Therefore, using GPU, each GPU thread processes a grid block composed of several grids, and uses shared memory to cache frequently accessed data (such as distribution functions). , speed direction , local macro variables), and avoid random access to global memory through memory merging optimization.

[0075] Based on the above content, the structure of the heterogeneous mixed precision acceleration framework (GDHP-SAF) is described in detail.

[0076] Figure 2 The following is the architecture diagram of GDHP-SAF, which is divided into three steps: generating labeled arrays, optimizing storage, and mixed-precision calculations. Generating labeled arrays and optimizing storage run on the CPU, while mixed-precision calculations run on the GPU. They are explained separately below.

[0077] 1. Generate a tag array

[0078] Based on gradient-curvature analysis, the real-time perception and feedback of local physical characteristics such as gradient and curvature are realized, and the precision distribution is dynamically adjusted according to the transient characteristics of the flow field in the fluid area to generate a marker array, such as Figure 3 Specifically shown are:

[0079] (1) Calculation of gradient extreme values ​​within a block

[0080] The fluid area is divided into multiple grid blocks, each grid block contains several grids, and the collision calculation is performed in grid blocks. Therefore, the gradient extreme value in the block is calculated by the reduction operation in the block, and the gradient extreme value in the block is calculated by Indicates that, For a grid block, The concentration gradient for each grid.

[0081] (2) Dynamic threshold generation

[0082] Based on the gradient extreme value within the block and combined with the curvature field of the current block, a threshold is dynamically generated for each grid in the block. , which can be expressed as:

[0083]

[0084] Where, is the gradient extremum within the block, is the curvature gradient (reflecting the discrete spatial change rate of curvature). The parameters α and β are calibrated based on grid sensitivity analysis and Young-Laplace pressure balance criterion to ensure that the dynamic threshold can suppress gradient noise and avoid excessive triggering of double-precision calculations.

[0085] (3) Mark array generation

[0086] The concentration gradient through each grid ( ), curvature gradient ( ) is compared with the threshold to obtain the 0 / 1 mark of each grid, which forms the mark array flag[N] (N is the total number of grids).

[0087] Specifically, when the i-th grid or When , flag[i]=1, otherwise flag[i]=0.

[0088] Based on the above content, the pseudo code of the tag array is generated, as shown in Table 1:

[0089] Table 1 Mark array generation function

[0090]

[0091] 2. Optimize storage

[0092] To more efficiently organize mixed-precision data and facilitate subsequent communication and computational processing, this embodiment proposes a two-stage optimized storage strategy: mark-driven compression mapping and storage layout reconstruction. Specifically,

[0093] like Figure 4As shown in the figure, in the flag-driven compression mapping, the flag array flag[N] (N is the total number of grids) generated in the previous step is used to divide the grid data arr[N*19] to be calculated into two groups: double precision (D_arr) and single precision (F_arr). When the flag flag[i] of the i-th grid is 1, the 19 distribution function data of the grid are stored in the array D_arr in double precision FP64 format, and the index is maintained by D_map[i]. If flag[i] is 0, the data are stored in the array F_arr in single precision FP32 format and are identified by F_map[i].

[0094] This method can alleviate the pressure on video memory in large-scale multiphase flow simulations and ensure that large-scale calculations can be successfully completed within a single GPU card.

[0095] Figure 5 The different storage methods of AoS (array structure) and SoA (array of structures) were compared. In AoS mode, all distribution functions of a single grid are arranged continuously according to physical properties. However, when global data in a specific direction (such as f0) needs to be read in batches, strided access is easily caused, thereby reducing cache efficiency. The SoA layout stores distribution functions in the same direction in a centralized manner. This design significantly improves the prefetch efficiency of the GPU cache, and bandwidth utilization jumps to 68%. In addition, the continuous data blocks generated by SoA can be directly encapsulated as communication messages, simplifying the subsequent packaging and transmission process. Therefore, this embodiment converts the array structure AoS into the structure array SoA, centrally stores the grid data in the same direction in the simulation, and completes the storage layout reconstruction.

[0096] 3. Mixed Precision Computing

[0097] Based on storage optimization, GDHP-SAF enables deep parallelization of communication and computation on the GPU through asynchronous double buffering, multiple CUDA streams, and task scheduling.

[0098] Specifically, multiple CUDA streams are used for simultaneous processing: one stream is responsible for the collision calculation of the current time step, that is, iteratively calculating the distribution function value of each time step through formula (1); the other stream performs the data transmission of the previous time step in parallel, thereby reducing the obstruction of communication on the calculation. Among them, combined with dynamic precision allocation, the stream responsible for collision calculation is divided into double-precision pipeline and single-precision pipeline. Together with the data transmission stream, they form a three-level pipeline consisting of double precision, single precision, and communication.

[0099] Since the data blocks output in the SoA format are divided into double-precision and single-precision types, the communication pipeline can directly package the messages and send them to the GPU for the underlying double-precision collision calculation and single-precision collision calculation. That is, the distribution function value of each time step is iteratively calculated through formula (1) to avoid frequent conversion. Experimental results show that this mechanism reduces the communication delay from 12.8 milliseconds to 2.9 milliseconds, and the communication efficiency is improved by about 77%.

[0100] In collision calculations based on double-precision pipelines and single-precision pipelines, task scheduling, namely instruction-level reconstruction and hardware resource scheduling, fully unleashes the GPU computing power. Specifically:

[0101] First, the fused multiply-add (FFMA) and global load (LDG) instructions reduce the instruction count and register usage of the single-precision path, improving the thread block scheduling efficiency of the streaming multiprocessor (SM);

[0102] Secondly, a loop unrolling strategy is used to improve instruction-level parallelism (ILP), significantly increasing the computing power utilization of single-precision kernel functions.

[0103] Finally, SM resources are dynamically allocated based on the characteristics of the Ampere architecture: FP64 calculations are prioritized in high-gradient areas to ensure interface tension accuracy, while preemptive communication channels are used to maximize FP32 data transmission efficiency in low-gradient areas, ultimately achieving load balancing of computing and communication.

[0104] In addition to the above-mentioned improvements in task scheduling to release GPU computing power, rounding errors in single-precision calculations are also handled.

[0105] First, let's explain the source of rounding errors in single-precision calculations. In computers, the storage and calculation of floating-point numbers (especially single-precision FP32) are subject to precision limitations. First, there is a finite number of bits for representation. Single-precision floating-point numbers use 32 bits (1 bit for sign, 8 bits for exponent, and 23 bits for mantissa), which cannot accurately represent all real numbers. Second, there is binary conversion error. For example, the decimal number 0.1 is an infinite repeating decimal in binary (0.0001100110011...) and must be truncated or rounded. Finally, arithmetic operations are truncation. In addition, subtraction, multiplication, and division operations, the part exceeding the mantissa will be discarded or approximated, resulting in small errors.

[0106] To reduce the impact of rounding errors on single-precision calculation accuracy, a Kahan error compensation mechanism is introduced in the single-precision collision calculation of the single-precision pipeline. This mechanism temporarily stores the rounding errors of single-precision calculations and dynamically corrects them in subsequent calculations, thereby suppressing error accumulation. As shown in Table 2, the details are:

[0107] (1) Initialize the cumulative sum (sum) and the compensation for temporary rounding error (compensation);

[0108] (2) Process the distribution function values ​​in different directions of the grid item by item :

[0109] By distribution function value Remove the compensation amount from the previous round and calculate the intermediate variable y;

[0110] Define the sum of the accumulated sum and the intermediate variable as a temporary accumulated sum;

[0111] Extract the rounding error compensation of this calculation by subtracting the accumulated sum sum and the intermediate variable y from the temporary accumulated sum temp_sum respectively;

[0112] Overwrite the distribution function value with the cumulative sum The original value of , ensuring that the error is dynamically corrected during iteration.

[0113] Table 2 Kahan error compensation function

[0114]

[0115] The compensation mechanism temporarily stores the rounding error in a dedicated variable (i.e., the compensation amount in Table 2) and dynamically adjusts the distribution function value in the next iteration cycle ( ), stabilizing the mass conservation error within 0.1%. Compared to the static strategy, this design reduces video memory usage while effectively suppressing error diffusion during interface evolution.

[0116] This example experimentally evaluates the GDHP-SAF framework's performance and memory optimization, as well as its numerical accuracy and physical fidelity. The experimental environment is based on an NVIDIA A100 GPU (40 GB of memory). A typical droplet collision problem was used as the test object on Palabos to demonstrate the framework's effectiveness. All experiments used the D3Q19 discrete model, and each result is the average of three independent experiments (standard deviation <2%).

[0117] A. Performance and video memory optimization

[0118] Figure 6 and Figure 7 The speedup difference between GDHP-SAF and the previous full double-precision model within the executable grid scale is compared. Figure 6We demonstrate GDHP-SAF's overall speedup across a range of grid sizes from 64³ to 521³, demonstrating near-linear weak scalability. At 420³, it achieves a 25.2x speedup, outperforming the previous full double-precision model by 17.7x. At 521³, the full FP64 model implementation exceeds the 40 GB memory capacity of the A100 GPU, while GDHP-SAF reduces memory usage to 37.2 GB through adaptive precision switching. This results in a 30.5x overall speedup compared to the CPU reference.

[0119] Figure 7 Demonstrating speedups for collision kernels (excluding communication) across a wide range of resolutions, GDHP-SAF consistently outperforms the full FP64 baseline model, with kernel speedups ranging from 1.8x to 2.5x. At 256³, the speedup improves from 446x (FP64) to 887x (GDHPSAF), a gain of 1.99x. This advantage increases with scale: at 420³, GDHP-SAF reaches 936x, compared to 524x for FP64. At 521³, it maintains a kernel speedup of 965x, while the FP64 model fails due to memory limitations. These results highlight the scalability and robustness of GDHPSAF in memory-constrained GPU environments.

[0120] Figure 8 A comparison of video memory usage is shown. With a 420³ grid, GDHP-SAF reduces video memory requirements from 32.2 GB to 19.5 GB, a reduction of approximately 39.4%, through dynamic storage compression. When the grid size is less than 256³, the video memory difference between mixed precision and full double precision is less than 9%, primarily due to the dominance of fixed storage overhead (such as index tables and tag arrays). This shows that the larger the simulation scale, the more significant the video memory advantage of GDHP-SAF, making it particularly suitable for industrial scenarios with grid sizes exceeding 100 million.

[0121] B. Numerical Accuracy Verification

[0122] In order to verify the dynamic precision allocation, this embodiment analyzes the influence of the threshold coefficient α on the mass conservation error. Figure 9The effect of the threshold coefficient α on the mass conservation error is demonstrated. In the case of droplet collisions on a 521³ grid, when α = 0.25, the mass conservation error is 1.0%, meeting the industry standard (<1%

[18] ); when α is increased to 0.30, the error rises to 1.1%, which is still significantly better than the 1.5% of the static mixed precision scheme[3]. Comparing different grid sizes, it is found that when α increases from 0.25 to 0.30, the error of the 121³ grid increases from 1.5% to 1.7% (a relative increase of 13.3%), while the error of the 521³ grid only increases from 1.0% to 1.1% (a relative increase of 10%), indicating that higher resolution helps reduce parameter sensitivity and improve the robustness of dynamic allocation.

[0123] It should be noted that existing mixed-precision studies have achieved errors of less than 1% in single-phase flow (Poiseuille flow), but these tests did not involve complex multiphase flow scenarios. GDHP-SAF, through dynamic precision allocation, stably controls mass conservation errors to less than 1% in multiphase scenarios such as droplet collisions, expanding the applicability of mixed-precision strategies. Furthermore, the threshold coefficient β is used to identify curvature-sensitive regions. For the current droplet collision problem, the interfacial tension error is primarily determined by the gradient component, and the curvature effect can be ignored.

[0124] C. Physical rationality verification

[0125] like Figure 10 、 Figure 11 As shown, the droplet interface in both the original Palabos version and the GDHP-SAF framework exhibits smooth and continuous evolution, without interface fragmentation or unphysical oscillations. Based on accuracy and performance results, GDHP-SAF utilizes dynamic precision allocation to maintain double-precision calculations in high-gradient regions to accurately capture interfacial tension, while employing single-precision combined with compensation techniques in low-gradient regions, reducing video memory usage by approximately 40% while maintaining interface morphology fidelity comparable to a full double-precision model. The overall experiment validates the engineering practicality of this framework from multiple perspectives: accuracy, efficiency, and physical plausibility.

[0126] This embodiment proposes a gradient-driven heterogeneous mixed-precision acceleration framework (GDHP-SAF). Through multiple optimization methods such as gradient-curvature determination, Kahan compensation, and SoA storage, in a 141.4 million grid droplet collision test, compared with the full double-precision solution, GDHP-SAF saves approximately 40% of video memory while maintaining industrial-grade accuracy and achieves up to 30 times performance improvement. It significantly reduces the GPU resource usage of high-resolution multiphase flow lattice Boltzmann simulations, fully demonstrating its robustness and efficiency in complex interface dynamics.

[0127] Example 2

[0128] In one embodiment of the present disclosure, a multiphase flow simulation system based on heterogeneous mixed-precision acceleration is provided, comprising:

[0129] The acquisition module is configured to: acquire information of a target object to be simulated;

[0130] The modeling module is configured to: utilize target object information to establish a fluid dynamics model through the lattice Boltzmann method, discretize the continuous fluid macroscopic behavior into tiny grids and time steps, and simulate the fluid macroscopic behavior by colliding and migrating a number of particles in the gridded fluid region;

[0131] The simulation module is configured to: iterate the fluid dynamics model in time steps based on the initial density distribution function, simulate the macroscopic behavior of the fluid for all particles in parallel in each time step until the iteration stop condition is met, and obtain the multiphase flow simulation result;

[0132] Among them, the parallel simulation of fluid macroscopic behavior adopts a heterogeneous mixed precision acceleration framework, dynamically identifies sensitive areas in the fluid area through the gradient-curvature collaborative criterion, and performs double-precision and single-precision mixed precision calculations based on the identification results, thereby parallelizing the collision process in the multiphase flow simulation.

[0133] Example 3

[0134] In one embodiment of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the multiphase flow simulation method based on heterogeneous mixed precision acceleration is implemented.

[0135] Example 4

[0136] In one embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, which is used to store computer instructions. When the computer instructions are executed by a processor, the multiphase flow simulation method based on heterogeneous mixed precision acceleration is implemented.

[0137] Example 5

[0138] In one embodiment of the present disclosure, an electronic device is provided, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device executes the multiphase flow simulation method based on heterogeneous mixed precision acceleration.

[0139] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Those skilled in the art should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.

Claims

1. A multiphase flow simulation method based on heterogeneous mixed precision acceleration, characterized in that: include: Obtain information about the target object to be simulated; Using the target object information, a fluid dynamics model is established through the lattice Boltzmann method. The continuous macroscopic behavior of the fluid is discretized into tiny grids and time steps. The macroscopic behavior of the fluid is simulated by the collision and migration of several particles in the gridded fluid area. Based on the initial density distribution function, the fluid mechanics model is iterated in time steps. In each time step, the macroscopic behavior of the fluid is simulated in parallel for all particles until the iteration stop condition is met to obtain the multiphase flow simulation result. The parallel simulation of fluid macroscopic behavior uses a heterogeneous mixed-precision acceleration framework to dynamically identify sensitive areas in the fluid region through a gradient-curvature collaborative criterion. Based on the identification results, double-precision and single-precision mixed-precision calculations are performed to parallelize the collision process in multiphase flow simulation. The heterogeneous mixed precision acceleration framework includes an application layer, a heterogeneous layer and an optimization layer; The application layer dynamically identifies sensitive areas in the fluid region through a gradient-curvature collaborative criterion and generates a marker array as an identification result; The heterogeneous layer, based on the recognition results, adopts a three-stage pipeline consisting of double precision, single precision, and communication, and coordinates communication and calculation with a double buffer protocol to ultimately simulate the collision process; The optimization layer performs full-stack optimization of storage, communication, and computing by reconstructing the compressed storage architecture and double-buffered communication; The gradient-curvature collaborative criterion is used to dynamically identify sensitive areas in the fluid region and generate a marker array, specifically: Use intra-block reduction to obtain the gradient extreme value within the block; Based on the gradient extreme value within the block and combined with the curvature field of the current block, a threshold is dynamically generated for each grid in the block; By comparing the gradient and curvature of each grid with the threshold, the 0 / 1 mark of each grid is obtained to form a mark array.

2. A multiphase flow simulation method based on heterogeneous mixed precision acceleration according to claim 1, characterized in that: The threshold is dynamically generated for each grid in the block and is expressed as: in, is the gradient extreme value within the block, is the curvature mutation intensity, α and β are two parameters.

3. The multiphase flow simulation method based on heterogeneous mixed precision acceleration according to claim 1 is characterized in that: The three-stage pipeline consisting of double precision, single precision, and communication is specifically as follows: The double-precision pipeline and the single-precision pipeline select the corresponding double-precision floating-point format and single-precision floating-point format respectively according to the 0 / 1 mark of the grid, and perform the collision calculation of the current time step in parallel through double-precision calculation and single-precision calculation combined with Kahan cumulative error compensation; The communication pipeline is based on the double buffer protocol, which constructs double-precision buffer area and single-precision buffer area, executes the data transmission of the previous time step in parallel, and saves the transmitted data to the corresponding buffer area according to the 0 / 1 mark of the grid.

4. A multiphase flow simulation method based on heterogeneous mixed precision acceleration according to claim 1, characterized in that: The reconstructed compression storage architecture includes mark-driven compression mapping and storage layout reconstruction; The tag-driven compression mapping compresses the grid data by grouping the grids according to the 0 / 1 tags of the grids to form an array structure. The storage layout reconstruction is to convert the array structure into a structure array and centrally store the grid data of the same direction in the simulation.

5. A multiphase flow simulation system based on heterogeneous mixed precision acceleration, characterized in that: A multiphase flow simulation method based on heterogeneous mixed precision acceleration according to any one of claims 1 to 4 is adopted, comprising: The acquisition module is configured to: acquire information of a target object to be simulated; The modeling module is configured to: utilize target object information to establish a fluid dynamics model through the lattice Boltzmann method, discretize the continuous fluid macroscopic behavior into tiny grids and time steps, and simulate the fluid macroscopic behavior by colliding and migrating a number of particles in the gridded fluid region; The simulation module is configured to: iterate the fluid dynamics model in time steps based on the initial density distribution function, simulate the macroscopic behavior of the fluid for all particles in parallel in each time step until the iteration stop condition is met, and obtain the multiphase flow simulation result; Among them, the parallel simulation of fluid macroscopic behavior adopts a heterogeneous mixed precision acceleration framework, dynamically identifies sensitive areas in the fluid area through the gradient-curvature collaborative criterion, and performs double-precision and single-precision mixed precision calculations based on the identification results, thereby parallelizing the collision process in the multiphase flow simulation.

6. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the multiphase flow simulation method based on heterogeneous mixed precision acceleration according to any one of claims 1 to 4 is implemented.

7. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by the processor, a multiphase flow simulation method based on heterogeneous mixed precision acceleration as described in any one of claims 1 to 4 is implemented.

8. An electronic device, characterized in that: include: A processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to implement a multiphase flow simulation method based on heterogeneous mixed precision acceleration as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-relaxation lattice Boltzmann model-based underground water flowing simulation acceleration method

    CN107515987A

  • Liquid chromatogram flow velocity real-time detection and optimal control method based on multi-point sensing

    CN120065760A