• Analysis of dynamic behavior considering weekly and bimonthly time scales

The dynamic evolution of the environmental indicators considering weekly and bimonthly temporal windows is presented here. For simplicity, a profile of total CO2 emissions is presented instead of separated profiles of CO2 from the digester and CO2 from the ASP, and Ntot, SNH and EQI profiles are considered to characterize emissions to water.

Figure 4 presents the bimonthly and weekly dynamic profiles of environmental indicators associated with energy usage: electricity consumption and heating energy (HE). The dynamic profile of electricity consumption with the three control schemes exhibits the combined effect of influent flow, COD and Ntot that affect the load to be treated. There are peaks on weeks 6, 7 and 50 and minimums on weeks 22, 24 and 46 corresponding to extreme values of influent variables in the weekly profiles (See Figure 2). A seasonal effect is detected in the bimonthly profile, electricity consumption is maximum in the first and second bimesters, that is the driest period of the year, and more energy is required to track DO set-point in these conditions and decreases significantly in the 3rd bimester, that is the period with the largest influent flow and lowest concentration of pollutants. The temperature effect is not evidenced in the evolution of this indicator.

**Figure 4.** Weekly and bimonthly profiles of environmental indicators associated with energy use: electricity consumption, Electricity/Qin (kW h/m3); heating energy, HE/Qin (kW h/m3).

Electricity consumption is associated with control movements of the control schemes (i.e., aeration energy, pumping energy), then the frequent variations observed in the weekly profile of the control schemes that keep a constant DO set-point (DO default and DO + NO control) are associated with control actions that keep DO close to set-point in the presence of disturbances in the load. The similitude between DO default and DO + NO control profiles suggest that variations in electricity consumption are mainly produced by aeration. On the other hand, the Cascade SNHSP scheme exhibits variations with load similar to the variations observed with DO-based control schemes, but electricity consumption is significantly reduced since it is not necessary to increase aeration to keep a fixed DO-set point. In the bimonthly profiles, the periods of maximum and minimum consumption coincide with DO-based schemes, but the variation pattern is completely different.

Regarding heating energy (HE) profiles, a clear effect of temperature with maximum heating requirements in the colder period and minimum requirements in the warmer season are observed in weekly and bimonthly profiles. The profiles with the three control schemes coincide exactly, which indicates that the effect of tested control schemes on energy requirements of digester is negligible.

Figure 5 shows the weekly and bimonthly profiles of the environmental indicators associated with emissions to air and soil: CH4 content on biogas, sludge production and carbon dioxide emissions. There is no evidence of a significant temperature effect in the profiles of the three variables. The weekly and bimonthly profiles of CH4 content on biogas reproduce the variation of COD concentration in the influent; it is recognized that COD content in the digester feed have a significant effect on biogas production [19], so influent variations of COD are reflected in the composition of Qw that is fed to the digester. In the case of sludge for disposal, the dynamic pattern does not coincide with influent variations, except for the periods of minimum production in the third bimester that coincides with the maximum influent flow and minimum Ntot and COD concentration. Regarding the effect of control schemes, identical weekly and bimonthly profiles of CH4 content in biogas and sludge for disposal are

obtained with the three control schemes indicating a negligible influence of control actions on these variables. CO2 production in ASP is governed by biological processes that are affected by load to be treated, so the effect of influent variables is evidenced in the profiles of CO2 emissions. The frequent changes observed in the weekly profiles coincide with continuous influent variations and bimonthly profiles, allowing us to distinguish a period with the lowest emissions in the 3rd bimester and higher emissions in the driest period, the 1st and 2nd bimesters. The CO2 emissions profiles with the three control schemes exhibit the same pattern of variation but different magnitudes, the Cascade SNHSP scheme produces the lowest CO2 emissions in the full operation horizon since treatment intensity is reduced due to reduction in aeration, but on the other hand DO + NO control produces the higher emissions since strict treatment requirements are imposed by simultaneous regulation of DO and NO set-point.

**Figure 5.** Weekly and bimonthly profiles of environmental indicators associated with emissions to air and soil: methane content in biogas, Biogas CH4/Qin (kg/m3), sludge for disposal, Sludge/Qin (kg/m3), and total carbon dioxide emissions, CO2/Qin (g/m3).

Figure 6 shows the weekly and bimonthly profiles of the environmental indicators associated with emissions to water: total nitrogen (Ntot), ammonium concentration (SNH) and EQI. The influence of influent variation is evidenced by the valleys between weeks 5 and 7, in all indicators, and some peaks that coincide with extreme values of influent concentration and flowrate. Seasonal effect of temperature and load are observed in the bimonthly profiles, especially in the case of SNH and EQI that exhibits higher values of the indicators in the period of lower temperature (4th bimester) and lower values in the warmer period (1st bimester). These variables determine the effluent quality attained with wastewater treatment, and then they are significantly affected by control actions. The weekly and bimonthly profiles of total nitrogen (Ntot) are completely different depending on control strategy. In the case of the DO control and DO + NO control schemes, it is evident that variations associated with changes in the influent load are attenuated by control actions that regulate nitrogen removal adjusting DO concentration to a constant DO set-point. The bimonthly profiles with DO-based control schemes do not suggest a seasonal effect. In the case of the Cascade SNHSP scheme, larger variations associated with changes in influent load are observed in the weekly profile and, in the bimonthly profile, it is observed how Ntot increases in the colder period, where biological removal is slower, and decreases in the warmer bimesters, where microorganism activity increases. This control scheme varies the DO set-point with ammonium concentration in the last bioreactor, then pressure on biological nitrogen removal is reduced and the effect of other variables is more notorious. Regarding the SNH and EQI profiles, they exhibit a similar variation pattern with the three control strategies with significant differences in the magnitudes of the indicators. The regulation of nitrates concentration with the DO + NO control scheme produce minimum levels of ammonium in the effluent in the full operation period while the highest values are attained with Cascade SNHSP scheme. EQI measures pollution content in the effluent including COD, BOD, total nitrogen and ammonium, and this indicator exhibits the lower values with the Cascade SNHSP scheme but, it is detected that in the periods of largest influent flow, lowest concentration of influent pollutants and lower temperature, the 3rd and 4th bimester, Cascade SNHSP scheme and DO control attain the same values. The worst EQI profiles correspond to DO + NO control.

Summarizing, the analysis of the weekly and bimonthly profiles provide evidence that the effect of control strategies on environmental indicators associated with the sludge line as heating energy (HE), CH4 content in biogas and sludge production is minimal. The dynamic profiles allow us to detect the significant effect of influent temperature for HE, and CH4 content in biogas, while sludge production is affected by seasonal behavior of influent flow rate. The electricity consumption is associated with manipulated variables of the control schemes such as aeration energy and pumping energy, so the dynamics of electricity consumption depends on control actions performed to deal with frequent and seasonal changes in the influent load. Dynamic behavior of indicators of emissions to water and CO2 emissions is determined by control actions performed to regulate the nitrogen removal process. However, analysis of those dynamic profiles allows to detect seasonal effects of influent load and temperature in CO2 emissions, SNH, EQI and Ntot, that cannot be observed in a study based on the evaluation of annual average environmental indicators. Then, analysis of dynamic performance considering different time scales provides insights into the effect of seasonal and periodic influent disturbances that can be useful to take adequate control decisions. Moreover, it allows us to capture the interactions between control actions and environmental impacts that can be addressed by the opportune adjustment of control variables.

This statement can be supported by comparing maximum difference between the values of indicators for the weekly and bimonthly profiles and the average annual value (DO control is used as a reference for comparison) shown in Table 5. Average values provide a quantification of performance in the full operational horizon, while dynamic profiles provide information of the changes experimented by indicators along the operation horizon that cannot be appreciated using annual based indicators. The possibility to detect such dynamic effects increases as the operation window decreases. In Table 5,

the differences between the maximum and minimum values for the weekly time scales are attenuated in the bimonthly time scale.

**Figure 6.** Weekly and bimonthly profiles of environmental indicators associated with emissions to water: Ntot Load/Qin (g/m3), SNH Load/Qin (g/m3), and EQI/Qin (kg/m3).

In order to select the control strategy that exhibits the best dynamic performance, a quantitative comparison of the mean bimonthly values of environmental indicators significantly affected by control actions (Electricity, Ntot and EQI) is presented in Table 6. It presents the variation of indicators obtained with the Cascade SNHSP scheme and DO + NO control with respect to the DO control scheme, since it is the typical strategy implemented in WWTPs. Weekly mean values of indicators are not presented, because a large amount of data had to be reported and qualitative information from Figures 4–6 have been sufficient to observe the dynamic effect in a shorter time horizon. The values reported in Table 5 evidence the improvement of electricity consumption, Ntot concentration and EQI attained with the Cascade SNHSP scheme in the full operation period with respect to the DO control scheme. Effluent

SNH concentration is worsened, but the highest value of SNH in the weekly profile is still significantly below the desired limit (4 g/m3), so it is admissible. The DO + NO control scheme improves only SNH concentration and worsens Ntot concentration, attaining values that violates the desired limits in the weekly and bimonthly profiles. Thus, the analysis of the average annual indicators and the qualitative observation of dynamic profiles leads to the conclusion that the best performance in terms of environmental and operational costs is achieved with the Cascade SNHSP scheme.

**Table 5.** Maximum and minimum values in the weekly and bimonthly profile, and average values of environmental indicators with respect to the volume of treated wastewater with DO control scheme (W. Av.: Weekly average, Bi-m Av.: Bimonthly average).


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


**Table 6.** Variation of bimonthly means of environmental indicators mainly affected by the Cascade SNHSP and DO + NO control schemes with respect to default DO control scheme.

SNH: ammonium concentration, Ntot: Total nitrogen concentration, EQI: Effluent quality index.

In order to determine the effect of other control actions on environmental indicators when using Cascade SNHSP scheme, in the next sections the effect of ammonium set-point SNHSP and external carbon dosage Qcarb variations is evaluated. For the sake of simplicity, the analysis is performed considering the annual average values of the indicators significantly affected by SNHSP and Qcarb variations, the weekly dynamic profiles for ammonium set-point changes and bimonthly profiles for carbon dosage variation and the comparison of the bimonthly mean values. The idea is to detect this through observation of the dynamic effect of these control actions, when the changes with respect to default Cascade SNHSP scheme with constant SNHSP = 1 g/m<sup>3</sup> and Qcarb = 2 m3/d can be favorable to environmental performance.

3.1.1. Different Set-Points for the Ammonium-Based Control Scheme (Cascade SNHSP)

Three possible set-points are considered for the Cascade SNHSP scheme, default set-point 1 g/m3, a set-point close to the admitted limit 4 g/m<sup>3</sup> and a relaxed set-point 6 g/m3. The annual average values

of the environmental indicators affected by control actions (Electricity consumption, CO2 emissions and effluent variables: Ntot, SNH and EQI) are presented in Table 6, together with the variations relative default Cascade scheme with SNHSP = 1 g/m3.

Increasing ammonium set-point implies increasing ammonium concentration in the effluent (SNH) as is observed in the values reported in Table 7, it reflects also on EQI. However, other indicators as energy consumption, CO2 emissions, Ntot in the effluent and operation costs (OCI) are improved when requirements on ammonium concentration in the effluent are reduced. Moreover, the negative impact of relaxing SNH set-point can be tolerable if it is compensated by a significant improvement on other indicators, since SNH in the effluent is still separated from its limit (4 g/m3) with an approximated back off of 56% in the worst case (SNHSP = 6) and the increment on EQI is small (1.9%). The analysis of dynamic behavior of the indices allows us to detect particular situations in a given temporal window where combination of the effects of influent variations, control actions and ammonium set-point variation produce a positive effect on environmental performance. Weekly profiles are considered since ammonium set-point changes affects biological processes that occur in a short time scale [8].

**Table 7.** Annual values of environmental indicators and operating costs of a BSM2 plant with respect to the volume of treated wastewater using the ammonium-based control scheme (Cascade SNHSP) with different set-points and variation relative to 1 g/m<sup>3</sup> set-point.


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

Figure 7 presents weekly profiles of electricity consumption and CO2 emissions and Figure 8 presents weekly profiles of the indicators associated with emissions to water: Ntot, SNH and EQI. The variation of bimonthly means of electricity, Ntot, SNH and EQI obtained with the Cascade scheme with SNHSP = 4 g/m3 and SNHSP = 6 g/m3 with respect to original SNHSP = 1 g/m3 is presented in Table 7.

**Figure 7.** Weekly profiles for electricity consumption Electricity/Qin (kW h/m3) and total carbon dioxide emissions CO2/Qin (g/m3) under ammonium-based control scheme (Cascade SNHSP).

**Figure 8.** Weekly profiles of environmental indicators associated with emissions to water: Ntot Load/Qin (g/m3), SNH Load/Qin (g/m3) and EQI/Qin (kg/m3) under the ammonium-based control scheme (Cascade SNHSP).

In Figure 7 it can be observed that profiles of electricity consumption and CO2 emissions decreases their magnitude as SNHSP increases but exhibit the same pattern of variation. The variation of electricity consumption reported in Table 8 provide evidence that the changes are larger between the 3rd and 5th bimesters where load and temperature effects are significant. Regarding indicators of emissions to water, in Figure 8 it is observed that magnitude of Ntot profile decreases as ammonium set-point increases, but the effect is notorious in the colder weeks (20–40). The opposite effect is observed in SNH and EQI profiles, ammonium concentration in the effluent and EQI increases as SNHSP increases, but it is more notorious in the colder weeks. Moreover, SNH values are significantly affected while the impact on EQI can be negligible in the warmer weeks. These observations are supported by the quantitative information reported in Table 8.

The solution to improve plant performance modifying ammonium set-point (SNHSP) depends on different factors. Increasing the SNHSP reduces electricity consumption and CO2 emissions and minimizes Ntot but increases ammonium emissions (SNH). The SNH set-point could be increased in specific periods of time, where other factors compensate the deterioration of EQI and emissions of ammonium to water, to produce a positive effect on electricity consumption, CO2 emissions and Ntot. The adjustment of carbon dosage, the effect of which is evaluated in the next section, can produce conditions favorable to increase ammonium set-points in particular temporal windows.


**Table 8.** Variation of bimonthly means of environmental indicators affected by ammonium set-point (SNHSP) changes with respect to the Cascade SNHSP control scheme with SNHSP = 1 g/m3.

SNH: ammonium concentration, Ntot: Total nitrogen concentration, EQI: Effluent quality index.

3.1.2. Effect of Variation of External Carbon Dosage (Qcarb) with the Ammonium-Based Control Scheme (Cascade SNHSP)

In the default operation strategy, an external carbon source with a concentration of 40,000 g/m3 is added to the first anoxic reactor at a constant flowrate Qcarb = 2 m3/d. The effect of variations of Qcarb to lower values, including Qcarb = 0 is evaluated considering annual and bimonthly time scales since it affects biological processes in a medium time scale, and it is easier to appreciate this effect using bimonthly profiles.

Table 9 presents the annual average values of environmental indicators and operating costs computed with respect to the volume of treated wastewater, and the variations observed on the annual average values of the indicators relative to the default Qcarb = 2 m3/d are presented in Table 10. In Tables 9 and 10 it is observed that variation of Qcarb affect, even slightly, all environmental indicators from the water and sludge line. Decreasing carbon dosage produce a slight positive effect ranging between 1% to 4% on electricity consumption, CO2 emissions from the digester, sludge production, SNH concentration in the effluent and heating energy (HE). On the other hand, a slight negative impact is observed in biogas production, CO2 emissions from ASP and COD in the effluent.


**Table 9.** Annual values of environmental indicators and operating costs of the BSM2 plant with respect to the volume of treated wastewater using the ammonium-based control scheme (Cascade SNHSP) with SNHSP = 1 g/m3 and different values of Qcarb.

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


**Table 10.** Comparison of the influence on environmental and cost indicators of carbon dosage variations relative to default Qcarb = 2 m3/ d with the ammonium-based control (Cascade SNHSP) with SNHSP = 1 g/m3.

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

The reduction in the use of chemicals, measured as the amount in kg COD of external carbon, is proportional to Qcarb. Carbon dosage affects directly the operation costs since OCI includes a term that accounts external carbon with a cost factor of 3 EUR/kg, then operation costs can be reduced 15.6% when half of the carbon dosage is used and can be reduced to 30% eliminating carbon dosage (Qcarb = 0).

The variables that are significantly affected by Qcarb are Ntot and EQI which vary up to 33.1% and 13.8% respectively. The amount of organic matter provided by Qcarb is used as substrate by heterotrophs for denitrification, then reducing available substrate to transform nitrates (SNO) to N2 gas increases the amount of nitrates in the effluent and consequently Ntot and EQI.

The dynamic behavior of total nitrogen in the effluent (Ntot) and EQI is observed using bimonthly profiles (Figure 9), since the effect of Qcarb variation on these variables is clearly observed considering this time scale. The Ntot and EQI profiles shown in Figure 9 exhibit the same variation patterns with different magnitudes for the different values of Qcarb, and the magnitude of the profiles increases proportionally to Qcarb reduction. There is only one exception in the case of EQI that exhibits a different trend in the 4th bimester with Qcarb = 2 g/m3. Table 11 presents the variation of bimonthly mean values of Ntot and EQI for the different Qcarb values relative to the default Qcarb = 2 g/m3.

Decreasing carbon dosage implies a significant reduction in the use of chemicals and operating costs but produces a negative impact on total nitrogen and effluent quality index. A comprehensive evaluation of Qcarb effect allows us to determine the temporal windows where other effects compensate the negative impact on Ntot and EQI of Qcarb reduction, to minimize operation costs and the use of chemicals.

**Figure 9.** Bimonthly profiles of Ntot Load/Qin (g/m3) and EQI/Qin (kg/m3) for Qcarb variations under ammonium-based control (Cascade SNHSP).


**Table 11.** Bimonthly variations on Ntot and EQI with carbon dosage variations relative to default Qcarb = 2 m3/ d.

Ntot: Total nitrogen concentration, EQI: Effluent quality index.

### *3.2. Selection of the Alternative Strategy for the Best Trade-o*ff *Solution*

The ammonium-based control scheme with constant SNHSP = 1 g/m<sup>3</sup> and Qcarb = 2 m3/d is selected as the best trade-off solution between environmental and operational costs compared with the DO default control and DO + NO control schemes. The analysis of the dynamic behavior in the weekly and bimonthly time scales, including the effect of variations of ammonium set-point SNHSP and Qcarb, allows us to determine how control actions and influent variables affects environmental indicators in different temporal windows. The analysis makes it possible to determine the temporal windows where different control actions can be applied to improve the environmental indicators. Thus, different combinations of ammonium set-points and a fixed sequence of changes of carbon dosage Qcarb have been evaluated to find the combination of control actions in the operational period that produce a positive effect on environmental and operation costs, preserving the desired performance. The sequence of control movements on SNHSP and Qcarb is presented in Figure 10.

**Figure 10.** Ammonium set-point SNHSP (g/m3) and Qcarb (m3/d) variations considered as alternative control actions.

From the analysis of dynamic behavior (weekly and bimonthly profiles), a period between the 3rd and 4th bimesters has been detected where influent conditions and low temperature affects negatively the indicators of emissions to water: Ntot, SNH concentration and EQI. As shown in Figure 10, strict ammonium set-point SNHSP = 1 g/m<sup>3</sup> and default Qcarb = 2 g/m<sup>3</sup> are maintained between weeks 17 and 37, where these effects are notorious, and the three different ammonium set-points (1, 4 and 6 g/m3) are considered for the rest of the operation period. A fixed sequence of movements of Qcarb is applied, in the first 6 weeks where low Ntot and SNH levels are observed with the different ammonium set-points (Figure 8) carbon dosage is reduced to Qcarb = 1 g/m3, in between weeks 7 and 9 the minimum values of Ntot and SNH are attained, then carbon dosage is cut, it is increased to Qcarb = 2 g/m3 between weeks 17 and 37, and it is finally reduced to Qcarb = 1 g/m<sup>3</sup> in the last weeks when Ntot and SNH levels

decrease. The combination of the sequence of different ammonium set-points and given sequence for carbon dosage, produce three different strategies named: SNHSP = 1 Qcarb var, SNHSP = 4 Qcarb var and SNHSP = 6 Qcarb var. The weekly and bimonthly dynamic profiles of the different environmental indicators affected by the aforementioned strategies are shown in Figures A1–A3 in Appendix A. From the observation of weekly and bimonthly profiles of environmental indicators, the changes that produce a positive effect detected in a specific temporal window are selected to produce a strategy named SNHSP var Qcarb var, that combines the sequence of SNHSP changes and Qcarb changes presented in Figure 10. Those changes are SNHSP = 6 g/m<sup>3</sup> between weeks 1 and 8 where SNH levels are the minimum, improvement attained with stricter ammonium set-point is not significant, but electricity consumption can be reduced by increasing SNHSP, SNHSP = 4 g/m3 between weeks 8 and 16 and weeks 38 to 53 to reduce electricity consumption and attain acceptable levels of SNH and SNHSP = 1 g/m3 between weeks 17 to 37 where treatment is difficult due to load and temperature effect. The proposed strategies are summarized in Table 12.



SNHSP: Ammonium set-point, Qcarb carbon dosage.

It is important to mention that the control decisions described above have been motivated by the observation of situations on specific periods of time (weeks or bimesters) on dynamic profiles, that can be changed to improve environmental performance. These situations could not be detected by a traditional analysis of annual average environmental indicators.

The performance of SNHSP var Qcarb var strategy is compared with the Cascade SNHSP scheme with SNHSP = 1 g/m3. First, weekly and bimonthly profiles of environmental indicators are obtained and compared to observe the temporal windows where environmental indicators are affected by the proposed strategy. Afterwards, the two alternative strategies are compared with DO default scheme, that is the usual control strategy implemented in WWTPs, considering the annual average values of environmental indicators and operating costs to evaluate the global improvement of the control actions determined after the dynamic analysis of behavior.

Figure 11 shows the weekly and bimonthly profile for electricity consumption, Figure 12 shows the bimonthly profiles of the indicators of biogas and sludge production, and Figure 13 the weekly and bimonthly profile for CO2 emissions. In Figure 11 it is observed that weekly and bimonthly profiles of the proposed SNHSP var Qcarb var strategy attains lower values than Cascade SNHSP scheme in the full operation horizon except for the period between weeks 17 and 37, where identical control actions are applied, and profiles coincide. The reduction of electricity consumption obtained with the SNHSP var Qcarb var strategy is 4.7% and 3.1% in the 1st and 2nd bimesters and 3.8% and 4.6% in the 5th and 6th bimesters. A slight reduction of biogas (ranging between 1.4 and 2.2%) and sludge production (only 1%) is achieved with the proposed strategy as observed in Figure 12, where SNHSP var Qcarb var profile is below Cascade SNHSP profile in the full operation period except for the period between weeks 17 and 37. A similar positive effect is observed in Figure 13 for CO2 emissions that are slightly reduced by proposed strategy.

**Figure 11.** Weekly and bimonthly profile for electricity consumption indicator (kW h/m3) with Cascade SNHSP and the alternative strategy.

**Figure 12.** Bimonthly profile for biogas (kg/m3) and sludge production (kg/m3) indicators with Cascade SNHSP and the alternative strategy.

**Figure 13.** Weekly and bimonthly profile for total CO2 emissions (g/m3) indicators with Cascade SNHSP and the alternative strategy.

The weekly and bimonthly profile of the indicators associated with emissions to water (effluent Ntot, SNH and EQI) with the proposed SNHSP var Qcarb var strategy and Cascade SNHSP scheme are presented in Figure 14. The control actions of the proposed scheme produce a negative effect on Ntot, SNH and EQI profiles that are worsened in most of the operation period with respect to the Cascade SNHSP scheme. Considering the first bimester as the worst temporal period, Ntot is worsened up to 8.7% and EQI is increased up to 4.5%, while SNH increases up to 28% in the 2nd bimesters even though the worst situation, identified in the week 18, is still distant from the limit value that is 4 g/m3.

**Figure 14.** Weekly and bimonthly profile for emissions to water indicators Ntot Load/Qin (g/m3), SNH Load/Qin (g/m3) and EQI/Qin (kg/m3) with Cascade SNHSP and the alternative strategy.

The annual average values are presented in Table 13 and the comparison relative to the DO default scheme is presented in Table 14. Despite deterioration of the SNH indicator, that is a consequence of the application of ammonium control with variable DO set-point, SNHSP var Qcarb var strategy and Cascade SNHSP strategy with SNHSP = 1 g/m<sup>3</sup> and Qcarb = 2 g/m<sup>3</sup> produce a significant improvement to the rest of environmental indicators and operation costs in comparison with DO default strategy. The variations of SNHSP and Qcarb in the appropriated temporal windows reduce the use of chemicals, electricity consumption and consequently operation costs, which could compensate the increment in the levels of SNH in the effluent.


**Table 13.** Annual values of environmental indicators and operating costs of BSM2 plant with respect to the volume of treated wastewater with the Cascade SNHSP and proposed alternative strategies.

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


**Table 14.** Comparison of the influence on environmental and cost indicators of alternative strategies' control relative to the default DO control scheme.

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

In order to provide a condensed view of the advantages and disadvantages of the control schemes considered in this work: DO control, DO + NO control, Cascade SNHSP and the proposed modification named SNHSP var Qcarb var., Table 15 summarizes the most important effects of control actions on environmental costs. The consideration of different temporal windows to observe WWTP behavior under different control schemes, on a dynamic influent scenario, have been a useful tool to detect seasonal effects and the influence of control actions performed to maintain the desired operating conditions on environmental indicators. The analysis of weekly and bimonthly dynamic profiles allows us to capture the interactions between control actions and environmental impacts that can be addressed by the opportune adjustment of control variables. The proposed methodology that combines the comprehensive analysis of annual average indicators and the qualitative observation of dynamic profiles allows us to determine the control scheme that produces the best compromise solution between environmental and operation costs. Moreover, the introduction of the analysis of dynamic profiles in the evaluation of the environmental impact of wastewater treatment makes it possible to determine the temporal windows where different control actions that can be applied to improve the environmental indicators. Thus, in this specific case study, the Cascade SNHSP scheme was selected from existing control strategies, and its overall performance has been improved introducing different combinations of ammonium set-points and a sequence of changes of carbon dosage Qcarb.

**Table 15.** Summary of the effect on dynamic evolution of environmental indicators and average operation costs of the three evaluated proportional integral (PI) control schemes (DO control, DO+ NO control, Cascade SNHSP).


As can be observed from Table 15, the minimization of electricity consumption is an expected advantage of control strategies. Electricity consumption is strongly dependent on control actions associated with aeration and pumping performed to deal with frequent and seasonal changes in the influent load. Since, energy consumption is a crucial variable for improving WWTP efficiency, it affects simultaneously the operation costs and environmental costs. So, systematic analysis of its dynamic behavior can be helpful for the decision-making process on WWTPs management. For future work, the available tools that describe aeration system [13] and alternative renewable energy sources [29] can be useful to implement innovative operation strategies oriented to upgrade environmental performance of the plant by applying appropriate energy-management strategies.

On the other hand, behavior of indicators of CO2 emissions and indicators of emissions to water is determined by control actions performed to regulate nitrogen removal process. Some control strategies such as DO control can affect positively all indicators of emissions to water, with the corresponding increase of electricity consumption as indicated in Table 15. The DO+ NO and Cascade SNHSP-based strategies have to deal with the compromise of improving ammonium removal or total nitrogen concentration in the effluent. It is affected also by carbon dosages, that have a significant influence on operation costs. Then, dynamic analysis allows us to detect seasonal effects of influent load and temperature in CO2 emissions, SNH, EQI and Ntot, that cannot be observed in a study based on the evaluation of annual average environmental indicators, carbon dosage Qcarb can be regulated considering the operation periods where it is possible to reduce carbon dosage preserving the desired Ntot vs. SNH compromise in the effluent load.

It is important to mention that the control decisions described above have been motivated by observation of situations during specific periods of time (weeks or bimesters) on dynamic profiles, that can be changed to improve environmental performance. These situations could not be detected by a traditional analysis of annual average environmental indicators. Moreover, the comparison of the annual average indicators provides a global perspective of environmental and economic performance of control strategies in the full operational period. Nevertheless, the analysis of the evolution of environmental indicators considering different temporal windows (weekly and bimonthly) allows us to determine which situations produce such overall result, when this situations occurs, in the case of seasonal variations of influent conditions and, in the case of the interactions between control actions and environmental costs of the treatment in the presence of influent variations.

### **4. Conclusions**

In this paper the assessment of environmental costs of the operation of a WWTP employing three different control strategies (DO control scheme, DO + NO control, Cascade SNHSP) integrating analysis of dynamic performance in different time scales (annual, bimonthly and weekly) has been carried out. The dynamic assessment has been based on environmental indicators classified into the following categories: energy indicators that measure electricity consumption and heating energy, indicators of emissions to air measuring CO2 emissions from the activated sludge process and anaerobic digestion, emissions to soil associated with the production of sludge for disposal and emissions to water indicators associated with total nitrogen concentration in the effluent Ntot, ammonium concentration SNH and pollution to effluent measured with the effluent quality index (EQI).

The analysis of dynamic profiles on different temporal windows makes it possible to identify operation periods where load, temperature effects and control actions have a significant impact on environmental indicators. These effects cannot be detected in a study based on the evaluation of annual average environmental indicators. The analysis of dynamic profiles of environmental indicators considering different time scales allows us to identify the seasonal influent disturbances and periodic variations that affect environmental performance such as seasonal changes of temperature and influent flow rate. This information is useful to take adequate control decisions that improve the environmental performance of the plant in these situations. Moreover, it allows us to capture interactions between control actions and environmental impacts occurring in specific periods of time that can be addressed by the opportune adjustment of control variables.

The observation of the annual average values of environmental indicators and operational costs showed that ammonium-based control (Cascade SNHSP) produces the best compromise solution between environmental and operating cost compared with DO default control and DO + NO control. The analysis of dynamic profiles (weekly and bimonthly) showed that the Cascade SNHSP perform better than the other control schemes in the periods where disturbances on load and seasonal effects

of temperature and influent flow rate affect plant behavior. The ammonium-based control relaxes the requirements on ammonium concentration in the effluent, but reduces energy consumption, CO2 emissions, total nitrogen concentration, and EQI. This is appreciated in the annual-based analysis of environmental performance, but also in the weekly and bimonthly dynamic profiles. The evaluation of the effect of SNH set-point changes and carbon dosage on performance of the Cascade SNHSP scheme allows us to determine the specific temporal windows where these actions produce a positive effect. Thus, a control strategy SNHSP var Qcarb var defined by a sequence of changes on SNHSP and carbon dosage is proposed. The comparison of the proposed strategies with DO default control considering dynamic profiles and annual averages values leads to the conclusion that both alternatives improve environmental performance, but benefits of the Cascade SNHSP scheme are associated with improvement of electricity consumption and emissions to water indicators Ntot and EQI, while the SNHSP var Qcarb var strategy reduces electricity consumption, use of chemicals (reducing external carbon dosage), and operational costs.

**Author Contributions:** Conceptualization, M.M. and R.V.; methodology, M.M.; software, S.R.; formal analysis, M.M. and S.R.; investigation, All authors; writing—original draft preparation, M.M. and S.R.; writing—review and editing, P.V. and M.F.; supervision, R.V. and P.V.; project administration, M.F. All authors have read and agreed to the published version of the manuscript.

**Funding:** The authors wish to thank the support of the Spanish Government through the Ministerio de 662 Economía y Competitividad (MINECO) projects DPI2015-67341-C2-1-R, DPI2016-77271-R also with FEDER funding.

**Acknowledgments:** To the WWTP of Salamanca (Aqualia) for allowing our research group visiting the plant and the IWA Task Group from the Department of Industrial Electrical Engineering and Automation (IEA), Lund University, Sweden (Ulf Jeppsson, Christian Rosen) for the BSM1 models.

**Conflicts of Interest:** The authors declare no conflict of interest.

### **Appendix A**

As shown in Figure 10, strict ammonium set-point SNHSP = 1 g/m3 and default Qcarb = 2 g/m3 are maintained between weeks 17 and 37, and the three different ammonium set-points (1, 4 and 6 g/m3) are considered for the rest of the operational period. A fixed sequence of movements of Qcarb is applied, in the first 6 weeks Qcarb = 1 g/m3, carbon dosage is cut between weeks 7 and 9 and then, it is increased to Qcarb = 2 g/m3 between weeks 17 and 37, to be finally reduced to Qcarb = 1 g/m3 in the last weeks. The combination of the sequence of ammonium set-point changes and carbon dosage variation, produce three different strategies named: SNHSP = 1 Qcarb var, SNHSP = 4 Qcarb var and SNHSP = 6 Qcarb var. The weekly and bimonthly dynamic profiles of the different environmental indicators: electricity consumption, emissions of CO2 and emissions to water affected by the mentioned strategies are shown in Figures A1–A3.

**Figure A1.** Weekly and bimonthly profile for electricity consumption indicator (kW h/m3) with alternative control actions.

**Figure A2.** Weekly and bimonthly profile for total CO2 emissions (g/m3) indicators with alternative control actions.

**Figure A3.** Weekly and bimonthly profile for emissions to water indicators Ntot Load/Qin (g/m3), SNH Load/Qin (g/m3) and EQI/Qin (kg/m3) with alternative control actions.


**Table A1.** Annual values of environmental indicators and operating costs of BSM2 plant with respect to the volume of treated wastewater with alternative strategies.

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

### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
