Parallel direct solving method for pressure equation in numerical reservoir simulation

The pressure equations in the numerical simulation of the reservoir were processed in parallel by the parallel direct solution method, which solved the problem of excessive time-consuming caused by the increase in the grid scale in the numerical simulation of the reservoir, improved the calculation efficiency and accuracy, and achieved more efficient Reservoir development support.

CN119004740APending Publication Date: 2024-11-22CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310562195.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

As the grid size increases in the reservoir numerical simulation, the simulation takes too long, especially the proportion of solving pressure equations accounts for more than 55%, which leads to low computational efficiency and is difficult to meet the needs of numerical simulation of fine reservoirs.

Method used

The pressure equations in the numerical simulation of the reservoir are solved by parallel direct solution method. Through LU decomposition and parallel processing technology, the pressure linear algebraic equation system is decomposed and solved in parallel, and the pressure solution time is shortened by multiprocessors.

Benefits of technology

It significantly shortens the pressure solution time, improves the calculation efficiency and accuracy, reduces the overall calculation time of reservoir numerical simulation, eliminates performance bottlenecks, and provides more efficient oil recovery rate support for reservoir development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004740A_ABST
    Figure CN119004740A_ABST
Patent Text Reader

Abstract

The invention provides a parallel direct solving method for a pressure equation in numerical reservoir simulation. The parallel direct solving method for the pressure equation in the numerical reservoir simulation comprises the steps that 1, the pressure equation is obtained according to a mathematical reservoir model, relevant data are collected, and the data are preprocessed; 2, carrying out source quantity distribution according to the well model; step 3, carrying out pressure pretreatment; 4, solving a pressure equation; step 5, calculating component concentration and phase saturation of reservoir numerical simulation; and 6, analyzing the remaining oil and the comprehensive water content, and determining a mine field implementation scheme. According to the parallel direct solving method for the pressure equation in numerical reservoir simulation, the pressure solving time can be shortened, the solving precision and speed of the pressure equation can be improved, then the numerical reservoir simulation time is shortened, the performance bottleneck in the numerical reservoir simulation process is eliminated, and technical support is provided for further improving the oil extraction rate of an oil reservoir.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of chemical drive fine oil reservoir numerical simulation, and in particular to a parallel direct solution method for pressure equations in oil reservoir numerical simulation. Background Art

[0002] Numerical simulation of oil reservoirs is a numerical calculation method that uses computers to study the seepage laws of multiphase fluids in oil and gas reservoirs. It is used to solve complex seepage and engineering problems that are difficult to solve during the development of oil reservoirs. It is one of the key technologies for fine prediction of remaining oil and efficient potential tapping. At present, most of my country's recoverable oil fields have entered the late stage of development, and the comprehensive water content of oil fields remains high. Ordinary numerical simulation of oil reservoirs can no longer meet the current development needs. In order to accurately understand the distribution of remaining oil and improve the oil recovery rate, it is necessary to use fine numerical simulation of oil reservoirs for further optimization. However, the number of grids in fine numerical simulation of oil reservoirs is very large, reaching millions or even tens of millions of grids. As the scale of the model increases, the simulation operation time becomes longer and longer, and the simulation speed becomes a bottleneck for the widespread application of numerical simulation technology. It takes several days or even months to simulate with an ordinary computer or workstation, or it cannot be simulated at all due to insufficient memory.

[0003] Numerical simulation of oil reservoirs generally includes several modules, such as data collection, source quantity allocation, pressure preprocessing, solving pressure equations, solving saturation and component concentration, and analyzing remaining oil and comprehensive water content. Among them, solving the pressure equation is the most time-consuming module in the current numerical simulation of oil reservoirs, accounting for more than 55% or even higher. In order to solve the problem that the fine numerical simulation of oil reservoirs is time-consuming due to the large number of grids, the present invention focuses on the use of MPI to realize the parallel solution of the pressure equation module, so as to improve the computational efficiency of the fine numerical simulation of oil reservoirs.

[0004] In the Chinese patent application with application number: CN201510135020.4, a chemical flooding reservoir numerical simulation method is involved, which includes: step 1, optimizing the grid model design and establishing a static model; step 2, establishing a dynamic model based on the established static model; and step 3, adjusting the parameters in different time periods based on the established dynamic model to achieve time-based historical fitting, with different parameters being adjusted in different time periods and different fitting accuracy requirements at different levels. The chemical flooding reservoir numerical simulation method improves the application level of numerical simulation software, improves the accuracy of reservoir description, and provides more accurate technical support for the later stage of reservoir development.

[0005] In the Chinese patent application with application number: CN201510026314.3, a ternary composite flooding optimization method based on parallel self-adjusting differential evolution is involved. The method first takes the net present value as the performance indicator, the seepage equation of the oil and water phases and the convection-diffusion adsorption equation of alkali, surfactant and polymer as the governing equation, the displacer synergy equation, the algebraic equation of physicochemical parameters and the boundary conditions of the displacer as the constraint equation, and the injection concentration of each displacer as the optimization variable to establish an optimization model. Secondly, in order to improve the global and local search capabilities of the traditional differential evolution algorithm, increase the convergence speed and avoid entering the local optimum, a new parallel self-adjusting differential evolution algorithm is proposed by introducing a parallel strategy into the evolution process and self-adjusting the scaling factor. Finally, the algorithm is used to optimize the injection concentration of the ternary composite flooding model to obtain the optimal injection-production strategy.

[0006] In the Chinese patent application with application number: CN201710702432.0, a method and system for rapid analysis of remaining oil in fracture-cavity reservoirs is involved, which includes establishing a mathematical model of fracture-cavity reservoirs; dividing the fracture-cavity reservoirs into grid units, and establishing a numerical model based on the mathematical model; iteratively solving the numerical model, and analyzing the remaining oil in the fracture-cavity reservoir according to the distribution of fluid pressure and saturation used to describe the fracture-cavity reservoir; wherein, in each iterative step of iteratively solving the numerical model, it includes: extracting the oil phase pressure equation from the numerical model based on the characteristics of the grid unit; processing the oil phase pressure equation based on the algebraic multigrid algorithm to obtain a first pressure value; and using the first pressure value as the initial solution when iterating the numerical model. By adopting this method, the remaining oil in fracture-cavity reservoirs can be rapidly and effectively analyzed.

[0007] In the Chinese patent application with application number: CN201710253502.9, a method and device for numerical simulation of oil reservoir seepage is involved, wherein the method includes: obtaining the initial state information of each grid area of ​​the heterogeneous sandstone reservoir, the variation function corresponding to each parameter in the initial state information, and the attribute information of each permeability interval of the heterogeneous sandstone reservoir; substituting the above parameters into a preset oil reservoir seepage numerical model to obtain a set of seepage control equations containing the seepage control equations corresponding to each permeability interval; solving the set of seepage control equations in combination with the boundary conditions of the set of seepage control equations to obtain the parameter values ​​of each parameter after the heterogeneous sandstone reservoir has been produced for a certain period of time, thereby accurately describing the distribution characteristics of the remaining oil after the preset production time of the heterogeneous sandstone reservoir and formulating a reasonable potential tapping method; the invention fully considers the differences in the seepage characteristics of each reservoir and reduces the error between the evaluation results and the actual situation.

[0008] The above existing technologies are greatly different from the present invention and fail to solve the technical problem we want to solve. For this reason, we have invented a new parallel direct solution method for the pressure equation in reservoir numerical simulation. Summary of the invention

[0009] The purpose of the present invention is to provide a parallel direct solution method for the pressure equation in reservoir numerical simulation which can solve the problem that the simulation takes too long as the scale of reservoir simulation grid increases.

[0010] The object of the present invention can be achieved by the following technical measures: a parallel direct solution method for the pressure equation in the numerical simulation of the oil reservoir, the parallel direct solution method for the pressure equation in the numerical simulation of the oil reservoir comprises:

[0011] Step 1: Obtain the pressure equation based on the reservoir mathematical model, collect relevant data, and pre-process the data;

[0012] Step 2, allocating source quantity according to the well model;

[0013] Step 3, performing pressure pretreatment;

[0014] Step 4, solving the pressure equation;

[0015] Step 5, calculating the component concentration and phase saturation of the reservoir numerical simulation;

[0016] Step 6: Analyze the remaining oil and comprehensive water content to determine the mine implementation plan.

[0017] The purpose of the present invention can also be achieved by the following technical measures:

[0018] In step 1, the basic mathematical model of reservoir numerical simulation is based on the following assumptions: local thermodynamic equilibrium in the reservoir, immobility of the solid phase, micro-compressibility of rock and fluid, Fick dispersion, ideal mixing, and fluid seepage satisfying Darcy's law; under the basic assumptions, the accuracy and speed of pressure solution are prerequisite for the overall solution of reservoir numerical simulation, and the pressure equation is in the following form:

[0019]

[0020] Where φ is the porosity at the reference pressure, C t is the total compressibility coefficient, t is time, P is pressure, k is the permeability of the rock, λ rw , ro is the fluidity of the water phase and the oil phase, γ w , γ o is the relative density of water phase and oil phase, P c is the capillary pressure, D is the depth, div is the divergence, ▽ is the gradient, q w and q oare the source and sink flows of water and oil respectively.

[0021] In step 1, the initial pressure, density, viscosity, and porosity at the initial pressure are collected, the data are preprocessed, and the conductivity and permeability are calculated.

[0022] In step 2, injection wells are allocated to each layer according to the injection rate, and well constraints are added to the implicit solution of the pressure equation.

[0023] In step 3, pressure preprocessing is performed to calculate the pressure equation coefficients and right-hand side terms; the pressure equation is discretized according to the seven-point central difference format. After discretization, the sum of the oil-water two-phase transmission coefficients is used to determine the discrete coefficients in six directions, and the time derivative phase coefficient is calculated using the comprehensive compression coefficient to form the main diagonal elements; the capillary force term and the gravity term are explicitly processed and placed on the right side; the coefficient matrix is ​​a seven-diagonal symmetric border matrix A and a right-hand side term b.

[0024] In step 4, the direct solution method based on LU decomposition is used to solve the pressure linear algebraic equation group AP=b in parallel; first, the coefficient matrix A is decomposed into a lower triangular matrix L and an upper triangular matrix U, that is, the matrix L and the matrix U are solved in parallel so that A=LU; then Uy=b and LP=y are solved in parallel respectively to obtain the pressure P.

[0025] Step 4 includes:

[0026] Step 41, storing the algebraic equation system;

[0027] Step 42, distributing the algebraic equation system;

[0028] Step 43, scaling the algebraic equation system;

[0029] Step 44, sorting the equations by rows;

[0030] Step 45, sorting the equation group by columns;

[0031] Step 46, performing symbolic decomposition of the algebraic equation system;

[0032] Step 47, performing parallel numerical decomposition and triangular solution of the algebraic equations;

[0033] Step 48, collecting the pressure P obtained by solving.

[0034] In step 41, in order to save storage space, the coefficient matrix A is stored in row compression form; in the row compression form, all non-zero elements in the matrix A are stored row by row, the array nzval[] is used to store the values ​​of the non-zero elements, the array colind[] is used to store the column numbers of the non-zero elements, and the array rowptr[] stores the information of the rows where the non-zero elements are located; since the non-zero elements are stored row by row, the elements of a row in the matrix are continuous, and the array rowptr[] only needs to store the position of the first non-zero element in each row; in addition, it is also necessary to additionally store the dimension N of the matrix A and the number of non-zero elements nnz.

[0035] In step 42, in order to make each processor perform parallel LU decomposition, the algebraic equation system is divided into blocks by row and distributed to each processor; if the number of processors used is p, the matrix A is divided into A1, A2, ..., A p There are p block submatrices, and the right-hand term b is divided into b1, b2, ..., b in the same form. p The p-block sub-vectors are then distributed to each processor, and the i-th processor stores the sub-matrix A in row compressed form i and b in array form i .

[0036] In step 43, in order to avoid floating point exception errors in the LU decomposition process, the coefficient matrix A is sorted by row and column i and the right-hand side term b i Balanced scaling is performed so that the order of magnitude of the elements in each row and column of the coefficient matrix is ​​the same; first calculate the row scaling diagonal matrix D r With column-scaled diagonal matrix D c , and then use the row scaling matrix D r With the column scaling matrix D c Scaling the coefficient matrix A of the algebraic equation system i and the right-hand side term b i , get A i ←D r ·A i ·D c , b i ←D r b i ·D c .

[0037] In step 44, in order to avoid instability in the LU decomposition process due to the small main diagonal elements, the coefficient matrix A i and the right-hand side term b iThe rows are sorted to maximize the main diagonal elements of the coefficient matrix; the diagonal elements of each row of the matrix are compared with the elements of the same column in each row below the diagonal by selecting the main element in the column, and the diagonal elements of each row are made larger than the elements of the same column in each row below the diagonal by exchanging rows; the diagonal matrix P is sorted by rows r Record the order of the rows after the rows are swapped, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system i and the right-hand side term b i , we get A←P r ·A, b←P r b.

[0038] In step 45, in order to improve the efficiency of the LU decomposition process, the coefficient matrix A i and the right-hand side term b i Column sorting is performed to minimize the number of filler elements generated when the coefficient matrix is ​​decomposed; a multi-layer nested partitioning sorting algorithm is used to reorder each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix, and the diagonal matrix P is sorted by columns. c Record the order of the vertices after sorting, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system in a symmetrical way i and the right-hand side term b i ,get

[0039] In step 46, in order to obtain the decomposition A i =L i U i Medium i and U i The number and position of the non-zero elements of the matrix, and allocate memory for it, symbolically decompose the coefficient matrix; use depth-first search to traverse each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix, and obtain L i and U i The number and positions of nonzero elements in the matrix.

[0040] In step 47, Gaussian elimination is used to calculate A in parallel i =L i U i Medium i and U i The values ​​of the non-zero elements of the matrix are then used to perform parallel triangular solutions U i y i =b i and L i P i =y i Calculate the pressure P iThe parallelism of this step lies in the distribution of the algebraic equations in step 42. Since the blocks of the algebraic equations are stored on different processors, for each calculation in the decomposition and solution process, each processor only calculates the part stored by itself. Therefore, the calculation of this step is completed by multiple processors.

[0041] In step 48, the pressures P1, P2, ..., P obtained by each processor are collected. p There are p blocks of sub-vectors in total, and they are merged in the order of subscripts to get the pressure P.

[0042] In step 5, the reservoir mathematical model is used to calculate the component concentration and phase saturation of the reservoir numerical simulation.

[0043] In step 6, reservoir development researchers determine the mine implementation plan by analyzing data such as remaining oil and comprehensive water content.

[0044] The parallel direct solution method of the pressure equation in the numerical simulation of the oil reservoir in the present invention aims at the problems of increased reservoir grid size and excessively long simulation time caused by the development of the numerical simulation of the oil reservoir towards large-scale and refined directions. The numerical simulation of the oil reservoir can be carried out on a high-performance computer, and the pressure solution therein is parallelized, which can shorten the time of pressure solution and improve the solution accuracy and speed of the pressure equation. The faster the pressure equation is solved, the more accurate the calculation is, and the subsequent calculation of component concentration, phase saturation, etc. can be faster and more accurate, thereby reducing the time of the numerical simulation of the oil reservoir, eliminating the performance bottleneck of the numerical simulation process of the oil reservoir, and providing technical support for further improving the oil recovery rate of the oil reservoir. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a flow chart of the parallel direct solution method of the pressure equation in the numerical simulation of the oil reservoir of the present invention;

[0046] Figure 2 It is a schematic diagram of the acceleration ratio of the pressure module with different numbers of processors in test data 1 in a specific embodiment of the present invention;

[0047] Figure 3 It is a schematic diagram of the acceleration ratio of the pressure module with different numbers of processors in test data 2 in a specific embodiment of the present invention. DETAILED DESCRIPTION

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

[0049] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations and / or combinations thereof.

[0050] The basic mathematical model of reservoir numerical simulation is based on the following assumptions: local thermodynamic equilibrium in the reservoir, immobility of the solid phase, microcompressibility of rock and fluid, Fick dispersion, ideal mixing, and fluid flow that satisfies Darcy's law. Under these basic assumptions, the phase Darcy velocity is used to give the total concentration of the i-th material component. The material conservation equation of the i-th material component expressed in the form of:

[0051]

[0052] Where: C il is the concentration of the i-th substance component in phase l, Q i is the source-sink term, n p is the phase number, subscript l indicates the lth phase, u l is the Darcy velocity of the phase, is the diffusion flux, φ is the porosity, ρ i is the density of component i, is the total concentration of the i-th material component, expressed as the sum of the concentrations of the i-th material component in all phases (including the adsorbed phase). The material conservation equations of the occupied volume components are added, and the phase flow rates are expressed using Darcy's law. The capillary pressure formula is used to express the relationship between phase pressures to obtain the pressure equation. The accuracy and speed of pressure solution are prerequisite for the overall solution of reservoir numerical simulation, which can be abbreviated as follows:

[0053]

[0054] Where φ is the porosity at the reference pressure, C t is the total compressibility coefficient, t is time, P is pressure, k is the permeability of the rock, λ rw , ro is the fluidity of the water phase and the oil phase, γ w , γ o is the relative density of water phase and oil phase, P c is the capillary pressure, D is the depth, q w and q o are the source and sink flows of water and oil respectively.

[0055] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0056] Example 1

[0057] In a specific embodiment 1 of the present invention, the parallel direct solution method of the pressure equation in the reservoir numerical simulation of the present invention includes:

[0058] Step 1: Collect data and process the data.

[0059] Step 2: Source quantity allocation. Injection wells are allocated to each layer according to the injection rate, and well constraints are added to the implicit solution of the pressure equation.

[0060] Step 3, pressure preprocessing, calculate the pressure equation coefficients and right-hand side terms. The pressure equation is discretized according to the general seven-point central difference format. After discretization, the sum of the oil-water two-phase transmission coefficients is used to determine the discrete coefficients in six directions. At the same time, the time derivative phase coefficient is calculated using the comprehensive compression coefficient to form the main diagonal elements. The capillary force term and gravity term are explicitly processed and placed on the right side. The coefficient matrix is ​​a seven-diagonal symmetric rimmed matrix (A) and a right-hand side term (b).

[0061] Step 4, solve the pressure linear algebraic equation AP=b in parallel using the direct solution method based on LU decomposition. First, decompose the coefficient matrix A into the lower triangular matrix L and the upper triangular matrix U, that is, solve the matrix L and the matrix U in parallel so that A=LU. Then solve Uy=b and LP=y in parallel to obtain the pressure P.

[0062] In step 4, (1) the algebraic equation system is first stored.

[0063] In order to save storage space, the coefficient matrix A is stored in row compression form. In row compression form, all non-zero elements in matrix A are stored row by row, the array nzval[] is used to store the values ​​of non-zero elements, the array colind[] is used to store the column numbers of non-zero elements, and the array rowptr[] stores the information of the rows where non-zero elements are located. Since non-zero elements are stored row by row, the elements of a row in the matrix are continuous, and the array rowptr[] only needs to store the position of the first non-zero element in each row. In addition, the dimension N of matrix A and the number of non-zero elements nnz need to be stored additionally.

[0064] (2) Distribute algebraic equations.

[0065] In order to make each processor parallel LU decomposition, the algebraic equations are divided into blocks by row and distributed to each processor. If the number of processors used is p, the matrix A is divided into A1, A2, ..., A p There are p block submatrices, and the right-hand term b is divided into b1, b2, ..., b in the same form. p The p-block sub-vectors are then distributed to each processor, and the i-th processor stores the sub-matrix A in row compressed form i and b in array formi .

[0066] (3) Scaling of algebraic equations.

[0067] In order to avoid floating point exception errors in the LU decomposition process, the coefficient matrix A is sorted by rows and columns. i and the right-hand side term b i Balanced scaling is performed so that the order of magnitude of the elements in each row and column of the coefficient matrix is ​​the same. First, the row scaling diagonal matrix D is calculated. r With column-scaled diagonal matrix D c , and then use the row scaling matrix D r With the column scaling matrix D c Scaling the coefficient matrix A of the algebraic equation system i and the right-hand side term b i , get A i ←D r ·A i ·D c , b i ←D r b i ·D c .

[0068] (4) Sort the rows of the equation system.

[0069] To avoid instability in the LU decomposition process due to the small main diagonal elements, the coefficient matrix A i and the right-hand side term b i The rows are sorted to maximize the main diagonal elements of the coefficient matrix. By selecting the main element by column, the diagonal elements of each row of the matrix are compared with the elements of the same column in each row below the diagonal, and the diagonal elements of each row are made larger than the elements of the same column in each row below the diagonal by row exchange. r Record the order of the rows after the rows are swapped, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system i and the right-hand side term b i , we get A←P r ·A, b←P r b.

[0070] (5) Sort the columns of the equation system.

[0071] In order to improve the efficiency of the LU decomposition process, the coefficient matrix A i and the right-hand side term b i Column sorting is performed to minimize the number of filler elements generated when the coefficient matrix is ​​decomposed. Using a multi-layer nested partitioning sorting algorithm, each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix is ​​reordered, and the diagonal matrix P is sorted by columns. cRecord the order of the vertices after sorting, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system in a symmetrical way i and the right-hand side term b i ,get

[0072] (6) Symbolic decomposition of algebraic equations.

[0073] In order to get the decomposition A i =L i U i Medium i and U i The number and position of the non-zero elements of the matrix, and allocate memory for it, and symbolically decompose the coefficient matrix. Use depth-first search to traverse each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix, and get L i and U i The number and positions of nonzero elements in the matrix.

[0074] (7) Parallel numerical decomposition and triangular solution of algebraic equations.

[0075] Use Gaussian elimination to parallelize the computation of A i =L i U i Medium i and U i The values ​​of the non-zero elements of the matrix are then used to perform parallel triangular solutions U i y i =b i and L i P i =y i Calculate the pressure P i .

[0076] The parallelism of this step lies in the distribution of the algebraic equations in step 2. Since the blocks of the algebraic equations are stored on different processors, each processor only calculates the stored part for each calculation in the decomposition and solution process. Therefore, the calculation of this step is completed by multiple processors.

[0077] (8) Collect the pressure P obtained by solving.

[0078] Collect the pressures P1, P2, ..., P obtained by each processor p There are p blocks of sub-vectors in total, and they are merged in the order of subscripts to get the pressure P.

[0079] Step 5: Calculate the component concentration, phase saturation, etc. of the reservoir numerical simulation.

[0080] Step 6: Analyze the remaining oil and comprehensive water content to determine the mine implementation plan.

[0081] Example 2

[0082] In a specific embodiment 2 of the present invention, Figure 1 The flowchart of the parallel direct solution method of the pressure equation in the numerical simulation of the oil reservoir of the present invention is as follows:

[0083] In step 1, the pressure equation is obtained according to the reservoir mathematical model, relevant data is collected, and the data is preprocessed.

[0084] In step 2, source volume allocation is performed based on the well model. Injection wells are allocated to each layer according to the injection rate, and well constraints are added to the implicit solution of the pressure equation.

[0085] In step 3, the pressure equation is discretized according to the general seven-point central difference format, and the discretization format is as follows:

[0086]

[0087] in:

[0088]

[0089]

[0090] The subscript i + represents the upstream point between points i and i+1 in the x direction (in formula (2) If the partial derivative of is greater than 0, it is the upstream point) position, subscript j + Indicates the position of the upstream point between points j and j+1 in the y direction. The subscript k + Indicates the superscript position of the upstream point between points k and k+1 in the y direction; the superscript n and n+1 represent the previous time step and the current time step respectively. The source and sink terms are semi-implicitly discretized, and the specific format is:

[0091]

[0092] Among them, PI o ,PI w Represent the production index of oil phase and water phase respectively, P wf is the bottom hole flowing pressure.

[0093] After the above discretization, the sum of the oil-water two-phase transmission coefficients is used to determine the discrete coefficients in six directions, and the time derivative phase coefficient is calculated using the comprehensive compression coefficient to form the main diagonal elements. After discretization, the coefficient matrix of the pressure linear algebraic equation group is a seven-diagonal symmetric edging matrix (A) and the right-hand term (b). The AP=b format is as follows:

[0094]

[0095] In step 4, the pressure linear algebraic equations are discretized to form a system of pressure linear algebraic equations, which are solved in parallel based on the direct solution method of LU decomposition. First, the coefficient matrix A is decomposed into a lower triangular matrix L and an upper triangular matrix U, that is, the matrix L and the matrix U are solved in parallel so that A = LU. Then, parallel triangular solutions Uy = b and LP = y are performed to obtain the pressure P.

[0096] Use MPI to solve the pressure linear algebraic equations in parallel, such as Figure 1 As shown, the specific process is as follows:

[0097] (1) Store algebraic equations. In order to save storage space, Figure 1 Processor p1 uses row compression to store the coefficient matrix A. In row compression, all non-zero elements in matrix A are stored row by row. The array nzval[] is used to store the values ​​of non-zero elements, the array colind[] is used to store the column numbers of non-zero elements, and the array rowptr[] stores the information of the rows where non-zero elements are located. Since non-zero elements are stored row by row, the elements of a row in the matrix are continuous, and the array rowptr[] only needs to store the position of the first non-zero element in each row. In addition, the dimension N of matrix A and the number of non-zero elements nnz need to be stored additionally.

[0098] (2) Distribute the algebraic equations. In order to make each processor perform LU decomposition in parallel, Figure 1 In the distribution step, processor p1 divides the algebraic equations into blocks by row and distributes them to each processor. If the number of processors used is p, the matrix A is divided into A1, A2, ..., A p There are p block submatrices, and the right-hand term b is divided into b1, b2, ..., b in the same form. p The p-block sub-vectors are then distributed to each processor, and the i-th processor stores the sub-matrix A in row compressed form i and b in array form i ,like Figure 1 As shown in . Where the i-th block sub-matrix A i and subvector b i The number of rows nrow i for

[0099]

[0100] (3) Scaling the algebraic equations. To avoid floating point exception errors in the LU decomposition process, Figure 1 In the scaling step, each processor performs row and column operations on the coefficient matrix A i and the right-hand side term b iBalanced scaling is performed so that the order of magnitude of the elements in each row and column of the coefficient matrix is ​​the same. First, the row scaling diagonal matrix D is calculated. r With column-scaled diagonal matrix D c , where the scaling factor of each row is D r (I,I) and the scaling factor D for each column c (J,J) satisfies condition D r (I,I)×A i (I,I)×D c (I,I)=1 and D r (I,I)×A i (I,I)×D c (I,I) = 1, and then use the row scaling matrix D r With the column scaling matrix D c Scaling the coefficient matrix A of the algebraic equation system i and the right-hand side term b i ,get

[0101] A i ←D r ·A i ·D c (6)

[0102] b i ←D r b i ·D c (7)

[0103] , the scaled sub-matrix block and the right-end sub-vector begin to be sorted in the next step.

[0104] (4) Sort the rows of the equation system. To avoid instability in the LU decomposition process caused by the main diagonal elements being too small, Figure 1 In the row sorting step, each processor pairs the coefficient matrix A i and the right-hand side term b i The rows are sorted to maximize the main diagonal elements of the coefficient matrix. By selecting the main element by column, the diagonal elements of each row of the matrix are compared with the elements of the same column in each row below the diagonal, and the diagonal elements of each row are made larger than the elements of the same column in each row below the diagonal by row exchange. r Record the order of the rows after the rows are swapped, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system i and the right-hand side term b i ,get

[0105] A i ←P r ·A i (8)

[0106] bi ←P r b i (9).

[0107] (5) Sort the columns of the equation system. In order to improve the efficiency of the LU decomposition process, Figure 1 The coefficient matrix A of each processor i and the right-hand side term b i Column sorting is performed to minimize the number of filler elements generated when the coefficient matrix is ​​decomposed. Using a multi-layer nested partitioning sorting algorithm, each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix is ​​reordered, and the diagonal matrix P is sorted by columns. c Record the order of the vertices after sorting, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system in a symmetrical way i and the right-hand side term b i ,get

[0108]

[0109]

[0110] (6) Symbolic decomposition of the algebraic equation system. In order to obtain the decomposition A i =L i U i Medium i and U i The number and position of the non-zero elements of the matrix, and allocate memory for it, and symbolically decompose the coefficient matrix. Use depth-first search to traverse each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix, and get L i and U i The number and positions of nonzero elements in the matrix.

[0111] During the traversal process, if L i (I,J)≠0 or U i (I,J)≠0, then record it in the non-zero element count nnz(L+U), and use the array ptr(L+U)[] to record the current subscript (I,J), and get L i and U i The matrix non-zero element data structures nnz(L+U) and ptr(L+U)[].

[0112] (7) Parallel numerical decomposition and triangular solution of algebraic equations. Use Gaussian elimination to parallelize the calculation of A i =L i U i Medium i and U i The values ​​of the non-zero elements of the matrix are then used to perform parallel triangular solutions U i y i =bi and L i P i =y i Calculate the pressure P i .

[0113] The LU decomposition using Gaussian elimination starts from the first column of the coefficient matrix and decomposes each column of the matrix in turn. For the Kth column of the coefficient matrix, the decomposition process consists of three parts: parallel column decomposition, parallel row update, and parallel trailing update. The parallel column decomposition uses the formula

[0114] A i (K:N,K)=L i (K:N,K)·U i (K,K) (12)

[0115] Solving for L i (K:N,K) and U i (K,K); Parallel row updates using the formula

[0116] U i (K,K+1:N)=L i -1 (K,K)·A i (K,K+1:N) (13)

[0117] Solving for U i (K,K+1:N); Parallel trailing update using formula

[0118] A i (K+1:N,K+1:N)=A i (K+1:N,K+1:N)-L i (K+1:N,K)·U i (K,K+1:N) (14)

[0120] Update A i (K+1:N,K+1:N), where I:J represents the integer sequence from I to J.

[0121] The parallelism of this step lies in Figure 1 In step 2, the distribution of the algebraic equation system, since each block of the algebraic equation system is stored on different processors, for each calculation in the decomposition and solution process, each processor only calculates the part stored by itself. Therefore, the calculation of this step is completed by multiple processors.

[0122] Collect the pressure P obtained by the solution. Collect the pressure P1, P2, ..., P obtained by each processor. p There are p blocks of sub-vectors in total, and they are merged in the order of subscripts to get the pressure P.

[0123] Step 5: Calculate the component concentration, phase saturation, etc. of the reservoir numerical simulation.

[0124] Step 6: Analyze the remaining oil and comprehensive water content to determine the mine implementation plan.

[0125] Example 3

[0126] This embodiment has carried out the following test on the method of the present invention:

[0127] 1. Test environment: Shanhe supercomputer system. The hardware system consists of 8624 computing nodes, each of which uses a dual-core 28-core Intel(R) Xeon(R) Gold 6258R CPU@2.70GHz. The processor's operating system is Centos7.6.1810, and the system's main compiler is Intel 2021.2.0.

[0128] 2. Test data 1 comes from the actual mine model with 5682880 grids (280×236×86), 27 wells, and 6000 days of simulation time. Test data 2 comes from the actual mine model with 11365760 grids (280×236×172), 27 wells, and 6000 days of simulation time.

[0129] 3. Test processor scale: The number of processors in test data 1 is serial, 1, 8, 16, 32, 64, 128, and 256 respectively.

[0130] The number of processors in test data 2 is serial, 1, 8, 16, 32, 64, 128, and 256 respectively.

[0131] The parallel direct solution method of the pressure equation proposed in this invention can reduce the reservoir simulation time and alleviate the problem of slow operation speed of million and ten million grid scale models. The test results are as follows: Figure 2 and Figure 3 As shown in the figure, the speedup ratio of solving the pressure equation in parallel reaches up to 2.664.

[0132] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions recorded in the aforementioned embodiments or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0133] Except for the technical features described in the specification, all other technical features are known technologies to those skilled in the art.

Claims

1. A parallel direct solution method for the pressure equation in reservoir numerical simulation, characterized in that: The parallel direct solution method of the pressure equation in the reservoir numerical simulation includes: Step 1: Obtain the pressure equation based on the reservoir mathematical model, collect relevant data, and pre-process the data; Step 2, allocating source quantity according to the well model; Step 3, performing pressure pretreatment; Step 4, solving the pressure equation; Step 5, calculating the component concentration and phase saturation of the reservoir numerical simulation; Step 6: Analyze the remaining oil and comprehensive water content to determine the mine implementation plan.

2. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 1, characterized in that: In step 1, the basic mathematical model of reservoir numerical simulation is based on the following assumptions: local thermodynamic equilibrium in the reservoir, immobility of the solid phase, micro-compressibility of rock and fluid, Fick dispersion, ideal mixing, and fluid seepage satisfying Darcy's law; under the basic assumptions, the accuracy and speed of pressure solution are prerequisite for the overall solution of reservoir numerical simulation, and the pressure equation is in the following form: Where φ is the porosity at the reference pressure, C t is the total compressibility coefficient, t is time, P is pressure, k is the permeability of the rock, λ rw , ro is the fluidity of the water phase and the oil phase, γ w , γ o is the relative density of water phase and oil phase, P c is the capillary pressure, D is the depth, div is the divergence, ▽ is the gradient, q w and q o are the source and sink flows of water and oil respectively.

3. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 2, characterized in that: In step 1, the initial pressure, density, viscosity, and porosity at the initial pressure are collected, the data are preprocessed, and the conductivity and permeability are calculated.

4. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 1, characterized in that: In step 2, injection wells are allocated to each layer according to the injection rate, and well constraints are added to the implicit solution of the pressure equation.

5. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 2, characterized in that: In step 3, pressure preprocessing is performed to calculate the pressure equation coefficients and right-hand side terms; the pressure equation is discretized according to the seven-point central difference format. After discretization, the sum of the oil-water two-phase transmission coefficients is used to determine the discrete coefficients in six directions, and the time derivative phase coefficient is calculated using the comprehensive compression coefficient to form the main diagonal elements; the capillary force term and gravity term are explicitly processed and placed on the right side; the coefficient matrix is ​​a seven-diagonal symmetric border matrix A and a right-hand side term b.

6. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 5, characterized in that: In step 4, the direct solution method based on LU decomposition is used to solve the pressure linear algebraic equation group AP=b in parallel; first, the coefficient matrix A is decomposed into a lower triangular matrix L and an upper triangular matrix U, that is, the matrix L and the matrix U are solved in parallel so that A=LU; then Uy=b and LP=y are solved in parallel respectively to obtain the pressure P.

7. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 6, characterized in that: Step 4 includes: Step 41, storing the algebraic equation system; Step 42, distributing the algebraic equation system; Step 43, scaling the algebraic equation system; Step 44, sorting the equation group by rows; Step 45, sorting the equation group by columns; Step 46, performing symbolic decomposition of the algebraic equation system; Step 47, performing parallel numerical decomposition and triangular solution of the algebraic equations; Step 48, collecting the pressure P obtained by solving.

8. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 7, characterized in that: In step 41, in order to save storage space, the coefficient matrix A is stored in row compression form; in the row compression form, all non-zero elements in the matrix A are stored row by row, the array nzval[] is used to store the values ​​of the non-zero elements, the array colind[] is used to store the column numbers of the non-zero elements, and the array rowptr[] stores the information of the rows where the non-zero elements are located; since the non-zero elements are stored row by row, the elements of a row in the matrix are continuous, and the array rowptr[] only needs to store the position of the first non-zero element in each row; In addition, additional storage is required for the dimension N of the matrix A and the number of non-zero elements nnz.

9. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 8, characterized in that: In step 42, in order to make each processor perform parallel LU decomposition, the algebraic equation system is divided into blocks by row and distributed to each processor; if the number of processors used is p, the matrix A is divided into A1, A2, ..., A p There are p block submatrices, and the right-hand term b is divided into b1, b2, ..., b in the same way. p The p-block sub-vectors are then distributed to each processor, and the i-th processor stores the sub-matrix A in row compressed form i and b in array form i .

10. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 9, characterized in that: In step 43, in order to avoid floating point exception errors in the LU decomposition process, the coefficient matrix A is sorted by row and column i and the right-hand side term b i Balanced scaling is performed so that the order of magnitude of the elements in each row and column of the coefficient matrix is ​​the same; first calculate the row scaling diagonal matrix D r With column-scaled diagonal matrix D c , and then use the row scaling matrix D r With the column scaling matrix D c Scaling the coefficient matrix A of the algebraic equation system i and the right-hand side term b i , get A i ←D r ·A i ·D c , b i ←D r b i ·D c .

11. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 10, characterized in that: In step 44, in order to avoid instability in the LU decomposition process due to the small main diagonal elements, the coefficient matrix A i and the right-hand side term b i The rows are sorted to maximize the main diagonal elements of the coefficient matrix; the diagonal elements of each row of the matrix are compared with the elements of the same column in each row below the diagonal by selecting the main element in the column, and the diagonal elements of each row are made larger than the elements of the same column in each row below the diagonal by exchanging rows; the diagonal matrix P is sorted by rows r Record the order of the rows after the rows are swapped, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system i and the right-hand side term b i , we get A←P r ·A, b←P r b.

12. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 11, characterized in that: In step 45, in order to improve the efficiency of the LU decomposition process, the coefficient matrix A i and the right-hand side term b i Column sorting is performed to minimize the number of filler elements generated when the coefficient matrix is ​​decomposed; a multi-layer nested partitioning sorting algorithm is used to reorder each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix, and the diagonal matrix P is sorted by columns. c Record the order of the vertices after sorting, and then use this matrix to reorder the coefficient matrix A of the algebraic equation system in a symmetrical way i and the right-hand side term b i ,get 13. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 12, characterized in that: In step 46, in order to obtain the decomposition A i =L i U i Medium i and U i The number and position of the non-zero elements of the matrix, and allocate memory for it, symbolically decompose the coefficient matrix; use depth-first search to traverse each vertex of the graph G(A) with the coefficient matrix as the adjacency matrix, and obtain L i and U i The number and positions of nonzero elements in the matrix.

14. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 13, characterized in that: In step 47, Gaussian elimination is used to calculate A in parallel i =L i U i Medium i and U i The values ​​of the non-zero elements of the matrix are then used to perform parallel triangular solutions U i y i =b i and L i P i =y i Calculate the pressure P i The parallelism of this step lies in the distribution of the algebraic equations in step 42. Since the blocks of the algebraic equations are stored on different processors, for each calculation in the decomposition and solution process, each processor only calculates the part stored by itself. Therefore, the calculation of this step is completed by multiple processors.

15. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 14, characterized in that: In step 48, the pressures P1, P2, ..., P obtained by each processor are collected. p There are p blocks of sub-vectors in total, and they are merged in the order of subscripts to get the pressure P.

16. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 1, characterized in that: In step 5, the reservoir mathematical model is used to calculate the component concentration and phase saturation of the reservoir numerical simulation.

17. The parallel direct solution method for the pressure equation in reservoir numerical simulation according to claim 1, characterized in that: In step 6, reservoir development researchers analyze the remaining oil and integrated water content data to determine the mine implementation plan.