{'fraction_non_alphanumeric': 0.02638857740898557, 'fraction_numerical': 0.008746355685131196, 'mean_word_length': 4.518976897689769, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Deriving the Governing Equations for Shock Damper to Model and Control the Unsteady Flow Caused by Sudden Closer of Valve

This paper focuses on deriving the governing equations for an instrument used in water flow systems known as “shock damper”. Shock damper is a tremulous tool with a single degree of freedom system which includes tank, connecting pipe, mass, spring, and a damper. This tool is then applied as a boundary condition for characteristic lines equations. Additional equations will be included by considering conservation of mass, momentum, and energy. This system of equations is then explicitly solved at each time step. In order to illustrate the performance of the shock damper, a gravity-feed system is considered with and without a damper. The control valve of this system will suddenly be shut to impose a water hammer condition. Then, unsteady flow parameters such as minimum/ maximum of flow velocity and pressure are evaluated along with a sensitivity analysis. Results demonstrate that shock damper despite being simple and economically efficient, is highly capable of moderating unsteady flow characteristics.


Introduction
One of the key factors in designing a water distribution system is to consider the effects of possible unsteady flow caused by water hammer. Water hammer is a pressure surge or wave propagating with the speed of sound and is created when a fluid (usually a liquid) in motion is forced to stop or change direction suddenly (momentum change). This phenomenon can occur due to various reasons including rapid opening and/or shutting of a valve, failure of a pump, joint, or pipe, use of check valves. Water hammer causes intensive damages in some cases, making it a significant factor while designing water distribution systems.
Two different approaches have been reported to tackle this problem: a) taking necessary precautions to avoid the occurrence of sudden change of flow velocity (or direction) hence water hammer; and b) equipping the water system with efficient tools to dampen water hammer wrecking impacts. Since water hammer seems inevitable, the second approach is widely employed. Use of such tools (e.g. shock dampers) helps in depreciating consequences of unsteady flow due to water hammer by compensating any change in flow pressure. Equipment used to dampen water hammer can be categorised into surge tanks and safety valves [1]. In order to simulate the dynamic behaviour of surge tanks, they are introduced as a boundary condition for characteristic lines equations. Taking conservation of mass, momentum, and energy into account augments the number of equations forming a system of n equations where n is the number ofunknown variables of the surge tank. Detailed discussion on this topic can be found in Bruce et al. [2] and Russell Bent et al. [3]. Safety valves are also applied as a boundary condition, and additional equations are derived to form a system of equations. Grabarczyk et al. [4] and Grabarczyk et al. [5] reviewed the application of safety valves and similar equipment in an unsteady flow condition. Niełacny [6] modelled spring safety valves in water distribution systems with pumps.
High operational cost is the major concerns in utilising surge tanks. Despite being expensive, one-way surge tanks are unable to dampen the positive pressure wave caused by water hammer. They are only capable of preventing the negative waves and column separation by injecting flow to the pipeline [2]. Air surge tanks can handle both positive and negative waves, but they are costly [2]. On the other hand, safety valves have much less installation and maintenance costs, yet they have poor performance for restraining positive waves and incapable of hindering negative waves. Thus, the occurrence of column separation and consequent damages to the system is inevitable [4]. We aim to find an alternative that can handle both negative and positive waves while being simple and economically efficient. This paper focuses on shock damper in attempt to derive its governing equations and illustrate the effectiveness. Results show that shock dampers are highly capable of moderating unsteady flow characteristics. The structure of the rest of this paper is as follows. In the next section, we define the problem we are dealing with which includes deriving the equation and solving it for the given boundary conditions. Then, we demonstrate the performance of the proposed approach by solving a case study. Results are depicted in the next section followed by a concluding section.

Problem Definition
The current study focuses on the proposed instrument, called shock damper, which is capable of encountering positive and negative waves due to water hammer. In this section, shock damper is demonstrated, the governing equation is derived, boundary conditions are considered, and the resulting system of equations is solved.

Shock Damper
A shock damper consists of a damper, spring, mass, tank, and a joint ( Figure 1). The combination of spring, damper, and mass performs as a vibrant system with a single degree of freedom (vertically) when positive or negative waves occur. The spring of this system is prepressed to capture enough force. This force is used to balance with the force caused by pressure head. In case of positive waves, the excessive pressure imposed to the spring compress it further, storing potential energy. This potential energy preserves the rest of the water distribution system from water hammer effects (waves). When a negative wave hits the shock damper, the pre-pressed spring will be elongated and water stored in the shock damper's tank will be injected into the flow to compensate the negative pressure. This will help to prevent column separation and consecutive damage to the system. In theory, due to water hammer, an infinite number of positive and negative waves must propagate in the system. However, this is never the case as a result of friction and depreciation of energy. The role of shock damper is to accelerate the process of depreciation of water hammer waves. Figure  1 shows a shock damper and its components including 1) damper, 2) spring, 3) mass, 4) joint, and 5) tank.

Governing Equations
To simulate the condition of unsteady flow in the system, a pair of partial differential equations as shown in equations 1 and 2 is used. These equations are obtained by considering conservation of mass and momentum for a moving control volume as an element of the pipeline [7].
Where H is the piezometric head and V is flow velocity, both are a function of time (t) and space (x); a is the speed of propagation of sound wave in the flow; g is the gravitational acceleration; D is the pipe diameter; and f is the Darcy-Weisbach coefficient. All dimensions follow the standard SI units. One of the most widely-used approaches to solving equations similar to those of equation (1) and (2) is the Characteristic line method [8]. In this method, the solution space is discretized to a finite number of nodes including intermediate and boundary nodes.

Intermediate Nodes
Discretised form of the equations for intermediate nodes under unsteady flow condition is represented below [2].
In the above equations, are the piezometric head and flow rate in node i at time-step n+1 respectively; and A is the pipe's cross-section.

Boundary Conditions
In order to derive the governing equations of a shock damper, a gravity-feed system is considered. Components of such system include pipe, tank, valve, and a shock damper, each with a specific equation (boundary condition).

Tank at i = 1:
Following equations are considered for a tank with constant head (H 0 ) located at the beginning of a pipeline [2].

Valve at i = m+1:
For a valve that requires t=T c to decrease the flow rate to zero and is located at the end of the pipeline, the boundary condition equations are:

Shock damper at i = B c :
As shown in Figure 2, we assume that the shock damper is located at the node i = B c . Expanding the conservation of mass for this node: Where 1 + n c Q is the amount of flow rate from the main pipe to the joint of the shock damper at time-step n+.
Whenever flow enters the shock damper it will be assumed a positive flow rate, otherwise it is negative.  Next, conservation of energy is expanded for node i. Since the distance between node i and i+1 is trivial, energy depreciation due to friction is negligible.
By taking into account the conservation of momentum for the joint, we have: Where L c is the length of the joint; n s Z is the mass level proportional to the pipe axis in each time-step; and 0 n P is pressure imposed to the moving mass at each time-step. Using the Continuity Principal, n s Z can be calculated as follows: Where M is the moving mass; C is damping coefficient; A r is the cross-section of shock damper's tank; K s is the spring stiffness factor; Z 0 is the mass level according to the pipe axis in t=0; 0 Z is the distance that spring has been compressed at t=0. The forces are defined as follow: gravity force is  Z in above equation are acceleration and velocity of flow mass respectively, they can be calculated as: The velocity and acceleration of the mass in the tank can be calculated based on flow rate in the joint using the Continuity Principal.  In the above equations, 1 n C and 2 n C are derived with the following equations: In each time-step the nine variables including are computed using equations 11 to 13 and equations 16 to 21.

Solving the System of Equations for a Shock Damper
The system of equations defined in the previous section is used to simulate the behaviour of a shock damper when water hammer occurs. The challenge here is to solve this nonlinear and implicit system of equations which cannot be readily solved with current numerical methods. To tackle this issue, we replace the term In the above equation, new parameters are introduced and defined as follows: We can now calculate 1 + n c Q from equation 24 for each time-step. Then, rest of the variables can be computed accordingly.

Case Study
A gravity-feed system is considered here which consist of a tank with constant head at the beginning of the pipeline system and a valve at the end of it. This system is solved in two scenarios: with and without using a shock damper. The aim is to demonstrate the effect of installing a shock damper on flow characteristics of such system. Figure 4 shows the system under consideration. In order to create a water hammer condition, the downstream valve is shut in 3 seconds. The initial condition of the system includes a constant flow rate in the pipe.

Scenario 1
In this case, no shock damper is equipped with the system.

Scenario 2
We use a shock damper in this scenario. The parameters related to the shock damper include M=30 Kg, C=10 7 N.sec/m, K s =30000 N/m, D r =1 m, D c =0.1 m, L r =2 m, and L c =0.5 m. All other parameters are assumed to be similar to those of scenario 1.

Results and Discussion
The case described in the previous section was solved to illustrate the effect of using a shock damper in a simple water distribution system. The piezometric head at the location of the valve was calculated for both scenarios. Figures 5 and 6 show the fluctuation of piezometric head obtained for scenario 1 and 2 respectively.
As it can be seen, water hammer caused by a sudden closure of the valve can generate piezometric head (and corresponding pressure) as high as 250 m and -50 m where no shock damper was used. This is relatively a severe pressure resulting in extensive damages to the system. The maximum pressure (positive value) can cause pipes to explode while the minimum pressure (negative value) can lead to column separation. Also, the next head peak reached a value of 130 m and -50 m. This is due to friction in the pipeline and depreciation of energy, yet the resulting pressure is high after approximately 5.25 sec. In this scenario, the impact of water hammer is still visible after around 30 sec. When the shock damper described in scenario 2was utilised, maximum and minimum of the piezometric head were calculated as 165 m and -10 m respectively. This is a great reduction (35% for the maximum head and 80% for the minimum head) compared to those of scenario 1. Moreover, the peak heads were significantly depreciated after almost 7 sec, reaching a value of 60 m and 20 m. Herein, we perform a sensitivity analysis of the system. Figures 7 -10 summarise the outcome of the sensitivity analysis. Results indicate that the performance of a shock damper is more sensitive to two of its parameters, namely the diameter of the main tank and damping coefficient of the shock damper. Figures 7 and 8 show obtained piezometric head at the location of the valve for damping coefficients of +80% and -60% of its initial value, respectively. It is seen that increase in the damping coefficient decreases the efficiency of the shock damper hence greater piezometric head is generated. Decreasing this parameter improves the performance of the shock damper. However, there is a limit to it as further reduction deteriorates its efficiency. This suggests that an optimal level can be sought. Responds of the system to changes made to the diameter of the main tank is demonstrated in Figures 9 and 10. As it is expected, as the size of the tank increases, the shock damper performs better. Yet