• Performance evaluation protocol

The BSM2 platform provides an evaluation protocol for the control strategies tested in the plant [12]. These indicators are computed, using a code provided by BSM2 simulator for an evaluation period of one year, starting 1 July. The program computes the most important variables associated with the load and composition of influent, effluent, biogas and sludge in a given temporal window. The notation for the interesting variables (most of them ASM1 variables): SI—soluble inert organic matter, SS—readily biodegradable substrate, XI—particulate inert organic matter, XS—slowly biodegradable substrate, XB,H—active heterotrophic biomass, XB,A—active autotrophic biomass, XP—particulate products arising from biomass decay, SO—oxygen, SNO—nitrate and nitrite nitrogen, SNH—NH4 <sup>+</sup> + NH3 nitrogen, SND—soluble biodegradable organic nitrogen, XND—particulate biodegradable organic nitrogen, Qin—influent flowrate, Qe—effluent flowrate, Tin—influent temperature, T—digester temperature A sub-index is used to indicate the number of the reactor associated with the variables when is necessary.

Some indicators given by BSM2 platform are the effluent quality index (EQI) that measures the effluent water quality as a weighted average of effluent COD, BOD, ammonia, nitrate and total solid loads, the overall cost index (OCI) [17–19] that provides a relative comparison for the operational cost including, power for mixing aeration and pumping, carbon source addition, heating of the digester, utilization of biogas and disposal of sludge. A modification is introduced in this work to obtain direct carbon dioxide (CO2) emissions produced in ASP.

The effluent quality index [19,20]:

$$EQI = C\_1 \int\_{t\_0}^{t f(days)} [2 \cdot SS\_{\varepsilon} + COD\_{\varepsilon} + 30 \cdot N\_{lbtt} + 10 \cdot S\_{NO,\varepsilon} + 2 \cdot BOD\_{\varepsilon}] Q\_{\varepsilon} dt \left(\frac{kg \text{ population}}{d}\right) \tag{1}$$

where *<sup>C</sup>*<sup>1</sup> <sup>=</sup> <sup>1</sup> *<sup>T</sup>*·<sup>1000</sup> and *<sup>T</sup>* is the evaluation period.

The BOD, COD, total nitrogen concentration (Ntot) and suspended solids (SS) are computed as [19,20]:

> *BODe* <sup>=</sup> 0.25 · (*SSe* <sup>+</sup> *XSe* <sup>+</sup> (<sup>1</sup> <sup>−</sup> 0.08) · (*XB*,*Ae* <sup>+</sup> *XB*,*He*)) *g*/*m*<sup>3</sup> (2)

$$\text{COD}\_{\ell} = \left(\text{S}\_{\text{S\varepsilon}} + \text{S}\_{\text{I\varepsilon}} + X\_{\text{S\varepsilon}} + X\_{\text{I\varepsilon}} + X\_{\text{B},\text{I\varepsilon}} + X\_{\text{B},\text{A}\varepsilon} + X\_{\text{P\varepsilon}}\right) \left(\text{g}/m^{\text{3}}\right) \tag{3}$$

$$N\_{\rm hotc} = S\_{\rm NOx} + S\_{\rm NIrc} + X\_{\rm NDic} + i\_{\rm XB}(X\_{\rm B,He} + X\_{\rm B,Ac}) + i\_{\rm XP}(X\_{\rm Pc} + X\_{\rm Ic}) \left( \lg/m^3 \right) \tag{4}$$

$$SS\_{\varepsilon} = 0.75 \cdot \left(X\_{\mathbb{S},\varepsilon} + X\_{I,\varepsilon} + X\_{\mathbb{B},H,\varepsilon} + X\_{\mathbb{B},A,\varepsilon} + X\_{P,\varepsilon}\right) \left(\text{g}/m^3\right) \tag{5}$$

where the subscript index: *e* is used to distinguish the variables in the effluent.

The influent quality index (IQI) has been defined to characterize the influent [19,20]:

$$IQI = C\_1 \int\_{t\_0}^{t/\text{days}} [2 \cdot SS\_i + COD\_i + 30 \cdot N\_{\text{lati}} + 10 \cdot S\_{\text{NO},i} + 2 \cdot BOD\_i] Q\_{\text{int}} dt \left(\frac{\text{kg population}}{d}\right) \tag{6}$$

where *SSi*, *CODi*, *Ntoti*, *BODi* are analogous to *SSe*, *CODe*, *Ntote*, *BODe* but the subscript index: *i* is used to denote the variables in the influent.

The global operational cost (OCI) is:

$$\text{OCI} = AE + PE + 3 \cdot SP + 3 \cdot EC + ME - 6 \cdot MP + HE\_{ntt} \text{ (EUR/d)} \tag{7}$$

where AE represents the aeration energy in the activated sludge process, PE is the pumping energy in the full plant (involving all flows), ME is the mixing energy in the full plant, SP is the sludge production for disposal, EC is the external carbon addition and MP is the methane production and HEnet is [19,20]:

$$HE\_{net} = \max\{0, HE - 7 \cdot MET\_{prod}\} \, (kWh/d) \tag{8}$$

where HE is heating energy necessary to heat the sludge to the digester operating temperature and METprod is the methane production (kg/d).

Regarding greenhouse emissions, direct emissions from activated sludge process are calculated as in [26], considering the following equations:

$$2.57 \text{C}\_{2.43}H\_{3.96}O + 2.5 \text{O}\_2 + NH\_3 \rightarrow \text{C}\_5H\_7O\_2N + 1.24 \text{CO}\_2 + 3.09 H\_2O \tag{9}$$

$$548.59NH\_3 + 5CO\_2 + 90.19O\_2 \rightarrow C\_5H\_7O\_2N + 47.59HNO\_3 + 45.59H\_2O \tag{10}$$

$$2.57C\_{2.43}H\_{3.98}O + 2HNO\_3 + NH\_3 \rightarrow 1.24CO\_2 + C\_5H\_7O\_2N + 4.09H\_2O + N\_2 \tag{11}$$

where *C*2.43*H*3.96*O* represents readily biodegradable substrate (SS) and *C*5*H*7*O*2*N* represents heterotroph and autotroph biomass (XB,H and XB,A).

### *2.2. Evaluation of the Impact of Dynamic Behavior Actions on Environmental and Operating Costs*

Several characteristics of WWTPs make the optimization of their operation a challenging problem:


which makes it difficult to find and maintain operating conditions that ensure the desired process performance with an optimal use of resources and minimum evitable emissions.

3. Due to the interactions and interconnections between the different units, the control actions performed in ASP have an impact in the whole plant effecting, sludge and biogas production which are emissions to soil and air, respectively.

Then, dynamic analysis of the effect of control actions on environmental and operating costs facilitate to detect dynamic effects on environmental indicators that are hidden in the annual based analysis of environmental impact [12,27] but can be relevant at smaller time scales. Identifying the effect of periodic variations and particular events in the influent in different temporal windows along the year provide the means to determine alternative control actions that can be applied to improve plant efficiency in such scenarios.

Conflicts regarding energy use, greenhouse gases emissions and use of chemicals are considered in the analysis:


### 2.2.1. Analysis Procedure

The general idea is to evaluate the impact of the control actions to find an operation strategy that produce a satisfactory trade-off between environmental and operating costs. It should be considered that wastewater treatment plants (WWTP) are subject to large disturbances related to variations in the flow and composition of the incoming wastewater. These variations are associated with human activity in the catchment or rainfall effects and seasonal effects due to the temperature changes along the year. The influent variations affect process behavior and produce a reaction of the control system to reject disturbances and maintain the appropriated operating conditions.

Annual, bimonthly and weekly periods are considered to capture such cause–effect relations in different operating windows. The annual average values of the environmental indicators and operating costs (OCI) measures the performance in the full operating horizon. The weekly profiles capture the effect of short time variations associated with rain events and human activities and bimonthly profile allows the observation of long-time effects in influent flow and temperature associated with the different seasons. This analysis makes it possible to identify the changes on operation variables that can be made in a specific temporal window to improve the plant behavior.

The criteria to select the environmental indicators considered in this study is the possibility of being affected by control actions, even though data provided by BSM2 protocol can be used to perform a more detailed environmental analysis. The selected indicators are:

For energy:



For emissions to air:


For emissions to soil:


Operational costs are measured using the OCI in euros/day (EUR/d).

All indicators are computed for a given temporal window and are expressed with respect average influent flow Qin (m3/h) in such time period. Then, Ntot Load/Qin (g/m3) and SNH Load/Qin (g/m3) are referred as concentrations Ntot and SNH.

• Temporal characterization of BSM2 dynamic influent

The BSM2 model represents a plant located in the northern hemisphere. The available dynamic influent profile describes seasonal changes of temperature and influent flowrate, characteristic daily and weekly variations associated with population activities and precipitations [8,12]. Both daily and seasonal variations of temperature are modelled with a sinus function [8]. The evaluation period contemplated in the simulation platform is one year, starting 1 July in a plant located in the northern hemisphere.

The characterization of influent behavior is important to identify the significant events on influent behavior that affect operating conditions and the temporal window that capture such an event. Weekly and bimonthly profiles of the most important influent variables: temperature, influent flow Qin, and influent concentrations of COD and Ntot (Equations (3) and (4)) are presented in Figure 3. It is observed that temperature profile (weekly or bimonthly) follows a senoidal function with a minimum in the colder (4th) bimester and a maximum in the warmer (1st) bimester. Weekly profiles of influent flow (Qin), total nitrogen (Ntot) and COD observed in Figure 3 exhibit frequent disturbances with eventual minimums and peaks due to population activities and rain events, while bimonthly profiles show the seasonal effects as the period with the highest influent flow (Qin) that is the 3rd bimester, the driest period (1st bimester), the period with lower load (3rd bimester) and the period with the lowest load (2nd bimester). Table 2 summarizes the annual averages of influent variables as well as the maximum and minimum values in the different time scales, quantifying the variations observed in Figure 3. The information provided by Table 2 allows us to demonstrate that WWTP influent exhibits variations of temperature of approximately 10 ◦C between the colder and warmer period that affect significantly biological processes kinetics. Moreover, the quantification of the differences between the maximum and minimum values of influent flow and load in the different time scales, shows how relevant are the changes in the influent that affect WWTP behavior. In order to maintain the desired WWTP performance, different control actions are executed to face these appreciable variations

of influent characteristics detected in different time horizons. These actions affect environmental performance of WWTP; a dynamic analysis of environmental indicators is interesting to determine the impact of control actions considering the time varying characteristics of the process.

**Figure 3.** Weekly and bimonthly profile of influent temperature (◦C), flow rate Qin (m3/d), total nitrogen concentration Ntot concentration (g/m3) and COD concentration (g/m3).

**Table 2.** Characteristic values of the significant variables of the influent including weekly and bimonthly means (W. Av.: Weekly average, Bi-m. Av.: Bimonthly average).


### **3. Results**

The evaluation of process behavior is performed for an operation cycle of one year using the control strategies described in Table 1 (DO default, DO + NO control and Cascade SNHSP). The selected environmental indicators and operating costs are computed considering the different temporal windows to capture: (1) the impact of slow disturbances associated with seasonal behavior of influent, and (2) the impact of variations on influent flowrate and load detected in weekly and bimonthly periods.

Following the BSM2 protocol, a simulation of 609 days is carried out but only the last 365 days (one year) are considered to compute the performance indices and environmental indicators [11]. The.output data is stored with a sampling time of 15 min. These outputs are used for the calculation of

the environmental indicators and the OCI. Thus, the annual, bimonthly and weekly mean of the selected environmental indicators (Section 2.2.1) are computed, and weekly and bimonthly dynamic profiles are obtained to show the effect of control actions and influent variations on different temporal windows.

This is a first step of the analysis, whereby different control strategies are compared and the control scheme that produce the best compromise between environmental and operational costs is selected. In a second stage, the effect of set-point changes and carbon dosage (Qcarb) on plant behavior with the selected control strategy is evaluated, in order to determine control movements that improves environmental and operating costs in a given operation window.

*3.1. Analysis of the E*ff*ect of Control Actions and Influent Variations on Environmental Indicators Considering Di*ff*erent Temporal Windows. Di*ff*erent Activated Sludge Process (ASP) Control Strategies*

• Analysis of behavior in the full operating period (one year)

Table 3 presents the annual average values of environmental indicators and operation costs computed with respect to the volume of treated wastewater.


**Table 3.** Annual values of environmental indicators and operating costs of BSM2 plant with respect to the volume of treated wastewater with different control schemes.

AE: Aeration energy, PE: Pumping energy, ME: Mixing energy, COD: Chemical oxygen demand, SNH: ammonium concentration, Ntot: Total nitrogen concentration, EQI: Effluent quality index.

*Energy consumption*. The lowest consumption of electricity is attained with the Cascade SNHSP scheme. This strategy varies DO set-point to regulate effluent ammonium concentration which reduces the consumption of energy for aeration, while the other schemes keep a constant DO set-point of 2 g/m3 in the full operating period. Regarding heating requirement of digester, the heating energy (HE) is equal with the three control schemes.

*Use of chemicals*. A constant carbon dosage (Qcarb = 2 m3/ d) is applied in all cases.

*Emissions to air and emissions to soil.* The amount of CH4, CO2 (emissions to air) and sludge (emissions to soil) produced in anaerobic digester is the same with the three control schemes. Conversely, the amount of CO2 produced by biological processes in ASP varies with the different control schemes, attaining the lowest levels with Cascade SNHSP scheme.

*Emissions to water*. The lowest Ntot concentration in the effluent is obtained with Cascade SNHSP scheme but also the highest concentration of ammonium (SNH). The Cascade scheme exhibits the lowest EQI, i.e., the lowest pollution load in the effluent considering nitrogenated compounds, organic matter and biomass. The concentration of COD in the effluent is similar for the three schemes.

The OCI depends on electricity, heating energy, chemicals and sludge treatment. Electricity usage is the only factor of OCI that varies with the different control schemes, therefore, the lower OCI is obtained with Cascade SNHSP scheme due to the reduction of energy requirements attained with this control scheme.

Table 4 present the variation of environmental and operating costs indicators observed with ammonium-based control (Cascade SNHSP) and DO and nitrates control (DO + NO control) relative to the DO default control scheme. The major impact of Cascade SNHSP scheme is observed on total nitrogen concentration with an improvement of 16.2% and SNH levels with a significant increment of 121%. The Cascade control scheme has a positive effect on five of the six indicators (5/6) decreasing its annual average values and the indicators that are worsened, and the levels of SNH (1.053 g/m3) are still below the desired limits (4 g/m3 in Table 1) with a back-off of 70%. Therefore, it can be concluded from the annual analysis that Cascade SNHSP scheme produce the best trade-off between environmental and operating costs.

**Table 4.** Environmental and cost indicators of Cascade SNHSP and DO + NO control relative to default DO control scheme.


AE: Aeration energy, PE: Pumping energy, ME: Mixing energy, COD: Chemical oxygen demand, SNH: ammonium concentration, Ntot: Total nitrogen concentration, EQI: Effluent quality index.

Now, dynamic analysis is carried out in to provide insight on the dynamic effect of control actions on environmental and operational costs that are hidden when annual average values of indicators are considered.
