Real-time data assimilation potential to connect micro-smart water test bed and hydraulic model

Recently, smart water application has gained worldwide attention, but there is a lack of understanding of how to construct smart water networks. This is partly because of the limited investigation into how to combine physical experiments with model simulations. This study aimed to investigate the process of connecting micro-smart water test bed (MWTB) and a ‘ two-loop ’ EPANET hydraulic model, which involves experimental set-up, real-time data acquisition, hydraulic simulation, and system performance demonstration. In this study, a MWTB was established based on the ﬂ ow sensing technology. The data generated by the MWTB were stored in Observations Data Model (ODM) database for visualization in RStudio environment and also archived as the input of EPANET hydraulic simulation. The data visualization ﬁ tted the operation scenarios of the MWTB well. Additionally, the ﬁ tting degree between the experimental measurements and modeling outputs indicates the ‘ two-loop ’ EPANET model can represent the operation of MWTB for better understanding of hydraulic analysis.


INTRODUCTION
Smart systems, which were first introduced in the field of electricity, have finally reached the drinking water sector to realize real-time data acquisition, organization, and analysis (Abu-Mahfouz et al. 2012). The smart water system (SWS) has received much attention in recent years due to its intelligent functions. SWS was the product of the integration of automated control technology, information communication technology (ICT), and traditional water systems, aiming to solve water issues more efficiently. SWS has been applied in many cases to address critical water problems which traditional water systems cannot (Dludla et al. 2013;Günther et al. 2015), and it has also been investigated as a potential solution for water leakage issues (Horsburgh et al. 2008;Hatchett et al. 2010;Günther et al. 2014). Despite broad application, the public adoption of SWS is less and both how to define the configuration of SWS and how SWS functions still confuse the public.
One way to clear up this confusion is to implement the SWS in water networks, and extensive research has been undertaken to discuss how to apply the SWS in field cases. For example, Boulos (2017) developed a cyber-physical concept-based smart flood information system called Dayu SWS. This intelligent water system created an on-site monitoring network and integrated it into rapid flood modeling to provide updated information. Bartos et al. (2018) demonstrated a dynamic system-level smart stormwater system which was implemented in Ann Arbor, Michigan, USA.
However, such a smart stormwater system needs long-term storm event records to display its adaptive functions.
Although the application of SWS began many years ago, little attention was paid to the consensus of the components and the working process of SWS, which impedes the implementation of the SWS in water networks. One way to improve public adoption is to educate the public by implementing innovative smart water networks. By knowing SWS better, residents are more likely to accept smart water. To increase the agreement of SWS, many researchers present it as an easy-to-access method. Some studies show the installation, application, testing, interconnection, and working rules for social and educational purposes (Horsburgh et al. 2008;Hatchett et al. 2010;Dludla et al. 2013;Günther et al. 2014Günther et al. , 2015. Meanwhile, many studies have utilized an experimental set-up to advance the benefits. For instance, Kramer (2014) introduced an experimental water distribution system following smart water network principles to configure physical components and sensing task. Furthermore, most of the experimental studies aimed to localize pipe leaks and to test leakage algorithms. Kramer (2014) conducted an experimental study to measure the leakage exponents of different types of leak openings, and longitudinal and pipe materials. To analyze correlation between the reduction of leakage rate with the decrease of pressure, Machell et al. (2010) installed an experimental network to adjust the geometry of the leak and also modify the material of the pipeline. Similarly, Sonaje & Joshi (2015) constructed a polyethylene water distribution network to investigate the effects of leak area and pipe rigidity on discharge. Apart from those studies on leak area and pipe materials, the leak detection algorithm was also examed in smart water networks. Steffelbauer et al. (2014) proposed an efficient wireless sensor armed water distribution system intended to detect and locate leaks for long distance pipelines by combining powerful leak detection and localization algorithms. Also, Karray et al. (2016) introduced a sensor-based laboratory SWS called Earnpipe to optimize the reliability of the inspection and improve the accuracy of the water pipeline monitoring.
However, those studies listed above mainly focused on integrating smart water test bed with online sampling, but more attention should be paid to the combination between the experimental measurements with hydraulic simulation results. The integration of physical components and simulation model will enable engineers to localize pipe leakage more efficiently, and this is also helpful for exhibiting what SWS can do for the community. To achieve this connection, some researchers have made initial progress which identified future directions. Günther et al. (2014) made full use of the pressure sensor alongside a calibrated hydraulic model to localize pipe leaks by considering the demand uncertainties.
Interestingly, Kartakis et al. (2015) presented a small-scale testbed called WaterBox which enables compilation of sensor monitoring data and actuator control algorithms in the simulation process. This work provides a typical reference for understanding how smart water networks are configured. The latest study illustrated the process of constructing a laboratory-scale water distribution system to verify the pressure-dependent demands (PDD) modeling in EPANET (Walski et al. 2017). However, the manometers installed in this test bed show disadvantages when compared with sensor monitoring.
To investigate how micro-smart water test bed (MWTB) can contribute to communities, this paper explored the potential of connecting the smart water test bed and hydraulic model in experimental practice. This work was structured in four parts. The first part was to establish the 'two-loop' smart water test bed including sensor installation for data collection and pipes' incorporation in the hydraulic laboratory. The second part was to organize data by designing a relational database schema and storing the data collected in the MySQL database. The third part was to analyze data by connecting RStudio to the database and visualizing data via R environment. The fourth part was to evaluate the system working status by operating test bed and importing the historic flow measurements to the hydraulic model. Generally, this study aims to foster the public adoption of SWS by creating MWTB. Meanwhile, the process of importing real-time data into the hydraulic model is helpful in educating people to understand how SWS is operated.

METHODS AND MATERIALS
In this paper, first, the MWTB was designed and set up. Then, the real-time data were collected by flow sensors and transmitted to the Arduino board. The flow data were saved automatically in the Arduino SD card as txt.file. Having been transferred to CSV.file, the flow data were imported into the created MySQL schema composed of the Observations Data Model (ODM) (Horsburgh et al. 2008). Next, the database was connected with R to achieve visualization and to produce data analysis results. Finally, to test the system performance, the hydraulic modeling results were compared with the experimental flow results by quantifying the fitting degree.

Micro-smart water test bed design
This research designed the 'two-loop' MWTB using AutoCAD 2017 as shown in Figure 1. This 'twoloop' water network is a 'gravity driven' system composed of one source tank, nine pipes, six junctions, three outlets, and two valves. The design details can be found in Appendix A (Figures A1 and A2).
Additionally, two YF-S201 sensors (Sensor) shown in Appendix B ( Figures B1 and B2) are used in this micro-smart water system. This kind of sensor is made for detecting the gas and fluid flow rate, which sits in line with the water line and contains a pinwheel sensor to measure how much liquid or gas has moved through it. There is an integrated magnetic hall-effect sensor that outputs an electrical pulse with every revolution. Flow sensors use acoustic waves and electromagnetic fields to measure the flow through a given area via physical quantities, such as acceleration, frequency, pressure, and volume. The sensors are solidly constructed and provide a digital pulse each time an amount of water passes through the pipe (more information about this flow sensor is given in Sensor (2016). Since the sensor is sitting in the water pipe line, to maintain the lowest impact caused by the sensor, a 1/2' diameter PVC pipe is designed to match the sensor inside the diameter. The first test sensor is placed at the farthest discharge pipe, to determine the lowest head flow rate; the second sensor is placed at the center of the central connection pipe, which can observe the water flow scenario in the most 'uncertain' pipe. One concern is turbulence caused by the sensors' minimum distance but this can be avoided completely in this structure. To make the experimental set-up fit the configuration of the hydraulic model, the distances are preferably kept as they are.

Hydraulic model establishment
The hydraulic model of this 'two-loop' MWTB was simulated by EPANET 2.0 (Rossman 2000). The 'two-loop' hydraulic model is one of the benchmark water distribution models which are open sources for education, research, and commercial purposes. This hydraulic model is a simplified model of the real MWTB since some assumptions were made. For example, the elevation of nodes was assumed to be zero, and the total head of the tank was assumed to be the water level. The base demand of nodes 3, 5 and 7 were assumed regarding the different valve status. The details of the hydraulic model can be seen in Figure 2.
System set-up The system was built as shown in Figure 3, following the designing strategy of Appendix A. The calculation of the system does not always match the reality, such as the discharge flow rate is smaller than the calculation, so our team added the extra overflow discharge pipe after purchasing the utility pump. To keep the source tank level stable under different scenarios, an automatic utility with maximum flow rate 2,400 gallons per hour and 10 ft of discharge lift was purchased and installed in the MWTB. With recycling the water use from source tank to pipe, this pump supplies water from the bottom water receiving tank to the top source tank. The bottom suction design filters debris and removes water down to 1/8' of the surface and passes up to 1/8' of solids. The SWS was built in the hydraulic laboratory at the University of Utah. The primary pipe material is PVC plastic, including the valve and the pipe cross. The resource tank is made from a customized household storage plastic tank, by making the hole and installing the pipe adapter to make the connection for the water system and the resource tank.

Data collection
In the data collection step, nine different scenarios, shown in Table 1, were tested to get nine different data results. To test the water system testing performance, the dataset and the inputs of selected scenarios were imported into EPANET model. All the scenarios are listed in Table 1 and Figure 4, including their start time and outlet status.

Data organizing
The ODM provides a consistent format for the storage and retrieval of environmental data in a relational database (Horsburgh et al. 2008). To organize the flow data, a new database schema was designed, and the (entity relationship) ER diagram was created and is shown in Figure 5. After  that, the additional tables were established, as shown in Appendix A ( Figure A3(a)-A3(e)), and the flow data from the CSV file were successfully loaded and imported into these tables shown in Figure A3(f) ready for the RStudio environment retrieval.

Data visualizing
For data visualization, the ggplot2 package in RStudio platform was adopted to retrieve data from the SQL database and make plots for all scenarios. Also, RStudio was used to directly plot graphs for each classified scenarios, such as scenarios 1, 2, and 3.  Overall, based on the methods and materials above, the framework of MWTB for educational purposes is organized in Figure 6. According to the framework, the process starts with the Arduino programming (Arduino 2018) and then the UNO board setting up. After that, the measurements obtained by YF -S201 flow sensor are saved in the storage card in the UNO board for MySQL database storing and organizing. Finally, the real-time data saved in the database are extracted by the RStudio and visualized in RStudio environment. All the codes of this framework are open source, and the details can be viewed in Appendix C.

Data visualization under different scenarios
By querying the MySQL database, RStudio was utilized to make plots for all scenarios as shown in Figure 7. However, it seems a little ambiguous to analyze the data visualization of the entire scenarios just one time. To solve this issue and to better analyze the graphic results, all the scenarios were categorized by every three scenarios.
According to Figure 8, from scenario 1 to 2, and 3, the flow rate from the end sensor increases step by step, although there are some errors or fluctuation in the EFlow curve. The reason for this is because the number of opening outlets declines, the pressure of water discharge in outlet 3 is increased. In contrast, the flow rate from the mid sensor decreases scenario by scenario, because once all the outlets are closed one by one, the flow going through the mid pipe is reduced. Fortunately, the flow rate from the mid sensor is more stable than that from the end sensor for each scenario.
According to Figure 9, from scenario 4 to 5, and 6, the flow rate from the mid sensor can remain almost stable because outlet 2 is always open. However, the flow rate from the end sensor suddenly goes down to zero in scenario 5 once outlet 3 is closed. The operation of the MWTB can be tracked by flow sensors in a timely way. Therefore, the change of flow rate regarding the outlets' status indicates that the flow sensors installed in the MWTB have reasonable sensitivity.
According to Figure 10, from scenario 7 to 8, and 9, when outlet 1 or outlet 2 is half open, the flow rate from the mid sensor shows little drop while the flow rate from the end sensor presents a little larger decrease. This phenomenon is because the flow going through the mid sensor depends more on the status of outlet 2. However, both sensors installed in the system show sensitive action to the little change of outlets' status. In other words, given the above graphic analysis, the system performance test shows that the flow sensors installed in the micro-SWS have reasonable sensitivity to the system operation or status change.    existing experimental measurements from the mid sensor. The modeling outputs can be seen in Table 2.

DISCUSSION
Summarizing Figures 8-10, it can be found that the MWTB can produce required data which match different scenarios. This work indicates this experimental MWTB is sensitive to water network  operation since each operating scenario can be presented accurately in the plots. Such kind of sensitivity can be utilized to demonstrate how SWS work for the public; this is because engineers can teach people how to infer the inner pipe condition by watching the change of data visualization.   Referring to Table 2, the column 'Fitting degree' demonstrates that the experimental measurements from the mid sensor match significantly the mid outlet modeling output under scenarios 2, 3, and 5. Conversely, in scenarios 1 and 6, there is a larger difference between measurements and modeling outputs. Interestingly, all outlets are open on scenarios 1 and 6 while at least one outlet was closed in other scenarios. This implies that experimental measurements fit the modeling outputs reliably and confirms the above result that the hydraulic model can adapt more to change of MWTB.
Overall, the testing result and performance evaluation show the MWTB works well. This real-time connection between experimental practice and hydraulic simulation performed as expected. Furthermore, the MWTB can be expanded to a large-scale real water networks with multiple loops in the future when needed.

CONCLUSIONS
In this paper, there are five tasks which have mainly been accomplished: (1) set up an experimental MWTB in the laboratory; (2) install and collect flow data by using flow sensor and Arduino sketch; (3) establish a database to store and organize the experimental measurements; (4) utilize R to connect MySQL, and visualize flow data from ODM database; and (5) evaluate the performance of MWTB by quantifying fitting degree between measurements and modeling output. One key point is that the data visualization illustrates that the MWTB has reasonable sensitivity to the system operation. Such kind of sensitivity has the potential to be used for detecting pipe leakage in the future. Additionally, the experimental measurements fitting the modeling output results show the MWTB has a reliable performance analysis under different scenarios. This analysis verified that the MWTB could be used as an educational practice to show how SWSs work for flow monitoring and also leakage detection. One future work will focus on expanding the scale of the MWTB with multiple loops to verify the network performance. Another future direction will be demonstrating a broader application of smart water techniques in the water resources field, such as pipe leakage detection, stream flow monitoring, and system operation efficiency improvement.