## 2 Materials and Methods
### Assessment of the GHGs Impact  
Conventional wastewater treatment facilities purify wastewater and reduce water pollution, but they also discharge GHGs into the air through direct emissions, and as they require a considerable amount of energy to process the influent, they also indirectly contribute to the release of GHGs in the atmosphere. Biological wastewater treatment using activated sludge technology removes organic matter and N and P nutrients from wastewater in an effective manner. Comprehensive environmental implications of the WWTP's contribution to GHG emissions have been highlighted in different studies. Greenhouse gas emissions have been identified as a key negative impact of the WWTP operation and have been studied in several works [62; 63; 64]. Other studies offer a complex image of the total environmental impact of a wastewater treatment plant through life cycle assessments [65; 66; 67]. However, no studies have looked at the environmental impact of the wastewater treatment plant when anomalies occur in the process due to sensor fault inappropriate operation. This study emphasizes the differences, with respect to both the environmental impact and the energy costs, between the plant performance when it is operated normally and when its operation is affected by faulty operation of the dissolved oxygen sensor. Overall impact assessment of the WWTP disturbed operation on plant performance was performed using a cumulative performance index composed of three different performance indices: aeration energy (AE), pumping energy (PE) and effluent quality (EQ) [50]. The oxygen mass transfer coefficient of the aerobic bioreactors (\(K_{L}a\)), which is directly related to the airflow rate, is used to compute the aeration energy index, as stated in Equation (12). \[AE=\frac{SO_{sat}}{T\cdot 1.8\cdot 1000}\cdot\int\limits_{0}^{T}\sum\limits_{ aerated\ reactors}V_{bioreactor}\cdot K_{L}a_{i}(t)dt \tag{12}\]  
where \(SO_{sat}\) is the oxygen saturation concentration (mg O\({}_{2}\)/L), \(T\) is the time in days of faulty operation, \(V_{bioreactor}\) represents the volume of the bioreactor (m\({}^{3}\)) and \(K_{L}a_{i}\) is the mass transfer coefficient in the aerated bioreactor \(i\). The pumping energy index is calculated using the flow rates of nitrate recirculation, return-activated sludge recycling and waste, as shown in Equation (13). The energy used for aeration and pumping is computed in kWh per day. The effluent quality index is determined by a weighted sum of total suspended solids (_TSS_), chemical oxygen demand, biochemical oxygen demand (_BOD_), total Kjeldahl nitrogen (_TKN_), and nitrates and nitritesconcentrations in the effluent flow stream, as indicated by Equation (14). The effluent quality is expressed in kilograms of pollutant units per day. \[PE=\frac{1}{T}.\cdot\int\limits_{0}^{T}[0.004\cdot Q_{NR}(t)+0.08\cdot Q_{RAS}(t) +0.05\cdot Q_{waste}(t)]dt \tag{13}\]  
where \(Q_{\text{NR}}\) is the flow rate of the nitrate recirculation (m\({}^{3}\)/day), \(Q_{RAS}\) is the flow rate of the return-activated sludge (m\({}^{3}\)/day) and \(Q_{waste}\) is the flow rate of waste from the secondary settler (m\({}^{3}\)/day). \[EQ=\frac{1}{T\cdot 1000}.\int\limits_{0}^{T}[PU_{TSS}(t)+PU_{COD}(t)+PU_{ BOD}(t)+PU_{TKN}(t)+PU_{NO}(t)]\cdot Q_{effluent}(t)dt \tag{14}\]  
where \(PU_{TSS}\) denotes total suspended solids, \(PU_{COD}\) refers to the chemical oxygen demand and \(PU_{BOD}\) to the biochemical oxygen demand, \(PU_{TKN}\) considers the Total Kjeldahl Nitrogen, \(PU_{NO}\) accounts for the nitrates and nitrites, and \(Q_{effluent}\) is the effluent flow rate. Total GHG emissions generated by the water line of the municipal wastewater treatment plant are composed of both on-site and off-site emissions and consist of CO\({}_{2}\) and N\({}_{2}\)O gases. Besides CO\({}_{2}\), N\({}_{2}\)O is also considered an important contributor to the GHGs, as it has a global warming potential (GWP) of about 265-298 times higher than CO\({}_{2}\), with an average residence time of 100 years [68].