## 3 Calculation Model  
### Calculation Model and Control Equations  
AFT Impulse is widely used for water hammer and transient flow analysis, is suitable for a variety of pumps, valves, and ancillary equipment, and is commonly employed in engineering applications. Allevi, developed by the University of Valencia and other research institutions, has been applied in pipeline wave interference studies and can simulate complex scenarios such as simultaneous multi-valve operations and branched pipeline networks. Flowmaster is a commercial hydraulic simulation software widely used in high-demand industries such as nuclear power and petrochemicals and is capable of analyzing water hammers in large-scale pipeline networks. WANDA Transient is primarily designed for transient flow conditions in pipeline systems, allowing detailed simulations of various components, including valves, pumps, and pressure relief devices. TSNet, an open-source Python package, facilitates integration with other numerical analysis tools and is suitable for studying transient scenarios such as valve closure, pump shutdown, and pipeline leakage [30; 31; 32; 33; 34; 35]. In this study, we focused on Bentley Hammer, a commercial software based on the MOC, to simulate the transient characteristics of multi-branch pipelines. The Bentley Hammer software is suitable for the design, analysis, and simulation of hydraulic systems across various water engineering fields, such as the design and optimization of water supply, drainage, and irrigation systems. It primarily focuses on water hammer simulations within hydraulic systems, including various hydraulic calculations related to components such as pipelines, pumps, and valves, and analyzes hydraulic shocks or water hammer phenomena within pipeline systems. Calculating the water hammer pressure primarily involves solving the water hammer motion equations and setting the boundary conditions for the inlet and outlet air valves as follows:  
In pressurized pipelines, the equations of motion and continuity of fluids must be adhered to. According to the elastic water hammer theory, the water hammer motion equation is as follows [36]:  
\[\frac{\partial H}{\partial x}+\frac{1}{g}\frac{\partial V}{\partial t}+\frac{ V}{g}\frac{\partial V}{\partial x}+\frac{f}{D}\frac{V|V|}{2g}=0 \tag{1}\]  
Considering the pipeline material and water as elastic bodies, the continuity equation is expressed as follows:  
\[\frac{\partial H}{\partial t}+\frac{a^{2}}{g}\frac{\partial V}{\partial x}+V \frac{\partial H}{\partial x}=0 \tag{2}\]  
In the above three equations: \(H\) is the water head at a certain point in the pipeline, in meters (m); \(x\) is the position coordinate along the pipeline axis, in meters (m); \(g\) is the acceleration due to gravity, in meters per second squared (m/s\({}^{2}\)); \(v\) is the flow velocity within the pipeline, in meters per second (m/s); \(f\) is the friction coefficient of the pipeline;  
Figure 2: Two-dimensional modeling profile of the pipeline. \(D\) is the diameter of the pipeline, in meters (m); \(t\) is the time, in seconds (s); \(a\) is the angle between the pipeline and the horizontal plane, in degrees (\"); \(a\) is the speed of the pressure wave propagation, in meters per second (m/s). The friction factor \(f\) is not constant but is automatically updated at each time step in the software based on the current Reynolds number. To simplify the mathematical model, this study adopts the quasi-steady friction assumption, which makes the model more suitable as a practical tool for pipeline design and operation. While unsteady friction models can enhance simulation accuracy, they require more experimental data and a more complex simulation process [37]. Given that this paper primarily focuses on conventional water hammer calculations for the design and operation of the Xinlongkou Power Station, the quasi-steady friction assumption was chosen.