Study on Optimization of Active Control Schemes for Considering Transient Processes in the Case of Pipeline Leakage

: Pipeline leakage of crude oil, reﬁned oil or other petroleum derivatives can cause serious damage to the environment, soil, and more importantly, pose a serious threat to personal safety. The losses can be minimized to a degree by active control. Therefore, timely and e ﬀ ective control measures should be taken to minimize the leak volume whenever a pipeline leaks. However, the complexity of pipeline hydraulic systems makes it di ﬃ cult to optimize control schemes for pipeline hydraulic devices under leak conditions, and existing studies rarely consider complex transient processes. This paper aims to establish a mixed integer linear programming model considering transient processes, hydraulic constraints, equipment constraints and ﬂow constraints, and develop a detailed control scheme of the devices by the branch and bound algorithm. Moreover, it is the objective of the model to ﬁgure out the most optimal control plan to minimize the leakage. Experiments on a real-world liquid pipeline have proved the practicability and high reliability of the model.


Background
Pipelines have become the main way of liquid transportation because of their advantages in economy and transportation capacity [1]. However, during the long-term operation of pipelines, they inevitably leak due to corrosion, third-party destruction and natural disasters, causing environmental contamination, fires or explosions if measures are not taken in a timely way [2][3][4]. In addition to the research on leak detection and hydraulic simulation, the control of hydraulic equipment is also critical to reducing leak volume. Difficulties in this research are mainly transient flow characteristics, the interactions between hydraulic devices, phase transitions and non-linear constraints.

Related Work
Much research has been done in related fields. One of the hottest topics is leak detection in pipelines which is critical to respond to any accident as well as subsequent assessments. In one reference a method was proposed to detect and localize leaks considering non-ideal gas mixtures [5]. The disadvantage of this method is that the leakage detection performance is satisfactory only when its magnitude is greater than or equal to 5% of the flow rate under transient conditions. Wang et al. [6] Energies 2020, 13 proposed a pipeline leak detection and location method based on the model-free isolation of abnormal (leak and operation) signals, which is helpful in accurately locating the leak location. Using an artificial bee colony (ABC) algorithm, Mandal et al. [7] came up with a relatively new leak detection scheme based on rough set theory and support vector machine (SVM) to enhance the accuracy of avoiding false leak detection. Based on transient data without failure history and gradient and slope turns rejection (GSTR), Liang and Zhang [8] put forward a novel pipeline leakage detection scheme using data under transient conditions. Vankov, et al. [9] used neural networks to analyze the vibrations in the pipe and identify defects. Elaoud, et al. [10] studied the transient pressure waves caused by sudden closing of the downstream shut-off valve of the hydrogen-natural gas mixture pipeline by the characteristic method of the specified time interval. Hermansyah, et al. [11] used event tree analysis to analyze the risk of gas pipeline leakage. Other research focused on experimental study of leak. Meng, et al. [12] designed a high-voltage and long-distance leakage test loop by analyzing the similarity with the field transmission pipeline. The acoustic signal is denoised by the wavelet transformer, and the interference signal is removed by time domain and frequency domain analysis; nevertheless, the false alarm rate is significant. Some other experimental research concentrated on pipelines transporting other fluids like CO 2 . Liu, et al. [13] conducted a series of scaled field tests using infrared CO 2 sensors to detect CO 2 concentration for further analysis, the result of which proved that safety distance was quite correlated with discharge flow. Xie, et al. [14] has set up an experimental system to study the leak behavior of high-pressure CO 2 flow, showing the typical characteristics of supercritical CO 2 flow leaking from small aperture. Some other studies have chosen numerical simulation methods to study leaks. Conservation of mass, momentum and energy were commonly applied. An alternative to energy conservation was the conservation of entropy or enthalpy. These approaches appear suitable for the small magnitude of the entropy or enthalpy volume when the expansion occurs [15][16][17]. Choi et al. [18] analyzed safety issues in an underground parking garage when hydrogen was dispersed from a fuel cell vehicle, and the results showed that a ventilation fan can effectively avoid the dangerous situation of hydrogen leakage in an underground parking garage scenario. He et al. [19] studied the numerical calculation methods of double-channel pumps, and analyzed the influence of flow rate and wall roughness on equipment leakage. Gorenz, et al. [20] applied computational fluid dynamics simulations to reduce the uncertainty regarding the pressure in pipeline cracks and its release pressures in pipeline puncture failures. Molag and Dam [21] established models for the outflow, dispersion, the causes of the uncertainties in the outflow and dispersion of CO 2 after an accidental release from a high-pressure pipeline. Similar research like Mazzoldi, et al. [22] made comparison with CFD and Gaussian leak models.
At present, there are many studies on pipeline leakage detection and location, but less attention has been paid to timely leakage assessment and active control schemes for the pipeline as well as the devices to reduce damage. Therefore, this paper proposes a method for rapid decision-making control scheme to make up for the shortcomings of existing research [23].

Contributions of This Work
The contributions of this work can be summarized as follows: • This paper analyzes the process of oil leaks and determines the most sensitive time-control region.

Paper Organization
The problem description and details of the mathematical model are given in Sections 2 and 3, respectively. Section 4 of the paper gives a description of the method for solving this model. Section 5 takes a real leak accident as an example to compare leakage volumes under different leak scenarios. Conclusions are provided in Section 6.

Control Scheme of Hydraulic Pipeline System under Leak Condition
Pipeline breakage and leak lead to a pressure drop both upstream and downstream, and the closer to the leak position, the faster the pressure drop rate is. When the cut-off valve actuator of a pipeline senses that the pressure drop rate is larger than the setting, the actuator will close the upstream and downstream cut-off valves to promise the influence of pipeline rupture and control the leakage between the two adjacent valves. The closure rate influences the transient pressure caused by water hammer. A faster closure rate results in a greater transient pressure, making the pipeline system vibrate severely and inducing noise, which contributes to valve damage and even pipeline rupture. In contrast, a slower closed rate increases the size of the pipeline oil leak. Therefore, the closure rate of valves is obviously of great significance.
When valves are closed quickly, a upstream pressure change is caused by fluid expansion and flow rate changes, and the valve blocks the fluid flow, creating a boost wave. Downstream pressure changes are caused by changes in flow rate, providing a reduction in energy and thus producing a decompression wave. The boost wave may make the pressure in the pipeline exceed the maximum operating pressure and cause severe damage. The decompression wave may cause the pressure in the pipeline to drop below the saturated vapor pressure of the liquid, thereby separating the liquid column and destabilizing the pipeline. The direct transient pressure caused by the flow rate cannot be controlled generally, but the pressure change caused by the liquid expansion can be alleviated as much as possible.
The overall system is composed of the initial station (IS), the pump station (PS), the functional valves (V1, V2, V3 and V4) and the terminal station (TS), as shown in Figure 1. The core of this article is to adjust the opening of the functional valve to minimize losses and damages.
Energies 2020, 13, x FOR PEER REVIEW 3 of 17  A real-world pipeline leak accident in China is cited as a case study. A detailed emergency response scheme and an optimal one are compared in terms of the leakage volume.

Paper Organization
The problem description and details of the mathematical model are given in Sections 2 and 3, respectively. Section 4 of the paper gives a description of the method for solving this model. Section 5 takes a real leak accident as an example to compare leakage volumes under different leak scenarios. Conclusions are provided in Section 6.

Control Scheme of Hydraulic Pipeline System under Leak Condition
Pipeline breakage and leak lead to a pressure drop both upstream and downstream, and the closer to the leak position, the faster the pressure drop rate is. When the cut-off valve actuator of a pipeline senses that the pressure drop rate is larger than the setting, the actuator will close the upstream and downstream cut-off valves to promise the influence of pipeline rupture and control the leakage between the two adjacent valves. The closure rate influences the transient pressure caused by water hammer. A faster closure rate results in a greater transient pressure, making the pipeline system vibrate severely and inducing noise, which contributes to valve damage and even pipeline rupture. In contrast, a slower closed rate increases the size of the pipeline oil leak. Therefore, the closure rate of valves is obviously of great significance.
When valves are closed quickly, a upstream pressure change is caused by fluid expansion and flow rate changes, and the valve blocks the fluid flow, creating a boost wave. Downstream pressure changes are caused by changes in flow rate, providing a reduction in energy and thus producing a decompression wave. The boost wave may make the pressure in the pipeline exceed the maximum operating pressure and cause severe damage. The decompression wave may cause the pressure in the pipeline to drop below the saturated vapor pressure of the liquid, thereby separating the liquid column and destabilizing the pipeline. The direct transient pressure caused by the flow rate cannot be controlled generally, but the pressure change caused by the liquid expansion can be alleviated as much as possible.
The overall system is composed of the initial station (IS), the pump station (PS), the functional valves (V1, V2, V3 and V4) and the terminal station (TS), as shown in Figure 1. The core of this article is to adjust the opening of the functional valve to minimize losses and damages.   [24]. Since the flow and pressure of fluid in a pipeline are related to distance and time, it can be expressed as a transient relationship between flow and pressure:

Equation of Transient Characteristic
The For further calculation, the differential term will be converted into a difference term. Moreover, the staggered mesh method is used to avoid the problem of coupling invalidation between pressure and flow rate. Staggered mesh means that pressure and flow rate are saved in two different mesh systems. The flow rate is stored in the boundary of volume that pressure controls and there exists a gap with the length of half step between flow rate control volume and pressure control volume. Hence, discretizing the flow rate can be achieved through integration of its control volume.
The number of nodes: the number of a flow rate nodes is determined by the number of main nodes in the direction of the flow. For instance, the controlling volume of node Q 3 covers the range from node H 1 to H 3 .
Boundaries: The pressure nodes on the boundaries like H 1 and H 3 are not unknown variables in the equations; instead, the value is determined using extrapolation method after the calculation has converged. Therefore, as for the left boundary of Q 3 controlling volume, the item H 1 could be omitted by the following equations.

Model Requirements
The model is formulated as a MILP model and a detailed control scheme under leak accident condition can be obtained. Given: • The objective of the issue is to minimize closing valve time with consideration of constraints including hydraulic constraints, equipment constraints and pipeline constraints as well as to give an optimal control scheme for hydraulic equipment.
The leak process involves the change of transient hydraulic, temperature and phase state. In order to build and solve the model effectively, the following assumptions are made:

•
The ambient pressure is constant since the pressure change outside leak aperture is so slight that it can be ignored.

•
The temperature will slightly drop with the leak, hence, the influence of temperature is neglected.

Objective Function
For the leaking pipeline section, the most important emergency operation is to close the cut-off valves at two ends of the upstream pipeline as soon as possible in order to reduce leakage and accident risk. Thus, the minimum closed time of cut-off valves at two ends of the upstream leak pipeline section is the objective. Equation (7) gives the objective function, which means that the sum of the valve closing operation time is minimized, and it also ensures the minimum leakage time and the minimum leakage. ∆t is the closure time of valves:

Delivery Constraints
Based on the staggered mesh, the difference of momentum and continuity equations (from Equations (3) and (4)) adopt the first-order upwind difference scheme that is unconditionally stable. The results are shown as Equations (8) and (9): The hydraulic head behind the valve is equal to that before the valve minus hydraulic loss and flow rate remains constant through the valve: Since valve blocks have an upper limit of closure rate, they need to meet the following constraints during closing. φ j i is the closure rate of upstream valves of pipeline section i at moment j. φ j is is the topening of valves located upstream of the leaking pipeline section. φ jm i is opening of cut-off valves at the final moment. φ According to a leak aperture's characteristic, the quantity of leakage volume is calculated on the basis of Equation (13): The flow before the leaking aperture minus the flow at the leaking point is equal to that behind the leaking aperture: Hydraulic head at any point should be below the maximum hydraulic head: When the degree of opening of valves upstream of the pipeline leak section is zero, the binary variable of cut-off valve closing will be zero too. The variable of valve opening degree ranges continuously from zero to one. The binary variable of cut-off valve closing should meet the following constraint in Equation (16): Energies 2020, 13, 1692 At the end, the all cut-off valves' opening degree should be zero:

Model Solving
In the above model, Equations (8), (10) and (13) are non-linear. Currently, methods for solving non-linear models include intelligent algorithms and coupling algorithms. In addition, there are many non-linear solvers such as DICOPT and SBB. However, these methods are no guarantee of a global optimal solution. In this paper, we propose a method to linearize non-linear constraints, that is, the non-linear functions are linearized in segments by introducing binary variables, and the more the segments, the smaller the deviation from the actual results.
The equation of momentum (Equation (8)) can be linearized as follows in Equations (18) and (19): i,a is the binary variable of distinguishing flowrate ranges: Similarly, we can linearize the equation of leak (Equation (13)) as follows: Due to the more complex non-linear item in Equation (10), the above linearization method fails to handle this problem. Therefore, we decide to substitute the variables. K φ j Q j i + 2 is considered as an entirety and substituted by H V j i , and Equation (10) is derived: Then the idea mentioned above can be applied in Equation (12): According to the transient model, when valves are closed, the flowrate at valve nodes must be zero. Based on this Equations (16) and (17) are accordingly changed as below:

Model Parameter Setting
The basic parameter of a liquid pipeline adopted for test is presented in Table 1 and Figure 1. An actual pipeline is used to verify this model. Under the premise that the water hammer pressure caused by closing the valve is less than the maximum operating pressure of the pipeline, the valves at both ends of the leaking pipeline section should be closed as soon as possible. It is necessary to optimize the opening variation of each valve during the closing process. The optimal results of valve closure under different working conditions are presented as follows.

Model Test
The valve control scheme is supposed to close each valve along the pipeline sequentially. In Figure 2, the dotted lines indicate the opening variation of each valve, and the solid lines indicate the opening variation with the fastest closure rate. The closure rate of valve 4 is always close to the fastest closure rate because its initial opening is the smallest compared to other valves and its closure time is the shortest. Small water hammer waves generated during valve closing do not cause any overpressure in the pipeline. During the closing of valves 1, 2 and 3, the closure rate changes drastically, especially when it is almost closed. The closure rate is reduced because the water hammer waves caused by valve closing and pump stop are now overlapping, which may cause overpressure in the pipeline. From this point of view, reducing the closure rate can relieve the water hammer pressure and avoid any overpressure. The closure time of each valve along the pipeline is shown in Table 2. Under the premise that the water hammer pressure caused by closing the valve is less than the maximum operating pressure of the pipeline, the valves at both ends of the leaking pipeline section should be closed as soon as possible. It is necessary to optimize the opening variation of each valve during the closing process. The optimal results of valve closure under different working conditions are presented as follows.

Model Test
The valve control scheme is supposed to close each valve along the pipeline sequentially. In Figure 2, the dotted lines indicate the opening variation of each valve, and the solid lines indicate the opening variation with the fastest closure rate. The closure rate of valve 4 is always close to the fastest closure rate because its initial opening is the smallest compared to other valves and its closure time is the shortest. Small water hammer waves generated during valve closing do not cause any overpressure in the pipeline. During the closing of valves 1, 2 and 3, the closure rate changes drastically, especially when it is almost closed. The closure rate is reduced because the water hammer waves caused by valve closing and pump stop are now overlapping, which may cause overpressure in the pipeline. From this point of view, reducing the closure rate can relieve the water hammer pressure and avoid any overpressure. The closure time of each valve along the pipeline is shown in Table 2.     Figure 3 shows the variation of the cumulative leakage volume. As can be seen from the figure, the leakage is basically constant after 650 s, indicating that the pipeline stop leaking. The slope of the curve from 0 to 650 s gradually decreases, indicating that pressure and flow rate of the leakage section are reduced after the leakage control scheme is implemented. In order to ensure the accuracy of this model, the results are compared with the simulation results of SPS whose leakage volume curve is close to the model.   Figure 4a shows that the pressure at the leak point gradually oscillates and decreases, tending to zero at 650 s. The pressure of the entire valve closure process is less than maximum pressure of the pipeline. Figure 4b shows the change in flow in the pipeline before and after the leak. Positive flow represents the flow from valve 1 to valve 4, and negative flow indicates the opposite direction. The flow periodically oscillates and gradually decreases, becoming zero at 650 s. The steady value of pressure and flow indicates that the leak stops at 650 s, and the result is consistent with Figure 3.   Figure 5 shows the variation of pressure and flowrate at the main nodes of the study pipeline. Figure 5a,b are the curves of pressure and flowrate between the outlet of valve 1 and the inlet of valve 2. It is shown that the pressure of the pipeline section also displays a significant decline after the pump stop at the initial station results in a negative pressure wave spreading through this pipeline section. Then the pressure fluctuates periodically and gradually reduces to a stable value that is higher than the lower limit of pressure and avoids liquid vaporization. Figure 5c,d are the curves of pressure and flowrate between the outlet of valve 2 and the inlet of valve 3, and for a detailed analysis one can refer to Figure 4. Figure 5e,f are the curves of the pressure and flowrate between the outlet of valve 3 and the inlet of valve 4. As the figures show, the pressure in the pipeline increases since the closing valve leads to a boost wave and then the pressure fluctuates periodically and gradually   Figure 4a shows that the pressure at the leak point gradually oscillates and decreases, tending to zero at 650 s. The pressure of the entire valve closure process is less than maximum pressure of the pipeline. Figure 4b shows the change in flow in the pipeline before and after the leak. Positive flow represents the flow from valve 1 to valve 4, and negative flow indicates the opposite direction. The flow periodically oscillates and gradually decreases, becoming zero at 650 s. The steady value of pressure and flow indicates that the leak stops at 650 s, and the result is consistent with Figure 3.   Figure 4a shows that the pressure at the leak point gradually oscillates and decreases, tending to zero at 650 s. The pressure of the entire valve closure process is less than maximum pressure of the pipeline. Figure 4b shows the change in flow in the pipeline before and after the leak. Positive flow represents the flow from valve 1 to valve 4, and negative flow indicates the opposite direction. The flow periodically oscillates and gradually decreases, becoming zero at 650 s. The steady value of pressure and flow indicates that the leak stops at 650 s, and the result is consistent with Figure 3.   Figure 5 shows the variation of pressure and flowrate at the main nodes of the study pipeline. Figure 5a,b are the curves of pressure and flowrate between the outlet of valve 1 and the inlet of valve 2. It is shown that the pressure of the pipeline section also displays a significant decline after the pump stop at the initial station results in a negative pressure wave spreading through this pipeline section. Then the pressure fluctuates periodically and gradually reduces to a stable value that is higher than the lower limit of pressure and avoids liquid vaporization. Figure 5c,d are the curves of pressure and flowrate between the outlet of valve 2 and the inlet of valve 3, and for a detailed analysis one can refer to Figure 4. Figure 5e,f are the curves of the pressure and flowrate between the outlet of valve 3 and the inlet of valve 4. As the figures show, the pressure in the pipeline increases since the closing valve leads to a boost wave and then the pressure fluctuates periodically and gradually stabilizes within the pressure limits.  Figure 5 shows the variation of pressure and flowrate at the main nodes of the study pipeline. Figure 5a,b are the curves of pressure and flowrate between the outlet of valve 1 and the inlet of valve 2. It is shown that the pressure of the pipeline section also displays a significant decline after the pump stop at the initial station results in a negative pressure wave spreading through this pipeline section. Then the pressure fluctuates periodically and gradually reduces to a stable value that is higher than the lower limit of pressure and avoids liquid vaporization. Figure 5c

Exploration for Model Influence Factors
To analyze the factors influencing the valve closure process, the model parameters should be changed to perform the corresponding simulation under the original leak state of the pipeline. There are five scenarios: Scenario (1): Compared with the original state, the leak position at 12.5 km upstream is substituted by 14 km, but the leak point and the original leak position belong to the same pipeline section.
Scenario (2): Compared with the original state, the leak position at 12.5 km upstream is substituted by 17.5 km, and the leak point and the original leak position belong to different pipeline sections.
Scenario (3): Compared with the original state, we vary the leak coefficient by enlarging the area

Exploration for Model Influence Factors
To analyze the factors influencing the valve closure process, the model parameters should be changed to perform the corresponding simulation under the original leak state of the pipeline. There are five scenarios: Scenario (1): Compared with the original state, the leak position at 12.5 km upstream is substituted by 14 km, but the leak point and the original leak position belong to the same pipeline section. Scenario (2): Compared with the original state, the leak position at 12.5 km upstream is substituted by 17.5 km, and the leak point and the original leak position belong to different pipeline sections.
Scenario (3): Compared with the original state, we vary the leak coefficient by enlarging the area of the leak aperture, converting it from 0.00008 to 0.0004.
Scenario (4): Compared with the original state, we rise the pressure along the pipeline with an increment of 0.5 MPa for each node.
Scenario (5): Compared with the original state, we reduce the pressure along the pipeline with an increment of 0.5 MPa for each node.
The simulation result and analysis are shown as below. Table 3 presents the comparison among closure time of valves under different simulation scenarios. Figure 6 shows the closure time of valve 2 under the above five scenarios, as well as the comparison with the original state. As seen in the figure, under scenarios (1), (3) and (5), the closure time of valve 2 is similar to the original state. In other words, there will be less influence on valve closure when changing the leak position (the same pipeline section), leak coefficient and the pressure along the pipeline is declining. Under scenarios (2) and (4), the closure time of both valves is prolonged compared with the original state, which means there will be an influence on valve closing when changing the leak position (different pipeline sections) and enhancing the pressure along the pipeline.
Combined with the interpretation for Figure 5 in Section 5.2, it is known that in scenario (2) after the leak point is altered, the pressure in the leak pipeline section is increased, which is similar to scenario (4). It can be deduced that pressure increase will affect valve closing since water hammer results in a pressure increase in the pipeline, which is prone to overpressure, especially when the pipeline is under higher pressure. Therefore, for the healthy operation of pipelines, valves should be closed gradually during valve closing. Scenario (5): Compared with the original state, we reduce the pressure along the pipeline with an increment of 0.5 MPa for each node.
The simulation result and analysis are shown as below. Table 3 presents the comparison among closure time of valves under different simulation scenarios. Figure 6 shows the closure time of valve 2 under the above five scenarios, as well as the comparison with the original state. As seen in the figure, under scenarios (1), (3) and (5), the closure time of valve 2 is similar to the original state. In other words, there will be less influence on valve closure when changing the leak position (the same pipeline section), leak coefficient and the pressure along the pipeline is declining. Under scenarios (2) and (4), the closure time of both valves is prolonged compared with the original state, which means there will be an influence on valve closing when changing the leak position (different pipeline sections) and enhancing the pressure along the pipeline. Figure 7 shows the closure process of valves under the above five scenarios, where the blue and green curves with no markers indicate the opening variation during the fastest process of valve closing and the slope indicates the fastest closing rate of valves. In the figure, under scenarios (1), (3) and (5), although the rate fluctuates during the whole closure process, it can maintain a higher value. Under scenarios (2) and (4), the curves vary from steep to slow during the whole closure process, and the rate decreases gradually.
Combined with the interpretation for Figure 5 in Section 5.2, it is known that in scenario (2) after the leak point is altered, the pressure in the leak pipeline section is increased, which is similar to scenario (4). It can be deduced that pressure increase will affect valve closing since water hammer results in a pressure increase in the pipeline, which is prone to overpressure, especially when the pipeline is under higher pressure. Therefore, for the healthy operation of pipelines, valves should be closed gradually during valve closing.    (5), although the rate fluctuates during the whole closure process, it can maintain a higher value. Under scenarios (2) and (4), the curves vary from steep to slow during the whole closure process, and the rate decreases gradually.

Analysis on Model Influence Factors
As known from the analysis in Section 5.3, the pressure along the pipeline would affect valve closure. The pressure increase contributes to the increase of the closure time of valves. During the closure process, the rate will gradually slow down in case of overpressure. Thus, this influence factor will be tested next.
The outlet pressure of pumps is perceived as a standard for grade division of the pressure along the pipeline. The outlet pressure improvement of pumps contributes to the pressure improvement along the pipeline. The pressure along the tested pipeline falls into six grades: 2.3, 2.8, 3.3, 3.8, 4.3 and 4.8 MPa. Figure 8 shows the relationship between the closure time of valve 2 and the pressure along the

Analysis on Model Influence Factors
As known from the analysis in Section 5.3, the pressure along the pipeline would affect valve closure. The pressure increase contributes to the increase of the closure time of valves. During the closure process, the rate will gradually slow down in case of overpressure. Thus, this influence factor will be tested next.
The outlet pressure of pumps is perceived as a standard for grade division of the pressure along the pipeline. The outlet pressure improvement of pumps contributes to the pressure improvement along the pipeline. The pressure along the tested pipeline falls into six grades: 2.3, 2.8, 3.3, 3.8, 4.3 and 4.8 MPa. Figure 8 shows the relationship between the closure time of valve 2 and the pressure along the pipeline. The closure time of valve 2 tends to rise up along with the pressure increase along the pipeline, but when the pressure is smaller, the closure time varies slowly since the valve can be closed in the allowable fastest closure rate to avoid overpressure conditions. Along with the pressure increase along the pipeline, the closure curves of valves change slowly in order to reduce water hammer wave. The closure process and time of each valve under different pipe pressures are presented in Figure 9and Table 4.
Meanwhile, the closure time of scenario (2) is less than that of scenario (4) because the pressure in the changed pipeline section improves due to valve closure, but is still lower than the magnitude of the improvement along the pipeline, therefore, less time is required.
In conclusion, with respect to a real pipeline, simulations in advance can figure out the closure process of valves under different pressure. When a leak happens, executing the closure scheme for valves can correspondingly close valves as soon as possible and simultaneously avoid overpressure. pipeline, but when the pressure is smaller, the closure time varies slowly since the valve can be closed in the allowable fastest closure rate to avoid overpressure conditions. Along with the pressure increase along the pipeline, the closure curves of valves change slowly in order to reduce water hammer wave. The closure process and time of each valve under different pipe pressures are presented in Figure 9and Table 4. Meanwhile, the closure time of scenario (2) is less than that of scenario (4) because the pressure in the changed pipeline section improves due to valve closure, but is still lower than the magnitude of the improvement along the pipeline, therefore, less time is required.
In conclusion, with respect to a real pipeline, simulations in advance can figure out the closure process of valves under different pressure. When a leak happens, executing the closure scheme for valves can correspondingly close valves as soon as possible and simultaneously avoid overpressure.

Conclusions
Pipeline leakage hazards can be minimized to a large extent by active control. However, under the leakage conditions, the hydraulic system of the pipeline is quite complicated, and it is difficult to formulate an optimal control scheme of the pipeline hydraulic devices. Since the constraints involve non-linear terms, the current solution algorithms and solvers cannot guarantee a global optimal solution for the non-linear model, therefore, the piecewise linearization method is used to transform the model into MILP, and the model is solved by branch and bound algorithm.
The optimal control on the closed operation for valves under pipeline system leak conditions can be simulated by this model. The closure process and time of valves can be determined to minimize leakage volume as well as water hammer waves. This paper focuses on the closure processes of valves for leaking pipelines under various leak states and pipeline pressures. The following conclusions are given: (1) When pipeline sections leak, the opening of each valve along pipeline systems declines at the fastest feasible closure rate. In this way, the shortest closure time of valves can be obtained, leading to the least leakage volume.

Conclusions
Pipeline leakage hazards can be minimized to a large extent by active control. However, under the leakage conditions, the hydraulic system of the pipeline is quite complicated, and it is difficult to formulate an optimal control scheme of the pipeline hydraulic devices. Since the constraints involve non-linear terms, the current solution algorithms and solvers cannot guarantee a global optimal solution for the non-linear model, therefore, the piecewise linearization method is used to transform the model into MILP, and the model is solved by branch and bound algorithm.
The optimal control on the closed operation for valves under pipeline system leak conditions can be simulated by this model. The closure process and time of valves can be determined to minimize leakage volume as well as water hammer waves. This paper focuses on the closure processes of valves (1) When pipeline sections leak, the opening of each valve along pipeline systems declines at the fastest feasible closure rate. In this way, the shortest closure time of valves can be obtained, leading to the least leakage volume. (2) Locating the leak point in different pipeline sections affects the valve control scheme and closure time. When the original states are different or the distance between the leakage point and the start becomes longer, the closure time will be prolonged. (3) The pressure in pipelines affects the closure time and scheme of valves. As the pressure increases along the pipeline, the closure time before the leak point tends to rise and a lower pressure will contribute to less closure time fluctuation because at this moment, valves will be closed at the fastest allowable closure rate and overpressure will not happen.
In summary, the model proposed in this paper is capable of figuring out the closure process and time of valves under various pipeline states by simulating different pipeline leakage conditions in advance, consequently helping plan a closure scheme for different valves. When leakage occurs, the fastest valve closure and normal pressure fluctuations can be achieved by executing the corresponding closure scheme.  Opening of valves locating at upstream leak pipeline section ψ i Opening of cut-off valves at end moment ∆φ max Upper limit of closed rate of valves