Next Article in Journal
Synergistic Pollution Removal in Paper Mill Wastewater Using Monoculture-Constructed Wetlands Optimized by RSM
Previous Article in Journal
Utilization of Polyamide Waste to Remove Endocrine Disruptors in Water Treatment
Previous Article in Special Issue
Freshwater Chemistry Shaped by Periglacial Conditions at Lions Rump, King George Island (Maritime Antarctica)
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Understanding Water Quality Models by Particle Forward and Backtracking Methods

by
Marta Hervás
1,2,
Fernando Martínez-Alzamora
3,*,
Pilar Conejos
1,2 and
Joan Carles Alonso
2
1
Department of Hydraulic Engineering and Environment, Universitat Politècnica de València, 46022 Valencia, Spain
2
G.O. Idrica, 46010 Valencia, Spain
3
Research Institute of Water and Environmental Engineering (IIAMA), Universitat Politècnica de València, 46022 Valencia, Spain
*
Author to whom correspondence should be addressed.
Water 2026, 18(1), 21; https://doi.org/10.3390/w18010021
Submission received: 11 November 2025 / Revised: 6 December 2025 / Accepted: 18 December 2025 / Published: 20 December 2025

Abstract

The quality of water supplied to consumers through drinking water distribution networks is a matter of growing concern and is subject to increasingly stringent new regulations. The utilization of simulation models, which encompass the movement of water through pipes and storage tanks, has been demonstrated to provide valuable information with regard to the improvement of the system operation. However, once a calibrated quality model is available, justifying the evolution of the quality provided by the model at any junction in the network is not direct; however, this is sometimes necessary to carry out the appropriate interventions to improve quality parameters. A methodology to help the comprehension of the quality results provided by simulation models has been developed in this paper. This methodology is based on the principles of event-based transport methods, whereby the quality of a particle is tracked as it moves downstream from a starting point or upstream from an arrival point. Upon reaching a junction, an event occurs that determines the subsequent trajectory of the particle. The details of the method and its potential are demonstrated through an illustrative example, reinforced by its application in a more realistic case. Consequently, by monitoring the particles, it becomes feasible to interpret the quality values obtained at any junction in the network and at any designated moment. If the quality value were the result of a measurement, the method would also allow us to track the origin of that value; in this way, it could be used in the future to locate the possible source of a detected contaminant.

1. Introduction

Traditionally, it was thought that if water enters a water distribution network (WDN) with a high quality, it will also reach the users with good quality. However, research and experience have shown that this is not the case [1,2,3]. Furthermore, the maximum quality at the entry points is often limited. Water quality (WQ) changes during its journey through the network, passing through the pipes and storage tanks. Thus, the processes taking place in drinking WDNs are of great interest to network operators, especially those related to WQ, such as mixing processes and transport of substances along the network [4,5].
WQ models provide valuable information regarding the status of the network in terms of water age, trace from different sources, and the evolution of substance concentrations [6,7,8,9,10]. It should be noted that the simulation results are highly dependent on the flows through the different pipes, the mixing processes taking place in junctions and tanks, and the reaction mechanisms [11].
In fact, the first quality models were used to confirm the flow rates of the pipes. Non-reactive substances were used as tracers so that quality would be affected exclusively by flow distribution and mixing processes. The idea was to trace the trajectory of dissolved substances as a basis for estimating flows using particle tracking.
However, monitoring changes in water quality in distribution networks proved to be a more complex undertaking. This led to the development of more comprehensive quality models that took into account all possible phenomena, so that knowledge of circulating flows became an input to solve the quality model. A common problem when analyzing the results of the WQ simulation at a junction is the difficulty in determining the causes of the observed variations: are there different origins of the water arriving at the junction? What are the paths followed by particles through the network until it reaches the junction? What is the contribution of each source to the observed quality? It would be very useful for operators to be able to easily identify the phenomena that give rise to the observed WQ evolution at a junction.
To answer these questions, it is necessary to monitor how substances are transported, stored and react along the network. The transport methods employed to calculate WQ throughout the WDNs are divided into Eulerian and Lagrangian methods.
Eulerian methods segment pipes into multiple fixed-length segments and monitor the progression of a substance as it traverses each segment. This process entails calculating the balance of incoming, outgoing, and reacting substances to ascertain the temporal progression of substance concentration within each segment [12,13].
Lagrangian methods involve the division of pipes into segments that move along the pipe. These segments maintain their size until they reach the downstream junction, at which point their length begins to decrease until they fully enter the junction for mixing. Following this, as the outflow of the junction enters the outlet pipes, the segments grow in size at the starting point of those pipes likely with a different concentration due to the mixing process that occurs at junctions, which leads to the creation of new segments [12,13,14].
In summary, the distinction between Eulerian and Lagrangian methodologies is based on the observation that the former considers fixed segments where the concentration is undergoing a transformation, whereas the latter is based on the tracking of different segments of given quality traversing the network, under the assumption of a piston-like flow behaviour. Thus, Lagrangian models facilitate more precise tracking of substances through the network.
The Langrangian method comprises two variants: the first being the Langrangian Time-Driven method (LTD) and the second being the Langrangian Event-Driven method (LED). The LTD method proceeds by fixed time intervals, which permit multiple segments to arrive at their corresponding downstream junctions within a single period, even from pipes located upstream to those connected to the junction. However, this also results in the loss of track of the segments undergoing mixing processes at the junctions. Conversely, the LED method defines the time intervals by the arrival of a new segment at its downstream junction (event), thereby enabling the complete and accurate tracking of the evolution of quality segments along the WDN [15,16].
However, all previous methods perform a global analysis that loses sight of the individual contributions from each junction of origin. Indeed, the trace analysis currently implemented in EPANET 2.2, using LTD method, does not differentiate between the various sources of origin or the moment at which different particles departed from them, presumably with differing qualities, to coalesce at the same moment in the same junction. Furthermore, the trace analysis does not report on the evolution of the quality of each of these particles along their trajectory, nor on the result of the mixing processes at the network junctions, as it considers the trace as a non-reactive substance, independent for each source. Consequently, the trace analysis provides data exclusively on the volume of water emanating from a specified source, without the detail of the mass flow contributing from that source.
In order to justify the evolution of quality observed in a junction, it is necessary to return to the initial approaches, which sought to individually track particles leaving a specific origin as they travel through the network and disperse until they finally exit through demand nodes or dilute in reservoirs or tanks.
The current transport models demonstrate that, when a substance is injected at a junction, its ultimate destination is significantly influenced by the hydraulic regime given by demand fluctuations and operational changes. Consequently, to ascertain the final WQ and its evolution at a junction, it is necessary to carry out a detailed analysis of paths at the particle level to determine its final destinations as the particle is diluted throughout the network.
One of the first particle tracking algorithms developed consists of Input/Output (I/O) models [17,18,19], which aim to determine the influence of each source on the quality results obtained at each junction in the network, based on the concentration value at the sources and their modulation. However, it should be noted that I/O methods are unable to report on the trajectory followed by the different particles. Consequently, they are not able to provide a justification for the quality observed at any node and at any time.
In circumstances where the substance is injected from multiple sources, it is imperative to conduct an analysis at the particle level to ascertain how each source influences the quality observed in the junctions. This is due to the fact that the quality observed in a junction may be the result of the superposition of multiple particles from diverse sources, or even particles that originated from the same source at different times and finally reached the same junction by travelling different paths.
In this regard, Lagrangian methods have demonstrated to have great potential for the precise tracking of particles within networks. Particle tracking is not a straightforward process that can be adequately addressed through a mere topological analysis of the upstream or downstream components at a given time. In order to gain a comprehensive understanding of the subject, it is essential to consider the time-varying flow rates and concentrations within the network as the particle goes on.
The objective of this paper is to develop a methodology for particle tracking along the network, based on the principles of the LED method. In this way, this study aims to provide a rigorous and comprehensive justification for the quality observed in each junction throughout the designated simulation period. In order to accomplish this objective, it is first necessary to formulate the problem of forward tracking of the path of a particle that initiates from a given junction at a given instant. While the forward analysis in itself does not substantiate the observed quality at any given junction, which is the result of the superposition of multiple particles arriving at the same junction from different sources, it does, however, allow for the establishment of the basis for performing a backward tracking that does lead to solving the formulated problem.

2. Materials and Methods

The LED method consists of tracking the advance of the boundaries, also called event fronts, that separate the different quality segments. The arrival of a front at a junction is called an event. During each event, a mixing of water coming from all the pipes that converge at the junction is performed to determine the new concentration of the junction [15,16].
The LED method has multiple advantages for simulating WQ in drinking WDN. Firstly, it is more accurate than LTD because changes in WQ are calculated as the events take place, providing the most exact results. Additionally, it is the only method that records the changes in concentration at the junctions as they occur [20].
In the LED method, the concentrations at the junctions are held constant unless an event at the junction occurs or the time required for the concentration to change due to the decay or growth of the simulated substance is reached. In this manner, the variation in concentrations at the junctions occurs in a staggered manner, changing at the instant at which an event reaches the junction, as seen in Figure 1. This allows for the monitoring of changes occurring at each junction, as well as the precise instant at which they occur. In contrast, in the LTD method, the calculation intervals are predefined and the concentration variation in the junctions is produced according to these times, showing interpolated values of the mixing processes carried out in the junction during these periods, losing the information on the exact moments in which the changes occur and, in addition, as has been discussed several times in the literature, presenting results that are not very precise in some cases. Inaccuracies are particularly significant when the time interval is much longer than the travel time of the pipes converging at the junction [20,21,22,23]. This tends to happen when there are many short sections in the network, as is often the case in detailed models.
Figure 1 and Figure 2 show a comparison of the evolution of WQ simulation results in a junction of the example network presented later on in Figure 3, using both the LTD improved method implemented in EPANET 2.2 [24], with ∆t = 15 min, and the more accurate LED method. In the latter, the WQ of the junction is maintained until the arrival of a new event.
It should be noted that when very small calculation time steps are used, both the LED and LTD improved methods give similar results. However, the processing times are shorter for LED for the same accuracy, and successive refinements are unnecessary as it is an exact method.
Figure 2 shows a refinement of the previous comparison using ∆t = 5 min for the LTD improved method. The LTD improved method converges to the results of the LED method by reducing the quality interval.
Based on the advantages offered by the LED method, a novel application of this method is proposed, consisting in tracking a particle with a given pollutant load through the network, starting from a given junction at a given time, and travelling forward or backward in time.

2.1. Forward Particle Tracking

Forward particle tracking (FPT) is an extension of the LED method. Just as the LED method associates each event front with a segment of equal concentration behind it, particle tracking only tracks the pollutant load associated with a certain particle located within one of the segments of the event method, not necessarily in the front.
The particle will advance and disperse through the outlet pipes of the junction it reaches. Part of the particle mass will leave the network if it is a demand node, while the rest will continue onward. In fact, when the particle reaches a new junction, it disappears, and new descending particles are created, as many as the number of outlet pipes of the junction.
For conservative substances, each particle has an associated mass flow rate of substance, expressed in mg/s (G); when a particle arrives at a junction and disperses, the total load of new sub-particles created plus the load leaving the network due to the outflow at the junction (demand) must be equal to the substance load of the incoming particle. Thus, when arriving at a junction, only the substance load arriving at the junction through the particle is assessed, without considering the load of the same substance that may arrive at the same junction via other routes. This fact differentiates the tracking of a particle’s load from the LED calculations, where in an event the total mass of the same substance present in all segments that converge at the junction is considered when performing the mass balance to determine the new concentration at the junction.
Therefore, being C i n the concentration of a particle reaching a junction through a pipe with flow Q i n , the concentration C o u t of the new outgoing particles will be:
C o u t = C i n     Q i n j ϵ I Q i n , j
Being I the set of inflows to the junction.
This equation represents a particular application of the more general mixing equation in junctions [24], which considers the mass transported by a particle arriving through a single pipe.
It is important to note that the numerator exclusively considers the load arriving at the junction from the pipe through which the particle travels, disregarding the other junction’s inlet pipes.
The mass balance at the junction is thus satisfied, as the substance load of the incoming particle, expressed as mass flow, is:
G i n = C i n   Q i n
And that of outgoing particles will be:
G o u t , j = C o u t   Q o u t , j
So, it is fulfilled:
j ϵ   O G o u t , j =   C o u t   j ϵ   O Q o u t , j =   C o u t   j ϵ   I Q i n , j =   C i n   Q i n
where O is the set of flows leaving the junction, including the demand external flow. It should be noted that the final equality is derived by applying (1).
Now suppose that one of the newly generated particles leaving the junction with a concentration designated by C o u t , travels along pipe j and reaches its downstream junction at a subsequent point in time. The concentration of the new particles leaving that junction will be determined using the same Equation (1), but with the value of Q i n on the right-hand side replaced by the concentration C o u t of the arriving particle, assuming the substance is conservative. In general, as new particles are generated in downstream junctions, there will be a cascade dilution effect on the concentrations. Consequently, the concentration C O N , k of a sub-particle leaving junction N, located n sections downstream from the starting point O, and following a path Π O N , k , will be:
C O N , k = C o     n ϵ Π O N , k Q i n , n j ϵ I n Q i n , j     =       C o   f O N , k
where C o denotes the concentration of the initial particle given by C o =   G o / Q o , with G o being the load of the particle, measured in terms of mass flow rate, and Q o the flow rate of the pipe from which the particle is originated. The product extends to all intermediate junctions n of the analyzed path Π O N , k that connects the origin junction O with the destination junction N, excluding the source junction and including the destination junction. The flow listed in the numerator as Q i n , n is the flow of the pipe through which the particle reaches junction n at the arrival time, while the denominator is the sum of all flows in going to junction n at this time. It should be noted that these flows may change as the simulation progresses and the flows evolve along the path followed. The result of the product can be summarized in the factor f O N , k , called dilution factor, which depends only on the circulating flows and their evolution. This factor expresses the relationship between the concentration of the initial particle C o   and that of the sub-particle that reaches junction N via path Π O N , k , named as C O N , k .
Other sub-particles from junction O have the potential to reach junction N, following a different path k, whilst maintaining compliance with the direction of flow at each moment. The travel time between the starting junction O and the destination junction N will vary for each path, and will be given by:
t O N , k = n ϵ Π O N , k Δ t n
where the time taken by a sub-particle to travel through the pipe that accesses junction n is denoted by Δ t n . It is acknowledged that Δ t n can be affected by changes in flow rates as the simulation progresses and the particle travels along the pipe, even flow can reverse in some cases resulting in the final junction n becoming the same as the starting junction of the pipe.
As there may be many paths connecting the O and N junctions, it follows that different sub-particles can arrive at junction N at different times, each sub-particle being characterized by its own load. If junction N is a demand node, a proportion of the sub-particle load will be discharged to outside in accordance with the demand flow, and the remaining load will continue travelling downstream through the outgoing pipes. Therefore, the total load discharged from junction N to outside, originating from the initial particle, after a time T from when that particle started to travel, will be:
G O N , T = k ϵ Π O N t O N , k T C O N , k t O N , k     q t O N , k
where Π O N is now the set of paths connecting junction O with junction N, while C O N , k t O N , k and q t O N , k denote the concentration and the demand of junction N at time t O N , k when the sub-particle travelling along path k arrives to it.
After a long time, and upon the complete dissipation of all sub-particles emanating from the initial particle, a total load G O N , will have been extinguished from junction N. Consequently, by considering all demand nodes N downstream of junction O, the subsequent balance equation must hold true:
G o = N G O N ,
This final balance allows to determine which junctions have consumed the load of the initial particle, and to what extent at each junction.
Alternatively, we could also have formulated a global mass load balance for any time T after the starting time, as follows:
G o = k ϵ Π O N C O , k T Q O , k T + N G O N , T
In the above expression, the first term represents the load of the sub-particles that are still travelling through the network at time T via the different paths k, being C O , k T the concentration of a sub-particle travelling along path k after time T, and Q O , k T the flow rate circulating at that moment through the pipe in which it is located. The second term denotes the load that has left the network through the demand junctions up to the time T, according to (7).
It is important to note that, to track the load of a particle and determine its destination, it is sufficient to know the evolution over time of the flows circulating through the pipes and the flows leaving the junctions.
To clarify all these concepts, let us follow the progression of a single particle within a simple network configuration, as depicted in Figure 3. The network is fed by a single tank, with nine pipes and seven junctions forming two loops. The total demand for these junction s is 100 L/s. The figure illustrates the flow rates circulating through each pipe, their direction, velocities and travel time, assuming permanent regime and according to physical properties of pipes and the nodal demands.
The initial particle leaves tank A with a concentration of 100 ppm, which is equivalent to a load of 10 g/s for a flow rate of 100 L/s. This initial particle will travel along different paths, creating new sub-particles that finally reach the end junction H at different times. According to flow directions, Figure 4 shows the only three possible paths from tank A to junction H, enumerated from the fastest to the slowest as 1 (orange), 2 (green), and 3 (blue), respectively. New sub-particles will be created each time a diversion occurs to follow the different paths.
Upon reaching a junction, each particle contributes a specific mass, thereby determining the junction’s new quality. Then new sub-particles with this quality are created to follow the different paths. In accordance with the principles of the LED method, it can be postulated that particles travel riding a segment of water of uniform quality. When reaching a junction, the segment’s mass is consumed, and new segments are created downstream. Assuming that the chosen particle occupies the initial front of a segment, its arrival at a junction will modify its quality until the arrival of a new segment. The newly generated sub-particles will be positioned at the forefront of the newly formed segments that emerge downstream.
This explains the stepped variation in quality observed at junction H, shown in Figure 5, where a correlation between the observed variations in quality and the travelling routes have been shown. In effect, the fastest particle completes its trajectory along path 1 in 100 s, resulting in an increase in the junction load of 1.6 g/s. This load is sustained until the arrival of the second particle at 120 s, at the forefront of a new segment that follows path 2. This results in an increase in the junction load to 2.8 g/s. At 150 s, the third particle arrives at the front of a new segment that travels along the slowest path 3, resulting in a load of 4 g/s at junction H.
However, this result should not be considered definitive in justifying the load observed at a given junction at a given time, since at that time other particles at the front of other segments from different sources could reach the junction at the same time. Even other particles leaving the same source later with a different concentration can overtake some sub-particles that took a longer path to reach the junction, changing the quality of the junction in advance. For simplicity, this is not our case.
For more detailed tracking of the initial particle’s destination in our illustrative example, Figure 6 shows the status of the particle and its sub-particles at different times, until its total load exits the network through the nodal demands.
Figure 6a shows the initial status. The particle that had previously left tank A reaches junction B after a period of 10 min (Figure 6b). At this point, according to Equation (1), the particle divides into two new sub-particles, with loads of 3 and 6 g/s, respectively, while a load of 1 g/s left the network through the nodal demand (Figure 6c). The two new particles travel to junctions C and E, which they reach at 25 min and 30 min, respectively, where they are dispersed again into new sub-particles (not shown for simplicity). At 60 min (Figure 6d), three particles remain in the network (blue dots). The load balance at this particular time, following Equation (9), gives that a load of 2 + 2 + 2 = 6 g/s persists in their trajectories, while a load of 1 g/s has left the network via each demand node B, C, D, and E (orange dots), summing the remaining 4 L/s (load leaving demand node E not shown for simplicity).
As illustrated in Figure 6d, a sub-particle with a load of 2 g/s arrives at junction F from junction E at the aforementioned time of 60 min. There is also a flow that arrives at this junction from junction C, carrying another particle which is scheduled to arrive at junction F later. Subsequently, upon applying Equation (1), it concludes that there will be just a single term in the numerator and two terms in the denominator. It is important to emphasize that this is a distinction between the FPT method and the LED method, where in the second method all the load entering the junction from the segments was considered. This results in the creation of a new sub-particle with a load of 1.5 g/s travelling to junction G, while 0.5 g/s exit the network through demand node F, as illustrated in Figure 6e. At that time, an additional particle with a load of 2 g/s is also in transit through the pipe DG, so still three particles remain in motion. This particle had its origin at junction D at 45 min and is expected to arrive at junction G at 70 min, exiting 0.4 g/s at this junction and creating a new particle with the remaining load of 1.6 g/s that flows to junction H (the precise instants are not displayed for the sake of simplicity).
The sub-particle travelling from C to F reaches this junction at 90 min, at the same time the sub-particle leaving junction D at 60 min reaches junction G (Figure 6f). Both create new sub-particles that travel towards junctions G and H, respectively, while part of the load exits outside from demand nodes F and G, specifically 0.5 g/s and 0.3 g/s, which add up to a total load discharged by these demand nodes up to this point of 1 g/s and 0.7 g/s, respectively (Figure 6g).
After 100 min, the particle travelling previously from D to G is the first sub-particle to reach junction H (Figure 6g), resulting in the complete discharge of its load of 1.6 g/s at that demand node.
Due to the looped nature of the network, the two remaining sub-particles will reach the final junction H at later times, as they follow slower routes. So, the second sub-particle arrives at junction H at 120 min, where it deposits its load of 1.2 g/s (Figure 6h). Subsequently, the third and final sub-particle arrives at junction H after 150 min to deposit other 1.2 g/s, giving a total of 4 g/s discharged at this junction. (Figure 6i). At that time, the total initial load is known to have departed from the network. A quantitative analysis reveals that finally 1 g/s has exited through demand nodes B, C, D, E, F, and G, and 4 g/s through demand node H, in accordance with the demands of each junction, as depicted in Equation (8).
In the event of a flow reversal, in more complex networks with extended period simulations, the particle may backtrack and return along a previously travelled path and reach a previously visited junction. In this case it will continue to disperse along the outgoing pipes according to the new flow directions at the arrival time to those downstream junctions.
Not all load of the initial particle will eventually leave the network through demand nodes. It can leave the network through reservoirs with incoming flow or be diluted in the tanks until it disappears. In the case of the tanks with inflows, the particle tracking is lost as soon as it reaches them. In order to continue the particle tracking analysis, it would be necessary to consider new particles starting from the point of discharge of the tank, when it is delivering water to the network.
For non-conservative substances, the particle will be losing substance load as it reacts in the bulk and pipe walls while it travels through the network. Assuming that the reaction is first order, for a particle travelling from junction i to junction j through the pipe connecting them, taking a time t i j and whose reaction constant is kij, the following equation can be derived [24]:
C i n , j = C o u t , i   e k i j   t i j
It should be noted that this type of analysis can only be carried out using the LED method, as the Eulerian methods do not track the movement of water masses through the network, and the LTD method, which employs fixed time intervals, does not allow for the precise determination of the substance arrival time at junctions.
The distinctive feature of this analytical approach is its capacity to provide a comprehensive and detailed understanding of the progression of substances within a network, beginning from a specified point of origin. Moreover, given that the final concentration observed at a junction is the superposition of all the paths and starting points, this method enables the influence of each chosen starting junction to be determined.
Nevertheless, if the total concentration observed at a junction at a given moment was to be justified using a forward analysis, it would be necessary to analyze all the particles arriving at that junction at that moment from different starting points. The determination of the origin of each component could be a significant challenge; however, a more efficient method of ascertaining the answer to this question is to perform a backward analysis, as will be outlined in the subsequent section.

2.2. Backward Particle Tracking

Backward particle tracking (BPT) is a more fruitful and versatile research avenue than FPT. BPT analysis facilitates the explanation of the quality measured at a given junction and at a given moment, or the quality obtained as a result of a full simulation previously performed with any of the quality models described in the introduction. However, using the LED method for the full quality simulation has significant advantages, again as will be described.
The current challenge is more intricate, given that the quality of the particles attaining a particular junction at that specific instant is attributable to the superposition of the qualities of a multitude of other particles emanating from diverse supply sources at different times, and dispersed en route to their designated targets, as delineated within the framework of the FPT method. Consequently, upon their concurrent arrival at the junction, these particles retain only a fraction of their initial mass.
To justify the quality observed at a junction N at a given moment, a particle located at that point is considered to trace its trajectory backwards in time, using the same illustrative example as for the forward analysis.
As illustrated in Figure 7, it is assumed now that a particle with a load of 4 g/s is detected at junction H at time t0 = 0 min (Figure 7a). This particle reached junction H through the single pipe that supplies it, coming from junction G. The particle departed from that junction 30 min earlier, with the same load under the assumption of conservative substance (Figure 7b). Junction G is fed by two pipes, and the load of the particle when it leaves junction G will be the result of mixing the loads of two other particles that arrived at that junction at the same time, each with a different load, being the concentration C o u t of the leaving particle given by the mixing equation:
C o u t =     j ϵ I C i n , j   Q i n , j j ϵ I Q i n , j
Which is a generalization of Equation (1), in which now all pipes converging at the junction contribute to determining the load of the particles leaving the junction.
Conducting a preliminary hydraulic analysis enables the determination of flow rates arriving at junction G at this moment, so Qin,j will be known in Equation (11). However, there are still multiple unknowns Cin,j, and a single equation is insufficient to fully address this system of equations. It is needed then to conduct also a preliminary quality analysis to know the fraction of the particle’s load leaving junction G that was contributed by other particles coming from the upstream junctions, D and F.
In a conventional LTD method, it is not always possible to ascertain the precise quality that reached the junction through each pipe at the exact moment the particle departed, as this may not align with a calculation instant. During the time interval encompassed by this method, it might occur that multiple segments would be consumed from some of the pipes feeding the junction, each with a distinct concentration, particularly if the pipes are of short length and the time interval is comparatively large.
In contrast, the LED method is the only approach that allows for the accurate determination of the quality arriving at a junction at any time. This is because, until a new event arrives at the junction through a pipe, the quality of the final segment of the pipe remains constant. This results in a stepped curve of concentration variation at the junctions, as illustrated in the previous Figure 1 and Figure 2, and justified in Figure 5 for this particular example.
Consequently, in order to track particles backwards in time, in addition to being aware of the flow rates, as is the case in the tracking process when particles are moving forward in time, it is also necessary to know the concentration variation at each junction obtained using the LED method, particularly its values before and after the moment when it changes.
As illustrated in Figure 7c, the particle that arrived at G from junction F departed from that junction 30 + 30 = 60 min before the designated instant. Using the LED method, the quality analysis reveals that the particle’s load was 3 g/s at the time of its departure. In contrast, the particle that originated from junction D departed 30 + 25 = 55 min earlier with a load of 2 g/s. Consequently, both reach junction G simultaneously, 30 min before the designated moment, resulting in an aggregated load of 3 + 2 = 5 g/s. According to Equations (3) and (11), at junction G 1 g/s leaves the network in the demand node, and 4 g/s persist in their trajectory through junction H, matching with the observed load at that junction.
Extending this reasoning to all network, finally three initial particles contributed to providing the load of 4 g/s to the observed particle in junction H at the designated instant. The more recent particle left tank A 100 min earlier, bearing a load of 10 g/s (Figure 7d). At that particular instant, two additional particles were already in travelling through pipes BE and CF, with respective loads of 3 g/s and 2 g/s. The first of them was a consequence of another particle that departed from tank A 120 min prior (see Figure 7e), while the second was a consequence of other particle that left the same tank 150 min earlier (see Figure 7f).
In the backward analysis, each time a particle reaches a junction, new particles are created that converge on it, one for each pipe that feeds the junction, so the trajectories that converge on the destination junction fanning out. However, it can be demonstrated that these trajectories ultimately converge to focus on the sources (tanks, reservoirs and junctions with negative demand), which represent the only possible origins. The total number of particles that will depart from the supply sources is equal to the number of paths consistent with the circulating flows that connect the different sources to the observation junction. It is important to note that each of these particles will leave the source at a different instants, so that the sum of the time lag between that instant and the moment of departure of the slowest particle, plus the time taken to travel the entire path given by (6), must always be the same for the coincidence at the destination junction to occur at the moment of observation.
In the provided example, the three particles originate from the same point. The travel times for each of the routes are 100, 120, and 150 min, respectively. The first particle departs 50 min after the third, which is the slowest, and the second departs 30 min after the third.
To verify the results, a FPT analysis of each of these particles can be performed. Upon reaching a junction, the creation of new particles is initiated downstream, as many as there are pipes coming out of the junction. However, it should be noted that only those particles which follow one of the paths constructed during the preceding BPT analysis will reach the destination junction at the moment of observation, and only these particles will contribute to justifying the load observed at the destination junction.
To determine the proportion in which each travelling particle contributes to the final load, Equation (1) can be referred once more, which ultimately leads to Equation (5). It must be noted that, while the BPT analysis generates as many particles for each junction as pipes feed it, the FPT analysis of the source particles considers an independent behaviour for each one of them, despite their potential convergence at a given junction and moment along their trajectory towards the destination junction. In fact, multiple particles which embarked on their journey at distinct times and origins, must progressively coincide at the intermediate junctions along their trajectories. This gradual convergence of particles ultimately culminates in a state of simultaneity at the same destination junction and instant.
According to the provided description, the overall mass balance leads to the following equation:
G N = k K N G o , k t O N , k f O N , k
G N being the total load observed at the destination junction N, K N the set of all paths leading to the destination junction from the different origins O, t O N , k the departure time for each path according to the travelling time given by Equation (6), and f O N , k the overall dilution factor for each path given by Equation (5). The initial load of the particle G o , k at the departure time is the product of the concentration of source O and the output flow rate at that time, so G o , k t O N , k = C o , k t O N , k Q o , k t O N , k . Finally, this load will eventually be diluted according to the factor f O N , k .
Conversely, at any given moment T during the period in which the particles move toward their destination, the following must hold true:
G N = k K N G k T   f O N , k , T + k K N G O , k t O N , k T   f O N , k
where the first term constitutes the aggregate contribution to the final load of the particles travelling along paths that leads to the destination junction at time T. The dilution factor f O N , k , T of these particles will be a fraction of the overall dilution factor for the path f O N , k , which only accounts for the part of the path that has already been travelled on the journey backwards in time. The second term represents the contribution of particles that will leave their sources at a time after T, that is, of the particles that have already completed their journey backwards at that moment.
For the sake of clarity, let us apply the above mass balances to our illustrative example. It has been shown that the total load of junction H is attributable to the contribution of three particles that departed from tank A at designated times t6 = −100 min, t8 = −120 min, and t11 = −150 min, bearing each particle a load of 10 g/s. According to Equation (5) and the flow rates shown in Figure 3, Table 1 summarizes the resulting mass balances, where the loads are expressed in g/s, and the concentrations in ppm. First, the dilution factors are calculated for three specific times: t1 = −30 min (Figure 7c), t6 = −100 min (Figure 7d), and t11 = −150 min (Figure 7f). At the bottom of Table 1, for each case, the load of the particles under consideration is initially converted into concentration by dividing it by the flow rate of the pipe in which they are located. Then, the corresponding dilution factor is applied, and the final concentration is converted back into the contributed load to the observed load at the destination junction by multiplying it by the flow rate at this point. It can be verified that the aggregated load contributed by all particles equals 4 g/s in all cases, which corresponds to the observed load.
As illustrated in Figure 7c, when t1 = −30 min, the partial dilution factor for the particle following path 1 (Figure 4) is   f O N , k , T = 20 / ( 30 + 20 ) = 0.4 , while for the particle resulting from the merger of paths 2 and 3, it is   f O N , k , T = 30 / ( 30 + 20 ) = 0.6 . The final charge contributed by each particle is 1.6 g/s and 2.4 g/s, respectively, giving a total of 4 g/s. When applying Equation (13), only the first term is considered in this case, since no particle has yet reached its point of origin. In the case of Figure 7d, one of the particles has already reached the tank, and its load is considered in the second term of Equation (13), contributing 1.6 g/s to the final load, of the initial 10 g/s. Finally, in the case of Figure 7f, when the slowest particle leaves, only the second term of Equation (13) is counted. This is equivalent to applying the global Equation (12), which defines how each of the initial particles contributes to justifying the final load observed in H.
A more general mass balance reveals that the total output mass of the original particles is 10 + 10 + 10 = 30 g/s, of which only 4 g/s reach junction H, with no reactions occurring. The remaining mass has three possible destinies: it has either already left the system through the demand nodes, has arrived at junction H prior to the moment under consideration, or is currently in transit through the network’s pipes and is scheduled to arrive at junction H later. For example, in the scenario where a particle is emitted from the tank at t8 = −120 min (Figure 7e), a sub-particle derived from it follows the fastest path (path 1) and arrives at junction H earlier, while another follows the slowest path (path 3) and will arrive at junction H later. Only the particle that follows path 2 arrives at the precise moment, thereby contributing a total of 1.2 g/s to the observed load. In other networks, some sub-particles may also be travelling through the network at a given moment that will never reach the observation point. These sub-particles do not form part of the balance of Equation (13).
It is important to note that, once the paths leading to the observation junction from the sources, and its departure times have been identified, the initial load of the particles that contribute to the observed load at the destination junction can be determined from data, as well as the contribution of each of these particles to that final load. This condensed model is referred to in the literature as an input-output model [18]. Following this model, it is now possible to reproduce the progress of each particle and observe how their load is diluted downstream following the multiple paths created according to the method described in Section 2.1, but to justify the observed load at the destination junction we must restrict the progress only to the paths that lead to it. However, this type of analysis will require as many forward analyses as there are particles contributing to the final load.
On the other hand, if a prior quality model has been executed by the LED method, by applying the BPT method, it is possible to determine in a single execution which particles contribute at each moment to justify the observed load, their location at each time, and the load they have at that moment. This load will increase as we approach backward to the source node, as illustrated in Figure 7. This is a critical consideration for future applications, such as the use of the BPT method to identify the injection point of a pollutant.
Finally, it should be noted that the illustrative example assumes constant flows and the transport of a conservative substance. As articulated in the FPT method, all flow changes must be considered in practice, which may occur while the particles are in the middle of a pipe, and their direction may even undergo a reversal. Moreover, for non-conservative substances, the concentration of the particle at the pipe’s end junction must undergo correction with respect to its concentration at the initial junction, employing in the case of first-order reactions Equation (10) in reverse order. These considerations will affect the calculation of the dilution factors by extending Equation (5), while the other considerations made in this section remain valid.

2.3. Implementation

This section presents the implementation of the two algorithms presented. Both forward (Algorithm 1) and backward particle tracking (Algorithm 2) algorithms are similar. The main difference resides in the direction in which particles are created, while in the forward analysis new particles are created downstream the junctions, in the backward analysis the new particles are created in upstream direction. Also, flow changes, even flow reversal and non-conservative substances are considered.
In both cases, a distinction is made between hydraulic events, in which only a change in flow occurs, and quality events, in which a particle reaches the end or the start node of a pipe, disappears, and new particles are created.
On the other hand, in the forward analysis, a history is kept of the mass flows that leave the network through the nodal demands, which does not make sense in the backward analysis, since the nodes do not contribute mass flow unless they are a source.
Another important difference is that, while in the forward analysis the particle load is distributed between the pipes leaving the node and the nodal demand, in the case of the backward analysis it is not possible to know a priori the mass flow of the particles that converge at a node (this may sometimes be zero) and therefore it is necessary to recover the results of a previously executed quality analysis. However, this does not invalidate the method, as the aim is to justify a quality value that has been previously calculated or observed.
Algorithm 1. Forward Particle Tracking Algorithm.
FORWARD PARTICLE TRACKING

Input:
      Read Hydraulic Results
      Read Initial Particle: position, time, mass flow

Output:
      Declare data structures:
         -
Travelling Particles
         -
Particle History (position and mass flow)
         -
Demand nodes History (outlet mass flow)

      Initiate Procedure:
         -
Network topology
         -
Counters
         -
Create the initial particle, assign its initial values and add to Travelling Particles

      Do
             Update
             -
Add the new particles to Particle History
             -
Perform mass balances
             -
Determine the first lapse of arrival time to the end nodes ∆tQ, for all travelling particles
             -
Determine lapse time to next hydraulic interval ∆tH = tNextH

             Advance
             -
Calculate the next ∆t = min (∆tQ, ∆tH)
             -
Update next time t = t + ∆t     
  • If ∆t = ∆tQ → Quality event
  • If ∆t = ∆tH → Hydraulic event
             -
Advance all travelling particles the lapse time ∆t
             -
Update mass flow if the substance is non-conservative
             -
If Hydraulic Event:
  • Update flows and velocities
  • Check for reversing flows
  • Update arrival times for travelling particles

             Distribute (if Quality Event)
             -
Remove current particle from the list of Travelling Particles
             -
Create new particles in the outgoing pipes from the end node of the current pipe and add to Travelling Particles
             -
Read its hydraulic values from Hydraulic Results
             -
Distribute the particle’s mass flow between the outgoing pipes and the node demand
             -
Add the outlet mass flow to the Demand nodes History

      Until t = tend or #Travelling Particles = 0
Algorithm 2. Backward Particle Tracking Algorithm.
BACKWARD PARTICLE TRACKING

Input:
      Read Hydraulic Results
      Read Quality Results
      Read observed quality to understand, at specific junction and time t

Output:
      Declare data structures:
          -
Travelling Particles
          -
Particle History (position and mass flow)

      Initiate Procedure:
        -
Network topology
        -
Counters
        -
Create the initial particle, assign its initial values and add to Travelling Particles

      Do
               Update
             -
Add the new particles to Particle History
             -
Perform mass balances
             -
Determine the first lapse of departure time from the start nodes ∆tQ, for all travelling particles
             -
Determine lapse time to next hydraulic interval ∆tH = t − tPrevH

               Advance
               -
Calculate the next ∆t = min (∆tQ, ∆tH)
               -
Update next time t = t − ∆t
  • If ∆t = ∆tQ → Quality event
  • If ∆t = ∆tH → Hydraulic event
               -
Backtrack all travelling particles the lapse time ∆t
               -
Get the new mass flow from Quality Results (non-conservative substances)
               -
If Hydraulic Event:
  • Update flows and velocities
  • Check for reversing flows
  • Update departure times for travelling particles

               Contribute (if Quality Event)
               -
Remove current particle from the list of Travelling Particles
               -
Create new particles in the incoming pipes to the start node of the current pipe and add to Travelling Particles, except if particle arrives to a quality source (tank, reservoir or injection node)
               -
Read its hydraulic values from Hydraulic Results
               -
Get the mass flow of the new particles from Quality Results

      Until t = 0 or #Travelling Particles = 0

3. Results

To illustrate the outcomes of the methodology developed in a real network, the Net3 network distributed as an EPANET example, depicted in Figure 8, has been employed.
The network is supplied by two sources: the lake and the river, so the water flowing through the network is a blend of the two distinct origins, being the first of lower quality. The river supplies the system continuously, but at 03:37 h the pump stops because Tank 1 is filled, reducing the inflow until the pump is switched on again. On the other hand, the pumping from the lake is only operational for a few hours per day following a timer control, ceasing the inflow when the pump is switched off, as illustrated in Figure 9.
For the purposes of this example, it has been assumed that the lake contains a conservative substance with a concentration of 100 ppm, which will be introduced into the network when the pump is operating, whereas the river is free of it.
As the supply is shared, the network junctions present variability in time in their concentration. These variations in concentration are mainly due to the fluctuations in the consumption patterns of the junctions and to changes in the pumping regimes from the sources and tank flows. These factors determine the flow rates through the network and, therefore, the mixtures that occur between the flows from different sources.
Proceeding with the analysis, the two FPT and BPT methods will be performed to analyze the quality results obtained for junction J113, highlighted in Figure 8, in the first hours of the simulation period.

3.1. Forward Particle Tracking for Net3

FPT over time enables the observation of a substance’s propagation through the network. This observation reveals the dilution of the substance’s mass as it disseminates through the network and as demand nodes extract some substance’s mass flow from the network.
In the case study under consideration, it is of interest to determine the extent to which the substance is introduced into the system from the lake. To illustrate, we propose the tracking of a particle that leaves the lake source at 00:30 h, focusing on when the substance reaches junction J113.
Figure 10 shows the progress of the particle after 1.5 h, i.e., at 02:00 h. Considering the changes in flow directions occurred in this period, the pipes show the trail left by the mass flows transported by the particle (and its sub-particles) as it circulates through the network pipes, according to the pipes’ legend. On the other hand, the junctions’ legend reflects the mass flows consumed in them. In both cases, the results shown are the cumulative mass flow contributed by all the sub-particles that have reached them up to the time of observation. Furthermore, the stars indicate the position of the sub-particles travelling through the network at the moment of observation.
The initial particle left the lake with a concentration of 100 ppm, which corresponds to a mass flow of 21.1 g/s for the outlet flow. Upon reaching the first junction, the particle began to disperse, with a portion of its mass flow exiting the system through the first demand node and the remaining mass flow continuing to travel the network via the junction’s outlet pipes. A similar analysis occurs in the following junctions.
Finally, three sub-particles are observed traversing the network at 02:00 h, each creating a trail of mass flow in its trajectory. At this time, it can be verified that the mass balance is accurate following Equation (9):
G o = k ϵ Π O N C O , k T     Q O , k T + N G O N , T = 12.1 + 9.0 = 21.1   g / s
By now, the paths have been visited only once by a particle or sub-particle, with the substance not yet reaching the looped sections where the same pipe will be travelled by several particles at different moments in time. Each sub-particle increases the accumulated mass flow trace in the pipe, as well as the mass flow that leaves the network through the demand nodes reached.
At this moment, as shown in Figure 10, the junction of interest J113 has not yet been reached by any sub-particle.
Sometime later, by 3:00 h, the substance has traversed a substantial portion of the network having reached junction J113, as illustrated in Figure 11. Currently, there are 4 sub-particles upstream junction J113 travelling in the network. All of them are sub-particles originated from the same particle C shown in Figure 10, that have been created when arriving at their corresponding downstream junctions.
At this moment, the network is traversed by multiple sub-particles. In the case of sub-particle C3, it is travelling through a pipe that changes its flow direction during the course of the simulation. From 00:00 h to 01:00 h, the flow direction is upstream, followed by a transition to downstream from 01:00 to 02:00. Then, a reversion to upstream flow is observed from 02:00 onward. It is important to note that sub-particles originate exclusively in the outgoing pipes of a junction at the arrival time; therefore, sub-particle C3 originates because it is created at 2:10 h, at which time the flow has an outgoing direction from the junction.
Furthermore, sections of the looped network have already been reached, where it can be observed how sub-particles are travelling again through a section that has already been travelled through previously. In this scenario, upon reaching these demand nodes, the accumulated mass flow rate at the output increases, as each new sub-particle that arrives contributes a fraction of its mass flow rate.
The specific case of junction J113 is examined now in greater detail. At 3:00 h, the junction was reached by three sub-particles:
  • t = 02:23 h: the junction is first reached via the fastest route. The first sub-particle that arrives, A1, is originated from particle A shown in Figure 10 and possesses a mass flow rate of 2.9 g/s, of which 0.1 g/s is consumed at junction J113, and 2.8 g/s continues its trajectory through the network. At that moment, the total inlet flow to the junction is 956 gal/min, resulting in a concentration of the junction of 48 ppm. Given the constant concentration at the source, the concentration at junction J113 will remain constant until new particles reach the junction or the flowrates in the pipes change.
  • t = 02:35 h: the junction is reached for the second time. The second sub-particle that arrives, B2, is originated from particle B (Figure 10). Sub-particle B2 possesses a mass flow rate of 0.6 g/s, of which 0.02 g/s is consumed at the demand node and the rest continues to travel downstream. The load carried by this sub-particle is added to the previous one. In the hydraulic model, changes in flow occur at hourly intervals, while the concentration at the source remains constant. Consequently, the concentration at junction J113 increases to 58 ppm.
  • t = 02:44 h: the junction is reached by a third sub-particle B3, also originated from particle B in Figure 10. Sub-particle B3 carries a mass flow rate of 0.4 g/s, of which 0.01 g/s is consumed at the junction and 0.39 g/s continues travelling downstream through the network. This sub-particle’s load is added to the previous ones, resulting in a concentration of 65 ppm.
The joint contribution of these three sub-particles, as well as the contributions of sub-particles C1 and C2 (Figure 11), provide a comprehensive explanation for the sharp but progressive increase in the junction’s concentration between 2:00 h and 3:00 h, shown in Figure 12. To sum up, as shown in this example, FPT provides a comprehensive analysis of the movement of a substance through the network.

3.2. Backward Particle Tracking for Net3

The following section shows how BPT allows to explain the quality simulation results observed. Once more, the focus will be on junction J113.
Observing the concentration of the substance at the junction, temporal variability can be seen over time, resulting from the mixing of water from the two sources with different initial substance concentration, 100 ppm for the lake and 0 ppm for the river. Figure 12 shows how the concentration starts at 0 ppm, increases from 2:00 h to 5:00 h up to 100 ppm, and then begins to decrease at 16:30 h, presenting various steps, until finally returning to a concentration value of 0 ppm.
The aim of this case study is to justify the concentration observed at junction J113 at two points in time: at 3:30 h, when the concentration nearly attains its maximum value, and at 17:30 h, when the concentration experiences a drop.
A BPT analysis is performed at 3:30 h, whose results are shown in Figure 13. As illustrated, the trajectories of the various particles that departed their origins at distinct times, culminate at junction J113 at 3:30 h. The accompanying legend provides the respective departure times for each route, while pipes are coloured according to the fastest rout, i.e., the route taken by the particle that passed through them first.
The paths travelled by particles arriving at the junction from the lake, where the substance concentration is 100 ppm, are delineated from red to yellow. Furthermore, contributions from other paths, whose initial concentration of the substance is 0 ppm, are represented in blue.
At the beginning of the simulation (0:00 h), the BPT concludes that some particles have not yet reached any origin and remain in the middle of the network, represented by stars. The initial load of these particles is 0 g/s, given that the initial concentration of substance in the network is 0 ppm for all junctions. In this way, their contribution to junction J113 at the moment of arrival will also be 0 g/s.
In summary, as a result of the BPT analysis at 3:30 h, it can be concluded that the observed concentration at junction J113 remains slightly below 100 ppm, due to the contribution of some particles present in the network with initial concentration of 0 ppm.
Subsequently, the same BPT has been performed at 17:30 h, to analyze the observed concentration at the same junction, which results are illustrated in Figure 14. In this moment, a total of 10 particles originating from the two sources and Tank 3 arrive at the junction concurrently at the instant of analysis. Four particles emanated from the lake at different times, all of them with an initial concentration of 100 ppm, traverse the network along distinct pathways, arriving at junction J113 at the same time. But the fastest road has now changed from 3:30 h. Moreover, 6 additional contributions have been identified, 3 originating from the river and 3 from Tank 3, all of them with an initial concentration of 0 ppm.
It should be noted that in double-arrow pipes there is a change in flow direction along the analysis time, so that some particles travel through them at a given moment and others do not because they arrive after the flow has been reversed. In particular, the particle that left tank 3 at 12:09 h, mixed with the particle that left the river at 12:04:20 h, took longer to travel its path than the particle that left tank 3 later at 12:11 h, due to the fact that it took the direction of a pipe that led it to another destination, but the reversal of flow in this pipe redirected it back to the correct route with a certain delay (light green line).
A more in-depth analysis of particles tracking would have revealed that the reason why the concentration of junction J113 drops sharply from 96 ppm to 41 ppm between 16:30 h and 17:30 h (Figure 12) is due to the shutdown of the pump that was delivering water from the lake at 15:00 h (Figure 9), whose effect begins to be noticeable at this junction at 16:30 h. As a result, from that time a greater flow arrives at junction J113 from the river and, to a lesser extent, from Tank 3. However, junction J113 is fed at that time directly by two pipes, one carrying water at a significantly lower velocity than the other. The slower pipe retains the water from the lake for longer, and only when this runs out does the concentration at the junction drop definitively to almost 0 g/s, which occurs at 18:30 h (Figure 12).
In summary, the employment BPT analysis has facilitated a more precise determination of the underlying cause of the observed concentration at various times at junction J113, and its most important fluctuations during a simulation period.

4. Discussion

The potential of the particle tracking method for analyzing substance dispersal through networks from their point of origin, or for justifying observed concentrations of substance transported by water at network junctions, has been demonstrated through detailed illustrative examples in Section 2.1 and Section 2.2, as well as through the analysis of results presented in Section 3.1 and Section 3.2 on a more realistic use case, applying in this case the algorithms described in Section 2.3.
In contrast to the upstream and downstream tracking tools offered by certain network analysis applications, which identify the upstream and downstream pipes of a junction based solely on a topological analysis of connectivity and flow direction at a given moment, the methods proposed in this paper aim to identify the upstream and downstream paths of a junction through a kinematic analysis. In this analysis, the speeds and flow directions change over time, and the load of the particles travelling along these paths is also updated at each moment.
The tracking methods proposed differ also from the trace analysis currently implemented in EPANET 2.2 water quality simulation model. This model is based on the LTD method and applied exclusively to forward movement. At each time interval, a mixing process is executed at all junctions, which considers the total mass of substance entering each junction from all upstream junctions. This process is performed without differentiating between the various paths followed by the flow or their conditions at the time of departure. While the method is valid and effective for assessing the movement of a substance through a network and determining the percentage of observed quality at a junction attributable to a specific source, the loss of the individual particle tracking limits the ability to conduct a more comprehensive analysis of the temporal and spatial evolution of water quality.
Conversely, the proposed particle tracking methods facilitate a more in-depth analysis of WQ models. The analysis of the forward and backward movement of a particle can be understood as two distinct problems that share a common objective: to justify the observed quality at a junction and its temporal variations. However, it is imperative to differentiate between the two methods to ensure comprehensive understanding. To that end, we will initially refer to the illustrative example shown in Section 2.
The FPT has demonstrated how the arrival of particles at a junction, from a single specific source, rules the variations in the junction’s concentration. But concentration at a junction at a given time can be affected by other particles arriving at the junction following different paths.
While in FPT analysis there is a single starting point and multiple arrival junctions at different times, each ultimately consuming a fraction of the initial load, in BPT analysis there is a single destination junction and multiple starting points at different times, each responsible for a fraction of the observed load at the destination junction. It is only the latter that permits the determination of the final value of the quality observed at a junction. In fact, both methods are dual to each other and should lead to the same results to respect the principle of conservation of mass, but their immediate objectives are not the same, nor are the particles involved in each method.
The realistic example in Section 3.1 and Section 3.2 presents a more complex situation, with flows that change over time as particles travel. First, an FPT analysis was used to justify the sudden but progressive increase in quality at junction J113 from 2:00 onwards. In this case, as there is only one point of entry for the substance, the particles that reach junction J113 from that point justify the total concentration observed. However, the FPT is not sufficient to justify the drop in quality observed in that junction from 16:30 onwards. The operation of the water pump at Lake is turned off at 15:00 h, a change that results in a shift in the direction of flows. In this moment, the network’s intricate configuration and its operation shows that justifying the observed quality is not a simple task. To obtain a comprehensive understanding of the factors contributing to the quality variations from 16:30, an BPT has been imperative.
It should be noted that the tracking of particles both forwards and backwards is based on an event-driven quality model (LED), since most of the quality models currently in use, and particularly the one used by EPANET 2.2, is a time-driven model (LTD) that does not allow particles to be differentiated from one another when they are close together.
An extension of the proposed methodology, with the help of AI techniques, will in future enable users to be informed of the various significant changes observed in water quality throughout the network, the causes of these changes, their scope, the moment at which quality exceeds the established thresholds, etc.
It is worth noting the large number of practical applications that can be derived from the proposed methodology. These applications are difficult to achieve by other methods or may require the use of more laborious processes. For instance, if a sensor detects a pollutant at a specific point in the network, it is mandatory to ascertain its origin promptly. A BPT analysis can be used to determine the possible origins of the pollutant and the initial concentrations that could justify the observed concentrations. Conducting repetitive measurements over time of the pollutant’s concentration at a specific location or its subsequent detection at other measuring points at different times and concentrations can assist in narrowing down the potential origins of the pollutant. This approach can even lead to the estimation of its concentration value in the event of a single-entry point and a constant mass flow injected over a period. After a hypothesis regarding the origin of the intrusion has been formulated, the subsequent analysis of a set of particles emitted from the specified point over a period will facilitate the estimation of the extent of the affected area from the moment the pollutant began to enter.
Other practical cases can be addressed by analyzing particle tracking, with certain advantages over traditional quality modelling methods. For instance, to ascertain the specific points in the network traversed by a given substance and the respective proportions in which it is present, as well as to determine the potential locations of its consumption. It can also be determined how switching on/off a pump or opening/closing a valve affects the path followed by the substances transported by the water, and at what points and at what time these maneuvers are noticeable. Therefore, it is possible to ascertain the appropriate course of action to redirect the destination of a substance.
A number of additional practical applications have been identified, including the calibration of quality models by following the concentration of a conservative tracer [25,26], the scheduling of network cleaning operations by periodical discharges (flushing analysis) [27], the controlled distribution of fertilizers in centralized irrigation networks [28], among others.
Finally, the particle analysis method is also applicable to real-time WQ monitoring. This will be based on measurements from specific sensors distributed throughout the WDN. As a result, it is possible to constantly maintain a certain number of particles travelling along the WDN. These particles report on water quality at the points where they are located at any given time.
The main limitation observed so far in the proposed model is the presence of storage tanks. Upon the arrival to the tanks, the particles are subjected to dilution, resulting in the loss of their trace. Conversely, new particles are continuously entering the network from the tanks, with qualities that vary over time and are not always easily predictable. The quality of the water in the tanks is subject to continuous changes due the inflows and outflows, as well as reactions occurring within the tanks that result in the retention of particles that have arrived at a previous time. However, more detailed models that simulate the behaviour of water quality in tanks using CFD techniques [29,30,31] also allow the creation of surrogate models configured by segments of different qualities that advance in piston mode, LIFO or FIFO type, or configured by completely mixed compartments [32]. Through these models, it is possible to extend the particle model presented here to predict how, at the same time that a particle with a certain quality enters a tank through an inlet pipe, another particle with a different quality exit through one of the outlet pipes, thus closing the paths. This issue is reserved for further exploration in future research initiatives.
Finally, this paper has not covered any discussion of reactions that affect the evolution of particle quality over time, having outlined exclusively the treatment for first-order reactions. However, all reaction models considered, for example, in the EPANET 2.2 software, both in bulk and pipe walls, would be equally applicable to determine the evolution of a particle’s quality as it travels through the pipes. However, in the context of examining reactions among distinct substances, as exemplified by the MSX model [33], particle analysis can become more intricate. This is due to the necessity of simultaneously monitoring multiple particles, each bearing a unique substance, as they react with one another over time. Furthermore, the analysis necessitates prolonging the tracking of particles resulting from the aforementioned reactions, to ensure comprehensive and precise data collection. However, the analysis of fluid motion by tracking a substantial number of differentiated particles has emerged as one of the most effective analysis techniques in simulating flows, considerably more complex than those discussed here [34].

5. Conclusions

Current transport models that simulate the evolution of WQ as it travels through WDNs are aggregated models in space and time. While these models have proven effective, they lack the capacity to reveal certain circumstances that can only be discerned using a particle tracking models, as shown in the present study.
This paper proposes a methodology for tracking quality particles throughout a hydraulic network, both forward and backward in time. The methodology comprises two dual methodologies for explaining the observed behaviour of water quality at any junction and its fluctuations. FPT enables the determination of the progress of any substance introduced into the water and its ultimate destination. Conversely, the BPT enables the determination of the origin of a substance observed at a specific junction, along with the various routes and sources of its origin.
The paper commences with the establishment of the fundamentals of the proposed methodology, using an illustrative example. It subsequently generalizes its application to more complex networks, thereby demonstrating the potential and universality of the proposed technique. Specifically, the sudden changes in WQ observed in a selected junction of a realistic network have been justified using the new technique.
Applying the principle of superposition, both particle tracking models ultimately lead to the same results as the aggregate models; however, they provide a greater degree of detailed information regarding the events taking place throughout the network. This approach can be valuable in identifying the source of a pollutant, predicting its trajectory and eventual destination, and implementing corrective measures to enhance the WQ parameters that ultimately reach users.
Furthermore, numerous other applications have been identified as potentially benefiting from the novel technique in the future, including real-time monitoring of water quality in networks using tracer particles that are transported by the water as it flows.

Author Contributions

Conceptualisation, F.M.-A., M.H., P.C. and J.C.A.; methodology F.M.-A., M.H., P.C. and J.C.A.; data curation, M.H.; validation F.M.-A. and M.H.; formal analysis F.M.-A. and M.H.; writing—original draft preparation, M.H.; writing—review and editing F.M.-A. and M.H.; visualization M.H. and F.M.-A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data is contained within the article. The data for the examples presented in this study are available on request from the corresponding author.

Conflicts of Interest

Authors Marta Hervás Carot, Pilar Conejos, and Joan Carles Alonso Campos were employed by the company Idrica. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Clark, R.M. The USEPA’s distribution system water quality modelling program: A historical perspective. Water Environ. J. 2015, 29, 320–330. [Google Scholar] [CrossRef]
  2. Lipiwattanakarn, S.; Kaewsang, S.; Makpiboon, C.; Changklom, J.; Pornprommin, A. Water Quality Audit in Drinking Water Distribution Networks. J. Water Resour. Plan. Manag. 2020, 147, 04020113. [Google Scholar] [CrossRef]
  3. Carabeț, A.; Mirel, I.; Florescu, C.; Stăniloiu, C.; Gîrbaciu, A.; Olaru, I. Drinking Water Quality in Water-Supply Networks. Environ. Eng. Manag. J. 2011, 10, 1659–1665. [Google Scholar] [CrossRef]
  4. Bello, O.; Abu-Mahfouz, A.; Hamam, Y.; Page, P.; Adedeji, K.; Piller, O. Solving management problems in water distribution networks: A survey of approaches and mathematical models. Water 2019, 11, 562. [Google Scholar] [CrossRef]
  5. Díaz, S.; González, J. Framework for the Statistical Characterization of Supplied Water Age in Water Distribution Networks. Water Resour. Manag. 2025, 39, 4335–4359. [Google Scholar] [CrossRef]
  6. Grayman, W.M. History of water quality modeling in distribution systems. In Proceedings of the WDSA/CCWI Joint Conference Proceedings (Vol. 1), Kingston, ON, Canada, 23–25 July 2018. [Google Scholar]
  7. Kowalska, B.; Holota, E.; Kowalski, D. Simulation of chlorine concentration changes in a real water supply network using EPANET 2.0 and WATERGEMS software packages. WIT Trans. Built Environ. 2018, 184, 39–48. [Google Scholar]
  8. Machell, J.; Boxall, J. Field studies and modeling exploring mean and maximum water age association to water quality in a drinking water distribution network. J. Water Res. Plan. Manag. 2012, 138, 624–638. [Google Scholar] [CrossRef]
  9. Ettema, R.; Arndt, R.; Roberts, P.; Wahl, T. Hydraulic modelling: Concepts and practice. In Manuals and Reports on Engineering Practice; American Society of Civil Engineers: Reston, VA, USA, 2000; pp. 1–390. [Google Scholar]
  10. Ostfeld, A. A review of modeling water quality in distribution systems. Urban Water J. 2005, 2, 107–114. [Google Scholar] [CrossRef]
  11. Savic, D.; Kapelan, Z.; Jonkergouw, P. Quo vadis water distribution model calibration? Urban Water J. 2009, 6, 3–22. [Google Scholar] [CrossRef]
  12. Grayman, W.M.; Clark, R.M.; Males, R.M. Modeling distribution system water quality: Dynamic approach. J. Water Resour. Plan. Manag. 1988, 114, 295–312. [Google Scholar] [CrossRef]
  13. Rossman, L.A.; Boulos, P.F. Numerial methods for modelling water quality in distribution systems: A comparison. J. Water Resour. Plan. Manag. 1996, 122, 137–146. [Google Scholar] [CrossRef]
  14. Liou, C.P.; Kroon, J.R. Modeling the propagation of waterborne substances in distribution networks. J. Am. Water Work. Assoc. 1987, 79, 54–58. [Google Scholar] [CrossRef]
  15. Boulos, P.F.; Altman, T.; Jarrige, P.; Collevati, F. An event-driven method for modelling contaminant propagation in water networks. J. Appl. Math. Model. 1994, 18, 84–92. [Google Scholar] [CrossRef]
  16. Boulos, P.F.; Altman, T.; Jarrige, P.; Collevati, F. Discrete Simulation Approach for Network-Water-Quality Models. J. Water Resour. Plan. Manag. 1995, 121, 49–60. [Google Scholar] [CrossRef]
  17. Zierolf, M.L.; Polycarpou, M.M.; Uber, J.G. Development and autocalibration of an input-output model of chlorine transport in drinking water distribution systems. IEEE Trans. Control Syst. Technol. 1998, 6, 543–553. [Google Scholar] [CrossRef]
  18. Shang, F.; Uber, J.G.; Polycarpou, M.M. Input-Output Model of Water Quality in Water Distribution Systems. In Proceedings of the Joint Conference on Water Resource Engineering and Water Resources Planning and Management 2000: Building Partnerships, Minneapolis, MN, USA, 30 July–2 August 2000; pp. 1–8. [Google Scholar]
  19. Shang, F.; Uber, J.G.; Polycarpou, M.M. Particle Backtracking Algorithm for Water Distribution System Analysis. ASCE J. Environ. Eng. 2002, 128, 441–450. [Google Scholar] [CrossRef]
  20. Hervás, M.; Martínez-Alzamora, F.; Conejos, P.; Alonso, J.C. Advantages of the Event Method for the simulation of Water Quality in Pressurized Water Systems. Water 2024, 16, 599. [Google Scholar] [CrossRef]
  21. Davis, M.J.; Janke, R.; Taxon, T.N. Mass imbalances in EPANET water-quality simulations. J. Drink. Water Eng. Sci. 2018, 11, 25–47. [Google Scholar] [CrossRef]
  22. Munavalli, G.R.; Mohan-Kumar, M.S. Modified Lagrangian method for modelling water quality in distribution systems. Water Res. 2004, 38, 2973–2988. [Google Scholar] [CrossRef]
  23. Basha, H.A.; Malaeb, L.N. Eulerian-Lagrangian method for constituent transport in water distribution networks. J. Hydraul. Eng. 2007, 133, 1155–1166. [Google Scholar] [CrossRef]
  24. Rossman, L.A.; Woo, H.; Tryby, M.; Shang, F.; Janke, R.; Haxton, T. EPANET 2.2 User Manual; Water Infrastructure Division; Center for Environmental Solutions and Emergency Response; U.S. Environmental Protection Agency: Cincinnati, OH, USA, 2020.
  25. Boccelli, D.; Shang, F.; Uber, J.; Orcevic, A.; Moll, D.; Hooper, S.; Masslia, M.; Sautner, J.; Blount, B.; Cardinali, F. Tracer Tests for Network Model Calibration. In Proceedings of the World Water and Environmental Resources Congress 2004: Critical Transitions in Water and Environmental Resources Management, Salt Lake City, UT, USA, 27 June–1 July 2004. [Google Scholar]
  26. Suroso, I.; Boissevain, P. Using Tracer Field Testing for Model Calibration: A Case Study. In Proceedings of the 12th Annual Conference on Water Distribution Systems Analysis (WDSA), Tucson, AZ, USA, 12–15 September 2010. [Google Scholar]
  27. Xiongfei, X.; Nachabe, M.; Zeng, B. Optimal Scheduling of Automatic Flushing Devices in Water Distribution System. J. Water Resour. Plan. Manag. 2014, 141, 04014081. [Google Scholar]
  28. Jiménez-Bello, M.A.; Alonso-Campos, J.C.; Manzano-Juárez, J.; Martínez-Alzamora, F. Methodology for flushing pressurised irrigation networks for fertigation and operation maintenance purposes. Irrig. Sci. 2021, 39, 375–384. [Google Scholar] [CrossRef]
  29. Grayman, W.M.; Arnold, C. Overview of CFD methods in analysis of distribution system tanks and reservoirs. In Proceedings of the AWWA Annual Conference, Anaheim, CA, USA, 15–19 June 2003. [Google Scholar]
  30. Moncho-Esteve, I.J.; Palau-Salvador, G.; Brevis, W.; Vaas, M.O.; López-Jiménez, P.A. Numerical simulation of the hydrodynamics and turbulent mixing process in a drinking water storage tank. J. Hydraul. Res. 2015, 53, 207–217. [Google Scholar] [CrossRef]
  31. Fard, M.A.; Baruah, A.; Barkdoll, B.D. CFD modeling of stagnation reduction in drinking water storage tanks through internal piping. Urban Water J. 2021, 18, 608–616. [Google Scholar] [CrossRef]
  32. Hervás, M.; Martínez-Alzamora, F.; Conejos, P. Analysis of the evolution of water quality in tanks according to the connections and operation mode: Application to the most suitable design. Water 2024, 16, 1265. [Google Scholar] [CrossRef]
  33. Shang, F.; Uber, J.; Rossman, L. EPANET Multi-Species Extension User’s Manual; U.S. Environmental Protection Agency: Cincinnati, OH, USA, 2011.
  34. Romanò, F. Reconstructing the fluid flow by tracking of large particles. Phys. Rev. Fluids 2019, 4, 104301. [Google Scholar] [CrossRef]
Figure 1. Comparison of the evolution of quality in a junction using the LTD improved method and the LED method. ∆t = 15 min.
Figure 1. Comparison of the evolution of quality in a junction using the LTD improved method and the LED method. ∆t = 15 min.
Water 18 00021 g001
Figure 2. Comparison of the evolution of quality in a junction using the LTD improved method and the LED method. ∆t = 5 min.
Figure 2. Comparison of the evolution of quality in a junction using the LTD improved method and the LED method. ∆t = 5 min.
Water 18 00021 g002
Figure 3. Illustrative example to track the forward path of a particle leaving the tank. Demands at junctions, flow rates, velocities and travelling times are shown in the picture. Steady flow is assumed.
Figure 3. Illustrative example to track the forward path of a particle leaving the tank. Demands at junctions, flow rates, velocities and travelling times are shown in the picture. Steady flow is assumed.
Water 18 00021 g003
Figure 4. Trajectories of the three sub-particles originated from the initial particle leaving tank A that reach the end junction H.
Figure 4. Trajectories of the three sub-particles originated from the initial particle leaving tank A that reach the end junction H.
Water 18 00021 g004
Figure 5. Stepwise variation in the load at the end junction H in Figure 3, according to a FPT analysis.
Figure 5. Stepwise variation in the load at the end junction H in Figure 3, according to a FPT analysis.
Water 18 00021 g005
Figure 6. Evolution of the load of a particle leaving the tank until all mass leaves the network. Each subfigure shows a snapshot of the particles’ situation at representative times.
Figure 6. Evolution of the load of a particle leaving the tank until all mass leaves the network. Each subfigure shows a snapshot of the particles’ situation at representative times.
Water 18 00021 g006
Figure 7. Justification of the observed load for a particle that reaches the junction H at t = 0. Each subfigure shows a snapshot of the particles’ situation at representative times.
Figure 7. Justification of the observed load for a particle that reaches the junction H at t = 0. Each subfigure shows a snapshot of the particles’ situation at representative times.
Water 18 00021 g007
Figure 8. Network Net 3 used for the development of the case study.
Figure 8. Network Net 3 used for the development of the case study.
Water 18 00021 g008
Figure 9. Evolution of the flow regimes of the two sources that feed Net 3.
Figure 9. Evolution of the flow regimes of the two sources that feed Net 3.
Water 18 00021 g009
Figure 10. Progression of sub-particles through the network at t = 2 h. The legends reflect the accumulative trail left in pipes and the load consumed in demand nodes.
Figure 10. Progression of sub-particles through the network at t = 2 h. The legends reflect the accumulative trail left in pipes and the load consumed in demand nodes.
Water 18 00021 g010
Figure 11. Progression of sub-particles through the network at t = 3 h. The legends reflect the accumulative trail left in pipes and the load consumed in demand nodes.
Figure 11. Progression of sub-particles through the network at t = 3 h. The legends reflect the accumulative trail left in pipes and the load consumed in demand nodes.
Water 18 00021 g011
Figure 12. Evolution of substance concentration in junction J113.
Figure 12. Evolution of substance concentration in junction J113.
Water 18 00021 g012
Figure 13. Graphical representation of the backward analysis from junction J113 at 3:30 h.
Figure 13. Graphical representation of the backward analysis from junction J113 at 3:30 h.
Water 18 00021 g013
Figure 14. Graphical representation of the backward analysis from junction J113 at 17:30 h.
Figure 14. Graphical representation of the backward analysis from junction J113 at 17:30 h.
Water 18 00021 g014
Table 1. Mass balance for particles travelling or having travelled along the paths leading to junction H, at three instants of the backward analysis.
Table 1. Mass balance for particles travelling or having travelled along the paths leading to junction H, at three instants of the backward analysis.
Nodet1 = −30 min (Figure 7c)t6 = −100 min (Figure 7d)t11 = −150 min (Figure 7f. Global)
P_Brown (1)P_Green (2) + P. Blue (3)P_Brown (1)P_Green (2)P_Blue (3)P_Brown (1)P_Green (2)P_Blue (3)
B 1 111
C 1 1 1
D 1 1
E 1 1
F 0.50.5 0.50.5
G0.40.60.40.60.60.40.60.6
Dilution Factor0.40.60.40.30.30.40.30.3
Particle Load231032101010
Concentration100100100100100100100100
Final Concentr4060403030403030
Final Load1.62.41.61.21.21.61.21.2
Total H Load4 4 4
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Hervás, M.; Martínez-Alzamora, F.; Conejos, P.; Alonso, J.C. Understanding Water Quality Models by Particle Forward and Backtracking Methods. Water 2026, 18, 21. https://doi.org/10.3390/w18010021

AMA Style

Hervás M, Martínez-Alzamora F, Conejos P, Alonso JC. Understanding Water Quality Models by Particle Forward and Backtracking Methods. Water. 2026; 18(1):21. https://doi.org/10.3390/w18010021

Chicago/Turabian Style

Hervás, Marta, Fernando Martínez-Alzamora, Pilar Conejos, and Joan Carles Alonso. 2026. "Understanding Water Quality Models by Particle Forward and Backtracking Methods" Water 18, no. 1: 21. https://doi.org/10.3390/w18010021

APA Style

Hervás, M., Martínez-Alzamora, F., Conejos, P., & Alonso, J. C. (2026). Understanding Water Quality Models by Particle Forward and Backtracking Methods. Water, 18(1), 21. https://doi.org/10.3390/w18010021

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop