Can a Wastewater Treatment Plant Power Itself? Results from a Novel Biokinetic-Thermodynamic Analysis

: The water–energy nexus (WEN) has become increasingly important due to differences in supply and demand of both commodities. At the center of the WEN is wastewater treatment plants (WWTP), which can consume a signiﬁcant portion of total electricity usage in many developed countries. In this study, a novel multigeneration energy system has been developed to provide an energetically self-sufﬁcient WWTP. This system consists of four major subsystems: an activated sludge process, an anerobic digester, a gas power (Brayton) cycle, and a steam power (Rankine) cycle. Furthermore, a novel secondary compressor has been attached to the Brayton cycle to power aeration in the activated sludge system in order to increase the efﬁciency of the overall system. The energy and exergy efﬁciencies have been investigated by varying several parameters in both WWTP and power cycles. The effect of these parameters (biological oxygen demand, dissolved oxygen level, turbine inlet temperature, compression ratio and preheater temperature) on the self-efﬁciency has also been investigated. It was found here that up to 109% of the wastewater treatment energy demand can be produced using the proposed system. The turbine inlet temperature of the Brayton cycle has the largest effect on self-sufﬁciency of the system. Energy and exergy efﬁciencies of the overall system varied from 35.7% to 46.0% and from 30.6% to 33.55%, respectively.


Introduction
Wastewater treatment has been particularly important for humanity since the Bronze age (CA 3200-1100 BC) although advanced technologies started in the early 1900s [1,2]. The United Nations Educational, Scientific and Cultural Organization published a detailed report in 2020 to illustrate how climate change will affect water scarcity in the coming decades. According to this report, more than 40% of mankind will suffer from water scarcity by 2050 due to climate change and a high increase in population [3].
The priority in wastewater treatment plants (WWTP) has historically been concerned with meeting certain effluent water standards with little concern for energy consumption [4]. Nevertheless, energy efficiency of WWTPs has been an important subject because of their high energy consumption. According to the US Environmental Protection Agency, 3-4% of total electricity use in the US is consumed by drinking water and wastewater systems [5,6]. A relationship between energy and water, the "water-energy nexus", has been the focus of attention worldwide due to climate change, population increase and urbanization [7,8]. While there is a high water demand for power generation, WWTP consume large amounts of electricity in most countries [9]. Since the standards of the effluent discharge is strict in WWTPs, energy consumption to treat wastewater can be quite high [7].
There are several ways to treat wastewater using physical, chemical and biological methods. Activated sludge is a biological wastewater treatment method for a secondary wastewater, and it is the most broadly applied treatment technology for municipal and J 2021, 4 615 industrial wastewater today [10,11]. Aeration is the most important parameter affecting performance of the activated sludge process, and there are two popular aeration devices utilized in the activated sludges process, namely, surface aerators and blowers/compressors. While surface aerators were highly popular until 1990s, blowers and compressors are the leading technology in today's activated sludge applications due to increased reliability and higher efficiency [12]. Here, compressed air is forced through membranes or perforated tubes in order to supply aeration basins with air bubbles, facilitating oxygen transfer from air to wastewater.
The purpose of the aeration process is to transfer oxygen from air to the wastewater so that carbonaceous matter may be consumed by organisms undergoing cellular respiration. Aeration is the most energy consuming process in WWTPs, and consumes 50% to 90% of electricity usage [12]. It is not surprising then that a significant number of studies have been conducted to investigate ways to increase performance of aeration devices [13][14][15]. Since compressors or blowers require external power to run, a different approach is envisioned in this study by adding a secondary compressor (also called "bleed air") to the power cycle so as to eliminate the associated generator inefficiency in the turbine as well as to directly use the shaft power in the Brayton cycle, thereby avoiding motor inefficiency.
In addition to the aforementioned aeration studies, combined heat and power (CHP) systems have been proposed using the biogas generated from anaerobic digestion (AD) process by digesting the activated sludge in WWTPs [16]. Once wastewater is treated in a WWTP, a vast amount of sludge that comes from the primary and secondary treatment processes must be separated from the water, and the disposal of this sludge may represent up to 50% of the total operational cost [17]. There are many different methods to harness the bio-energy in sludge, such as, pyrolysis, gasification, dark fermentation and anaerobic digestion. While gasification converts biomass into a combustible gas mixture-mostly carbon dioxide and hydrogen-anaerobic digestion transforms the volatile suspended solids into biogas [18,19]. Shizas and Bagley [20] claim that the energy potential of a raw wastewater is 9.3 times higher than the required energy to treat it. Appels et al. [17] provide an intensive review to show the potential and principle of the anaerobic digestion of the activated sludge. Another review has been conducted by Shen et al. [21] to show how anaerobic digestion can contribute to WWTPs in the United States as an energy source. The authors claimed that less than 10% of the WWTP in the US produces biogas for beneficial use. Farahbakhsh et al. [22] perform a novel integrated WWTP-CCHP system in order to investigate the performance of the system from the points of view of energy and economy. The authors also introduced a significant number of studies who focus on the integration of CHP on WWTPs. While there are several different approaches to model the CHP system, such as transient simulation using the real gas equation of state [23], the ideal gas law approach is used in this study for simplicity.
Biogas is the final production of the AD process, and mainly consists of methane and carbon dioxide. Since methane has a high lower heating value, it is one of the most common fuels in CHP systems. Self-sufficiency (sometimes called net zero) energy models for WWTP have been an interesting topic as of late, with several studies investigating whether WWTPs can produce enough power to treat the wastewater itself; some claim that this is indeed possible [24][25][26][27][28]. While challenges and opportunities toward net-zero WWTP have been discussed by Shen et al. [21], several self-sufficient full-scale WWTP with AD of sewage sludge have been illustrated. The authors performed a case study and found that 126% of a WWTP's electricity demand can be met from the WWTP-CHP system. Schwarzenbeck et al. [25] claim that a WWTP in Germany produced 113% of the electricity consumed for plant operations in 2005 using a gas engine. Nowak et al. [27] analyzed two WWTPs in Austria whether the plants can be self-sufficient. The authors found that 180% energy generation compared to energy needs is possible in these two plants using a biogas powered CHP system.
A theoretical net zero energy (NZE) model has been created by Peng et al. [29] to investigate the self-sufficiency of 20 WWTPs in China. The authors implemented CHP systems to each WWTP, and they claim that while 6 of the WWTPs can produce excess energy than required, eight of the WWTPs may achieve 100% energy self-sufficiency by modifying some parameters. The same model has been used in another study [29] to find the effect of temperature and chemical oxygen demand effect on self-sufficiency. It was found that while the self-sufficiency rate is 43.9% under the existing operation in the WWTP, it can be increased up to 110.6% by optimizing the substrate allocations. In 2011, a 700-kW capacity CHP system is integrated into Sheboygan Regional WWTP to produce power for the plant. The WWTP currently generates between 90 and 115% of electricity need in the plant as well as 90% of heating energy on-site [28].
Second law (exergy) analysis has been a common method to investigate energy conversion systems in order to identify locations and magnitude of exergy losses [30,31]. A theoretical study based on the anaerobic digestion of sewage from WWTP has been conducted by Safari and Dincer [32] in order to investigate the thermodynamic efficiencies of a multigeneration system. The authors obtained overall energy and exergy efficiencies as 63.6% and 40%, respectively. Ozdil et al. [33] conducted a detailed exergy and exergoeconomic analyses of a biogas powered electricity production in a WWTP. The authors found that the highest exergy destruction is obtained in the gas engine and an overall efficiency of 69.1%. Abusoglu et al. [34][35][36] performed several studies so as to investigate exergoeconomic analysis of a municipal WWTP in Gaziantep, Turkey. The authors conducted a very detailed exergy analysis for each subsystem. The exergy efficiencies of the primary, secondary, and overall systems there were found to be 53.4%, 14.8% and 34%, respectively.
In this study, thermodynamic analysis of a novel integrated system in a WWTP is conducted. Sludge, one of the final products of a WWTP, is digested in an anerobic digestor to produce biogas. Then, the produced gas is combusted in a biogas-powered gas turbine cycle in order to generate power. There are two main novelties involved in this study. First, this study incorporates a comprehensive analysis including both biological and thermal parameters for WWTP and cogeneration systems, which has not been done for this system before. Secondly, the proposed system includes a secondary compressor connected to the gas turbine cycle in order to provide required air for aeration in the WWTP at reduced system loss. Since the dominant energy consumers in a WWTP is the aerators, the system analyzed herein has the potential to vastly increase efficiency and reduce associated costs and emissions for WWTP operations.

Model Description
In this study, a mathematical model has been developed in order to investigate a multigeneration system for a wastewater treatment plant using a net-zero energy building model. The proposed system is an integration of wastewater treatment plant with a combined gas-vapor power cycle. Figure 1 indicates the schematic diagram of the proposed system.

WWTP
As can be seen from Figure 1, municipal wastewater first passes a bar screen process to remove large items in order to prevent damage to the equipment in the plant followed by the grit chamber to separate solid organic matter from the wastewater. After that, the suspended solids are removed by sedimentation in the primary clarifier. Since a lower biochemical oxygen demand (BOD) level is required to have a high-quality treated water, a secondary treatment is a must in order to reduce BOD concentration. There are various systems for wastewater treatment, and the most common method-activated sludge-is chosen here. The most crucial part of a WWTP from an energy standpoint is the aeration basin, and this process requires a significant amount of oxygen. A new approach here is applied to provide air to the aeration basins using a compressor which is connected to the gas power cycle in order to remove the generator inefficiency of the gas turbine and any motor inefficiency associated with a fan/blower. In a typical WWTP, the air is provided from a separate compressor or blower. Since the sludge from the secondary clarifier has a high volume because of high water content, a gravity thickener is used to J 2021, 4 617 increase the solid content. The sludge coming from primary and secondary clarifiers are blended in a blending tank, then the mixture is sent to the anerobic digester to stabilize the sludge. Anaerobic digestion is the most common method to stabilize the sludge, and it is a very efficient way to produce biogas [22]. Although biogas contains many different gas components, the biogas can be approximated by assuming a molar fraction of 60% CH 4 and 40% CO 2 [34]. Another product of the anaerobic digestion process is digestate, which is sent to a dewatering process in order to reduce the liquid volume. The final product here is called caked sludge, and it can be used as a fertilizer or gasified for syngas production.

WWTP
As can be seen from Figure 1, municipal wastewater first passes a bar screen process to remove large items in order to prevent damage to the equipment in the plant followed by the grit chamber to separate solid organic matter from the wastewater. After that, the suspended solids are removed by sedimentation in the primary clarifier. Since a lower biochemical oxygen demand (BOD) level is required to have a high-quality treated water, a secondary treatment is a must in order to reduce BOD concentration. There are various systems for wastewater treatment, and the most common method-activated sludge-is chosen here. The most crucial part of a WWTP from an energy standpoint is the aeration basin, and this process requires a significant amount of oxygen. A new approach here is applied to provide air to the aeration basins using a compressor which is connected to the gas power cycle in order to remove the generator inefficiency of the gas turbine and any motor inefficiency associated with a fan/blower. In a typical WWTP, the air is provided from a separate compressor or blower. Since the sludge from the secondary clarifier has a high volume because of high water content, a gravity thickener is used to increase the solid content. The sludge coming from primary and secondary clarifiers are blended in a blending tank, then the mixture is sent to the anerobic digester to stabilize the sludge. Anaerobic digestion is the most common method to stabilize the sludge, and it is a very efficient way to produce biogas [22]. Although biogas contains many different gas components, the biogas can be approximated by assuming a molar fraction of 60% CH4 and 40% CO2 [34]. Another product of the anaerobic digestion process is digestate, which is sent to a dewatering process in order to reduce the liquid volume. The final product here is called caked sludge, and it can be used as a fertilizer or gasified for syngas production.

Cogeneration Power Cycle
The bottom cycle in Figure 1 depicts the schematic diagram of the cogeneration power cycle. The produced biogas from the AD process is used as a fuel in a combustion chamber. Here, air is used as an oxidizer and the air fuel ratio is calculated based on the conditions of a complete combustion operation. The compressed air is heated in a regenerator (HX 1) in order to decrease the heat input requirements for the same power production [37]. Once combustion takes place, high-temperature exhaust gas is expanded in a gas turbine to generate power. Afterwards, exhaust passes through two heat exchangers to increase the temperature of air and steam, respectively. The second heat exchanger (HX 2) is used to combine a Rankine cycle with the Brayton cycle. The final temperature of the exhaust gas is set to a minimum value of 400 K in order to avoid corrosive sulfuric acid formation [38]. As explained before, a secondary compressor is attached to the same shaft in the Brayton cycle in order to provide the required air for aeration purpose in the WWTP, which may be called "bleed air".

Model Analysis
This section addresses the modeling of the proposed system, and it is divided into two subsections, WWTP and CHP, which are modeled on mass and energy balance bases, respectively. A steady state assumption exists for both systems.

WWTP Model
In addition to the mass balance, there are other important parameters to consider such as biochemical oxygen demand (BOD), total suspended solid (TSS) and volatile suspended solid (VSS). Several assumptions have been made to coincide with reasonable estimates and are listed in Table 1. Although many parameters are calculated during system modeling, the volatile suspended solid (VSS) calculation process is explained here since the total VSS is digested in the anaerobic digester. The sources of VSS are from the primary and secondary clarifiers and its calculation is shown in Equation (1).
Here, VSS 4 and VSS 7 indicate the volatile suspended solids from the primary and secondary clarifiers (subscripts correspond to states in Figure 1). The following equation is used to find VSS 4 : Again, all parameters in Equation (2) are defined in Table 1. VSS production from the secondary clarifier is more complex than in the primary clarifier, see Equations (3)-(6).
Here, VSS 5 represents the produced suspended solid in the activated sludge process and can be calculated as shown in Equation (4).
Y obs and S are the observed yield and the soluble BOD concentration in the effluent. Based on the assumption listed in Table 1, S can be calculated as follows: where f b , UBOD and f are the biodegradable TSS ratio, ultimate biological oxygen demand and a constant value to convert UBOD to effluent BOD concentration, respectively. To calculate observed yield, Equation (6) is used.
Y and k d are the biomass conversion factor and decay rate of microorganism, respectively.

Oxygen Transfer
As discussed earlier, oxygen addition is the fundamental process of the activated sludge process. Oxygen transfer requires either compressors or blowers, and they consume the highest amount of power in a WWTP. To calculate oxygen requirement in a WWTP, Equation (7) is used.
Here, OTR f and BOD 5 /BOD L denote the actual oxygen transfer rate at the plant and ratio of 5-day BOD to ultimate carbonaceous BOD, and assumed to be 0.68 [40]. While in some sources [39] BOD 5 /BOD L were not taken into consideration, it is in some others [40]. For completeness, this study takes this parameter into consideration and follows [40] for actual oxygen transfer rate calculations. Due to the fact that aerators, blowers and compressors are used to provide oxygen to the activated sludge process, the standard oxygen transfer rate (SOTR) must be calculated using additional parameters as shown below [39]: Details and assumed values for various parameters in Equation (8) are seen in Table 2.

Power Requirement
As can be seen from Figure 1, bleed air will be used to provide required air from Compressor 1. There are two different ways to calculate the required power for adiabatic compression, the first is shown below [39]: where w is the air flow rate and calculated as follows: where E denotes the oxygen transfer efficiency, assumed to be 0.25 [39]. The assumptions from [39] are made and listed in Table 3 for power requirement calculations. However, there is a simpler method to calculate the required power once the air is assumed to be an ideal gas. If the mass flow rate, temperature and pressure of the air is known before and after compression, enthalpy of the streams can be found, hence the power requirement for the compressor.
While aeration consumes the most power, anaerobic digestion heating is the second largest power consumer in a CHP-WWTP. In order for mesophilic anaerobic digestion to take place, a temperature range between 30 and 40 • C is required; it is assumed to be 35 • C in this study [41,42]. In order to calculate the heat requirement for the digestion process, Equation (12) is used: Here C P,sludge represents the specific heat of sludge, and it is assumed to be equal to specific heat of water as 95% of the sludge contains water. Since there is not enough data to calculate the total plant power requirement, and the sum of aeration and anaerobic digestion heat requirement consumes about 72% of the WWTP [43], the below equation is used to estimate the total power requirement for the WWTP.

Exergy Analysis
Here, both physical and chemical exergy of the WWTP must be taken into consideration since sewage has a high potential in terms of chemical exergy. An expression has been claimed by Tai et al. [44] so as to calculate the specific chemical exergy of sewage using COD concentration as expressed in the following equation: The BOD 5 values in the influent and effluent are 375 mg/L and 20 mg/L [39], COD values are 661.32 mg/L and 64.37 mg/L [34], respectively. Sludge is one of the final products of a WWTP, and the exergy of the sludge can be calculated as follows [34,45]: Here, z, h evap , ex CH and β are the mass fractions of each component, enthalpy of water vaporization, specific chemical exergy of each component and atomic ratio, respectively.
An expression for β is as follows when the oxygen to carbon ratio is lower than 0.5 [45]: Here, C, H, O, N, S, and ash represent the molar fractions of the carbon, hydrogen, oxygen, nitrogen, sulfur, and ash of a dried sludge in a municipal WWTP, and their molar fractions are 50, 2.5, 12.5, 1.1, 0.4, 10, respectively [34,39,46]. The last process of the WWTP is the anaerobic digestion, and the chemical exergy for the produced gas mixture is calculated as follows: While x i represent the molar fraction of any component in the biogas mixture, ex 0,CH i denote specific chemical exergy of each component in the biogas mixture at the reference state. Once all calculations have been completed, energy and exergy efficiencies of the WWTP part can be calculated using Equations (18) and (19), respectively.

Thermal Modeling
The first and second laws of thermodynamic analyses have been performed for the proposed system. Engineering Equation Solver (EES) is used for the calculations of both energy and exergy efficiencies. While evaluating the thermal modeling, the following assumptions have been made based on the references [38,42,47,48].

•
A steady state condition has been assumed for all processes; • Air and combustion products treated according to the ideal gas mixture law; • The fuel is assumed to be CH 4 , and only volume portion of the methane in the biogas mixture is taken into consideration;

Gas Turbine Cycle
As can be seen from Figure 1, a Brayton cycle with regeneration has been used in the proposed study. This system consists of a compressor, turbine, a combustion chamber and an air preheater. In this study, three variables, the compression ratio of the compressor, the temperature of the preheated air before the combustor chamber and the turbine inlet temperature, are variable and their effect on the efficiencies have been investigated. Details are listed in Tables 4 and 5.  [38,48].

Parameter Unit Range
As mentioned earlier, biogas is the final product of the AD process, and there are many different ways to calculate the mass of produced biogas. The following equation is used to estimate the produced biogas as in [22,39,49]: where GP, VSD, ρ air and ρ r represent the VSS destruction rate in an anaerobic digester, production factor of biogas, density of air and the density ratio of produced gas to the density of air, respectively. Since the biogas contains mainly CH 4 (~60%) and CO 2 (~40%), only CH 4 portion in the biogas is considered here as a fuel. The mass flow rate of the air, which is the oxidizer in the combustion chamber, is calculated based on the combustion model which will be discussed later in the combustion chamber section. Since the temperature, pressure and molar concentration of the air in state 13 are known, enthalpy and entropy values can be determined easily. In order to find the enthalpy value in state 14, the following equation is used.
The isentropic compression of the air in the compressor is stated as [48]: The molar compositions of the components in the air are as given in Section 3.2. Once h 14 is calculated using Equation (21), temperature of the state 14 can be obtained using EES. Now, it is possible to calculate the compressor work using the following equation: where . m air and M air are the mass flow rate and molecular weight of air, respectively. The energy balance for the preheater is as follows: (24) λ is the ratio of molar flow rates of fuel to air, and will be explained in the next section.
The mixture of air and produced biogas from AD is combusted in a combustion chamber.
The molar flow ratio of the air, fuel and products are determined as follows [38]: where . n f , . n a , . n p are the molar flow rates of fuel, air and combustion products, respectively. The chemical equation of the combustion process on a per mole of air basis is described as below [38]: where, Since a heat loss of a 2% of the lower heating value of the fuel is assumed, energy balance for the combustion chamber is as follows [38]: n a h a = 0 (29) or, equivalently, Methane has been used as a fuel here, and its lower heating (LHV) and enthalpy values are 802,361 kj/kmol and −74,872 kj/kmol, respectively [38]. To determine the enthalpy values of the air and combustion products, the ideal gas law mixture principle has been used as shown below: where The pressure drop in the combustion chamber can be calculated as follows: Using the isentropic efficiency of the turbine, the enthalpy value of the exhaust gas from the gas turbine can be determined from the following equation: Since the entropy values of the inlet and outlet of the turbine (s 17s − s 16 = 0) is equal for an isentropic expansion, enthalpy and temperature of the stream 17 can be found. Using energy balance of the gas turbine, the produced power from the gas turbine can be expressed as follows:

Gas Turbine Cycle Exergy Analysis
On the basis of the first and second law of thermodynamics, neglecting kinetic and potential exergy, the total exergy of a stream is calculated including physical and chemical exergies: The energy and exergy efficiencies of the gas turbine cycle is expressed as the following equations.

Rankine Cycle
As explained earlier, the temperature of the leaving exhaust gas from the gas turbine cycle is assumed to be above 400 K. For this reason, a Rankine cycle is used to produce more power, and water has been used here as a working fluid. As can be seen from Figure 1, heat is transferred through a heat exchanger from state 20 to 21. Then, the superheated steam is expanded to produce power. The assumptions made for the Rankine cycle are listed in Table 6. Table 6. Constant values for the Rankine cycle [37].

Parameter Unit Range
Steam Turbine inlet temperature, T 21 • C 500 Steam Turbine inlet pressure, P 21 Bar 30 Condenser pressure, P 22 Bar 0.75 Applying energy balance for the heat recovery steam generator (HX2) assuming no heat loss to ambient, the mass flow rate of the water in the Rankine cycle can be calculated as shown below: .
To calculate energy and exergy efficiencies of the Rankine cycle for each component, the following equations are used: where W p is the pump power. To calculate the power production from the steam turbine, Equation (44) is used.
Now, energy and exergy efficiencies of the Rankine cycle can be calculated as follows: Once the calculations have been determined for both gas turbine and Rankine cycles, the efficiencies of the cogeneration system are expressed as follows including the compressor work due to WWTP aeration:

Overall Efficiencies
In the proposed multigeneration system, the useful outputs are considered to be the power production from the gas turbine and Rankine cycle, treated wastewater, and digested sludge. The inputs to the overall system are the influent sewage in the WWTP as well as the required power in the WWTP. The overall energy and exergy efficiencies of the overall system are expressed as follows: As explained earlier, the main purpose of this study is to determine whether the proposed cogeneration system can produce sufficient power to treat wastewater for a specified effluent standard. So as to examine this self-sufficiency of the proposed system, the following equation has been used, which represents the ratio of produced power from the cogeneration cycle to the sum of the power requirement of wastewater treatment and cogeneration system.

Results
In this section, a base and a parametric study have been performed varying a significant number of variables in order to investigate the performance of the wastewater treatment plant, and combined gas-vapor cycle from the point of view of first and second law efficiencies. In addition, power requirement for the WWTP, including the power requirement of aeration and heat requirement for anaerobic digestion, is evaluated for different scenarios.

Case Study
A case study has been conducted here using data from a well-known study [39]. Furthermore, several parameters listed in Table 7 are varied to calculate the efficiencies of each system as well as power requirement for the WWTP. Before starting the discussion of energy and exergy efficiencies of each subsystem, energy transfer rate, exergy destruction rate and exergy efficiencies for Brayton cycle components have been listed in Table 8. It is obvious from the table that the highest energy transfer and exergy destruction take place in the combustion chamber due to a high entropy generation during the combustion process. Furthermore, heat exchanger II is found to have the second highest exergy destruction rate due to a high heat transfer from exhaust gas to the Rankine cycle. Exergy efficiencies of the Brayton cycle components varied from 55.9% to 92.9%. Heat exchanger I and compressor II have been found to have the lowest and highest exergy efficiencies, respectively.  Figure 2 indicates the energy and exergy efficiencies of each subsystem. As can be seen, overall energy and exergy efficiencies for the case study are found to be 41.2% and 32.2%, respectively. While energy and exergy efficiencies are 28.96% and 28.19% for the Brayton cycle, they are 28.41% and 68.44% for the Rankine cycle. Since chemical exergy is quite high in the influent of the wastewater, exergy efficiency is higher than energy efficiency in WWTP. Figure 2b illustrates the power requirement for aeration and the total for the WWTP as well as the power production from both Brayton and Rankine cycles. Also, while a power of 219.5 kW is produced from the cogeneration system, a total power of 226.1 kW is required for the WWTP. Hence, it can be said that 97% of the total energy requirement of the WWTP can be provided using the multigeneration system. Table 9 indicates the thermodynamic properties of each stream including mass flow rate, pressure, temperature, enthalpy, specific entropy and total specific exergy for the case study.
In the following section, a parametric study has been conducted varying important variables for both WWTP, and cogeneration systems. While biological oxygen demand in the effluent and dissolved oxygen level in the WWTP varied, turbine inlet temperature, compression ratio as well as air preheater temperature changed for the cogeneration system. The variables have been listed in Table 7.
Brayton cycle, they are 28.41% and 68.44% for the Rankine cycle. Since chemical exergy is quite high in the influent of the wastewater, exergy efficiency is higher than energy efficiency in WWTP. Figure 2b illustrates the power requirement for aeration and the total for the WWTP as well as the power production from both Brayton and Rankine cycles. Also, while a power of 219.5 kW is produced from the cogeneration system, a total power of 226.1 kW is required for the WWTP. Hence, it can be said that 97% of the total energy requirement of the WWTP can be provided using the multigeneration system.  Table 9 indicates the thermodynamic properties of each stream including mass flow rate, pressure, temperature, enthalpy, specific entropy and total specific exergy for the case study.   Since activated sludge is chosen here as a treatment method, the two important variables of this process, total effluent BOD and DO level, are varied in order to investigate the soluble BOD in the effluent, standard oxygen transfer rate (SOTR), total power requirement for the multigeneration system, and energy and exergy efficiencies of each subsequent system. While the BOD e is varied from 15 to 25 mg/L, DO concentration is changed from 2 to 4 mg/L. As Riffat [50] stated, a minimum DO concentration of 2 mg/L is required in order for most aquatic plants and animals to survive. Furthermore, game fish and other higher life-forms require 4 mg/L or more for survival [50]. For this reason, a minimum level of 2 mg/L DO level is chosen for most calculations. Figure 3a shows the variation of S e and SOTR with changing BOD e . It is not surprising that, S e increased from 1.4 to 11.4 mg/L when BOD e is increased from 15 mg/L to 25 mg/L. As can be seen from Equation (5), the soluble BOD (S e ) depends on only total effluent BOD in the effluent and the BOD in the suspended solid; hence, there is a linear relation between BOD e and S e . Figure 3a also shows the standard transfer oxygen rate with changing BOD e . Since higher BOD e results in lower quality treated water, oxygen requirement will decrease when the BOD e is higher; hence, S e is higher. SOTR decreased from 396 to 380 kg/h when BOD e is changed from 15 to 25 mg/L.
Since activated sludge is chosen here as a treatment method, the two important variables of this process, total effluent BOD and DO level, are varied in order to investigate the soluble BOD in the effluent, standard oxygen transfer rate (SOTR), total power requirement for the multigeneration system, and energy and exergy efficiencies of each subsequent system. While the BODe is varied from 15 to 25 mg/L, DO concentration is changed from 2 to 4 mg/L. As Riffat [50] stated, a minimum DO concentration of 2 mg/L is required in order for most aquatic plants and animals to survive. Furthermore, game fish and other higher life-forms require 4 mg/L or more for survival [50]. For this reason, a minimum level of 2 mg/L DO level is chosen for most calculations. Figure 3a shows the variation of Se and SOTR with changing BODe. It is not surprising that, Se increased from 1.4 to 11.4 mg/L when BODe is increased from 15 mg/L to 25 mg/L. As can be seen from Equation (5), the soluble BOD (Se) depends on only total effluent BOD in the effluent and the BOD in the suspended solid; hence, there is a linear relation between BODe and Se. Figure 3a also shows the standard transfer oxygen rate with changing BODe. Since higher BODe results in lower quality treated water, oxygen requirement will decrease when the BODe is higher; hence, Se is higher. SOTR decreased from 396 to 380 kg/h when BODe is changed from 15 to 25 mg/L.   As discussed earlier, aeration shares the highest portion of power requirement in a WWTP. Figure 3b shows the power requirement for the entire WWTP, including the power requirement for aeration. As is obvious from the graph, there is an inverse relation between BODe and power requirement since SOTR is lower when BODe is higher. Power production using the cogeneration system, also indicated in Figure 3b, and the power production decreased with increasing BODe since the amount of produced biogas is lower when the BODe is higher. It is found here that about 108% of the required power in WWTP can be produced using the proposed cogeneration system (see Figure 3c). However, it should be noted that DO level in this case is 2 mg/L, which is the lowest acceptable concentration in a WWTP. More detailed analysis varying the DO level is discussed in the next section.
Energy and exergy efficiencies of the WWTP and overall system have been indicated in Figure 3c. A change in the BODe level did not show a high influence on the thermodynamic efficiencies. While the energy efficiency of the WWTP varied from 43.18% to 43.55% in the WWTP, overall energy efficiency increased from 44.92% to 43.55% when the BODe level is varied from 15 to 25 mg/L. As mentioned earlier, more power can be produced 14   As discussed earlier, aeration shares the highest portion of power requirement in a WWTP. Figure 3b shows the power requirement for the entire WWTP, including the power requirement for aeration. As is obvious from the graph, there is an inverse relation between BOD e and power requirement since SOTR is lower when BOD e is higher. Power production using the cogeneration system, also indicated in Figure 3b, and the power production decreased with increasing BOD e since the amount of produced biogas is lower when the BOD e is higher. It is found here that about 108% of the required power in WWTP can be produced using the proposed cogeneration system (see Figure 3c). However, it should be noted that DO level in this case is 2 mg/L, which is the lowest acceptable concentration in a WWTP. More detailed analysis varying the DO level is discussed in the next section.
Energy and exergy efficiencies of the WWTP and overall system have been indicated in Figure 3c. A change in the BOD e level did not show a high influence on the thermodynamic efficiencies. While the energy efficiency of the WWTP varied from 43.18% to 43.55% in the WWTP, overall energy efficiency increased from 44.92% to 43.55% when the BOD e level is varied from 15 to 25 mg/L. As mentioned earlier, more power can be produced than required for WWTP using the activated sludge as shown in Figure 3c. The self-sufficiency ratio (SSR) varied from 106.2% to 108.1% for the given BOD e range.

Dissolved Oxygen Concentration
A detailed parametric study has been carried out to investigate the effect of DO concentration on the thermodynamic efficiencies and oxygen requirement. The BOD e level is assumed to be constant at 20 mg/L in this case. Looking at Figure 4a, standard oxygen transfer rate (SOTR) variation with DO concentration is quite obvious. When the DO concentration increased from 2 to 4 mg/L, SOTR jumps from 388 to 555 kg/h. The increment is about 43%, and SOTR is fundamentally dependent on DO concentration. An increase in the DO level causes a substantial increase in aeration power requirement; hence total power requirement for the WWTP. As obvious from the Figure 4b that, while the required power for aeration increased from 87 to 124 kW, the total WWTP power requirement increased from 204 to 256 klW when the DO concentration varied from 2 to 4 mg/L. Since DO level does not have an effect on the biogas production rate, produced power from the cogeneration system will be constant at 219 kW for this case. Therefore, the energy efficiencies of WWTP and overall will decrease with DO level increment. While the energy efficiency of WWTP decreased from 43.4% to 40.5%, overall energy efficiency decreased from 45.3% to 35.7% when the DO concentration is varied from 2 to 4 mg/L. As considered earlier, DO level has a significant effect on the total power requirement because of a higher oxygen requirement. As shown in Figure 4b, self-sufficiency ratio decreased from 107% to 85% when the DO concentration increased from 2 to 4 mg/L. Therefore, the proposed system is not able to provide its power itself for higher DO concentrations.
J 2021, 4 FOR PEER REVIEW 17 85% when the DO concentration increased from 2 to 4 mg/L. Therefore, the proposed system is not able to provide its power itself for higher DO concentrations.

Parametric Study-Cogeneration Power System
In this section, performance of the proposed cogeneration energy system will be investigated varying the turbine inlet temperature, compression ratio and the preheater temperature in the Brayton cycle. The values of the parameters for the parametric study have been provided in Table 7.

Gas Turbine Inlet Temperature (TIT)
In the literature, the proposed cogeneration energy system is referred to with different names such as integrated biogas-based power generation system [48] and biogas fueled power generation system [47]. In this paper, we refer to the proposed system as cogeneration (cog) power system. Based on literature the turbine inlet temperature should not exceed 1277 °C [38]. For this reason, the inlet temperature in this study is varied from 700 to 1200 °C. Except TIT, all other parameters are assumed to be constant for both Bray-

Parametric Study-Cogeneration Power System
In this section, performance of the proposed cogeneration energy system will be investigated varying the turbine inlet temperature, compression ratio and the preheater temperature in the Brayton cycle. The values of the parameters for the parametric study have been provided in Table 7.

Gas Turbine Inlet Temperature (TIT)
In the literature, the proposed cogeneration energy system is referred to with different names such as integrated biogas-based power generation system [48] and biogas fueled power generation system [47]. In this paper, we refer to the proposed system as cogeneration (cog) power system. Based on literature the turbine inlet temperature should not exceed 1277 • C [38]. For this reason, the inlet temperature in this study is varied from 700 to 1200 • C. Except TIT, all other parameters are assumed to be constant for both Brayton and Rankine cycle as shown in Table 7 for the base study except the DO level, which is assumed to be 2 mg/L. Figure 5 indicates the effect of TIT on the air to fuel ratio and the exhaust gas mass flow rate. As seen, exhaust gas mass flow rate decreases with increasing the TIT since fuel mass flow rate will be constant and the air fuel ratio will be lower when TIT is higher. While air fuel ratio decreases from 72 to 26, exhaust gas mass flow rate decreases from 1.27 to 0.46 kg/s when TIT varies from 700 to 1200 • C. vestigated varying the turbine inlet temperature, compression ratio and the preheater temperature in the Brayton cycle. The values of the parameters for the parametric study have been provided in Table 7. 4.3.1. Gas Turbine Inlet Temperature (TIT) In the literature, the proposed cogeneration energy system is referred to with different names such as integrated biogas-based power generation system [48] and biogas fueled power generation system [47]. In this paper, we refer to the proposed system as cogeneration (cog) power system. Based on literature the turbine inlet temperature should not exceed 1277 °C [38]. For this reason, the inlet temperature in this study is varied from 700 to 1200 °C. Except TIT, all other parameters are assumed to be constant for both Brayton and Rankine cycle as shown in Table 7 for the base study except the DO level, which is assumed to be 2 mg/L. Figure 5 indicates the effect of TIT on the air to fuel ratio and the exhaust gas mass flow rate. As seen, exhaust gas mass flow rate decreases with increasing the TIT since fuel mass flow rate will be constant and the air fuel ratio will be lower when TIT is higher. While air fuel ratio decreases from 72 to 26, exhaust gas mass flow rate decreases from 1.27 to 0.46 kg/s when TIT varies from 700 to 1200 °C.  TIT effect is one of the most important factors in evaluating the performance of Brayton cycles. While Figure 6a shows the variation of the mass flow rates of air and combustion products in the Brayton cycle and water in the Rankine cycle, Figure 6b shows the variation of power generation from Brayton cycle, Rankine cycle and the total power production of this integrated system as well as the self-sufficiency ratio. While mass flow rate of the exhaust gas decreases with increasing TIT, mass flow rate of the water in the Rankine cycle increases because more heat is transferred in HX2 when TIT is higher, as seen in Figure 6a. Although there is a tremendous decrease in the exhaust gas mass flow rate, net powers from Brayton and Rankine cycles increase because of higher TIT. Despite the fact that the unit power production from Rankine cycle does not change when the TIT varies, the mass flow rate of working fluid in the Rankine cycle increases with increasing TIT, as shown in Figure 6a. Hence, the net power production increment in the Rankine cycle is not surprising. Since BOD e and DO levels are kept constant here, the total power requirement for the WWTP is calculated to be 204.8 kW. As can be seen from Figure 6b, a total power of 219.5 kW can be produced from the cogeneration system when the TIT is 1200 • C. However, it should be noted that the self-sufficiency ratio varies from 76.6% to 107.2% when TIT changes from 700 • C to 1200 • C. Therefore, it can be said that TIT has the highest effect on the self-sufficiency of the proposed system.
Energy and exergy efficiency change of cogeneration and overall systems with TIT variation have been illustrated in Figure 7a,b, respectively. While energy and exergy efficiencies of WWTP are 28.4% and 68.4%, the efficiencies for Rankine cycles are 43.3% and 53.2%, respectively. Since the efficiency of the WWTP and Rankine cycle did not change with TIT variation, they were not included to the graphs. Whereas energy efficiency of the cogeneration system increased from 14% to 27%, it increased from 36% to 45% for the overall system when TIT varied from 700 to 1200 • C. The reason behind of these increments can be explained by increase on the power generation from both Brayton and Rankine cycles. Exergy efficiencies of the cogeneration system increased from 14% to 26% due to exergy destruction reduction in the Brayton cycle.
TIT, as shown in Figure 6a. Hence, the net power production increment in the Rankine cycle is not surprising. Since BODe and DO levels are kept constant here, the total power requirement for the WWTP is calculated to be 204.8 kW. As can be seen from Figure 6b, a total power of 219.5 kW can be produced from the cogeneration system when the TIT is 1200 °C. However, it should be noted that the self-sufficiency ratio varies from 76.6% to 107.2% when TIT changes from 700 °C to 1200 °C. Therefore, it can be said that TIT has the highest effect on the self-sufficiency of the proposed system. Energy and exergy efficiency change of cogeneration and overall systems with TIT variation have been illustrated in Figure 7a,b, respectively. While energy and exergy efficiencies of WWTP are 28.4% and 68.4%, the efficiencies for Rankine cycles are 43.3% and 53.2%, respectively. Since the efficiency of the WWTP and Rankine cycle did not change with TIT variation, they were not included to the graphs. Whereas energy efficiency of the cogeneration system increased from 14% to 27%, it increased from 36% to 45% for the overall system when TIT varied from 700 to 1200 °C. The reason behind of these increments can be explained by increase on the power generation from both Brayton and Rankine cycles. Exergy efficiencies of the cogeneration system increased from 14% to 26% due to exergy destruction reduction in the Brayton cycle.

Compression Ratio (Rp)
Compression ratio effect on the efficiencies and power production is investigated here. As shown in Table 7, TIT and air preheater temperature is assumed to be constant here; hence AF is constant. Figure 8a,b show energy and exergy efficiencies of the Brayton cycle, cogeneration system as well as overall system. While energy efficiency of the cogeneration system increased from 18% to 27%, the overall system energy efficiency increased from 39.6% to 45.6% when compression ratio is varied from 3 to 15. The main reason for the energy efficiency increment can be explained by increase in power production with higher compression ratios. As can be seen from Figure 8c, while the Brayton cycle is able to produce 144.9 kW of power, the Rankine cycle produces 76.9 kW when the compression ratio is set to 15. It is obvious from this figure that when the compression ratio is lower, the power production from the Rankine cycle is higher due to the fact that the turbine outlet temperature of the exhaust gas is too high; hence more heat is transferred from Brayton cycle to Rankine cycle. Therefore, the mass flow rate of the working fluid in the Rankine cycle is too high. Self-sufficiency ratio is also shown in Figure 8c, and it is varied from 86% to 108% when compression ratio is changed from 3 to 15.

Compression Ratio (R p )
Compression ratio effect on the efficiencies and power production is investigated here. As shown in Table 7, TIT and air preheater temperature is assumed to be constant here; hence AF is constant. Figure 8a,b show energy and exergy efficiencies of the Brayton cycle, cogeneration system as well as overall system. While energy efficiency of the cogeneration system increased from 18% to 27%, the overall system energy efficiency increased from 39.6% to 45.6% when compression ratio is varied from 3 to 15. The main reason for the energy efficiency increment can be explained by increase in power production with higher compression ratios. As can be seen from Figure 8c, while the Brayton cycle is able to produce 144.9 kW of power, the Rankine cycle produces 76.9 kW when the compression ratio is set to 15. It is obvious from this figure that when the compression ratio is lower, the power production from the Rankine cycle is higher due to the fact that the turbine outlet temperature of the exhaust gas is too high; hence more heat is transferred from Brayton cycle to Rankine cycle. Therefore, the mass flow rate of the working fluid in the Rankine cycle is too high. Self-sufficiency ratio is also shown in Figure 8c, and it is varied from 86% to 108% when compression ratio is changed from 3 to 15. to produce 144.9 kW of power, the Rankine cycle produces 76.9 kW when the compression ratio is set to 15. It is obvious from this figure that when the compression ratio is lower, the power production from the Rankine cycle is higher due to the fact that the turbine outlet temperature of the exhaust gas is too high; hence more heat is transferred from Brayton cycle to Rankine cycle. Therefore, the mass flow rate of the working fluid in the Rankine cycle is too high. Self-sufficiency ratio is also shown in Figure 8c, and it is varied from 86% to 108% when compression ratio is changed from 3 to 15.

Preheater Temperature
In a gas turbine cycle, regeneration plays an important role in order to increase the temperature of the air entering to the combustion chamber. As shown in Figure 9a, the exhaust mass flow rate increases with increasing preheater temperature since more air is consumed for a constant fuel amount in the combustor as the temperature difference between the inlet and outlet of the combustion chamber is lower for higher preheater temperature. Figure 9b indicates the power production from Brayton and Rankine cycles. While the Brayton cycle is able to produce more power when the preheater temperature is increased, the Rankine cycle power production tends to decrease due to a decrease in the working fluid mass flow rate. Obviously, this decrement is a result of temperature drop in the turbine outlet exhaust gas. Energy and exergy efficiencies are shown in Figure  9c,d, and it can be said that the change in the overall efficiencies with preheater temperature variation are very small. While Brayton cycle energy and exergy efficiencies vary from 28.1% to 30.5% and 27.4 % to 29.7%, cogeneration energy and exergy efficiencies change from 26.7% to 28.1% and from 26% to 27.3%, respectively.

Preheater Temperature
In a gas turbine cycle, regeneration plays an important role in order to increase the temperature of the air entering to the combustion chamber. As shown in Figure 9a, the exhaust mass flow rate increases with increasing preheater temperature since more air is consumed for a constant fuel amount in the combustor as the temperature difference between the inlet and outlet of the combustion chamber is lower for higher preheater temperature. Figure 9b indicates the power production from Brayton and Rankine cycles. While the Brayton cycle is able to produce more power when the preheater temperature is increased, the Rankine cycle power production tends to decrease due to a decrease in the working fluid mass flow rate. Obviously, this decrement is a result of temperature drop in the turbine outlet exhaust gas. Energy and exergy efficiencies are shown in Figure 9c,d, and it can be said that the change in the overall efficiencies with preheater temperature variation are very small. While Brayton cycle energy and exergy efficiencies vary from 28.1% to 30.5% and 27.4 % to 29.7%, cogeneration energy and exergy efficiencies change from 26.7% to 28.1% and from 26% to 27.3%, respectively. is increased, the Rankine cycle power production tends to decrease due to a decrease in the working fluid mass flow rate. Obviously, this decrement is a result of temperature drop in the turbine outlet exhaust gas. Energy and exergy efficiencies are shown in Figure  9c,d, and it can be said that the change in the overall efficiencies with preheater temperature variation are very small. While Brayton cycle energy and exergy efficiencies vary from 28.1% to 30.5% and 27.4 % to 29.7%, cogeneration energy and exergy efficiencies change from 26.7% to 28 (c) (d) Figure 9. Combustor inlet temperature effect on: (a) air fuel ratio and exhaust gas mass flow rate, (b) power production, and self-sufficiency ratio (total required power for the WWTP is 184.3 kW), (c) Energy Efficiency, (d) Exergy Efficiency.

Conclusions
In this paper, a theoretical thermodynamic study has been conducted to investigate the self-sufficiency of a WWTP from the standpoint of energy. A novel multigeneration system has been developed by adding a secondary compressor to the combined gas-vapor cycle to provide air for the WWTP aeration as well as eliminate the generator efficiency in the gas turbine. The energy and exergy efficiency variations with several parameters for both WWTP and power cycles are investigated. The key findings in this study are:

•
While energy efficiency of the overall system varied from 35.7% to 46.0, exergy efficiency changed from 30.6% to 33.55%; • The highest efficiencies were obtained for a turbine inlet temperature, air preheater temperature, compression ratio, effluent biological oxygen demand and dissolved oxygen level of 1200 °C, 427 °C, 10, 20 mg/L and 2 mg/L, respectively; • Self-sufficiency ratio varied between 76.6% to 109.4%. Hence, a self-sufficient system is possible using the proposed multigeneration system; • Self-sufficiency ratio can be increased by 42% and 12.7% by choosing the optimal parameters compared to the least efficient system and case study, respectively; • While an increase in the desired effluent BOD result in an increase in the oxygen requirement, a small increase in the desired DO level cause a tremendous rise in the oxygen requirement; • Similarly, while efficiencies do not change considerably varying effluent BOD, the self-sufficiency ratio varies from 85% to 107% when the DO level is varied. Therefore, the proposed system is found to be self-sufficient when the DO level is lower than 3 mg/L;  Figure 9. Combustor inlet temperature effect on: (a) air fuel ratio and exhaust gas mass flow rate, (b) power production, and self-sufficiency ratio (total required power for the WWTP is 184.3 kW), (c) Energy Efficiency, (d) Exergy Efficiency.

Conclusions
In this paper, a theoretical thermodynamic study has been conducted to investigate the self-sufficiency of a WWTP from the standpoint of energy. A novel multigeneration system has been developed by adding a secondary compressor to the combined gas-vapor cycle to provide air for the WWTP aeration as well as eliminate the generator efficiency in the gas turbine. The energy and exergy efficiency variations with several parameters for both WWTP and power cycles are investigated. The key findings in this study are:

•
While energy efficiency of the overall system varied from 35.7% to 46.0, exergy efficiency changed from 30.6% to 33.55%; • The highest efficiencies were obtained for a turbine inlet temperature, air preheater temperature, compression ratio, effluent biological oxygen demand and dissolved oxygen level of 1200 • C, 427 • C, 10, 20 mg/L and 2 mg/L, respectively; • Self-sufficiency ratio varied between 76.6% to 109.4%. Hence, a self-sufficient system is possible using the proposed multigeneration system; • Self-sufficiency ratio can be increased by 42% and 12.7% by choosing the optimal parameters compared to the least efficient system and case study, respectively; • While an increase in the desired effluent BOD result in an increase in the oxygen requirement, a small increase in the desired DO level cause a tremendous rise in the oxygen requirement; • Similarly, while efficiencies do not change considerably varying effluent BOD, the self-sufficiency ratio varies from 85% to 107% when the DO level is varied. Therefore, the proposed system is found to be self-sufficient when the DO level is lower than 3 mg/L; • A power production increase of up to 52.9% can be realized by integrating a Rankine cycle into the Brayton cycle for lower compression ratios; • While turbine inlet temperature and DO level are found to be the most dominant decision variables for self-sufficiency ratio variations, desired effluent BOD and air preheater temperature are found to be the least dominant parameters; • While the most important factor on the self-sufficiency ratio is found to be turbine inlet temperature, DO concentration also has a high effect on the self-sufficiency ratio since it has the highest effect on the required power for aeration process.
In the future, different power cycle models with increased complexity will be investigated to increase the self-sufficiency of the WWTP, with the goal of providing energy back to the grid at an increased rate including lifecycle assessment and cost analysis. Additionally, since bio-energy from WWTPs are considered a renewable resource, the authors plan to incorporate carbon capture from exhaust streams, which could possibly result in WWTPs becoming not only self-sufficient but also negative carbon emitters. The authors concede that many simplifying assumptions have been made, especially for subsystem components (e.g., ideal gases, adiabatic processes, ideal turbine in the Rankine cycle, etc.). However, the proposed model does obtain results very close to some analytical [38,39] and numerical studies [34], and may serve as a very reasonable first approach to modeling and analyzing self-sufficiency of WWTPs.

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