Multi-phase pipe flow multi-parameter optimization method and system based on genetic algorithm

By decomposing the multiphase pipe flow problem to construct a multi-objective function model and combining it with genetic algorithm optimization, the problems of insufficient adaptability and global search capability of multiphase flow calculation methods under different working conditions are solved, and accurate optimization and stable simulation of multiphase flow parameters are achieved.

CN122072779APending Publication Date: 2026-05-22CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA PETROLEUM & CHEMICAL CORP
Filing Date
2024-11-21
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing multiphase flow calculation methods are difficult to adapt to the changes in different oil and gas fields or pipeline conditions, and genetic algorithms are prone to getting stuck in local optima in multiphase flow optimization, failing to find the global optimum, resulting in unstable optimization results.

Method used

By decomposing the multiphase pipe flow problem, a multi-objective function model is constructed, including the accuracy problems of liquid holdup, friction coefficient, and friction length. A genetic algorithm is used to perform individual encoding, population initialization, crossover, and mutation operations to gradually optimize the multiphase flow calculation model until the target accuracy is met.

Benefits of technology

It improves the accuracy and robustness of multiphase flow calculation, can simultaneously optimize multiple parameters under different operating conditions, avoids local optima, ensures the acquisition of global optima, and improves the stability and accuracy of multiphase flow simulation and control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122072779A_ABST
    Figure CN122072779A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a multiphase pipe flow multi-parameter optimization method and system based on a genetic algorithm, and belongs to the field of multiphase fluid mechanics and oil and gas pipeline engineering. The method comprises the following steps: constructing a corresponding multi-objective function model based on a decomposition problem of a target multi-phase pipe flow problem; wherein the decomposition problem comprises any one or more of a liquid holdup accuracy problem, a friction resistance coefficient accuracy problem and an on-way length accuracy problem; calling a genetic algorithm based on a multi-objective function model, and carrying out individual coding and group initialization operation; executing the genetic algorithm, and executing optimization solution on the multi-objective function model; and repeating iteration until the optimized multiphase pipe flow calculation model meets the target precision, and outputting an individual with the highest fitness as a final optimization result. According to the scheme, the problems that a traditional method cannot give consideration to multi-objective optimization and the global search capability is insufficient are solved, and reliable technical support is provided for simulation and control of oil and gas field multiphase flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of multiphase fluid mechanics and oil and gas pipeline engineering, specifically to a multiphase pipeline flow multi-parameter optimization method based on genetic algorithms and a multiphase pipeline flow multi-parameter optimization system based on genetic algorithms. Background Technology

[0002] In the development of oil and gas fields, the flow of multiphase fluids (including gases, liquids, and solid particles) within pipelines is a common phenomenon. To effectively predict and control the multiphase flow state within oil and gas pipelines, multiphase flow modeling and parameter optimization are necessary. However, due to the highly nonlinear equations and complex physical phenomena involved in multiphase flow, different flow patterns (such as bubbly flow, slug flow, and annular mist flow) exhibit varying characteristics under different pipeline conditions, making existing multiphase flow calculation methods insufficient to meet the needs of various actual operating conditions in oil and gas fields.

[0003] Traditional methods for optimizing multiphase flow parameters are primarily based on experimental or empirical formulas, establishing specific computational relationships for different flow patterns. However, this approach suffers from several major problems in practical applications: First, traditional empirical formulas are usually derived from fitting experimental data under specific conditions, exhibiting significant limitations and failing to adapt to variations in different oil and gas fields or pipeline conditions. Second, multiphase flow computational models typically contain multiple parameters with complex coupling relationships, making accurate predictions difficult using a single empirical formula. Especially when parameters are uncertain or difficult to obtain, the model's accuracy significantly decreases. Furthermore, since multiphase flow parameter optimization involves multiple optimization objectives (such as optimal liquid holdup, optimal friction coefficient, and optimal pressure drop prediction), traditional optimization methods often fail to simultaneously balance multiple objectives, making it difficult to obtain a set of optimized solutions suitable for different operating conditions.

[0004] To address the aforementioned issues, current research has gradually introduced intelligent optimization algorithms, such as genetic algorithms, to optimize multiphase flow parameters under multi-objective conditions through evolutionary computation. However, current genetic algorithms applied to multiphase flow optimization still suffer from high computational costs and slow convergence speeds, particularly in large-scale parameter optimization and real-time applications. Furthermore, genetic algorithms are prone to getting trapped in local optima in high-dimensional problems, failing to find the global optimum and resulting in unstable optimization performance. Therefore, an improved multiphase flow multi-parameter optimization method based on genetic algorithms is urgently needed to enhance the algorithm's convergence and computational efficiency, thereby more accurately simulating multiphase flow conditions within oil and gas pipelines. Summary of the Invention

[0005] The purpose of this invention is to provide a multi-parameter optimization method and system for multiphase pipe flow based on genetic algorithms, so as to at least solve the problem that genetic algorithms are prone to getting stuck in local optima in high-dimensional problems and cannot find the global optimum, resulting in unstable optimization results.

[0006] To achieve the above objectives, the first aspect of the present invention provides a multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm. The method includes: constructing a corresponding multi-objective function model based on a decomposition problem of the target multiphase pipe flow problem; wherein the decomposition problem includes any one or more of the following: liquid holdup accuracy problem, friction coefficient accuracy problem, and friction length accuracy problem; calling a genetic algorithm based on the multi-objective function model to perform individual encoding and population initialization operations; executing the genetic algorithm to optimize and solve the multi-objective function model; repeating the iteration until the optimized multiphase pipe flow calculation model meets the target accuracy, and outputting the individual with the highest fitness as the final optimization result.

[0007] Optionally, the decomposition problem based on the target multiphase pipe flow problem is used to construct a corresponding multi-objective function model, which includes: modeling the liquid holdup accuracy problem, the friction coefficient accuracy problem, and the friction length accuracy problem respectively to obtain multiple sub-models; and coupling the sub-models to obtain the corresponding multi-objective function model.

[0008] Optionally, the sub-model corresponding to the liquid holdup accuracy problem is:

[0009] in, Liquid holdup; The first fitting constant; , , , These are preset parameters; The pipe inclination angle; and These are characteristic parameters for the liquid phase and the gas phase, respectively; and It is the exponential coefficient.

[0010] Optionally, the sub-model for the friction coefficient accuracy problem includes: Sub-models for the flow patterns corresponding to bubbly flow and slug flow, and sub-models for the flow patterns corresponding to annular mist flow; The sub-model for the flow pattern corresponding to the bubbly flow-slug flow is: ; The sub-model corresponding to the annular fog flow is: ; in, Total frictional resistance; These are the second fitting coefficients; It is a dimensionless friction coefficient; The distance along the path; The average velocity of the mixture; The density of the mixture; It is the acceleration due to gravity; The diameter of the pipe; This is the corrected coefficient of friction; The third fitting coefficient; is the friction coefficient of the annular flow.

[0011] Optionally, a genetic algorithm is called based on a multi-objective function model to perform individual encoding and population initialization operations, including: treating each combination of fitting coefficients as an individual and performing individual encoding based on a pre-selected encoding rule; randomly generating a first fitting coefficient and a second fitting coefficient within a preset constraint value range, setting a third fitting coefficient to a custom value, and generating a preset number of individuals as the initial population.

[0012] Optionally, the pre-selected encoding rule can be any one of binary encoding, floating-point encoding, and string encoding; when the currently pre-selected encoding rule is binary encoding, the individual encoding based on the pre-selected encoding rule includes: amplifying each fitting coefficient in each individual by 100 times to obtain amplified values; and encoding the method values ​​based on binary encoding to obtain the corresponding individual codes.

[0013] Optionally, the execution of the genetic algorithm to optimize the multi-objective function model includes: using the error between the calculated and measured values ​​of the wellbore pressure drop as the fitness of an individual, and calculating the fitness of each individual in the initial population; determining the relative fitness of each individual based on its fitness, and performing genetic individual selection based on the relative fitness to obtain multiple genetic individuals; and performing crossover and mutation operations on each genetic individual to obtain new individuals and form a progeny population.

[0014] Optionally, determining the relative fitness of each individual based on their individual fitness, and performing genetic individual selection based on the relative fitness to obtain multiple genetic individuals, includes: obtaining the total fitness based on the individual fitness of each individual, and using the proportion of each individual's fitness within the total fitness as the relative fitness of each individual; allocating sectors of corresponding size to each individual within the sectors corresponding to the total fitness based on their relative fitness; and performing a roulette algorithm based on the allocated sectors, obtaining one genetic individual with each round of the roulette algorithm, until a preset number of genetic individuals are obtained.

[0015] Optionally, the rules for performing crossover on each genetic individual are as follows: randomly select two genetic individuals, and based on the generated random number, exchange the binary code strings corresponding to the random number positions between the two paired genetic individuals to obtain two new individuals; repeat the crossover operation until a preset number of new individuals are obtained.

[0016] Optionally, the rules for performing mutation operations on each genetic individual are as follows: randomly select a genetic individual and determine the mutation position of the corresponding genetic individual based on the generated random number; generate another random number and replace the value of the mutation position based on the newly generated random number to obtain the corresponding new individual; repeat the mutation operation until a preset number of new individuals are obtained.

[0017] Optionally, the iteration is repeated until the optimized multiphase pipe flow calculation model meets the target accuracy, and the individual with the highest fitness is output as the final optimization result. This includes: after each iteration, determining whether the difference between the calculated and measured values ​​of the wellbore pressure drop corresponding to the new offspring population is less than a preset difference threshold; if the difference between the calculated and measured values ​​of the wellbore pressure drop corresponding to the new offspring population is not less than the preset difference threshold, then the initial population is updated and the next iteration is executed; if the difference between the calculated and measured values ​​of the wellbore pressure drop corresponding to the new offspring population is less than the preset difference threshold, then the individual with the highest fitness in the final population is output as the approximate optimal solution to the problem.

[0018] A second aspect of this invention provides a multi-parameter optimization system for multiphase pipe flow based on a genetic algorithm. The system includes: a model building unit for constructing a corresponding multi-objective function model based on a decomposition problem of the target multiphase pipe flow problem; wherein the decomposition problem includes any one or more of the following: liquid holdup accuracy problem, friction coefficient accuracy problem, and friction length accuracy problem; an initialization unit for calling the genetic algorithm based on the multi-objective function model to perform individual encoding and population initialization operations; an execution unit for executing the genetic algorithm to optimize and solve the multi-objective function model; and an output unit for iteratively repeating the process until the optimized multiphase pipe flow calculation model meets the target accuracy, outputting the individual with the highest fitness as the final optimization result.

[0019] A third aspect of the present invention provides a computer-readable storage medium storing instructions which, when executed on a computer, cause the computer to perform the above-described multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm.

[0020] A fourth aspect of the present invention provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described multiphase pipe flow multi-parameter optimization method based on genetic algorithm.

[0021] The fifth aspect of the present invention provides a computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, it implements the above-described multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm.

[0022] Through the above technical solution, this invention decomposes the multiphase pipe flow problem, taking the accuracy of liquid holdup, friction coefficient, and friction length as key optimization objectives, and constructs a multi-objective function model to achieve accurate optimization for multiphase pipe flow systems. A genetic algorithm is used to solve this multi-objective function model, including steps such as individual encoding, population initialization, fitness calculation, selection, crossover, and mutation, ensuring the diversity and stability of the optimization process. During the optimization process, the model accuracy is gradually improved through multiple iterations until the predetermined target accuracy requirement is met. Finally, the individual with the highest fitness is selected as the optimization result, ensuring the accuracy and applicability of the multiphase flow calculation model. This technology significantly improves the accuracy and robustness of the multiphase pipe flow model under different operating conditions, effectively solving the problem that traditional methods cannot simultaneously handle multi-objective optimization and lack global search capabilities, providing reliable technical support for the simulation and control of multiphase flow in oil and gas fields.

[0023] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0024] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the steps of a multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm provided in one embodiment of the present invention; Figure 2 This is a system structure diagram of a multiphase pipe flow multi-parameter optimization system based on a genetic algorithm provided in one embodiment of the present invention. Detailed Implementation

[0025] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0026] Figure 1 This is a flowchart of a multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm, provided by one embodiment of the present invention. Figure 1 As shown, this invention provides a multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm, the method comprising: Step S10: Construct the corresponding multi-objective function model based on the decomposition problem of the target multiphase pipe flow problem.

[0027] Specifically, multiple sub-models are obtained by modeling the accuracy problems of liquid holdup, friction coefficient, and friction length respectively; and the corresponding multi-objective function model is obtained by coupling the sub-models.

[0028] In this embodiment of the invention, accurate flow calculation and prediction are crucial for oil and gas field production management in multiphase pipe flow systems. However, multiphase flow involves different phases such as gas, liquid, and solid, resulting in complex flow patterns and highly nonlinear and coupled relationships between flow parameters, leading to significant computational difficulty and instability. Therefore, to effectively address the parameter optimization problem in multiphase flow, a multi-objective function model construction method based on multiphase pipe flow problem decomposition is proposed. The core of this method lies in decomposing different influencing factors in the multiphase pipe flow problem, independently modeling the accuracy of liquid holdup, friction coefficient, and friction length, and constructing their respective sub-models. Specifically, liquid holdup refers to the proportion of liquid phase in the pipe cross-section, and its accuracy directly affects the accuracy of liquid phase content prediction; friction coefficient is a dimensionless quantity used to describe the resistance of fluid flow in the pipe, and accurate calculation of friction coefficient helps optimize the control of fluid flow resistance; the accuracy of friction length involves the attenuation and transmission characteristics of flow in different pipe sections, and is a key factor in predicting pressure drop and flow pattern distribution. These issues each have a significant impact on multiphase flow. Therefore, when constructing a multi-objective function model, the liquid holdup, friction coefficient, and accuracy of friction length are treated as independent optimization objectives and modeled separately.

[0029] Furthermore, after establishing each sub-model, the objective functions of each sub-model are coupled to form a comprehensive multi-objective optimization function model. This coupling process considers the interactions between parameters and the need for multi-objective balance, enabling the multi-objective optimization function model to better reflect the real operating conditions of multiphase flow systems. Through this coupling process, the generated multi-objective function model can effectively describe the relationships between various key parameters, meeting the computational needs of multiphase flow under different operating conditions.

[0030] Based on the scheme of this invention, the combination of a multi-objective optimization model and a genetic algorithm effectively solves the coupling and nonlinearity problems among multiphase flow parameters, enhancing the applicability and accuracy of the calculation model under different operating conditions. Compared with traditional single optimization or empirical formula methods, this method can optimize multiple parameters simultaneously, ensuring the acquisition of the global optimum and effectively avoiding the trap of local optima. This improves the stability and accuracy of multiphase flow calculation and control in oil and gas fields, providing reliable technical support for decision-making and management in oil and gas field production.

[0031] Specifically, the sub-model corresponding to the liquid holdup accuracy problem is:

[0032] in, Liquid holdup; Let be the first fitting constant; , , , These are preset parameters; The pipe inclination angle; and These are characteristic parameters for the liquid phase and the gas phase, respectively; and It is the exponential coefficient.

[0033] Furthermore, the sub-models for the friction coefficient accuracy problem include: sub-models for the bubbly flow-slug flow flow pattern and sub-models for the annular mist flow flow pattern; the sub-model for the bubbly flow-slug flow pattern is as follows: ; The sub-model corresponding to the annular fog flow is: ; in, Total frictional resistance; These are the second fitting coefficients; It is a dimensionless friction coefficient; The distance along the path; The average velocity of the mixture; The density of the mixture; It is the acceleration due to gravity; The diameter of the pipe; This is the corrected coefficient of friction; The third fitting coefficient; is the friction coefficient of the annular flow.

[0034] Step S20: Call the genetic algorithm based on the multi-objective function model to perform individual encoding and population initialization operations.

[0035] Specifically, each combination of fitting coefficients is treated as an individual, and individual coding is performed based on pre-selected coding rules; the first and second fitting coefficients are randomly generated within the preset constraint value range, and the third fitting coefficient is set to a custom value to generate a preset number of individuals as the initial population.

[0036] Furthermore, the pre-selected encoding rule can be any one of binary encoding, floating-point encoding, and string encoding; when the current pre-selected encoding rule is binary encoding, the individual encoding based on the pre-selected encoding rule includes: amplifying each fitting coefficient in each body by 100 times to obtain amplified values; and encoding the method values ​​based on binary encoding to obtain the corresponding individual codes.

[0037] In this embodiment of the invention, each combination of fitting coefficients is treated as an individual. The fitting coefficients serve as parameters for adjusting the accuracy of the computational model; different combinations of fitting coefficients can achieve the best fit to the multiphase flow parameters. During initialization, the individuals are encoded based on pre-selected encoding rules. Various encoding rules can be chosen, such as binary encoding, floating-point encoding, and string encoding. In this technical solution, binary encoding is preferred because it has higher computational efficiency in genetic algorithms and facilitates crossover and mutation operations.

[0038] Specifically, during individual encoding, the fitting coefficients within each individual are first processed. The first and second fitting coefficients are randomly generated within a preset numerical range (the fluctuation range of the fitting coefficients should be small; in this application, numbers between 0 and 10 are used, rounded to two decimal places. Therefore, the constraint condition for each individual in the genetic algorithm used in this application is 0 to 10) to ensure that the initial population has sufficient diversity and coverage. The third fitting coefficient is set to a fixed value according to the specific needs of the system. This setting method preserves a moderate degree of randomness during population initialization while ensuring the stability of specific parameters, thus laying the foundation for subsequent iterative optimization.

[0039] In the specific encoding process, the fitting coefficients within each individual are first amplified by a factor of 100. This operation improves the precision of the binary encoding and ensures the preservation of decimal information. Then, based on the binary encoding rules, the amplified values ​​are converted into corresponding binary codes. The binary code strings of each individual are concatenated into a symbol string representing the genetic information of that individual. This encoding method not only makes crossover and mutation operations in genetic algorithms easier to implement, but also ensures that the mutation of each fitting coefficient does not lead to a significant loss of numerical precision.

[0040] After encoding, multiple individuals are generated using randomly generated combinations of fitting coefficients, forming an initial population. The population size is a crucial parameter of the genetic algorithm, directly impacting the search space coverage and convergence speed. Typically, the initial population size is set to 50 to 100 individuals to ensure sufficient individuals participate in optimization while maintaining reasonable computational resource consumption, increasing the probability of finding the global optimum. The individuals in the initial population possess diverse gene combinations, giving the genetic algorithm a strong exploratory nature at the start of the search, thus reducing the risk of getting trapped in local optima during the search process.

[0041] Based on this invention, combinations of fitting coefficients are used as individuals, and binary encoding is employed for both individual encoding and population initialization, ensuring the diversity of the initial population and the convergence speed of the algorithm. The application of binary encoding not only improves encoding accuracy but also lays a solid foundation for subsequent crossover and mutation operations. Furthermore, by setting a third fitting coefficient as a fixed value, the variation range of specific parameters can be better controlled, improving the stability and accuracy of the computational model. Compared to traditional encoding and initialization methods, this technical solution achieves more accurate solutions in multiphase flow parameter optimization and effectively improves the algorithm's convergence and global search capabilities. This initialization method ensures the stability and efficiency of the optimization process, enabling the multiphase flow computational model to better adapt to the complex flow conditions of oil and gas fields, thereby improving the modeling accuracy and reliability of multiphase flow systems.

[0042] Step S30: Execute the genetic algorithm to optimize and solve the multi-objective function model.

[0043] Specifically, the error between the calculated and measured values ​​of wellbore pressure drop is used as the fitness of an individual, and the fitness of each initial population is calculated separately. Based on the fitness of each individual, the relative fitness of each individual is determined, and genetic selection is performed based on the relative fitness to obtain multiple genetic individuals. Crossover and mutation operations are performed on each genetic individual to obtain new individuals, which form the offspring population.

[0044] Furthermore, the step of determining the relative fitness of each individual based on their individual fitness, and performing genetic individual selection based on the relative fitness to obtain multiple genetic individuals, includes: obtaining the total fitness based on the individual fitness of each individual, and using the proportion of each individual's fitness within the total fitness as the relative fitness of each individual; allocating sectors of corresponding size to each individual within the sectors corresponding to the total fitness based on their relative fitness; and performing a roulette algorithm based on the allocated sectors, obtaining one genetic individual for each round of the roulette algorithm, until a preset number of genetic individuals are obtained.

[0045] Furthermore, the rules for performing crossover operations on each genetic individual are as follows: randomly select two genetic individuals, and based on the generated random numbers, exchange the binary encoded strings corresponding to the random numbers between the two paired genetic individuals to obtain two new individuals; repeat the crossover operation until a preset number of new individuals are obtained.

[0046] Furthermore, the rules for performing mutation operations on each genetic individual are as follows: randomly select a genetic individual and determine the mutation position of the corresponding genetic individual based on the generated random number; generate another random number and replace the value of the mutation position based on the newly generated random number to obtain the corresponding new individual; repeat the mutation operation until a preset number of new individuals are obtained.

[0047] In this embodiment of the invention, the error between the calculated and measured wellbore pressure drop is used as the fitness of an individual. Fitness is a key indicator in genetic algorithms, used to evaluate the performance of each individual. Specifically, for each individual in the initial population, the error between its predicted and actual wellbore pressure drop is calculated. The smaller the error, the higher the fitness, indicating a better fit for the individual. Based on this, the fitness of all individuals in the population is calculated to evaluate the overall performance of the population.

[0048] Furthermore, based on the fitness of each individual, the relative fitness of each individual is determined, and the selection of genetic individuals is based on the relative fitness. The selection operation in genetic algorithms typically employs a roulette wheel algorithm, allocating the selection probability of genetic individuals through relative fitness. The specific operation is as follows: First, the total fitness of all individuals in the initial population is calculated, and the relative fitness of each individual is determined based on its proportion to the total fitness. Then, the total fitness is divided into a disk, with each individual's relative fitness corresponding to a sector of that disk. By randomly generating a number, individuals falling within a certain sector are selected as genetic individuals. Each round of the roulette wheel algorithm yields one genetic individual; this process is repeated until a predetermined number of genetic individuals are obtained.

[0049] For example, suppose the initial population has five individuals with fitness values ​​of 20, 30, 40, 10, and 50, for a total fitness of 150. The corresponding relative fitness values ​​are 0.13, 0.2, 0.27, 0.07, and 0.33. A disk is partitioned based on relative fitness, with each individual's sector size proportional to its relative fitness. Using a roulette wheel algorithm, individuals with higher fitness are selected for the next generation, increasing their genetic probability and thus improving the overall optimization efficiency of the population.

[0050] Furthermore, after the selection operation, a crossover operation is performed on each genetic individual to generate new individuals and increase population diversity. The rules for the crossover operation are as follows: two genetic individuals are randomly selected for pairing, a random number is generated, and the binary code strings of the paired individuals are swapped at random positions to obtain two new individuals. The crossover operation combines the advantageous characteristics of different individuals through gene recombination, generating new individuals and thus improving population diversity and exploratory activity. For example, assuming the binary codes of two genetic individuals are "101010" and "110011" respectively, and the randomly generated crossover position is the third bit, then swapping the parts after the third bit will generate new individuals "101011" and "110010".

[0051] Building upon crossover, to further increase population diversity, mutation is performed on each genetic individual. The rules for mutation are as follows: randomly select a genetic individual, determine its mutation position based on a generated random number, and then generate another random number to replace the value at that position, thus generating a new individual. Mutation is crucial in genetic algorithms, preventing the algorithm from getting trapped in local optima. By modifying local gene positions of certain individuals, the randomness and diversity of the population are increased, ensuring the algorithm's global search capability. For example, assuming the binary code of a genetic individual is "101010", and the randomly generated mutation position is the second bit, the new individual's code after mutation might be "111010".

[0052] After completing the selection, crossover, and mutation operations described above, the new individuals constitute the offspring population. The offspring population inherits the superior characteristics of the highly fit individuals in the parent generation and further optimizes the overall performance of the population by introducing new gene combinations through crossover and mutation.

[0053] Based on the scheme of this invention, this optimization method effectively improves the accuracy and convergence speed of multiphase flow parameter optimization through selection, crossover, and mutation operations of a genetic algorithm. Compared with traditional single optimization methods, this method performs better in global search and multi-objective balance, and can handle nonlinear and coupled relationships in multiphase flows. In roulette wheel selection, by assigning higher selection probabilities to individuals with higher fitness, the genetic algorithm can prioritize the retention of individuals with superior performance; by increasing the diversity of the population through crossover and mutation operations, the algorithm can escape local optima and find the global optimum. Taking multiphase flow calculation in oil and gas fields as an example, this scheme can still obtain accurate wellbore pressure drop predictions under conditions of large variations in flow conditions, significantly improving the applicability and accuracy of multiphase flow models, and providing reliable technical support for oil and gas pipeline flow management and optimization.

[0054] Step S40: Repeat the iteration until the optimized multiphase pipe flow calculation model meets the target accuracy, and output the individual with the highest fitness as the final optimization result.

[0055] Specifically, after each iteration, it is determined whether the difference between the calculated and measured values ​​of the wellbore pressure drop corresponding to the new offspring population is less than a preset difference threshold. If the difference between the calculated and measured values ​​of the wellbore pressure drop corresponding to the new offspring population is not less than the preset difference threshold, the initial population is updated and the next iteration is executed. If the difference between the calculated and measured values ​​of the wellbore pressure drop corresponding to the new offspring population is less than the preset difference threshold, the individual with the highest fitness in the final population is output as the approximate optimal solution to the problem.

[0056] In this embodiment of the invention, after each iteration, the algorithm determines whether the difference between the calculated and measured values ​​of the wellbore pressure drop meets a preset difference threshold based on the calculation results of the current offspring population. This difference threshold is a measure of optimization accuracy, ensuring that the error of the multiphase flow calculation model is within an acceptable range to meet the accuracy requirements of engineering applications.

[0057] In each iteration, the genetic algorithm generates a new offspring population through selection, crossover, and mutation operations, progressively optimizing the individuals within the population. Each individual in the offspring population represents a combination of fitting coefficients. By solving a multiphase flow calculation model on this model, a corresponding predicted wellbore pressure drop value can be obtained. This predicted value is then compared with the actual measured wellbore pressure drop to calculate the error. If the difference between the calculated and measured wellbore pressure drop value of the individual with the highest fitness in the new offspring population is still greater than a preset threshold, it indicates that the accuracy of the current solution has not yet reached the expected level. At this point, the algorithm updates the current offspring population into a new initial population and enters the next iteration.

[0058] This iterative process continues, and the algorithm gradually selects individuals with higher fitness. After multiple rounds of optimization and evolution, the individuals in the population will continuously approach the global optimum. When a certain round of iteration is completed, if the difference between the calculated and measured values ​​of the wellbore pressure drop in the new offspring population is less than a preset threshold, it indicates that the accuracy of the current solution has met the requirements. At this point, the algorithm outputs the individual with the highest fitness in the final population as the approximate optimal solution to the multiphase pipe flow calculation problem.

[0059] For example, in practical applications of oil and gas pipeline flow optimization, if the set error threshold is 5%, meaning the error between the calculated and measured wellbore pressure drop is less than 5%, the optimization is considered to have reached the target accuracy. Then, through the iterative optimization process of the genetic algorithm, the fitness of the population gradually increases. When, in a certain iteration, an individual with the highest fitness is found, and its error is below 5%, the algorithm stops iterating and outputs the parameter combination of that individual as the final optimization result.

[0060] Based on the scheme of this invention, through iterative optimization, the multiphase pipe flow calculation model can gradually approximate the actual wellbore pressure drop value, ensuring the accuracy of the optimization results. By judging the error in each iteration, the algorithm can dynamically adjust the optimization process, avoiding excessive ineffective iterations that waste computational resources while ensuring the accuracy of the final result. Simultaneously, by outputting the individual with the highest fitness as the final optimized solution, the global search capability of the genetic algorithm is guaranteed, making the multiphase flow model highly applicable and stable under different flow conditions. This scheme can effectively improve the modeling accuracy of multiphase flow systems, is suitable for parameter optimization in complex multiphase fluid flow scenarios such as oil and gas fields, and provides reliable data support for flow control and management.

[0061] Figure 2 This is a system structure diagram of a multiphase pipe flow multi-parameter optimization system based on a genetic algorithm provided in one embodiment of the present invention. (See diagram below.) Figure 2 As shown, this invention provides a multi-parameter optimization system for multiphase pipe flow based on a genetic algorithm. The system includes: a model building unit, used to construct a corresponding multi-objective function model based on the decomposition problem of the target multiphase pipe flow problem; wherein the decomposition problem includes any one or more of the following: liquid holdup accuracy problem, friction coefficient accuracy problem, and friction length accuracy problem; an initialization unit, used to call the genetic algorithm based on the multi-objective function model to perform individual encoding and population initialization operations; an execution unit, used to execute the genetic algorithm to optimize and solve the multi-objective function model; and an output unit, used to iterate repeatedly until the optimized multiphase pipe flow calculation model meets the target accuracy, and output the individual with the highest fitness as the final optimization result. A third aspect of the present invention provides a computer-readable storage medium storing instructions which, when executed on a computer, cause the computer to perform the above-described multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm.

[0062] A fourth aspect of the present invention provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described multiphase pipe flow multi-parameter optimization method based on genetic algorithm.

[0063] The fifth aspect of the present invention provides a computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, it implements the above-described multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm.

[0064] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0065] The optional embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details described above. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe the various possible combinations.

[0066] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the embodiments of the present invention, they should also be regarded as the content disclosed by the embodiments of the present invention.

Claims

1. A multi-parameter optimization method for multiphase pipe flow based on genetic algorithm, characterized in that, The method includes: A multi-objective function model is constructed based on the decomposition problem of the objective multiphase pipe flow problem; whereby... The decomposition problem includes any one or more of the following: liquid holdup accuracy problem, friction coefficient accuracy problem, and friction length accuracy problem; The genetic algorithm is invoked based on a multi-objective function model to perform individual encoding and population initialization operations. The genetic algorithm is executed to optimize and solve the multi-objective function model. Repeat the iteration until the optimized multiphase pipe flow calculation model meets the target accuracy, and output the individual with the highest fitness as the final optimization result.

2. The method according to claim 1, characterized in that, The decomposition problem based on the objective multiphase pipe flow problem constructs a corresponding multi-objective function model, including: Multiple sub-models are obtained by modeling the accuracy problems of liquid holdup, friction coefficient, and friction length separately. The corresponding multi-objective function model is obtained by coupling the sub-models.

3. The method according to claim 2, characterized in that, The sub-model corresponding to the liquid holdup accuracy problem is: in, Liquid holdup; Let be the first fitting constant; , , , These are preset parameters; The pipe inclination angle; and These are characteristic parameters for the liquid phase and the gas phase, respectively; and It is the exponential coefficient.

4. The method according to claim 2, characterized in that, The sub-model for the friction coefficient accuracy problem includes: Sub-models for the flow patterns corresponding to bubbly flow and slug flow, and sub-models for the flow patterns corresponding to annular mist flow; The sub-model for the flow pattern corresponding to the bubbly flow-slug flow is: ; The sub-model corresponding to the annular fog flow is: ; in, Total frictional resistance; These are the second fitting coefficients; It is the dimensionless friction coefficient; The distance along the path; The average velocity of the mixture; The density of the mixture; It is the acceleration due to gravity; The diameter of the pipe; This is the corrected coefficient of friction; The third fitting coefficient; is the friction coefficient of the annular flow.

5. The method according to claim 1, characterized in that, The genetic algorithm is invoked based on a multi-objective function model to perform individual encoding and population initialization operations, including: Each combination of fitting coefficients is treated as an individual, and individual coding is performed based on pre-selected coding rules; Within a preset constraint range, a first and a second fitting coefficient are randomly generated, and a third fitting coefficient is set to a custom value. A preset number of individuals are then generated as the initial population.

6. The method according to claim 5, characterized in that, The pre-selected encoding rule is any one of binary encoding, floating-point encoding, and string encoding; When the currently selected encoding rule is binary encoding, the individual encoding based on the selected encoding rule includes: Each fitting coefficient in each body is magnified by 100 times to obtain the magnified value; The numerical values ​​of the method are encoded based on binary encoding to obtain the corresponding codes for each entity.

7. The method according to claim 5, characterized in that, The execution of the genetic algorithm to optimize and solve the multi-objective function model includes: The magnitude of the error between the calculated and measured values ​​of wellbore pressure drop is used as the fitness of an individual, and the fitness of each initial population is calculated separately. The relative fitness of each individual is determined based on its individual fitness, and genetic selection is performed based on the relative fitness to obtain multiple genetic individuals. Perform crossover and mutation operations on each genetic individual to obtain new individuals and form the offspring population.

8. The method according to claim 7, characterized in that, The relative fitness of each individual is determined based on its individual fitness, and genetic individual selection is performed based on the relative fitness to obtain multiple genetic individuals, including: The total fitness is obtained based on the individual fitness of each individual, and the relative fitness of each individual is obtained based on the proportion of the individual fitness of each individual in the total fitness. Based on the relative fitness of each individual, sectors of corresponding size are allocated to each individual within the sectors corresponding to the total fitness. The roulette algorithm is executed based on the allocated sectors. Each round of the roulette algorithm yields a genetic individual, until a preset number of genetic individuals are obtained.

9. The method according to claim 7, characterized in that, The rules for performing crossover operations on each genetic individual are as follows: Choose any two genetic individuals, and based on the generated random numbers, swap the binary encoded strings at the corresponding positions of the random numbers between the two paired genetic individuals to obtain two new individuals; Repeat the crossover operation until a preset number of new individuals are obtained.

10. The method according to claim 7, characterized in that, The rules for performing mutation operations on each genetic individual are as follows: Randomly select a genetic individual and determine the mutation location of the corresponding genetic individual based on the generated random number; Generate another random number, and replace the value at the mutation position with the newly generated random number to obtain the corresponding new individual; Repeat the mutation operation until a preset number of new individuals are obtained.

11. The method according to claim 1, characterized in that, Repeat the iteration until the optimized multiphase pipe flow calculation model meets the target accuracy, and output the individual with the highest fitness as the final optimization result, including: After each iteration, it is determined whether the difference between the calculated and measured values ​​of the wellbore pressure drop corresponding to the new offspring population is less than a preset difference threshold. If the difference between the calculated and measured wellbore pressure drop corresponding to the new offspring population is not less than the preset difference threshold, then the initial population is updated and the next iteration is executed. If the difference between the calculated and measured wellbore pressure drop corresponding to the new offspring population is less than the preset difference threshold, then the individual with the highest fitness in the final population is output as the approximate optimal solution to the problem.

12. A multi-parameter optimization system for multiphase pipe flow based on a genetic algorithm, characterized in that, The system includes: The model building unit is used to construct a corresponding multi-objective function model based on the decomposition problem of the target multiphase pipe flow problem; wherein, The decomposition problem includes any one or more of the following: liquid holdup accuracy problem, friction coefficient accuracy problem, and friction length accuracy problem; The initialization unit is used to call the genetic algorithm based on the multi-objective function model to perform individual encoding and population initialization operations; The execution unit is used to execute the genetic algorithm and perform optimization solutions on the multi-objective function model; The output unit is used for repeated iterations until the optimized multiphase pipe flow calculation model meets the target accuracy, and the individual with the highest fitness is output as the final optimization result.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the multi-parameter optimization method for multiphase pipe flow based on a genetic algorithm as described in any one of claims 1-11.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the multi-parameter optimization method for multiphase pipe flow based on genetic algorithm as described in any one of claims 1-11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the multi-parameter optimization method for multiphase pipe flow based on genetic algorithm as described in any one of claims 1-11.