An integrated model predictive control (MPC) strategy to control the power consumption and the effluent quality of a water resource recovery facility (WRRF) by utilizing the storage capacity from the sewer system was implemented and put into operation for a 7-day trial period. This price-based MPC reacted to electricity prices and forecasted pollutant loads 24 hours ahead. The large storage capacity available in the sewer system directly upstream from the plant was used to control the incoming loads and, indirectly, the power consumption of the WRRF during dry weather operations. The MPC balances electricity costs and treatment quality based on linear dynamical models and predictions of storage capacity and effluent concentrations. This article first shows the modelling results involved in the design of this MPC. Secondly, results from full-scale MPC operation of the WRRF are shown. The monetary savings of the MPC strategy for the specific plant were quantified around approximately 200 DKK per day when fully exploiting the allowed storage capacity. The developed MPC strategy provides a new option for linking WRRFs to smart grid electricity systems.
A model predictive control strategy to control pumping power consumption and effluent quality was implemented.
The strategy considers electricity prices to prioritize pumping 24 hours ahead.
The strategy was tested full-scale as it was put into operation for a total of 7 days.
The strategy demonstrated savings of approximately 200 DKK per day.
The transition towards an increasing share of renewable energy sources is an essential step to reduce CO2 emissions and mitigate severe climate change. This transition requires the implementation of smart grids; that is, making electrical grids able to cope with highly fluctuating sources (such as wind and solar power) while being able to match supply and demand (Jørgensen et al. 2018). This can be obtained by either storing the electricity for later use or by modifying the consumption accordingly. Since energy storage is currently very expensive, a cheaper alternative is to modify the power consumption of flexible consumers by using intelligent control and communication methods (Madsen et al. 2015). The fluctuations in the electricity prices provide economic incentives to implement flexible controls of electricity consumption. This concept is also referred to as Demand Response (Palensky & Dietrich 2011; O'Connell et al. 2014).
As discussed in Olsson (2015), there is a great potential for interactions between the energy and the water sector. Integrated operation of urban wastewater systems or minimization of energy consumptions have been investigated by, for example, Kroll et al. (2018), who found that synchronizing sewer storage volume with WRRF aeration control led to savings of 2.5% in total energy and improved TN effluent as well as CSO activity. When looking at applications of Demand-Response systems, examples are mostly found for water supply systems, with examples focusing on energy optimization of wellfield operation for groundwater extraction (Bauer-Gottwein et al. 2016), or for pumping and treatment (Zimmermann et al. 2018). Wastewater transport and treatment can also potentially be integrated into a smart grid due to their large and geographically distributed consumption (Thompson et al. 2008; Reinhofer-Gubisch & Pucker 2014; Kirchem et al. 2018).
The idea of including electricity prices into control and operation of water resource recovery facilities (WRRFs) was first mentioned in Tassou (1988) over three decades ago. Aymerich et al. (2013, 2015) simulated the minimization of aeration costs based on varying energy tariffs through an ammonium controller and a modified BSM1 model (Gernaey et al. 2014). Savings were in the range of 4–11% while maintaining effluent quality, and storing peak flows in expensive energy periods resulted in 13% savings. Stentoft et al. (2019a) showed up to 21% reduction in costs of effluent taxes and electricity by using variable electricity prices in a model predictive control (MPC) strategy as compared with a rule-based control. Brok et al. (2019) showed a methodology to incorporate flexibility in aeration control for providing flexibility on short term electricity markets (i.e. providing regulating power capacity). These controls sometimes increased the total energy consumption, but lowered the total cost when moving the peak consumption to cheaper operating hours, and the savings depend on various performance criteria. Beltrán et al. (2013) furthermore minimized aeration costs based on a model that can be extended to include time-varying electricity costs, and Douglass et al. (2012) and Kebir et al. (2014) mainly considered the pumps at the WRRF as flexible on short-term electricity markets. ESWA (2014) also demonstrated Demand-Response savings in Denmark.
In practice, connecting a WRRF within Demand-Response systems requires the ability to buffer the incoming wastewater and delay wastewater treatment to periods with cheaper electricity prices while complying with environmental discharge regulations. This implies the ability to store wastewater during high-price periods. This storage is usually available in combined sewer systems, which are designed to cope with the high flows taking place during wet weather periods. In fact, combined sewer systems are in dry weather conditions during most of their operational time; that is, there is an excess storage capacity that can be used to delay power consumption for pumping and treatment. Also, an integrated MPC is needed in order to comply with environmental discharge limits, avoid an increase in flooding risk, and minimize the WRRF operational costs based on forecasts of incoming pollutant loads and future electricity prices. Although there are several applications of MPC in combination with Demand Response in, for example, chemical manufacturing plants (Mendoza-Serrano & Chmielewski 2013) or supermarket refrigeration (Hovgaard et al. 2012), no examples are yet found in literature for integrated urban wastewater systems.
In this paper, we propose an integrated MPC strategy connecting WRRFs and sewer systems and offering flexible energy consumption in a smart grid system. We apply a Demand-Response control to exploit the excess storage capacity in the sewer system in order to change the WRRF power consumption according to electricity prices. Because of this Demand-Response setup, the method will be directly applicable in the remaining part of the Nordic electricity market. Furthermore, it is believed that only a few modifications in the correspondence time and prediction horizon will be needed to apply in other markets worldwide. Since the major energy-demanding process is wastewater aeration to remove nitrogen, we consider the total nitrogen in the effluent as a measure of treatment quality. We show how to implement an MPC strategy that changes the inlet flow to the WRRF and minimizes the electricity costs while keeping effluent quality within regulatory limits. After testing the strategy in a simulation study, we provide results and evaluate the performance from actual operation of the Kolding WRRF, Denmark.
MATERIAL AND METHODS
The Kolding integrated catchment
The integrated MPC was developed and tested for the integrated system (combined sewer and WRRF) in Kolding, Denmark. The hydraulic performance and the availability of storage volumes in the combined sewer system for control purposes was investigated in Bjerg et al. (2015). Wastewater from the Kolding urban area is conveyed to a pumping station, which pumps it to the 125,000 PE WRRF located 8 km away. There are 21 storage basins spread across the catchments, with a total storage volume of 30,000 m3. However, for this initial study, only a large storage pipe located upstream of the plant inlet (with a volume of approximately 6,000 m3) is considered. A water level sensor is located in the pipe and used to estimate the stored water volume.
The Kolding WRRF utilizes the BioDenitro process (Bundgaard et al. 1989) for N removal, with two alternating aeration tanks for each of the two plant lines. The maximum power capacity for the biological aeration process is 720 kW, and aeration is responsible for at least 60% of the power consumption of the WRRF, in line with similar values found in literature (Plappally & Lienhard 2012; Gu et al. 2017).
The plant electricity bill is currently paid via a retailer, EnergiDanmark, and a small part of the price changes every hour. This hourly price is known 12 to 36 hours ahead and originates from the power exchange NordPools day-ahead market. The estimated yearly consumption of the Kolding is 2.7 GWh.
In Denmark, larger consumers with an annual energy consumption above 100 MWh are billed an hourly time-varying electricity price, the Elspot price. This price is settled every day at noon for the coming day from midnight to midnight in the different geographical areas of the electricity market. Consequently, after settlement at noon, the price is known 36 hours ahead. Before settlement at noon, the price is known and fixed at least 12 hours ahead. Our prediction horizon is Np = 24 hours, so consequently we need forecasts of the price from midnight to noon where the price is known less than 24 hours ahead. EnergiDanmark, the Balance Responsible Party of Kolding WRRF, provides online forecasts of the price. Modelling and forecasting this price is not part of this work, but details can be found in Jónsson et al. (2013). Due to the composition of the Danish electricity system, wind power plays a major role in price fluctuations (Jónsson et al. 2013); that is, a higher share of renewables sources results in lower electricity prices.
Effluent concentration limits and taxation
The maximum allowed discharge concentration for total nitrogen is SN,max 8 mgN/l. In addition, the Danish legislation imposes taxation on pollutant loads discharged by WRRFs, with the fee for total nitrogen set at pfee = 30 DKK/kgN for 2019–2020. The taxed annual loads are calculated based on 24-hr composite samples that are collected at fixed intervals (2–4 weeks according to the plant capacity). These discrete concentration values are combined and then multiplied by the total annual discharged volume.
Overall MPC strategy
In model predictive control of integrated sewer and wastewater systems, the optimal control is recursively recalculated over a specified, finite time horizon (here Np = 24 hours) based on current and updated information about the state of the system as well as information about future inputs to the system. For this purpose, an MPC model with associated forecasts of the inlet flow, effluent quality and power consumption is needed, and an MPC optimization model, needs to be specified. The MPC operates only in dry weather conditions. When rainfall is predicted by Numerical Weather Predictions (similarly to the example presented by Courdent et al. (2017)), the integrated system switches to a rule-based wet-weather control, aiming at minimizing the risk of combined sewer overflows.
MPC model structure and input forecasts
The Kolding integrated wastewater system is schematized in Figure 1. The storage pipe upstream from the pumping station is described by the volume V, while its inflow is defined as . The only actuator controlled by the MPC is the pumping station, and the control strategy defines setpoints for the outflow q(t) from the pumping station (i.e. the inflow to the WRRF). The MPC only controls the pumps that are normally active during dry weather and hence, for full-scale tests, the upper bound on q(t) is lower than the true. The WRRF is described as a noncontrollable unit that removes the nitrogen in the incoming wastewater load; that is, aeration is controlled by the existing WRRF control. The WRRF effluent concentration is defined as SN (mg/l).
The total energy consumption u is the sum of the energy consumption for pumping (upump) and aeration (uWRRF), both expressed as kW.
The volume and the flow are physically limited and must lie within some operator-specified bounds to avoid an increased risk of overflows and flooding.
Dry weather inlet flow forecast
The flow constraints (ensure positive flows. Exponential weights W are used to prioritize the newest measurements in the parameter estimation dataset (e.g. Madsen 2008). Wet weather periods are removed from the estimation data set by eliminating inlet flows above a certain threshold. This approach is useful for describing slowly varying parameters, and the model adapts to changing conditions and long term variation in the parameters. The estimate is run with same frequency as the MPC (hourly time steps).
Effluent quality model
During normal pump operations, flow and effluent concentrations appear to be correlated and to show a daily pattern. However, this correlation decreases once the MPC is implemented. Storing wastewater in the storage volume V may furthermore build up the NH4 concentration in a non-linear way that is not taken into account in Equation (3). However, since no water quality measurements are available in the combined sewer system to model such behaviour, this was neglected in this first version of the MPC.
Power consumption model
MPC optimization model
A linear objective function is used to formulate an Economic MPC (Jørgensen et al. 2011; Halvgaard et al. 2012) in order to control the system. Compared to traditional control methods, MPC takes any variable constraints and predictions into account, and it is able to react ahead of time. In this case the MPC moves power consumption to periods with cheaper electricity and larger shares of wind power, while meeting the treatment objectives.
Minimizing electricity cost
The controlled pump flow rate q(t) is formulated as a vector q ∊ over the prediction horizon of Np samples (with sampling period of 1 hour and Np = 24). So q contains one flow setpoint for each hour the next 24 hours. After finding the optimal flow set points, only the first value for the current time step is sent to the pumping station and actuated. This process is repeated in the following time step when new measurements and predictions are available, providing closed-loop feedback and adjusting for model and prediction errors.
If the volume exceeds the capacity, a slack variable ρ ∊ accounts for the overflow volume in dry weather (i.e. to avoid unwanted spills of the stored wastewater). This is heavily penalized in the objective function by using a high cost (ρ = 1,061). The slack variable is not only a measure of the overflow, it also makes sure that the optimization problem is feasible even though a small overflow might exceed the constraints, for example due to uncertainty in the dry weather flow or noisy volume measurements near the constraints. The volume measurement error is assumed to be negligible compared to the volume size, and thereby no data assimilation is included to update the modelled storage volume. MPC aiming at reducing CSO in wet weather typically adopt additional terms to increase robustness (e.g. penalization of stored volumes). These would however be in direct contrast with the objective of the proposed approach, which only operates in dry weather.
Minimizing electricity cost and respecting regulatory effluent quality limits
Solving the MPC optimization problem
The MPC problem described previously in (6) has only a linear objective term (i.e. H=0 in Equation (11a)), and it can be solved by using a Linear Programming (LP) solver in R (Berkelaar et al. 2015). Consequently, the differential Equation (6b) can be rewritten as a sum of matrix vector multiplications; that is, the impulse response model (Prasath & Jørgensen 2008). This impulse response model fits into the solver as the linear matrix inequality (11b). This implies that the MPC optimization problem (Equation (9)) can be managed by converting it to a standard Quadratic Programming (QP) form (11) where the optimization variables are augmented in x=[qT ; uT ; sT ]T. This problem can be solved by using a QP solver, which finds the optimal x that minimizes the objective function. The QP solver from the R-library quadprog (Goldfarb & Idnani 1983; R Core Team 2019) was used in this study. Running this solver on the WRRF control system hardware solves this relatively small convex MPC problem in milliseconds.
MPC performance evaluation
The MPC described in Equation (6) (focusing only on electricity cost minimization) was simulated by using the measured inlet flows from a 160 day period starting on 1 September 2015. Electricity prices and future inlet flows were assumed to be known; that is, these simulations indicate the upper bound for the performance of the MPC.
Effluent quality and electricity savings trade-off
In this formulation, a tuneable parameter α ∊ [0; 1], weighting the trade-off between the effluent quality and electricity cost savings for one particular day, is introduced. When α = 1, only the effluent quality is maximized. When α = 0, the power consumption is moved to the cheapest period possible without taking effluent quality into account.
The MPC was tested in full-scale operations for 2 and 5 days in November and September 2015, respectively.
RESULTS AND DISCUSSION
Dry weather inlet flow forecast
An example of the fitted inlet flow forecast model is shown in Figure 3, which shows the hourly measurements of the inlet flow qin(t) over one day, along with fitted the Fourier series model and the expected future (i.e. forecasted) inlet flow for the next 24 hours.
Modelled MPC performance
Figure 4 shows the daily savings obtained for the 160 days simulation period with average daily savings of 170 DKK/day relative to the normal operation where the dry weather flow is sent directly to the WRRF. Figure 5 shows the value of potentially using additional storage basins across the catchments and thereby increasing the storage volume and increasing the maximum pump flow qmax from Equation (6f). After a certain volume, the increase in the savings slowly decline. The savings can also be boosted by increasing the allowed maximum flow. Indeed, to fully exploit the storage capacity available in the system (above 30,000 m3), a high qmax should be used. This is particularly interesting, as most implementations of the algorithm will require considerations of the upper bound on the volume, Vmax. In this context, Vmax close to the actual physical limit for CSOs means that the system is not very robust against unpredicted events, without providing significant improvements in terms of savings. Hence, changing Vmax represents a trade-off between savings and robustness. Note that the effluent concentrations are not included in this approach, and hence the regulatory fee is not included in the savings. This is however discussed using (12) in the next section.
Effluent quality and electricity savings trade-off
Figure 6 shows the trade-off between effluent quality and electricity costs when α is varied between 0 and 1. The savings and effluent quality were calculated for a single open-loop trajectory that provided the optimal flow setpoints over one day. However, the MPC optimization model in Equation (9) has real prices as weights in the objective function and it is not tuneable. However, it is possible to find the point when the weights are equal to the actual prices; that is, the current regulatory fee pfee = 30 DKK/kg and the Elspot prices for that chosen day. As expected, the higher regulatory fee reduces the potential electricity cost savings on the particular day, as shown in Figure 6, but it reduces the emission of nitrogen to the environment. This is because a higher regulatory fee implies a lower weight on the electricity prices in the optimization of the economical objective function (12), and hence the daily savings in electricity costs are lowered. However, it is noted that the total savings (including electricity and fee) might not be equally lowered.
Figure 7 shows how the MPC optimization aimed at minimizing electricity costs (Equation (6)) controlled the flow in full-scale operation for 2 and 5 days in November and September 2015. The MPC adjusted the flow setpoint q based on the predictions of both the electricity price and the incoming flow. It did not take the effluent quality into account, but it did include the power consumption.
The uppermost plot in Figure 7(a) shows how the flow setpoint is high during periods with low electricity prices and low during periods with high electricity prices. The middle plot shows the volume and the volume constraints. The lower bound is violated a few hours during two of the days. The main reason is the uncertainty in volume measurements at low storage volume.
The uncertainty in volume measurements also influences the estimation of low inlet flows: in fact, this was negative during these periods (bottom plot). The controller truncated all inlet flows below zero and did not account for this error.
Other factors impacting the constraint violations were inlet flow forecast errors and rate of flow setpoint change limitations. Faster sampling time and robust handling of uncertainty could eliminate some constraint violations. One computationally efficient way of dealing with this uncertainty is simply to tighten the volume constraints a bit. The error in flow forecasts might also lead to suboptimal control actions. This is for instance likely to be the case in Figure 7(a) at hour 37. Here pumping is reduced only to increase pumping in the following hour where electricity is more expensive. However, looking at the actual inflow in this period, it seems to follow a diurnal variation poorly.
The other test period depicted in Figure 7(b) also shows some problems with constraint violations. However, from the bottom plot it is obvious that the volume constraint violation was caused by sharp spikes in the dry weather flow (e.g. wastewater discharges deviating from typical daily profiles) that are not accounted by the dry weather forecast model. This stresses the fact, that for the general application of this methodology, Vmax must be chosen wisely by including a safety margin to account for uncertainty in the inlet forecast model. In this test period, the minimum allowed flow setpoint for q was 160 l/s. Consequently, the controller was forced to pump out water even though the volume was below its minimum constraint. The upper volume constraint is also violated between hours 48 and 72. This is due to bad estimation of the volume caused by uncertain/noisy measurements. It is noted that this did not cause any CSO. Furthermore it is noted that the effluent requirements for the WRRF were satisfied during both entire test periods.
The MPC was also compared against a controller where the diurnally varying dry weather load is sent directly to the WRRF; that is, q(t)=qin(t). In practice, the volume is today controlled through rules reacting to volume levels. Unfortunately, the linear model used for including the effluent quality was not sufficient for control in all operating conditions. In future work, this model should be studied in detail using data that cover more operational periods and/or extended with details describing the control of the WRRF (e.g. by using the model in Stentoft et al. (2018)).
As discussed earlier, the implementation of a new control strategy must not cause CSO events in dry weather. However, erroneous estimations of the stored volume and uncertainty in the inlet forecast might lead to unwanted discharges. Therefore the definition of Vmax should include a safety factor with a buffer volume. Additionally, the dry weather forecast model might be improved by, for example, including a stochastic approach. Although negligible, the risk of CSO discharges in dry weather cannot be completely avoided, and it should therefore be included in the multi-criteria analysis performed before choosing to implement the proposed MPC.
Furthermore, there is an additional risk of increasing CSO in wet weather due to errors and false negatives in the NWP used to switch to wet-weather operation (which can e.g. lead to a late emptying of the storage volume). NWP application was discussed by Courdent et al. (2017), while Bjerg et al. (2015) showed a negative limited impact on the performance of the Kolding catchment for a simple energy-based control strategy.
In the 5-day test period the average savings were approximately 200 DKK/day as compared to a similar historic period. Although such monetary value might appear negligible compared to the overall WRRF costs, this should not shadow the novelty represented by this first application of Demand-Response MPC to a full-scale integrated wastewater system. The entire control of the Kolding integrated system has recently been migrated to a cloud system, allowing integration with other energy based controls (e.g. Stentoft et al. 2019a) with possible increase in savings. Investigations of the proposed MPC for catchments with similar energy markets and more favourable characteristics (e.g. gravity driven flow to the WRRF) are suggested.
This simple model structure is in fact well suited for control and it provides an important building block for expanding the control to bigger sewer systems. Electricity prices are usually low in periods with high shares of renewables, so price based control creates an incentive to integrate more wind power in the system. In some hours of the year in Denmark, negative electricity prices are observed due to the high share of wind power in the power system. Prices can also be generated to provide ancillary services like voltage control or congestion management. The importance of these markets (and thereby the economic return) is growing due to the decreasing importance of traditional power plants (currently used for e.g. frequency stabilization) across electricity networks. Since WRRFs electricity demand corresponds to an average of 1% of a country's electricity consumption (Shi 2011), these could provide a substantial capacity reserve in the power markets. In fact, as the need for flexible energy increases (Morales et al. 2013), this reserve might become necessary to exploit. Furthermore, investments made by WRRFs to implement the proposed controls would spare society from the need to upgrade the existing infrastructure. These economic savings at the societal level could therefore be acknowledged and re-distributed to WRFF operators through economic incentives (e.g. changes in taxation), decreasing the return of investment of the MPC.
Focusing the MPC on a single performance indicator might lead to a worsening of other aspects, as in the example presented by Flores-Alsina et al. (2014). Current research is focusing on testing the proposed MPC on a dynamic WRRF model to allow for a long-term performance analysis for a range of different performance indicators. Following this philosophy, possible extensions of proposed control can include combination with other MPC strategies mainly focusing on control of the removal processes (e.g. Stentoft et al. 2019a), boosting their overall performance not only in monetary terms, but also in other performance criteria (e.g. CO2 emissions, eutrophication impacts, acidification of receiving water bodies etc.) (Stentoft et al. 2019b).
This paper illustrates the first application of model predictive control (MPC) in a price-based, Demand-Response set-up to control an integrated sewer-wastewater system during dry weather. The control aims at storing wastewater in the sewer network during periods of high electricity prices, while enabling wastewater treatment in periods when electricity prices are lower. The main findings are as follows:
The MPC optimized the operation of the WRRF over short-term (24-hour) predictions of the hourly electricity price from NordPool.
The MPC used several dynamic mathematical models as part of the optimization, including models of the upstream storage volume, the power consumption of the pumps and the WRRF, and the inlet flow to and the effluent quality from the WRRF. Updating these models continuously to measurements allowed using simple and fast model structures sufficiently accurately for this short-term optimization problem.
The proposed MPC showed its potential both in model simulations and full-scale applications at a medium-sized WRRF in Denmark.
The monetary savings from the Kolding case study were limited (approximately 200 DKK per day). Additional simulations of the MPC over a longer period of time resulted in similar performance.
A control method that takes the effluent quality at the WRRF into account by considering the sewer system and the WRRF jointly was also presented.
Although the application to the specific Kolding system did not provide great savings in monetary terms, the structure of the proposed MPC enables an easy application in any other catchment. Hence this can provide an important contribution towards the integration of WRRF and sewer system operation in electric smart grids.
This research was funded by Innovation Fund Denmark through the Industrial PostDoc project ‘W2E Smart Grid upgrade’ and the first author's industrial PhD project ‘Stochastic Predictive Control of Wastewater Treatment Processes’, and partly by the Danish Council for Strategic Research through the CITIES project no. 1305-00027. Thanks to BlueKolding for providing all plant data.
Current address: DHI Denmark, 5 Agern Allé, Hørsholm, DK-2970, Denmark
Current address: WaterZerv, Founders House, Njalsgade 19D, 2300 Copenhagen
Current address: Lobster, Folevadsvej 18, 2400 København