1. Introduction
Entrapped air during transient events in water distribution systems poses significant operational and structural challenges [
1]. Water columns compress air pockets during filling operations, rapidly increasing internal pressure. If this pressure exceeds the pipeline’s design capacity [
2,
3,
4], it can result in pipe rupture. Conversely, during emptying processes, the expansion of entrapped air pockets induces a pressure drop accompanied by oscillations, which may lead to structural collapse depending on the pipe’s stiffness and installation conditions [
5,
6,
7]. These scenarios highlight the importance of understanding air–water interactions during transient events in pressurised systems.
Effective mitigation strategies involve properly designing and sizing the pipeline system and implementing operational protocols to ensure the controlled admission and expulsion of air through air valves [
8]. In many situations, such as when air valves are absent, inadequately maintained, or rendered inoperative—for instance, due to flooding of the valve chamber—air cannot be adequately managed within the hydraulic installation. This may lead to hazardous pressure transients, including extreme pressure surges or undesirable sub-atmospheric conditions, posing a significant risk to system integrity. This latter situation represents one of the most critical scenarios water utilities may face during routine operations [
5].
The modelling of air–water interactions during pipeline emptying is inherently complex due to the nonlinear and transient nature of the governing equations [
5,
9]. Reference [
5] addressed this problem by developing a model to describe the behaviour of an emptying process with an entrapped air pocket. This model is formulated as a system of three equations—two ordinary differential equations (ODEs) coupled with one algebraic equation—characterising the coupled dynamics of air and water. The first equation is derived from the rigid water column model, representing the dynamics of the water phase. The second is based on the polytropic law governing the air phase, while the third describes the conditions at the air–water interface. The model has been validated through experimental measurements conducted by References [
5,
10,
11] in several European laboratories across different universities and research institutes. The results confirm that the three-equation system provides an adequate physical representation of the phenomena involved. The system was solved numerically using appropriate computational methods in all these studies.
The problem related to emptying processes has been explored by relatively few researchers worldwide. Initially, a semi-empirical approach for computing the emptying process in water pipelines was proposed by Tijsseling et al. [
10]. Subsequently, the authors developed a mathematical model based on physical principles [
5], which has been solved numerically. Water utilities increasingly focus on creating digital twin models [
12,
13] to support decision-makers in managing emptying operations within water distribution networks. In this context, developing alternative approaches to the numerical solution of complex differential equations may contribute to achieving the Sustainable Development Goals (SDGs) [
14]. A detailed analysis of the emptying process can support the advancement of digital twins [
13,
15]. This concept integrates modelling, the Internet of Things (IoT), an infrastructure layer, sensing technologies, and artificial intelligence (AI) [
16]. In this regard, improvements in modelling techniques may enhance the application of AI tools to detect potential failure scenarios—such as pipeline collapse caused by sub-atmospheric pressures—that may occur during emptying operations.
This research advances the theoretical understanding of the emptying process involving an entrapped air pocket with the upstream closed (without air valves). The primary objective of this study is to derive an analytical solution to the three governing equations previously described. In this sense, the system is first reduced to two first-order nonlinear ordinary differential equations (ODEs), allowing for an investigation into the existence and uniqueness of the solutions. Subsequently, the model is further simplified to a single second-order nonlinear ODE, which captures the oscillatory behaviour of the water column during the emptying process. In a further step, a specific change of variables transforms the second-order nonlinear ODE into a first-order linear ODE. This transformation simplifies the system’s structure and opens the possibility of formulating an analytical solution.
This work’s contribution lies in extending the previous numerical models and establishing an analytical framework for describing such transient air–water interactions. This analytical insight can support water distribution systems’ optimisation and safer design, particularly in scenarios where air entrapment cannot be entirely avoided. Experimental validations in this study confirm the relevance and applicability of the proposed methodology in real-world hydraulic systems [
5,
6,
17].
This study may serve as a valuable complement for water utilities in the development of digital twin models, providing enhanced analytical tools for accurately simulating the emptying process [
6,
15,
18].
2. Mathematical Model
This section revisits the mathematical model proposed by Fuertes-Miquel et al. [
5] for analysing the emptying process in a single pipeline. The model provides a comprehensive framework to describe the transient interaction between the water and air phases during emptying operations.
Figure 1 presents a schematic representation of a pipe segment containing an entrapped air pocket.
The assumptions made to describe this phenomenon are based on the following considerations:
The water phase is considered incompressible, as the air phase’s elasticity is significantly higher than that of the water phase.
The single pipe’s slope, diameter, and roughness are assumed to be constant.
A constant friction factor is employed, representing the losses according to the Darcy–Weisbach equation [
10,
19,
20,
21,
22].
The polytropic law is used to model the air pocket pressure [
22].
An instantaneous opening of the regulation valve at the downstream end is assumed, facilitating the air release process.
The air–water interface is modelled using the piston flow model, which is valid for small pipe diameters and hydraulic slopes, ensuring no free surface flow occurs [
21].
One of the three formulations’ main advantages is its ability to capture different polytropic behaviours. Specifically, an adiabatic process is represented with a polytropic coefficient of 1.4, an intermediate process with a coefficient of 1.2, and an isothermal process with a coefficient of 1.0.
Then, the phenomenon is modelled as follows:
Water column behaviour [
5,
11]: The water column can be modelled using the rigid water column approach.
where
is the water velocity,
is the air pocket absolute pressure,
is the atmospheric pressure,
is the water density,
is the water column length,
g is the gravity acceleration,
is the pipe slope,
f is the Darcy–Weisbach friction factor,
D is the internal pipe diameter,
A is the cross-sectional area,
is the resistance coefficient of a regulating valve, and
is the water flow. Minor losses (
) through a regulating valve are estimated using the formula
.
It should be noted that the closed air pocket prevents the complete drainage of the water, thus avoiding from reaching zero. In other words, as the water drains, the pressure in the air pocket decreases until it matches the external atmospheric pressure, without the contents being fully emptied. Subsequently, the water column begins to refill, causing the pressure inside the air pocket to rise above the atmospheric pressure, and the draining process resumes. This cycle describes a continuous oscillatory dynamic.
Air–Water interface [
22]: The piston flow model defines the interface between the water and air phases as follows.
where
is the initial value of
.
Polytropic air evolution [
19]: The air pocket pressure can be approached using the polytropic law.
where
is the air volume,
is the initial air volume,
is the initial value of
,
k is the polytropic coefficient,
x is the air pocket size, and
is the initial value of
x.
In summary, the system of Equations (4)–(6) fully describes the process. This system, along with the appropriate initial and boundary conditions, can be solved for the variables , , and .
The initial and boundary conditions, along with the gravity term, are given by:
Initial and boundary conditions: At the beginning, the system is assumed to be at rest (). The initial conditions are given by , , and . The upstream boundary condition is defined by , representing the air pocket’s initial condition. At the downstream end, the boundary condition is given by , corresponding to the free release of water into the atmosphere.
Gravity-related term: The gravity term (
) is presented in Equation (4) as:
where is the elevation difference.
The resulting system can thus be expressed as:
with initial conditions
This mathematical model was previously developed by the authors [
5].
3. Existence and Uniqueness of the System Solution
This section demonstrates that the system (4)–(6), subject to the specified initial conditions (7), admits a unique solution within certain time intervals. To this end, the system is reduced to a set of nonlinear differential equations as follows:
Combining Equations (4)–(6), and using the notation
and
(these are time-dependent variables), the system reduces to:
with initial conditions
where
Using
, the system (8)–(10) can be expressed more compactly using vector notation as follows:
with
where
are functions defined by:
The functions P and Q do not explicitly depend on the time variable t. Therefore, Equations (11) and (12) constitute a nonlinear autonomous system of differential equations with initial conditions, whose solutions are parametrised curves in the phase plane , commonly referred to as orbits.
The following result is obtained through direct calculation:
It is worth noting that
P,
Q, and their partial derivatives
,
,
, and
are continuous within an open connected set
. This holds because, according to the parameters of the system (see
Section 2),
L is never zero, and
does not equal
L at any point during the emptying process, which begins at
from
. These conditions on
P and
Q ensure that for
, the initial value problem has a solution
on a time interval
for a given
, where the solution is unique within this interval [
23].
4. Analytical Solution
Instead of directly addressing problem (8)–(10), the derivation of a simplified initial value problem (IVP) for
L is pursued. A reduced model for the pipe emptying process is introduced, based on the conditions outlined in
Section 2. This model is described by a nonlinear second-order ordinary differential equation with the specified initial conditions.
The problem is then further reduced by suitable substitution into a first-order ordinary differential equation to simplify the solution process.
4.1. Reduction of the System (8)–(10) to a Second-Order ODE
By combining Equations (8) and (9), the following second-order nonlinear ordinary differential equation in
L is obtained:
subject to the following initial conditions:
where
4.2. Reduction of the Second-Order ODE to a First-Order ODE
To solve the IVP (Equations (13) and (14)), it is crucial to note the involvement of the term , which gives rise to two cases: and .
Figure 2 illustrates the oscillatory behaviour of
around zero. This prompts us to redefine the initial problem, stated for all
, into several issues over time intervals of the form
. These intervals are determined by changes in the sign of
. We start with setting
(where
).
The value
is defined as
. Under this condition, it is ensured that
keeps the same sign for all
, i.e.,
. Also, the continuity of
v is guaranteed because of the nature of the physical phenomenon. Thus, Bolzano’s theorem from calculus [
24] states that, given a change of sign in
v, there has to be a value
where
=0. This value is precisely
(i.e.,
).
Once a solution for IVP (13) and (14) is obtained, the values and can be computed.
Because of the way it was defined, is the smallest value of t such that and ; then, a new value can be set such that . Thus, a new IVP can be defined using Equation (13) and the initial conditions and .
This process is repeated, solving the IVP given by Equation (13) on each interval
with initial conditions
and
, where
is set as
Notice that, because of the continuous nature of v, there has to be specific values where whenever v switches its sign, and those values are exactly for
In the following, a solution will be presented for each of the two previously outlined cases.
4.2.1. Case on the Interval
This case considers that
in
. Under these conditions, Equation (13) becomes
If we define
, note that:
Therefore,
Using
and relation (17), Equation (16) becomes
so,
Therefore, Equation (16) reduces to the following linear first-order ODE for
where
Because
, the functions
P and
Q are continuous for all
L evaluated in the interval
. Thus, Equation (18) possesses a unique solution satisfying the initial condition
, given by the formula (see Reference [
24]).
with
and
Note that the expression (20) can be simplified to
provided that the initial condition satisfies
.
By direct calculations, we have:
Therefore,
and
We now turn our attention to the computation of
, as presented in Equation (22).The next family of special integrals is first defined (of the lower incomplete gamma functions kind [
25])
From Equation (22):
so
the integral is defined as
Now, can be expressed as a binomial series.
Because
, then
. Therefore, the above binomial series converge (see Reference [
24]) and
Consequently,
where
is the gamma function [
25]. From Equations (23) and (28), thus:
4.2.2. Case on the Interval
Following the same reasoning as in
Section 4.2.1, Equation (13) can be expressed as:
By making the substitution
, Equation (30) can be presented as a linear firstorder ODE for
:
where
and
are the functions defined in (19).
Proceeding analogously to the case where
, and given that
, then Equation (31) admits a unique solution expressed as:
where
and
Note that the expression (32) can be simplified to
provided that the initial condition satisfies
.
By applying an analogous reasoning as employed in the derivation of , the formula for is obtained.
Let us call
This is a family of special integrals (of the lower incomplete gamma functions kind [
25]). From Equation (34), it follows that:
Using the power series expansion of the expression
, the integral can be estimated as:
Indeed,
Finally,
4.3. Solution of , , and from
This section derives expressions for , , and based on the solution of the first-order differential Equations (18) and (31), corresponding to cases where and , respectively.
4.3.1. Calculation of
Considering that
, then
So,
, and because
, then:
That is:
4.3.2. Calculation of :
Because
, then:
4.3.3. Calculation of
Given that
L is calculated from
, the air pocket pressure can be computed as follows:
In summary, the solution to the
system (4)–(6) is provided by Equations (36)–(38).
4.4. Validation of the Analytical Solution
The analytical solution is now checked by first numerically solving the original system (4)–(6) and comparing its solution with the analytical solution (20)–(22) and (32)–(34) on the respective time intervals. During the test, the following parameters were considered: m, , m, s2/m−6, m, , Pa, rad.
Figure 3,
Figure 4 and
Figure 5 display graphical representations of these solutions with the integrals (22) and (34) evaluated numerically. The analytical and numerical solutions show excellent concordance, validating the use of the analytical solution as a predictive tool for emptying processes.
Figure 6 presents the solution considering the first seven terms of the series, expressed explicitly through Equations (29) and (35) for the initial two intervals corresponding to
and
, respectively. The results demonstrate rapid convergence of the analytical solution to the numerical solution with relatively few terms.
Furthermore, the analytical model was validated using experimental measurements conducted by the authors, as reported in Reference [
5], where a single pipeline with an internal diameter of 42 mm and a total length of 4.36 m was employed. In this case, conditions similar to those of the practical application were considered, implying that the upstream end remained closed during the simulations. For the analysis, the initial air pocket size,
, ranged from 0.205 to 0.450 m; longitudinal pipe slopes varied between 0.457 and 0.515 rad; and resistance coefficients at the regulating valves ranged from 11.89 to 138.41 × 10
6 ms
2/m
6. The analytical solution was applied under the assumption of instantaneous valve opening to provide conservative (safety) estimates, while the experiments were conducted considering a gradual valve opening.
Figure 7 presents a comparison between the computed and measured evolution of the air pocket pressure over time, for an initial air pocket volume of 0.450 m, a longitudinal slope of 0.457 rad, and a resistance coefficient of 30.86 × 10
6 ms
2/m
6. The discrepancy observed during the initial seconds is attributed to the experimental setup, in which the regulating valve was gradually opened using an opening manoeuvre time of 0.3 s.
Figure 8 compares the maximum air pocket pressures obtained from 12 measurements, demonstrating that the analytical model can accurately capture these values, which are crucial to detect if a pipeline can have a risk of collapse.
5. Discussion
The original coupled model defined by Equations (4)–(6) has been reduced to a single second-order nonlinear ordinary differential equation in the water column length (see Equation (13)). This formulation captures the intrinsic oscillatory dynamics arising from the air–water interface reversal, but the presence of renders direct integration intractable. By introducing the change of variables , it is possible to eliminate the absolute value nonlinearity and recast the problem into the linear first-order ODE for (see Equation (18)), valid over monotonic segments of . This key transformation not only simplifies the analytical treatment but also yields explicit integral expressions for in both regimes (see Equations (20)–(22)) and (see Equations (32)–(34)).
Constructing the global solution thus requires stitching together these local solutions at the sign change instants
(where
). In this research, the switching times were determined numerically by locating zeros of the water velocity in the reduced model; thereafter, the piecewise integrals were evaluated to produce continuous profiles of
,
, and
(
Figure 3,
Figure 4 and
Figure 5) that agree closely with fully numerical simulations of the original system. Moreover, the series expansions of the special integrals
and
converge rapidly; even truncating after seven terms recovers the numerical velocity profile almost exactly (
Figure 6), demonstrating the practical utility of the analytical analysis.
Although solutions (36)–(38) obtained from (20) and (32) are not explicitly continuous or differentiable for (especially on with ), the fact that both (18) and (31) were derived from (13) ensures that is defined globally for , and therefore, and are continuous and differentiable for .
On the other hand, the simplified model can be as precise as desired whenever the time subintervals determined by the values with are computed correctly depending on the sign of .
However, there are some errors generated while computing v, L, and from expressions (36)–(38). These errors arise from the truncation of the numerical computations of the integral terms (, , , and ) and the series . In addition, round-off errors might come up due to hardware architecture and software configuration used for calculations. All these errors can be compensated by selecting an appropriate step size for the time variable.
The proposed model could be further optimised from a physical standpoint by acknowledging that the air–water interface may adopt various configurations—such as bubble flow, plug flow, stratified wave flow, and stratified smooth flow—rather than assuming a strictly vertical profile. These flow regimes are particularly relevant in pipelines with larger diameters or lower longitudinal slopes. Furthermore, the current mathematical model does not account for the effect of air backflow, which may occur especially in largediameter pipes, where air can travel from the regulating valve at the downstream end back towards the upstream end.
Finally, the proposed solution method, which treats the cases in which the velocity changes direction separately, can be generalised to describe oscillations involving dissipative forces proportional to the square (or another even power) of the water velocity but acting in the opposite direction. This approach could be applied to the solution of ordinary differential equations that include sign-changing terms, such as those that involve absolute values of the variable under study.
Water utilities increasingly seek to implement digital twin systems within water distribution networks. As draining processes in pressurised pipelines can potentially lead to pipeline collapse, the proposed analytical solution offers a rapid means of estimating these effects. Real-time data are essential for accurately calibrating the phenomenon under study to establish a reliable digital twin. As physical equations govern the draining process examined in this study, variations in the initial parameters do not affect the model’s applicability. However, the model is specifically designed for drainage operations and unsuitable for filling processes, where different parameters and governing variables come into play.
6. Conclusions
This research has analysed the problem of emptying processes with an entrapped air pocket. The corresponding mathematical model for this physical phenomenon is illustrated at the beginning. Based on this model, this research demonstrated an analytical solution that can be used to describe this problem. The analytical solution can be a practical tool for implementing a digital twin model to predict emptying operations in water distribution systems.
Considering that the emptying process evidences an oscillatory behaviour where the velocity at which the air–water interface moves switches its sign at specific time intervals, a strategy was proposed to simplify the model and determine a closed-form formula for the solution. Thus, by rewriting the problem in terms of a new variable, the problem could be reduced to a linear model for different time intervals, and an analytical solution based on integral terms was constructed for every time interval for the column length, the velocity of the air–water interface, and the pressure in the air pocket. The solution for the velocity was plotted locally at every time interval after evaluating the integral terms in the solution numerically. It was observed that this solution corresponds with the approximated numerical solution, validating the formulation of the analytical solutions. Finally, a series expansion was proposed for the integral terms at every time interval. The plots for the first seven partial summations of the series exhibit the convergence of the solution, demonstrating the correctness of the proposed analytical solution.