Numerical Investigation for Power Generation by Microbial Fuel Cells Treating Municipal Wastewater in Guelph, Canada

: Significant research endeavors have focused on microbial fuel cell (MFC) systems within wastewater treatment protocols owing to their unique capacity to convert chemical energy from waste into electricity while maintaining minimal nutrient concentrations in the effluent. While prior studies predominantly relied on empirical investigations, there remains a need to explore modeling and simulation approaches. Assessing MFC systems’ performance and power generation based on real wastewater data is pivotal for their practical implementation. To address this, a MATLAB model is developed to elucidate how MFC parameters and constraints influence system performance and enhance wastewater treatment efficiency. Leveraging actual wastewater data from a municipal plant in Guelph, Canada, six sets of MFC models are employed to examine the relationship between power generation and six distinct parameters (inflow velocity, membrane thickness, internal resistance, anode surface area, feed concentration, and hydraulic retention time). Based on these analyses, the final model projects a total power generation of 50,515.16 kW for the entire wastewater treatment plant in a day, capable of supporting approximately 2530 one-person households. Furthermore, the model demonstrates a notably higher chemical oxygen demand (COD) removal rate (75%) compared to the Guelph WWTP. This comprehensive model serves as a valuable tool for future simulations in similar wastewater treatment plants, providing insights for optimizing performance and aiding in practical applications.


Introduction 1.Research Motivation
Against the backdrop of economic advancement and the swift pace of urbanization, concerns about water sanitation have emerged as fundamental requirements for humanity and the environment on a global scale.Wastewater treatment remains an essential priority that is not solely limited to developing nations; instead, it stands as a fundamental requirement for safeguarding the environment and preserving the integrity of water bodies, which serve as vital sources of drinking water across the globe.The contamination of ground and surface water bodies contributes significantly to the primary origins of wastewater.Given the rapid strides in industrialization, more than the prevailing approach to wastewater treatment is needed to cater to the escalating demands for water sanitation.Additionally, the existing technologies for wastewater treatment confront substantial hurdles in terms of excessive expenses and energy consumption.
The energy demand for wastewater treatment varies between 0.5 and 2 kWh per cubic meter (kWh•m −3 ), contingent on factors such as the treatment method and the wastewater composition.It is worth noting that the energy content within wastewater is approximately three to ten times higher than the energy needed for its treatment [1].The energy present in domestic wastewater can be categorized into two types: chemical energy and thermal energy.Chemical energy, constituting approximately 26% of the total, exists in the form of carbon (measured as chemical oxygen demand, COD) as well as nutrient compounds such as nitrogen (N) and phosphorous (P).Through harnessing this latent chemical energy, the wastewater treatment process can be transformed from an energy-consuming endeavor into one that generates energy or operates independently in terms of energy, while mitigating environmental pollution [1].
In light of the imperative for sustainability and economic viability, microbial fuel cells (MFCs) have garnered substantial attention within the scientific community as a more viable solution for addressing wastewater treatment challenges [1].Compared to traditional active sludge wastewater treatment processes, MFCs have a higher conversion efficiency from substrates to energy and a higher volume reduction [2].Moreover, a higher recovery rate of value-added products such as silver (Ag) or chromium (Cr) and lower GHG emissions also increases the sustainability of the wastewater treatment process using MFCs [3][4][5].
A fuel cell represents an electrochemical apparatus that directly transforms the inherent chemical energy within its reactants (fuel and oxidant) into electrical energy.Unlike batteries, a fuel cell operates as an energy converter, capable of generating continuous electric energy output, provided that the fuel and oxidant are consistently supplied in principle [6].Like other fuel cells, MFCs can transfer chemical energy from wastewater into electricity by oxidizing carbohydrates to carbon dioxide (CO 2 ) and allowing biochemical reduction to transport electrons [7].Electrons and protons are generated in MFCs due to the degradation of substrates on the anode side.These electrons and protons are then transported through a resistor and a membrane to the cathode, reacting with oxygen to produce electricity [8,9].
The Guelph Water Resource Recovery Centre, previously known as the Wastewater Treatment Plant (WWTP), is managed by the Wastewater Services Division of the City of Guelph, Ontario, Canada.This center is responsible for treating various types of wastewater, including domestic, commercial, institutional, and industrial wastewater, from both the City of Guelph and the nearby Township of Guelph/Eramosa [10].The average total daily flow for 2022 was 50.651MLD based on the annual report.This study aims to investigate the power generation potential via MFCs treating municipal wastewater in the City of Guelph.In the following sections, the basics of MFCs treating wastewater are first introduced, and the actual wastewater data of the City of Guelph is analyzed using the activated sludge model number 1 (ASM1) model.Next, major factors influencing the power generation of the MFC are investigated by numerical experiments.Finally, an optimal model is developed to simulate the potential power generation and COD removal rate for the actual wastewater treatment plant in Guelph, Canada.

Current Wastewater Treatment Method
The direct discharge of wastewater from diverse sources, including domestic, agricultural, and industrial facilities, is the primary driver behind various adverse environmental effects.These impacts encompass issues like the eutrophication of surface waters, hypoxia, and the proliferation of algal blooms that disrupt potential drinking water supplies.Existing wastewater treatment methods are resource intensive, both in terms of energy and chemicals.They necessitate substantial investments but do not yield any revenue.The energy requirements for wastewater treatment processes range from 0.5 to 2 kWh per cubic meter (kWh•m −3 ) of treated wastewater, especially for removing carbon and a portion of nitrogen [1].During treatment, significant quantities of greenhouse gases like carbon dioxide (CO 2 ) and nitrous oxide (N 2 O), along with other volatile substances, are released into the atmosphere.Additionally, this process generates excess sludge that demands further disposal measures.For instance, the production of every kilowatt-hour (kWh) of electricity produces 0.9 kg of CO 2 .Furthermore, considering the treatment of 1000 tons of wastewater, around 1500 tons of greenhouse gases are emitted [1].
In many parts of the world, the activated sludge process is the most commonly used method for treating wastewater.This process is efficient and fast, but it has its downsides.It demands significant amounts of chemicals and energy, making its setup and maintenance costly.For instance, a substantial portion (up to 75%) of the energy expenses in a wastewater treatment plant is due to the need for aeration.Moreover, the handling and disposing of the leftover sludge can account for about 60% of the overall operational costs [11].On the flip side, anaerobic treatment has been found to be applicable in treating concentrated industrial wastewater and excess sludge from wastewater treatment plants.This technique has been honed over time, effectively treating wastewater and generating valuable bioenergy.In the past, wastewater treatment mainly aimed to ensure that the released water met specific cleanliness standards (by eliminating elements like carbon and nutrients) and that the remaining sludge could be safely used on land.However, given the concerns about dwindling fossil fuels, environmental pollution, and the scarcity of resources, including water, there is a significant drive to discover more sustainable approaches to wastewater treatment and utilization.As a result, the design and operation of wastewater treatment systems are evolving.The emphasis is shifting from simply eliminating pollutants to finding methods to recover resources from the wastewater, minimizing energy usage, and even gaining some energy benefits from the process [12].

Microbial Fuel Cell
Compared to other wastewater treatment methods, microbial fuel cells present a range of advantages across various fronts.They provide energy benefits such as direct electricity generation and energy savings through anaerobic treatment that eliminate the need for aeration.MFCs also offer low sludge production and can be applied in centralized and decentralized systems.From an environmental perspective, MFCs contribute to water reclamation, have a minimal carbon footprint, and produce lower volumes of sludge for disposal.On the economic front, they generate revenue through energy production and the creation of value-added products like chemicals.MFCs also exhibit cost-effective operation by reducing operational expenses and eliminating the need for downstream processes.Moreover, they come with operational merits, including the self-generation of microorganisms, strong resilience against environmental stressors, and suitability for real-time monitoring and control [13].MFCs generate electricity directly from organic substances in wastewater, eliminating the need to separate, purify, or convert energy byproducts.In contrast, processes like anaerobic digestion produce methane and hydrogen, but these need to undergo separation and purification before they can be effectively utilized; in this case, MFCs stand out as environmentally friendly solutions because they produce clean electricity directly [14].
An MFC comprises three main components: an anode, a proton exchange membrane (PEM), and a cathode.The anode and cathode are linked by an electric wire to establish a circuit.Within MFCs, the microbes in the anode chamber produce protons, which are then transported through the PEM to the cathode chamber, where they combine with oxygen.Regardless of the fuel cell type, anodes need to be constructed from materials that are both environmentally safe, resistant to fouling, and capable of efficiently conducting electrons [13,15,16].
Electrons and protons generated through microbial metabolism within the anodic chamber embark on a journey to the cathode chamber, combining with oxygen to produce water.Alternatively, mediators or shuttle systems can facilitate electron transfer to the anode [17].This transfer can occur through direct membrane transport, or nanowires synthesized by bacteria.Chemical mediators can be introduced to MFCs to enable bacterial electricity production, although specific systems operate without such mediators [17].
MFC devices transform chemical energy into electrical energy via the oxidation of carbon and other organic substances with the assistance of Electrochemically Active Bacteria (EABs).The predominant microbial participants in MFCs often encompass the Geobacter and Shewanella species [17,18].Moreover, photosynthetic bacteria, including efficient candidates like Anabaena and Nostoc, find utility in MFC operation.Notably, mixed microbial cultures sourced from various environments-from domestic and industrial wastewater to marine, lake, and pond sediments and anaerobic sludge-have been harnessed within MFCs for their biocatalytic prowess [19].
A proton exchange membrane acts as a separator between the two electrodes in a fuel cell, the anode and cathode.Not only does this membrane facilitate the transport of ions from the anode to the cathode, enabling the reactions within the fuel cell to proceed [20], but it also has a unique function in MFCs, which is to prevent the migration of waste substances metabolized at the anode from reaching the cathode.This membrane shields the cathode from fouling and ensures that the reactions at the cathode are not disrupted [20,21].The proton exchange membrane is made from various unique materials, such as biopolymers and carbon sheets produced from activated carbon, making it semi-permeable.To avoid biofouling by microorganisms in wastewater, the membrane is fabricated using sulfonated graphene oxide and polyvinylidene fluoride [22].
Cathodes use electrons and ions from the anode to sustain the cell reaction.In microbial fuel cells, cathodes typically do not have microorganisms, except in cases where methane production is the goal and methanogens are introduced near the cathode [15].The cathode plays a crucial role in the microbial fuel cell, as the reactions occurring at this electrode determine the energy output [23].These reactions depend on an oxidant, usually oxygen or air, which is supplied to the cathode compartment to facilitate the reaction and utilize the products generated at the anode [15].Figure 1 shows the basic setup of a microbial fuel cell.
efficient candidates like Anabaena and Nostoc, find utility in MFC operation.Notably, mixed microbial cultures sourced from various environments-from domestic and industrial wastewater to marine, lake, and pond sediments and anaerobic sludge-have been harnessed within MFCs for their biocatalytic prowess [19].
A proton exchange membrane acts as a separator between the two electrodes in a fuel cell, the anode and cathode.Not only does this membrane facilitate the transport of ions from the anode to the cathode, enabling the reactions within the fuel cell to proceed [20], but it also has a unique function in MFCs, which is to prevent the migration of waste substances metabolized at the anode from reaching the cathode.This membrane shields the cathode from fouling and ensures that the reactions at the cathode are not disrupted [20,21].The proton exchange membrane is made from various unique materials, such as biopolymers and carbon sheets produced from activated carbon, making it semi-permeable.To avoid biofouling by microorganisms in wastewater, the membrane is fabricated using sulfonated graphene oxide and polyvinylidene fluoride [22].
Cathodes use electrons and ions from the anode to sustain the cell reaction.In microbial fuel cells, cathodes typically do not have microorganisms, except in cases where methane production is the goal and methanogens are introduced near the cathode [15].The cathode plays a crucial role in the microbial fuel cell, as the reactions occurring at this electrode determine the energy output [23].These reactions depend on an oxidant, usually oxygen or air, which is supplied to the cathode compartment to facilitate the reaction and utilize the products generated at the anode [15].Figure 1 shows the basic setup of a microbial fuel cell.MFC is a tool for generating electrical energy from organic matter using the catabolic activity of microorganisms.At the anode, organic matter is oxidized by electrochemically active microorganisms and releases electrons [24].The generated electrons are then transferred to the cathode through an external circuit and generate electricity.Many models are designed for MFC, but they can be roughly divided into two categories: double-chamber and single-chamber [25].

Modeling
To model an MFC in the wastewater treatment process, both MFCs structure and wastewater conditions need to be considered since the output of the MFCs depends not only on the internal condition of the MFC but also on the wastewater properties [26].Six parameters, including inflow velocity (Qs), membrane thickness (Lf), MFCs internal MFC is a tool for generating electrical energy from organic matter using the catabolic activity of microorganisms.At the anode, organic matter is oxidized by electrochemically active microorganisms and releases electrons [24].The generated electrons are then transferred to the cathode through an external circuit and generate electricity.Many models are designed for MFC, but they can be roughly divided into two categories: double-chamber and single-chamber [25].

Modeling
To model an MFC in the wastewater treatment process, both MFCs structure and wastewater conditions need to be considered since the output of the MFCs depends not only on the internal condition of the MFC but also on the wastewater properties [26].Six parameters, including inflow velocity (Q s ), membrane thickness (L f ), MFCs internal resistance (Ω), hydraulic retention time (HRT), anode surface area, and feed concentration, were discussed in the study.
The choice of substrates is a pivotal factor in MFC, significantly influencing electricity generation.MFC technology offers the flexibility to employ diverse substrates for enhancing energy production, including both individual compounds and intricate blends derived from organic components found in wastewater.The primary objective of all treatment procedures is to minimize water pollutants, rendering them suitable for both practical use and environmental preservation.
To simplify the simulation of MFCs, it is assumed that wastewater is oxidized in the anode, and a reduction in dissolved oxygen is present in the cathode.In an anode chamber, the chamber is operated under anoxic or anaerobic conditions, where a Monodtype equation is adopted.Based on the wastewater properties of the Guelph WWTP, several compounds are recognized as substrates for MFC.Equations ( 1)-( 3) represent the anode reaction based on different substrates (acetate, butyric, and propionic acid) separately.Equation ( 4) shows the cathode reaction.
Furthermore, since both anode and cathode reactions are electrochemical reactions and are controlled by electrical potential, the Butler-Volmer expression is applied for simulation [27].Moreover, the Nernst-Monod term was used for the rate of microbial reaction Equation ( 5), Equation ( 5) comprises symbols representing various parameters: q max stands for the maximum specific substrate consumption rate (mgCOD•(mgVS•day) −1 ).φ a represents the volume fraction of active bacteria within the biofilm (dimensionless).K SED signifies the half-maximum rate of substrate concentration (mgCOD•cm −3 ).F is the Faraday constant; R stands for the ideal gas constant.T represents the temperature in Kelvin (K).S ED is the concentration of substrate (mgCOD•cm −3 ).
In order to define the maximum voltage under different parameters, the bioelectrochemical kinetics and charge and mass balance of the fuel cell are applied.Compared to the forward reaction, the reverse reaction in MFCs is insignificant, and only the forward reaction will be used in the simulation [28].Equations ( 6) and (7) represent the rate of reaction in the anode and cathode, respectively: where k a and k c are the rate constants of the anode and cathode reaction under standard conditions, η a and η c are the overpotential at the anode and cathode.X represents the concentration of biomass in the anode chamber.In contrast, C a and C o represent the substrate concentration in the anode and the dissolved oxygen concentration in the cathode.K a and K o represent the half velocity rate constant for the substrate and dissolved oxygen, respectively.There are also several constants in the equation: F, the Faraday constant; R, the gas constant; and T, for operating temperature.Moreover, α represents the chargetransfer coefficient of the anode reaction, and β is the charge-transfer coefficient of the cathodic reaction [28].
Equation (8) illustrates the substrate mass balance within the anolyte, while the movement of the substrate to the biofilm is characterized by the alteration in substrate concentration within the bulk of the anolyte: where V anode , A anode S ED,sol and J ED represent the volume of the anode chamber (cm 3 ), the surface area of anode electrode (cm 2 ), concentration of substrate in bulk anolyte (mgCOD•cm −3 ) and flux of substrate entering the biofilm (mgCOD•(cm −2 •day)), respectively [29].
It is also assumed that carbon dioxide and acetate do not diffuse into the membrane, and the gas phase formed by releasing carbon dioxide bubbles is not considered.Therefore, four components in the anode compartment need to be balanced, i.e., substrate, dissolved CO 2 , hydrogen ions, and biomass.In comparison, the cathode compartment has two components, i.e., dissolved oxygen and hydroxide ion.After mass balancing and charge transfer, the current density and the flux of ions transferring the membrane can be simulated [30] by using Equation ( 9) where z n is the charge number of the nth species; N n is the superficial flux of the n th species, and the cell voltage can be simulated by using Equation (10) [28]: where L f and d are the thickness of the membrane and the distance between the electrodes.k m and k s are the conductivities of the membrane and the solution, respectively, and U 0 is the open-circuit voltage.

Data
All analyses in this study are based on the wastewater data from Guelph WWTP.The Guelph WWTP initiates its process with preliminary screening and grit removal, followed by primary treatment through sedimentation.Subsequently, a secondary treatment phase employs conventional and extended activated sludge methods, complemented by a two-stage tertiary treatment involving rotating biological contactors (RBC) and sand filtration.The liquid extracted during dewatering follows a separate treatment procedure, Anammox, designed to lower ammonia concentrations.Before being directed to primary digesters, the waste-activated sludge is compacted.In terms of disinfection, sodium hypochlorite is incorporated into the treated water, and prior to releasing the water into the receiving body, sodium bisulfite is introduced to eliminate chlorine [10].Wastewater enters the facility through two main sanitary trunk sewers and is elevated to the Headworks using Archimedes screw pumps for initial treatment involving screening and grit removal.After the Headworks stage, the flow is divided among four designated plants with capacities of 16,000, 13,000, 13,000, and 22,000 cubic meters per day, respectively [10].The wastewater undergoes primary and secondary treatment through conventional activated sludge processes.Chemical phosphorus removal is accomplished by using a system that injects ferric chloride at two different points.The secondary effluent from Plants 1, 2, and 3 comes together upstream of rotating biological contactors (RBCs), which facilitate ammonia removal through nitrification.For Plant 4, ammonia removal happens during the secondary treatment.Plant 4's secondary effluent is managed based on its flow rate.If the flow rate is below a certain threshold, it is directed to the RBCs.Once the combined flow from Plant 4 and the RBCs reaches a certain point, excess flow from Plant 4 is sent directly to tertiary sand filters.The filtered effluent goes through disinfection using sodium hypochlorite, followed by de-chlorination using sodium bisulfite before being released into the Speed River.The sludge generated in the primary clarifiers is thickened, while waste-activated sludge (WAS) settling in the secondary clarifiers is thickened using a rotating drum thickener (RDT).After thickening, the sludge undergoes anaerobic digestion in primary digesters and then flows to secondary digesters via gravity.The digested sludge is drawn and dewatered from there using belt filter presses [10].
A summary of the raw wastewater inflow data is calculated and shown in Table 1 [10].Connected with the electrochemical reactions, a sequence of biochemical processes involving microbial cells occurs in a suspended state and as an attached biofilm.Given that the MFC model is designed to simulate an anaerobic anode system utilizing a microbial community extracted from an anaerobic wastewater treatment process, the biochemical model is founded on the International Water Association's activated sludge model number 1 (ASM1) [31].This involves the conversion of glucose into short-chain carboxylic acids (such as butyric and propionic acids), followed by the generation of acetate and, subsequently, the process of methanogenesis, including the conversion of hydrogen.Additionally, it is presumed that an electroactive microbial community (X) can oxidize acetate using a mediator as an electron acceptor, thereby contributing to electrical current production [32].By applying the raw wastewater data into ASM1, a more detailed input acid concentration for MFC can be simulated.Table 2 summarizes the detailed input concentration generated by ASM1.Furthermore, building upon the foundational Guelph wastewater treatment plant procedure, a revised schematic integrating an MFC system has been developed, as shown in Figure 2. Following the primary clarification stage, the wastewater stream is directed towards the MFCs system instead of the conventional aeration basins, aimed at enhancing energy efficiency.The study also includes an evaluation of the COD removal rate, comparing the original WWTP process with the newly proposed design incorporating MFCs.The MFC shown in the flowsheet represents the stacked MFC system.
All fixed operating conditions and parameters used during the simulations are listed in Table 3 for the modeling system.Since the electrical conductivity of the aqueous solution (k s ) is not sensitive to the simulation result, k s is assumed based on theoretical data during the simulation and parameters of the capacitances of the anode and cathode.All fixed operating conditions and parameters used during the simulations are listed in Table 3 for the modeling system.Since the electrical conductivity of the aqueous solution (k s ) is not sensitive to the simulation result, k s is assumed based on theoretical data during the simulation and parameters of the capacitances of the anode and cathode.

Parameter Testing
Before simulating the power generation for the wastewater treatment plant, several different pre-tests focusing on different parameters are generated using the MATLAB model to test the model and find the best model to maximize the power output.Moreover, to increase the accuracy of each test, the raw wastewater data applied for the pre-test is only for 1 L. The first test aims to find the relationship between inflow velocity and voltage output.The operational time for MFC is set as a constant of 12 h, and three different velocities are chosen as the variables, Qs equal to 5 mm•s −1 , 10 mm•s −1 and 20 mm•s −1 .
As shown in Figure 3, the maximum voltage output for Qs equal to 20 mm•s −1 is the highest, which is 0.1785 V, while the other two tests only have a maximum voltage output of around 0.173 to 0.174 V. Increased inflow velocities encourage improved mixing of wastewater within the MFC, leading to a more even distribution of substrates across the anode surface.This enhanced mixing prevents localized depletion of substrates, which might otherwise hinder bacterial activity and the production of electrons.It is noteworthy that even though the differences between each simulation case are only around 0.01, this

Parameter Testing
Before simulating the power generation for the wastewater treatment plant, several different pre-tests focusing on different parameters are generated using the MATLAB model to test the model and find the best model to maximize the power output.Moreover, to increase the accuracy of each test, the raw wastewater data applied for the pre-test is only for 1 L. The first test aims to find the relationship between inflow velocity and voltage output.The operational time for MFC is set as a constant of 12 h, and three different velocities are chosen as the variables, Q s equal to 5 mm•s −1 , 10 mm•s −1 and 20 mm•s −1 .
As shown in Figure 3, the maximum voltage output for Q s equal to 20 mm•s −1 is the highest, which is 0.1785 V, while the other two tests only have a maximum voltage output of around 0.173 to 0.174 V. Increased inflow velocities encourage improved mixing of wastewater within the MFC, leading to a more even distribution of substrates across the anode surface.This enhanced mixing prevents localized depletion of substrates, which might otherwise hinder bacterial activity and the production of electrons.It is noteworthy that even though the differences between each simulation case are only around 0.01, this is still a very significant change, as the simulation cases are evaluated on a small scale.The change would become more noticeable and significantly influence the output after applying the full scale of wastewater data.
is still a very significant change, as the simulation cases are evaluated on a small scale.The change would become more noticeable and significantly influence the output after applying the full scale of wastewater data.The second test applies constant Qs of 20 mm•s −1 in the simulation to test the relationship between membrane thickness (Lf) and voltage output.Lf is chosen among 1000 µm, 5000 µm, and 10,000 µm.As shown in Figure 4, both the 1000 µm membrane and 5000 µm membrane lead to the highest voltage output of 0.1786 V, around 0.02 V higher than the 10,000 µm membrane.However, it can be seen that the start-up voltage of the 1000 µm membrane is much higher than the 5000 µm membrane, and it takes the 5000 µm membrane around 5 h to reach the same voltage output level as the 1000 µm membrane.Considering that, in reality, a shorter start-up time significantly increases the efficiency of the MFC system and helps increase the total voltage generation.The second test applies constant Q s of 20 mm•s −1 in the simulation to test the relationship between membrane thickness (L f ) and voltage output.L f is chosen among 1000 µm, 5000 µm, and 10,000 µm.As shown in Figure 4, both the 1000 µm membrane and 5000 µm membrane lead to the highest voltage output of 0.1786 V, around 0.02 V higher than the 10,000 µm membrane.However, it can be seen that the start-up voltage of the 1000 µm membrane is much higher than the 5000 µm membrane, and it takes the 5000 µm membrane around 5 h to reach the same voltage output level as the 1000 µm membrane.Considering that, in reality, a shorter start-up time significantly increases the efficiency of the MFC system and helps increase the total voltage generation.
is still a very significant change, as the simulation cases are evaluated on a small scale.The change would become more noticeable and significantly influence the output after applying the full scale of wastewater data.The second test applies constant Qs of 20 mm•s −1 in the simulation to test the relationship between membrane thickness (Lf) and voltage output.Lf is chosen among 1000 µm, 5000 µm, and 10,000 µm.As shown in Figure 4, both the 1000 µm membrane and 5000 µm membrane lead to the highest voltage output of 0.1786 V, around 0.02 V higher than the 10,000 µm membrane.However, it can be seen that the start-up voltage of the 1000 µm membrane is much higher than the 5000 µm membrane, and it takes the 5000 µm membrane around 5 h to reach the same voltage output level as the 1000 µm membrane.Considering that, in reality, a shorter start-up time significantly increases the efficiency of the MFC system and helps increase the total voltage generation.Pre-test 3 focuses on the internal resistance of the MFC after taking an inflow velocity of 20 mm•s −1 and a membrane thickness of 1000 µm as constants.100 Ω, 1000 Ω, and 10,000 Ω are selected in this test.
The final voltage generation difference between different internal resistances is not as significant as in the previous two tests, as shown in Figure 5.The maximum output ranges from 0.1745 to 0.1787 V, and 100 Ω has the highest voltage output of 0.1787 V.As mentioned previously, the case with the shortest start-up time is chosen to maximize the output when the maximum voltage output is similar.
output when the maximum voltage output is similar.
Test 4 focuses on the relationship between the anode surface area and the voltage output.Increasing the surface area of the anode results in a higher surface area for the biofilm and more active sites available for the reaction.The microorganisms within the biofilm function as chemical sites for the reaction.This test investigated the impact of anode surface area across a range from 1 to 24 cm 2, and the modeling results, in terms of power and power density (power per unit area of the anode electrode surface), for three initial substrate concentrations, are depicted in Figure 6.As illustrated in Figure 6, increasing the anode area increased the generated power.Test 4 focuses on the relationship between the anode surface area and the voltage output.Increasing the surface area of the anode results in a higher surface area for the biofilm and more active sites available for the reaction.The microorganisms within the biofilm function as chemical sites for the reaction.This test investigated the impact of anode surface area across a range from 1 to 24 cm 2, and the modeling results, in terms of power and power density (power per unit area of the anode electrode surface), for three initial substrate concentrations, are depicted in Figure 6.As illustrated in Figure 6, increasing the anode surface area increased the generated power.
Pre-test 3 focuses on the internal resistance of the MFC after taking an inflow velocity of 20 mm•s −1 and a membrane thickness of 1000 µm as constants.100 Ω, 1000 Ω, and 10,000 Ω are selected in this test.
The final voltage generation difference between different internal resistances is not as significant as in the previous two tests, as shown in Figure 5.The maximum output ranges from 0.1745 to 0.1787 V, and 100 Ω has the highest voltage output of 0.1787 V.As mentioned previously, the case with the shortest start-up time is chosen to maximize the output when the maximum voltage output is similar.
Test 4 focuses on the relationship between the anode surface area and the voltage output.Increasing the surface area of the anode results in a higher surface area for the biofilm and more active sites available for the reaction.The microorganisms within the biofilm function as chemical sites for the reaction.This test investigated the impact of anode surface area across a range from 1 to 24 cm 2, and the modeling results, in terms of power and power density (power per unit area of the anode electrode surface), for three initial substrate concentrations, are depicted in Figure 6.As illustrated in Figure 6, increasing the anode surface area increased the generated power.A study to examine how the feed concentration affects the electrical is also conducted.Three different substrates with different initial COD concentrations were examined in this test.According to the data presented in Figure 7, it is evident that feed concentrations in the lower range had a substantial impact on the generated power, specifically, when the feed concentrations were maintained within the lower range, a significant impact on the power output of MFCs was observed.This effect can be attributed to the availability of substrates for microbial metabolism [33].At lower feed concentrations, the availability of organic matter as a substrate for bacterial oxidation may be limited, leading to reduced microbial activity and consequently lower power generation in MFCs.Therefore, maintaining optimal feed concentrations within the lower range is crucial for maximizing the power output and efficiency of MFC systems, as previously observed in studies by Wang et al. [33].However, as the feed concentration increased into the higher range, the influence of feed concentration on power generation decreased.
test.According to the data presented in Figure 7, it is evident that feed concentrations in the lower range had a substantial impact on the generated power, specifically, when the feed concentrations were maintained within the lower range, a significant impact on the power output of MFCs was observed.This effect can be attributed to the availability of substrates for microbial metabolism [33].At lower feed concentrations, the availability of organic matter as a substrate for bacterial oxidation may be limited, leading to reduced microbial activity and consequently lower power generation in MFCs.Therefore, maintaining optimal feed concentrations within the lower range is crucial for maximizing the power output and efficiency of MFC systems, as previously observed in studies by Wang et al. [33].However, as the feed concentration increased into the higher range, the influence of feed concentration on power generation decreased.Three different HRTs were chosen as parallel simulations in Test 6.The cell voltage rises as the hydraulic retention time (HRT) decreases.This is because a shorter HRT boosts microbial fuel cell (MFC) power generation by removing non-exoelectrogenic microorganisms.As these non-exoelectrogens are flushed out, more organic matter becomes available for exoelectrogenic bacteria to utilize in power generation.Conversely, exoelectrogenic bacteria may also be washed away when the HRT is longer, resulting in reduced power generation, as shown in Figure 8. Three different HRTs were chosen as parallel simulations in Test 6.The cell voltage rises as the hydraulic retention time (HRT) decreases.This is because a shorter HRT boosts microbial fuel cell (MFC) power generation by removing non-exoelectrogenic microorganisms.As these non-exoelectrogens are flushed out, more organic matter becomes available for exoelectrogenic bacteria to utilize in power generation.Conversely, exoelectrogenic bacteria may also be washed away when the HRT is longer, resulting in reduced power generation, as shown in Figure 8.

Sensitivity Analysis for Pre-Test Parameters
Sensitivity analysis plays a crucial role in enhancing the accuracy and reliability of mathematical models across various fields.By systematically studying how changes in input parameters affect model outputs, sensitivity analysis helps identify critical factors driving system behavior, quantify uncertainties, validate, and calibrate models effectively.In this case, the sensitivity analysis was applied to each parameter that was simulated in the above section to prove the accuracy and feasibility of the model.
The inflow velocity, representing the rate of fresh feedstock delivery, exerts a significant impact on the availability of substrates crucial for microbial metabolism within the

Sensitivity Analysis for Pre-Test Parameters
Sensitivity analysis plays a crucial role in enhancing the accuracy and reliability of mathematical models across various fields.By systematically studying how changes in input parameters affect model outputs, sensitivity analysis helps identify critical factors driving system behavior, quantify uncertainties, validate, and calibrate models effectively.
In this case, the sensitivity analysis was applied to each parameter that was simulated in the above section to prove the accuracy and feasibility of the model.
The inflow velocity, representing the rate of fresh feedstock delivery, exerts a significant impact on the availability of substrates crucial for microbial metabolism within the MFC, as well as the voltage output.However, after Q s reach a relativity high speed, the impacts on voltage output start to be minimized, as shown in Figure 9A.Conversely, the membrane thickness, a key structural component, governs ion transport and electrochemical reactions, with variations influencing voltage output due to associated diffusion limitations.Furthermore, internal resistance, encompassing ohmic and polarization resistances, intricately regulates electron transfer efficiency within the MFC, with higher resistance invariably leading to diminished voltage output.The anode surface area, serving as the substrate for microbial attachment and electron transfer, directly shapes voltage output by determining the number of active sites available for these processes.

Sensitivity Analysis for Pre-Test Parameters
Sensitivity analysis plays a crucial role in enhancing the accuracy and reliability of mathematical models across various fields.By systematically studying how changes in input parameters affect model outputs, sensitivity analysis helps identify critical factors driving system behavior, quantify uncertainties, validate, and calibrate models effectively.In this case, the sensitivity analysis was applied to each parameter that was simulated in the above section to prove the accuracy and feasibility of the model.
The inflow velocity, representing the rate of fresh feedstock delivery, exerts a significant impact on the availability of substrates crucial for microbial metabolism within the MFC, as well as the voltage output.However, after Qs reach a relativity high speed, the impacts on voltage output start to be minimized, as shown in Figure 9A.Conversely, the membrane thickness, a key structural component, governs ion transport and electrochemical reactions, with variations influencing voltage output due to associated diffusion limitations.Furthermore, internal resistance, encompassing ohmic and polarization resistances, intricately regulates electron transfer efficiency within the MFC, with higher resistance invariably leading to diminished voltage output.The anode surface area, serving as the substrate for microbial attachment and electron transfer, directly shapes voltage output by determining the number of active sites available for these processes.Feed concentration directly affects voltage output in microbial fuel cells (MFCs) by influencing the availability of electron donors and acceptors.Higher concentrations increase microbial activity, enhancing electron transfer processes and voltage generation.However, as shown in Figure 9E, the impact on the voltage output will be negative when the initial concentration is overly high.HRT also negatively impacts voltage output.This Feed concentration directly affects voltage output in microbial fuel cells (MFCs) by influencing the availability of electron donors and acceptors.Higher concentrations increase microbial activity, enhancing electron transfer processes and voltage generation.However, as shown in Figure 9E, the impact on the voltage output will be negative when the initial concentration is overly high.HRT also negatively impacts voltage output.This is because a shorter HRT enhances power generation in microbial fuel cells by eliminating nonexoelectrogenic microorganisms.
Through sensitivity analysis of all model parameters, a comprehensive understanding of their individual contributions to MFC performance was attained.Additionally, testing a wider range of parameter values enhanced the simulation's reliability and feasibility.

Power Generation for Guelph WWTP
After pre-testing of the models, the final model is conducted for the power generation simulation.The model still takes 1 L of the wastewater as the sample, and then the final total power generation is calculated.
The final simulation gives a maximum power generation of 998 mW in 12 h for 1 L of wastewater shown in Figure 10.Since the daily inflow of the wastewater in the treatment plant is 50.651MLD [10], the total power generation for the Guelph wastewater treatment plant could reach 50,515.16kWh per day by implementing testing data into Equation (11).Based on Residential Energy Consumption Survey (RECS) datasets [34], average electricity usage for a one-person home is 20.11 kWh per day, which means by applying MFC to Guelph wastewater treatment plant, the electricity generated in one day can supply around 2530 one-person homes daily electricity usage.
Other than simulating the voltage output using the model, the COD removal rate can be calculated by analysis of the effluent wastewater properties.The effluent concentration for each input component is simulated in ASM1 and MATLAB models to compare the removal efficiency.Figure 11 shows the comparison of effluent concentration between MFCs and Guelph WWTP.Based on Residential Energy Consumption Survey (RECS) datasets [34], average electricity usage for a one-person home is 20.11 kWh per day, which means by applying MFC to Guelph wastewater treatment plant, the electricity generated in one day can supply around 2530 one-person homes daily electricity usage.
Other than simulating the voltage output using the model, the COD removal rate can be calculated by analysis of the effluent wastewater properties.The effluent concentration for each input component is simulated in ASM1 and MATLAB models to compare the removal efficiency.around 2530 one-person homes daily electricity usage.
Other than simulating the voltage output using the model, the COD removal rate can be calculated by analysis of the effluent wastewater properties.The effluent concentration for each input component is simulated in ASM1 and MATLAB to compare the removal efficiency.Figure 11 shows the comparison of effluent concentration between MFCs and Guelph WWTP.

Conclusions
This study investigated how inflow velocity, membrane thickness, internal resistance, anode surface area, feed concentration, and HRT will influence the MFC power generation while treating wastewater at Guelph Wastewater Treatment Plant, Canada.The relationship between inflow velocity and voltage output is found to be in a positive correlation.Membrane thickness has a negative correlation relationship with voltage output.Moreover, the simulation shows that the membrane's thickness will also affect the start-up time due to the resistance changes within the membrane; a thinner membrane leads to a shorter start time, leading to more total power generation in a fixed time period.The internal resistance of the MFC also has a negative correlation with power generation.Expanding the surface area of the anode leads to a greater area for biofilm formation and an increased number of active sites available for the reaction, even with different initial substrate concentrations; voltage generation increases with the expanded anode surface area.Lower feed concentrations significantly affect power generation in MFCs by limiting substrate availability for microbial metabolism, resulting in reduced microbial activity and power output.Moreover, reduced HRT yields enhanced energy generation output, whereas prolonged HRT should be avoided in the operation of microbial fuel cells.
With extensive pre-testing of various parameters under ideal conditions, the most efficient model forecasts a remarkable daily power generation of 50,515.16kWh for the entire wastewater treatment plant, sufficient to sustain approximately 2530 one-person families.Moreover, the model underscores the substantial advantages of microbial fuel cells, or MFCs, showcasing a notably higher chemical oxygen demand (COD) removal rate of 75% compared to the current COD removal rate at the Guelph wastewater treatment plant.The insights gleaned from this model serve as a valuable reference for future simulations of wastewater treatment plants with similar properties, thereby facilitating optimization and enhancing the overall efficiency of waste-to-energy conversion.

Figure 1 .
Figure 1.The basic setup for MFCs.

Figure 1 .
Figure 1.The basic setup for MFCs.

Figure 3 .
Figure 3. Differences in voltage generation with time under different Qs.

Figure 4 .
Figure 4. Differences in voltage generation with time under different Lf.

Figure 3 .
Figure 3. Differences in voltage generation with time under different Q s.

Figure 3 .
Figure 3. Differences in voltage generation with time under different Qs.

Figure 4 .
Figure 4. Differences in voltage generation with time under different Lf.Figure 4. Differences in voltage generation with time under different L f.

Figure 4 .
Figure 4. Differences in voltage generation with time under different Lf.Figure 4. Differences in voltage generation with time under different L f.

Figure 5 .
Figure 5. Differences in voltage generation with time under different internal resistances.

Figure 6 .
Figure 6.Voltage generation performance under different anode surface areas.

Figure 5 .
Figure 5. Differences in voltage generation with time under different internal resistances.

Figure 5 .
Figure 5. Differences in voltage generation with time under different internal resistances.

Figure 6 .
Figure 6.Voltage generation performance under different anode surface areas.Figure 6. Voltage generation performance under different anode surface areas.

Figure 6 .
Figure 6.Voltage generation performance under different anode surface areas.Figure 6. Voltage generation performance under different anode surface areas.

Figure 7 .
Figure 7. Voltage generation performance under different feed concentrations.

Figure 7 .
Figure 7. Voltage generation performance under different feed concentrations.

Figure 9 .
Figure 9. (A) Main effects of the input Qs on the MFC voltage output obtained by the sensitivity analysis.(B) The main effects of the Lf on the MFC voltage output obtained by the sensitivity analysis.(C) The main effects of the internal resistance on the MFC voltage output obtained by the sensitivity analysis.(D) The main effects of the anode surface area on the MFC voltage output were obtained by the sensitivity analysis.(E) The main effects of the feed concentration on the MFC voltage output obtained by the sensitivity analysis.(F) The main effects of the HRT on the MFC voltage output obtained by the sensitivity analysis.

Figure 9 .
Figure 9. (A) Main effects of the input Q s on the MFC voltage output obtained by the sensitivity analysis.(B) The main effects of the Lf on the MFC voltage output obtained by the sensitivity analysis.(C) The main effects of the internal resistance on the MFC voltage output obtained by the sensitivity analysis.(D) The main effects of the anode surface area on the MFC voltage output were obtained by the sensitivity analysis.(E) The main effects of the feed concentration on the MFC voltage output obtained by the sensitivity analysis.(F) The main effects of the HRT on the MFC voltage output obtained by the sensitivity analysis.
Figure 11 shows the comparison of effluent concentration between MFCs and Guelph WWTP.By comparing the effluent component concentration and the influent concentration, the Guelph wastewater treatment plant has a COD removal rate of around 25%.In comparison, MFCs have a COD removal rate of around 75%. (g•L −1 ).

Figure 11 .
Figure 11.Effluent wastewater properties.By comparing the effluent component concentration and the influent concentration, the Guelph wastewater treatment plant has a COD removal rate of around 25%.In comparison, MFCs have a COD removal rate of around 75%. (g•L −1 ).

Table 2 .
ASM1 analysis for the raw wastewater.

Table 3 .
Parameters for model set-up and simulation.

Table 3 .
Parameters for model set-up and simulation.