System Design and Performance Evaluation of Wastewater Treatment Plants Coupled With Hydrothermal Liquefaction and Gasification

Wastewater treatment and sludge disposal are responsible for considerable costs and emissions in a global scale. With population and urbanization growing, tackling the rational and efficient use of energy while fulfilling the desired effluent standards are imperative. In this work, a superstructure-based approach is designed to incorporate alternative treatments for wastewater. In particular, technologies like hydrothermal liquefaction and gasification, coupled with technologies for CO2 conversion to value-added products are studied. Multi-objective optimization is applied as a way to generate multiple solutions that correspond to different system configurations. From a reference treatment cost of almost 0.16 $/mWW3, an environmental impact of 0.5kgCO2/mWW3 and an energy efficiency of 5%, different configurations are able to transform a waste water treatment plant to a net profit unit, with a net environmental benefit and energy efficiency close to 65%. The investment in hydrothermal liquefaction producing biocrude coupled with catalytic hydrothermal gasification demonstrated to yield consistently better total costs and environmental impacts. Parametric analysis is performed in the inlet flow of wastewater to account for different sizes of waste water treatment plant, with smaller inlets achieving values closer to those of the state-of-the-art configuration.


INTRODUCTION AND STATE OF THE ART
With increasing population growth, urbanization and industrialization, wastewater treatment plants (WWTPs) are of vital importance. Not only do they directly impact the aquatic ecosystem, but they also play a pivotal role in guaranteeing water security in a world scenario of hydric stress (OECD, 2012). Primarily focused on removing impurities from wastewater, practitioners used to pay little attention to both energy and environmental bill of their facilities. However, due to unavoidable legalization and even public perception, the water-energy nexus has become a key topic in the field (Gu et al., 2017), with the scientific community working to manage both, wastewater treatment quality and energy efficiency. WWTPs are generally the facilities with the highest energy bill in a municipality.
This refers up to 5% of the total electrical energy load (Chen and Chen, 2013), while the energy consumption is responsible for up to 40% (Panepinto et al., 2016) of the operating costs in such plants.
Low quality feedstocks are inherently difficult to valorize, one of the main reasons being typically the high amount of water they contain. Water can be removed by means of filtration and thermal drying, but that usually comes to a tremendous energetic (and economic) cost. Particular technologies have been developed to lead with this setback, profiting from the abundant availability of feedstocks as well as its price (typically free of charge).
In a study developed by Ang et al. (2019), the overall efficiency, costs, and impact are tackled, while introducing multiple input treatment options as well as several disposal scenarios. However, it does not consider different conversion pathways for wastewater, but it rather focuses on the conventional system configuration.
WWTP that rely only on biogas production and use it as heat and power source face a problem particularly difficult in summer and in southern latitudes. Indeed, with practically no storage of biogas being done industrially, biogas has to be burnt and the heat evacuated. This results in tremendous energetic losses as the demand in those periods is low. To this end, the production of biocrude and synthetic natural gas (SNG) as representative liquid and gaseous fuels, respectively, seems an interesting alternative. This is due to the fact that apart from the simultaneous production of fuels, it also offers storage options and thus is able to provide additional flexibility to the energy system.
Hydrothermal treatment coupled with WWTP has been already studied in the literature. Elliott (2020) considered the valorization of the plant's effluent for the production of biocrude using hydrothermal liquefaction (HTL). Similarly, Chen et al. (2014) focused their study on the feasibility of converting a mixed-culture algal biomass, and thus the exploitation of the contained carbon and the subsequent production of biocrude. On the other hand, hydrothermal gasification of sewage sludge has gained a prominent attention as well. Mainly focused in the production of SNG (Gassner et al., 2011), or even targeted in hydrogen (He et al., 2014), it offers an interesting alternative CO 2 .
CO 2 removal from gaseous effluents and subsequent upgrading to value-added products has led to a growing number of publications in this field (Olajire, 2010). Indeed captured CO 2 can be transformed from a waste to a raw material and act as the building block molecule for the synthesis of organic compounds, with the primary focus of synthesizing biofuels but also biochemicals. A number of different processing routes have been proposed including the catalytic hydrogenation of CO 2 to methanol and olefins (Pérez-Fortes et al., 2016), SNG (Gorre et al., 2019), diesel (Dimitriou et al., 2015), and jet fuels (Willauer et al., 2012), to name a few. However, capturing CO 2 in industrial processes is responsible for around 75% of the overall cost of carbon capture and storage (Olajire, 2010).
Concerning mathematical approaches, a large majority of the publications focus either on environmental impact or economic implications of adopting a given configuration or treating a specific amount of wastewater. However, this approach is unable to capture the required trade-offs that decision-makers (DM) are looking for-solutions that are a compromise between sound environmental benefit and low to moderate economic costs. Sometimes DM look also for high efficiencies as objective, which might result to unbearable investment costs.
Indeed, most of the existing studies deal with the processing of the WWTP effluents in a straightforward rather than a systematic and explorative way. To the best of the authors' knowledge, there is no research addressing systematically the competition between the three main pathways, namely the benchmark system for biogas production, and the valorization through HTL and gasification for biocrude and SNG production respectively, exploring the synergies and opportunities of material, energy and economic integration.
The work developed in this publication utilizes system optimization as a solution generator. Thus costs, impacts and efficiencies of different system configurations of treatment options integrated in a WWTP are revealed. Consequently, system flexibility is increased to address challenging environmental regulations by means of multi-objective optimization (MOO) coupled with a superstructure-based approach.
The structure of this work is as follows: In Section 2, a superstructure-based approached is depicted and the main building blocks of the system are described; Section 3 shows the methodology followed as well as the key performance indicators (KPI) chosen to characterize the competing configurations. In Section 4, results are presented and discussed and finally in Section 5, conclusions are drawn and summarized.

PROCESS DESCRIPTION AND MODELING
A superstructure-based approach is the design methodology followed in this work to assess different wastewater thermochemical conversion routes, corresponding to the use and/or combination of different technologies. A similar approach has been proposed and used by several authors (Maronese et al., 2015;Santibañez-Aguilar et al., 2015). All process units are represented as black-box models, built by assessing the conversion features, either from extensive literature review or real, operating, units. Flowsheeting software (e.g., Belsim Vali) is used to describe the complex processes and is the base for the linearization of the mass and energy flows, based on a reference size (typically the inlet mass flow). The linear nature of the approach is kept by assuming linear operating and investment costs, as well as process efficiency. Flows entering and leaving a model boundaries allow connections between different technologies, granting a simple and fast integration and connection between them.
The superstructure proposed (Figure 1) tackles the challenge of wastewater treatment coupled with sludge handling, disposal and valorization.
The relevant units are described below, where only the most important assumptions will be discussed. All assumed parameters, ranging from economic (Tables 1 and 2), environmental ( Table 3) and thermodynamic/operating ( Table 4) are to be found in the end of this section. For environmental considerations, only the most impactful units/ flows were considered.

Wastewater Treatment Plant
WWTP are considered sources of CO 2 , CH 4 , and N 2 O, due to the unavoidable leaks of biological processes taking place (aerobic and anaerobic treatments). According to Molinos-Senante et al. (2018) who modeled wastewater energy intensity for a large spectrum of facilities, WWTPs are energy intensity facilities. Average energy demand profiles were taken and incorporated in the model.
The light blue boxes ( Figure 1) contain the backbone units of a classic, state-of-the-art WWTP. Wastewater is cleaned from contaminants and carbon-rich substances and leaves as a treated effluent that can be safely discharged in a receiving body. In the process, sludge is formed (primary and secondary), dewatered and sent to anaerobic digestion for biogas production, which is used to supply local energy needs. The remaining solid digestate is a major liability that needs drying and stabilization and imposes a cost for disposal in the overall WWTP system.

Hydrothermal Liquefaction
HTL is a thermochemical conversion process that makes use of water present in the feedstock to produce biocrude, a raw material for liquid transportation fuels, thus fully replacing crude oil. It mainly consists of a thermal degradation step to break down the large carbon chains contained in the biomass feedstock, the dissolution of useful materials in water and a recombination  (polymerization) step for the synthesis of the final products (Gollakota et al., 2018). As such, it is able to handle feedstocks with high moisture level (up to 90% content), avoiding the drying step that is needed for other kinds of technologies (Snowden-Swan et al., 2016). Wet wastes (like sludge) are usually readily available, thus dismissing preprocessing and preparation steps associated with lignocellulosic based feedstocks (He et al., 2014); Four products are obtained from HTL: i) biocrude, which is the main desirable product, ii) aqueous co-products (ACP) accounting for up to 75% of weight in product distribution, iii) biochar, which is a solid residue rich in carbon, retaining up to 45% of inlet carbon content, and iv) a gaseous stream, mainly constituted by CO 2 and H 2 0. Albeit little attention has been given to the aqueous effluent, a great deal of carbon and other nutrients need treatment and valorization. A recent publication on the characterization of the aqueous stream compares several feedstocks with different operating conditions; in particular primary, secondary, and digested sludges are analyzed (Maddi et al., 2017). The authors conclude that higher lipid content results in increased biocrude yields, while more proteic substrates (present in high amounts in secondary sludge) are associated with higher (more than double) carbon amount in aqueous phase. For this reason it is suggested to use HTL either directly in digested sludge or in pre-digested sludge as a mixture of primary and secondary sludges. Bauer et al. (2018) also analyzed different feedstocks for HTL. They concluded that pre-digested as well as digested sludge show higher biocrude yields compared to other sources of waste. This study focuses also in evaluating the quantity and quality of the ACP. It is also reported that the ACP of liquefaction is far more noxious than common industrial wastewaters, requiring treatment before discharge. This might compromise the economic viability of stand-alone HTL units. It is, however, a decisive incentive to couple HTL in a WWTP, in order to benefit from process symbiosis.
HTL works at temperatures ranging from 250 up to 380°C and pressures up to 30 MPa, with residence times spanning from 5 to 60 min (Mørup et al., 2012). Oxygen removal is of critical importance, as lower concentrations allow higher heating values of bio-oil (around 35 MJ/kg). When compared with competing processes, like gasification and pyrolysis systems, HTL has a lower energy penalty as it avoids the water vaporization step.
Filtration followed by hydrothermal co-liquefaction has recently proved to be particularly efficient for wastewater sludge with different solids content Anastasakis et al., 2018), and thus is included as an option for the superstructure. Indeed, higher performances are achieved, and operating costs are reduced, due to the avoided catalyst in the main reaction step. A schematic representation for a reference flow of 1,000 kg/h of inlet sludge is depicted in Figure 2. Different feedstocks compositions are handled by conversion to a generic layer, according to experimental results given by Snowden-Swan et al. (2016) and Bauer et al., (2018).

Catalytic Hydrothermal Gasification
Similarly to HTL, Catalytic hydrothermal gasification (CHTG) is able to valorize intrinsically difficult low quality feedstocks, being    particularly suitable for those with more than 80% water content. The water evaporation step is by-passed as water is kept in the liquid phase under the imposed supercritical conditions, thus avoiding supplying the heat of vaporization. SNG or bio-SNG can be produced if upgraded from a methane rich gas leaving the catalytic reactor. The process diagram, Figure 3, shows the main steps including the upgrading, energy, and material needs.
Operating conditions and process description were the ones reported elsewhere (Gassner et al., 2011;Mian et al., 2015), using 20% solids content as input.

Phosporous and Nitrogen Recovery/ Struvite Formation
Besides Sun, water, and CO 2 , minerals are a crucial nutrient for crops growth; in particular phosporous (P), nitrogen (N), and potassium (K) are the most relevant. Crop yields may be increased up to 100% by increasing the amount of nutrients in the soil, according to a recent report on struvite recovery (de Vries et al., 2016).
Mineral fertilisers (phosphate rock) are a non-renewable resource. Struvite (MgNH 4 PO 4 ·6H 2 O) is a fertiliser that can be obtained from wastewater with high concentrations of both P and N; it can be precipitated by the addition of magnesium salts under basic conditions. Despite a lower solubility in water struvite is able to replace mineral fertilisers on a P 2 O 5 basis (Degryse et al., 2017), including some cases where it performs statistically better (Li et al., 2019).
In a review of struvite from several feedstocks (Kataki et al., 2016), six different recovery technologies were described.
Applied to municipal wastewater and with industrial applicability, only chemical precipitation is used. Fluidized bed reactors are the most deployed reactor for chemical precipitation (Li et al., 2019) and they were used as the modeling base in the present work. High P recovery (up to 90%) is reported, despite the addition of some P and/or NH 4 salts, that accounts for a large share (up to 90%) of operating costs (Ye et al., 2020).
In a recent review focusing on bottlenecks and challenges of struvite formation, Li et al. (2019) have shown that implementing struvite precipitation as a post-treatment technology (as implemented in Figure 1) for both P and N recovery helps reducing the burden associated with hydrothermal treatments. Furthermore, it reduces the volume that needs treatment in a WWTP.
From the cost perspective, several authors (Mayer et al., 2016;Kataki et al., 2016) agree on the non-profitability of recovering struvite by means of chemical precipitation, due to the low market value motivated by low market cost of rock phosphate. Struvite market prices are not consensual; 55 €/ton was taken as a reference (de Vries et al., 2016), which is the closest to commercial P fertilizers. Concerning operating costs, 350 €/ton of struvite were considered (Huang et al., 2014), coherent with the values reported in Mayer et al. (2016), and accounting for average values of chemical compounds added in a wastewater treatment environment. Complementary, Li et al. (2019) report that a selling price close to 430 $/ton of struvite would be enough to guarantee the investment on a plant in Belgium. The same reference asks for more research  on the economics, with a focus on the reagents promoting struvite crystallization. In addition, Rahimi et al. (2020) points economics as the major hinder to industrial deployment, mostly due to the need of magnesium salts to promote struvite precipitation. However, it sheds some light on the potential for magnesium oxide (MgO) as a cheap and abundant source of magnesium, that is expected to help changing the overall economics.
However, all of them agree on the lower environmental impact, as well as the need to reduce phosphorous discharges in receiving bodies. Thus, there is a direct environmental benefit of recovering struvite of 0.35 kgCO 2 − eq/kg struvite .

CO 2 Removal and Upgrading
On the one hand, the positive impact of CO 2 removal from environment can be supported by economic incentives. On the other hand, if used and upgraded as a carbon source it can yield useful products, thus creating an economic off-set.
For moderate to high partial pressures (up to 40%), physical absorption processes might be used for CO 2 capture, as the gas is absorbed according to Henry's law (Olajire, 2010). Selexol process (Gassner et al., 2011) is implemented in CHTG to purify CH 4 up to gas grid quality. Pressure swing adsorption (PSA), a discontinuous process that removes CO 2 by cycles of adsorption and regeneration is also commonly used and implemented. For both processes, the mechanical power to be used has been estimated between 600 and 800 kJ/kg crudegas . For PSA, temperature swing adsorption precedes to ensure drying over aluminium-oxide to ensure a dried feed (Gassner and Maréchal, 2009); the process consumes 11 MJ/kg H2O at a temperature between 160 and 190°C. Carbon dioxide removal models are thus developed based on overall efficiencies, performances, and energy intensity (Urban et al., 2009), as detailed simulation models are too complex and not designed for flowsheet calculations.
Both methanol and methane formation from CO 2 require expensive H 2 to work; the former has the advantage of consuming less H 2 and having an higher energy density (at standard conditions), being simultaneously easier to store. The latter has the main advantage of integration in the existing natural gas infrastructure. Miguel et al. (2015) have shown that from a thermodynamic point of view the valorization of CO 2 to methane (SNG) is easier and requires less harsh conditions. Methanation is also among the systems expected to contribute to a low-carbon economy, with chemical methanation showing the greatest potential to be implemented on large scale compared with the biological counterpart, not only due to economics but also to technical aspects (Hidalgo and Martín-Marroquín, 2020).
Conversion of CO 2 to valuable products is thus conditioned in this superstructure to SNG. The underlying principle is the Sabatier reaction, taking place in a (catalytic) methanation reactor and by making use of electrolysis as H 2 provider. The model is adapted from (Wang et al., 2018), making use of an alkaline electrolysis cell; high level of market maturity and utilization, coupled with the lowest investment costs among the electrolysis cells (Hidalgo and Martín-Marroquín, 2020), motivated the selection.
Hidalgo and Martín-Marroquín (2020) reviewed the current state of power-to-methane technologies with a forecast for the next 30 years, up to 2050. In the analysis, heavier deployment coupled with mass production are expected to drive both electrolysis and methanation prices down. The same reference points at hydrogen production as the major cost, with the range of current investment on alkaline electrolysis cell between 800 and 1,500 €/kW, in line with values from other sources (Schmidt et al., 2017).

Utilities
The utilities section consists of technologies used to close the thermal and energy balance of the process section. It includes a combustion unit, equivalent to a boiler, a gas engine, a steam network (SN), and a solid oxide fuel cell (SOFC). Operating conditions were not object of optimization. Efficiencies were taken as the most common values in the literature and steam temperature levels were chosen to fit the thermal profiles. The SOFC unit was modeled based on the work of (Facchinetti et al., 2011). SN investment cost was taken as the turbine cost.

Key Performance Indicators
A number of KPI are used to compare different scenarios and to validate models taking into account an extensive literature review on the topic Table 5.
The thermodynamic performance of different system configurations is assessed based on the total conversion efficiency. This allows, besides characterizing chemical conversion, to evaluate the process integration quality based on both energy and mass efficiencies. Energy efficiency (Eq. 1) is defined as the ratio between the amount of energy leaving the system (either biocrude, SNG or biogas) and entering (besides wastewater, also electricity, natural gas, and filter aid biomass). For mass efficiency (Eq. 2) the ratio between the net energy input (defined as energy flows entering subtracted by flows leaving) and the total amount of wastewater entering the system is taken. When used, Δh 0 WW reports to the lower heating value of wastewater on a dry basis.
Environmental impact (Eq. 3) was calculated in terms of CO 2 emissions using the global warning potential 100a method, corresponding to the Intergovernmental Panel on Climate Change 2013 global warming potential impact method and considering a time-range of 100 years. It was chosen due to its widespread use and easiness of comparison with other studies. It is computed as the ratio between the impact of operating the system (given as the impact sum of units, resources, and electricity) and the inlet flow of wastewater. For both Eqs 2 and 3 only one of the electricity flows is nonzero, which means that the system is either a net importer or exporter. Pay-back time is a metric targeting investment decisions and is defined as the ratio between the investment and the difference in operational expenditures accounted by the investment (Eq. 4).

Mathematical Formulation
The problem is formulated as a mixed-integer linear programming problem. The material and energy flow models contain relevant information concerning physical properties used to define both mass and energy requirements. The approach presented in Maréchal and Kalitventzeff (1998) is used to satisfy the minimum energy requirements. It combines heat cascade generation (Eqs 9-11) with pinch analysis to obtain the optimal utility network with respect to minimum cost, while satisfying both electricity (Eq. 12) and mass balances (Eqs. 13-15). Solutions are generated by considering a weighted sum of both objectives (Eq. 5), Operating expenditures (OPEX) (Eq. 6) and Capital expenditures (CAPEX) (Eq. 7). Constraints are also placed in the minimum and maximum capacity of each unit (Eq. 8). with: f min u y u ≤ f u ≤ f max u y u ∀u ∈ U Heat cascade: Electricity balance: Resources mass balance: ∀r ∈ R, Units mass balance: ∀u ∈ U, The mixed-integer linear programming problem is written in AMPL (2013) and solved by IBM ILOG CPLEX Optimization Studio (Cplex, 2009). Table 6 explain the Indices, sets, variables, and parameters used in the formulation.

Multi-Objective Optimization
Single objective optimization is often not enough for decision making, as there are typically conflicting objectives. MOO provides an efficient way of generating optimal solutions forming a Pareto front. A Pareto front represents a set of nondominated solutions-meaning none of the objectives can be improved without degrading another one (Cui et al., 2017). MOO has been widely studied and applied in a multitude of research fields, among which biomass and waste conversion (Fazlollahi et al., 2012;Celebi et al., 2017). In this work, MOO is introduced in the objective function itself, by making use of a CAPEX weight factor (α in Eq. 5), that is allowed to change between 0 and 1. This guarantees the generation of a set of different solutions that in the end correspond to different system configurations. Steps of 0.005 were used.

RESULTS AND DISCUSSION
The optimization procedure yields a Pareto front (Figure 4) that can be translated into a set of different system configurations and optimal values for the decision variables (  Table 7). Sludge residuals which account for 10% of operating costs are disposed. Alongside with the potential for biogas upgrade, it was the main driving force for studying and proposing new ways of treating wastewater. It should be mentioned that biogas formation is not excluded from any configuration ( Table 7). This is mainly due to the already installed anaerobic digester (no investment associated), but also to the potential of using PSA to upgrade biogas to gas grid level (SNG) and by making use of CO 2 as carbon source in the Sabatier reaction. Generated solutions and in particular Pareto points, are able to provide an interesting trade-off not only between operating and investment costs, but also taking into consideration other KPI's, such as impact and efficiencies, as defined in Table 5. With increasing investment, the reduction of OPEX is mainly driven by increasing SNG and biocrude export and for some configurations, by electricity production.
From the reference cost of 0.1605 $/m 3 WW , the total cost (TC) of the system is reduced for all the configurations, with savings ranging from 14 to 111%. The more modest reductions, up to 40% in TC (Pareto points between a and f), correspond to configurations where technologies are installed in small scale and the production of SNG is the main operating benefit. Sludge disposal is replaced by a mixture of nutrients recovery for struvite formation and either biocrude or SNG formation, in HTL or CTHG units respectively. Furthermore, biogas is preferably upgraded in a PSA unit. Environmental impact is reduced up to 23%, and energy efficiency goes as high as 40%, translating a better use of the intrinsic wastewater energetic content. Similarly, global energy intensity, which measures how much external energy is needed, is reduced up to 70%.
A second Pareto region corresponds from point g to q. It is mainly characterized by CO 2 recovery and upgrade to gas grid Reference mass flow of resource r consumed/produced by FIGURE 4 | Solution set (circles and squares); Pareto points are the ones represented by squares and contain the same reference as in Table 7. Color shows the interval gap of environmental impact. Subplot is a zoom for points between i and q.      and impact goes as low as 0.139 kgCO 2 /m 3 ww , which is equivalent to a reduction of 72%. Energy efficiency goes as high as 65% and energy intensity records a negative value (point i), which translates to a net energy producer on a wastewater volume base.
A third Pareto section, from points r to v, provides a net economic benefit (negative TC), arising mainly from electricity production, complemented by an investment in the SN. At the same time biocrude is internally consumed, producing steam and electricity.The SNG production is reduced and for certain configurations reverted, meaning natural gas is imported from the grid. Electricity production is thus both an economic and environmental driving force. Indeed, the environmental impact is negative for all the section configurations which is equivalent to a net environmental benefit, with a global energy efficiency up to 66%. On the other hand, the need for importing natural gas and the internal use of biocrude justify energy intensities as high as seven times the reference case.
The last set of Pareto, corresponding to points x and y are the ones with the lowest OPEX but the highest investment. There is maximization of SNG export by means of CO 2 conversion to CH 4 through H 2 production via electrolysis, corresponding to heavy electricity consumption (up to 162 MW). Indeed, the incentive to  control investment is practically vanished in these cases and extremely expensive technologies are chosen even if the marginal operating benefit compared to the third Pareto region is small. However, both Pareto points present considerable environmental impact (three times the reference case) and a high energy intensity due to the need of importing electricity. In spite of it, TC is able to be reduced by 50% compared to the reference case. Lastly, the pay-back time, an important measure for investors, is close to 7 years which represents a liability due to the investment in technologies with reducing industrial implementation. Figures 5A,B as well as Figure 6 graphically represent the information contained in Table 7 for all the Pareto front solutions. Figure 5A shows how biocrude and SNG are the major economic driving forces up to point q, after which electricity exports lead the economic benefit. Similarly, global energy intensity is reduced up to point q, after which by means of exporting electricity the export of biocrude is eliminated. This leads to energy intensity values up to seven times higher than the reference. Figure 5B graphically displays investment decisions as stacked bars, TC as a line and pay-back time as numbers above the stacks. For almost all the configurations HTL and PSA are chosen technologies as they are able to produce biocrude and SNG respectively. The use of electrolysis is also frequent as a way to produce H 2 for CO 2 upgrading. In the most expensive configurations the investment in electrolysis accounts for up to 50% of the total investment, leading inclusively to negative TCs as the production of electricity is maximized.
On the environmental impact and energy efficiency, Figure 6 shows that up to the second Pareto region (point q) only a small to moderate reduction of the reference impact takes place. For the third region (from point r to v), exporting electricity and replacing an equivalent amount of CO 2 (the grid carbon intensity) renders those configurations negative equivalent emissions systems. The last two options (points x and y), which include maximizing electricity use to supply the production of SNG, show a considerable increase in impact. For all the configurations the energetic recovery of wastewater has drastically increased. However, as it is demonstrated it might not be a synonym of sound environmental performance. In particular, configurations x and y achieve the highest efficiencies despite a considerable increase in impact.
Total inlet wastewater (in weight or volume) is an important parameter that is likely to affect decision-making. In reality, although WWTPs tend to grow in area and equivalent people managed, the average wastewater in urban centers is rather small. To account for it a parametric analysis on the amount of inlet wastewater and thus the size of the facility was performed. It was changed between the reference amount of 25.000 ton/h, equivalent to 1.7 M inhabitants and 2.500 ton/h, corresponding to 0.17 M inhabitants, in steps of 2.500 ton/h. The results are shown in Figure 7. OPEX and CAPEX have a consistent decreasing and increasing tendency, respectively, regardless of the Pareto point or the inlet flow of wastewater. Concerning TC, the first points are more likely to be less competitive for small flows, which means a TC closer to the reference value.
In the first region, between points a and f, size plays a role with TC for some configurations being similar to the reference value. This aspect however, might hinder the feasibility of the configuration purposed. In the same way, impacts and both efficiencies have values that come close to that of the reference for low inlet flows. For the second region, between points g and q, solutions provide consistently lower TC than the reference despite some extreme values in investment notably points j, m, and q. For those points, lower OPEX and negative TC are achieved. The consequence is immediate in terms of environmental impact, with values closer to those of the reference case. Similarly, the higher impact corresponds in this situation to a higher global energy intensity (ϵ m ).
The third region, between points r and v, shows the highest variability in TC. In this region, smaller flows achieve lower values compared to bigger ones due to an increasing investment in technology, but providing a considerably lower OPEX. By exploring new opportunities, the impact is also considerably reduced as export of both electricity and SNG are maximized. Nevertheless, the energy efficiency seems to be stable around 60%, and the energy intensity high regardless of the size, which is again due to the fact of internally using biocrude as an energy provider.
The fourth and last region, of points x and y, shows a curious behavior. The higher inlet flows corresponding to the main results shown ( Figure 5) are outliers of the parametric analysis-observed in the TC box plot. Indeed the huge amount of wastewater and its intrinsic energetic content motivated the investment in technologies that make use of electricity to produce SNG (electrolysis and methanation units). However, with a reduced flow the system converges to a configuration very similar to those of the third region, amidst the corresponding reduction in global energy efficiencies. By changing system configuration the investment is reduced and TC shifts toward negative values, indicating a net economic profitable solution.

CONCLUSIONS
The production of biogas and its use for internal WWTP purposes is only able to explore 5% of the total intrinsic energetic content of wastewater. In order to minimize costs, technologies that allow handling and valorizing not only biogas, but also sludge (with variable water content) were studied. MOO was used to generate a set of competing solutions to be analyzed and discussed by DM.
HTL is chosen in almost all the configurations analyzed, which is the result of exploring system synergies for its aqueous by-product whose further treatment can be explored within a typical WWTP configuration. For investment costs of up to 0.10 $/m 3 WW an effective reduction of TC and environmental impact of up to 73% is achieved. At the same time, global energy efficiency goes as high as 60% and pay-back time around 3 years. For the same range of investment, capture and upgrading of CO 2 is also used, with electrolysis and methanation units adopted at low sizes. It is of interest to note that for some configurations the global energy efficiency substantially increases without a similar and comparable decrease in the environmental impact. For some solutions, CHTG is included in the optimal configuration. However, it is not heavily deployed for two reasons: biocrude from HTL seems to provide a better trade-off between OPEX and CAPEX and SNG can be obtained by investing in a PSA, which has lower economic barrier.
When higher investments are allowed, and because all economic results are extremely dependent on the economic assumptions, in particular electricity and (synthetic) natural gas prices as well as their ratio, investment in a SN coupled with a SOFC make use of the internally generated biocrude to maximize either electricity or SNG. In the end this provides substantial economic benefits. Actually, within the current assumptions framework the system's TC can go below 0, transforming it in a net economic profitable system. Simultaneously, environmental impact can also change to negative values as the electrical grid carbon intensity is considerably high. Obeying economic motivations, there are also two configurations that albeit reducing operating cost at the expense of higher investment have a considerable impact (three times higher the reference case) which hinders their application.
Parametric analysis was performed on the inlet wastewater flow, changing it between 10 and 100% of its nominal value. The results show that for lower investments, smaller flows endanger the conclusions, with TCs in line with the reference values. However, for higher investments the adopted configurations perform systematically better.
This work paves the way for cheaper and more sustainable wastewater industrial clusters, showing how well new conversion routes can be interconnected to generate new system configurations.

DATA AVAILABILITY STATEMENT
All datasets presented in this study are included in the article.

AUTHOR CONTRIBUTIONS
RA-Formulation and model developed, results generation, analysis, and discussion. TD-Literature review and manuscript review. JG-Catalytic hydrothermal gasification model adaption and manuscript review. FM-Supervision results and conclusions discussion. All authors contributed to the article and approved the submitted version.