Abstract
A simple model for online forecasting of ammonium (NH4+) concentrations in sewer systems is proposed. The forecast model utilizes a simple representation of daily NH4+ profiles and the dilution approach combined with information from online NH4+ and flow sensors. The method utilizes an ensemble approach based on past observations to create model prediction bounds. The forecast model was tested against observations collected at the inlet of two wastewater treatment plants (WWTPs) over an 11-month period. NH4+ data were collected with ion-selective sensors. The model performance evaluation focused on applications in relation to online control strategies. The results of the monitoring campaigns highlighted a high variability in daily NH4+ profiles, stressing the importance of an uncertainty-based modelling approach. The maintenance of the NH4+ sensors resulted in important variations of the sensor signal, affecting the evaluation of the model structure and its performance. The forecast model succeeded in providing outputs that potentially can be used for integrated control of wastewater systems. This study provides insights on full scale application of online water quality forecasting models in sewer systems. It also highlights several research gaps which – if further investigated – can lead to better forecasts and more effective real-time operations of sewer and WWTP systems.
INTRODUCTION
Models for forecasting water quality in different parts of the integrated urban drainage-wastewater system (sewers, wastewater treatment plants – WWTPs) can provide useful information for improving the operation of integrated urban drainage-wastewater systems (Yuan et al. 2019). These models can be used to quantify discharges from combined sewer overflows (CSOs), or in an online context as part of real-time control strategies aiming at optimizing WWTP operations (the so-called ‘software sensors’ – e.g. Stentoft et al. (2017)). Further potential applications include Model Predictive Control approaches, allowing water quality-based control of sewer systems (e.g. Vezzaro et al. 2013) or WWTPs (Stentoft et al. 2019) over different forecast horizons.
As pointed out in Langeveld et al. (2017), the increased availability of long-term time series of water quality parameters with high resolution in time (e.g. Métadier & Bertrand-Krajewski 2012; Schilperoort et al. 2012; Alferes et al. 2013) allows the development of new models utilizing such information. There is a wide experience with the application of data-driven software sensors in WWTPs (Haimi et al. 2013; Newhart et al. 2019), and several studies on simulating WWTP influent quality (Martin & Vanrolleghem 2014). Many of these studies employ empirical/phenomenological approaches (Langergraber et al. 2008; Gernaey et al. 2011; Langeveld et al. 2017), while Talebizadeh et al. (2016) proposed a stochastic influent generator to provide a more realistic description of the natural variability of WWTP influent. These examples are mostly based on offline simulation studies, using pre-validated data (e.g. Flores-Alsina et al. 2014), a condition that is not available under actual real-time conditions. The majority of research on forecasting of water quality indicators at WWTPs focuses on quantities within the process tanks or at the plant outlet. Few examples deal with predictions of the WWTP influent (e.g. Kusiak et al. 2013; Yu et al. 2018), despite its potential use in feed-forward control. Furthermore, model predictive power is often evaluated in terms of statistical assumptions regarding residuals, while online application requires more robust, ad-hoc metrics, focusing on the intended use of the model outputs.
This paper presents a simple phenomenological model specifically developed for online prediction of ammonium (NH4+) loads and concentrations along with their uncertainty. The model relies on a flow forecast and continuous online NH4+ measurements from an ISE (ion-selective electrode) sensor. In the evaluation of forecast skill in this study, the forecasts of ammonia loads are based on ex-post flow forecasts; that is, measured flow values that are used ‘as if’ they are forecasted values. In an operational setup, the measured flow should obviously be exchanged for real-time forecasts of flow. However, the ex-post setup in this paper ensures that the performance evaluation of the ammonium forecasts is independent of errors in the flow domain. The forecasts are tested at the inlet of two Danish WWTPs and the performance of the forecast model is evaluated over an 11-month period. The evaluation also aims at identifying further research gaps and improvements with specific focus on application in online control strategies.
MATERIAL AND METHODS
Water quality monitoring
Flow and ammonia measurements have been collected with a 2-minute frequency at the Viby WWTP (Aarhus, Denmark – since June 2018) and the Damhusaaen WWTP (Copenhagen, Denmark – since April 2018). The Viby catchment consists of 6.78 km2 combined and 7.48 km2 separate systems (Ahm et al. 2013). The majority of the system is gravity driven, while the flow from two minor subcatchments is pumped to the plant. The Damhusaaen WWTP receives wastewater from a 67 km2 combined system, which is mainly gravity driven (flow from an adjacent catchment can be pumped in case of extreme events).
NH4+ is measured with commercially available ion-selective sensors (Table S1, Supplementary Information). The sensors in Viby and in Damhusaaen are placed at different locations in the plants for logistical reasons (Figure 1): after the primary clarifier and a pumping station in Damhusaaen and after the grit removal in Viby (Table 1). Their planned sensor maintenance follows different schedules (Table 1). Data from the plants' SCADA systems are transferred to the AQUAVISTA™ cloud-based system (based on the STAR® system described in Nielsen & Onnerth 1995), where they are automatically quality controlled based on simple rule methods (e.g. running variance, physical ranges, flat lines).
. | Damhusaaen . | Viby WWTP . |
---|---|---|
Sensor placement (Figure 1) | After primary clarifier and pumping station | At plant inlet (after grit removal) |
Planned sensor cleaning and performance check | Weekly | Weekly |
Sensor calibration | If sensor deviation from laboratory measurements >10% | If sensor deviation from laboratory measurements >5% |
Start of monitoring campaign | April 2018 | June 2018 |
Threshold used to define wet weather events (at WWTP inlet) | 5,000 m3/hr | 400 m3/hr |
Forecast model parameters | ||
Fourier series coefficients | X | X |
Volume of primary clarifier | X | |
Additional morning pulse | X |
. | Damhusaaen . | Viby WWTP . |
---|---|---|
Sensor placement (Figure 1) | After primary clarifier and pumping station | At plant inlet (after grit removal) |
Planned sensor cleaning and performance check | Weekly | Weekly |
Sensor calibration | If sensor deviation from laboratory measurements >10% | If sensor deviation from laboratory measurements >5% |
Start of monitoring campaign | April 2018 | June 2018 |
Threshold used to define wet weather events (at WWTP inlet) | 5,000 m3/hr | 400 m3/hr |
Forecast model parameters | ||
Fourier series coefficients | X | X |
Volume of primary clarifier | X | |
Additional morning pulse | X |
Forecast model
Ammonium forecasts
The proposed forecast model is schematized in Figure 2 and further explained in the following paragraphs. The proposed model builds upon the widely applied concept of daily ammonium loads (Figure 2(a)); that is, the concept that NH4+ loads (i) only originate from domestic sources that can vary between weekdays and weekends, (ii) follow a typical diurnal profile over 24 hours, and (iii) are unaffected by wet weather events (e.g. Langergraber et al. 2008; Martin & Vanrolleghem 2014; Langeveld et al. 2017). The NH4+ loads are estimated on a daily basis for dry days (Figure 2(b)), and forecast are generated by using an ensemble approach, utilizing the daily load profiles from n previous dry days (Figure 2(c)). By combining the NH4+ loads with flow data it is then possible to estimate NH4+ concentrations by using a simple dilution approach.
The model uses a moving window of length n on previous dry days (Figure 2(a)). Here, dry days are defined with respect to the flow observations, and not simply as days without rain events. Wet days are defined as the days when the measured flow exceeded the flow threshold that is used to activate the wet weather controls at the plant (Table 1). Days with small rain events, generating flows below the threshold, would therefore be classified as dry days, since they would not lead to a change in the plant operations. In daily operation, the threshold value depends on the plant characteristics and status (based e.g. on actual capacity of the biological treatment and settling conditions in the secondary clarifier). Once the flow falls back below the threshold, the following 12 hours (24 hours if the event volume is above 20,000 m3) are still characterized as wet periods. This is done because NH4+ concentrations are still affected by slow catchment runoff and concentrations are still below typical dry weather values.
The operational cycle for the online forecast model on the i-th day is described by the following steps (Figure 2(b) and 2(c)):
Step 1: A few minutes after midnight, flow measurements from day i−1 are analysed for identifying potential wet weather events.
Step 2: If the previous day was a dry day, the parameters of the NH4+ daily profile for day i−1 are estimated and stored in a database (Figure 2(b)).
Step 3: Estimated parameter sets from the previous n dry days of corresponding day type (weekday/weekend) are retrieved from the database.
Step 4: Ammonium forecasts for day i are generated by running the model every two minutes. Forecast uncertainty is created as an ensemble with n members consisting of ammonia load profiles from the past n corresponding days (weekday/weekend) (Figure 2(c)).
As shown in Figure 2(c), these steps are repeated for each day by shifting the moving window and by repeating Steps 1–4.
Model structure
As mentioned earlier, the flow values Q(t) that are used as input to the forecasting scheme are the values that were observed later in the day, and thus not real forecasts of the flow (also referred to as ex-post forecasts).
Given the specific setup at the Damhusaaen site, the volume of the primary clarifiers (about 12,000 m3) is included in the model as it leads to a time delay and to an attenuation of ammonium profiles between the inlet and the sensor location. To account for these issues, the estimated NH4+ loads at the inlet (from Equation (1)) are routed through three cascading continuously stirred tank reactors.
Estimation of model parameters
The model parameters are estimated by using an optimization routine based on the Simplex method, minimizing the Root Mean Square Error (RMSE) between simulated and observed loads. The optimization is run once per day (just after midnight), using the data collected in the previous 24 hours. An optimal parameter set for the load model (θopt,i), is obtained for each calendar day. It is assumed that rain-induced phenomena (e.g. first flush, WWTP inlet bypass) would affect the estimation of the NH4+ profiles. Therefore, the optimization procedure is not run for wet days; that is, for days when the plant would operate in wet-weather mode. Days characterized by small rain events, generating flows below the threshold, are classified as dry periods, and thereby are included in the calibration.
Evaluation of model performance
Experimental setup
The proposed forecast model was tested on the data collected from June 2018 to May 2019 (i.e. the performance evaluation covered 318 days for both locations). Online operations were mimicked by following the procedure described earlier (Figure 2(c)).
Performance evaluation
Among the potential applications of the online forecast model, the following options were hypothesized in order to investigate the performance during wet-weather events:
Estimation of incoming ammonium loads, including potential first-flush peaks from the upstream catchment (as described by e.g. Krebs et al. (1999)). Such forecasts can potentially be used to optimize the removal efficiency of the WWTP by using a Model Predictive Control (e.g. Stentoft et al. 2019).
Estimation of ammonium dilution during a rain event. This information might open the possibility for water-quality-based controls involving prioritizing bypass or diverting low pollution flows to natural waters, as described by, for example, Hoppe et al. (2011).
In the first case, the relative error was calculated on the ammonium load for the first 30 minutes of a rain event. In the second case, a contingency table (Bennett et al. 2013) was used to evaluate the ability of the forecast model to estimate dilution in the plant influent. Dilution is here defined a 10% drop of concentration below dry weather values (e.g. if dry weather concentration is 40 mg/l, a dilution event starts when the concentration drops below 36 mg/l). Since ammonium concentrations vary throughout the day and sensor measurements are affected by variability and outliers, the dry weather concentration threshold was defined as the 5th percentile concentration measured during the 2 hours before the start of the event.
RESULTS AND DISCUSSION
Measurement campaigns
The available datasets from the two plants are shown in Figure 3(a)–3(d). A total of 35 and 57 wet weather events were observed in Damhusaaen and Viby, respectively. Based on the analysis of the rainfall data recorded in the catchments (see Supplementary Information – Table S2), wet-weather events were caused by rainfall greater than 3–4 mm (Damhusaaen) and 2 mm (Viby).
The data at the Damhusaaen WWTP show the influence of the sensor's location within the plant (Figure 1), as the flow (light blue in Figure 3(a)) is affected by a pumping station, showing spikes often exceeding the wet-weather threshold (see an example in Figure S1). To avoid data artefacts and false identification of wet-weather events, flow measurements were smoothed to estimate the WWTP inlet flow. Flow data were filtered by using a simple moving average with 60 steps (dark blue). The daily variations in NH4+ concentrations are clearly attenuated by the volume of the primary clarifier, as daily variations ranged in the order of 5–10 mg/l, and a distinct diurnal pattern is not evident (Figure S1). Conversely, the data from the Viby WWTP show the characteristic daily patterns associated with dry-weather WWTP inlets, with an evident morning peak and daily variations of more than 15 mg/l (Figure S2).
Effects of sensor calibration in Damhusaaen are seen in the sudden changes in NH4+ concentrations, which in the most extreme cases can jump more than 20 mg/l before and after the calibration. This is consistent with the observations in Cecconi et al. (2019), who highlighted the (potentially negative) influence of the sensor calibration on the sensor readings. The effect of the different calibrations can be seen in the calculated ammonium load profiles (Figure 3(e) and 3(g)), which show variations in the average daily level. Nevertheless, the daily load profiles measured at both Damhusaaen (Figure 3(e) and 3(g)) and Viby (Figure 3(f) and 3(h)) show a great inter-day variability. An approach based on, for example, only tabular values or fixed ammonium profiles, neglecting the natural variability of the simulated process, would be affected by important uncertainty. This stresses the importance of the proposed ensemble approach to generate model prediction bounds and allow for a more confident application of model forecast for online applications.
Performance during the entire period
The performance of the forecast model over the whole analysed period is shown in Figure 4 where each red dot represents the average skill over a single day. Figure 4 shows how the sensor maintenance resulted in a deterioration of the forecast model performance after the signal correction. In fact, after calibration, MARE tends to increase (Figure 4(a)), while the coverage drops (Figure 4(b)). This is explained by the fact the model uses a moving window of values preceding the forecast, which may include days where sensor calibration takes place. Predictions after a sensor recalibration event consistently over- or underestimate the NH4+ concentrations compared to the signal after the sensor is calibrated. Subsequently, prediction improves in the days following the calibration, as the window moves further, including an increasing number of days with the new sensor calibration and thereby discarding values from the ‘old’ calibration.
It should be noted that in some periods, sensor maintenance was performed with a frequency lower than planned: for example, no sensor maintenance was performed in Damhusaaen in the period from mid-December to mid-February. Although a small drift in the sensor reading can be theorized (Figure S3), no significant worsening of model performance was observed in this period. This can be explained by the chosen ensemble approach, which only considers data from the latest n dry days. Potential drift of the sensor is assimilated by the moving window, ensuring a good agreement between measured and modelled data. This highlights the importance of adopting a data validation routine capable of detecting sensor drift in an online setup and/or correcting sensor data. A similar behaviour can be observed in March, when an exceptionally long rainy period led to an important increase of groundwater infiltration and thereby to a drop in NH4+. Also in this case, the model performance did not show important variations compared to other periods. It can be assumed that using a greater value of n will result in a deterioration of model performance in case of sensor drift or increase/decrease of the NH4+ dilution due to groundwater infiltration. A smaller value of n might on the other hand make the ensemble predictions overly sensitive to inter-daily variations.
Results from Viby (Figure 4(c) and 4(d)) show a deterioration of the forecast model performance following wet weather events. In the periods when the forecast model provided the best performance, MARE ranged at 20–25% for both the plants, while the coverage was better in Damhusaaen (often achieving 100%). This can be explained by the difficulties in the proposed model structure to fully describe the specific daily ammonium pattern in Viby. The performance of the forecast model in terms of coverage could be improved by either increasing the length of the moving window (i.e. by increasing the number of ensemble members and thereby the width of the model prediction bounds) or by modifying the model structure (i.e. identifying a better equation than Equation (4)). However, the first option would not lead to an improvement in MARE. This is likely to be achieved by the latter option which, however, should find a trade-off between model complexity (i.e. the number of model parameters) and the computational requirements for a cloud-based system. For example, several commercial software products, often applied in an offline context, simulate wastewater generation by using tabular hourly values. This formulation would clearly ensure a better representation of the daily profile. However, running an automatic optimization routine for 24 parameters might be computationally demanding or have identifiability problems; therefore, such formulation is not preferable in an online, cloud-based setup.
Performance during wet weather events
Figure 5 provides an overview of the forecast model performance regarding its potential applications for online control applications (e.g. controlling aeration in case of first flush phenomena, or diverting low polluted flow to bypass structures). When looking at the prediction of NH4+ in the first phase of a rain event, the forecast model in Damhusaaen (Figure 5(a)) mostly remains in a ±40% range. In the majority of the events, the load was overestimated. Conversely, in Viby (Figure 5(b)), the forecast model consistently underestimated the initial load. It should be pointed out that such performance analysis is strongly affected by the sensor calibration as some of the over/underestimation might be explained by events taking place shortly after sensor maintenance. Generally, the data show that rain-induced peaks have longer duration than 30 minutes; that is, the benefits of using such forecasts for predictive control would be limited (after 30 min the wet-weather control would be fully operational). Figure 5(c) and 5(d) show the ability of predicting whether there are dilution effects from stormwater in each time step during an event. Here, the forecast model provided correct predictions (both correct positives and correct negatives) over 75% of the time for 22 events (63%) and 35 events (61%) in Damhusaaen and Viby, respectively. For some events, the number of false positives (predicting a dilution while the concentration is still high, i.e. a prediction that might have negative consequences on the environment) was higher in Damhusaaen than in Viby. The number of events where the false positives exceeded 10% of the total event period was 13 (37%) in Damhusaaen and 5 (9%) in Viby. Figure 6 shows four examples of how the forecast model performed during different wet weather events. The examples suggest that the simple modelling approach based on dilution of ammonium loads is sufficient to grasp the dynamics at the beginning of a rain event, while it fails to represent the behaviour in the receding phase (Figure 6(e)).
Such behaviour is in line with the findings of Langeveld et al. (2017), who added an additional term to the model structure in order to obtain a better representation of the transition from the wet weather concentrations back to dry weather values. Considering that the majority of online applications for the proposed forecast model would focus on the initial phase of the event, structural shortcomings at the end of the events are not expected to affect its performance. Furthermore, this analysis illustrates the importance of evaluating the model performance in terms of its potential applications, instead of limiting the analysis to an evaluation of the model residuals.
Figure 6(d) and 6(j) confirm the inadequacy of the model structure in Viby in representing the overall events. The available measurements suggest an increase in the ammonium loads, which might resemble the process described by Krebs et al. (1999). The model structure should therefore be adapted accordingly. Nevertheless, Figure 6(f) and 6(l) show how the model was still capable of detecting the dilution during wet weather events. Figure 6(i) and 6(k) also highlight an issue linked to the moving window approach: the updating of the window can in fact result in discrete jumps of the predicted values. For an ensemble-based approach such as the one in this study, these variations might be reduced by increasing the size n of the window.
Research gaps and future developments
The available results show how the predictions of the proposed setup are strongly dependent on the signal provided by the ion-selective sensors and by the maintenance operations. As pointed out by Cecconi et al. (2019), excessive maintenance and/or improper sensor calibration might significantly decrease the reliability of ammonium measurements. Furthermore, the performance of the forecast model cannot be evaluated in a complete manner, since a major cause of poor indicator values is changes in the signal rather than in the model structure and/or parameters. Possible improvement of the proposed approach might include the following:
Correction and transformation of the signal from the ion-selective sensor. Ideally, the raw signal from the sensor could provide a more reliable data source compared to the existing situation. A follow-up study on how to correct the raw ISE-based signal is currently being undertaken, as all the following improvements require a good quality dataset.
Variable uncertainty description: the proposed ensemble approach equally weighs all the days in the calibration window. Approaches such as exponential filtering, weights on most recent days, and so on, can be used to increase the importance of the most recent data for cases where this is desired.
Use of stochastic models that combine a deterministic model with a stochastic term capable of describing the natural variability of the NH4+ concentrations. Possible techniques include the so-called grey-box models or the external bias description (Del Giudice et al. 2015).
A thorough evaluation of the influence of the different model parameterizations on the resulting predictions. The effect of the length of the moving window, the number of ensemble members, the intervals used in the parameter estimation, and so on, should be fully evaluated. This would provide robust guidelines for a wide application of the proposed method to other systems.
Performance evaluation of the proposed approach at CSO structures; that is, where the installation of a permanent online NH4+ sensor is less likely compared to WWTPs. Here, the model would use historical data from monitoring campaigns of limited duration (e.g. an online sensor installed over a 2–3 month period) to forecast NH4+ concentrations. The duration of the historical dataset should be sufficient to confidently estimate representative daily profiles (and their variations).
Performance evaluation using real flow forecasts, based on e.g. radar rainfall forecasts or numerical weather predictions. There is ample research on flow uncertainty estimation, and this comparison could show if the uncertainties discussed here are significant compared with those related to the rainfall forecasts, which are known to be very large.
Performance evaluation based on event definitions that are not strictly linked to the plant operational settings. For example, a variable flow threshold, defined on the actual dry weather flow conditions, rather than the used fixed value, could improve the understanding of the model behaviour in wet weather.
Modification of the model structure by including additional terms, such as those included in the model from Langeveld et al. (2017). This would expand the applicability of the model to other applications outside WWTP control (e.g. for quantification of CSO and bypass load).
CONCLUSIONS
This work investigated the performance of a simple model for online prediction of NH4+ concentrations intended for real time control applications. The analysis of the forecast model results showed the following:
The analysis of data from two Danish WWTPs showed high inter-diurnal variations in the incoming ammonium loads. This underlines the importance of using an uncertainty-based approach, which explicitly accounts for this natural variability.
The simple structure of the model (based on Fourier series) should be adapted to the specific locations of the sensors and/or to the characteristics of the catchment.
Calibration of the ammonium ISE sensors significantly affected the model performance. The proposed data-driven forecast model uses data from previous calibration periods, and its capability of matching the measured values drops just after the sensor is calibrated. This suggests a strong need for new approaches that can reduce the impact of the sensor calibration on the operation of online forecast models.
The performance of the forecast model in relation to potential online control strategies seems satisfactory. Specifically, the model provided good simulations of both the ammonium loads at the beginning of a rain event and the dilution induced by wet-weather events.
Overall, the proposed data-driven forecast model creates interesting opportunities for online forecasts of WWTP influent quality. Although further research is needed to improve the accuracy of the forecast model in terms of predicted concentrations, it can already open various possibilities for the implementation of online control strategies. The forecast model can also be applied for forecasting of incoming NH4+ loads and concentrations, creating new opportunities for Model Predictive Control of WWTPs.
ACKNOWLEDGEMENT
This research was financially supported by the Innovation Fund Denmark through the Water Smart Cities (WSC) project [grant number 5157-00009B]. The authors thank Tomas Trabjerg (Aarhus Vand A/S) for the detailed information regarding the measurements campaign at the Viby WWTP and Anders Breinholt (HOFOR. Hovedstadsområdets Forsyningsselskab) for the support in the Damhusaaen case study.
SUPPLEMENTARY MATERIAL
The Supplementary Material for this paper is available online at https://dx.doi.org/10.2166/wst.2020.085.