## 2 Mathematical Model of the Semi-Pneumatic Surge Tank  
The following mathematical model of the SPST is defined as a boundary condition in the original software developed at the University of Belgrade, Faculty of MechanicalThe system of equations includes positive and negative characteristics (Equations (1) and (2)), losses in junction that are considered negligible (Equation (3)), and continuity equation (Equation (4)) defined for the branching junction [34],  
\[Q_{P_{i,n+1}}=C_{Pi}-\frac{gA_{i}}{a_{i}}H_{P_{i,n+1}} \tag{1}\]  
\[Q_{P_{i+1,1}}=C_{Ni+1}+\frac{gA_{i}}{a_{i}}H_{P_{i+1,1}} \tag{2}\]  
\[H_{P_{i,n+1}}=H_{P_{i+1,1}} \tag{3}\]  
\[Q_{P_{i,n+1}}=Q_{P_{i+1,1}}+Q_{P_{P}} \tag{4}\]  
where: \(Q\) is discharge and \(H\) is head at the defined point on the pipe upstream and downstream, indexes \(P\) and \(SP\) are related to the next time step and standpipe, respectively. Coefficients \(C_{P}\) and \(C_{N}\) are calculated from the previous time step through the following relations (Equations (5) and (6)):  
\[C_{Pi}=Q_{i,n}+\frac{gA_{i}}{a_{i}}H_{i,n}-\frac{\lambda_{i}\Lambda t}{2D_{i}A _{i}}Q_{i,n}|Q_{i,n}| \tag{5}\]  
\[C_{Ni+1}=Q_{i+1,2}-\frac{gA_{i+1}}{a_{i+1}}H_{i+1,2}-\frac{\lambda_{i+1} \Lambda t}{2D_{i+1}A_{i+1}}Q_{i+1,2}| \tag{6}\]  
where: \(g\) is gravity acceleration, \(\lambda\) is friction coefficient, \(\Delta t\) is time step, \(D\) is pipe diameter, \(A\) is cross-section area and \(a\) is wave propagation speed. It is assumed that the air behaves in a polytropic manner where mass changes should be included (Equation (7)):  
\[\frac{H_{P_{air}}^{*}V_{P_{air}}^{n}}{m_{P_{air}}^{n}}=\text{const.} \tag{7}\]  
where: \(H_{P_{air}}^{*}\) is absolute pressure head, \(V_{P_{air}}\) and \(m_{P_{air}}\) are the volume and the mass, respectively, of the air in the SPST at time step \(P\) and \(n\) is polytropic exponent. The dynamic  
Figure 1: Cylindrical semi-pneumatic surge tank scheme. equation for the standpipe at the end of the time step is defined by Equation (8) as a lumped inertia model including friction with adequate modifications to use in MOC [12]:  
\[Q_{P_{sp}}=Q_{sp}+\frac{g\Delta A_{sp}}{L_{sp}}\Big{(}H_{P_{in+1}}-H_{P_{air}}^{*} -H_{P_{ST}}\Big{)}+\frac{g\Delta A_{sp}}{L_{sp}}\Bigg{(}H_{attn}-\Bigg{(}\frac{ \lambda_{sp}L_{sp}}{2 gD_{sp}A_{sp}^{2}}+C_{sp}\Bigg{)}Q_{sp}\big{|}Q_{sp}\big{|} \Bigg{)} \tag{8}\]  
where: \(L_{sp}\) is standpipe length, \(H_{P_{ST}}\) is the surge tank head for the next time step \(P\), \(\lambda_{sp}\) and \(C_{sp}\) are the friction and minor losses coefficients of the standpipe which also includes the possibility of orifice positioning. The head of the surge tank for the next time step is defined by Equation (9):  
\[H_{P_{ST}}=H_{ST}+\frac{0.5\Big{(}Q_{P_{sp}}+Q_{sp}\Big{)}\Delta t}{A_{ST}} \tag{9}\]  
where: \(A_{ST}\) is the cross-sectional area of the surge tank. Mass of the air expelled through aeration orifice \(\dot{m}_{aorf}\) is defined by [PERSON] & Streeter [12] as subsonic in-flow, critical in-flow, subsonic out-flow and critical out-flow (Equation (10)), respectively:  
\[\dot{m}_{aorf}=\left\{ \begin{array}{cc}C_{in,aorf}A_{in,aorf}\sqrt{7p_{0}^{* }\rho_{0}\left[\left(\frac{p_{air}^{*}}{p_{0}}\right)^{1.4286}-\left(\frac{p_{ air}^{*}}{p_{0}}\right)^{1.714}\right]}&p_{0}^{*}>p_{air}^{*}>0.53p_{0}^{*}\\ C_{in,aorf}A_{in,aorf}\frac{0.686}{\sqrt{K_{1}^{*}}p_{0}^{*}}p_{air}^{*}<0.53p_ {0}^{*}\\ -C_{out,aorf}A_{out,aorf}p_{air}^{*}\sqrt{\frac{7}{RT_{air}}\left(\left(\frac{ p_{0}^{*}}{p_{air}}\right)^{1.4286}-\left(\frac{p_{0}^{*}}{p_{air}}\right)^{1.714} \right]}\frac{p_{0}^{*}}{0.53}>p_{air}^{*}>p_{0}^{*}\\ -C_{out,aorf}A_{out,aorf}\frac{0.686}{\sqrt{K_{air}}}p_{air}^{*}&p_{air}^{*}>p_ {0}^{*}\\ \end{array} \right.