Load distribution method, device and load distribution system for reservoir numerical simulation
By acquiring the mesh file of reservoir numerical simulation, and combining the characteristics of structured and unstructured meshes, a strategy of evenly distributing quantity and time, as well as graph segmentation technology, is adopted to optimize load distribution, thereby solving the problem of unbalanced load in reservoir numerical simulation and improving computational efficiency and accuracy.
Patent Information
- Application Number
- CN202511001933.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-07-21
AI Technical Summary
In existing technologies, reservoir numerical simulation grid computing cannot achieve load balancing when distributing loads, resulting in low computational efficiency.
By acquiring mesh files, the load is allocated according to the mesh type (structured mesh or unstructured mesh). A strategy of evenly distributing the load based on the number of structured meshes or the computation time is adopted. Combined with graph partitioning technology, the load distribution is optimized, and a unified management framework is built to ensure that the load on each computing node matches the computation time.
Load balancing was achieved, which improved the computational efficiency and accuracy of reservoir numerical simulation, especially when dealing with complex geological structures, by shortening the computation time and reducing resource waste.
Smart Images

Figure CN120508403B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of reservoir simulation technology, and more specifically, to a load distribution method, apparatus, computer program product, and load distribution system for reservoir numerical simulation. Background Technology
[0002] In reservoir numerical simulation, grids are commonly used for simulation, and then different processors (or other computing devices) are used to calculate the oil and water distribution. However, due to the different complexities of different grids, the required memory access efficiency is different, which can lead to the inability to achieve load balancing when distributing the load. Summary of the Invention
[0003] The main objective of this application is to provide a load distribution method, apparatus, computer program product, and load distribution system for reservoir numerical simulation, so as to at least solve the problem that the existing reservoir numerical simulation grid computing cannot achieve load balancing when distributing loads.
[0004] To achieve the above objectives, according to one aspect of this application, a load allocation method for reservoir numerical simulation is provided, comprising: acquiring a grid file, wherein the grid file is a file representing the geological spatial structure of a target area, the target area being one or more of a coal mine, oil field, geothermal field, and gas field, and the grid file including multiple grids; allocating loads according to the type of the grids in the grid file, wherein the type of the grids includes structured grids or unstructured grids, the loads being devices used for reservoir numerical simulation, and the allocation method including even allocation based on the number of grids and / or even allocation based on the computation time of the grids, wherein the computation time is the time taken for the load to calculate the oil-water distribution in the target area when used for reservoir numerical simulation; and controlling all the loads to perform reservoir numerical simulation based on the allocated grid file.
[0005] Optionally, when the type of the mesh is the structured mesh, allocating loads according to the type of the mesh in the mesh file includes: dividing the structured mesh into a first partition based on the directional distribution of the structured mesh to obtain a first partitioning result; updating the first partitioning result according to graph segmentation techniques to obtain a second partitioning result; and allocating the structured mesh to multiple loads according to the second partitioning result.
[0006] Optionally, the structural mesh is divided into multiple mesh sets according to the directional distribution of the structural mesh to obtain a first division result, including: obtaining the load quantity of all the loads; dividing the structural mesh in each direction into multiple mesh sets to obtain the first division result, wherein the number of mesh sets in all directions is equal to the load quantity, and each mesh set includes at least one structural mesh.
[0007] Optionally, updating the first partitioning result according to graph segmentation technology to obtain a second partitioning result includes: obtaining relevant information for each structural mesh in the first partitioning result, wherein the relevant information includes at least the size and / or complexity of the structural mesh, the size of the structural mesh is positively correlated with the computation time, and the complexity of the structural mesh is positively correlated with the computation time; updating the first partitioning result based on the relevant information according to graph segmentation technology to obtain the second partitioning result, wherein the size of the structural mesh is negatively correlated with the number of partitions, and the complexity of the structural mesh is negatively correlated with the number of partitions.
[0008] Optionally, if the type of the mesh is the unstructured mesh, allocating the load according to the type of the mesh in the mesh file includes: dividing the unstructured mesh according to a graph partitioning technique to obtain a third partitioning result; and allocating the unstructured mesh to multiple loads according to the third partitioning result.
[0009] Optionally, after allocating the load according to the type of the mesh in the mesh file, the method further includes: obtaining mesh elements, wherein the mesh elements include points, edges, faces, and volumes, at least two points form an edge, at least two edges form a face, and at least two faces form a volume; determining mesh topology information based on adjacent mesh elements, wherein the mesh topology information is information about the adjacency relationships between the mesh elements; generating geometric information based on the mesh topology information, and displaying the geometric information in a display interface, wherein the geometric information is information about the shape, size, and position of the mesh elements.
[0010] Optionally, after allocating the load according to the type of the grid in the grid file, the method further includes: obtaining a preset template range, wherein the preset template range is a set of preset defined grids; generating network template information according to the preset template range, wherein the network template information is used to describe the extended region of the grid considered when each grid is executed in a specific numerical discretization algorithm; and integrating the network template information into reservoir numerical simulation software so that reservoir numerical simulation can be performed in the reservoir numerical simulation software.
[0011] According to another aspect of this application, a load allocation device for reservoir numerical simulation is provided, comprising: a first acquisition unit for acquiring a grid file, wherein the grid file is a file representing the geological spatial structure of a target area, the target area being one or more of a coal mine, oil field, geothermal field, and gas field, and the grid file including multiple grids; an allocation unit for allocating loads according to the type of the grids in the grid file, wherein the type of the grids includes structured grids or unstructured grids, the loads being devices used for reservoir numerical simulation, and the allocation method including equal allocation based on the number of grids and / or equal allocation based on the computation time of the grids, wherein the computation time is the time taken for the load to calculate the oil-water distribution of the target area when used for reservoir numerical simulation; and a control unit for controlling all the loads to perform reservoir numerical simulation based on the allocated grid file.
[0012] According to another aspect of this application, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the steps of any of the load distribution methods for reservoir numerical simulation.
[0013] According to another aspect of this application, a load distribution system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any of the described load distribution methods for reservoir numerical simulation.
[0014] By applying the technical solution of this application, the structured grid data structure has the advantages of high memory access efficiency and high parallel computing efficiency, while the unstructured grid data structure can handle complex geometry and has good adaptability to geological structures. This solution can distribute the load to different types of grids, build a unified management framework for different grid types, and ensure that the load can bear similar workloads, thereby achieving load balancing. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 A hardware block diagram of a mobile terminal for performing a load distribution method for reservoir numerical simulation provided in an embodiment of this application is shown.
[0017] Figure 2 A schematic flowchart of a load allocation method for reservoir numerical simulation provided according to an embodiment of this application is shown.
[0018] Figure 3 A schematic diagram of the grid functionality for reservoir numerical simulation is shown.
[0019] Figure 4 A schematic diagram of the adjacency relationship of the polyhedral mesh topology is shown;
[0020] Figure 5 A structural block diagram of a load distribution device for reservoir numerical simulation provided according to an embodiment of this application is shown.
[0021] The above figures include the following reference numerals:
[0022] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0027] Numerical simulation of oil reservoirs: Numerical simulation of oil reservoirs refers to using computers to solve mathematical models of oil reservoirs, simulate underground oil and water flow, and give the oil and water distribution at a certain moment in order to predict oil reservoir dynamics.
[0028] A mesh is a spatial grid structure used to discretize and represent complex geometries. It is a fundamental concept in numerical simulation, used to transform continuous physical space into discrete grid points for numerical computation.
[0029] Structured grids: In numerical computation, a structured grid refers to a grid arranged according to rules and possessing a specific structure within the computational domain. The nodes of such a grid are typically arranged in a regular manner, satisfying certain geometric structures (such as rectangles or cubes), and structured grids usually employ a regular coordinate system. In two-dimensional space, the grid nodes are located on grid points in a Cartesian coordinate system; in three-dimensional space, the grid nodes are located on regular grid points in a three-dimensional Cartesian coordinate system.
[0030] Unstructured mesh: In numerical computation, an unstructured mesh refers to a mesh with irregular arrangement of nodes and elements, and irregular shapes or sizes. Unlike structured meshes, the elements of an unstructured mesh can be of arbitrary shapes, such as triangles, quadrilaterals, tetrahedrons, hexahedrons, etc. in three dimensions.
[0031] Corner mesh: A corner mesh is a three-dimensional mesh whose mesh cells are shaped like cubes or histograms. The main information includes the mesh cells and corner points. One mesh cell contains eight corner points, and the coordinates of these corner points are flexible. This means that although both mesh cells and corner points can be described using Cartesian coordinates, the adjacency relationships and geometry of the mesh can be irregular. Corner meshes can flexibly adapt to the complex structures of oil reservoirs.
[0032] Radial mesh: A radial mesh is a type of mesh constructed using a polar coordinate system (or spherical coordinate system), particularly suitable for problems with axisymmetric (e.g., circular or spherical) geometries. In a radial mesh, mesh points are distributed primarily along the radial direction, typically around a central point (e.g., a wellbore, source point, or a reference point). Mesh partitioning usually divides the entire simulation domain into multiple concentric circles (in two-dimensional problems) or concentric spherical layers (in three-dimensional problems). The distribution of mesh points in each layer can be uniform or non-uniform, depending on the needs of the physical problem.
[0033] As described in the background section, existing reservoir numerical simulation grid computing cannot achieve load balancing when distributing loads. To solve the above problem, embodiments of this application provide a load distribution method, apparatus, computer program product, and load distribution system for reservoir numerical simulation.
[0034] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0035] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a load distribution method for reservoir numerical simulation according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0036] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the device information display method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0037] This embodiment provides a load distribution method for reservoir numerical simulation that runs on a mobile terminal, computer terminal or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although the logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0038] Figure 2 This is a schematic flowchart of a load allocation method for reservoir numerical simulation according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0039] Step S201: Obtain a grid file, wherein the grid file is a file representing the geological spatial structure of the target area, the target area is one or more of a coal mine, oil field, geothermal field, and gas field, and the grid file includes multiple grids;
[0040] Specifically, the grid file containing geological information of the target area is read. This step is the starting point for the entire reservoir numerical simulation, ensuring that subsequent calculations are based on actual geological data, thus improving the accuracy and reliability of the simulation.
[0041] Accurate reading of the geological spatial structure enables precise simulation of oil reservoirs, avoiding calculation deviations caused by grid file errors and thus improving the prediction accuracy of oil reservoir numerical simulations. The accuracy and completeness of the grid file are crucial to the success of oil reservoir numerical simulations; different grid types require different reading strategies to ensure that all grid information is correctly parsed.
[0042] Step S202: Assign load according to the type of the grid in the grid file, wherein the type of the grid includes structured grid or unstructured grid, the load is a device used for reservoir numerical simulation, and the allocation method includes evenly distributing according to the number of grids and / or evenly distributing according to the calculation time of the grids, wherein the calculation time is the time for the load to calculate the oil and water distribution in the target area when used for reservoir numerical simulation.
[0043] Specifically, after reading the mesh file, the load is distributed according to the mesh type (structured mesh or unstructured mesh). For example, for structured meshes, a strategy of evenly distributing the load based on the number of meshes can be used to simplify the complexity of parallel computing; for unstructured meshes, a strategy of evenly distributing the load based on computation time is used, and a graph partitioning algorithm is used to optimize load balancing and ensure the effective utilization of computing resources.
[0044] This load distribution strategy can significantly improve the computational efficiency of reservoir numerical simulation, especially when dealing with large-scale reservoirs with complex geological structures. The regularity of the structured grid allows the computational tasks to be evenly distributed across computing devices, while the dynamic load distribution to the unstructured grid avoids resource bottlenecks in computationally intensive areas, thereby improving the overall parallel computing performance.
[0045] Numerical simulation of oil reservoirs: This is a mathematical and physical method used to predict and analyze the behavior of underground oil reservoirs (such as oil, natural gas, geothermal resources), including oil-water distribution, pressure changes, fluid flow, etc.
[0046] Load: Here it refers to the computing resources used for reservoir numerical simulation, which can be a processor (such as CPU, GPU), computing node or a component of a cluster.
[0047] Target area: refers to the actual geographical location of the underground oil reservoir or the virtual area defined in the reservoir simulation software. This area contains grid data of oil and water distribution.
[0048] Oil and water distribution: The distribution of oil and water in an oil reservoir is one of the main focuses of reservoir numerical simulation, as it directly affects the extraction efficiency and economic benefits of oil and gas resources.
[0049] In reservoir numerical simulation, each computational load (such as a computing node) needs to process its assigned grid data to calculate the oil-water distribution within the target area. The computation time refers to the length of time required from the start of grid data processing until the oil-water distribution is calculated. Computation time depends on several factors, including grid complexity, computing device performance, and the efficiency of the numerical algorithm used. In a parallel computing environment, the computation time of the load directly impacts load balancing (i.e., the allocation of workload among computing nodes), as loads with longer computation times may become computational bottlenecks, slowing down the overall simulation progress.
[0050] In this scheme, by intelligently allocating the load, it is ensured that the amount of grid data processed by each computing node matches its computation time. This minimizes computational imbalance and improves the overall efficiency and speed of reservoir numerical simulation. This means that by optimizing the load allocation strategy, even when dealing with complex geological structures, high-performance reservoir numerical simulation can be maintained, thereby obtaining accurate oil-water distribution prediction results in a shorter time.
[0051] Step S203: Control all the above-mentioned loads and perform reservoir numerical simulation based on the allocated grid file.
[0052] Specifically, it coordinates all computing devices to perform reservoir numerical simulations based on the loads allocated according to grid type. It not only processes topological, geometric, and adjacency template information, but also creates computationally necessary data structures such as matrices and vectors, ensuring synchronized execution of computational tasks and data communication across all devices.
[0053] Through the aforementioned intelligent scheduling, optimal resource allocation and efficient parallel computing were achieved, significantly shortening the total computation time for reservoir numerical simulation. Furthermore, by integrating and coordinating grid information and computing equipment, efficient parallel processing of complex computational tasks was ensured, reducing inter-process communication latency and thus enabling rapid and stable operation of reservoir numerical simulation.
[0054] Through this embodiment, the structured grid data structure has the advantages of high memory access efficiency and high parallel computing efficiency, while the unstructured grid data structure can handle complex geometry and has good adaptability to geological structures. This solution can distribute the load to different types of grids and build a unified management framework for different grid types to ensure that the load can bear similar workloads, thereby achieving load balancing.
[0055] Specifically, a polyhedral mesh data compatible with various reservoir meshes is adopted. The structural mesh information in the original mesh is used for pre-division as the initial mesh partitioning scheme, and a graph partitioning algorithm is further used to complete the mesh partitioning. At the same time, the order of the structural mesh is maintained to establish distributed mesh topology data, providing a unified and efficient mesh data structure for reservoir numerical simulation.
[0056] Commonly used mesh types in reservoir numerical simulation include block-center meshes, corner meshes, radial meshes, and unstructured meshes. Block-center and radial meshes are structured meshes, while corner meshes possess both structured mesh indices and the topological and geometric information of unstructured meshes. Currently, different processing methods are used for different mesh types in reservoir simulations.
[0057] 1. Block-centered grid and radial grid: Using a structured grid data structure, the grid region decomposition can be easily achieved by utilizing the characteristics of the structured grid. For example, if a three-dimensional structured grid is to be divided into 8 processes, it only needs to be divided into 2 equal parts in each direction to obtain a grid region decomposition scheme with good load balancing.
[0058] 2. Unstructured Mesh: An unstructured mesh data structure is adopted, and a load-balanced mesh region decomposition scheme is obtained using a graph partitioning algorithm.
[0059] 3. Corner mesh: It can use either structured or unstructured mesh data structures, but the common approach is to use unstructured mesh.
[0060] Structured grid data structures offer advantages such as high memory access efficiency and ease of parallel computation, but they suffer from poor geometric adaptability, making it difficult to describe the complex geological structures in reservoir numerical simulations. Unstructured grid data structures can handle complex geometries and are well-adapted to geological structures; however, they often require more complex data structures, generally have lower memory access efficiency than structured grids, and face greater challenges in load balancing. In practice, reservoir simulation engineers often choose different grids and corresponding solvers based on their understanding of the simulation scenario, significantly increasing the complexity of reservoir simulations and reducing their efficiency.
[0061] Therefore, the technical solution of this application combines the advantages of structured grid data structure and unstructured grid data structure. In response to the needs of reservoir numerical simulation for handling complex geological structures and efficient large-scale parallelism, it utilizes the adaptability of unstructured grids to complex geometric structures and the possible structured grid information (block center grid, radial grid and corner grid) to ensure computational performance, and provides a unified management scheme for the diverse grid types in reservoir simulation.
[0062] Specifically, structured grids (such as block-center grids and radial grids) are efficient in data structure and simple in load balancing due to their structural characteristics, but they are difficult to describe complex geological structures. Unstructured grids (including unstructured and corner grids) are good at describing complex geological structures, but their data structure is complex, inefficient, and difficult to load balance. The solution in this application combines the advantages of structured and unstructured grids, possessing both efficient load balancing and adaptability to complex data structures, and uses a unified grid management framework for multiple grid types.
[0063] In the specific implementation process, when the type of the above-mentioned mesh is the above-mentioned structural mesh, the load is allocated according to the type of the above-mentioned mesh in the above-mentioned mesh file, which can be achieved through the following steps: according to the directional distribution of the above-mentioned structural mesh, the above-mentioned structural mesh is divided for the first time to obtain the first division result; according to the graph segmentation technique, the above-mentioned first division result is updated to obtain the second division result; according to the above-mentioned second division result, the above-mentioned structural mesh is allocated to multiple above-mentioned loads.
[0064] In this scheme, the pre-partitioning and optimization process of the structured mesh fully utilizes the inherent regularity of the structured mesh. This not only simplifies the initial mesh partitioning but also further optimizes the load distribution using a graph partitioning algorithm, ensuring that the amount of mesh data processed by each computing device matches the computation time and reducing unnecessary communication overhead. Precise load distribution avoids idle computing devices, reduces waste caused by underutilized computing resources, and lowers the cost of large-scale parallel computing. Although the structured mesh has regularity, the optimization through the graph partitioning algorithm can effectively handle the irregularities present in the structured mesh, making it more suitable for describing complex geological structures in reservoir numerical simulations.
[0065] Specifically, considering the regular distribution and geometric characteristics of the structured mesh, this method first performs a pre-partitioning based on the distribution of the structured mesh along the x, y, and z axes in three-dimensional space. The purpose of pre-partitioning is to utilize this characteristic of the structured mesh to simplify the computational complexity of the partitioning process and provide a good initial state for subsequent load allocation.
[0066] Based on the distribution characteristics of the structured mesh in three-dimensional space, it is divided along the x, y, and z axes according to a certain ratio (e.g., 1:1:1 or 2:3:1, the specific ratio is determined according to the mesh density in each direction and the calculation requirements, or it can be set manually) to obtain a preliminary region division, i.e. the first division result.
[0067] The initial grid partitioning may not fully meet load balancing requirements, especially when the grid distribution is uneven. Therefore, a graph partitioning algorithm, such as Metis or Scotch, is used to readjust the initially partitioned grid, ensuring that the computational load on each load is roughly equivalent, resulting in an optimized second partitioning. This update process is crucial, as it makes the final load distribution more reasonable and improves the efficiency of parallel computing.
[0068] The structured grid data is distributed to different computing devices (loads) based on the partitioning results. This distribution ensures that the computing workload of each device is moderate, neither overburdening nor wasting resources, thereby achieving an efficient and balanced parallel computing environment throughout the computing cluster.
[0069] In reservoir numerical simulation, the pre-partitioning of the structured mesh, based on its dimensional distribution, quickly provides an initial plan for load allocation. Subsequently, optimization using a graph partitioning algorithm addresses potential imbalances in the initial plan, resulting in a more rational allocation of computational resources and improved parallel computing efficiency. In parallel computing environments, load balancing is crucial for computational efficiency. Improper load allocation can lead to some computing devices remaining idle for extended periods, while others face overload. Pre-partitioning and load optimization ensure an even distribution of computational tasks across devices, reducing resource idleness and thus lowering overall computational costs. Even within a structured mesh, the geological structure of an oil reservoir may exhibit local irregularities. Graph partitioning algorithms can identify and appropriately adjust these irregular regions, making the mesh more closely resemble the actual reservoir structure. This enhances adaptability to complex geological environments while maintaining the advantages of the structured mesh, thereby improving the accuracy of simulation results.
[0070] In some embodiments, the structural mesh is divided into multiple mesh sets according to the directional distribution of the structural mesh to obtain a first division result. Specifically, this can be achieved through the following steps: obtaining the number of loads of all the above-mentioned loads; dividing the structural mesh in each direction into multiple mesh sets to obtain the first division result, wherein the number of mesh sets in all directions is equal to the number of loads, and each mesh set includes at least one structural mesh.
[0071] This scheme enables faster initial load distribution, laying the foundation for more complex load balancing optimizations. It also reduces computational costs during load distribution, significantly improves the efficiency of parallel computing, and further achieves load balancing.
[0072] Specifically, the first step is to determine the total number of devices involved in the computation, i.e., the total number of loads. For example, assume there are a total of 8 computing nodes.
[0073] Considering the distribution characteristics of the structured mesh in the x, y, and z directions, the structured mesh in each direction can be divided into mesh sets corresponding to the aforementioned load quantity by equal division, thus simplifying the load distribution for parallel computing. For example, for a three-dimensional structured mesh, if the load quantity is 8, the mesh can be divided into 2 parts in each direction. After equal division in the x, y, and z directions, 8 mesh sets (2 × 2 × 2 = 8) can be obtained. Each set contains a certain number of structured mesh elements, satisfying the basic requirements of load balancing.
[0074] The regularity of structured meshes allows for rapid initial distribution of the mesh across various computing devices through simple equal division. This approach not only reduces the complexity of computing resource allocation but also ensures that each computing device has at least one structured mesh cell, thereby avoiding resource idleness.
[0075] By directly utilizing the inherent characteristics of structured grids for pre-partitioning, the initial computation of complex graph partitioning algorithms is avoided, and preliminary load distribution can be completed in a shorter time, reducing the computational overhead when processing large-scale grid data.
[0076] Based on the compatibility of polyhedral mesh data and the pre-partitioning strategy of structural mesh information, the subsequent graph segmentation algorithm can optimize the pre-partitioning results more efficiently, ensuring that each computing node can quickly enter the efficient computing state in large-scale parallel computing, thus realizing the rapid response and high computing performance of reservoir numerical simulation.
[0077] Suppose a specific reservoir simulation scenario where the structured mesh to be processed is distributed as 1000×1000×1000 in three directions. Given 32 computing resources (computing nodes), for initial load allocation, the structured mesh in each direction can be divided into four mesh sets: 250×250×250 in the x, y, and z directions respectively. This ensures that each load will ultimately have 250×250×250 = 15,625,000 mesh elements. This allocation strategy simplifies the initial load allocation and provides a good starting point for subsequent graph partitioning algorithm optimization.
[0078] In the specific implementation process, the first partitioning result is updated according to graph segmentation technology to obtain the second partitioning result. This can be achieved through the following steps: obtaining relevant information about each structural mesh in the first partitioning result, wherein the relevant information includes at least the size and / or complexity of the structural mesh, the size of the structural mesh is positively correlated with the computation time, and the complexity of the structural mesh is positively correlated with the computation time; updating the first partitioning result based on the relevant information according to graph segmentation technology to obtain the second partitioning result, wherein the size of the structural mesh is negatively correlated with the number of partitions, and the complexity of the structural mesh is negatively correlated with the number of partitions.
[0079] This scheme utilizes the size and complexity information of the structured mesh for dynamic optimization, which better balances the computational load among different computing devices, ensuring that the computation time for each device is approximately equal. The optimized mesh partitioning strategy ensures the rational allocation of computing resources, avoiding resource idleness and overuse.
[0080] Specifically, the size and complexity data of each structured mesh cell are collected, as these data directly affect computation time. The size of the structured mesh determines the basic unit of computation, while the complexity reflects any irregularities and additional computational requirements that may exist within the mesh.
[0081] This algorithm employs a similar graph partitioning technique, but focuses on optimizing the initial partitioning result using grid size and complexity information. The algorithm dynamically adjusts its partitioning strategy based on the relevant information of each grid cell, ensuring that the grid cells with the longest computation time are not concentrated on a single computing device, but are evenly distributed to achieve a balance in computation time. For example, for larger or more complex grid cells, the algorithm may add more partitions to distribute the computational load across more devices; conversely, smaller or simpler grid cells may be partitioned less to maintain higher computational locality.
[0082] Larger meshes or more complex regions have high computational demands. Without effective partitioning and load balancing, individual nodes may become bottlenecks, slowing down the overall computation speed. Conversely, smaller meshes and simpler regions have lower computational demands, and excessive partitioning can increase unnecessary communication and management overhead. Dynamic optimization strategies can be used to tailor partitioning strategies to the characteristics of different mesh structures, achieving optimal load balancing and thus improving parallel computing efficiency.
[0083] By dynamically assessing the size and complexity of the grid, excessive computing power can be avoided by allocating too much computing power to small grids with low computing demands, while ensuring that large grids or complex regions with high loads do not lack sufficient computing resources. This refined resource management approach reduces resource waste and improves resource utilization.
[0084] In a numerical simulation example of an oil reservoir, we assume we are dealing with a structured mesh containing 10,000 × 10,000 × 10,000 grid cells, which vary in complexity and size. Initial pre-partitioning divides the mesh into 100 × 100 × 100 grids, resulting in 1,000,000 preliminary mesh sets, each containing 1,000,000 grid cells. However, this initial partitioning may not adequately account for the uneven distribution of mesh complexity and size, leading to an unbalanced computational load. Therefore, using the method described above, we can perform a secondary partitioning by obtaining the size and complexity information of each grid cell. For example, large grid cells exceeding 150% of the average size can be further subdivided into four sub-grids, while small grid cells less than 75% of the average size can remain unchanged or be subdivided into only two sub-grids, thus balancing computational time and resource consumption across different loads. Through this dynamic adjustment, a total of 1,500,000 grid sets may be obtained, each containing approximately 6,666 grid cells, achieving a more balanced load distribution and improving the efficiency of parallel computing and the performance of reservoir numerical simulation.
[0085] In some embodiments, when the type of the above-mentioned mesh is the above-mentioned unstructured mesh, the load is allocated according to the type of the above-mentioned mesh in the above-mentioned mesh file. Specifically, this can be achieved through the following steps: dividing the above-mentioned unstructured mesh according to graph segmentation technology to obtain a third segmentation result; and allocating the above-mentioned unstructured mesh to multiple above-mentioned loads according to the above-mentioned third segmentation result.
[0086] In this scheme, unstructured meshes can more accurately describe the complex geological structures in reservoirs, such as faults, fractures, and pore networks. Using graph partitioning ensures that this complexity is properly managed, with each computational node processing an optimized subset of the unstructured mesh, which is beneficial for accurately simulating reservoir behavior. By dividing the unstructured mesh into multiple computationally independent subsets, each subset communicates only with a few neighboring subsets, unnecessary data exchange during parallel computation is significantly reduced. Graph partitioning not only considers the geometry of the unstructured mesh but also fully considers computational requirements and equipment performance, ensuring that the computational load of each subset matches the capabilities of its corresponding computational nodes, avoiding waste of computational resources.
[0087] Specifically, when dealing with unstructured meshes, due to their irregular geometric distribution and complex topological relationships, efficient and mature graph partitioning techniques are directly employed to analyze the connectivity and computational requirements of the unstructured mesh. For example, the Metis or Scotch graph partitioning algorithm libraries can be used for analysis. The algorithm comprehensively considers the size, shape, and connectivity of the mesh cells, dividing the unstructured mesh into multiple subsets to form a third partitioning result. This partitioning process aims to achieve load balancing, ensuring that the computational complexity of each subset matches the computing power (load) allocated to it.
[0088] After the third partitioning is completed, the unstructured mesh data and processing tasks are distributed to various computing devices based on the computational load and device performance of each subset. For example, if the graph partitioning technique divides the unstructured mesh into 32 subsets, and there are exactly 32 available computing nodes in the system, then each node will be responsible for processing one subset, achieving a balanced distribution of computational tasks. This allocation method effectively reduces communication latency between different computing nodes, while also improving overall computational efficiency and parallel performance.
[0089] Unstructured grids can freely adapt to the irregularities of geological structures. By using graph segmentation technology to automatically identify and balance the computational complexity of these grids, reservoir numerical simulations can better reflect the actual situation, improving the reliability and accuracy of the simulations.
[0090] The third partitioning result of the unstructured mesh was optimized by graph partitioning technique. This partitioning method ensures that the boundaries of each subset are as smooth as possible, reduces communication paths across subsets, thereby reducing communication overhead and improving the efficiency of parallel computing.
[0091] By dynamically adjusting the size and complexity of each subset using graph partitioning techniques, subsets with high computational demands are allocated to more powerful computing nodes, while those with low computational demands are allocated to less powerful nodes. This refined management approach optimizes the allocation of computing resources to the greatest extent, achieves load balancing, and improves the overall performance of parallel computing.
[0092] In reservoir numerical simulation, it is assumed that an unstructured mesh with irregular shapes and complex topological relationships is being processed, consisting of approximately 1.2 million randomly distributed polygonal elements. In the specific embodiment described above, the Metis graph partitioning algorithm is used to partition the unstructured mesh. Assuming there are 32 computing nodes, the Metis algorithm can divide the unstructured mesh into 32 computationally independent subsets, each containing approximately 37,500 elements (in reality, the number of elements in each subset may vary slightly due to the irregularity of the mesh). Algorithm optimization ensures that the computational complexity of each subset matches the performance of the corresponding computing nodes, achieving load balancing. For example, subsets containing more complex elements are further subdivided and assigned to higher-performance computing nodes; while subsets with fewer elements and simpler shapes are assigned to lower-performance nodes, ensuring the efficiency and stability of the entire parallel computing environment.
[0093] Specifically, for structured meshes, the load can be distributed equally by the number of meshes or by the computation time of the meshes. The specific process will not be elaborated here.
[0094] For unstructured meshes, the load can be evenly distributed by the number of meshes alone, or by combining the number of meshes and image segmentation computation (i.e., the computation time of the meshes) to distribute the load evenly. The distribution process is similar to that of structured meshes and will not be elaborated here.
[0095] In the specific implementation process, after allocating the load according to the type of the mesh in the mesh file, the method further includes the following steps: obtaining mesh elements, wherein the mesh elements include points, edges, faces, and volumes, at least two points form the edges, at least two edges form the faces, and at least two faces form the volumes; determining mesh topology information based on adjacent mesh elements, wherein the mesh topology information is the information on the adjacency relationship between the mesh elements; generating geometric information based on the mesh topology information and displaying the geometric information on the display interface, wherein the geometric information is the information on the shape, size, and position of the mesh elements.
[0096] This approach, by calculating the topological relationships and geometric information of grid elements in detail, can more accurately represent the complex geometry of the reservoir, which is crucial for simulating reservoir dynamics. Clear grid topological information and accurate geometric information help reduce potential errors during parallel computing, ensuring the correct execution of the numerical discretization algorithm. Visualizing the grid's geometric information in the display interface not only helps reservoir engineers intuitively understand the reservoir structure but also enhances the interpretability of simulation results.
[0097] Specifically, this embodiment involves obtaining the basic elements that constitute a mesh, namely points, edges, faces, and volumes. These elements are the foundation for complex geometries. In a polyhedral mesh, at least two points form an edge, at least two edges form a face, and at least two faces form a volume. This structure allows for precise description of the details of various geological structures within an oil reservoir.
[0098] Mesh topology information is constructed based on the adjacency relationships between mesh elements. For unstructured meshes, such as corner meshes, the connections between each volume, face, edge, and point need to be clearly defined to generate a complete mesh topology. For example, a volume may be adjacent to multiple faces, a face may be connected to multiple edges, and an edge connects to at least two points. These complex adjacency relationships constitute the mesh topology information, which is the foundation for subsequent calculations and visualizations.
[0099] Based on the obtained topological information, the shape, size, and location of each mesh element are calculated, including but not limited to the volume of the mesh cell, the normal vector of the face, and the length of the edge. This geometric information is crucial for understanding and analyzing reservoir dynamics. Finally, the calculated geometric information is visualized in a display interface, allowing reservoir engineers to intuitively observe the details of the reservoir geometry, thereby enabling more accurate reservoir dynamic prediction and decision-making.
[0100] The topological relationships and geometric information of the grid directly affect the accuracy of the reservoir mathematical model, and an accurate mathematical model is the cornerstone for predicting reservoir dynamics and making reasonable decisions. Through the above steps, more refined grid information is obtained, thereby improving the accuracy of reservoir numerical simulation.
[0101] The accuracy of mesh topology information directly affects the setting of boundary conditions for numerical computation, while geometric information determines the accuracy of the discretization process. By accurately acquiring and calculating this information, uncertainties in parallel computing can be effectively reduced, and the reliability of simulation results can be improved.
[0102] By visualizing the geometric information of the mesh, engineers can clearly see the actual size and relative position of each part of the reservoir, which is crucial for understanding and analyzing simulation results. Furthermore, visualization allows for easy checking of the quality of mesh generation, ensuring the accuracy of data during the simulation process and improving the scientific rigor and effectiveness of reservoir engineering decisions.
[0103] In this reservoir numerical simulation example, we assume we are dealing with an irregular corner grid consisting of approximately 200,000 volume elements and millions of edges and points. After load distribution, we proceed to the grid topology calculation and geometry generation stage. First, using a grid analysis algorithm, we clarify the topological relationships between each volume element and its adjacent faces, edges, and points. For example, a volume element may be adjacent to 6 faces, 12 edges, and 8 points. Subsequently, the geometric information of each mesh element is calculated, such as the volume of the volume element (assuming an average volume of 0.1 cubic meters), the normal vector of the face (e.g., the normal vector of a face is (0.6, 0.8, 0.0), the length of the edge (average length is approximately 0.5 meters), and the coordinate position of the point. This data is then used to generate a visualization interface that displays the geometry of the reservoir. For example, in the display interface, different colors represent the type of each volume element, arrows represent the direction of the face normal vector, and the size of line segments and points reflects the length of the edge and the coordinate position of the point. This highly accurate visualization information not only enhances the user's understanding of the reservoir structure but also improves the interpretability of the parallel computing results, playing an important role in decision support for reservoir engineering.
[0104] In some embodiments, after allocating the load according to the type of the grid in the grid file, the method further includes the following steps: obtaining a preset template range, wherein the preset template range is a set of preset defined grids; generating network template information according to the preset template range, wherein the network template information is used to describe the extended region of the grid considered when each grid is executed in a specific numerical discretization algorithm; and integrating the network template information into reservoir numerical simulation software so that reservoir numerical simulation can be performed in the reservoir numerical simulation software.
[0105] In this scheme, the generation and integration of network template information can effectively guide reservoir numerical simulation software in data exchange within a parallel computing environment. By presetting the template range and network template information, the numerical discretization algorithm can accurately call and calculate the required grid data, avoiding problems such as missing data or redundant calculations.
[0106] Specifically, before performing numerical simulation of a reservoir, a template range is preset based on the required numerical discretization algorithm. This template range defines the adjacent grid regions that each grid cell needs to consider during the calculation. For example, assuming the finite volume method (FVM) is used as the numerical discretization algorithm, the preset template range may include the 12 neighboring grids around each grid cell, because the finite volume method usually needs to consider the direct neighbors of the grid cell to calculate fluid flow.
[0107] Based on a preset template range, network template information is calculated and generated. This includes which grid cells each grid cell is adjacent to within its template range, and the distribution of these adjacent grid cells across different processes. For example, if a grid cell needs to communicate with four other grid cells from different processes within its template range, the method records the identification information of these grid cells and their respective process IDs, ensuring correct inter-process communication during parallel computing.
[0108] After the grid template information is constructed, it is integrated into the framework of the reservoir numerical simulation software. This enables the software to perform efficient data exchange and calculation based on the grid template information when executing specific numerical discretization algorithms, avoiding unnecessary communication delays and data redundancy, and improving the real-time performance and accuracy of reservoir simulation.
[0109] The preset template range defines the adjacent grid regions that each grid cell needs to consider when executing the numerical discretization algorithm, while the network template information specifically indicates the distribution of these adjacent grids in each computation process. This allows the software to directly locate the process that needs to communicate, reducing unnecessary addressing and waiting time, thereby achieving efficient parallel communication.
[0110] Numerical discretization algorithms rely on information about grid cells and their neighbors to discretize physical fields. The network template information accurately describes the relationships and locations of these neighbors, ensuring that the execution of the algorithm on each computing node is based on a complete and correct dataset, thereby improving the efficiency and accuracy of numerical computation.
[0111] The introduction of network template information enables reservoir numerical simulation software to easily handle different types of grid data and parallel computing architectures. Whether using structured, unstructured, or corner grids, the template information accurately describes the computational requirements of each grid cell. Furthermore, it adapts to parallel computing environments of varying scales, from a small number of computing nodes to large-scale cluster computing, enabling effective load distribution and data communication, significantly enhancing the flexibility and scalability of reservoir numerical simulation.
[0112] In reservoir numerical simulation scenarios, assuming the Finite Element Method (FEM) is used as the numerical discretization algorithm, the preset template range includes at least 20 neighboring grids around each grid cell. This is because the FEM needs to consider more information from neighboring grids to accurately describe the changes in the reservoir's physical field when constructing a continuum model. In a specific embodiment, the generated network template information covers detailed information about each grid cell and its neighboring grids within the template range. For example, if a specific grid cell needs to communicate with 5 grid cells from other processes within the template range, then not only are the identification information of these 5 grid cells recorded, but they are also marked as belonging to computation nodes with process IDs 1, 2, 3, 4, and 5, respectively. In this way, the reservoir numerical simulation software can quickly locate these neighboring grids during runtime, reducing communication latency and improving parallel computing efficiency. Simultaneously, by constructing a mapping relationship between neighboring grids across different processes, the software can effectively manage cross-process data exchange, ensuring the smooth execution of the numerical discretization algorithm, thereby improving the accuracy and real-time performance of the reservoir simulation.
[0113] The optimization process of the graph segmentation algorithm is as follows:
[0114] Mesh modeling as a graph: First, the mesh model is transformed into a graph model. In a graph model, each mesh cell is considered a node, and the connections between nodes (especially cross-partition connections) are considered edges. In this way, the entire mesh is abstracted into a collection of nodes and edges, forming a graph network.
[0115] Calculate node weights: For each node (i.e., grid cell), calculate its computational load (or weight). This computational load is based on the grid cell size, complexity, reservoir properties, etc., because different grid cells may require different computational resources in numerical simulations. For example, grid cells near reservoir faults may be more complex than cells in other regions and require more computation time.
[0116] Defining the Objective Function: The goal of graph partitioning algorithms is to achieve load balancing while minimizing data communication between partitions. Therefore, the algorithm defines an objective function that considers both load balancing and communication costs. A common objective function is to minimize the number of edge cuts (i.e., minimize cross-partition connections) while ensuring that the node weights (i.e., computational load) in each partition are as close as possible.
[0117] Applications of Graph Partitioning Algorithms: Graph partitioning algorithms, such as the Kernighan-Lin algorithm, the Fiduccia-Mattheyses algorithm, or more advanced multi-level graph partitioning algorithms (such as Metis and Scotch), are used to partition graphs. These algorithms iteratively optimize and adjust the allocation of nodes (grid cells) to minimize the objective function. During the iteration process, the algorithm attempts to swap the affiliation of nodes between different partitions, evaluates the impact of the swaps on the objective function, and selects swaps that improve load balancing or reduce communication overhead.
[0118] Boundary Adjustment: As the graph partitioning algorithm progresses, the boundaries of the grid partitions are adjusted accordingly to reflect the optimal partitioning scheme. The goal of boundary adjustment is to ensure that adjacent grid cells remain within the same partition as much as possible to reduce inter-process communication requirements, while ensuring that the computational load of each partition is balanced.
[0119] Evaluation and Termination Conditions: The algorithm continuously evaluates the segmentation results until a preset termination condition is met. This might be that the improvement of the objective function reaches a threshold, or that convergence occurs after a certain number of iterations. Once the termination condition is met, the algorithm outputs the final grid partitioning scheme.
[0120] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the load allocation method for reservoir numerical simulation of this application will be described in detail below with reference to specific embodiments.
[0121] This embodiment relates to a specific load allocation method for reservoir numerical simulation, such as... Figure 3 As shown, it includes the following functional blocks:
[0122] 1) MeshFileReader: This reader reads mesh files and can correctly read various mesh formats used in reservoir simulation, including structured meshes, unstructured meshes, and corner meshes. It is responsible for reading data from mesh files of various formats and can correctly parse common mesh formats used in reservoir simulation, such as structured meshes, unstructured meshes, and corner meshes. This is the first step in processing mesh data in reservoir numerical simulation software, ensuring the accuracy and integrity of data in subsequent processing.
[0123] 2) MeshPartioner: This function performs mesh partitioning by process. It determines whether to pre-partition based on whether the mesh contains structured information and supports calling graph partitioning algorithms (i.e., graph theory algorithms) to complete the mesh partitioning by process during pre-partitioning. In other words, it performs mesh data partitioning, determining the pre-allocation scheme based on the mesh type (structured, unstructured, or corner mesh) and the distribution of computing devices. For meshes with structured information (such as structured and corner meshes), it first performs pre-partitioning and then optimizes to achieve load balancing. For unstructured meshes, it directly uses graph partitioning algorithms for partitioning.
[0124] 3) PolyMeshTopology: This involves establishing a distributed polyhedral mesh topology based on mesh file information and mesh partitioning results. Specifically, it constructs the mesh's topological structure information, including the adjacency relationships between volumes, faces, edges, and points, based on the mesh data and partitioning results. For structured meshes, the topological information is implicit and does not require additional computation; however, for unstructured meshes and corner meshes, the adjacency relationships between mesh entities need to be calculated for subsequent numerical calculations.
[0125] 4) Mesh Geometry: The geometric information of the mesh, including volume, surface normals, and element weights on both sides of a surface. Mesh geometry is the fundamental mesh information required for reservoir simulation and is an essential module; it does not require detailed description. It is responsible for calculating and storing the geometric properties of the mesh, such as the volume of mesh elements, surface normals, and connectivity weights between mesh elements. This information is crucial for building the physical model and performing numerical calculations.
[0126] 5) PolyMeshStencil: This is the mesh template information, representing the adjacent mesh regions needed by the exponential value discretization algorithm. Different versions exist depending on the numerical discretization method used. The mesh template information is determined based on the numerical method used in the reservoir simulation and is an essential basic function of reservoir meshing. Specifically, it generates mesh template information according to the needs of the numerical discretization algorithm, including determining the mesh region within the template range—the set of mesh elements that the algorithm needs to consider during execution. The template can be based on different numerical methods such as the finite volume method, the finite element method, or the finite difference method.
[0127] 6) PolyMeshManager: Addressing the needs of reservoir numerical simulation, this module provides functions such as topological information, geometric information, adjacency templates, matrix and vector creation. It manages the information generated by previous modules and directly applies it to reservoir numerical simulation calculations. Specifically, it provides a unified interface and management mechanism for manipulating mesh topology, geometry, and templates, supporting matrix and vector creation, and handling inter-process data exchange in parallel computing. It integrates the functions of all the above modules, providing an efficient and unified mesh data structure and management solution for reservoir numerical simulation.
[0128] 7) Graph Partitioner: A key component for optimizing grid data load distribution in parallel computing. It works by treating the grid in reservoir simulation as nodes of a graph, and the adjacency relationships between grids as edges. A graph partitioning algorithm is then applied to divide the graph, achieving a balanced distribution of parallel computing tasks across different computing nodes. The goal of graph partitioning is typically to minimize communication between different parts (or computing nodes) while maintaining a balanced computational load, as communication overhead is often a significant factor affecting overall efficiency in parallel computing. Specifically, the graph partitioner identifies computationally intensive regions in the grid data and attempts to distribute these regions evenly across computing nodes, while reducing data interactions across node boundaries, thereby improving the efficiency and speed of parallel computing. This method is particularly suitable for unstructured grids, as their geometry and topology are often irregular, making it difficult to achieve load balancing through simple geometric or mathematical partitioning.
[0129] StructureReader: Specifically designed for reading and parsing structured mesh files. A structured mesh is a regularly arranged mesh, typically defined in Cartesian coordinates, with its nodes and elements distributed according to certain rules.
[0130] CornerPointReader: Responsible for reading and parsing corner grid files. Corner grids are a special type of 3D grid that combines the characteristics of structured and unstructured grids, enabling more flexible description of complex geological structures while retaining a certain degree of regularity.
[0131] UntructureReader: Used to read and parse unstructured mesh files. Unstructured meshes have irregular node and cell distributions, allowing them to adapt to more complex geometries, making them suitable for simulating reservoirs with complex structures.
[0132] MetisPartioner: Based on the Metis graph partitioning algorithm, it partitions a graph to achieve load balancing. Metis is an efficient graph partitioning and filling algorithm widely used in parallel computing to optimize the allocation of computing resources.
[0133] ScotchPartioner: This tool uses the Scotch graph partitioning utility to partition a grid, optimizing parallel computing load. Scotch is a parallel computing tool for graph and high-dimensional grid partitioning and sparse matrices, and it is particularly well-suited for optimizing grid partitioning in parallel computing environments.
[0134] Partioner: A more general-purpose grid partitioning component that can call different grid partitioning algorithms (such as MetisPartioner, ScotchPartioner, or other partitioners) to partition grid data based on specific inputs and requirements.
[0135] FVMCellcenterStencil (Finite Volume Method Element Center Template): Generates template information for the influence mesh region around the element center point in Finite Volume Method (FVM) calculations. The Finite Volume Method is a common discretization method used for numerical simulations of continuous media (such as fluids), and the element center template is used to define the coupling and interactions of local meshes in the calculation.
[0136] FEMstencil: Generates template information for calculations using the Finite Element Method (FEM), defining the connections and interactions between mesh elements in numerical computation. The Finite Element Method is another numerical method widely used in engineering problems (including reservoir simulation). By constructing templates between elements, local calculations and solutions can be performed efficiently.
[0137] FDMStencil (Finite Difference Method Template): Provides template information for calculations using the Finite Difference Method (FDM), defining how to apply difference equations for numerical computation at grid points. The Finite Difference Method is a fundamental method in numerical analysis used to approximate the solution of differential equations.
[0138] DynamicStencil provides the ability to dynamically adjust the template range, allowing the computational template to be adjusted in real time according to dynamic changes during the simulation process, thereby optimizing computational efficiency and accuracy. For example, in reservoir numerical simulation, as the distribution of reservoir fluids changes, the grid region that needs to be considered in the calculation may also need to be dynamically adjusted.
[0139] Includes the following steps:
[0140] Step S1: Read the mesh file to obtain global mesh point coordinate data. For corner meshes and unstructured meshes, the adjacency relationships between mesh cells and mesh points will also be obtained, i.e., which points constitute a cell. This information for structured meshes does not need to be explicitly given. A structured mesh cell with index (i,j,k) is composed of eight points: (i,j,k), (i+1,j,k), (i,j+1,k), (i+1,j+1,k), (i,j,k+1), (i+1,j,k+1), (i,j+1,k+1), (i+1,j+1,k+1). This step is used to obtain the coordinates of mesh points and the adjacency relationships between cells and points. This information can be obtained by directly reading the mesh file. The mesh point coordinates are used for subsequent geometric information generation, and the adjacency relationships between cells and points are used for subsequent topology generation and process partitioning.
[0141] Step S2: Partition the mesh by process. Let the number of processes be N. For meshes with structural information, including structured meshes and corner meshes, divide the mesh into segments Px, Py, and Pz in three directions according to their mesh distribution Nx, Ny, and Nz, satisfying Px*Py*Pz=N while Px:Py:Pz is close to Nx:Ny:Nz. For corner meshes, after initial partitioning, a graph partitioning algorithm is used for further load balancing optimization. For unstructured meshes, the graph partitioning algorithm is used directly for partitioning. After partitioning, mesh information is assigned to the corresponding processes. Subsequent steps focus on local information within each process. Reservoir numerical simulation generally uses static load balancing; therefore, process partitioning of the mesh directly affects the load balancing effect. This step involves partitioning the mesh based on the mesh information obtained in the first step. After obtaining the partitioning scheme through the marked steps, only the mesh information of the corresponding process is retained in the relevant process. This step is used to achieve efficient load balancing for different types of meshes in this technical solution.
[0142] Step S3: Mesh topology calculation. The topology of the structured mesh is implicit in the structure information. That is, the left cell of the (i,j,k)th structured mesh cell is (i-1,j,k), and the right cell is (i+1,j,k). Adjacent cells are adjacent meshes and do not need to be calculated. Corner meshes and unstructured meshes also need to be calculated as follows: Figure 4The adjacency relationships between four types of mesh entities include regions, faces, edges, and vertices. Adjacency relationships are constructed through bidirectional adjacency relationships between the regions, faces, edges, and the points that make them up. This scheme supports the selective generation of entities and adjacency relationships according to the needs of different numerical algorithms. Regions and points are information generally contained in the mesh file. Faces and edges are constructed on this basis. Specifically, they are obtained by finding the intersection of adjacent units. If the intersection has three or more points, it is a face; if it has two points, it is an edge. The construction of adjacency relationships is the basis for subsequent mesh template information and geometric information. Adjacency relationships are also called mesh representation. An efficient mesh representation is a key part of supporting efficient numerical computation. The mesh representation constructed in this scheme is efficient and flexible. It can choose which entities to save according to the developer's needs and supports obtaining arbitrary adjacency relationships in O(1) time complexity.
[0143] Step S4: Generate grid template information. Template information is constructed based on the template type required by the numerical discretization method. This includes establishing extended regions of the sub-region grid based on the template, i.e., grids belonging to other processes within the template range, and constructing mappings of these extended regions between different processes to facilitate inter-process communication during reservoir simulation. The template information is determined based on hotspot calculation regions in reservoir numerical simulation. For example, if a numerical discretization method requires data from several adjacent locations on the grid, the scope of hotspot calculation can be determined based on adjacency information in the topology, and the structure is the template information. The extended regions are constructed by expanding outwards through common points between different processes of the grid. The mapping of the extended regions can be constructed by obtaining the corresponding index of the extended region in the remote process through inter-process communication. After mapping, efficient communication of numerical calculation data between different processes can be achieved, improving parallel efficiency.
[0144] Step S5: Generate geometric information, calculate the volume of the mesh element, surface normal, weights of elements on both sides of the surface, etc.
[0145] Each mesh cell (whether structured, unstructured, or corner mesh) has a certain volume. In numerical simulations, this volume is the basis for calculating fluid transport, pressure distribution, and changes in other physical quantities. Accurate calculation of the volume is crucial to ensuring the reliability of the simulation results.
[0146] The surface normal refers to the direction perpendicular to each mesh surface, and it is crucial for determining the direction in which fluid or material passes through the mesh surface. In numerical simulations, the surface normal is used to calculate the flow rate of fluid or material through each mesh surface, as well as the interactions between mesh surfaces involved in the physical process.
[0147] When calculating the flow of fluid or matter through a mesh surface, it may be necessary to consider the relative influence of the elements on the fluid behavior on both sides. This influence can be represented by weights, the magnitude of which reflects the physical properties of the elements on both sides (such as permeability, flow resistance, etc.).
[0148] It should be noted that any calculation method can be used, but this solution only involves load distribution and does not limit the calculation method.
[0149] This approach has a wide range of applications, providing a unified processing method for the diverse grid types involved in reservoir simulation. For unstructured grids, such as diagonal grids, which possess some structural grid characteristics, the structural information is utilized to optimize load balancing and locality, thereby improving the efficiency of reservoir numerical simulation.
[0150] This application also provides a load distribution device for reservoir numerical simulation. It should be noted that the load distribution device for reservoir numerical simulation provided in this application can be used to execute the load distribution method for reservoir numerical simulation provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0151] The following describes the load distribution device for reservoir numerical simulation provided in the embodiments of this application.
[0152] Figure 5 This is a structural block diagram of a load distribution device for reservoir numerical simulation according to an embodiment of this application. Figure 5 As shown, the device includes:
[0153] The first acquisition unit 10 is used to acquire a grid file, wherein the grid file is a file representing the geological spatial structure of a target area, the target area is one or more of a coal mine, oil field, geothermal field, and gas field, and the grid file includes multiple grids;
[0154] The allocation unit 20 is used to allocate the load according to the type of the grid in the grid file, wherein the type of the grid includes a structured grid or an unstructured grid, the load is a device for reservoir numerical simulation, and the allocation method includes equal allocation according to the number of grids and / or equal allocation according to the calculation time of the grids, wherein the calculation time is the time for the load to calculate the oil and water distribution in the target area when used for reservoir numerical simulation.
[0155] Control unit 30 is used to control all the above-mentioned loads and perform reservoir numerical simulation based on the assigned grid file.
[0156] Through this embodiment, the structured grid data structure has the advantages of high memory access efficiency and high parallel computing efficiency, while the unstructured grid data structure can handle complex geometry and has good adaptability to geological structures. This solution can distribute the load to different types of grids and build a unified management framework for different grid types to ensure that the load can bear similar workloads, thereby achieving load balancing.
[0157] In the specific implementation process, the allocation unit includes a first partitioning module, an update module, and a first allocation module. The first partitioning module is used to perform a first partitioning of the structural mesh according to the directional distribution of the structural mesh when the mesh type is the structural mesh, to obtain a first partitioning result. The update module is used to update the first partitioning result according to the graph partitioning technique to obtain a second partitioning result. The first allocation module is used to allocate the structural mesh to multiple loads according to the second partitioning result.
[0158] In this scheme, the pre-partitioning and optimization process of the structured mesh fully utilizes the inherent regularity of the structured mesh. This not only simplifies the initial mesh partitioning but also further optimizes the load distribution using a graph partitioning algorithm, ensuring that the amount of mesh data processed by each computing device matches the computation time and reducing unnecessary communication overhead. Precise load distribution avoids idle computing devices, reduces waste caused by underutilized computing resources, and lowers the cost of large-scale parallel computing. Although the structured mesh has regularity, the optimization through the graph partitioning algorithm can effectively handle the irregularities present in the structured mesh, making it more suitable for describing complex geological structures in reservoir numerical simulations.
[0159] In some embodiments, the first partitioning module includes a first acquisition submodule and a partitioning submodule. The first acquisition submodule is used to acquire the load quantity of all the above-mentioned loads. The partitioning submodule is used to divide the above-mentioned structural mesh in each direction into multiple mesh sets to obtain the above-mentioned first partitioning result, wherein the number of the above-mentioned mesh sets in all directions is equal to the above-mentioned load quantity, and each of the above-mentioned mesh sets includes at least one of the above-mentioned structural meshes.
[0160] This scheme enables faster initial load distribution, laying the foundation for more complex load balancing optimizations. It also reduces computational costs during load distribution, significantly improves the efficiency of parallel computing, and further achieves load balancing.
[0161] In the specific implementation process, the update module includes a second acquisition submodule and an update module. The second acquisition submodule is used to acquire relevant information of each of the structural meshes in the first partitioning result, wherein the relevant information includes at least the size and / or complexity of the structural mesh, the size of the structural mesh is positively correlated with the computation time, and the complexity of the structural mesh is positively correlated with the computation time. The update module is used to update the first partitioning result based on the relevant information according to the graph segmentation technique to obtain the second partitioning result, wherein the size of the structural mesh is negatively correlated with the number of partitions, and the complexity of the structural mesh is negatively correlated with the number of partitions.
[0162] This scheme utilizes the size and complexity information of the structured mesh for dynamic optimization, which better balances the computational load among different computing devices, ensuring that the computation time for each device is approximately equal. The optimized mesh partitioning strategy ensures the rational allocation of computing resources, avoiding resource idleness and overuse.
[0163] In some embodiments, the allocation unit includes a second partitioning module and a second allocation module. The second partitioning module is used to partition the unstructured mesh according to graph segmentation technology when the mesh type is the unstructured mesh, to obtain a third partitioning result. The second allocation module is used to allocate the unstructured mesh to multiple loads according to the third partitioning result.
[0164] In this scheme, unstructured meshes can more accurately describe the complex geological structures in reservoirs, such as faults, fractures, and pore networks. Using graph partitioning ensures that this complexity is properly managed, with each computational node processing an optimized subset of the unstructured mesh, which is beneficial for accurately simulating reservoir behavior. By dividing the unstructured mesh into multiple computationally independent subsets, each subset communicates only with a few neighboring subsets, unnecessary data exchange during parallel computation is significantly reduced. Graph partitioning not only considers the geometry of the unstructured mesh but also fully considers computational requirements and equipment performance, ensuring that the computational load of each subset matches the capabilities of its corresponding computational nodes, avoiding waste of computational resources.
[0165] In specific implementation, the above-mentioned device further includes a second acquisition unit, a determination unit, and a processing unit. The second acquisition unit is used to acquire mesh elements after allocating the load according to the type of the mesh in the mesh file. The mesh elements include points, edges, faces, and volumes. At least two points form an edge, at least two edges form a face, and at least two faces form a volume. The determination unit is used to determine mesh topology information based on adjacent mesh elements. The mesh topology information is the information on the adjacency relationship between the mesh elements. The processing unit is used to generate geometric information based on the mesh topology information and display the geometric information on the display interface. The geometric information is the information on the shape, size, and position of the mesh elements.
[0166] This approach, by calculating the topological relationships and geometric information of grid elements in detail, can more accurately represent the complex geometry of the reservoir, which is crucial for simulating reservoir dynamics. Clear grid topological information and accurate geometric information help reduce potential errors during parallel computing, ensuring the correct execution of the numerical discretization algorithm. Visualizing the grid's geometric information in the display interface not only helps reservoir engineers intuitively understand the reservoir structure but also enhances the interpretability of simulation results.
[0167] In some embodiments, the above-described apparatus further includes a third acquisition unit, a generation unit, and an integration unit. The third acquisition unit is used to acquire a preset template range after allocating the load according to the type of the grid in the grid file, wherein the preset template range is a set of grids defined in a preset manner. The generation unit is used to generate network template information according to the preset template range, wherein the network template information is used to describe the extended region of the grid considered when each of the grids is executed in a specific numerical discretization algorithm. The integration unit is used to integrate the network template information into the reservoir numerical simulation software so that reservoir numerical simulation can be performed in the reservoir numerical simulation software.
[0168] In this scheme, the generation and integration of network template information can effectively guide reservoir numerical simulation software in data exchange within a parallel computing environment. By presetting the template range and network template information, the numerical discretization algorithm can accurately call and calculate the required grid data, avoiding problems such as missing data or redundant calculations.
[0169] The aforementioned load distribution device for reservoir numerical simulation includes a processor and a memory. The first acquisition unit, distribution unit, and control unit are all stored as program units in the memory, and the processor executes these program units to achieve their respective functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.
[0170] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problem of load balancing in existing reservoir numerical simulation grid computing when distributing loads.
[0171] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0172] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the load distribution method for reservoir numerical simulation.
[0173] This invention provides a processor for running a program, wherein the program executes the load allocation method for reservoir numerical simulation.
[0174] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements at least the load distribution method steps for reservoir numerical simulation. The device described herein can be a server, PC, tablet, mobile phone, etc.
[0175] A computer program product includes a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the load distribution method for reservoir numerical simulation described in various embodiments of this application.
[0176] This application provides a load distribution system, including one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any of the above-described load distribution methods for reservoir numerical simulation.
[0177] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0178] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0179] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0180] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0181] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0182] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0183] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0184] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0185] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0186] 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.
Claims
1. A method for load distribution for reservoir numerical simulation, characterized in that, include: Obtain a grid file, wherein the grid file is a file representing the geological spatial structure of a target area, the target area being one or more of a coal mine, oil field, geothermal field, and gas field, and the grid file includes multiple grids; The load is allocated according to the type of the grid in the grid file, wherein the type of the grid includes structured grids and unstructured grids, and the load is a device used for reservoir numerical simulation. The allocation method includes evenly distributing the load according to the number of grids and / or evenly distributing the load according to the computation time of the grids, wherein the computation time is the time that the load takes to calculate the oil and water distribution in the target area when used for reservoir numerical simulation. Control all the loads and perform reservoir numerical simulation based on the assigned grid file; When the type of the mesh is the structured mesh, the load is allocated according to the type of the mesh in the mesh file, including: dividing the structured mesh into a first partition according to the directional distribution of the structured mesh to obtain a first partition result; updating the first partition result according to graph segmentation technology to obtain a second partition result; and allocating the structured mesh to multiple loads according to the second partition result.
2. The method of claim 1, wherein, Based on the directional distribution of the structural mesh, the structural mesh is divided for the first time to obtain the first division result, including: Obtain the load count for all of the aforementioned loads; The structural mesh in each direction is divided into multiple mesh sets to obtain the first division result, wherein the number of mesh sets in all directions is equal to the number of loads, and each mesh set includes at least one structural mesh.
3. The method of claim 1, wherein, Based on graph segmentation techniques, the first segmentation result is updated to obtain a second segmentation result, including: Obtain relevant information for each structural mesh in the first partitioning result, wherein the relevant information includes at least the size and / or complexity of the structural mesh, the size of the structural mesh is positively correlated with the computation time, and the complexity of the structural mesh is positively correlated with the computation time; According to graph segmentation technology, the first segmentation result is updated based on the relevant information to obtain the second segmentation result, wherein the size of the structural mesh and the number of segments are negatively correlated, and the complexity of the structural mesh and the number of segments are negatively correlated.
4. The method of claim 1, wherein, When the mesh type is the unstructured mesh, the load is assigned according to the mesh type in the mesh file, including: The unstructured mesh is divided according to graph segmentation technology to obtain a third segmentation result; Based on the third partitioning result, the unstructured mesh is assigned to multiple loads.
5. The method according to any one of claims 1 to 4, characterized in that, After allocating the load according to the type of the mesh in the mesh file, the method further includes: Obtain mesh elements, wherein the mesh elements include points, edges, faces, and volumes, at least two points form an edge, at least two edges form a face, and at least two faces form a volume; Based on adjacent grid elements, determine grid topology information, wherein the grid topology information is the adjacency relationship information between the grid elements; Geometric information is generated based on the grid topology information and displayed on the display interface. The geometric information includes the shape, size, and position information of the grid elements.
6. The method according to any one of claims 1 to 4, characterized in that, After allocating the load according to the type of the mesh in the mesh file, the method further includes: Obtain a preset template range, wherein the preset template range is a set of preset defined grids; Network template information is generated according to the preset template range, wherein the network template information is used to describe the extended region of the grid considered when each grid is executed in a specific numerical discretization algorithm; The network template information is integrated into the reservoir numerical simulation software so that reservoir numerical simulation can be performed in the reservoir numerical simulation software.
7. A load distribution device for reservoir numerical simulation, characterized in that, include: The first acquisition unit is used to acquire a grid file, wherein the grid file is a file representing the geological spatial structure of a target area, the target area is one or more of a coal mine, oil field, geothermal field, and gas field, and the grid file includes multiple grids; An allocation unit is used to allocate a load according to the type of the grid in the grid file, wherein the type of the grid includes structured grids and unstructured grids, and the load is a device used for reservoir numerical simulation. The allocation method includes evenly allocating the load according to the number of grids and / or evenly allocating the load according to the computation time of the grids, wherein the computation time is the time taken for the load to calculate the oil-water distribution in the target area when used for reservoir numerical simulation. A control unit is used to control all the loads and perform reservoir numerical simulations based on the assigned grid file; The allocation unit includes a first partitioning module, an update module, and a first allocation module. The first partitioning module is used to partition the structural mesh for the first time according to the directional distribution of the structural mesh when the mesh type is the structural mesh, to obtain a first partitioning result. The update module is used to update the first partitioning result according to graph partitioning technology to obtain a second partitioning result. The first allocation module is used to allocate the structural mesh to multiple loads according to the second partitioning result.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the load distribution method for reservoir numerical simulation as described in any one of claims 1 to 6.
9. A load distribution system, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a load distribution method for performing any one of claims 1 to 6 for reservoir numerical simulation.
Citation Information
Patent Citations
Fractured-vuggy reservoir numerical simulation method and system
CN115345080A
Multi-layer region decomposition parallel computing method and device for polyhedral mesh
CN116562066A