Method for optimizing size of oil nozzle in self-spraying period of shale oil reservoir
By constructing a proxy-assisted genetic algorithm to optimize nozzle size, the subjectivity and inefficiency of nozzle size determination in traditional methods are solved, achieving efficient and accurate optimization of shale oil reservoirs during the self-flowing period, and improving oil production and computational efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional nozzle size determination relies on manual experience, which is highly subjective and difficult to adapt to the multi-objective optimization needs under complex working conditions. It also involves a large amount of computation and a long iteration cycle, making it difficult to meet the needs of high efficiency and precision in industrial production.
A surrogate-assisted genetic algorithm is constructed. By combining the objective function and quantization constraints with a random forest algorithm embedded in the genetic algorithm, the nozzle size is optimized. The surrogate model is used to replace the high-cost real calculation, and the optimization efficiency is improved by combining the iteration termination condition.
Standardized modeling for nozzle size optimization was achieved, reducing computational load, improving optimization efficiency, avoiding local optima, ensuring the theoretical optimality and practical feasibility of the final solution, and increasing oil production by 9.8%.
Smart Images

Figure CN121744928A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil and gas development engineering technology, and in particular to a method for optimizing the nozzle size during the self-flowing stage of shale oil reservoirs. Background Technology
[0002] In fields such as oil and gas extraction and industrial fluid control, nozzles are key flow control components, and their size directly affects production efficiency, energy consumption control, and equipment operational safety. Traditional nozzle size determination relies heavily on trial and error based on experience, leading to strong subjectivity and a lack of clear optimization direction. This makes it difficult to meet the multi-objective optimization needs under complex operating conditions (such as balancing output and energy consumption), and dimensional deviations can easily result in low production efficiency and accelerated equipment wear. Furthermore, nozzle optimization involves the coupling of multiple disciplines such as fluid mechanics and engineering thermodynamics. Solving using realistic physical models or numerical simulations suffers from high computational loads and long iteration cycles, failing to meet the efficiency requirements of industrial production.
[0003] With the development of industrial intelligence, traditional optimization methods are no longer sufficient to meet the demands of high-precision and high-efficiency production, necessitating standardized and precise optimization technologies. On the one hand, constraints under complex operating conditions (such as pressure limits and flow ranges) are becoming increasingly stringent, requiring optimization solutions to be highly feasible. On the other hand, industrial production urgently needs to control computational costs and improve optimization efficiency, driving the integrated application of surrogate models and intelligent algorithms. Against this backdrop, there is an urgent need to construct a systematic nozzle size optimization technology solution to address the subjectivity and inefficiency of traditional methods. Summary of the Invention
[0004] The purpose of this invention is to provide a method for optimizing the nozzle size during the self-flowing stage of shale oil reservoirs, thereby solving the problem of low optimization efficiency of traditional genetic algorithms.
[0005] To achieve the above objectives, this invention provides a method for optimizing nozzle size during the self-flowing stage of shale oil reservoirs, comprising the following steps: S1. Construct the objective function for optimizing nozzle size; S2. Determine the constraints; S3. Construct a proxy-assisted genetic algorithm; S4. Obtain the optimized solution through a proxy-assisted genetic algorithm.
[0006] Preferably, in S1: the self-flowing period of shale oil reservoirs The objective function is the maximum cumulative oil production within each optimization step, and its expression is: ; In the formula, This represents the objective function for optimization, namely, the cumulative oil production. This indicates the size of the nozzle during the optimization step; Indicates the number of optimization steps; This represents the oil production during each optimization stage; among which, satisfy: , This indicates the size of the nozzle in the first optimization step. This indicates the size of the nozzle in the second optimization step. This indicates the size of the nozzle in the third optimization step. Indicates the first The size of the nozzle in each optimization step Indicates the first The size of the nozzle in each optimization step.
[0007] Preferably, in S2: the constraint conditions include the nozzle size range, which is a discrete set. Let the nozzle size set be... , At the same time satisfy ,in This indicates the first nozzle size available for selection. This indicates the second nozzle size available for selection. This indicates the third nozzle size available for selection. The first option is indicated by the number of options available. One nozzle size.
[0008] Preferably, in S3: the random forest algorithm is embedded into the genetic algorithm GA as a proxy model to obtain the proxy-assisted genetic algorithm SAGA.
[0009] Preferably, in S4: S41. The surrogate-assisted genetic algorithm maps different nozzle schemes to a set of nozzle sizes in the form of integer codes. This yields chromosomes that can be directly used by proxy-assisted genetic algorithms. , ,in This indicates the nozzle used in the first optimization step. In the set of nozzle sizes The corresponding serial number, This indicates the nozzle used in the second optimization step. In the set of nozzle sizes The corresponding serial number, This indicates the nozzle used in the third optimization step. In the set of nozzle sizes The corresponding serial number, Indicates the first The nozzle used in each optimization step In the set of nozzle sizes The corresponding serial number; S42. Generate the initial population: The proxy-assisted genetic algorithm generates the initial population according to the encoding method in S41. , ,in Indicates the initial population size. This represents the chromosome corresponding to the first individual in the initial population. This represents the chromosome corresponding to the second individual in the initial population. Represents the first in the initial population The chromosomes corresponding to each individual; S43. Generate initial samples; S44. Train the agent model; S45. Measure the forecast results; S46, Genetic manipulation; S47. Prediction and Solution Verification; S48. Iteration Termination: When the predicted results and the solution results in S47 have not improved for multiple generations, stop the iteration and output the optimal nozzle size combination scheme.
[0010] Preferably, in S43: a full-process simulation of real-world yield calculation is performed on all individuals in the initial population using a yield solver, and the mapping relationship between individuals and their fitness is obtained as the initial sample, expressed as: ; In the formula, A sample representing the mapping relationship between individuals and their fitness; Indicates the first Oil nozzle size; Indicates the size of a certain type of nozzle Corresponding fitness; Indicates the first in the nozzle size kind; Indicates the initial population size.
[0011] Preferably, in S44: the surrogate model is trained using initial samples. Through the proxy model By performing prior prediction, the expression for the final cumulative oil production is obtained as follows: ; In the formula, For the proxy model right The projected final cumulative oil production; This represents the number of decision trees in a random forest. Indicates the first decision trees The predicted value.
[0012] Preferably, in S45: the uncertainty of the prediction is measured by the variance of the predicted values from different decision trees, expressed as: ; In the formula, This represents the variance of the predicted values from the decision tree.
[0013] Preferably, in S46: the initial population is subjected to selection, crossover, and mutation operations to generate offspring populations.
[0014] Preferably, in S47: two types of individuals are selected from the offspring population, the yield solver is used to solve for these two types of individuals, a surrogate model is used to predict the remaining individuals, and the solution and prediction results are added to the surrogate model's database. The surrogate model is then updated, and the process is iterated. The two types of individuals include the individual with the highest prediction uncertainty. And the individual with the highest predicted cumulative oil production ; ; In the formula, This represents a portion of the individual fitness obtained using the production solver; The expression for predicting the remaining individuals is: ; In the formula, This represents the fitness of a subset of individuals predicted using a surrogate model.
[0015] Therefore, this invention adopts the above-mentioned method for optimizing nozzle size during the self-flowing stage of shale oil reservoirs. By constructing an objective function and quantifying constraints, it achieves standardized modeling for nozzle size optimization, avoiding the subjectivity of trial and error. The application of a surrogate-assisted genetic algorithm, relying on initial sample training and prediction verification, replaces high-cost real calculations with a surrogate model. Combined with iteration termination conditions, it significantly reduces the amount of computation and improves optimization efficiency. At the same time, by leveraging the global search characteristics of the genetic algorithm, it avoids local optima and ensures that the final solution has both theoretical optimality and practical feasibility.
[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0017] Figure 1 This is an overall flowchart of a method for optimizing nozzle size during the self-flowing stage of shale oil reservoirs according to the present invention; Figure 2 This is a comparison chart of oil production before and after nozzle optimization in an embodiment of the present invention; Figure 3 This is a comparison chart of cumulative oil production before and after nozzle optimization in an embodiment of the present invention. Detailed Implementation
[0018] The following detailed description of embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0019] Please see Figure 1 A method for optimizing nozzle size during the self-flowing stage of shale oil reservoirs includes the following steps: S1. Construct the objective function for optimizing nozzle size; The self-flowing period of shale oil reservoirs The objective function is the maximum cumulative oil production within each optimization step, and its expression is: ; In the formula, This represents the objective function for optimization, namely, the cumulative oil production. This indicates the size of the nozzle during the optimization step; Indicates the number of optimization steps; This represents the oil production during each optimization stage; among which, satisfy: , This indicates the size of the nozzle in the first optimization step. This indicates the size of the nozzle in the second optimization step. This indicates the size of the nozzle in the third optimization step. Indicates the first The size of the nozzle in each optimization step Indicates the first The size of the nozzle in each optimization step; S2. Determine the constraints; The constraints include the range of nozzle sizes, which is a discrete set. Let the set of nozzle sizes be... , At the same time satisfy ,in This indicates the first nozzle size available for selection. This indicates the second nozzle size available for selection. This indicates the third nozzle size available for selection. The first option is indicated by the number of options available. One nozzle size; S3. Construct a proxy-assisted genetic algorithm; By embedding the random forest algorithm into the genetic algorithm GA as a surrogate model, a surrogate-assisted genetic algorithm SAGA is obtained. S4. Obtain the optimized solution through a proxy-assisted genetic algorithm; S41. The surrogate-assisted genetic algorithm maps different nozzle schemes to a set of nozzle sizes in the form of integer codes. This yields chromosomes that can be directly used by proxy-assisted genetic algorithms. , ,in This indicates the nozzle used in the first optimization step. In the set of nozzle sizes The corresponding serial number, This indicates the nozzle used in the second optimization step. In the set of nozzle sizes The corresponding serial number, This indicates the nozzle used in the third optimization step. In the set of nozzle sizes The corresponding serial number, Indicates the first The nozzle used in each optimization step In the set of nozzle sizes The corresponding serial number; S42. Generate the initial population: The proxy-assisted genetic algorithm generates the initial population according to the encoding method in S41. , ,in Indicates the initial population size. This represents the chromosome corresponding to the first individual in the initial population. This represents the chromosome corresponding to the second individual in the initial population. Represents the first in the initial population The chromosomes corresponding to each individual; S43. Generate initial samples: Simulate the full-process real-world production calculation for all individuals in the initial population using a production solver, obtaining a mapping relationship between individuals and their fitness as the initial samples. The expression is: ; In the formula, A sample representing the mapping relationship between individuals and their fitness; Indicates the first Oil nozzle size; Indicates the size of a certain type of nozzle Corresponding fitness; Indicates the first in the nozzle size kind; Indicates the initial population size; S44. Training the agent model: Training the agent model using initial samples. Through the proxy model By performing prior prediction, the expression for the final cumulative oil production is obtained as follows: ; In the formula, For the proxy model right The projected final cumulative oil production; This represents the number of decision trees in a random forest. Indicates the first decision trees The predicted value; S45. Measuring Prediction Results: The uncertainty of the prediction is measured by the variance of the predictions from different decision trees. The expression is as follows: ; In the formula, This represents the variance of the predicted values from the decision tree; S46. Genetic operations: Selecting, crossing over, and mutating the initial population to generate offspring populations; S47. Prediction and Solution Verification: Select two classes of individuals from the offspring population, solve for these two classes using the yield solver, predict the remaining individuals using a surrogate model, and add the solution and prediction results to the surrogate model's database. Update the surrogate model and iterate. The two classes of individuals include the individual with the highest prediction uncertainty. And the individual with the highest predicted cumulative oil production ; The expression for solving for the two types of individuals is: ; In the formula, This represents a portion of the individual fitness obtained using the production solver; The expression for predicting the remaining individuals is: ; In the formula, This represents the fitness of a subset of individuals predicted using a surrogate model. S48. Iteration Termination: When the predicted results and the solution results in S47 have not improved for multiple generations, stop the iteration and output the optimal nozzle size combination scheme.
[0020] Experimental Verification 1 The nozzle size was optimized using both a traditional genetic algorithm and the surrogate-assisted genetic algorithm of this invention. Compared to the 2400-minute optimization time of the traditional genetic algorithm, the overall optimization time of the surrogate-assisted genetic algorithm was 450 minutes, an improvement of 70%; the difference in the maximum cumulative oil production between the two was only 7m³. 3 The levels were similar, but the proxy-assisted genetic algorithm cumulatively increased oil production by 380.3 m³. 3 This represents a 9.8% increase in oil production compared to the actual production stage, as shown in Table 1.
[0021] Table 1
[0022] Experimental Verification 2 Taking a well in an oil-rich reservoir (with a self-flowing period of 261 days and 8 nozzle replacements) as an example, its self-flowing period was divided into 18 time stages, i.e., 18 optimization steps. A surrogate-assisted genetic algorithm was used to optimize the nozzle size at each stage. The oil production at each stage and the cumulative oil production before and after optimization were compared. Please refer to [link to relevant documentation]. Figure 2-3 .
[0023] The proxy-assisted genetic algorithm initially reduced nozzle size to store energy in the first three stages, then opted for larger (6.0mm) nozzles between days 51 and 71, resulting in a significant increase in single-stage oil production. Subsequent changes in nozzle size were relatively minor, and the stage oil production remained largely unchanged from the original scheme. Overall, the cumulative oil production after optimization using the proxy-assisted genetic algorithm increased by 118.2m compared to the original scheme. 3 This represents a year-on-year increase of 1.33%.
[0024] In terms of computational speed, the surrogate-assisted genetic algorithm increases the initial population size by 10 times and the maximum number of generations by 1 time. Under the condition that the number of optional schemes and the number of optimization stages are increased at the same time, the computational efficiency is still within a controllable range. The total time to complete 20 generations of optimization is less than 30 hours. Imagine if the traditional genetic algorithm were still used for forced optimization, the computation time would inevitably increase exponentially when the single simulation time is long. Overall, the surrogate-assisted genetic algorithm is very suitable and successful for solving the nozzle optimization problem in actual shale oil reservoirs.
[0025] Therefore, this invention adopts the above-mentioned method for optimizing nozzle size during the self-flowing stage of shale oil reservoirs. By constructing an objective function and quantifying constraints, it achieves standardized modeling for nozzle size optimization, avoiding the subjectivity of trial and error. The application of a surrogate-assisted genetic algorithm, relying on initial sample training and prediction verification, replaces high-cost real calculations with a surrogate model. Combined with iteration termination conditions, it significantly reduces the amount of computation and improves optimization efficiency. At the same time, by leveraging the global search characteristics of the genetic algorithm, it avoids local optima and ensures that the final solution has both theoretical optimality and practical feasibility.
[0026] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for optimizing choke size during the flow period of a shale reservoir, characterized in that, The method comprises the following steps: S1, constructing an objective function of oil nozzle size optimization; S2, determining the constraint condition; S3, constructing a proxy-assisted genetic algorithm; S4, obtaining an optimization scheme through the proxy-assisted genetic algorithm.
2. The method of claim 1, wherein, In S1: the shale oil reservoir self-suction period The maximum cumulative oil production in the optimization step as the objective function, the objective function expression is: ; In the formula, Indicates cumulative oil production; This indicates the size of the nozzle during the optimization step; Indicates the number of optimization steps; This represents the oil production during each optimization stage; among which, satisfy: , This indicates the size of the nozzle in the first optimization step. This indicates the size of the nozzle in the second optimization step. This indicates the size of the nozzle in the third optimization step. Indicates the first The size of the nozzle in each optimization step Indicates the first The size of the nozzle in each optimization step.
3. The method of claim 2, wherein, In S2: the constraints include the nozzle size range, which is a discrete set. Let the nozzle size set be... , At the same time satisfy ,in This indicates the first nozzle size available for selection. This indicates the second nozzle size available for selection. This indicates the third nozzle size available for selection. The first option is indicated by the number of options available. One nozzle size.
4. The method of claim 3, wherein, In S3, a random forest algorithm is embedded into a genetic algorithm GA as a proxy model to obtain a proxy-assisted genetic algorithm SAGA.
5. The method of claim 4, wherein, In S4: S41. The surrogate-assisted genetic algorithm maps the nozzle scheme to the nozzle size set in the form of integer encoding. This yields the chromosome form directly invoked by the proxy-assisted genetic algorithm. , ,in This indicates the nozzle used in the first optimization step. In the set of nozzle sizes The corresponding serial number, This indicates the nozzle used in the second optimization step. In the set of nozzle sizes The corresponding serial number, This indicates the nozzle used in the third optimization step. In the set of nozzle sizes The corresponding serial number, Indicates the first The nozzle used in each optimization step In the set of nozzle sizes The corresponding serial number; S42, generating initial population: the agent-assisted genetic algorithm generates initial population according to the coding mode of S41 , wherein denotes the size of the initial population, denotes the chromosome corresponding to the first individual in the initial population, denotes the chromosome corresponding to the second individual in the initial population, denotes the chromosome corresponding to the individual in the initial population; S43, generating an initial sample; S44, training a proxy model; S45, measuring a prediction result; S46, genetic operation; S47, prediction and solution verification; S48, iteration termination: when the prediction result and the solution result in S47 have no improvement for multiple generations, the iteration is stopped, and an optimal oil nozzle size combination scheme is output.
6. The method of claim 5, wherein, In S43, a yield solver is used to perform real yield calculation simulation on all individuals in the initial population to obtain a mapping relationship sample of the individuals and their fitness as the initial sample, and the expression is: ; In the formula, represents a mapping relationship sample of individuals and their fitnesses; represents the first oil nozzle size; represents a certain oil nozzle size corresponding fitness; represents the first of the oil nozzle sizes; represents the initial population size.
7. The method of claim 6, wherein, In S44: training the proxy model by the initial sample , the expression of the final cumulative oil production is obtained by the proxy model prior prediction, ; wherein is a proxy model for the final cumulative oil production; denotes the number of random forest decision trees; denotes the prediction of the th decision tree for the final cumulative oil production.
8. The method of claim 7, wherein, In S45, the variance of the prediction values of different decision trees is used to measure the uncertainty of the prediction, and the expression is: ; In the formula, denotes the variance of the decision tree prediction values.
9. The method of claim 8, wherein, In S46, selection, crossover and mutation operations are performed on the initial population to generate a child population.
10. The method of claim 9, wherein, In S47: select two types of individuals from the offspring population, solve the two types of individuals through the yield solver, predict the remaining individuals through the proxy model, and add the solving results and prediction results to the database of the proxy model, update the proxy model, and iterate; the two types of individuals include individuals with the highest prediction uncertainty and individuals with the highest predicted cumulative oil production The expression for solving two types of individuals is: ; wherein represents the partial individual fitness obtained by solving with the yield solver; The expression for predicting the remaining individuals is: ; In the formula, represents the partial individual fitness predicted by the proxy model.