A bottom-up appraisal of the technically installable capacity of biogas-based solid oxide fuel cells for self power generation in wastewater treatment plants

This paper proposes a bottom-up method to estimate the technical capacity of solid oxide fuel cells to be installed in wastewater treatment plants and valorise the biogas obtained from the sludge through an efficient conversion into electricity and heat. The methodology uses stochastic optimisation on 200 biogas profile scenarios generated from industrial data and envisages a Pareto approach for an a posteriori assessment of the optimal number of generation unit for the most representative plant configuration sizes. The method ensures that the dominant role of biogas fluctuation is included in the market potential and guarantees that the utilization factor of the modules remains higher than 70% to justify the investment costs. Results show that the market potential for solid oxide fuel cells across Europe would lead up to 1,300 MW of installed electric capacity in the niche market of wastewater treatment and could initiate a capital and fixed costs reduction which could make the technology comparable with alternative combined heat and power solutions.


Background
Since 2009, the EU started developing strategies to reach 80-95% abatement in greenhouse gas (GHG) emissions below 1990 levels by 2050. In support of this objective, the European Climate Foundation (ECF) delivered the Roadmap 2050, which provided a practical guide to a low-carbon Europe, highlighting urgent policies needed over the coming five years especially in the power sector (ECF, 2010). Recently, after the Agenda 2030, the EU Commission has re-affirmed the commitment to tackling climate and environmental-related challenges with the European Green Deal, aiming to make the EU ′′ a prosperous society, with a modern, resource-efficient and competitive economy where there are no net emissions of greenhouse gases in 2050" (EC, 2019). This means that not only interventions to support investments in low carbon assets, renewable technologies, and energy efficiency measures are needed, but it is also crucial decoupling economic growth from resource use establishing a circular economy.
Among the energy efficiency measures, the interest has been focused on combined heat and power (CHP) solutions by governments across Europe, through investment subsidies, power production premiums and feed-in tariffs. In this context, fuel cells will be a pivotal technology in renewable energy systems, being a lower emitting and a more efficient alternative to internal combustion engines and gas turbines at power generating stations (Wang, 2015). Solid oxide fuel cells (SOFCs) operate at higher temperatures than other fuel cells. This allows a wider variety of fuels, faster conversion reactions, higher power densities, and higher efficiencies in cogeneration systems (Choudhury et al., 2013). Among the several fuel options for SOFCs (e.g., natural gas, upgraded biogas, hydrogen, syngas), biogas is a promising renewable energy source with a great potential to secure a considerable part of the energy worldwide. Currently biogas is not exploited but is mainly flared: only a few applications involve the valorisation of biogas for electricity generation using internal combustion engines or gas turbines. Internal combustion engines could have an electrical efficiency of 36% for smaller scales and 41% for the larger ones (Lantz, 2012). Biogas would be more valuable as a fuel for SOFCs compared since the higher electrical efficiency (up to 60%), lower CO 2 emissions and virtually zero emissions of atmospheric  . However, raw biogas often contains considerable quantities of undesirable trace compounds such as hydrogen sulfide and siloxanes that can cause SOFC degradation even at very low concentrations ( , (Madi et al., 2015)). As the amount of these contaminants varies widely depending on the biogas production unit operating conditions and raw feedstock composition, the future digesters should be designed to produce cleaner gas streams (Saadabadi et al., 2019). Despite this great potential, the experimental results of operating SOFC with biogas, and the techno-economic theoretical studies, reveal that the high investment costs and short term stack replacements costs are the main barriers to direct internal reforming SOFC commercialisation. Current applications of SOFCs are quite varied but mainly refer to the small-scale.
• The primary market for SOFCs has been the residential sector, particularly in areas with stricter air quality regulation. In the industrial sector, there are good opportunities for the integration of fuel cells in large data centres, in pharmaceutical and chemical production facilities (through gas-fuelled CHPs), in the food processing industry (through biogas-fuelled CHP), in wastewater treatment plants (WWTPs) (through biogas-fuelled SOFCs) (Ammermann et al., 2015). Other applications of SOFCs can be found in aircraft auxiliary power units, in deep ocean power units, as well as in hybrid systems integrated with wind and solar energy (Azizi and Brouwer, 2018 (Gandiglio et al., 2020). The SOFC system was installed under the framework of the DEMOSOFC project (hereafter called DEMOSOFC plant), aiming to demonstrate the technical and economic feasibility of operating SOFCs in a wastewater treatment plant. The proposed layout allows a net electric efficiency of the SOFC in the range 50-55%.
Only the success in the manufacturing of SOFC stacks with longer lifetime could be instrumental in decreasing the number of stacks replacements to eventually lead to acceptable costs (Ali et al., 2019). According to Wang (2015), the cost reduction necessary for the commercialisation, can be achieved improving the reliability and the durability of these engines, which can be obtained integrating experiments and numerical modelling to explore different combinations of materials, chemistry, flow field designs and fabrication techniques. New business model and standards for the industry are also necessary to enable large scale manufacturing and distribution. As discussed by Hardman et al. (2015), successful examples of fuel cell marketing solutions represented by Fuel Cell Energy and Bloom Energy have achieved market entry by producing fuel cell products as power providers with an added value rather than attempting to directly compete with incumbents. Wang et al. (2018) stressed that the greatest barriers to end-user acceptance and fuel cell commercialisation do mainly come from the additional costs of maintenance and repairs which SOFCs require compared to alternative technologies.
Economy of scale effects for SOFCs could take place after a cumulative manufacturing volume of about 8,000 50 kW-units costs, making the technology competing with state-of-the-art technologies, such as gas turbines (Ammermann et al., 2015). WWTPs represent a niche market for the deployment of SOFCs. First, co-generation would improve the economics of WWTPs and would also represent a strategic alternative to increase the grid flexibility (Udaeta et al., 2019). Second, the use of biogas produced at the WWTPs in co-generation units would be a renewable option to reduce the electrical demand on the grid and contribute to curbing the power sector emissions (Dehhaghi et al., 2019). Third, the use of biogas in SOFCs would represent a flexible waste-to-energy option especially in markets where electricity price are low and projects running on state-of-the-art technologies are only economical for generating capacities greater than 200 kW because high maintenance costs must be offset by revenue from the power generated (Lackey et al., 2017).
Current estimates of the SOFCs market value widely vary across the studies: they can propose a compound annual growth rate varying between 14 and 30 % in the near term (Grand View Research) (Murdor Intelligence). Existing analyses are primarily top-down estimates, where econometric models are combined with technology diffusion models to analyse effects of policies and market barriers. The top-down analyses identify the market for SOFCs with the potential replacement of existing co-generation systems for the different market segments proposing selected case studies (Ammermann et al., 2015) (Department of Energy, 2014) and can be integrated with stakeholders' elicitations (Grand View Research). Currently, there is no estimate of the installable capacity of SOFCs accounting for the constraints on the operability of the plants where the co-generation device is installed. Taking into account the system operability constraints makes the analysis bottom-up and provides a more accurate figure of the technical and economic feasibility of the SOFC integration. This work introduces a novel bottom-up approach for the estimate of the technically installable capacity for SOFCs in WWTPs using an optimisation-based methodology where the total system costs of a WWTP integrated with an increasing number of SOFC generators is minimised. The model applies a stochastic approach to account for the variable inlet flow of biogas and optimally dispatch the generators including the dynamics of fuel prices, constraints on biogas availability, as well as on biogas storage, and on the technical operability of the SOFCs. A Pareto optimality approach (or Pareto frontier approach) is used to assess the optimal number of SOFC modules for each WWTP size. The WWTP sizes are obtained from a cluster analysis of the European WWTP database; whereas the optimal number of SOFC modules represents the configuration with the number of devices showing the minimum costs. The optimisation has been applied for each wastewater treatment plant size (extra-small, small, medium, large, and extra-large) that model the entire WWTP sector in Europe.
This paper is organised as follows. After a literature review on SOFC modelling, the novel bottom-up methodology used in this paper to estimate the technically installable SOFC capacity is discussed and validated; some final remarks conclude the paper.

Modelling challenges for SOFCs
SOFC development has been widely promoted by inherently multiscale modelling approaches spanning from fundamental to engineering applications. The flexibility of the SOFC technology makes it interesting when integrated with gas turbine and micro-turbine systems (Bao et al., 2018). Ramadhani et al. (2017) reviewed optimisation approaches to single, stack and hybrid SOFC-CHP application. Based on the literature, growing interest is in the area of the population-based algorithm for SOFC optimisation. Multi-level optimisation has been dramatically increasing to develop hybrid algorithms to face the multiscale issues of SOFC.
Although optimisation strategies for single and stack SOFC

Objective function variables TC
total annual cost of CHP system, €/year applications have been widely developed, more research is needed for developing control strategies that can eliminate degradation mechanisms in integrated SOFC-CHP systems (e.g., steep thermal gradients, fast electrical, flow, or thermal transients, anode fuel starvation, thermal management of all components, compressor stall and surge) and validation is required at a prototype or pilot scale (Azizi and Brouwer, 2018). Baldinelli et al. (2017) simulated biogas-based SOFCs, comparing two different configurations, the former reforming the biogas prior to the SOFC, the latter feeding partially upgraded biogas through membranes. The results showed that the system based on CO 2 separation membranes achieved higher performance indicators than the system equipped with the reformer. (Siefert and Litster (2014)) presented an exergy and economic analysis of an SOFC integrated with anaerobic digestion (AD). Assuming target capital costs for the SOFCs, comparable to the competing technologies, they performed a multiparametric analysis of a power normalized capital cost and internal rate of return (IRR) as a function of the current density, the stack pressure, the fuel utilization, and the total air stoichiometric ratio. They found that the AD-SOFC system would exhibit a higher IRR compared to CHPs based on either micro-gas turbine or the internal combustion engine, at lower values of the selling electricity price. As the performance and degradation of the SOFCs are strongly dependent on the operating conditions (temperature and current density), commercialisation will be strongly linked to proper operating conditions to ensure efficient long term operation. (Parhizkar and Hafeznezami (2018)) developed a degradation-based optimisation model to find the optimal operating conditions for the SOFCs and improve the system durability. Asadi et al. (2020) estimated biogas production rates using artificial neural network and an adaptive network-based fuzzy inference system. They used as inputs operating measures taken between 2014 and 2016, of volatile fatty acids, total solids, fixed solids, volatile solids, pH, and inflow rate. The input parameters were pre-processed using principal component analysis (PCA) to determine highly correlated variables. Sechi et al. (2017) proposed an MILP (Mixed Integer Linear Programming) modelling approach to the optimal unit commitment of a sub-MW biogas-fed SOFC-CHP system as designed in the retrofit of a WWTP operating in Turin (Italy). The optimisation approach shows potentials and opportunities for improvements both for SOFC manufacturers and WWTP owners. Manufacturers can investigate the impact of design decisions (i.e., scale), operating and technological variables (i.e., thermal and electrical output from SOFCs, minimum up-and down-time, ramp rates) on commercialisation; end-users can assess opportunities and risks of adopting the technology in their business.

Approaches to estimate SOFC market size
One of the most comprehensive market analysis on stationary fuel cells is based on the work by Ammermann et al. (2015), where the technical, environmental and economic performance of fuel cell-based distributed generation against competing conventional technologies was assessed in Europe, whilst taking into consideration the focus markets (Germany, Italy, Poland, and UK). Three different opportunity levels for SOFC penetration were considered. These scenarios were the basis for a sensitivity analysis regarding the future market potential for fuel cell where the main inputs were energy prices, the spark spread of electricity and natural gas prices, and the price of carbon. Given the lack of rigorous statistical data on distributed CHP plants, Ammermann et al. (2015) used a three-step approach to estimate the addressable market for fuel cell technologies in the specific sub-segment across all four focus markets: • estimation of the total market size considering total number of data centres, breweries, wastewater treatment facilities, pharmaceutical, and chemical plants; • prioritisation of sites through identification of the most attractive segments within the defined use cases; • definition of power requirements estimated as total power consumption and average full load hours per use case; • estimation of market as the minimum addressable market for fuel cell technologies in all focus markets To the authors' knowledge, there is no contribution in the literature, where the estimation of the total installable capacity of the SOFCs in the wastewater treatment sector is appraised in order to guarantee the optimal dispatch of SOFCs integrated in WWTPs. In this paper, a novel methodology to assess the market size considering the maximum installable capacity of SOFCs is proposed to fill this research gap. A generic optimisation framework of an SOFC-CHP system integrated to a WWTP is proposed for identifying the potential available biogas from WWTPs across Europe. The methodology used extends the deterministic dispatch model described in (Giarola et al., 2018) to a two-stage stochastic MILP model to examine both the optimal number of modules and their dispatch. The model proposed is based on a techno-economic characterization of each SOFC stack module (capacity, piecewise profile for electrical and thermal efficiency, capital costs, maintenance costs, stack replacement costs, ramp rates, minimum up-and down-times) as well as of boiler, gas holder and biogas clean-up unit and the decision variables (i.e., capacity, efficiency and unit costs). The stochastic formulation allows to identify the optimal dispatch considering the seasonal variability of the biogas fed into the system using 200 scenarios. In fact, seasonal and daily variations in the biogas production introduce uncertainties in the evaluation of the operating costs. The biogas profiles are quantified on the basis of two real industrial plant profiles operating in Italy. The stochastic optimisation is embedded in a Pareto frontier approach in which the number of SOFC generators is fixed before running the optimisation, thus guaranteeing the linearity of the model as capacity decisions (i.e., number of modules) are separated from the operational ones (i.e., dispatch). The Pareto frontier approach allows to estimate the optimal number of plants a posteriori balancing the total costs of the SOFC-based co-generation system with the module utilization factor.

Bottom-up approach to the maximum installable capacity of SOFCs
The technical market potential was estimated according to the following steps: • Appropriate data source selection (section 3.1) • Definition of criteria for selecting WWTP size and type suitable to integrate SOFCs (section 3.2) • Clustering of the plants into reference sizes (section 3.3) • Determination of the specific biogas production (section 3.4) • Estimate of Pareto frontier for the assessment of optimal number of modules per WWTP size to quantify the installable SOFC capacity per WWTP cluster size (section 4)

Data sources
The data source used to model the wastewater treatment sector in Europe is the UWWTD database (EUROSTAT, 2016). This database is conceived to collect the data about both the quality and the amount of wastewater produced by the WWTPs installed in Europe. The dataset contains data selected from the reporting of Member States as part of the UWWT Directive implementation (European Environment Agency, 2016). The dataset is divided into tables on reported period, receiving areas, agglomerations, urban wastewater treatment plants, links agglomerations, discharge points, and (at Member State level) sludge handling and treated wastewater re-use. The database also allows the selection of the most attractive countries in terms of total capacity (expressed in people or persons equivalent, P.E.) treated within the country and hence in terms of potential biogas production. The first seven countries in terms of biogas potential (total P.E.) are Germany, Spain, United Kingdom, Italy, France, Poland and the Netherlands.

Assessment of WWTP suitability to integration with SOFC-CHP
Although the source is quite fragmented, the number of people equivalent is available for each plant and it represents a measure of the plant capacity; furthermore, information on geographical location, actual load treated, and type of treatment are available. Starting from the original set of plants, two main discriminants were applied to select the eligible WWTPs in which the AD adoption can be considered economically feasible: • a minimum size of 20,000 P.E. The 20,000 P.E. is the threshold size used in this study to decide whether a WWTP is eligible for anaerobic digestion; this is typical of countries, such as Switzerland, where small WWTPs are common and the smallest commercial size integrated with AD corresponds to 20,000 P.E. (IEA Bioenergy, 2016). • the presence of at least a secondary biological treatment, which represents the plants that more likely will use the activated sludge systems in the anaerobic digester (and hence could have biogas production available). The database does not provide indeed information on the availability of an AD section.
The overall number of active WWTPs in Europe is 23,185: among them, the ones with at least a secondary treatment are 77% of the total that corresponds to a total capacity of around 767 million of P.E. Nevertheless, most of them (72% of the active plants with at least the secondary treatment) are very small plants with a capacity lower than 20,000 P.E. In total, the number of suitable WWTPs is around 6,400 which corresponds to 21% of the total recorded plants.

Cluster analysis
WWTP plants were classified into 5 clusters (extra-small XS, small S, medium M, large L, extra-large XL) to identify categories of capacity with relatively homogeneous energy consumption, yields, and energy costs.
Small and medium WWTPs represent an important share of the market in Europe (Table 1), where the WWTP capacity is concentrated in seven countries (Fig. 1).
The number of WWTPs for each size range of the most important countries in terms of biogas production is reported in Table 1. Each category was assigned a cluster size, representing the size range median, which was used for estimating the Pareto frontier in the market analysis (Section 5). Each WWTP cluster was assigned a suitable nameplate capacity of the SOFC module varying from 10 to 150 kW. For example, the medium cluster size M was assigned a 58.3 kW SOFC nameplate capacity as installed in the DEMOSOFC WWTP operating in Collegno (Gandiglio et al., 2020). The SOFC nameplate capacities were assigned on the basis of the estimated WWTP electrical loads and heuristics on the maximum number of modules which could be installed on a site.

Dry mass balance of the plant
The dry biogas potential (DGPP, litres of biogas per P.E. per day) was assessed by performing a dry mass balance of a conventional WWTP system, adopting a secondary treatment (the so-called CAS configuration) (Sanin et al., 2011).
The most diffused WWTP layout in Europe was used as reference (European Environment Agency, 2016) as this is also the most suitable configuration to host anaerobic digestion (Sanin et al., 2011). The plant schematic is shown in Fig. 2 which reports the names of the streams used in the material balance.
The balance of the digester is governed by Eq. (1) on the biogas generation side; on the solid side, S6 contains the remaining fraction of volatile suspended solid non-reacted.
The specific biogas production (SGP), is an input assumption; it normally ranges between 0.75 and 1.12 L biogas per unit of volatile solid destroyed (VSD) (Qasim, 1999). The volatile solids destroyed, are estimated as a percentage, f VSD VSD, expected to range between 30 and 60% of the volatile suspended solids ((Tchobanoglous et al., 2013), (Qasim, 1999)).
Volatile suspended solids (VSS) are estimated as in Eq. (2), which applies to both the stremas entering the digester, S4 and S5, from the total suspended solids (TSS) of the sludge and the percentage of VSS over the TSS (f VSSTSS ), which was set to 0.76 for the primary sludge and to 0.75 for the secondary one, considering that typical values range between 0.76 and 0.79 according to ((Tchobanoglous et al., 2013) and (Qasim, 1999)).
TSS in S5 depend on the VSS from residual BOD in and residual TSS after the secondary pretreatment (VSSr and TSSr).
After a preliminary BOD abatement during the primary treatment (f BODS1 ), an additional abatement occurs during the secondary treatment, which is calculated using an observed yield f BODs . The observed yield f BODs represents BOD transformed into VSS in the secondary treatment (biological reactor) and depends on the water temperature and of the age of the sludge (the higher the age of the sludge, the lower the yield) and is typically assumed to be 0.5 kg of VSS per kg of BOD (Tchobanoglous et al., 2013).
TSS present in S1 (TSS S1 ) are partly removed during the primary treatment (f TSSs1 ) and partly during the secondary treatment of which the fraction of fixed suspended solid represents an estimate f FSSTSS .
The maximum concentration of TSS (TSS max ) and BOD (BOD max ) in the effluent are by law equal to 25 g per m 3 and 35 g per m 3 (European Economic Community, 1991).
In Table 2, BOD and TSS concentration in each stream are reported. DGPP varies between 10 and 29 L per P.E. per day, respectively assuming the lower and upper bound values for SGP and f VSD .

Mathematical formulation
The MILP model here described extends to a two-stage stochastic programming approach the methodology proposed in (Giarola et al., 2018) which optimised the dispatch of a sub-MW co-generation system including n SOFC-CHP generators integrated to the WWTP operating in a deterministic way.
A general novel framework is presented to identify: a) the optimal number of generators, b) the optimal dispatch considering the seasonal variability of the inlet biogas produced. To contain the computational time despite the stochastic analysis, the dispatch model has been formulated aggregating the time scale on a daily basis. The temporal disaggregation reduction leads to an overestimation by 1% of the operating costs of the system but it is needed to reduce the computational time of the algorithm. It is also justified by the lack of input data with hourly resolution.
In the following, the objective function will be first presented, then the equations concerning the fulfilment of energy balances, and the system constraints will be outlined. The CHP unit specific constraints are not reported here as they refer to the deterministic formulation of the SOFC dispatch (Giarola et al., 2018). The full list of symbols is reported in the section Nomenclature.

Objective function
The model minimises the yearly CHP system costs, z, which consist of the expected operating costs OP t,s weighted over the probability prob s of occurrence per scenario, of the annualized capital expenditure (capex) and of the SOFC start-up and shut-down costs. More specifically: • variable operating costs account for the costs cn related to the fuel sent to the supplementary thermal unit and the CHP unit (NGi t,s ), the cost of electricity bought ce t from the grid (Ei t ). cn accounts also for the fuel emission costs. • capital costs (Capex, Eq. (9)) have been linearized to reduce the computational burden of the model; as such they are assumed proportional to the CHP nameplate capacity (n⋅Pnom). They include the unit SOFC capital cost (UCCf), annualized with a capital charge factor (CFC), the unit capital investment for the clean-up unit (UCCc), the unit maintenance and clean-up costs, UMC and UOC respectively • shut-down and start-up (SCosts t ) costs are calculated in terms of the additional electricity consumption absorbed by the SOFCs when the system has to undergo stop and start events (Eq. (10)) OP t,s = Ei(t, s) ⋅ ce(t) − NGi(t, s)⋅cn The model is formulated as a two-stage stochastic modelling framework to embed the effects of the biogas rate fluctuations in the planning and operation of the CHP integrated system. The first stage of the stochastic model includes the decision on whether to set status of each generator on or off at time t as well as the definition of the operating regime which defines the electrical and thermal output. In the second stage, the recourse variables account for the operating costs necessary to adjust the system after the uncertainty is materialized and the actual biogas flow is known. These costs are dependent on the natural gas and the electricity bought from the grid, the biogas storage level, the amount of biogas unexploited.

Energy balances
The sub-MW CHP system has to obey the biogas balance in Eq. (11), where.
• BGi t,s is the flow of biogas from the anaerobic digester at time t and scenario s: • BGb t,s is the flow of biogas sent to the boiler at time t and in scenario s, is the fuel needed by all the CHP units f during their regular operation at a selected regime r • BGS t,f and BGD t,f represent the fuel needs during start-up and shutdown events • BGn t,s is unexploited biogas, which exceeds the storage size and is flared at time t and in scenario s • GH t,s is the biogas being stored in the biogas holder at time t in scenario s The system thermal demand (DTL t,s ) is met via the CHP units f ( a t,r,f η t r ) and the supplementary boiler using either natural gas (NGb t,s ) or biogas (BGb t,s ) (Eq. (12)).
( NGb t,s + BGb t,s ) Finally, Eq. (13) guarantees the electricity balance of the system. Where: • Ed t,s is the on-site electricity demand at time t and scenario s • Ei t,s is the electricity bought from the grid, • the clean-up utility electrical demand is accounted for in terms of the electricity consumption of the two chillers (UEC u ) present in the system: one downstream the digester (BGflow t,s ) and another one upstream the SOFCs ( • the electricity absorbed during start-ups PSS t,f and shut-downs PSD t,f of each module f As stated in Eq. (13), at every hour t, the on-site electrical demand is met by a combination of power generated from the CHP units X t,r,f and electricity from the grid Ei t .

System constraints
Eq. (14) defines a lower (GHL) and an upper (GHU) bound to the biogas storage; Eq. (15) sets that the boiler thermal power must not exceed its capacity (BCap).
Finally, a periodic condition is set to ensure that the CHP operational strategy applies from one year to the next one until the end of the system lifetime. The periodic condition is stated with Eq. (16) where the gas holder level at the beginning of the year has to equal the value at the end of the year.

Methodology
In order to determine the optimal number of SOFC modules, the stochastic formulation of Section 4 was applied to a total of 200 scenarios of biogas profiles and embedded within a Pareto optimisation approach. Each point of the Pareto frontier was obtained fixing the number of modules before running the stochastic model. In this way, the number of modules was varied, starting from 1 and adding one module at a time until the number of 10 modules was reached, as shown in Fig. 3. The Pareto Curve allows to determine the optimal number of modules for each of the WWTP cluster size using an a posteriori approach which is more informative in the decision-making process when conflicting objectives are leveraged. In the problem addressed, the total system costs need to be minimised at the same time as avoiding overcapacities, which would lead to lower SOFC utilization factors.

Biogas profile generalisation
Industrial data of daily biogas profiles from operating plants in Northern Italy (SMAT, 2016) were used in the statistical analysis to model biogas profiles for a generic but plausible plant at any possible size available from the database (European Environment Agency, 2016). In particular, daily profiles of the last 3 years of operation of the DEMOSOFC plant in Collegno (with a size of 180,000 P.E.) and of a 2, 500,000 P.E. WWTP operating in Castiglione Torinese, were used to model probability distribution functions of daily biogas profiles in each season respectively for small-to-medium WWPTs (corresponding to XS, S, M sizes of the database) and for large plants (L and XL capacities of the Fig. 3. Pareto scheme. database).
Data trends were modelled using normal distributions. The seasonal probability profiles of biogas were regressed using daily biogas flow values disaggregated into seasons. The seasonal probability distribution functions obtained in kWh/d were N(9347, 2.0842), N(6426, 1.1952), N(9257, 2.8422), N(11437, 2.8022) for Spring, Summer, Autumn and Winter, respectively. Uncertainty in the profiles due to the datasets length was assessed in (Sechi et al., 2017).
The average value of biogas production of the most productive season was calculated from the database (European Environment Agency, 2016) which reports the person equivalent unit as the maximum organic load produced by the WWTP during the year, assuming a value of specific biogas production equal to 10 L per P.E. per day. The shape of the profile was defined fixing the fraction of seasonal biogas production with respect to the most productive season, the standard deviation (as a percentage of the average seasonal production), and a maximum daily variation between two consecutive days (as percentage of the average seasonal value of biogas production). (1 day, t) generating generalised biogas profiles, where each step represents a consecutive day in a year. Fig. 4 shows the approach used for the stochastic analysis, which has the following main steps: • if the plant capacity A is lower than the threshold for large plants (α), then the first archetype (based on the DEMOSOFC plant, a 1 ) is chosen, otherwise the second archetype is chosen (based on Castiglione Torinese, a 2 ) • for a time step in a season with maximum production (Autumn for XS, S, M; Winter for L, XL) the mean μ M and the standard deviation is estimated as being proportional to the mean • for a time step in any of the remaining seasons, the mean μ S is proportional to μ M through a factor f μ and the standard deviation is proportional to the mean • the seasonal probability distribution functions were randomly sampled applying a rejection test which imposed the maximum variation of the daily biogas rate between two consecutive days observed from the data.

Energy consumption
The electrical loads were determined from the statistical surveys performed in the framework of the European project ENERWATER (ENERWATER enerwater ENERWATER project, 2015). Each WWTP category was assigned the median value of the corresponding consumption value obtained from the survey. From the industrial profiles of electricity consumption, the electricity consumption showed only small fluctuations; therefore it was kept constant during the year. Table 3 summarises the energy input.
From the simulated daily biogas profiles, the daily thermal loads of the plant was calculated as reported in Appendix 9.

Economic input of the model: SOFC cost input and energy costs
The SOFC-CHP system costs were modelled according to (Giarola et al., 2018) and are reported in Table A.3 for convenience. Electricity and natural gas prices extracted from (EUROSTAT, 2016) were selected at the corresponding capacity ranges of the WWTP clusters.

Carbon dioxide emission factors
Accounting for emissions due to electricity consumption implies knowledge of the typical generation mix in each country. In this work, emission factors for electricity generation from the grid were estimated using the IEA database, using an average European value (IEA, 2016).

Results
Results are first presented for the validation of the stochastic model with industrial data for the medium size (M) which corresponds to the DEMOSOFC plant size, also used for the biogas profile generalisation at the small-to-medium scales (section 5.1). The DEMOSOFC plant in Fig. 4. Approach used to generate a generic biogas profile on a daily basis.

Table 3
Size and specific electricity consumption of the WWTP case studies (i.e., capacity ranges). Average European values of electricity and natural gas prices and their corresponding band prices; (all taxes and levies included prices). Collegno was selected to demonstrate the operation of 3 SOFC modules whose dispatch was optimised in (Giarola et al., 2018). In the second part, the generalisation of the methodology to the cluster sizes as extracted from the WTTP database are presented (European Environment Agency, 2016).

Validation
We validated the methodology estimating the number of optimal SOFC modules for the medium size capacity of the WWTP database (European Environment Agency, 2016) as well as comparing variables such as cost distribution and biogas utilization. Fig. 5 represents the total costs of the system, as obtained from the Pareto curve at an increasing number of modules. The total costs include the operating costs of (fuels and electricity) in addition to fixed and maintenance costs. In Figure C.1, the variation of total costs for the number of modules between 1 and 6, displaying the average, as well as minimum and maximum costs obtained from the most optimistic and less optimistic scenario of biogas profile. Fig. 5 and Figure C1 show that the minimum of total costs occurs when three modules are installed. A configuration with 4 modules has comparable total costs. As the number of modules increases beyond 4, there is an increase in costs due to start-up and shut-down events and the technology utilization drops below 70% (Fig. 5).
Despite the increase in total costs compared to a configuration with 3 modules, a configuration with 4 modules allows only marginal improvements in the electricity output ( Fig. 6 and Fig. C.2), in the biogas utilization ratio (77% of the total produced by the anaerobic digester) (Fig. C.3), in operating costs (shown in Fig. C.4), and in the total emissions (shown in Fig. C.5).
The optimal number of modules for WWTP size M, selected on the basis of the minimum total costs would involve 3 modules as the marginal improvements of the introduction of a new module due to the benefits of the co-generation, cannot compensate the additional fixed costs. This choice was adopted for the DEMOSOFC plant in Collegno (SMAT, 2016), assumed as a reference for the deterministc analysis in (Giarola et al., 2018) as well as for the biogas profile generation.
Operating costs (see Fig. C.4) show a 90% share of electricity costs and 10% for the natural gas cost, which is consistent with the empirical observations: industrial data shows 87% of electricity cost and 13% natural gas costs. The prevalence of electricity costs is due to various factors: the SOFC system can only cover 20% of the electrical demand, the WWTP electricity demand is twice the thermal demand, and the unitary electricity cost is higher than the natural gas.

Pareto analyses extended to all cluster sizes
The Pareto approach presented in section 4 was applied to predict the optimal number of SOFC modules for all the clusters (XS, S, M, L, XL) re-iterating the approach at each WWTP cluster size. Fig. 7 shows the estimated SOFC capacity for each cluster size, reiterating the Pareto frontier approach. The optimal number of modules chosen with the total cost minimum is always lower than the corresponding minimum of the operating costs. The strategy proves to be effective at avoiding over-sizing of the generation system, especially at bigger scale where the impact of fixed costs would be higher. Table 4 shows operating costs and total costs (including maintenance and clean-up costs) for all the cluster sizes under the hypotheses presented in 5.3.
In addition to the reference, sensitivity cases were performed on the following technical and economic uncertainties, appraising their effects on the total system costs.
• The effects of a reduction in the thermal demand were addressed assuming that pre-thickening was installed leading to 7% of solid concentration in the sludge, which is the maximum value to keep the sludge viscosity acceptable (Sanin et al., 2011). It was assumed that centrifugal pre-thickening were already installed in the WWTP, without incurring into additional capital costs, and that biogas profile and electricity consumption were equal to the reference. The pre-thickening of the sludges could guarantee a reduction of the operating costs between 9% (M case) and 18% (XS case) with respect to the reference due to the reduction of the thermal load of the plants (Table C.1). • The effect of national policies on fuel and electricity prices in comparison to the average European context presented in the reference case, was assessed modelling the WWTP market of the most biogas productive European countries, such as Poland, France, the Netherlands, United Kingdom, Italy, and Germany. As electricity prices drive the total costs more than natural gas, in the countries where the specific electricity price is above the average European value (like the United Kingdom, Italy and Germany) the annual  operating costs of the plant can reach 30% increase with respect to the average European value. Countries with lower electricity prices, such as Poland and France, would still present better economic performance, but the role of co-generation would be less crucial (see Fig. C.7). • Effects of SOFC performance were assessed assuming the projected improvements reaching SOFC electrical efficiency equal to 60% (Curletti et al., 2015). An increased efficiency of the SOFCs implies a better utilization of the biogas produced by the WWTP plant thus leading to higher SOFC utilization rates. The electricity produced by the SOFC increases by 11% with respect to the base case (see Table C.2) and the total costs minimum occurs when 4 modules are installed (see Fig. C.6 and Table C.3)

Total installable capacity and avoided emissions
The total installable capacity of SOFCs in Europe, a proxy of the technical market size for SOFCs integrated with WWTPs, was estimated correlating the optimal number of modules predicted at each cluster with the corresponding fraction of the WWTP population allocated to each cluster.

Avoided emissions
An estimation of the carbon emission avoided was performed under the following assumptions for the definition of the systems boundaries of the WWTP configuration used as a reference: • For the XS and S sizes, the emissions avoided were assessed with respect to a reference case in which all the electricity and the natural gas are bought from the national grid. • For the sizes M, L and XL, it was assumed that internal combustion engine units (ICEs) were installed to cover the full electricity demand: electrical and thermal efficiencies correspond to 36% and 52% respectively for the M size while 41% and 41% for the L and XL sizes.
The thermal loads were estimated assuming that a sludge prethickening unit were installed leading to TSS of 7%. Without prethickener, ICEs would have a more favourable emission reduction than SOFCs because the WWTP thermal load overcomes the electricity load. Estimates of emission reductions are also sensitive to the carbon intensity of the electricity. Using the minimum and the maximum values of the emission factors from the selected countries in Europe (respectively from France and Poland, the emissions from the WWTPs of size M could vary between 880 and 8,200 t of CO 2 /y. Emissions are reported in Table 5.

Improvements of biogas yields
WWTPs display variability in yields which not only depends on influent seasonal composition, but also on potential integration of external substrates and plant operating practice. In addition to the biogas yield value assumed in the reference (in Section 3.4, the Pareto frontier approach was performed doubling the DGPP, consistently updating thermal and electrical loads, and keeping all the economic assumptions fixed (Table 6).
At a European level, the market potential of SOFCs in the WWTP industry, ranges between 650 and 1,370 MW assuming a conservative value on biogas yields (DGPPref equal to 10 L/P.E.). The potential SOFC power to install in Europe could double if the biogas availability was double. These values would correspond to a cumulative number of 58.3 kW units between 11,000 and 22,000 which would enable capital cost reduction of more than 60% on the current capital costs. Cost reductions are expected both on the stack side and on the system due to semiautomation of the production and assembly process, in addition to the improved stack durability.

Concluding remarks
This work proposes a stochastic Mixed Integer Linear Programming optimisation model which is embedded in a Pareto fronteir approach to assess the techno-economic feasibility and the optimal size of a solid oxide fuel cell system integrated in a wastewater treatment facility of any size in Europe. The stochastic implementation allowed to enhance the robustness of the model by including the uncertainties due to the fluctuations of the biogas production. The Pareto frontier was generated for representative wastewater treatment plant sizes eligible for cogeneration, as obtained from a cluster analysis of the wastewater treatment plants in Europe. The resulted potential installed capacity was used as a proxy of the market size for solid oxide fuel cells integrated with wastewater treatment plants. The approach, validated on an industrial wastewater treatment plant, captures the biogas availability and its fluctuations: both are among the key bottlenecking factors to an efficient exploitation of the technology (i.e., at an utilization factor higher than 70%).   A maximum installable capacity between 650 and 1,370 MW, depending on the specific biogas production yield (10 or 20 L per P.E. per day, respectively) could be realised in Europe in a carbon neutral context. This value would correspond to a cumulative number of 58.3 kW -units greater than 10,000 which would enable a CAPEX reduction of more than 60% on the current capital costs. Solid oxide fuel cells have the potential to reduce more remarkably the wastewater treatment sector emissions in countries such as Poland, where they could promote the displacement of carbon-intensive electricity. The value of the total installable capacity of solid oxide fuel cells, although uncertain, makes the wastewater treatment a promising niche market for exploiting the technology and enabling a cost reduction which could open novel markets. Information such as plant layout, local regulations, and budget limitations, were not included in the analysis, as they are not available at a European level.
The smallest wastewater treatment plants size range, lower than 150,000 P.E. per year, represents the greatest part of the technical market for solid oxide fuel cells. If energy use were optimised reducing the thermal loads, opportunities for the use of solid oxide fuel cells would be more tangibly profitable than state-of-the-art technologies such as internal combustion engines. Despite the obvious benefits of sludge pre-thickening, budget constraints prevent in most of cases, wastewater treatment plants from investing in these energy savings solutions. Given the constraints due to capital budgeting, policy makers should target tools to enable wastewater treatment plants to overcome capital access limitations, allowing the diffusion of best available technologies and advanced co-generation options, such as solid oxide fuel cells.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. The daily thermal load of the digester, based on (Tchobanoglous et al., 2013), has the following contributions: • heating up the inlet sludge Qs t (Eq. B.1), proportional to the daily sludge flow (m t ), its calorific value cp (assumed equal to 4.2 kJ per kg per K), and the temperature difference between the digester (Td t ) and the sludge (Ts t ). Td t is controlled and kept constant per day, and equal to 40 • C. m t is correlated to the stochastically generated biogas profile, normally preceding it by 30 days, which sum the retention time of the solids (20 days) and the retention time of the biological reactor Qs t = cp ⋅ m t ⋅(Td t − Ts t ) (B.1) • compensating for the heat losses from the vessel top and bottom, which, as shown in Eq. B.2 and B.3, depend on the corresponding heat transfer coefficient of the top and aboveground wall (Ut) and the bottom and underground wall (Ub), corresponding to the heat transfer surface of the top (At) and the bottom (Ab), and temperature difference of the digester temperature with the ambient air (Ta t ) and the ground (Tg t ). The vessel bottom was assigned a transfer coefficient value Ub equal to 2.13 W/(m 2 K) assuming an average moisture value of the ground; the vessel top and walls were assigned a value respectively of 0.9 and 2.87 W/(m 2 K) (Tchobanoglous et al., 2013).
• balancing the losses due to the pipes, which typically represent 10% of the plant thermal load The yearly external temperature Ta t profiles were retrieved from (NOAA, 2016). For example, for selected countries (Italy, UK, Germany, France, Spain, Netherlands, Poland), the most densely populated city located in the North of each Country was used as geographical reference. For Europe, an average temperature profile was chosen. In addition, it was assumed that the temperature of the ground was constant throughout the year; it was set equal to 5 • C.
The inlet temperature of the sludge Ts t is a controlled operational parameter in WWTPs which never falls below a certain threshold (10 • C), as the primary and secondary sludges are always pre-heated. From the observed data, a weighted averaged value (between the minimum and 80% of the air temperature) was assigned the sludge when the external temperature is higher than the threshold.
Heat transfer areas were calculated from the digester volume V, which is determined from the sludge flow and the retention time SRT (B.4). The sludge flow is calculated from the influent So t , considering a specific sludge production of 50 g per P.E. (SSP), and a fraction of total suspended solids equal to 3%. The sludge density rho was assumed equal to 1.020 kg per L. From the volume of the digester assumed to be cylindrical, a height to diameter ratio of 1.7 was used to estimate the height, 20% of which would go under ground.
C. Appendix C.