*2.4. Boundary Conditions*

The next step is to solve the boundary conditions. According to Figure 1, the instantaneous closing valve of an RVP system is at the left-hand side of the system (*x* = 0). The valve boundary condition is derived from the negative *C*− characteristic:

$$\begin{cases} & -\frac{p\_Z}{c\rho\_l} + \frac{\kappa p\_v}{c\rho\_l} + \frac{\upsilon\_Z}{a\_Z} - \frac{\varsigma}{2}ln\frac{\rho\_{mZ}}{\rho\_l} - p\_Z c \Sigma F \Delta t = \mathsf{C}\_X \\ & \mathsf{C}\_X = \frac{\upsilon\_X}{a\_X} - \frac{p\_X - \kappa p\_v}{c\rho\_l} - \frac{\int\_X \Delta t \upsilon\_X |\upsilon\_X|}{4Ra\_X^2} - \frac{\varsigma}{2}ln\frac{\rho\_{mY}\rho\_{mW}}{\rho\_l \rho\_{mX}} - \mathsf{G}\_Y(t)\Sigma c \Delta t \end{cases} \tag{49}$$

Please note that the value of *CX* is based only on known values from the previous time steps. The velocity at the valve section for time *t* > 0 has zero value, i.e., *vZ* = 0 (closed valve). The above Equation (49) takes the form:

$$p\_Z \left( \underbrace{1 + c^2 \rho\_l \Xi \mathbf{F} \Delta t}\_{\kappa} \right) = -c \rho\_l \mathbb{C}\_X + \kappa p\_v - \frac{c^2 \rho\_l}{2} \ln \frac{\rho\_{mZ}}{\rho\_l} \tag{50}$$

which finally reduces to:

$$p\_Z = p\_v - \frac{\left(C\_X + \frac{\epsilon}{2} \ln \frac{\rho\_{WZ}}{\rho\_l}\right) c \rho\_l}{\kappa}. \tag{51}$$

When the pressure *pZ* at this boundary is higher than the vapor pressure *pv*, then the natural logarithm is equal to 0 as *ρmZ* = *ρl*; this means that there is no cavitation when *CX* < 0, and the pressure at the valve section can be calculated from the following equation:

$$p\_Z = p\_v - \frac{C\_X c \rho\_l}{\kappa}.\tag{52}$$

Otherwise, when *CX* ≥ 0 and *pZ* = *pv*, then the bubble mixture density and volumetric fraction of the liquid, respectively, should be calculated as follows:

$$
\rho\_{mZ} = \rho\_l e^{-\frac{2\mathbb{C}\_X}{\varepsilon}} \text{ and } \mathfrak{a}\_Z = \frac{\rho\_{mZ} - \rho\_v}{\rho\_l - \rho\_v}. \tag{53}
$$

Next, the dynamic viscosity of the homogeneous bubble mixture using Dukler's formula [46] should be calculated:

$$
\mu\_{\rm mZ} = \alpha\_Z \mu\_l + (1 - \alpha\_Z)\mu\_\upsilon. \tag{54}
$$

At the opposite end (*x* = *L*) of the RPV system, Figure 1 is the reservoir. At the crosssection connecting the pipe with the reservoir, the pressure is assumed to be of constant value, i.e., *pN* = *pR* during the complete transient event associated with the analyzed water hammer phenomenon. As the pressure does not pulsate at this cross-section, the retarded strain is neglected here. The final equation for the velocity pulsation at this section in which the pressure is always higher than the vapor pressure *pN* > *pv* is:

$$
\upsilon\_N = \frac{\upsilon\_L}{\alpha\_L} + \frac{p\_L - p\_N}{c\rho\_l} + \frac{c}{2} \ln \frac{\rho\_{mM}\rho\_{mK}}{\rho\_l\rho\_{mL}} - \frac{2\Delta t}{R\rho\_l}\tau\_L. \tag{55}
$$
