Numerical Modeling and Hydraulic Optimization of a Surge Tank Using Particle Swarm Optimization

.


Introduction
Hydraulic transients occur whenever there is a disturbance in the steady state condition of a system, causing variations in pressure and discharge in the system.The control of hydraulic transients in pressurized systems like water supply, wastewater, and hydropower systems, is a major concern for engineers regarding the safety and effective operation of the system throughout the life span of the project.Uncontrolled hydraulic transients in the system have led to several cases of accidents in hydropower stations in the past [1][2][3].A number of methods and models have been developed for the analysis of hydraulic transients, like the graphical method, the algebraic method, the implicit method, the wave characteristic method, the Method of Characteristics (MOC), the Zielke model, the Brunone model, Surge2012, and much more commercial software [4][5][6][7][8][9].Calamak et al. [10] developed a computer program using MOC, which accurately predicted pressures for various simulations in case studies having a Pelton and Francis turbine.Martin et al. [11] performed 3-D and 1-D simulations for various unsteady friction formulations and discovered that the convolutionbased unsteady friction models, which consider a set of previous time steps in simulation, perform better than the instantaneous acceleration-based models.Among these methods, MOC is a very popular method, as it gives accurate results with a shorter computational time for analyzing the hydraulic transients in a pipeline system, and can be conveniently used in computer modeling [12,13].In this study, MOC is used, considering the steady-state friction along the pipe, for numerical modeling and hydraulic transient analysis of the given generalized hydropower system, where the transient is generated by gradual closing and opening of the valve.
Researchers have extensively studied hydraulic behaviors of the pressurized system to discover methods for improvements and successfully tackle hydraulic transient complications in the system.Yu et al. [14] performed 1-D analysis of a complex differential surge tank for a long diversion-type hydropower station using MOC and concluded that the high pressure difference produced between two sides of breast wall during transient conditions can be effectively reduced by setting appropriate pressure reduction orifices.Guo et al. [15] reviewed transient processes and safety measures for hydropower stations with long headrace tunnels, and revealed that the maximum pressure in hydropower stations with long headrace tunnels depends on the maximum water level in the surge tank, rather than the closing mechanism of the guide vane.Zhou et al. [16] introduced the addition of interconnecting holes in a differential surge tank, which significantly reduced the pressure on the breast wall and made gate maneuver much easier and more effective.Covas and Ramos [17] used inverse transient analysis for the identification of the location of a leak in a water pipeline system through a transient generated by fast change in flow conditions.Balacco et al. [18] carried out laboratory experiments on an undulating pipeline consisting of an orifice for air venting, creating a complex air-water environment.They analyzed the pressure surge build during rapid filling of the pipeline and found that the maximum pressure is reached during the mass oscillation phase.A plethora of research could be found on the sensitivity analysis of parameters like diameter of the orifice (DO), diameter of the surge tank (DS), working head, operating discharge, valve closure mechanism, pipe material and diameter, etc., for various transient effects [19][20][21][22][23] Hydraulic transients in pressurized systems are complex phenomena which are interdependent of several parameters, and also highly site-specific.Thus, designing an effective and well-optimized hydraulic system is always a challenging work.Several attempts of optimizing the orifice in a surge tank have been made using 1-D and 3-D simulations [24][25][26][27].Similarly, different optimizing tools have been successfully employed to obtain the most advantageous design of hydraulic systems.Afshar et al. [28] applied the NSGA-II optimization algorithm for developing an optimized closingrule curve for valves to control the effects of a water hammer in pressurized pipelines.Kim et al. [29] implemented the genetic algorithm (GA) with the impulse response method, and then optimized the location and dimensions of a surge tank considering the safety and cost of the system.Fathi-Moghadam et al. [30] employed GA to optimize the diameters of a headrace tunnel, penstocks, and surge tank considering the benefit-cost ratio as the objective function.Their model successfully optimized the diameters in a system consisting of branching tunnels and penstocks with a surge tank.Jung et al. [31] integrated both GA and PSO simultaneously with hydraulic transient analysis to discover the best location and combination of transient protection devices in a pipe network.Similarly, Moghaddas et al. [32] compared central force optimization (CFO) and GA for optimizing the pipeline protection cost of a water transfer project considering hydraulic transients induced during pump maneuver.They optimized the volume of the air chamber along with the location and type of air-inlet valves with minimum cost as the objective function.Generally, researchers have performed the optimization of a surge tank considering the cost of the project as the objective function and including some hydraulic transient characteristics, while optimization dedicated to reducing the severe effects of the extreme transient conditions is very limited.This study solely emphasizes the hydraulic transient characteristics of the system and uses PSO for optimization of the diameter of the surge tank (DS) and diameter of the orifice (DO).Generally, researchers have used GA for optimization, while PSO has been proved to be more convenient and effective.GA is more suitable for discrete optimization and has been more rigorously studied and applied in diverse fields due to its much earlier introduction (in 1989) than other modern optimization techniques, while PSO is a much more recent technique (in 1995) and suitable for continuous optimization problems and has a higher converging speed towards the solution [33][34][35][36].Hassan et al. [37] compared PSO and GA and discovered that the computational effort and efficiency required for PSO to reach a high-quality solution is significantly less than that of GA to reach the same high-quality solution.Similarly, Kecskes et al. [38] and Duan et al. [39] also compared PSO and GA on their respective models and discovered that PSO was better and has a high convergence ratio compared to GA.On the other hand, every engineering problem has their own unique characteristics which demand certain alterations in general optimization procedures.In this study, we have attempted to optimize the surge tank based on its hydraulic transient characteristics with a highly non-linear solution and constrained variables.In these conditions, PSO is much easier to formulate and apply for optimization and it acquires the global optimization value quickly and conveniently with fairly agreeable results.
In this study, a generalized system of a high-head hydropower station is selected for analysis during extreme cases of hydraulic transients.The system consists of a constant-head upstream reservoir, headrace tunnel, orifice surge tank, penstock pipe, and turbine at the end of the penstock.Because this study mainly focuses on the surge analysis and hydraulic optimization of the surge tank, the downstream turbine can be simplified into a valve boundary, as shown in Figure 1.First, 1-D numerical modeling and analysis of the hydraulic transients, occurring due to valve operation of the system, is carried out by using MOC.Gradual closing of the valve during the maximum water level in the reservoir and gradual opening of the valve during the minimum water level in the reservoir are considered as the two worst cases, which give the maximum and minimum water level in the surge tank, respectively.Secondly, major hydraulic transient behaviors in the system are studied and analyzed.Finally, the necessary objective functions and constraints are developed regarding the transient behavior of the system, and optimization is performed using the Particle Swarm Optimization (PSO) method to find the optimum diameters of the surge tank (DS) and orifice (DO).The results obtained are compared with the contemporary methods of finding DO and DS, and discussions are presented.

Governing Equations
The 1-D governing equations for the physics of hydraulic transients are the equations of motion and continuity, also called the Saint-Venant equations [12].These are hyperbolic quasilinear partial differential equations, and, having no analytical solution, they are most accurately solved by MOC.
where H is the piezometric head; V is the mean flow velocity; f is the Darcy-Weisbach friction factor; D is the diameter of the pipe; g is the acceleration due to gravity; and c is the wave speed.

Method of Characteristics
For 1-D numerical modeling of the hydropower system, the most widely used method called Method of Characteristics (MOC) is applied, as proposed by Wylie et al. [12], which converts the equations of motion and continuity into two ordinary differential equations that are then solved as a simple form, Equations ( 3) and (4), by the finite-difference method.
− :    =   +    (4) where Hi and Qi are the piezometric head and discharge, respectively, at any time and location; A is the area of the pipe; and f is the coefficient of friction.As shown in Figure 2, the characteristic lines C + and C − intersect at point P. Thus, with the known initial values during a steady state condition, Equations ( 3)-( 8) give the values of head and discharge at a particular time and position in the x-t grid.

Boundary Conditions
In this study, we considered a simple model of a high-head hydropower system for hydraulic transient analysis and optimization of its hydraulic characteristics.1-D numerical analysis was carried out using MATLAB.Based on the layout of the hydropower system shown in Figure 1, the following boundary conditions were established, as described by Wylie et al. [12].

Reservoir
The system consists of an upstream reservoir and it is assumed that water level of the reservoir remains constant during transient evaluation.
1 =   (9) where   1 is the piezometric head at the reservoir and Zres is the water level of the reservoir.

In-Line Surge Tank
In the pressurized water conveyance system, the surge tank is a very important structure to effectively control the hazardous effects of hydraulic transients.In this study, the restricted orifice surge tank, as shown in Figure 3,is located at the end of the headrace tunnel.The equations defining the boundary conditions of the restricted orifice surge tank are presented below [12]: where Q1 and Q2 are the discharges in pipe 1 and pipe 2, respectively, at the point of surge tank; QS is the discharge flowing into the surge tank; HP is the piezometric head in the pipe at the bottom of the surge tank; ZS is the water level in the surge tank, also referred to as surge head in further sections; QS0 and ZS0 are the previous discharge and water level in the surge tank, respectively; AO and AS are the area of orifice and area of surge tank, respectively; Cd is the coefficient of discharge; Δt is the iteration time period considered for simulation; T is the time period for mass oscillation in the surge tank; and Lt and At are the length and area of the headrace tunnel, respectively.Equations ( 3), (4), and ( 10)-( 12) are solved together to get the values of the variables at the surge tank boundary.

Free Discharge Valve at the End
In this model, linear gradual opening and closing of the valve causes transients.For gradual closure, the time period of closure of the valve is more than the pipe characteristic time, i.e.,   > 2  .
The time of closure/opening of the valve for general surge analysis and the optimization procedure is considered to be 10 s according to the practically used closing time of guide vanes in hydropower stations.In surge analysis, the closing/opening of valve is started at 5 s and the valve is completely closed/opened at 15 s in linear progression.Later, in Section 3.5, an elaborated analysis is conducted to demonstrate the transient changes for various closing/opening times of the valve, including both fast and gradual closure/opening.The equations determining the valve boundary conditions are as follows [12].
where   +1 is the discharge at the valve; τ is the valve opening; Q0 is the steady state flow; and H0 is the operating head across the valve, and for a free discharge valve, H0 is the piezometric head at the inlet of the valve.

Stability Criteria
The hydraulic transient causes pressure and discharge fluctuations in the surge tank.During such conditions, the surge tank is vulnerable to various instabilities.For a surge tank to be stable and effective, the following criteria must be fulfilled:

Minimum Area of Surge Tank
During hydraulic transients, fluctuation of the water level occurs in the surge tank, which must be dampened in a reasonably short time to ensure the stability of the system.In addition to this, the maximum and minimum water level in the surge tank should be properly analyzed so that the system stays safe in the worst condition.For this, Thoma derived an equation called the Thoma equation, which gives the minimum area of a stable surge tank [40].However, Jaeger later proved that this area is not sufficient for the stability of a surge tank and introduced a safety coefficient in the Thoma equation [41].
where Ath is the Thoma area; e is the safety coefficient; Lt and At are the length and area of the headrace tunnel, respectively; Ho is the gross head in the turbine;    is the head loss in the headrace tunnel;    is the head loss in the penstock; Zmax is the maximum water level in the surge tank; and Q is the discharge in the tunnel.

Vortex Control
In the case of start-up of the pressurized water conveyance system, the surge tank acts as a temporary intake, supplying discharge to the system.This causes hydraulic transients in the system and the water level in the surge tank falls down to its minimum level.During such conditions, if the water level falls below a certain elevation, there is a very high risk of vortex formation or air entrainment, which can have devastating effects on the system.The following steps were followed to check the vortex formation in the system after the optimized values of DO and DS were obtained: 1.The minimum possible down surge that can be created in the system is calculated, which is defined as objective function 2 in Section 2.5.3; 2. From this minimum water surface elevation, the bottom surface elevation of the surge tank is subtracted to obtain the height of the minimum water column in the tank; 3.Then, the critical submergence for the possible suction vortex is calculated using the Gordon equation [42]: where Scr is the critical submergence depth; c is an empirical coefficient whose value ranges from 0.55 to 0.73 (c = 0.55 for symmetrical intake); V is the velocity at intake; and d is the diameter of the pipe at intake, and for this case, the velocity and the diameter of penstock pipe are considered to check vortex formation in the surge tank.The minimum water column depth in the surge tank must be greater than the critical submergence depth (Scr) to prevent the formation of a harmful vortex in the system.

Optimization
First, 1-D numerical modeling and analysis of the hydropower system were conducted for linear gradual closing and gradual opening of the valve, respectively, using MATLAB and the values of the piezometric head and discharge at the surge tank were obtained using MOC.From these obtained values, the following objective functions and constraints were developed for optimizing the diameter of the surge tank (DS) and the diameter of the orifice (DO).

Objective Function 1
The maximum water level in the surge tank (Max1) is reached during full load rejection, as shown in Figure 4a, when the system is working with full capacity and the reservoir is at the highest water level.This value is obtained in this study by 1-D numerical modeling of the system using MOC.This value gives the maximum possible water level in the surge tank and determines the height and performance of the surge tank during the worst transient condition and hence, plays a vital role in surge tank design.Minimization of this maximum value is taken as the first objective function in this study.Many researchers have derived empirical or stochastic equations for simplicity in the calculation of the maximum surge head in the surge tank [43][44][45][46], but MOC gives the most accurate results for surge analysis from which the maximum value can be easily obtained.
Minimize: F1(x1, x2) where F1(x1, x2) is the function for the maximum water level for different diameters of the orifice (x1) and diameters of the surge tank (x2).

Objective Function 2
The minimum water level in the surge tank (Min1) is reached during full load acceptance, as shown in Figure 4b, when the system is put into operation with minimum capacity and the reservoir is at the lowest water level.This gives the value of the lowest possible water level in the surge tank, or the lowest submergence depth, which essentially determines the safety of the system from harmful vortices or air entrainments.This minimum value, obtained after surge analysis of the worst scenario of transients for the lowest possible water level in the surge tank using MOC, is assigned as objective function 2. The value of the lowest submergence depth should be increased to ensure effective working of the system, even in severe hydraulic transients.

Objective Function 3
Whenever hydraulic transients occur in the system, oscillation of pressure and discharge is observed, which is gradually dampened by friction and various surge controlling devices, like the air chamber, surge tank, pressure release valves, etc. Damping of surge waves is a very crucial characteristic of the surge tank and effective surge tanks are required to dampen the surge waves as quickly as possible.In this study, we performed surge analysis for the worst condition of transients that gives the maximum water level in the surge tank, as explained in Section 2.5.1, extracted two successive values of maximum water level as shown in Figure 4a, and calculated the percentage of damping of surge waves using Equation (23).
where D is the percentage of surge pressure damping; and Max1 and Max2 are the first and second maximum water level during full load rejection, respectively, as shown in Figure 4a.

Normalization
The nature of the three objective functions chosen in this study is highly conflicting and the range of their values is also very diverse, as shown in Section 3.2.Hence, normalization was done so that all objective functions fell into a similar range, and could be combined under a single objective function.The unity-based normalization was used, which brings all the values in the range of [0, 1].
where F(x1,x2) is the normalized objective function; FiN(x1,x2) represents the individual objective functions; and Fi,max and Fi,min are the maximum and minimum values of each objective function within the given range, respectively.

Variables and Constraints
This study intends to find a well-optimized surge tank which effectively overcomes all the hydraulic transient complications.The diameter of the orifice (DO) and the diameter of the surge tank (DS) are considered as variables during the optimization.The lower and upper limits of these diameters are determined as follows: According to the "Chinese design code for surge chamber of hydropower stations", the minimum and maximum area of the orifice must be 25% and 45% of the area of the headrace tunnel, respectively, for optimum performance of the surge tank [19,47].Hence, we obtained, For the diameter of surge tank (Ds), the minimum value is obtained by the Thoma area, as discussed in Section 2.4.1, and the maximum value is taken to be 12 m based on the preliminary observations, as presented in Section 2.8, and the results obtained during optimization.Thus, we have, 

𝑚 ≤ 𝐷 𝑆 ≤ 12 𝑚
Besides these, the difference between the maximum piezometric head at the bottom tunnel of the surge tank and the maximum water level of the surge tank plays a crucial role in designing an efficient surge tank.In this study, the DO and DS are accepted only when the difference between the maximum head at the bottom tunnel and the maximum water level in the surge tank is less than 1 m.When the difference is higher, the surge tank is not effective and the headrace tunnel becomes more vulnerable to transient effects [47].

 𝑚𝑎𝑥(𝐻 𝑃 ) − 𝑚𝑎𝑥(𝑍 𝑆 ) ≤ 1 𝑚
where   is the piezometric head at the bottom tunnel of the surge tank and   is the water level in the surge tank.

Acceptance Region
The constraints described in Section 2.7 define the total population for optimization and also distinguish valid and invalid regions based on the difference of the maximum piezometric head at the bottom tunnel of the surge tank and the maximum water level in the surge tank.Figure 5 shows various values of DO and DS within the range of optimization discussed earlier.The green area in the graph shows the valid region, where the value of the difference of the maximum heads is less than 1 m, and the red area in the graph shows the invalid region, having the difference of the maximum heads of more than 1 m.This eventually makes the optimization problem highly non-linear and discontinuous and the individual objective functions are highly conflicting in Figure 5. Acceptable (green) and unacceptable (red) region in the total population.

Particle Swarm Optimization
The Particle Swarm Optimization (PSO) is a nature-inspired, metaheuristic stochastic optimization tool developed by Kennedy et al. [34].PSO imitates the social behavior of swarm in which, initially, a random set of the population is selected, and then, in each iteration, each particle explores and moves to a new location based on the best solution of that individual particle, and the best solution of all the particles.A parameter called velocity is added to each particle's position in each iteration, which moves it towards the global minimum or maximum.Due to its simplicity and robust nature, PSO can easily optimize complex problems and has been widely used in engineering optimization works.
= 1, 2, . . . ., ;   = 1, 2, . . . .,  where (Xj)i and (Vj)i are the position and velocity of the jth particle in the ith iteration; c1 and c2 are cognitive and social learning rates; r1 and r2 are random numbers in the range of 0 and 1; (Pbest,j)i is the best result obtained for the jth particle till the ith iteration; (Gbest)i is the best result among all particles till the ith iteration; θi is the inertia weight for the ith iteration, developed by Shi et al. [48], to dampen the velocities over each iterations for efficient optimization; θMax and θMin are the maximum and minimum values of inertia weight, respectively; and M and N are the total number of population and iterations used in PSO, respectively.
Figure 6 shows the flowchart for PSO used for the optimization of the hydraulic characteristics of the generalized hydropower system.In this study, when the difference of the maximum head at the bottom tunnel at the point of the surge tank and the maximum water level in the surge tank is less than or equal to 1 m (  ≤ 1 m), the solution and corresponding DO and DS are considered acceptable, while, when   is more than 1 m, they are considered unacceptable.If this head difference is smaller, it ensures efficient working of the surge tank [47].During optimization, to avoid the solutions of the unacceptable region, a technique of reducing the position is applied, as shown in Figure 6.Whenever the new position of any particle is calculated using Equation ( 28), if the new position falls into the unacceptable region, then the average of the previous position and current position is taken as the new position, and again, the region of the new position is checked.Every time, the velocity of the new position is reduced by half until it falls into the acceptance region.If the new position does not lie in the acceptance region for 50 iterations, a random new position is assumed within the range of the variables.This reduction in new positions reduces the speed of acquiring the global minimum or maximum, but more importantly, it enables the program to stay in the acceptable region during all calculations.

Surge Analysis
The surge behavior in the surge tank reveals important characteristics of transients occurring in a pressurized water conveyance system.The given generalized hydropower system is first analyzed numerically for gradual closure and opening of the valve respectively using the MOC.This method has been experimentally validated by several researchers in real world problems [6,11,14,[49][50][51].In recent years, many model tests for the hydropower systems have been conducted in the laboratory, mainly including the hydraulic characteristics of the surge tank [49,50].The models provided complete head loss coefficients for water flowing into or out of the surge tank, which revealed the complete hydraulic transient processes during load rejection or load acceptance, and also display great agreement with the results obtained by MOC.Thus, MOC is widely accepted as a reliable tool for accurate numerical analysis involving computer modeling, especially for surge analysis.
The system consists of a headrace pipe of length 570 m (head loss coefficient R = 6.81687 × 10 −6 ) and a penstock pipe of length 1000 m (head loss coefficient R = 9.3451 × 10 −6 ).It is divided into 157 sections, each of a 10 m length, with 158 nodal points.Applying Courant's condition, i.e., ∆ =   , the time step of analysis is taken to be 0.008 s.An upstream reservoir is located at node 1 in the system.The maximum and minimum operational water level of reservoir are 520 m and 500 m, respectively, and the valve discharge is 132.4 m 3 /s.The restricted orifice surge tank with DS = 9 m and DO = 4.3 m is at the end of the headrace tunnel at node 58 and a free discharge valve at the end of the penstock at node 158.The time of closure and opening of the valve was 10 s and the total time of analysis was 200 s.Initially, a steady state condition was modeled, and then the closing/opening of valve was started at 5 s and the valve was completely closed at 15 s in linear progression.Surge analysis was carried out to reveal important hydraulic characteristics occurring due to gradual closure and opening of the valve.Later, PSO was used to optimize the diameter of the orifice and the diameter of the surge tank to improve the transient controlling capacity, and design a more efficient and effective surge tank.
Figure 7 depicts the most important characteristics of the hydraulic transient in the hydropower system due to valve maneuver, which plays a vital role in surge tank design.Figure 7a shows the water level in the surge tank, during the maximum water level in the reservoir and full load rejection condition.Hence, the maximum value of surge head shown by the graph indicates the maximum possible surge head reached for the given condition of valve closure.Initially, the water level is constant for 5 s, which represents the steady state condition.After the start of valve closure at 5 s, the water level gradually rises to its maximum value and starts oscillating to consecutive maximum and minimum values due to water hammer action.Damping of surge waves in this condition occurs gradually and its value, as given by Equation ( 23), is calculated to be 1.378%.Similarly, Figure 7b shows the water level in the surge tank during the minimum water level in the reservoir and full load acceptance condition and hence it reveals the minimum possible water level for the given time of valve opening.The initial horizontal line represents the steady state for 5 s, valve opening is started at 5 s, and the water level drops to its lowest value and then starts oscillating.Discharge is kept constant, regardless of the water level in the reservoir.Damping of surge waves during the valve opening condition occurs very fast, while during valve closing, surge waves dampen gradually and hence, damping of surge waves during the valve closing condition should be properly analyzed.The theoretical value of the time period of surge waves, given by Equation (15), is calculated to be 69.524s, and from this analysis, this value is found to be 69.888s.This shows that the modeling and analysis results are fairly accurate.

Effects of Changing Do and Ds
The maximum and minimum water level in the surge tank as shown in Figure 8 and damping of surge waves is the most important characteristic, which determines the efficient design and stability of the surge tank.The sensitivity of these three parameters is analyzed with varying diameters of orifice (Do) and diameters of surge tank (Ds), as shown in Figure 8.As the DO is increased, the value of maximum head gradually increases and minimum head gradually decreases.Thus, the lower value of DO is more favorable, which was also concluded by Diao et al. [19].Contrary to that, when the DS is increased, the maximum water level gradually decreases and the minimum water level gradually increases.Thus, it can be concluded that a higher value of DS is favorable to minimize hydraulic transient effects in the system.The percentage of damping of surge waves during gradual valve closure first increases, reaches a maximum, and then decreases with increasing DO, and damping gradually decreases with an increase in DS.In addition to this, the difference of the maximum piezometric head at the bottom tunnel of the surge tank and the maximum water level in the surge tank is required to be below 1 m for an effective surge tank.All these features make the system highly conflicting and discontinuous, and thus, a robust optimizing tool is required to obtain global optimum values of the variables within the defined constraints.Three major characteristics of hydraulic transients in the given system, as discussed in Section 5.1.1,are taken as the objective functions for optimizing DO and DS.For normalizing the three individual objective functions into a single objective function, the maximum and minimum values of each individual function are required, which are calculated using the PSO in each objective function within the given range of variables.Table 1 shows the obtained minimum and maximum values, which can also be verified by analyzing the nature of graphs presented in Figure 8.

Optimization with PSO
As described earlier, the maximum water level, the minimum water level, and damping are chosen as objective functions for optimization, with diameter of the orifice (DO) and diameter of the surge tank (DS) as variables.All three objective functions are reduced to minimization problem and a single objective function is designed by using normalization.The cognitive and social learning rates are taken to be 1 (c1 = c2 = 1).Initially, random values of the variables are provided, and then, 500 iterations are carried out with a population size of 10.Due to the small range of variation of variables, a small is considered and the discontinuous nature of the problem, as discussed in Section 2.8, required a large number of iterations before the optimized values were obtained.The following graph in Figure 9 shows the convergence of the values towards the optimum minimal solution after optimization with PSO.After performing PSO for the given system, the optimized values of DO and DS were obtained to be 4.1 m and 11.362 m, respectively.These optimized dimensions of the surge tank produced significant improvements in the maximum and minimum water level in the surge tank, while the damping of surge waves was not improved, as shown in Table 2.In order to improve the damping of surge waves, a weighting factor of 0.25, 0.25, and 0.5 was multiplied in each objective function, respectively, and optimization was performed again.The optimized values were obtained as Do = 3.684 m and Ds = 6.434 m and better damping of surge waves was obtained, while the values of the maximum and minimum water level in the surge tank were worse than the original case.For these two optimization cases and the original case, surge analysis is carried out and the results are presented in Figure 10.The values of each objective function for all three cases are tabulated in Table 2 and improvements obtained are analyzed.After examining the results shown in Figure 10 and Table 2, the first case of optimization is concluded to be better than the other one.An improvement of 4.706 m and 4.486 m in maximum and minimum possible water levels in the surge tank, respectively, were obtained in this case for the given hydropower system.Hence, the optimized values are taken as Do = 4.1 m and Ds = 11.362m and surge analysis is conducted showing piezometric head at the bottom tunnel of the surge tank and water level in the surge tank referring to these values, as shown in Figure 11.The difference of maximum head for these two cases during the valve closure condition is found to be 0.999 m and the graphs for these two heads are almost overlapping, which indicates sound functioning of the surge tank.Thus, in this optimization, both water level in the surge tank and piezometric head at the bottom tunnel are effectively controlled for the optimum performance of the surge tank.

Vortex Formation Check
The minimum possible surge head in the surge tank during hydraulic transients in the given system after optimization was found to be 485.095m.Elevation of the bottom of the surge tank was 450.00 m and hence the minimum water column height in this system became 35.095 m.From Equation ( 22), the critical submergence depth of flow was calculated to be 6.638 m, which is way below the minimum water column height in the surge tank.Therefore, the optimized surge tank effectively prevents the formation of a vortex in the system during the worst hydraulic transient condition.

Time of Closure and Opening of Valve
The closure and opening time of the valve can have significant effects on the transients occurring in the system [23][24][25]28].Generally, in hydropower projects, gradual closure and opening of valve is adapted for adjusting the condition of flow in the system and power demands.In this study, all the analysis is conducted with linear closing and opening of the valve in 10 s.Figures 12 and 13 show the sensitivity analysis for valve closing/opening time in linear progression for the optimized values of DO and DS.The valve closing/opening time is changed from 10 s to 60 s at an interval of 10 s.For time of closure from 10 s to 30 s, the maximum water level is almost the same and it gradually decreases for a further increase in closing time, as shown in Figure 12.Similarly, for the valve opening case, the minimum water level gradually increases with an increase in valve opening time, as shown in Figure 13.Hence, as valve maneuver time increases, the maximum water level decreases and the minimum water level increases, and thus the effects of transients are slightly reduced.Generally, the effect of changing gradual closing/opening time of the valve has negligible effect in surge analysis [15], but in this case, the effect is significant.Hence, valve or guide vanes' closing/opening time is also an important parameter for the hydraulic optimization of the surge tank for this study and should be considered in future optimization cases.An elaborate study on the effects of changing closure time for maximum piezometric head at the bottom tunnel of the surge tank and maximum water level in the surge tank is performed, as shown in Figure 14.The pipe characteristic time for this case is 1.667 s and closing of the valve below this time indicates fast closure of the valve.The maximum pressure head at the bottom tunnel of the surge tank is very high for fast closure and it quickly decreases as soon as gradual closure occurs and gradually becomes almost constant after the valve closing time reaches 15 s.Contrary to that, the maximum water level in the surge tank during fast closure is lower and it increases linearly till 2.5 s of valve closing time, and afterwards, the changes in the maximum water level in the surge tank are very small.The difference of these two pressure heads for a closing time of more than 10 s is less than 1 m, which indicates effective functioning of the surge tank.The effects of fast closing of the valve are more significant in tunnel pressure changes, while for the surge tank, they are comparatively less significant.

Conclusions
Surge tanks are very important structures for a pressurized water conveyance system, which prevents the harmful effects of hydraulic transients in the system.Valve or guide vane operation is a very frequent phenomenon in a hydropower or other water conveyance system with a surge tank, which causes harmful transients and the system should be robust enough to cope with such hazardous The efficient design of a surge tank is vital to ensure maximum benefit and safety in the system.In this study, surge analysis is carried out to examine vital parameters of hydraulic transient caused by opening and closing of the valve.Further, optimization is done using PSO to investigate the best values of DO and DS and enhance the performance of the surge tank.Effects of various parameters during hydraulic transients are studied and favorable conditions are discussed.The following are the conclusions made in this study: 1.A model of a generalized hydropower system consisting of an upstream reservoir, an orifice surge tank, conduit pipes, and an outlet valve was designed and numerically analyzed using MOC in MATLAB.Surge analysis by MOC revealed the variation of water level in the surge tank in different conditions and assisted in defining and modeling the required hydraulic parameters for optimization of the surge tank; 2. The maximum and minimum possible water level in the surge tank and damping of surge waves were considered as the important parameters for surge tank optimization.Analyses in this study show that these transient behaviors are highly conflicting in nature for different values of DO and DS.In addition, for certain values of DO and DS, the difference of maximum piezometric head at the bottom tunnel of the surge tank and maximum water level in the surge tank becomes unacceptable.Hence, a proper optimization method is necessary to investigate the best values of DO and DS to enhance the efficiency of the surge tank and minimize the effects of transients in the worst conditions; 3. The Particle Swarm Optimization successfully optimized the values of DO and DS with a significant improvement in the maximum and minimum water level in the surge tank with reasonable damping of surge waves and the recommended surge tank was free from vortex formation.The overall performance of the surge tank is better than the contemporary methods; 4. Based on the sensitivity analysis of the valve's closing and opening time, significant changes were observed in surge analysis for different closing and opening times of the valve.This indicates that valve or guide vanes' closing/opening time should also be considered during the hydraulic optimization of the surge tank in further cases.The difference of maximum piezometric head at the bottom tunnel of the surge tank and maximum water level in the surge tank was studied for various times of closure of the valve and it is concluded that the closing time of the valve results in more significant pressure changes in the penstock pipe and headrace tunnels, while in the surge tank, the effect is comparatively lower.
This study establishes a foundation for the design of a hydraulically optimized restricted orifice surge tank using PSO.In future research, more parameters like location of the surge tank, valve closure time and mechanism, bifurcation of penstocks, etc., could be included in optimization.In addition to that, optimization of other types of orifices or other surge controlling devices could also be done.

Figure 1 .
Figure 1.General layout of the hydropower system.

Figure 2 .
Figure 2. Characteristic lines in x-t grid.
Minimize: −F3(x1, x2) where F3(x1, x2) is the function for the percentage of damping obtained for different values of diameter of the orifice (x1) and diameter of the surge tank (x2) (negative sign is for minimization).These three objective functions are combined into a single objective function using normalization.

Figure 4 .
Figure 4. Water level vs time graph for a restricted orifice surge tank during linear gradual closure of the valve (a) and linear gradual opening of the valve (b).

Figure 7 .
Figure 7. Surge analysis in surge tank during transients caused by gradual closing (a) and opening (b) of valve.

Figure 9 .
Figure 9. Graph showing the minimization of results in each iteration using PSO.

Figure 10 .
Figure 10.Comparison of surge analysis for different cases of valve closing (a) and opening (b).

Figure 11 .
Figure 11.Piezometric head at the bottom tunnel of surge tank and water level in surge tank during gradual closing (a) and opening (b) of valve.

Figure 12 .
Figure 12.Surge analysis for gradual closure of the valve with varying time of closure of the valve (τc).

Figure 13 .
Figure 13.Surge analysis for gradual opening of the valve with varying time of opening of the valve (τo).

Figure 14 .
Figure 14.Maximum piezometric head at the bottom tunnel of the surge tank (HP.max) and maximum water level in the surge tank (ZS,max) for different times of closure of the valve.

Table 1 .
Maximum and minimum values of each objective function.

Table 2 .
Comparison and improvements in each objective function after optimization.