Method for screening valve closing schemes of gravity-flow water conveyance pipelines optimized based on genetic algorithm
By using feature line method and genetic algorithm to optimize the water hammer protection solution for multi-stage closing valve curve and gas valve in long-distance gravity flow water transfer engineering, the safety threat of water hammer phenomenon to the water supply system is solved, and a more efficient water hammer protection effect is achieved.
Patent Information
- Application Number
- CN202111160917.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Unreasonable end valve closure schemes in long-distance gravity flow water transfer projects lead to water hammer phenomenon, endangering the safety of the water supply system, and the existing technology has not seen any research on the selection of the optimal number of stages for multi-stage valve closure schemes.
The hydraulic transient calculation model based on the feature line method is adopted, and the water hammer protection scheme used in combination with the genetic algorithm is optimized and calculated for the multi-stage closing valve curve and the gas valve, and the optimal number of stages of the closing valve curve is selected.
The valve closing scheme of long-distance gravity flow water supply pipelines has been effectively optimized, the complexity of the water hammer protection scheme has been reduced, the calculation success rate has been improved, and the overall characteristics and rules of the optimized valve closing curve have been obtained.
Smart Images

Figure CN113887042B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of urban water supply system safety and energy conservation, and particularly relates to a method for optimizing the screening of water supply pipeline valve closing schemes. Background Art
[0002] Long-distance gravity flow water conveyance projects are an effective means to solve the problem of uneven spatial distribution of fresh water resources in some regions of our country. However, unreasonable end valve closing schemes are one of the important reasons for water hammer occurrence and endangerment of the safety of the water supply system. For the problem of optimizing the valve closing curve of long-distance water conveyance projects, there are currently two common design methods: the empirical method and the algorithm optimization method. Typical methods of the empirical method, such as the enumeration method and the orthogonal experiment method, have limited calculation times and poor representativeness, and it is not easy to obtain the global optimal scheme. The algorithm optimization method based on intelligent optimization algorithms is easy to obtain the global optimal scheme, but there is no report on the research of selecting the best number of stages for multi-stage valve closing schemes using this method at present. Summary of the Invention
[0003] In view of the above problems, the technical solution of the present invention proposes a hydraulic transient calculation model based on the characteristic line method, and uses the genetic algorithm to optimize and calculate the water hammer protection scheme combined with multi-stage valve closing curves and air valves respectively, and obtains a method for selecting the best number of stages of valve closing curves.
[0004] The technical solution of the present invention to achieve the above object is as follows.
[0005] A method for optimizing the screening of gravity flow water conveyance pipeline valve closing schemes based on the genetic algorithm, comprising the following steps:
[0006] Step 1, establish a hydraulic transient calculation model for a long-distance gravity flow water conveyance pipeline based on the basic differential equation of water hammer calculation and the characteristic line method;
[0007] Step 2, optimize and design the valve closing curve and the air valve layout scheme based on the genetic algorithm;
[0008] Step 3, repeat the optimization calculation for valve closing schemes with different total valve closing times, count the optimization results, and determine the best valve closing time;
[0009] Step 4, repeat the optimization calculation for valve closing schemes with different numbers of stages based on the best valve closing time, count the optimization results, and determine the best number of stages of the valve closing curve;
[0010] Step 5, statistically analyze the optimization results based on the best number of stages of the valve closing curve, observe the morphological rules of the optimized valve closing curve, merge decision variables with similar values to obtain a simplified valve closing curve, and verify the protection effect of the simplified valve closing curve to obtain the finally optimized gravity flow water conveyance pipeline valve closing scheme.
[0011] Based on the basic differential equation of water hammer calculation and the method of characteristics, a hydraulic transient calculation model is programmed in MATLAB. After inputting data such as the horizontal position and elevation, flow rate, pipe diameter, and inflection point parameters of the valve closing curve of each node of the water conveyance pipeline, the water head at any moment within the total simulation time of each node can be calculated through this model.
[0012] In the hydraulic transient calculation model of the method of the present invention, when the area of the water pool is much larger than the area of the pipeline, the influence of the water volume change during the transient process on the water level of the water pool can be ignored. If the water levels of the upstream and downstream water pools are H R1 and H R(N+1) , respectively, then the node water heads at the starting point and the ending point of the pipeline are H1 = H R1 and H N+1 = H R(N+1) . To meet the requirement of the design flow rate, a flow control valve is installed at the ending point of the pipeline, and the pipeline flow rate is maintained at Q0 and remains unchanged during steady-state operation.
[0013] Adopting the hydraulic transient calculation model described in the method of the present invention, since the valve closing operation will cause the local pressure in the pipeline to decrease, and thus it is possible to generate a water column separation and closing water hammer. Arranging air valves in advance at these positions can effectively prevent the occurrence of the water column separation and closing water hammer phenomenon. When the node pressure is less than the atmospheric pressure, the air valve intakes air, the water column is separated, and the nodes all maintain the local pressure unchanged. When the length of the air bag begins to shorten, the air valve closes, and according to the ideal gas state equation, the air bag is compressed.
[0014] The method of the present invention has good effects and can reduce the dimension of the genetic algorithm objective function, narrow the search space, reduce the optimization complexity, and improve the calculation success rate. At the same time, this method can obtain the overall characteristics and laws of the optimized valve closing curve, and has significant technical advantages in determining the water hammer protection scheme for long-distance gravity flow water conveyance pipelines. Description of the Drawings
[0015] Figure 1 It is a description diagram of the variables of different valve closing schemes of the present invention.
[0016] Figure 2 It is a flow chart of the screening method for optimizing the valve closing scheme of the gravity flow water conveyance pipeline based on the genetic algorithm.
[0017] Figure 3 It is the general plan and longitudinal section of the water supply pipeline.
[0018] Figure 4 It is the genetic algorithm optimization result of the two-stage valve closing scheme.
[0019] Figure 5 It is the genetic algorithm optimization result of the three-stage valve closing curve.
[0020] Figure 6It is the optimization result of the genetic algorithm for the four-stage valve closing curve.
[0021] Figure 7 It is the optimization result of the genetic algorithm for the three-stage valve closing curve with a plateau period. Detailed implementation manners
[0022] The present invention uses a genetic algorithm to optimize the valve closing scheme. The genetic algorithm is commonly used to solve the optimal solution under single-factor or multi-factor conditions. Inspired by the natural population evolution law, this algorithm applies the biological population evolution ideas of random mutation and survival of the fittest to program design, mainly including stages such as selection, crossover, and mutation.
[0023] The related concepts involved in the present invention are as follows:
[0024] Gene and individual: A feasible solution to the problem is called an "individual" (also known as a "chromosome"). A feasible solution is generally composed of multiple elements, and each of these elements is called a "gene" on the individual (chromosome). In the present invention, the individual (chromosome) refers to different valve closing curves, and the inflection point coordinates of the valve closing curve are used as the genes of the individual (chromosome).
[0025] Population: A collection of individuals. In the present invention, the population refers to the collection of all valve closing curves within the same generation.
[0026] Population size: The number of individuals in the same population. When the population size takes a larger value, the population diversity is higher, which is beneficial to avoiding falling into local optimal solutions, but the program calculation amount is larger. In the present invention, the population size refers to the number of different valve closing curves within the same generation.
[0027] Initial population: The genetic algorithm starts iteration with the initial population as the starting point. In the present invention, the initial population is generated by randomly assigning values to the inflection points of the valve closing curve.
[0028] Genetic operator: It includes selection, where the optimized individuals are paired and crossed to generate new individuals and then inherited to the next generation; crossover, where according to the crossover rate, some individuals in the parent generation are randomly exchanged with each other for some genes to generate new gene combinations; mutation, where according to the mutation rate, some gene positions of some individuals in the population are changed.
[0029] Offspring population: The genetic algorithm is an iterative search algorithm. The previous generation population (parent population) generates the next generation population (offspring population) through selection, crossover, and mutation.
[0030] Evolutionary algebra: The genetic algorithm gradually approaches the optimal solution through multiple evolutions, so it is necessary to determine the stopping condition. The most commonly used stopping condition is to specify the number of generations of inheritance, that is, the evolutionary algebra.
[0031] Compared with traditional optimization algorithms such as the enumeration method and the gradient descent method, it has the advantages of fast convergence speed and being more likely to avoid local optimal solutions. In the present invention, the genetic algorithm is called by using the GAOT library in MATLAB.
[0032] In the preferred technical solution of the present invention, the individuals of the genetic algorithm are defined as different valve closing procedures. Figure 1 This is a description diagram of the variables of different valve closing schemes of the present invention. Figure 1 In (a), it shows the variation of the valve opening with time in the one-stage valve closing scheme, and in (b), it shows the schematic variation of the valve opening with time in the three-stage valve closing scheme. For a multi-stage valve closing scheme where n is greater than 2, n is a positive integer greater than 1, and t c is the total valve closing time. The abscissa t1 to t of the inflection point is selected n and the ordinate y1 to y n A total of 2n decision variables are selected.
[0033] In the preferred technical solution of the present invention, the objective function of the genetic algorithm is defined according to Formula (6) and Formula (7). This is mainly because the objective function is used to evaluate the fitness of individuals in the genetic algorithm. The smaller the objective function, the more dominant the corresponding individual is in the population evolution process of survival of the fittest. The objective function is set as the combination of the fitness function and the penalty function. By setting appropriate penalty coefficients, the genetic algorithm can avoid the schemes that do not meet the constraint conditions during the evolution process, which can not only meet the requirements of water hammer protection but also minimize the pressure fluctuation in the pipeline as much as possible.
[0034] In the preferred technical solution of the present invention, the algorithms selected for the population initialization, selection, crossover, and mutation operation processes should be consistent and appropriate, and the settings of the relevant parameters in the algorithms should also be consistent and appropriate. Through preliminary pre-experiments, the present invention finally selects the population size of the genetic algorithm to be 50, the method of selecting excellent individuals is the roulette wheel selection method, the crossover method is arithmetic crossover, the mutation method is the non-uniform mutation function, and the number of evolution generations is 50 generations.
[0035] In the preferred technical solution of the present invention, the selection basis of the population size refers to the prior art "Practical Genetic Algorithms" (See: Haupt R L, Haupt S E. Practical Genetic Algorithms [M]. John Wiley & Sons, Inc., 2003.). It is more appropriate to control the population size between 20 and 100.
[0036] The optimization model process of the valve closing scheme for long-distance gravity flow water conveyance pipelines based on the genetic algorithm is as follows Figure 2As shown in the figure, specifically: ① Input parameters such as terrain, pipe diameter, pipe material, water hammer wave velocity, etc.; ② Define the objective function; ③ Create an initial population by randomly generating the inflection point parameters of the valve closing curve; ④ Calculate the water head at each node under steady-state conditions; ⑤ Calculate the water head at each node at any time under transient conditions and determine whether an air valve is installed; ⑥ Calculate the values of the objective function for all individuals in the initial population according to formulas (6) and (7); ⑦ Convergence control of the genetic algorithm. If it converges, go to step ⑨. If it does not converge, continue; ⑧ The genetic algorithm generates a child population through crossover and mutation and returns to step ④; ⑨ Select the best individual in the population as the optimized best valve closing curve.
[0037] The length of the total valve closing time has a great influence on the water hammer protection effect. When the total valve closing time is too short, the water hammer protection effect cannot meet the safety requirements. When the total valve closing time is too long, the harm of the water hammer effect to the system safety is relatively small, and the selection of the valve closing scheme is relatively simple, but it conflicts with the requirements for the valve closing time in engineering practice. After preliminary investigation, the total valve closing time of common pipelines is about 30s.
[0038] To find a more appropriate total valve closing time, various valve closing schemes are optimized with 25, 30, 35, and 40s as the total valve closing time respectively. To eliminate the influence of randomness on the results, this step is repeated 100 times and the results are statistically analyzed to obtain the relationship between the total valve closing time, the type of valve closing curve, and the optimization success rate, and then the best valve closing time is obtained.
[0039] In the preferred technical solution of the present invention, as the number of stages of the valve closing curve increases, the dimension of the objective function of the genetic algorithm increases, the search space expands, and the optimization complexity improves. In order to minimize the optimization complexity under the condition of good water hammer protection effect, the two-stage, three-stage, four-stage, five-stage, and six-stage valve closing schemes are optimized based on the best valve closing time respectively. To eliminate the influence of randomness on the results, this step is repeated 100 times and the results are statistically analyzed. On the premise that there is no obvious advantage in the optimization success rate and the number of air valves called for the valve closing curve with more stages, considering from the perspective of ensuring the system operation process and the simplicity of program calculation, the valve closing curve with fewer stages is preferably selected.
[0040] In the preferred technical solution of the present invention, the optimization results based on the best valve closing curve number are statistically analyzed, the morphological rules of the optimized valve closing curve are observed, and the decision variables with similar values are merged to narrow the search space and reduce the optimization complexity.
[0041] To verify the water hammer protection effect of the simplified valve closing curve, first, the valve closing curve is optimized based on the best valve closing time and the simplified valve closing curve scheme. To eliminate the influence of randomness on the results, this step is repeated 100 times and parameters such as the optimization success rate and the number of air valves called are statistically analyzed.
[0042] To further verify the water hammer protection effect of the simplified valve closing curve, an optimized successful case based on the unsimplified multi-stage scheme was simplified and brought into the water hammer calculation model, and the distribution of the frequency of the fitness change degree of each case based on the simplified scheme was statistically analyzed.
[0043] The present invention will be further described below in conjunction with the accompanying drawings and specific examples.
[0044] Figure 2 This is a flowchart of the screening method for optimizing the valve closing scheme of a gravity flow water conveyance pipeline based on the genetic algorithm of the present invention. As Figure 2 shown, the screening method for optimizing the valve closing scheme of a gravity flow water conveyance pipeline based on the genetic algorithm of the present invention includes the following steps:
[0045] Step 1, establish a hydraulic transient calculation model for a long-distance gravity flow water conveyance pipeline based on the basic differential equation of water hammer calculation and the method of characteristics;
[0046] Step 2, optimize the design of the valve closing curve and the air valve layout scheme based on the genetic algorithm;
[0047] Step 3, repeat the optimization calculation for valve closing schemes with different total valve closing times, statistically analyze the optimization results, and determine the optimal valve closing time;
[0048] Step 4, repeat the optimization calculation for valve closing schemes with different numbers of stages based on the optimal valve closing time, statistically analyze the optimization results, and determine the optimal number of valve closing curve segments;
[0049] Step 5, statistically analyze the optimization results based on the optimal number of valve closing curves, analyze the characteristics of the valve closing curves, merge decision variables with similar values to obtain a simplified valve closing curve, verify the protection effect of the simplified valve closing curve, prove its effectiveness, and obtain the final optimized valve closing scheme for the gravity flow water conveyance pipeline.
[0050] Furthermore, the said Step 1 includes the following sub-steps:
[0051] Step 101, the basic differential equation of water hammer calculation includes the continuity equation and the motion equation, as shown in formulas (1) and (2) respectively:
[0052]
[0053]
[0054] In the formula: H = Z + P / (ρg), where Z is the elevation of the pipeline axis, m; P is the pressure, Pa; ρ is the liquid density, kg / m3; g is the acceleration due to gravity, m / s 2 ; x is the length of the pipeline along the axis direction, m; a is the water hammer wave speed in the pipeline, m / s; t is the transient time, s; θ is the angle between the pipeline axis and the horizontal plane, °; $v$ is the average flow velocity of the fluid in the pipeline, m / s; $\lambda$ is the friction coefficient along the path; $D$ is the inner diameter of the pipeline, m.
[0055] Step 102: Transform and simplify the basic differential equation by the method of characteristics to obtain the compatibility equations (3) that are easy to be programmed into MATLAB:
[0056]
[0057] Therefore,
[0058]
[0059] In the formula, $B$, $C$ p and $C$ M are calculation coefficients, which are respectively:
[0060]
[0061] In the formula: $A$ is the cross-sectional area of the pipeline, m 2 ; $f$ is the resistance coefficient; $\Delta x$ is the distance step of the pipeline, m; $H$ pi is the water head of the $i$-th node at this moment, m; $Q$ pi is the flow rate of the $i$-th node at this moment, m 3 / s; $H$ i-1 and $H$ i+1 are respectively the water heads of the $(i - 1)$-th and $(i + 1)$-th nodes at the previous moment, m; $Q$ i-1 and $Q$ i+1 are respectively the flow rates of the $(i - 1)$-th and $(i + 1)$-th nodes at the previous moment, m 3 / s; $a$ is the water hammer wave velocity in the pipeline, m / s; $t$ is the transient time, s; $g$ is the acceleration of gravity, m / s 2 ; $D$ is the inner diameter of the pipeline, m.
[0062] Step 103: Determine the basic boundary conditions
[0063] When the area of the water pool is much larger than the area of the pipeline, the influence of the water volume change in the transient process on the water level of the water pool can be ignored. If the water levels of the upstream and downstream water pools are $H$ R1 and $H$ R(N+1) respectively, then the node water heads at the starting point and the ending point of the pipeline are $H_1 = H$ R1 and $H$ N+1 $ = H$ R(N+1) . To meet the requirements of the design flow rate, a flow control valve is installed at the end of the pipeline, and the flow rate of the pipeline remains unchanged at $Q_0$ during steady-state operation.
[0064] Closing the valve will cause a local pressure drop in the pipeline, which may in turn generate a closing water hammer. Arranging air valves at these positions in advance can effectively prevent the occurrence of closing water hammers. When the node pressure is less than the atmospheric pressure, the air valve admits air, the water column breaks, and the nodes all maintain the local pressure unchanged. When the length of the airbag begins to shorten, the air valve closes, and according to the ideal gas state equation, the airbag is compressed.
[0065] Further, step 2 includes the following sub-steps:
[0066] Step 201, define the decision variables of the genetic algorithm as different valve closing procedures. In the multi-stage valve closing scheme, the variation of the valve opening with time is as Figure 1 shown, where n is a positive integer greater than 1, and t c is the total valve closing time, which is manually set before the program runs. Therefore, select the abscissas t1 to t n and the ordinates y1 to y n for a total of 2n decision variables.
[0067] Step 202, in order to not only meet the requirements of water hammer protection but also minimize the pressure fluctuation in the pipeline, set the objective function as:
[0068] F = Fitness + M1PF1 + M2PF2 (6)
[0069] In the formula: Fitness is the fitness; PF1 and PF2 are the maximum water hammer pressure rise constraint and the minimum water hammer pressure drop constraint respectively; M1 and M2 are the penalty coefficients corresponding to the constraint conditions. When the water heads of all nodes are within the allowable range, the penalty functions PF1 and PF2 are both 0. By setting appropriate penalty coefficients, the genetic algorithm can avoid solutions that do not meet the constraint conditions during the evolution process.
[0070] Where
[0071]
[0072] In the formula: i is the node number, i = 1, 2, 3,..., N + 1; H a,max (i), H a,min (i) are the maximum and minimum water heads that each node of the pipeline can withstand, in m; H max (i), H min (i) are the maximum and minimum water heads that appear during the simulation process for each node of the pipeline, in m.
[0073] Step 203: Determine the population size, that is, determine the number of different valve closing curves in the same generation. The algorithms selected for the processes of population initialization, selection, crossover, and mutation operations should be consistent and appropriate, and the settings of relevant parameters in the algorithms should also be consistent and appropriate. Through preliminary pre-experiments, the present invention finally selects the population size of the genetic algorithm to be 50, the method for selecting excellent individuals is the roulette wheel selection method, the crossover method is arithmetic crossover, the mutation method is the non-uniform mutation function, and the number of evolution generations is 50 generations.
[0074] Step 204: Optimize the valve closing scheme for the long-distance gravity flow water conveyance pipeline based on the genetic algorithm: ① Input parameters such as terrain, pipe diameter, pipe material, water hammer wave velocity, etc.; ② Define the objective function; ③ Generate an initial population using the inflection point parameters of the valve closing curve as chromosomes; ④ Calculate the water head at each node under steady-state conditions; ⑤ Calculate the water head at each node at any time under transient conditions and determine whether an air valve is installed; ⑥ Calculate the values of the objective function for all individuals in the initial population according to Formula (1) and Formula (2); ⑦ Convergence control of the genetic algorithm. If it converges, go to Step ⑨. If it does not converge, continue; ⑧ The genetic algorithm generates a child population through crossover and mutation and returns to Step ④; ⑨ Select the best individual in the population as the optimized best valve closing curve.
[0075] Furthermore, Step 3 includes the following sub-steps:
[0076] Step 301: Obtain the basic data of the long-distance gravity flow water conveyance project, including pipeline flow rate, total length, upstream reservoir water level, inlet elevation, downstream pool water level, outlet elevation, pipeline plan view and longitudinal section, pipeline roughness coefficient, wall thickness, and total number of segments of the water hammer wave velocity.
[0077] Step 302: It is necessary to determine the optimal total valve closing time. The length of the total valve closing time has a great impact on the water hammer protection effect. When the total valve closing time is too short, the water hammer protection effect cannot meet the safety requirements. When the total valve closing time is too long, the harm of the water hammer effect to the system safety is relatively small, and the selection of the valve closing scheme is relatively simple, but it conflicts with the requirements for the valve closing time in the actual project.
[0078] After preliminary research, the total valve closing time of common pipelines is about 30s. To find a more appropriate total valve closing time, various valve closing schemes are optimized with 25s, 30s, 35s, and 40s as the total valve closing time respectively. To eliminate the influence of randomness on the results, this step is repeated for calculation 100 - 1000 times and the results are statistically analyzed.
[0079] Step 303, data analysis of the total valve closing time. If the success rate is 0, it indicates that the total valve closing time is too short to control the water hammer effect within the safe range by adjusting the valve closing curve; if the success rate is 100%, it indicates that the total valve closing time is too long and the water hammer protection work is relatively simple, unable to reflect the superiority of the genetic algorithm compared to the experience-based design method. Select the optimal total valve closing time according to the statistical results to ensure a high optimization success rate with a relatively short total valve closing time. Such a total valve closing time makes the scheme of adjusting the valve closing curve to prevent water hammer overload feasible on the one hand, and solves the problem that it is difficult to design the valve closing curve based on experience on the other hand.
[0080] Further, step 4 includes the following sub-steps:
[0081] Step 401, based on the optimal total valve closing time, use the genetic algorithm to optimize and calculate the two-stage valve closing scheme respectively. Repeat the optimization program 100 - 1000 times and count the calculation results, and analyze the optimization effect and the characteristics of the valve closing curve after optimization.
[0082] Step 402, based on the optimal total valve closing time, use the genetic algorithm to optimize and calculate the three-stage valve closing scheme respectively. Repeat the optimization program 100 - 1000 times and count the calculation results, and analyze the optimization effect and the characteristics of the valve closing curve after optimization.
[0083] Step 403, based on the optimal total valve closing time, use the genetic algorithm to optimize and calculate the four-stage valve closing scheme respectively. Repeat the optimization program 100 - 1000 times and count the calculation results, and analyze the optimization effect and the characteristics of the valve closing curve after optimization.
[0084] Step 404, determine the optimal number of valve closing stages according to steps 401 - 403.
[0085] Step 405, repeatability verification. Based on the optimal number of valve closing stages, repeat the above steps twice. The relative standard deviation of the average fitness obtained from the three calculations should be less than 1%. Therefore, it is considered that the calculation of the average fitness is relatively accurate and has strong repeatability, excluding the possible influence of the uncertainty of the optimization solution of the genetic algorithm and the randomness of processes such as crossover and mutation on the calculation results.
[0086] Based on the above analysis, obtain the optimal number of valve closing stages and describe the typical characteristics of the valve closing curve after optimization.
[0087] Further, step 5 includes the following sub-steps:
[0088] Step 501, analyze the typical characteristics of the valve closing curve successfully optimized based on the optimal total valve closing time and the optimal number of valve closing stages, and simplify the valve closing curve based on this characteristic, that is, take the average value of the inflection point coordinates with similar values in the valve closing curve.
[0089] Step 502: Analyze the influence of the simplified valve closing curve on the water hammer protection effect. Simplify the valve closing curves of each optimized successful case based on the optimal number of valve closing stages according to the method in Step 501, substitute the simplified valve closing curve into the water hammer calculation model, and statistically analyze the degree of fitness change.
[0090] For more than 70% of the cases, the degree of fitness change should be between ±5% after the modification, indicating that the influence of the simplified valve closing scheme on the water hammer protection effect is limited. The dimension of the objective function can be reduced, the search space can be narrowed, and the complexity of the optimization calculation can be reduced by simplifying the valve closing curve.
[0091] Step 503: Verify the feasibility of reducing the dimension of the objective function, narrowing the search space, and reducing the complexity of the optimization calculation by simplifying the valve closing curve. Optimize the valve closing curve scheme based on the simplification using the genetic algorithm, and repeat the calculation 100 - 1000 times, and analyze the optimization effect and the characteristics of the optimized valve closing curve.
[0092] Compared with the optimization results of the ordinary multi - stage valve closing scheme, the two types of schemes should be generally the same in terms of the inflection point position and the trend of the hydraulic envelope. The simplified valve closing scheme should have a lower average fitness, a higher operation success rate, and fewer average nodes exceeding the head limit. Therefore, the genetic algorithm optimization program for the simplified valve closing scheme has better solving ability and can better reduce the construction cost.
[0093] The following takes a specific example to illustrate the best embodiment of the present invention in detail.
[0094] For a water supply project in a certain city in Shanxi Province, the pipeline flow rate is 289.352 L / s, the total length is 18492 m, the upstream reservoir water level is 1126 m, the inlet elevation is 1114.5 m, the downstream pool water level is 1042 m, and the outlet elevation is 1037 m. The plan view and longitudinal section of the pipeline are as Figure 3 shown.
[0095] The pipeline uses reinforced concrete pipes with a roughness coefficient of 0.018, a wall thickness of 60 mm, a water hammer wave velocity of 1111.21 m / s, a total number of segments of 52, a flow regulating valve is set at the pipeline end, the steady - state pipeline flow velocity is 1.02 m / s, the hydraulic gradient is 2.092‰, and the maximum and minimum allowable head lines are 200 m above and 2 m below the pipeline center line respectively.
[0096] Optimize various valve closing schemes with total valve closing times of 25, 30, 35, and 40 s respectively. To eliminate the influence of randomness on the results, repeat this step 100 times and statistically analyze the results. The relationship between the total valve closing time, the type of valve closing curve, and the optimization success rate is shown in Table 1:
[0097] Table 1 Summary of optimization success rates
[0098]
[0099] As can be seen from Table 1, when the total valve closing time is 35 s, on the one hand, the scheme of adjusting the valve closing curve to prevent water hammer overload is feasible, and on the other hand, it can solve the problem that it is difficult to design the valve closing curve based on experience. When the total valve closing time is 35 s, the performance evaluation of the optimization program based on three valve closing schemes is shown in Table 2:
[0100] Table 2 Performance evaluation of the optimization program based on three valve closing schemes
[0101]
[0102] Based on the analysis of the data with a total valve closing time of 35 s, Figure 4 (a) is the summary of the valve closing curve results after optimization by the genetic algorithm based on the two-stage valve closing scheme, Figure 4 (b) is the corresponding hydraulic envelope. As can be seen from Figure 4 , in the case of the two-stage valve closing scheme, the optimized valve closing curves generally show a trend of "fast closing first and then slow closing". The inflection points appear between 1.5 - 5.5 s, around 8.4 s or around 10.5 s after the valve starts, corresponding to the valve opening between 50 - 85%, near 28% or near 15%. However, the influence of the change of the valve closing curve on the hydraulic envelope is limited. For the long-distance gravity flow water conveyance project in this engineering case, the effect of the two-stage valve closing scheme on water hammer elimination is not obvious.
[0103] The genetic algorithm is used to optimize the calculation of the three-stage valve closing scheme. The optimization program is repeated 100 times and the calculation results are statistically analyzed. The kmeans algorithm is used to perform cluster analysis on the successfully optimized three-stage valve closing scheme. The clustering results and their corresponding hydraulic envelopes are as Figure 5 shown. According to the different positions of the inflection points, the valve closing curves are divided into three categories, all showing the characteristics of "fast closing in the early stage, slow closing in the middle stage, and fast closing in the later stage".
[0104] As can be seen from Figure 5 , the inflection points of the first, second, and third categories of valve closing curves appear at 4 - 12 s, 10 - 16 s, and 4 - 12 s after the valve starts respectively; the inflection points of the first, second, and third categories of valve closing curves appear at 24 - 32 s, 24 - 32 s, and 19 - 31 s after the valve starts respectively;. The valve opening in the slow closing stage of the first, second, and third categories of valve closing curves is between 25 - 65%, 20 - 45%, and 35 - 75%. The hydraulic envelopes corresponding to the three categories of valve closing curves do not exceed the allowable maximum and minimum head lines. In engineering practice, the valve closing scheme can be screened according to the distribution range of the inflection points of the valve closing curve to avoid the harm of water hammer phenomenon to the pipeline.
[0105] Similarly, the genetic algorithm is used to optimize the calculation of the four-stage valve closing scheme. The optimization program is repeated 100 times and the calculation results are statistically analyzed. Cluster analysis is performed on the successfully optimized four-stage valve closing scheme. The clustering results and their corresponding hydraulic envelopes are as Figure 6 shown. According to the different positions of the inflection points, the valve closing curves are also divided into three categories. However, different from the optimization results of the three-stage valve closing scheme, the four-stage valve closing curves are characterized by "fast closing, fast closing, slow closing, fast closing", "fast closing, slow closing, slow closing, fast closing" or "fast closing, slow closing, fast closing, fast closing". In the successful cases of optimizing the four-stage valve closing curves, there is a phenomenon that the slope change between adjacent stages is not significant. It can be approximately regarded as a three-stage valve closing scheme. Then, the first inflection points of the first, second, and third categories of valve closing curves appear at 4 - 21 s, 5 - 9 s, and 5 - 9 s after the valve starts respectively; the second inflection points of the first, second, and third categories of valve closing curves all appear around 26 - 31 s after the valve starts. The valve opening degrees in the slow closing stage of the first, second, and third categories of valve closing curves are between 20 - 50%, 25 - 75%, and 25 - 65% respectively.
[0106] As can be seen from Table 2, the three-stage valve closing scheme has the highest operation success rate (up to 47%), the fewest average number of nodes exceeding the head limit (only 0.69), and the fewest average number of gas valves called (only 0.33). The average fitness of the two-stage valve closing scheme is slightly better than that of the three-stage one, but due to its success rate being 0, it cannot guarantee water supply safety. Compared with the two-stage valve closing scheme, the average fitness of the optimized three-stage valve closing scheme is slightly higher, but the changes in the corresponding maximum and minimum hydraulic envelopes ensure the safety of the water hammer protection system. Compared with the four-stage valve closing scheme, although the fitness of the optimal solution of the three-stage valve closing scheme is slightly higher, it has advantages in terms of average fitness, calculation success rate, average number of gas valves called, and valve closing process complexity. Therefore, the genetic algorithm optimization program based on the three-stage valve closing scheme has better solving ability and can better reduce the construction cost of the water conveyance pipeline in the water supply system.
[0107] Combined with Figure 5 、 Figure 6 it can be seen that compared with the valve closing curves optimized by the three-stage valve closing scheme, the four-stage valve closing scheme still conforms to the characteristics of "fast closing in the early stage, slow closing in the middle stage, and fast closing in the later stage". At the same time, the two types of schemes are generally the same in terms of the inflection point position and the trend of the hydraulic envelope. Therefore, there is no essential difference between the four-stage valve closing scheme and the three-stage valve closing scheme. Considering that the decision variables (t1, t2, t3, y1, y2, y3) of the four-stage valve closing scheme have more dimensions than those (t1, t2, y1, y2) of the three-stage valve closing scheme, the search space expands sharply and the search difficulty increases significantly. Therefore, the program requires more computing power. Without changing the computing power, the success rate of optimizing the four-stage valve closing scheme and its water hammer protection ability both decline.
[0108] Repeatability verification. Taking the three-stage valve closing scheme with a total valve closing time of 35 s as an example, repeat the above steps two more times. The average fitness values obtained from the three calculations are 5639.42, 5614.87, and 5644.92 respectively, and the relative standard deviation is 0.23%. Therefore, it is considered that the calculation of the average fitness is relatively accurate and has strong repeatability, excluding the possible influence of the uncertainty of the genetic algorithm optimization solution and the randomness of the crossover and mutation processes on the calculation results.
[0109] Based on the above analysis, the water hammer protection scheme optimized by the three-stage valve closing curve can effectively prevent the occurrence of pipe bursting and the closing water column separation effect. The solutions of the valve closing curve are not unique, but all show the characteristics of "fast closing in the early stage, slow closing in the middle stage, and fast closing in the later stage". In engineering practice, it can be selected according to the actual situation.
[0110] Compared with the three-stage valve closing curve, the four-stage valve closing curve can also achieve good water hammer protection effect. However, it has no obvious advantage in terms of optimization success rate and the number of air valves used. Considering the guarantee of the system operation process and the simplicity of program calculation, it is not necessary to choose the four-stage valve closing curve.
[0111] Use the kmeans algorithm to perform cluster analysis on the successfully optimized ordinary three-stage valve closing scheme. The clustering results and their corresponding hydraulic envelopes are as Figure 5 shown. According to the different inflection point positions, the valve closing curves are divided into three categories, all showing the characteristics of "fast closing in the early stage, slow closing in the middle stage, and fast closing in the later stage". The average slopes of the slow closing stages of the first, second, and third category valve closing curves are -0.323, -0.241, and -0.386 respectively. The slope of the slow closing stage of the valve closing curve after optimizing the ordinary three-stage valve closing scheme is small. To simplify the valve closing curve, it is considered that the ordinary three-stage valve closing scheme will be adjusted to a three-stage valve closing scheme with a flat period.
[0112] Adjust the slow closing stage of the successful optimization case of the ordinary three-stage scheme to a flat stage, and set the valve opening of the flat stage to the average value of the valve opening in the slow closing stage and substitute it into the water hammer calculation model. The frequency distribution of the fitness change degree of each case based on the modified scheme is shown in Table 3:
[0113] Table 3: Frequency distribution table of the fitness change degree of each case of the modified scheme
[0114]
[0115] For 76.56% of the cases, the fitness change degree after modification is between ±4%. For some cases, the fitness change degree after modification is relatively large, but all show a trend of decreasing fitness, which is instead beneficial to the protection of the water hammer effect. Therefore, it can be considered that the change of the slope of the slow closing stage curve of the ordinary three-stage valve closing scheme has limited effect on the water hammer protection effect, and the three-stage valve closing scheme with a flat period can be used for simplified substitution.
[0116] To verify the feasibility of reducing the dimension of the objective function, shrinking the search space, and reducing the complexity of the optimization calculation by simplifying the valve closing curve. The genetic algorithm was used to optimize the three-stage valve closing scheme with a plateau period, and it was repeated 100 times. The starting valve closing time was set to 0 s, and the time when the valve was fully closed was set to 35 s. The hydraulic transient changes between 0 and 1000 s were considered. And cluster analysis was performed on the successfully optimized three-stage valve closing scheme with a plateau period. The clustering results and their corresponding hydraulic envelopes are as Figure 7 shown.
[0117] According to the different positions of the inflection points, the valve closing curves are divided into three categories, which are similar to the optimization results of the ordinary three-stage valve closing scheme. The slope of the second stage of the valve closing curve is 0. The first inflection points of the first, second, and third categories of valve closing curves appear at 3 - 8 s, 11 - 23 s, and 4 - 10 s after the valve starts respectively; the second inflection points of the first, second, and third categories of valve closing curves appear at 20 - 28 s, 25 - 32 s, and 25 - 32 s after the valve starts respectively. The valve opening degrees in the plateau stages of the first and second categories of valve closing curves are between 50 - 60% and 24 - 30% respectively; the valve opening degree in the slow closing stage of the third category of valve closing curve is between 30 - 50%. The optimization success rate of the three-stage valve closing scheme with a plateau period is 80%, the average fitness is 5499.75, the average number of nodes exceeding the head limit is 0.21, and the average number of air valves called is 0.32.
[0118] Combined with Figure 6 , Figure 7 it can be seen that the slope of the slow closing stage valve closing curve after optimizing the ordinary three-stage valve closing scheme is small, and the two types of schemes are generally the same in terms of the inflection point position and the trend of the hydraulic envelope. The average fitness of the three-stage valve closing scheme with a plateau period is lower (only 5499.75), the operation success rate is higher (up to 80%), and the average number of nodes exceeding the head limit is less (only 0.221). This is because the number of decision variables of the three-stage valve closing scheme with a plateau period (t1, t2, y1, y1) is less than that of the ordinary three-stage valve closing scheme (t1, t2, y1, y2), and the number of situations to be considered is reduced. Therefore, the program has lower requirements for computing power. With the same computing power, the success rate of scheme optimization and the water hammer protection ability have increased.
[0119] Therefore, the genetic algorithm optimization program of the three-stage valve closing scheme with a plateau period has good solving ability. Although the ordinary three-stage curve scheme can also achieve good water hammer protection effect, it has no obvious advantages in terms of optimization success rate and the number of air valves called. In order to ensure that the system operation process is as simple as possible, the three-stage valve closing scheme with a plateau period should be selected.
[0120] The present invention has been described in detail with reference to the embodiments accompanied by drawings. Those of ordinary skill in the art can make various variations of the present invention according to the above description. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the scope of the invention protection of the present invention.
Claims
1. A method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm, characterized in that, It includes the following steps: Step 1: Based on the basic differential equation of water hammer calculation and the method of characteristics, establish a hydraulic transient calculation model for long-distance gravity-flow water conveyance pipelines. Step 2: Based on the genetic algorithm, optimize the valve closing curve and the air valve layout scheme. Step 3: Conduct optimization calculations for valve closing schemes with different total valve closing times, count the optimization results, and determine the optimal valve closing time. Step 4: Based on the optimal valve closing time, conduct optimization calculations for valve closing schemes with different numbers of stages, count the optimization results, and determine the optimal number of stages of the valve closing curve. Step 5: Count the optimization results based on the optimal number of stages of the valve closing curve, analyze the characteristics of the valve closing curve, simplify the valve closing curve and prove its effectiveness, and obtain the finally optimized valve closing scheme for gravity-flow water conveyance pipelines. Among them, Step 4 includes the following sub-steps: Step 401: Based on the optimal total valve closing time, use the genetic algorithm to conduct optimization calculations for two-stage valve closing schemes respectively, and analyze the optimization effect and the characteristics of the optimized valve closing curve. Step 402: Based on the optimal total valve closing time, use the genetic algorithm to conduct optimization calculations for three-stage valve closing schemes respectively, and analyze the optimization effect and the characteristics of the optimized valve closing curve. Step 403: Based on the optimal total valve closing time, use the genetic algorithm to conduct optimization calculations for four-stage valve closing schemes respectively, and analyze the optimization effect and the characteristics of the optimized valve closing curve. Step 404: Determine the optimal number of valve closing stages according to Steps 401 to 403. Step 405: Based on the optimal number of valve closing stages, verify the repeatability and describe the typical characteristics of the optimized valve closing curve. Step 5 includes the following sub-steps: Step 501: Analyze the typical characteristics of the valve closing curve successfully optimized based on the optimal total valve closing time and the optimal number of valve closing stages. Based on these characteristics, simplify the valve closing curve, and take the average value of the inflection point coordinates with similar numerical values in the valve closing curve. Step 502: Analyze the influence of the simplified valve closing curve on the water hammer protection effect. Simplify the valve closing curves of each optimization success case based on the optimal number of valve closing stages according to the method of Step 501, substitute the simplified valve closing curve into the water hammer calculation model, and count the degree of change in fitness. Step 503: Verify the feasibility of reducing the dimension of the objective function, narrowing the search space, and reducing the complexity of optimization calculations by simplifying the valve closing curve. Use the genetic algorithm to optimize the valve closing curve scheme based on the simplification, repeat the calculation several times, analyze the optimization effect and the characteristics of the optimized valve closing curve, and obtain the finally optimized valve closing scheme for gravity-flow water conveyance pipelines.
2. The method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm according to claim 1, characterized in that, Step 1 includes the following sub-steps: Step 101: The basic differential equation of water hammer calculation includes the continuity equation and the motion equation, as shown in Formulas (1) and (2) respectively: Where: H = Z + P / (ρg), where Z is the elevation of the pipeline axis, in m; P is the pressure, in Pa; ρ is the liquid density, in kg / m 3 ; g is the acceleration due to gravity, in m / s 2 ; x is the length of the pipeline along the axis direction, in m; a is the water hammer wave velocity in the pipeline, in m / s; t is the transient time, in s; θ is the angle between the pipeline axis and the horizontal plane, °; is the average flow velocity of the fluid in the pipeline, m / s; λ is the friction factor along the length; D is the inner diameter of the pipeline, m; Step 102: Through the method of characteristics, transform and simplify the basic differential equation to obtain a compatibility equation set that is easy to program into MATLAB: Therefore where B and C p and C M are calculation coefficients, which are respectively: where: A is the cross-sectional area of the pipeline, m 2 ; f is the resistance coefficient; △x is the distance step of the pipeline, m; H pi is the water head at the i-th node at this moment, m; Q pi is the flow rate at the i-th node at this moment, m 3 / s; H i-1 , H i+1 are the water heads at the (i - 1)-th and (i + 1)-th nodes at the previous moment, m; Q i-1 , Q i+1 are the flow rates at the (i - 1)-th and (i + 1)-th nodes at the previous moment, m 3 / s; a is the water hammer wave velocity in the pipeline, m / s; t is the transient time, s; g is the acceleration due to gravity, m / s 2 ; D is the inner diameter of the pipe, m; Step 103, determine the basic boundary conditions: When the area of the water tank is much larger than the area of the pipeline, the influence of the water volume change in the transient process on the water level of the water tank is negligible; if the water levels of the upstream and downstream water tanks are H R1 and H R(N+1) , respectively, then the nodal heads at the starting point and the ending point of the pipeline are H1 = H R1 and H N+1 = H R(N+1) .
3. The method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm according to claim 1 or 2, characterized in that, The hydraulic transient calculation model for the long-distance gravity-flow water conveyance pipeline separates the pipeline with multiple nodes at equal horizontal distances and supports the installation of air valves at any node.
4. The method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm according to claim 3, characterized in that, A flow control valve is installed at the end of the pipeline.
5. The method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm according to claim 1, wherein, Step 2 includes the following sub-steps: Step 201: Define the decision variables of the genetic algorithm as different valve closing procedures; Step 202: Set the objective function as: F = Fitness + M1PF1 + M2PF2 (6) Where: Fitness is the fitness; PF1 and PF2 are the maximum water hammer pressure rise constraint and the minimum water hammer pressure drop constraint respectively; M1 and M2 are the penalty coefficients corresponding to the constraint conditions; among them where: i is the node number, i = 1, 2, 3, …, N+1; H a,max H a,min (i) and H (i) are the maximum and minimum water heads that each node of the pipeline can withstand, respectively, in m; H max (i), H min (i) are the maximum and minimum water heads that occur during the simulation of each node of the pipeline, m; Step 203: Determine the population size, that is, determine the number of different valve closing curves in the same generation; Step 204: Optimize the valve closing scheme of the long-distance gravity flow water conveyance pipeline based on the genetic algorithm.
6. The method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm according to claim 5, wherein, The steps of Step 204 are as follows: ① Input parameters such as terrain, pipe diameter, pipe material, water hammer wave speed, etc.; ② Define the objective function; ③ Generate the initial population with the inflection point parameters of the valve closing curve as chromosomes; ④ Calculate the water head at each node under steady-state conditions; ⑤ Calculate the water head at each node at any time under transient conditions and judge whether air valves are installed; ⑥ According to the formula F = Fitness + M1PF1 + M2PF2 (6) And the formula Calculate the values of the objective function for all individuals in the initial population; ⑦ Convergence control of the genetic algorithm. If it converges, go to Step ⑨; if not, continue; ⑧ The genetic algorithm generates the offspring population through crossover and mutation, and returns to Step ④; ⑨ Select the best individual in the population as the optimized best valve closing curve.
7. The method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm according to claim 1, wherein, The said Step 3 includes the following sub-steps: Step 301: Obtain the basic data of the long-distance gravity flow water conveyance project, and determine the total number of pipe segments, the pipe flow velocity and the hydraulic gradient at steady state; Step 302: Determine the optimal total valve closing time. Optimize various valve closing schemes with 25 s, 30 s, 35 s, and 40 s as the total valve closing time and count the results; Step 303: Conduct data analysis on the total valve closing time to determine the optimal valve closing time.
8. The method for screening the valve closing scheme of a gravity flow water conveyance pipeline optimized by a genetic algorithm according to claim 7, wherein, A flow regulating valve is provided at the end of the pipeline.
Citation Information
Patent Citations
High-pressure common rail system based on genetic algorithm and parameter optimization method
CN106089524A
Valve closing optimal control method of transition process of long distance and mass flow water conveyance system
CN106842928A