Modeling and Simulation of a Novel Sustainable Ammonia Production Process From Food Waste and Brown Water

Global demand for both clean energy carriers and agricultural nutrients continues to grow rapidly, alongside increasing quantities of waste globally, interlinked challenges that may be addressed with interlinked solutions. We report on the potential efficiency and Greenhouse Gas (GHG) intensity of several configurations of a new, sustainability-driven ammonia (NH3) production processes to determine whether a waste-based process designed first around carbon dioxide (CO2) capture can compete with other available NH3 technologies. This is assessed via different scenarios: Two hydrogen generating options are paired with four CO2 fates. For either an anaerobic digestion-centered process or a two-stage dark fermentation coupled with anaerobic digestion process, the resultant CO2 may be captured and injected, sold to the marketplace, released directly in the atmosphere, or converted to urea in order to produce a green substitute for synthetic NH3. Modeled yields range from 47 t NH3 when the resultant CO2 is released or captured, or 3.8 t NH3 and 76.5 t urea when the system is designed to produce no unutilized CO2. Among the technologies assessed, NH3 production where CO2 is captured for anaerobic digestion-only is the most efficient for GHG emissions and water consumption, while the two-stage requires less energy on a fertilizer-N basis. GHG emissions for anaerobic digestion-only are approximately 8% lower than the two-stage. The best of the proposed technology configurations consumes about 41% less energy than water electrolysis coupled with Haber-Bosch and approximately 27% lower energy than Steam Methane Reforming (SMR) coupled with Haber-Bosch per kg NH3.


INTRODUCTION
Ammonia is the second most produced chemical compound globally (146 million tonnes reported in 2016) after sulfuric acid (H 2 SO 4 ), with fossil fuels being the main feedstock for its production (CICE, 2016;Soloveichik, 2017) . Due to the important role of NH 3 as a fertilizer in the agricultural industry and its promising prospects as an energy carrier, many studies have recently attempted to find the most environmentally benign, energy efficient, and economically viable production process for NH 3 synthesis.
Ammonia production technologies currently in use require either a steady supply of deionized water in high volumes to operate and/or result in high CO 2 production. The most commonly utilized NH 3 production method is the Haber-Bosch process. The downside of this technology is high GHG emissions, surpassing 2.16 kg CO 2 eq/kg NH 3 and high energy consumption. For the production of 1 t of NH 3 through SMR coupled with Haber-Bosch, 0.66 t H 2 O is utilized and 9-10 t CO 2 eq is produced, over its full life cycle (Parkinson et al., 2018). For producing 1 t of NH 3 through water electrolysis 1.6 t H 2 O is consumed (Will and Lukas, 2018). In order to replace the existing high impact NH 3 technologies currently in use, a new sustainabilitydriven waste-based technology that is competitive for carbon emissions, water use, and power use has been designed around carbon capture/utilization. The design strategy was based on optimizing production while mitigating and valorizing waste and reducing emissions.
Bioconversion of wastes such as food and Human Waste (HW) into important chemical compounds such as NH 3 and urea (CH 4 N 2 O) offers, to some extent, a new resource recovery alternative for fossil-based chemicals. The overabundance of these waste streams poses significant threats for GHG control. Uncontrolled decomposition of organic waste in landfills, if left untreated, leads to the discharge of methane (CH 4 ), a potent GHG trapping approximately 85 times more heat than CO 2 through the first 20 years from when it is discharged. Methane accounts for 20% of the global warming that is currently being experienced (IPCC, 2013;MIT News, 2017). In 2015, the U.S. Environmental Protection Agency (USEPA) reported that the GHG emissions resulting from waste landfills was 115.7 Mt of CO 2 eq (Lee et al., 2017). While in the same year, the UK government reported GHG emissions of waste disposed of in landfills was approximately 18 Mt of CO 2 eq (BEIS, 2017). As shown in Figure 1, the increase in the amount of Food Waste (FW) keeps pace with nutrient N demand and this trend is projected to continue. FW has increased by 40% over the course of the 34 years; while the nutrient N demand has increased approximately 49% over the same time period.
A particular benefit of a waste-based process such as the green NH 3 technology developed here is the potential to avoid CH 4 that could have been released from uncontained degradation of waste. The potential GHG mitigation benefit with the technology depending on how much of the processed waste was diverted from uncontained degradation is illustrated in Figure 2. About 74 kg of CH 4 is released with open degradation of a tonne of food waste comprised of about half vegetable and a quarter meat wastes (Quantis, 2019). If 10% of each tonne of processed food waste resulted from diversion, that would avoid releasing about 7.4 kg CH 4 or 200 kg CO 2 eq; at 50% rescued material that grows to nearly 1 kg of CO 2 eq/kg FW processed and at 90%, almost 1.85 kg CO 2 eq/kg FW would be prevented from directly reaching the atmosphere.
As the population grows the need for more food production leads to the demand for more fertilizers, which results in higher food demands and more HW generation. The projected global population along with the total nitrous oxide (N 2 O) and CH 4 emissions from human sewage and domestic wastewater from 1990-2030 are shown in Figure 3. The amount of HW necessarily increases proportionally with the global population. The amount of HW has increased by approximately 51% over the course of 40 years, while the population growth is approximately 47% over the same time period.
Both FW and HW are rich in readily biodegradable organic matter, therefore they decompose rapidly, and, in addition to their contributions to global GHG balances, may potentially result in other serious environmental implications if not properly managed. FW and HW are readily biodegradable in the environment which indicates their potential in industrial bioconversion. As a result, designing a sustainable waste management process which reduces the GHG emissions such as the utilization of AD will be an effective pathway to target the replacement of higher impact, fossil-based chemicals.
This work describes the results of a study implementing this design strategy, developing a green and viable NH 3 /urea process in order to reduce waste and prevent the release of additional CO 2 (from primarily biogenic sources) into the atmosphere.

Simplified Process Description
In the processes designed and modeled, waste (FW and human faeces) is fed into a two-stage bioreactor, resulting in the production of biogas. Hydrogen (H 2 ) is separated from the gas mixture through a series of operating stages (membranes) and reacts with nitrogen (N 2 ) derived from the migration of air through a membrane, in order to produce NH 3 . The CO 2 recovered along with the NH 3 can be used for urea production (a simplified process flow diagram is shown in Figure 4). This process is compared to the case where the CO 2 is not FIGURE 2 | Carbon dioxide mitigation potential per tonne processed food waste as a function of fraction diverted into various processes instead of landfilling, calculated with WBCSD's Food Loss and Waste Value Calculator (Quantis 2019) with composition of FW (vegetables, meat and fish, fruit, grains, bones and shells, and plastics) selected to assess the avoided emissions throughout this study (food waste composition for South East Asia (Paudel et al., 2017)). captured/utilized, as well as to cases where the CO 2 is captured, compressed, liquefied, and either injected into the ground (Carbon Capture and Sequestration (CCS)) or assumed to enter the commodity liquid CO 2 market (base Carbon Capture and Utilization (CCU)) (scenarios i-iv).

Plant Components Incorporated into the Modeled Process
The core component of this proposed NH 3 production process is waste processing, utilizing either a two-stage Dark Fermentation Bioreactor (DFB) coupled with an Anaerobic Digestion Bioreactor (ADB) or the latter alone. For each component involved in this proposed process a model section will be presented. The modeling components are comprised of: Dark Fermentation (DF), Anaerobic Digestion (AD), Micro Filtration Index (MFI), Electrochemical Membrane Separation (EMS), Ion Transport Membrane (ITM), CH 4 assisted-Solid Oxide Fuel Electrolysis Cell (SOFEC), Solid State Ammonia Synthesis (SSAS), Solid Oxide Fuel Cell (SOFC), and a urea production plant. The description of the plant components is shown in Table 1. A critical analysis of why EMS, ITM, CH 4 assisted-SOFEC, SSAS, and SOFC have been chosen as process components is presented in the study conducted by (Ghavam et al., 2021).
The main components for NH 3 production are H 2 and N 2 . Hydrogen is the output from MFI and CH 4 assisted-SOFEC, while N 2 comes from the ITM. These two components enter the SSAS for NH 3 synthesis.

Incorporating Urea into the Modeled Process
A urea production process is an effective pathway for harnessing the CO 2 that might otherwise have been directly released into the atmosphere. Eventually this CO 2 that is utilized for urea production will be discharged, as a result, incorporating a urea plant cannot solve the carbon emission problem but merely delays it while getting useful services (in this case offsetting FIGURE 4 | A simplified process flow diagram of the proposed ammonia/urea production process. the production of conventional urea, which uses significant fossil resources and results in significant life cycle GHGs). From a low carbon design point of view, which is the aim of this study, offsetting urea production has a greater environmental benefit than releasing the CO 2 directly from the process on a life cycle basis, despite the increase in energy demand. There is a side unwanted reaction during urea synthesis which produces biuret and thus lowers production yields. In order to prevent high biuret formation, a vacuum evaporator is utilized followed by a cooling system. Our aim is to optimize the process for maximum urea purity and to minimize biuret formation.

Significance of Membrane Incorporation in the Modeled Process
Our process is designed around membranes to address the challenges in necessary gas upgrading and purification, reduce the need for external sources of both chemicals and water, while minimizing the physical footprint of the processing units. To obtain the necessary purity level from biogas resulting from waste (food and Brown Water (BW)), the CH 4 stream needs to be upgraded to separate impurities such as CO 2 , hydrogen sulfide (H 2 S) and traces of other compounds. The cost of the available technologies for upgrading biogas such as water scrubbing, Pressure Swing Adsorption (PSA), chemical absorption, cryogenic distillation, amine scrubber, etc. are comparatively high due to energy, water, chemical usage, and large physical footprint, and/or the combination of these factors (Fouladvand, 2016). In place of processing units, such as an amine scrubber, with large physical footprint, an MFI membrane is used for the separation of H 2 and CO 2 from DF. For example, a single MFI module has the same throughput/output as a large, expensive and energy-intensive amine scrubber (Korelskiy et al., 2015).
This proposed process is also designed in order to increase the production of H 2 required for NH 3 synthesis through an environmentally benign, energy efficient, and cost-effective manner. The design objectives have been achieved by utilizing CO 2 for urea synthesis, converting H 2 S into sulfur (S 2 ) and H 2 via a membrane, converting the byproduct of the AD process into compost, utilizing renewable energy sources, and processing units with a low physical footprint for its operation. These processing units include certain types of membranes which reduce the production costs, such as ITM that is used for air separation (Sun et al., 2011).

MODELING APPROACH
The CO 2 emissions, water, and energy usage of this novel process for the production of NH 3 and urea from waste are analyzed computationally. A mathematical model to simulate the performance of the NH 3 production process from codigestion of FW and BW is developed with mass, heat, and energy balance equations. This is implemented in the Visual Basic for Applications (VBA) platform embedded in the Microsoft excel program. The coupled mass and energy balance of this simulated model is assessed under various physical and chemical conditions (temperature, pressure, flow rates, specific heat capacity, porosity, tortuosity, flux, and permeability) and sizing of various processing units (thickness, area, number of tubes, cells, and modules). Assumptions and mathematical equations (mass transfer, energy transfer, thermodynamics, and kinetics) are determined for each processing unit. Since the entire process operates sequentially, the output and the performance of each component affects the input of the other components except for the bioreactors and ITM which are the initial processing units of this proposed process. The modeling framework is comprised of equation-oriented and sequential modular approaches. Through this approach, the components (processing units) are modeled using an equation-based approach in sequence, starting with the AD is a continuous biochemical process in which complex substrates are decomposed and digested via microbial actions and converted into biogas in the absence of O 2 (Pengyu et al., 2017). This transformation takes place through four main steps: Hydrolysis, acidogenesis, acetogenesis, and methanogenesis CH 4 assisted-Solid Oxide Fuel Electrolysis Cell (SOFEC) In the Solid Oxide Fuel Electrolyzer Cell, CH 4 is added to the anode side of the electrolyzer, the decomposition potential (voltage) of H 2 O is decreased, and this results in lower energy usage and a higher conversion ratio of electricity for H 2 production Membrane Filtration Index (MFI) An electrochemical zeolite-based membrane known as Membrane Filtration Index has been incorporated into the system for the separation of H 2 from the H 2 and CO 2 gas mixture feed stream and the entire process flow is treated as a set of mathematical equations which need to be solved simultaneously.
Although there are a variety of different thermodynamic simulators capable of modeling and optimizing different processes, none offer membranes among their standard process functions (Hoorfar et al., 2018). Commercial tools such as AspenPlus ® do not have the option to model the membrane operation, and so it is necessary to program the membranes in Matlab, FORTRAN, VBA, or other programs. VBA enables us to expose direct optimization of membrane parameters.

Assumptions
The results presented here are based on the calculations for 20 tpd of input waste (FW and BW). Although other scaling can be evaluated with the implemented model, this figure is calculated to roughly show the size of a mid-size city such as Bakersfield, California. The main assumptions used in this study are listed in Table 2.

PROCESS DESCRIPTION
This proposed process is assessed through two configurations: Technology-1: Ammonia production through a two-stage DF coupled with AD and Technology-2: Ammonia production through AD-only. Each configuration has four possible CO 2 fates, Scenario i: CO 2 is discharged directly into the atmosphere, Scenario ii: (CCU) CO 2 is utilized for urea production, Scenario iii: (CCS) CO 2 is compressed, liquefied, captured, and injected into the ground, and Scenario iv: (CCU) CO 2 is compressed, liquefied, captured, and enter the commodity liquid CO 2 market. All four scenarios are evaluated for two situations, one where SOFC is used, and one where it is not.
For both technologies (1 and 2) there are four sets of scenarios. The process configuration and computational model behavior change depending on scenario configuration. For scenarios i, ii, and iv all the produced CO 2 is compressed, cooled, and liquefied, then either discharged directly, captured and injected into the ground, or sold commercially. The CH 4 and H 2 resulting from AD/DF are upgraded into pure H 2 for NH 3 synthesis via multiple membrane types (MFI and CH 4 assisted-SOFEC). If the process does not utilize SOFC, the calculation ends at this point. When SOFC is incorporated into the process, the SSAS/ SOFC hydrogen ratio is set, the SOFC calculations are conducted and the ITM, N 2 throughput is attenuated.
For scenario iii the entirety of the CO 2 produced is utilized for urea production and the upgraded H 2 is used for the production of the required NH 3 for urea synthesis. As with the other scenarios, the inclusion of SOFC determines the algorithm from here. If SOFC is incorporated into the process, the SOFC calculations are conducted and the SSAS/SOFC hydrogen ratio is set at this point. In the absence of the SOFC module, the N 2 from ITM is used without attenuation along with the excess H 2 for NH 3 synthesis rather than entering the SOFC module (detailed

1-Process conditions 2-Operational conditions
-The process operates at a steady state condition -The flow in the membrane, fuel cell, and electrolyzer channels are considered as laminar (Reynolds number<2,300) -The composition of gases produced from the DFB is kept fixed at 58.7% H 2 and 41.3% CO 2 -The composition of biogas produced from the ADB is kept fixed at 81.5% CH 4 , 18.47% CO 2 , 0.010 %H 2 S, and traces of other gases -The calculations are based on 10 t of FW and 10 t of BW and 25 t of water for dilution -The input gas flow enters this process at ambient temperature (25 o C) and pressure (1 atm) -The operating pressures and temperatures are applicable to production processes of any size. As a result, once the size of the plant is selected, the flow rates through the plant can be estimated and the processing units can be properly sized, based on the waste composition, substrate concentration, and dilution rate -Solar radiation and effective temperature are neglected -Physical properties of digester, membrane, fuel cell, and electrolyzer material and the hot box material are uniform over the temperature range considered -The temperature of the substrate inside the bioreactor is constant -FW and BW will be fed to the process at temperatures lower than 4 o C -The temperature within the membranes, fuel cell, and electrolyzer is distributed uniformly 1.1 Gas behaviors -Air properties are constant-All gases involved in this production process (H 2 , CO 2 , CH 4 , H 2 S, NH 3 , O 2 , N 2 , H 2 O, CH 4 N 2 O, and NH 4 CO 2 NH 2 ) are considered as ideal gases (PV nRT)-The gas mixtures are assumed well mixed at the molecular level with all components having the similar velocity, pressure, and temperature 1.2 Electrolytic assumptions -Anode and cathode gases are not allowed to crossover-The electronic and ionic conductors are spread evenly and continuously throughout the electrodes-Total reactions take place in the CH 4 assisted-SOFEC and SOFC-99.9% of H 2 produced in this process is diverted into SSAS for NH 3 synthesis and the remainder goes to SOFC 3-Mass and heat transfer -The internal mass transfer resistance between the gas and the membrane surface is negligible -Radiation heat transfer in this process is neglected -The internal heat generation in the two-stage DF and AD is negligible -Heat transfer is linear under steady state condition -The heat transfer coefficient is constant -Heat and mass flows are two-dimensional 4-Material loss -There will be no leakage (material loss) from the process except for CH 4 from the AD, and CO 2 for urea production (NH 3  information on the logical flow diagram is provided in Supplementary Figure S1 in the supplementary materials).

Technology Pathways
Digestion efficiencies in co-digestion of FW and HW are generally higher when urine has been removed (Rajagopal et al., 2014). This separation is done in order to increase the hydrolytic and acidogenic potential of co-digestion of FW and BW (Colón et al., 2015). Moreover, co-digestion of excreta along with other organic compounds enhances the process efficiencies that are prevented by excreta characteristics. General technology structures are shown in Figure 5 (twostage DF coupled with AD and AD-only process). Detailed technology descriptions are as follows.

Technology-1: Process Description of Ammonia Production Through a Two-Stage DF Coupled With AD
Hydrogen is separated from the H 2 and CO 2 gas mixture resulting from DFB by using an MFI. The separated H 2 provides the process with the required H 2 for NH 3 synthesis. The H 2 along with the needed N 2 resulting from the ITM, enters into the SSAS for NH 3 production. The organic acids which are the byproducts of DF are used as the substrate for AD in order to produce biogas which is comprised of CH 4 , CO 2 , and H 2 S. Hydrogen sulfide must be removed from the biogas stream, which is accomplished here using an EMS system. This H 2 S is converted into traces of H 2 and S 2 in the presence of a sweep gas (N 2 ) which is separated via ITM. The CO 2 along with CH 4 is introduced into a CH 4 assisted-SOFEC for H 2 production. Throughout this conversion, CO 2 is also separated from the H 2 stream in this electrolyzer. The H 2 then enters the SSAS, producing NH 3 which is required in the event where urea is required (only for scenario ii). A portion of the H 2 resulting from the CH 4 assisted-SOFEC is fed into a SOFC for generating heat, power, and steam for a part of the process. The NH 3 produced along with the CO 2 resulting from both MFI and CH 4 assisted-SOFEC enter the urea production process or the CO 2 is released directly into the atmosphere (scenario i), captured and injected into the ground (scenario iii) or assumed to enter the commodity liquid CO 2 market (scenario iv).

Technology-2: Process Description of Ammonia Production Through AD-Only
Biogas resulting from AD, needs to be upgraded in order to provide the H 2 required for NH 3 synthesis. The H 2 along with the needed N 2 resulting from the ITM, enters into the SSAS for NH 3 production. Hydrogen sulfide must be removed from the biogas stream, accomplished here using an EMS system. Hydrogen sulfide is converted into traces of H 2 and elemental S 2 in the presence of a sweep gas (N 2 ) which is separated via ITM. The CO 2 along with CH 4 are introduced into a CH 4 assisted-SOFEC for H 2 production. Throughout this conversion, CO 2 is also separated from the H 2 stream in the electrolyzer.
The H 2 along with the N 2 resulting from the separation of air in an ITM then enters the SSAS for producing NH 3 which in turn is required for urea production. A portion of the H 2 resulting from the CH 4 assisted-SOFEC is fed into a SOFC for generating heat, power, and steam for part of the process. The NH 3 produced along with the CO 2 resulting from CH 4 assisted-SOFEC enter the urea production process (only for scenario ii). The CO 2 resulting from the CH 4 assisted-SOFEC can be released directly into the atmosphere (scenario i), captured and injected into the ground (scenario iii) or assumed to enter the commodity liquid CO 2 market (scenario iv).

Energy Flows of Ammonia Production Through a Two-Stage DF Coupled With AD Process
The need for external energy sources is minimized and heat recovery is maximized when the heat integration method is adopted. A heat balance model is presented in Figures 6A,B. for the proposed NH 3 production process. It illustrates the energy flow diagram utilizing heat integration and is divided into three parts I, II, III, and IV described below: I: The process streams are cooled with the input air flow at 25°C before entering the ITM and heated with recirculated steam at about 974.8°C resulting from an external source of water at 920°C which enters a compressor before being used for heating up the process at a steady state condition. The input air enters a compressor in order to reach the desired pressure in the range of 10-30 atm before entering the ITM. This air stream is heated from ambient temperature to 850°C. The separated O 2 is divided into two streams. The first stream enters the SOFC as one of the main feedstocks for its operation. The remaining O 2 passes through the SOFC hot box in order to enter the gas turbine system for power generation. The remaining N 2 is also divided into two streams. The first stream enters the relief valve to reach the pressure of 1 atm and is cooled down with air before entering the SSAS at 80°C. The second stream is also cooled down with air and lowered to 650°C before entering the EMS used as the sweep gas.
II: FW and BW enter the process at 2°C and are heated to 90°C in a mixing tank along with the water for dilution. The mixture is then cooled with air to 55°C in the DFB. The temperature is monitored through the entire process to increase the H 2 produced. The H 2 and CO 2 resulting from DF is compressed and passes through a refrigerator in order to reach a pressure of 20 atm and temperature of −39°C before entering the MFI. The sludge is then pumped into the ADB and is cooled to 35°C.
III: The biogas resulting from the ADB enters a heat exchanger to reach 650°C before entering the EMS. The resulting N 2 + S 2 from the EMS enter a condenser in order to separate N 2 from S 2 . The separated N 2 will then be recirculated back into the EMS as the sweep gas. The remaining biogas stream from the EMS is then heated to 850°C and the steam is cooled to the same temperature (850°C) in order to enter CH 4 assisted-SOFEC for CO 2 separation and H 2 production. The resulting sludge from the ADB passes through a filter press to remove its moisture for producing compost. The reclaimed water is then recycled back into the mixing tank used as the diluted water.
IV: The separated CO 2 from both the MFI and CH 4 assisted-SOFEC are mixed, compressed, and cooled before entering the urea production process at 130 atm and 190°C ( Figure 6A). While for the process without urea production the separated CO 2 is compressed and cooled to 100 atm and 25.1°C before being captured and injected into the ground or sold commercially ( Figure 6B). Simultaneously the separated H 2 from both the MFI and CH 4 assisted-SOFEC is also mixed before entering the SSAS at 80°C and 1 atm. The NH 3 produced from the SSAS is divided into two streams, the first stream enters the urea production process ( Figure 6A). The second stream is compressed to 100 atm, cooled, and finally liquified ( Figure 6B). The remaining H 2 is heated to 1,000°C before entering the SOFC along with the O 2 from the ITM.

Energy Flows of Ammonia Production Through AD-Only Process
A heat balance model for the proposed NH 3 production process demonstrating the energy flow diagram with heat integration is presented in Figures 7A,B. Part I and III have the same energy flows as described above. While part II and IV have different configurations that are described below.
II: The waste stream enters the AD process at 37°C and is cooled to 35°C.
FIGURE 6 | A schematic of the process flow diagram of the proposed ammonia production process through, (A) a two-stage DF coupled with AD with urea production and by incorporating SOFC and (B) a two-stage DF coupled with AD without urea production with CCS and by incorporating SOFC. Frontiers in Energy Research | www.frontiersin.org April 2021 | Volume 9 | Article 600071 9 IV: The separated CO 2 from the CH 4 assisted-SOFEC is mixed, compressed, and cooled before entering the urea production process at 130 atm and 190°C ( Figure 7A). While for the process without urea production, the separated CO 2 is compressed and cooled to 100 atm and 25.1°C before being captured and injected into the ground or sold commercially ( Figure 7B). Simultaneously the separated H 2 from the CH 4 assisted-SOFEC reaches 80°C FIGURE 7 | A schematic of the process flow diagram of the proposed ammonia production process through, (A) AD with urea production and by incorporating SOFC and (B) AD without urea production with CCS and by incorporating SOFC. Frontiers in Energy Research | www.frontiersin.org April 2021 | Volume 9 | Article 600071 10 before entering the SSAS. The NH 3 produced from the SSAS is divided into two streams, the first stream enters the urea production process ( Figure 7A). The second stream is compressed to 100 atm, cooled, and finally liquified ( Figure 7B). The remaining H 2 is heated to 1,000°C before entering the SOFC along with the O 2 from the ITM.

RESULTS AND DISCUSSION
Technology-1: Modeling Results of Ammonia Production Through a Two-Stage DF Coupled with AD Input and output waste compositions to and from DF and AD along with the gas/biogas specifications, yields, and the output composition of H 2 and CO 2 , CH 4 , H 2 S, etc. are presented in the supplementary materials. The composition of the gas stream from DF is based on a H 2 content of 58.7%. If the ratio of H 2 /CO 2 is ≥ 58.7%, the proposed production process produces both steam and power for SOFC, excess NH 3 , and urea. When the ratio of H 2 /CO 2 ≤ 58.7%, the only output product is urea.
The biogas composition from AD is based on a CH 4 content of 81.5%, which is a controllable aspect of the proposed process. If the ratio of CH 4 /CO 2 is ≥ 81.5% the proposed production process produces both steam and power for SOFC, excess NH 3 , and urea. With the ratio of CH 4 /CO 2 ≤ 81.5% the only output product is urea.

Technology-2: Modeling Results of Ammonia Production Through AD-Only
Input and output waste compositions to and from AD along with the biogas specifications, yields, and the output composition of biogas are shown in supplementary materials.
The biogas composition from AD is based on a CH 4 content of 81.5%. If the ratio of CH 4 /CO 2 ≥ 75%, the proposed production process produces both steam and power for SOFC, excess NH 3 , and urea. When the ratio of CH 4 /CO 2 ≤ 75% the only output product is urea.

A. Energy Balance Results of Ammonia Production Through a Two-Stage DF Coupled with AD
The energy draw is driven primarily by the urea production process, which accounts for approximately 93% of the total energy consumed ( Figure 8A). This is followed by the energy loss (6.04 MW), power required for supplying steam (5.2 MW), and driving the impellers. Other energy uses are much smaller; indeed, the next highest energy use is the air compressor (COMP-2) with 1.72 MW. This process is designed with renewable electricity supply (solar/wind).
The energy production and consumption for the two-stage process as shown in Sankey diagram ( Figure 8A) is calculated based on Eqs (2,3).
The required power for running the membranes is carried out using Eq. (1): Where, P is the power (kW), I is the total current (A), (Area× current density), and V the total voltage (E cell ×number of cells).

B. Energy Balance Results of Ammonia Production Through AD-Only
As with the two-stage configuration, urea production is the largest energy user ( Figure 8B), accounting for 85% of the energy draw. This is followed by the power required for driving the impellers (7.11 MW), energy loss (6.85 MW), and power required for supplying steam (2.64 MW) as shown in Figure 8B. Other energy uses are smaller, the next highest energy use is the required power for the EMS with 2.19 MW. The source of this electricity is renewable energy sources (solar/ wind).
The energy draw in this process (AD-only) is about 8% lower than the two-stage due to higher NH 3 production. This is due to higher NH 3 yields driven by increased CO 2 production resulting from the incorporation of DF. With AD-only, the energy draw goes up due to higher H 2 S handling by the EMS when DF is not used.
The energy production and consumption for the AD-only process as shown in Sankey diagram ( Figure 8B) is calculated based on Eqs. (4,5).

Comparison of Total Daily Production and Consumption Results for the Two Technologies and Seven Scenarios
The highest NH 3 yields are obtained from AD, which produces about 6.5 times that of the two-stage process. However, the two-stage process makes more urea in urea-producing configurations. This is due to more CO 2 produced with the incorporation of the DF process. Based on Table 3A, the twostage process consumes less energy and water compared to the AD-only. The AD-only produces about 3.5% less CO 2 compared to the two-stage process. Although all calculations for the proposed process are carried out on the basis of per kg NH 3 produced, a comparison needs to be conducted for per kg-N basis, since in each of the two technologies when using scenario ii, both urea and NH 3 are produced. Table 3B shows the efficiencies of different proposed processes per kg-N basis. The AD-only process is superior to the two-stage in terms of the CO 2 emitted/kg-N with 1.455 compared to 1.571. The water usage/kg-N through AD is lower compared to the twostage except in the case where urea is produced with 0.902 compared to 0.973 for AD process. The energy consumption (MW/kg-N) for the two-stage process is lower than the process with AD except in the case where urea is produced with 5.087 MW compared to 4.961 MW for the AD-only process.

A Comparison of the Proposed Processes with Ammonia Technologies Currently in Use
A comparison of the proposed NH 3 production process with conventional methods (SMR and water electrolysis coupled with Haber-Bosch process) in terms of water usage (kg/tNH 3 ), CO 2 emissions (kg/tNH 3 ), and energy consumption (kW/ tNH 3 ) at steady state condition is shown in Figure 9 (for detailed information see the supplementary materials). This figure shows that the proposed NH 3 process through a two-stage DF coupled with AD both with a and without the incorporation of SOFC is the most efficient in terms of water consumption compared to the other technologies. SMR-Haber-Bosch (H-B) uses 0.66 kgH 2 O/tNH 3 . While the consumption rate for water FIGURE 10 | A comparison of the two proposed technologies for ammonia production in terms of energy consumption, ammonia, and urea produced at different TS of FW and BW in a 20 tpd facility for 1) two stage DF coupled with AD 2) AD-only process. electrolysis is approximately 82% higher than SMR-H-B. In terms of CO 2 emissions, this process is similar to water electrolysis, assuming that both processes are powered by renewable energy sources. However, the energy consumption of water electrolysis is 0.44 kW/tNH 3 which is approximately 15% higher than SMR-H-B and approximately 41% higher than the two-stage process and about 6% lower than the AD-only process.

Carbon Dioxide Mitigation by Diverting Different Fractions of FW into the Modeled Process
Assuming 10%, 33%, 50%, and 100% of the FW is directed into our proposed process instead of degrading openly in landfills, this will prevent the release of about 5,159.06, 17,024.91, 25,795.32, and 51,590.64 kg CO 2 eq respectively from directly reaching the atmosphere, which results from the open decomposition of FW (see Supplementary Figure S4 in Supplementary Materials).

Sensitivity Analysis
The sensitivity analysis studies the dependency in the output of the proposed model (gas and biogas production, output flow rate of NH 3 and urea, number of cells/tubes for membranes, energy demand, water and energy consumption) and the identifiability and significance of the parameters involved (waste compositions, substrate concentrations, input air flow rates, and different dilution ratios). The Total Solid (TS) and Volatile Solid (VS) contents of a substrate affect the functionality of both DF and AD. Changing the TS content of the substrate will result in variations in microbial morphology of DF and AD (Orhorhoro et al., 2017).
Changing the TS of FW and BW for a two-stage DF coupled with AD leads to changes in energy consumption. Sensitivity analysis has been conducted in order to assess how the abovementioned functionalities respond to changes in these and other key parameters, and about how much variability in these streams may matter to the process conditions, yields, and process outputs. By keeping the VS of FW and BW parameters fixed throughout the sensitivity analysis, the following results as shown in Figure 10 were obtained. The energy consumption of the two-stage DF coupled with AD process (1) is approximately 1.7% higher than the AD-only process (2). As the TS of FW and BW goes up, the energy consumption of both processes (1) and (2) drops significantly due to lower gas/biogas production.
Variations on the VS removal of FW have a more significant impact on the two-stage DF coupled with AD process (1) on Organic Loading Rate (OLR) and the theoretical biogas yields compared to the AD-only process (2). This effect becomes more evident by varying the VS removal of FW compared to BW as shown in Figure 11.
For the two-stage DF coupled with AD process (2), increasing the ratio of FW/BW results in a decrease in the produced H 2 , NH 3 , urea, and compost. However, the decrease in urea production is sharper than in the other process outputs. When the ratio of FW/BW is 0.5 the optimum production yields were achieved. Conversely, for the two-stage DF coupled with AD process (2), the NH 3 production yield goes up when the ratio of FW/BW increases. This is due to higher CO 2 production resulting from the presence of DF in the proposed process based on our modeling method described in the logical flow diagram which can be seen in the supplementary materials. Increasing the dilution rate will result in an increase in compost and CH 4 production in both processes. An increase in CH 4 production will in turn result in higher NH 3 and urea production ( Figure 12).

CONCLUSION
The results above indicate that among the proposed technologies, the AD-only is the most efficient for GHG emissions, while the two-stage DF coupled with AD process requires less energy per kgNH 3 basis. When comparing the proposed NH 3 processes to the literature data, water electrolysis powered by renewable technologies is the best of all processes in terms of GHG emissions while steam reforming coupled with Haber-Bosch has the lowest water consumption of all the processes mentioned.
Additional research is needed in a few key areas of research on the production of NH 3 /urea through waste utilization, environmental impact of water usage for NH 3 production and where an NH 3 production plant needs to be located, in terms of both availability of feedstock and sustainability (accessibility to renewable energy sources such as solar Photovoltaic (PV) and wind power, distance from the waste hub to the production plant, etc.). Location is an important factor in the development of sustainable production methods, for maximizing productivity and sustainability in the production of chemical compounds such as NH 3 . Since the inputs and outputs of this proposed NH 3 production process are FW and BW, wastewater treatment and solid waste management facilities are resources of interest.
A waste-based, CO 2 aware, NH 3 production technology leveraging emerging membrane technologies in concert with local infrastructure can provide a viable route to green NH 3 and to green fertilizers, providing an effective strategy to address multiple sustainability/sustainable development needs simultaneously.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.