OpenMP parallel computing method for numerical model of underwater explosion LDG
By using OpenMP parallel computing technology, the computationally intensive task of the underwater explosion LDG numerical model is decomposed onto multiple CPU cores, which solves the problem of low efficiency of traditional serial computing methods, realizes larger-scale and more refined computing, and improves computing speed and accuracy.
Patent Information
- Application Number
- CN202511574713.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-10-31
AI Technical Summary
Traditional serial computation methods suffer from low computational efficiency and limited computational scale when handling numerical simulations of underwater explosion impact cavitation loads, failing to meet the computational needs of modern engineering and unable to accurately capture key physical phenomena.
By employing OpenMP parallel computing technology, computationally intensive tasks are decomposed across multiple CPU cores. By merging computational tasks, optimizing variable types and array storage structures, computational efficiency is improved.
It enables larger-scale and more refined calculations, accurately capturing the peak value of shock waves and cavitation effects, and significantly improving calculation speed and accuracy.
Smart Images

Figure CN121050861B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of computer data processing calculation, and particularly relates to an OpenMP parallel calculation method for an underwater explosion LDG numerical model. BACKGROUND
[0002] Numerical simulation of underwater explosion shock cavitation load is of great significance in the fields of ship structure shock resistance performance evaluation, underwater weapon damage performance analysis and ocean engineering protection. The physical process is extremely complex, involving multiple stages such as propagation of high-pressure shock wave, generation, development and collapse of cavitation region, and the numerical simulation has the typical characteristics of large amount of calculation, large storage demand and long calculation time. In the existing traditional technology, the process is solved step by step on the computer through a serial calculation program. However, with the increasing requirements of modern engineering on the calculation scale, the limited computing capacity of a single core of the processor in the traditional serial calculation method is difficult to meet the computing requirements when dealing with such large-scale complex problems. SUMMARY
[0003] In view of the above problems, the present application aims to overcome the technical problems of low calculation efficiency and limited calculation scale in the traditional serial calculation method. Since the traditional serial calculation method can only use a single core of the computer CPU for calculation, when facing a complex calculation model, the calculation time cannot meet the efficiency requirements of engineering applications. The present application fully calls the multi-core CPU resources in the modern computer by using the OpenMP parallel calculation technology, and decomposes the calculation-intensive tasks to multiple cores for collaborative processing. This makes the calculation speed increase exponentially, greatly improving the calculation efficiency. In order to shorten the calculation time, the existing serial calculation method has to sacrifice the scale and grid density of the calculation model, resulting in the inability to accurately capture the shock wave peak value, cavitation collapse and other key physical phenomena. Due to the improvement of calculation efficiency, the present application can use larger scale calculation domain and more fine calculation grid for calculation, which can more accurately capture the peak pressure of shock wave and simulate the evolution process of cavitation effect, so as to obtain more real and reliable calculation results.
[0004] The present application provides an OpenMP parallel calculation method for an underwater explosion LDG numerical model, comprising the following processes:
[0005] Step 1, importing a discrete flow field file and identifying boundary conditions;
[0006] Step 2, identifying calculation-intensive tasks in underwater explosion serial numerical calculation;
[0007] Step 3: Create a parallel computing environment. Before enabling parallel computing, based on the number of physical cores of the computing platform, set the number of threads to be started in the parallel computing domain by calling the OpenMP parallel computing function; start multiple threads and assign subsequent loop computing tasks to the set threads, with each thread executing the assigned computing task.
[0008] Step 4: Specify private and public variables in the loop calculation and optimize the array storage structure;
[0009] Step 5: OpenMP parallel computing is used for solving the governing equations, calculating the element numerical flux, and updating the time domain in the underwater explosion problem.
[0010] Furthermore, in step 1, the program first reads discrete flow field related data, including node number, node coordinates, element number, and information related to the composition of element nodes.
[0011] The program assigns specific boundary identifiers, such as incident wave loading surface, non-reflective loading surface, and free boundary, to element boundary coordinates through calculation. This provides crucial support for subsequent calculation of different boundary condition formulas via conditional branching in parallel loop computation.
[0012] Furthermore, in underwater explosion numerical calculations, computationally intensive tasks typically involve: solving the governing equations, calculating element numerical flux, and updating the time domain. Therefore, OpenMP parallel computing is primarily employed for these steps.
[0013] Furthermore, step 3 specifically includes:
[0014] For numerical calculations of underwater explosions involving multiple independent loops, the independent auxiliary variable calculation tasks in the governing equations are merged into a single parallel loop. A parallel computation domain is created using parallel computation instructions, and the calculations of multiple physical quantities are performed within the loops of this domain. This reduces the fixed overhead of creating and destroying threads at each time step.
[0015] In underwater explosion numerical calculations, for calculation expressions under different boundary conditions in the flow field, all boundary elements are processed within a unified loop, and only one OpenMP parallel domain is created. Within the loop, a select-case branch statement is used to precisely select and execute the corresponding calculation expression based on the boundary identifier of the currently processed boundary element. This merges the original multiple parallel loops into one, eliminating redundant thread management overhead.
[0016] Furthermore, step 4 specifically includes:
[0017] Temporary variables used within a single loop (such as flow field element numbers, element edge numbers, and Gaussian integration point numbers within an element) are declared as private variables. This ensures that each thread has independent values for these variables, preventing data races caused by overlapping calculations between threads. Large global arrays (such as element basis function arrays, element normal vector arrays, and element numerical flux arrays) are declared as public variables, instructing all threads to directly access the same memory location. This avoids unnecessary memory copying.
[0018] Optimize the array storage structure in the parallel computing domain to ensure that the numerical flux at the boundary of a cell and the corresponding physical quantities at each Gaussian integration point within the cell are stored continuously in memory, exhibiting continuous streaming characteristics, thereby significantly improving cache hit rate and reducing memory access latency.
[0019] Furthermore, step 5 specifically includes:
[0020] The control equations for underwater explosions are solved using OpenMP parallel computing. The parallel computation iterates through each discrete cell and, based on the current physical state, calculates the two auxiliary variables and the second-order partial derivative of dynamic pressure with respect to time for each discrete cell in the control equation (wave equation).
[0021] The numerical flux of the cell boundary is calculated using OpenMP parallel computing. The parallel computing iterates through each edge in each discrete cell, and calculates the numerical flux of the cell boundary based on the current physical field state, the average value of physical quantities on both sides of the boundary, and the jump amount of physical quantities in the normal direction.
[0022] OpenMP parallel computing is used to solve the time-domain update. The fourth-order Runge-Kutta method is used to update the first-order partial derivative of dynamic pressure with respect to time and the dynamic pressure results of all elements in the next time step according to the physical quantities or initial conditions at the current time step.
[0023] Furthermore, after the parallel computation is completed, the parallel computation termination statement is called to end the parallel computation, and then the program will switch back to serial execution mode.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] 1. This invention innovatively introduces the OpenMP parallel computing method into the study of underwater explosion impact cavitation load in the Locally Discontinuous Galerkin (LDG) method. By adopting OpenMP parallel technology, the computationally intensive tasks in the underwater explosion calculation problem are decomposed into multiple cores for collaborative processing, overcoming the shortcomings of traditional serial computing methods such as low computational efficiency and limited computational scale.
[0026] 2. This invention optimizes OpenMP parallel computation for underwater explosive impact cavitation loads. By merging computation tasks, the computation tasks of two independent auxiliary variables within each unit are combined and executed within a single OpenMP parallel domain. This reduces the overhead of creating and destroying parallel domains, and lowers thread synchronization and management overhead. Variable types are rationally allocated within the parallel computation domain to avoid data races and unnecessary memory copies; simultaneously, the array structure storing numerical flux is improved, and its layout in memory is optimized. This further improves cache hit rate and reduces memory access latency. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the following description is only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is the overall logic flowchart of the present invention.
[0029] Figure 2 This is a flowchart of the method for accelerating the calculation of far-field underwater explosion impact cavitation load based on OpenMP parallelism in an embodiment of the present invention.
[0030] Figure 3 This is a schematic diagram of the propagation of underwater explosion shock waves in the flow field based on the OpenMP parallel computing method of this invention.
[0031] Figure 4 This is a comparison chart of the pressure at the flow field measurement points calculated by the LDG (serial and parallel) method and the ABAQUS acoustic finite element method. Detailed Implementation
[0032] This invention proposes an OpenMP parallel computing method for underwater explosion LDG numerical models. By introducing the OpenMP parallel computing method, computationally intensive tasks are decomposed and processed collaboratively across multiple cores, significantly improving computational efficiency. The effectiveness and accuracy of the proposed method's calculation results are verified by comparing them with those obtained using ABAQUS software for acoustic-structure interaction (AS / DE). Furthermore, the acceleration performance and parallel efficiency of the proposed method are verified by comparing its processing time with that of serial computing methods. The overall process is as follows: Figure 1 As shown:
[0033] Step 1: Import the discrete flow field file and identify boundary conditions;
[0034] Step 2: Identify computationally intensive tasks in the serial numerical calculation of underwater explosions;
[0035] Step 3: Create a parallel computing environment. Before enabling parallel computing, based on the number of physical cores of the computing platform, set the number of threads to be started in the parallel computing domain by calling the OpenMP parallel computing function; start multiple threads and assign subsequent loop computing tasks to the set threads, with each thread executing the assigned computing task.
[0036] Step 4: Specify private and public variables in the loop calculation and optimize the array storage structure;
[0037] Step 5: OpenMP parallel computing is used for solving the governing equations, calculating the element numerical flux, and updating the time domain in the underwater explosion problem.
[0038] Step 6: After the parallel computation is completed, call the parallel computation termination statement to end the parallel computation, and then the program will switch back to serial running mode.
[0039] The following will further describe the specific implementation methods of this invention, as well as the technical difficulties and details of this invention, using concrete examples. The calculation flow of this experiment, based on the OpenMP parallel far-field underwater explosion impact cavitation load acceleration calculation method, is as follows: Figure 2 As shown.
[0040] Step 1: Import Discrete Flow Field File and Identify Boundary Conditions. The program reads relevant data from the discrete flow field, including node numbers, node coordinates, element numbers, and information related to the composition of element nodes. The program calculates the element boundary coordinates and assigns specific boundary identifiers such as incident wave loading surface, non-reflective loading surface, and free boundary.
[0041] Step 2: Based on the relevant information in the discrete flow field file read in Step 1, a numerical model of the underwater explosion impact load propagating in the acoustic flow field is constructed to calculate the load of the shock wave generated by the underwater explosion in the flow field. A pressure truncation model is introduced to handle the cavitation effect of the discrete flow field.
[0042] The propagation of the underwater explosion shock wave in the fluid follows the second-order wave equation, which is calculated in the flow field as follows:
[0043] (1)
[0044] In the formula p It represents the dynamic pressure of the fluid, and Δ represents the Laplace operator. This represents the second derivative of the fluid's dynamic pressure with respect to time. c It is the fluid in the flow field Ω The speed of sound inside.
[0045] The three-dimensional flow field model is simplified into an axisymmetric model, and auxiliary variables are introduced into the axisymmetric model in cylindrical coordinates. Formula (1) can be rewritten as:
[0046] (2)
[0047] (3)
[0048] (4)
[0049] In the formula r and z These are radial coordinates and axial coordinates, respectively. Indicates the fluid dynamic pressure r Find the partial derivative in the direction. Indicates the fluid dynamic pressure r Find the second-order partial derivative in the direction. Indicates the fluid dynamic pressure z Find the second-order partial derivative in the direction. This represents the differentiation operator. q 1 Represents the hydrodynamic pressure of fluid on space r Take the partial derivative of the direction and multiply by the speed of sound c ; q 2 Represents the hydrodynamic pressure of fluid on space z Take the partial derivative of the direction and multiply by the speed of sound c .
[0050] The second-order wave equation of the above axisymmetric model is multiplied by the test function respectively. , and By applying the integral-by-parts rule and Gauss's theorem, the governing equations for the propagation of underwater explosion shock waves in the discrete triangular element flow field are obtained. The governing equations can be expressed as:
[0051] (5)
[0052] (6)
[0053] (7)
[0054] In the formula r and z These are the radial and axial coordinates in cylindrical coordinate system, respectively. c It is the sound velocity of the flow field. Represents the hydrodynamic pressure of the fluid in the discrete unit Approximate solution in and These are approximate solutions for auxiliary variables, which are respectively represented in the discrete unit. Medium fluid dynamic pressure space r andz Take the partial derivative of the direction and multiply by the speed of sound c an approximate solution, Represents the element in the discrete element e The boundary, It is the unit outward normal vector of the element boundary. and They represent the test functions respectively. right r and z Find the partial derivative. Represents the test function right r Find the partial derivative. Represents the test function right z Find the partial derivative. , and It is the numerical flux at the cell boundary.
[0055] A pressure cutoff model is introduced to prevent negative absolute pressure in the fluid, and the cavitation region of the flow field is marked. Specifically:
[0056] (8)
[0057] (9)
[0058] In the formula It is pseudo-dynamic pressure. It is atmospheric pressure. It is the hydrostatic pressure at that point in the flow field. It is gravitational acceleration. It is the water depth at the calculation point. This is the cavitation limit, which is set to 0.
[0059] Step 3: Based on the boundary markers of the boundary elements in Step 1 and the governing equations for the propagation of the underwater explosion shock wave in the discrete element flow field in Step 2, calculate the numerical flux at the boundary of the discrete element. , and The calculations are performed, and the expressions for calculating the numerical flux under different boundary conditions are shown below:
[0060] (10)
[0061] (11)
[0062] (12)
[0063] In the formula, + represents the element located in the cell. Physical quantities on Indicates the location of the cell The dynamic pressure value of the corresponding side. It is the gradient of dynamic pressure at any point on the incident wave loading surface with respect to the spatial direction. This represents the time derivative of the fluid dynamic pressure at a non-reflective boundary element. ,in It is the edge e The length. For fluid bulk modulus, The fluid density is given. and These represent the hydrodynamic pressure at the free boundary element versus space. r and z Take the partial derivative of the direction and multiply by the speed of sound c An approximate solution.
[0064] Step 4: Based on the results calculated in Steps 2 and 3, the physical quantities of all discrete elements in the flow field at the initial moment can be obtained. The fourth-order Runge-Kutta method is used to calculate the physical quantities of all discrete elements in the flow field at the next moment. By continuously repeating this step, the physical quantities of all discrete elements in the flow field at all calculation moments can be calculated, thereby realizing the propagation characteristics and cavitation evolution law of underwater explosion impact load in the discrete element flow field.
[0065] Introducing variables , , and Formula (5) can be expressed as:
[0066] (13)
[0067] Combined with initial conditions , ;
[0068] The physical quantity at the next time step is solved using the fourth-order Runge-Kutta method, and the calculation expression is as follows:
[0069] (14)
[0070] (15)
[0071] (16)
[0072] (17)
[0073] (18)
[0074] In the formula Δ t Increment for time step; for t mThe hydrodynamic pressure at time t and the first derivative of the hydrodynamic pressure with respect to time; , , , They represent different times and different The fluid dynamic pressure and the first derivative of the fluid dynamic pressure with respect to time are calculated under the given conditions. for t m Moment and The value, For calculation Time calculation and value, For calculation Time calculation and value, For calculation Time calculation and value; for t m +Δ t The hydrodynamic pressure at time t and the first derivative of the hydrodynamic pressure with respect to time.
[0075] Step 5: Based on the governing equations for the propagation of the underwater explosion shock wave in the two-dimensional axisymmetric model from Step 2, and the calculation expressions for the pressure truncation model, the numerical fluxes under different boundary conditions are calculated in Step 3, and the physical quantities of all discrete elements in the flow field at the next time step are calculated in Step 4. This step uses OpenMP parallel computing to accelerate the calculation of the relevant physical quantities of all discrete elements.
[0076] S5-1: Call the OpenMP parallel computing command to specify how many threads need to be called for OpenMP parallel computing.
[0077] S5-2. Before calculating the relevant physical quantities for each discrete unit in the flow field in step 2, enter the OpenMP parallel computing environment by calling the OpenMP parallel computing creation command.
[0078] S5-3. After entering the OpenMP parallel computing environment, specify private and public variables in the loop computation to avoid data races between threads.
[0079] S5-4. After the loop calculation is completed, the OpenMP parallel calculation is terminated by calling the OpenMP parallel calculation termination command.
[0080] Step 6: Calculate the expressions for the governing equations in Steps 2 and 4, as well as the expressions for the numerical flux under different boundary conditions, and perform OpenMP parallel computation in Step 5. Optimize the loop computation in the OpenMP parallel region.
[0081] S6-1. For each calculation unit, the formulas 6 and 7 in step 2... and These two auxiliary variables are calculated in two separate loops. Therefore, we merge these two computational tasks into a single parallel loop body. A parallel domain is created using a single OpenMP parallel computation creation instruction, and the same unit is completed within the loop computation of this parallel domain. and The calculation of two auxiliary variables reduces the fixed overhead of thread creation and destruction at each time step.
[0082] S6-2. For solving the numerical flux calculation expressions under different boundary conditions in step 4, all boundary cells are processed within a unified loop, and only one OpenMP parallel domain is created. Within the loop, a selectcase branch statement is used to precisely select and execute the corresponding calculation expressions in formulas 10, 11, and 12 of step 3 based on the type identifier of the currently processed boundary cell. This merges the original multiple parallel loops into one, eliminating redundant thread management overhead.
[0083] Step 7: Based on the OpenMP parallel computing in Step 5, optimize the memory usage and array storage structure of OpenMP parallel computing.
[0084] S7-1. Properly allocate variable types within the parallel computing domain. In OpenMP parallel loop computation, declare temporary variables used within a single loop (such as cell numbers, edge numbers, Gaussian integration point numbers, etc.) as private. This ensures that each thread has independent values for these variables, preventing data races caused by overlapping calculations between threads. For large global arrays (such as basis function arrays, normal vector arrays, and auxiliary variables at each cell integration point), [further details are needed]. and Declaring a thread as shared (e.g., `shared`) instructs all threads to access the same memory location directly, avoiding unnecessary memory copying.
[0085] S7-2, Improve the array storage structure. Change the storage structure of the numerical flux array at the boundary to... , and Where k is the Gaussian integration point number, k is the cell edge number, and i is the cell number. This allows the numerical flux of each point in a cell to be stored continuously in memory, exhibiting a continuous streaming characteristic, thereby significantly improving cache hit rate and reducing memory access latency.
[0086] Figure 3 This paper demonstrates the OpenMP parallel computation method for underwater explosion LDG numerical models, as described in this invention, simulating the propagation characteristics (unit: Pa) of the shock wave generated by the explosion of 0.1 kg explosive in a 10 m × 5 m axisymmetric computational domain. To verify the effectiveness and acceleration performance of the parallel computation method based on OpenMP for far-field underwater explosion impact cavitation loads described in this invention, the computation method used in this invention is first compared with the acoustic-structure interaction calculation results of ABAQUS software to verify its effectiveness. The comparison is performed by selecting the total pressure at (3.2 m, 4.3 m) in the flow field. Figure 4 As shown in Table 1, the results indicate that the dynamic pressure results obtained by the calculation method used in this invention are in good agreement with the calculation results obtained by the ABAQUS software. Secondly, to verify the acceleration performance of the OpenMP parallel computing method of this invention, its time consumption was compared and analyzed with that of the serial computing method. As shown in Table 1, the results show that multi-core OpenMP parallel computing can achieve significant acceleration, and in an 8-core computing scenario, it can still maintain 50% parallel efficiency.
[0087] Table 1. Speedup and Parallelism Efficiency of OpenMP Parallel Computation under Different Number of Cores
[0088]
[0089] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0090] While the specific embodiments of the present invention have been described above, they are not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. An OpenMP parallel computing method for an underwater explosion LDG numerical model, characterized in that, The process includes the following: Step 1: Import the discrete flow field file and identify boundary conditions; Step 2: Identify computationally intensive tasks in the serial numerical calculation of underwater explosions; Step 3: Create a parallel computing environment; Before enabling parallel computing, based on the number of physical cores of the computing platform, set the number of threads to be started in the parallel computing domain by calling the OpenMP parallel computing function; Multiple threads are started, and subsequent iterative computation tasks are assigned to the designated threads. Each thread executes its assigned computation task; specifically, this includes: For multiple independent loop calculations in the numerical calculation of underwater explosions, the calculation tasks of mutually independent auxiliary variables in the governing equations are merged into the same parallel loop body; a parallel computing domain is created using parallel computing instructions, and the calculation of multiple physical quantities is completed in the loop calculation of the parallel domain. In the numerical calculation of underwater explosions, for the calculation expressions under different boundary conditions in the flow field, all boundary elements are processed in a unified loop, and only one OpenMP parallel domain is created. Within the loop, the corresponding calculation expression is selected and executed according to the boundary identifier of the currently processed boundary element through the selectcase branch statement. Step 4 specifies the private and public variables in the loop calculation and optimizes the array storage structure; specifically including: Temporary variables used within a single loop are declared as private variables, including the flow field element number, element edge number, and Gaussian integration point number in the element, ensuring that each thread has independent values for these variables; large global arrays are declared as public variables, including the element basis function array, element normal vector array, and element numerical flux array, instructing all threads to directly access the same memory, avoiding unnecessary memory copying. Optimize the array storage structure in the parallel computing domain to ensure that the numerical flux at the boundary of a cell and the corresponding physical quantities at each Gaussian integration point inside the cell are stored continuously in memory, exhibiting continuous streaming characteristics and improving cache hit rate. Step 5 employs OpenMP parallel computing for the governing equation solving loop, element numerical flux calculation, and time-domain update loop in the underwater explosion problem; specifically including: S51 uses OpenMP parallel computing to solve the underwater explosion control equations. The parallel computing iterates through each discrete cell and calculates the two auxiliary variables and the second-order partial derivative of dynamic pressure with respect to time for each discrete cell in the control equations based on the physical field state at the current moment. S52 uses OpenMP parallel computing to calculate the numerical flux of the cell boundary. The parallel computing iterates through each edge in each discrete cell and calculates the numerical flux of the cell boundary based on the current physical field state, the average value of the physical quantities on both sides of the boundary, and the jump of the physical quantities in the normal direction. S53 uses OpenMP parallel computing to solve the time-domain update; it uses the fourth-order Runge-Kutta method to update the first-order partial derivative of dynamic pressure with respect to time and dynamic pressure results of all units in the next time step according to the physical quantity or initial conditions at the current time.
2. The OpenMP parallel computing method for an underwater explosion LDG numerical model as described in claim 1, characterized in that: In step 1, the program first reads discrete flow field related data, including node number, node coordinates, element number, and element node composition information. Then, by calculating the boundary coordinates of the element, specific boundary identifiers are assigned to it, including the incident wave loading surface, the non-reflection loading surface, and the free boundary.
3. The OpenMP parallel computing method for an underwater explosion LDG numerical model as described in claim 1 or 2, characterized in that: After the parallel computation is completed, the parallel computation termination statement is called to end the parallel computation, and then the program will switch back to serial execution mode.
Citation Information
Patent Citations
Method for increasing computing speed through parallel computing based on MPI and OpenMP hybrid programming model
CN104461466A
Method and device for calculating action of electromagnetic wave and plasma based on OpenMP and MPI
CN112861333A