A Review of the State of the Art of Biomethane Production: Recent Advancements and Integration of Renewable Energies

: Anaerobic Digestion (AD) is a well-established process that is becoming increasingly popular, especially as a technology for organic waste treatment; the process produces biogas, which can be upgraded to biomethane, which can be used in the transport sector or injected into the natural gas grid. Considering the sensitivity of Anaerobic Digestion to several process parameters, mathematical modeling and numerical simulations can be useful to improve both design and control of the process. Therefore, several different modeling approaches were presented in the literature, aiming at providing suitable tools for the design and simulation of these systems. The purpose of this study is to analyze the recent advancements in the biomethane production from different points of view. Special attention is paid to the integration of this technology with additional renewable energy sources, such as solar, geothermal and wind, aimed at achieving a fully renewable biomethane production. In this case, auxiliary heat may be provided by solar thermal or geothermal energy, while wind or photovoltaic plants can provide auxiliary electricity. Recent advancements in plants design, biomethane production and mathematical modeling are shown in the paper, and the main challenges that these ﬁelds must face with are discussed. Considering the increasing interest of industries, public policy makers and researchers in this ﬁeld, the efﬁciency and proﬁtability such hybrid renewable solutions for biomethane production are expected to signiﬁcantly improve in the next future, provided that suitable subsidies and funding policies are implemented to support their development.


Introduction
Finding alternative ways to produce energy is one of the most important challenges of today's society, due to the increasing global energy demand [1]. According to data provided by the IEA, the total consumption of electricity and natural gas and the total CO 2 emissions has more than doubled in the last 30 years [2]. Nevertheless, energy production from renewable sources showed an exponential growth in the last 20 years and more and more solutions are being explored [3]. In this framework, the concept of sustainability arises, namely the correct balancing between energy consumption and green energy production, which is the subject of study for several works [4].
A first attempt to solve the Greenhouse Gases (GHG) emissions problem was performed by the Kyoto Protocol, signed in December 1997, when industrialized countries, in the so called "Annex B", agreed to reduce, by a significant amount, CO 2 emissions [5]. This process was continued with the Paris Agreement, signed in 2015, where a "pledge and review" system, which involves all countries, was established. The main goal of this main goal of this agreement was to reduce the GHG emissions and consequently brake the increase in the global average temperature from 2 °C to 1.5 °C from the levels in the 1990s [6].
EU, for its part, defined its own targets for 2030 with more restrictions and aims to a near-zero emissions scenario by 2050, which is of great relevance to biogas technology. Recent advancements in EU policies forecasted that by 2030, the total energy required must be satisfied by renewables at 32%, and a new restriction has been posed in the road vehicles sector. In fact, 14% of the overall energy consumption from road and rail transports must be satisfied using renewable sources and at least 3.5% is targeted to be reached by biofuels [7]. In addition, the International Panel on Climate Change (IPCC) forecasted that energy generation from biomass, including various types of biofuels, will stand at 50,000, 75,000 and 89,000 TWh by 2050, 2075 and 2100, respectively [8]. This new worldwide involvement makes biogas a strategic resource for developing countries, where there is a large availability of agricultural wastes [9] and animal wastes [10]. Several studies for these countries show the high potential for electricity production from biogas [11] and highlight the various economic, social and political constrains [12]. EU targeted to reach nearly 100% of renewable energy production by 2050 and step-by-step analyses on the energy, environmental and socio-economic aspects of different scenarios for that transition were considered [13]. Amongst the innovative solutions, biogas is establishing itself as one of the most promising technologies. Nowadays, there is about 18 GW of electric power installed around the world, mostly in Germany, the USA and the UK [14]. Biogas upgrading to biomethane then leads to the possibility of injection into the national gas grid, possibly determining a strong reduction of greenhouse gases (GHG) emissions due to the road transport sector [15]. The increasing interest in such technologies is also shown by the number of research works in the last 20 years, shown in Figure 1. It is widely known that biogas is obtained by a combination of complex biochemical reactions known as "Anaerobic Digestion (AD) process" [16]. The complexity of AD results in a special sensitivity of the whole process to several parameters, which must be kept constantly under control to avoid possible inhibition of micro-organisms, It is widely known that biogas is obtained by a combination of complex biochemical reactions known as "Anaerobic Digestion (AD) process" [16]. The complexity of AD results in a special sensitivity of the whole process to several parameters, which must be kept constantly under control to avoid possible inhibition of micro-organisms, determining a lower biogas yield [17]. For instance, one of the main factors that limit the biogas production is the presence of toxic compounds in the inlet substrate [18]. In case of a high presence of lipids, the AD process is remarkably unstable, due to their viscosity at the operating temperature and their toxicity [19]. Saponification and emulsification are the most common solutions to avoid issues related to fat oil and grease (FOG) [20]. AD plants usually operate in mesophilic conditions (between 30 • C and 40 • C), adopting an external sludge separation and an internal membrane that catches FOGs [21].
Mathematical modeling represents a useful support to assess the optimal design and operating conditions of digesters through software simulations [22]. Predictive models are largely used to analyze the behavior of the biochemical systems, analyzing the effect of the variation of the operating parameters and determining the optimal set of design parameters. To this scope, transient thermal models can be helpful to predict time-dependent thermal losses due to the variation of boundary conditions [23]. Biogas plants also need a certain amount of thermal energy and auxiliary electricity for mixing or pumping; in case of upgrading to biomethane, additional auxiliary energy is required [24]. Electricity and thermal energy can be provided by renewable technologies, to improve the sustainability of the overall process [25].

Aim of the Paper
The integration of renewable energies in AD processes is crucial to support the full decarbonization of this sector and to achieve a more sustainable overall biogas/biomethane production [26]. Mathematical and simulation models represent powerful tools that allow the definition of hybrid energy production systems, including different types of renewables. The aim of this work is to provide a critical analysis of the recent advancements in biogas and biomethane technologies, with special attention to the integration with other renewable sources. To the best of the authors' knowledge, there has not been any exhaustive and updated work in the literature which critically reviews biomethane plant design and operation criteria, paying special attention to the integration of the process with other renewable energy sources. The present paper aims to cover this gap, also providing an overview of the current biogas and biomethane diffusion around the world. The most important advancements in biogas plants technology are then reported, especially focusing on wastewater treatment plants based on upflow anaerobic sludge bed reactors and membrane reactors, which have been largely studied and improved upon in the past few years. Subsequently, biomethane production alternatives are analyzed, with a critic approach to the most recent solutions. A comparison among upgrading treatments, lignocellulosic biomass gasification and enhanced hydrogenotrophic methanogenesis is also presented. A comprehensive investigation of the most diffused biological, thermal and combined models is presented, along with the results of experimental analyses. The last section is focused on the comparison of different biogas and biomethane plants, including other renewable sources, to explore the state of the art of these complex systems and to show how these different options can be integrated. The latest models and experiments carried out on hybrid renewable energy system are discussed and compared. Finally, the state of the art of studies on multi-renewable energy systems is shown along with a comparative analysis of costs and primary energy savings, which are crucial to evaluate the potentials of these technologies in future scenarios.

Method
The current development of biogas and biomethane resources can be addressed using a schematic approach which involves several aspects. The method used in this work is to analyze the most innovative solutions regarding the above-mentioned aspects of the biogas production and upgrading. An in-depth literature review was performed, analyzing the following aspects: Plant distribution: the current diffusion of biogas plants around the world is presented, along with their main characteristics; then, the potential diffusion in the next years is evaluated, based on the actual international policies. • Technology advancements: recent developments of biomethane production show a trend in using wastes and mainly wastewater; domestic and industrial wastewater treatment are gaining a large diffusion, also due to recent developments of sludge bed reactors [27]. • Mathematical modeling: many different dynamic models have been developed, regarding different technologies, the type of biomass to be treated, the external conditions and the possible integration with other renewables. • Hybrid solution for biogas and biomethane production: lignocellulosic biomass gasification and hydrogen are emerging as interesting enhancers of the methane production in AD processes [28]; the use of other renewable sources, such as solar and wind energy, is also becoming the subject of many works [29].

Biogas and Biomethane in the World
According to the International Renewable Energy Agency (IRENA), the biogas production grew massively in the last 10 years [30]. In Figure 2, a map is reported showing the total energy production from biogas for power generation, at the end of year 2018, for each country.

•
Plant distribution: the current diffusion of biogas plants around the world is presented, along with their main characteristics; then, the potential diffusion in the next years is evaluated, based on the actual international policies. • Technology advancements: recent developments of biomethane production show a trend in using wastes and mainly wastewater; domestic and industrial wastewater treatment are gaining a large diffusion, also due to recent developments of sludge bed reactors [27].

•
Mathematical modeling: many different dynamic models have been developed, regarding different technologies, the type of biomass to be treated, the external conditions and the possible integration with other renewables.

•
Hybrid solution for biogas and biomethane production: lignocellulosic biomass gasification and hydrogen are emerging as interesting enhancers of the methane production in AD processes [28]; the use of other renewable sources, such as solar and wind energy, is also becoming the subject of many works [29].

Biogas and Biomethane in the World
According to the International Renewable Energy Agency (IRENA), the biogas production grew massively in the last 10 years [30]. In Figure 2, a map is reported showing the total energy production from biogas for power generation, at the end of year 2018, for each country. Five main geographical areas can be distinguished as the main producers of biogas, namely: North America, Latin America, Europe, East Asia (mainly China) and Australia. Unfortunately, data are not available for some countries, due to the total absence of bioenergy production and/or to the lack of official data. In particular, in Africa, only few countries can rely on biogas facilities, whose main producer is South Africa with 45 GWh/year. In a recent work, Dumont et al. [31] reported an interesting socioenvironmental analysis of the condition of the African population and the possibility to enhance the use of renewables in some areas. According to their work, the diffusion of biogas technology in Africa is strongly constrained by the "yuck factor". This is a negative perception of the naturalness of something which reflects in the repulsion of the thing Five main geographical areas can be distinguished as the main producers of biogas, namely: North America, Latin America, Europe, East Asia (mainly China) and Australia. Unfortunately, data are not available for some countries, due to the total absence of bioenergy production and/or to the lack of official data. In particular, in Africa, only few countries can rely on biogas facilities, whose main producer is South Africa with 45 GWh/year. In a recent work, Dumont et al. [31] reported an interesting socio-environmental analysis of the condition of the African population and the possibility to enhance the use of renewables in some areas. According to their work, the diffusion of biogas technology in Africa is strongly constrained by the "yuck factor". This is a negative perception of the naturalness of something which reflects in the repulsion of the thing itself, in that case the disgust for putrid wastes and fetid smells. The research activity is carried out by means of surveys to a relevant number of participants both of high income and low income. The results showed that most participants of both categories perceive biogas as a "contaminated" technology, in contrast with other renewables which are seen as "natural". Beyond the psychological aspect, a diffused poverty is the main issue for the rural communities in sub-Saharan territories [32]. Surprisingly, Russia is a low producer of biogas despite the high potential for biogas production and its upgrading for biofuel utilization. The reasons for this endurance are explained in [33], where a deep evaluation is made about all the technical, economic, market and institutional barriers which constrain Russia to be a coal-dependent country. China is instead one of the major producers of biogas, with a total production of more than 3200 GWh/year reached at the end of 2018. The downside of such a massive production is that almost 70% comes from household digesters [34], which means that only a small percentage is upgraded to biomethane or biofuels. The Chinese National Development and Reform Commission recently issued a guidance document laying down the guidelines for the biogas production at industrial scale and upgrading to biomethane [35]. As a consequence of this rethink, the number of household digesters recently started decreasing [36]. EU countries have instead a mature policy framework compared to Chinese one [37] and so the upgrading and methanation technologies are already well-established. Germany was the first country in the world to produce biogas, with more than 33,000 GWh produced at the end of 2018. Germany accounts for approximately 48% of the total EU biomethane production, followed by UK at 14% and Sweden at 8.4% [38]. The most diffused reactors are continuously stirred tank reactors (CSTRs), which represent 90% of the total biomethane plants and biomass is essentially harvested from energy crops [39]. IEA stated that in the last few years, the energy crop utilization significantly decreased by means of several policies which instead promote the use of animal manure, which is the main source in China, and municipal solid waste, mainly used in the USA. In this regard, wastewater treatment is receiving more and more attention, as discussed later. Other solutions are applied in Central and South American countries, where sugarcane is widely used [40], or in Australia, where the main source is bagasse [41]. For sake of clarity, in Table 1, a summary of the declared data of power generation is reported, always referring to the end of year 2018. Data about biomethane production are also shown in Figure 3, for different geographic areas.

AD Technologies
Plenty of works are available in the literature dealing with the AD process and all the related biochemical processes; in particular, the ADM1 model is the most used one [42]. According to this model, the whole AD process can be divided into four sequential steps, namely: hydrolysis, acidogenesis, acetogenesis and methanogenesis. These steps, schematically shown in Figure 4, lead to the formation of a mixture of gases, principally CH4 and CO2, from the input biomass [43]. In the following paragraphs, the most updated and relevant works regarding the anaerobic digestion process are presented, along with some comments concerning the source used.

AD Technologies
Plenty of works are available in the literature dealing with the AD process and all the related biochemical processes; in particular, the ADM1 model is the most used one [42]. According to this model, the whole AD process can be divided into four sequential steps, namely: hydrolysis, acidogenesis, acetogenesis and methanogenesis. These steps, schematically shown in Figure 4, lead to the formation of a mixture of gases, principally CH 4 and CO 2 , from the input biomass [43].

AD Technologies
Plenty of works are available in the literature dealing with the AD process and all the related biochemical processes; in particular, the ADM1 model is the most used one [42]. According to this model, the whole AD process can be divided into four sequential steps, namely: hydrolysis, acidogenesis, acetogenesis and methanogenesis. These steps, schematically shown in Figure 4, lead to the formation of a mixture of gases, principally CH4 and CO2, from the input biomass [43]. In the following paragraphs, the most updated and relevant works regarding the anaerobic digestion process are presented, along with some comments concerning the source used. In the following paragraphs, the most updated and relevant works regarding the anaerobic digestion process are presented, along with some comments concerning the source used.

Open Digestion Chamber Reactor
In a recent study, Pilarski et al. [44] analyzed the anaerobic digestion process of wastewater treatment plants (WWTP) working at operating temperature of 20 • C in two open digestion chambers (ODC) of about 6000 m 3 , in Poland. Figure 5 shows how the biogas is gathered from the open chamber. The operating condition of the psychrophilic digesters were reproduced in laboratory and measurements results revealed that in a real case, 68.5% of CH 4 in the gas mixture was found, whereas the same situation in a laboratory experiment showed a value of 69.7%, comparable with that of a mesophilic process, where the operating temperature is higher.

Open Digestion Chamber Reactor
In a recent study, Pilarski et al. [44] analyzed the anaerobic digestion process of wastewater treatment plants (WWTP) working at operating temperature of 20 °C in two open digestion chambers (ODC) of about 6000 m 3 , in Poland. Figure 5 shows how the biogas is gathered from the open chamber. The operating condition of the psychrophilic digesters were reproduced in laboratory and measurements results revealed that in a real case, 68.5% of CH4 in the gas mixture was found, whereas the same situation in a laboratory experiment showed a value of 69.7%, comparable with that of a mesophilic process, where the operating temperature is higher. Figure 5. Scheme of biogas gathering: 1-ODC, 2-gas sampler, 3-pump, 4-differential pressure meter, 5-biogas meter [44].

Sludge Bed Reactor
Recent upgrades of the Upflow Anaerobic Sludge Blanket (UASB) are innovative solutions which are receiving attention in the field of wastewater treatment [45]. In USAB reactors, the ascendent flow of wastewater combines with a blanket of flocculant sludge, creating a suspended granular bed where a prolific bacterial growth occurs. Kumari et al. [46] studied the performance of a single stage UASB reactor operating with a co-substrate of different wastes, showing a great impact on the biogas yield. The reactor was a 1 L UASB, operating in mesophilic conditions for about 20 days. During the experiments, both pH and VFA percentages were monitored and controlled. The total COD removal percentage ranged between 76% to 86%, and the best performance was obtained by mixing wastewater with cow manure. A maximum biogas production of 4.5 L/day was reached. In a recent work, Jiraprasertwong et al. [47] developed an interesting three-stage UASB reactor, whose layout is shown in Figure 6. The concept behind this work is to develop a model for a high yield biodigester with a large optimum COD loading rate thanks to the presence of a granular sludge bed in all the reactors. The volume ratio of each reactor is selected with the aim of suiting each step of AD process within a unique reactor by considering the different growth rates of the sequential steps. In this case, it can be assumed that the hydrolysis step is negligible, since most wastewaters mostly contain lightweight organic compounds with a large fraction of water-soluble organic matters [48]. The experiment started with an optimum loading rate of 15 COD kg/m 3 d, but the long operation led to the increase of this value to up to 28 COD kg/m 3 d.

Sludge Bed Reactor
Recent upgrades of the Upflow Anaerobic Sludge Blanket (UASB) are innovative solutions which are receiving attention in the field of wastewater treatment [45]. In USAB reactors, the ascendent flow of wastewater combines with a blanket of flocculant sludge, creating a suspended granular bed where a prolific bacterial growth occurs. Kumari et al. [46] studied the performance of a single stage UASB reactor operating with a cosubstrate of different wastes, showing a great impact on the biogas yield. The reactor was a 1 L UASB, operating in mesophilic conditions for about 20 days. During the experiments, both pH and VFA percentages were monitored and controlled. The total COD removal percentage ranged between 76% to 86%, and the best performance was obtained by mixing wastewater with cow manure. A maximum biogas production of 4.5 L/day was reached. In a recent work, Jiraprasertwong et al. [47] developed an interesting three-stage UASB reactor, whose layout is shown in Figure 6. The concept behind this work is to develop a model for a high yield biodigester with a large optimum COD loading rate thanks to the presence of a granular sludge bed in all the reactors. The volume ratio of each reactor is selected with the aim of suiting each step of AD process within a unique reactor by considering the different growth rates of the sequential steps. In this case, it can be assumed that the hydrolysis step is negligible, since most wastewaters mostly contain lightweight organic compounds with a large fraction of water-soluble organic matters [48]. The experiment started with an optimum loading rate of 15 COD kg/m 3 d, but the long operation led to the increase of this value to up to 28 COD kg/m 3 d. Second-generation UASBs are known as Expanded Granular Sludge Bed (EGSB) reactors. The main difference compared to UASB reactors is their higher upflow velocity (about 6 m/h). This allows the expansion of the granular sludge bed, and the wider high/diameter ratio enables the reactor to put in contact wastewater and granules for enough time. Faria et al. [49] observed that the high shear of the upflow velocity in EGSB reactors negatively affects the sludge granulation. Furthermore, the effluent recirculation also shows negative effects on sludge granulation when the solid organic loading rate (SOLR) is higher. This suggests starting the sludge granulation in an UASB reactor and then proceeding with an EGSB-type reactor, by adding partial effluent recirculation when the sludge density is established. In this work, the authors also found that calcium chloride is a good precursor for sludge granulation.
Third-generation UASB reactors are also known as External Circulation Sludge Bed reactors (ECSB). In this case, there are two settler layers operating at different upflow rates to allow a complete disintegration of different size granules. Diamantis et al. [50] studied the performance of an ECSB reactor working with high cheese content wastewater (CWW). The system includes an external circulation column as shown in Figure 7 and is of particular interest of the high content of calcium in the influent, which may have negative effects on the long term. Second-generation UASBs are known as Expanded Granular Sludge Bed (EGSB) reactors. The main difference compared to UASB reactors is their higher upflow velocity (about 6 m/h). This allows the expansion of the granular sludge bed, and the wider high/diameter ratio enables the reactor to put in contact wastewater and granules for enough time. Faria et al. [49] observed that the high shear of the upflow velocity in EGSB reactors negatively affects the sludge granulation. Furthermore, the effluent recirculation also shows negative effects on sludge granulation when the solid organic loading rate (SOLR) is higher. This suggests starting the sludge granulation in an UASB reactor and then proceeding with an EGSB-type reactor, by adding partial effluent recirculation when the sludge density is established. In this work, the authors also found that calcium chloride is a good precursor for sludge granulation.
Third-generation UASB reactors are also known as External Circulation Sludge Bed reactors (ECSB). In this case, there are two settler layers operating at different upflow rates to allow a complete disintegration of different size granules. Diamantis et al. [50] studied the performance of an ECSB reactor working with high cheese content wastewater (CWW). The system includes an external circulation column as shown in Figure 7 and is of particular interest of the high content of calcium in the influent, which may have negative effects on the long term.
By varying the OLR from 5 to 18 kg/m 3 d, calcium precipitation and process efficiency of the process were comprehensively evaluated. The results showed that the proposed ECSB layout for particularly advantageous for the calcium-rich wastewaters. The reason is probably the CaCO 3 precipitation in the neutralization tank and the crystals washing out due to the high upflow rate of 5 m/h.  By varying the OLR from 5 to 18 kg/m 3 d, calcium precipitation and of the process were comprehensively evaluated. The results showed ECSB layout for particularly advantageous for the calcium-rich wastew is probably the CaCO3 precipitation in the neutralization tank and the out due to the high upflow rate of 5 m/h. An innovative solution was proposed by Torres et al. [51], who c experimental tests on laboratory scale reactors seeded with slud wastewater treatment plants (WWTPs) located in Spain. The reactors mesophilic conditions at different hydrodynamic regimes, varying th from 0.10 m/h (UASB) to 3 m/h (EGSB), assisted by chitosan. The l demonstrate that its presence in the start-up phase favors the form microbial granules from the flocculant. Not only was their hypothesis c solid retention was also independent of the hydrodynamic conditions i This means that this solution can be applied to both UASB and EGSB r et al. [52] tried to overcome the limitations of the anaerobic treatment means of the innovative solution of the fluidized active filling reacto their experiment, the effect of FAF on sugar industry effluent was t organic loading rates (OLR), more precisely from 4 to 6 kgCOD/m 3 d. T that, within this OLR range, the COD removal efficiency was greater methane yield was greater than 70%. However, when the OLR was kgCOD/m 3 d, the effluent treatment efficiency strongly decreased mai An innovative solution was proposed by Torres et al. [51], who carried out several experimental tests on laboratory scale reactors seeded with sludge coming from wastewater treatment plants (WWTPs) located in Spain. The reactors operated in sub-mesophilic conditions at different hydrodynamic regimes, varying the upflow velocity from 0.10 m/h (UASB) to 3 m/h (EGSB), assisted by chitosan. The latter was used to demonstrate that its presence in the start-up phase favors the formation of compact microbial granules from the flocculant. Not only was their hypothesis confirmed, but the solid retention was also independent of the hydrodynamic conditions inside the reactors. This means that this solution can be applied to both UASB and EGSB reactors. Debowski et al. [52] tried to overcome the limitations of the anaerobic treatment of wastewater by means of the innovative solution of the fluidized active filling reactor (FAF-R). During their experiment, the effect of FAF on sugar industry effluent was tested at different organic loading rates (OLR), more precisely from 4 to 6 kgCOD/m 3 d. The results showed that, within this OLR range, the COD removal efficiency was greater than 74% and the methane yield was greater than 70%. However, when the OLR was increased up to 8 kgCOD/m 3 d, the effluent treatment efficiency strongly decreased mainly due to the pH reduction. Similar work is proposed by Dohdoh et al. [53], who analyzed the effect of carrier filling media inside a UASB reactor. In their work a comparison is made between an integrated fixed-film anaerobic sludge (UASB-IFAS) and a traditional UASB with activated sludge (UASB-AS). Both systems showed high organic matter and ammonia removal efficiency under different operating conditions in which organic loading rate (OLR), hydraulic retention time (HRT), temperature and other parameters were varied. In particular, the hybrid solution showed greater stability when hydraulic and organic loads were changed. Optimum HRT was found at 6 h with 95% COD removal efficiency and increasing the temperature improved system operation.
Innovative wastewater treatment plants must be analyzed not only from a technological point of view but also considering the environmental and economic aspect. Arias et al. [54] performed an LCA and LCC comparative analysis of three different innovative wastewater UASB technologies versus a conventional USB system. The systems proposed for comparison were upflow anaerobic sludge blanket (UASB), integrated fixed film activated sludge (IFAS), high rate activated sludge (HRAS) and IFAS, and rotating belt filter (RBF) chemically enhanced primary treatment (CEPT) followed by an IFAS unit. The results showed that the innovative solutions have a great environmental impact when the biogas produced is used to self-sustain the energy needs of the plant; otherwise, the conventional solution is even better in some cases. This is due to the high energy consumption of the proposed system, in particular the HRAS. From an economic point of view, there is a saving of 13% due to aeration when the IFAS unit is integrated, but the costs can increase by 50% when chemical technologies are used. These analyses showed how the validation of a technology depends both on the environmental and economic aspects as well as on the advancement of the proposed solution itself.

AnMBR Reactor
Anaerobic Membrane Bio-Reactors (AnMBR) are gaining increasing popularity as advanced technologies for high quality biogas production from wastewater treatment. In a recent work, Maaz et al. [55] critically analyzed the pros and cons of several AnMBR alternatives, assessing that the main limit to the diffusion of this technology is membrane fouling. In Figure 8, several configurations are shown and analyzed, whose potential production and energy consumption are compared. The results showed that the crossflow AnMBR is by far the most energy consuming solution, whereas the Hybrid MFC-MBER system is the less energy consuming one.
Campo et al. [56] provided an interesting review of the effect of aerobic granular sludge (AGS) on the membrane fouling problem in membrane bioreactors (MBR). This combined solution (AGS-MBR) could potentially avoid the main issue of the membrane reactors, which is the membrane fouling that causes the occlusion of the upflow. AGS is an innovative concept for the biofilm, characterized by a high simplicity of arrangement, a high resistance to toxic compounds typical of wastewaters, a strong microbial structure and a high removal efficiency. Unfortunately, this solution is strongly affected by the structural stability required to the granular sludge, since the mean size of the granules should always be well below the critical value. The biofouling problem was also studied by Medina et al. [57] for a submerged AnMBR in which domestic wastewater was treated under mesophilic operating conditions. Their interest was focused on the soluble microbial products (SMP), which are the main issues for membrane fouling. For the analysis of the SMP inside the reactor, samples of both permeate and sludge were taken at different heights of the 32 L lab-scale reactor used for the tests. The main result of the chemical analysis of the SMP was that the unknown fraction of the COD was prevalent over the known one, so further studies on the composition of SMP should be done to solve the problem of membrane fouling.
An extensive comparison between these technologies and other membrane innovative solutions was made by Krzeminski et al. [58], who carried out an overall analysis of the life cycle of the existing systems and identified the market prospects. According to their survey, the AnMBR systems have high energy consumption and high environmental impact compared to other solutions, such as electromembrane (MEBR) or forward osmosis (FO-MBR). It is difficult to judge the corresponding market potential, as the market growth depends on the type of technology used for fouling mitigation and the manufacturers involved. In fact, fouling control and membrane economics are the main aspects to consider for these technologies. Further analyses require the development of antifouling membranes, stable flow production and suitable pretreatment processes. An extensive comparison between these technologies and other membrane innovative solutions was made by Krzeminski et al. [58], who carried out an overall analysis of the life cycle of the existing systems and identified the market prospects. According to their survey, the AnMBR systems have high energy consumption and high environmental impact compared to other solutions, such as electromembrane (MEBR) or forward osmosis (FO-MBR). It is difficult to judge the corresponding market potential, as the market growth depends on the type of technology used for fouling mitigation and the manufacturers involved. In fact, fouling control and membrane economics are the main aspects to consider for these technologies. Further analyses require the development of antifouling membranes, stable flow production and suitable pretreatment processes.
An overview of strategies concerning fouling mitigation is proposed by Anjum et al. An overview of strategies concerning fouling mitigation is proposed by Anjum et al. [59], who considered some membrane enhancing solutions as the best performing ones. Hybrid processes such as Granular Anaerobic Membrane Bioreactor (G-AnMBR), Forward Osmosis Anaerobic Membrane Bioreactor (FO-AnMBR) and Microbial Electrolysis Cell-Anaerobic Membrane Bioreactor (MEC-AnMBR) strongly improve the overall efficiency of the treatment. Unfortunately, these solutions are still in their infancy, so resizing is not an option. In a recent study, Huong et al. [60] designed a lab-scale Anaerobic-Anoxic-Oxic Moving Bed Biological Reactor (A20-MBBR) for of coal gasification wastewater treatment. It is a toxic effluent of the coking industry which must be treated as it is rich in complex phenolic substances. In fact, before entering the reactor, the wastewater was pre-treated with an internal electrolysis using Fe-C materials. The results showed that the combined action of electrolysis pre-treatment and A20-MBBR process led to 100% decomposition of phenolic compounds and high efficiency for COD and nitrogen removal.

Internal Circulation Reactor
This technology comes from the development of third-generation UASB reactors using a double layer configuration with a gas-driven internal circulation system [61]. In a recent work Cheng et al. [62] analyzed the performance of a brewery wastewater-fed internal circulation (IC) reactor. Their main interest was in the observation of bacterial community mechanisms at different heights of the digester for large-scale brewery wastewater treatment. A layout of the digester is shown in Figure 9.
Anaerobic-Anoxic-Oxic Moving Bed Biological Reactor (A20-MBBR gasification wastewater treatment. It is a toxic effluent of the coking indus be treated as it is rich in complex phenolic substances. In fact, before enter the wastewater was pre-treated with an internal electrolysis using Fe-C results showed that the combined action of electrolysis pre-treatment a process led to 100% decomposition of phenolic compounds and high effi and nitrogen removal.

Internal Circulation Reactor
This technology comes from the development of third-generation using a double layer configuration with a gas-driven internal circulation s recent work Cheng et al. [62] analyzed the performance of a brewery internal circulation (IC) reactor. Their main interest was in the observat community mechanisms at different heights of the digester for large wastewater treatment. A layout of the digester is shown in Figure 9. Experiment lasted for two years, and samples of bacterial species several heights by means of reserved pipes. The high relevance of this solu by the results, which showed a total COD removal efficiency between 80% In Table 2, a comparison of the proposed innovative plants is mad technology, the analyzed waste, the operating conditions and the scaling Proper references are added. Experiment lasted for two years, and samples of bacterial species were taken at several heights by means of reserved pipes. The high relevance of this solution is revealed by the results, which showed a total COD removal efficiency between 80% and 84%.
In Table 2, a comparison of the proposed innovative plants is made basing on the technology, the analyzed waste, the operating conditions and the scaling of the system. Proper references are added. Recently, innovative solutions also involved small-scale plants (<200 m 3 ), to make them competitive with the largest ones. Bienert et al. [63] compared small-scale and largescale digesters under different aspects, evaluating technical, environmental and economic parameters. The analysis covered biomass pretreatments, digester operation and upgrading units, with data collected from existing plants in Europe. The results highlight that in many cases, the electricity demand for small-scale plants is comparable to that of large-scale ones, and so it is the required thermal energy. Hence, the most important thing that needs to be considered for the feasibility of a small-scale plant is how it can be integrated with the environment. It is, therefore, a matter of intelligent interlinking between the plant and the context that must be connected within it.

Biomass Pre-Treatment
As the AD process and its several limiting factors are investigated, it seems clear that the input biomass in the system must be pretreated to optimize the biogas production from the organic matter. Pre-treatment methods can range from chemical to mechanical, electrical and even ultrasound or magnetic treatments for new innovative solutions. Ouahabi et al. [64] analyzed the combined solution of chemical pre-treatment and ultrasonic disintegration in case of wheat straw biomass. Ultrasonic treatment is of utmost importance to reduce the particle size and increase soluble COD. The results showed that the optimum was achieved for a presence of 4% weight by weight H 2 O 2 at 36 • C under a frequency of 24 kHz at 200 W. D'Arc Coura et al. [65] investigated the effect of a double pretreatment solution, including ultrasonic treatment and struvite precipitation in a mixture of cattle slurry and sewage sludge. Ultrasound at 218 kJ/L and struvite precipitation in an ammonium/magnesium molar ratio of 1:3 resulted in biomass producing 82% richer in methane biogas and the HRT was reduced by 28%, compared to the non-pretreated case. Zielinski et al. [66] studied the hydrodynamic cavitation pretreatment for Sida Hermaphrodita silage to observe the improvement of the methane fermentation. It was noted that the chemical composition of the silage did not change, but a higher concentration of carbohydrates was found in the liquid fraction of the disintegrated substrate. The optimal value for the cavitation process was found at 5 min in laboratory and the results showed that this treatment can be economically applied to plant scale for this application. Electrochemical pretreatment was recently investigated by Heng et al. [67], who applied titanium coated with a ruthenium oxide electrode for the disintegration of waste activated sludge used for the AD process. Experimental analyses were carried out in a batch-scale reactor operating under mesophilic conditions, whose main parameters were varied, aiming at optimize sludge disintegration and dewaterability. An effective improvement of the biogas production was reached, with an increase from 0.20 to 0.24 m 3 /kg VS (volatile solids). This could be an important finding to apply at larger scale wastewater plants, but deeper economic analyses must be conducted to make the electrochemical pretreatment observed fully viable. Cubero-Cardoso et al. [68] proposed the exploitation of the extrudate flow coming from the strawberry concentrate production, which presents a lignocellulosic composition and is commonly landfilled. This extrudate is rich in sugars and phenols and could be effectively processed with thermal pretreatments, such as the steam explosion. This process is useful for disintegrating the lignocellulosic structures with an enhancement of the disruption of the fibrous material. De-phenolized Strawberry Extrudate (SE) pretreated with steam explosion was tested in a semi-continuous batch reactor, resulting in a high stability at OLR of 0.5 gVS/(L × d) with a methane production rate greater than 130 mLCH 4 /(gVS × d).
The use of an anaerobic digestion process in waste treatment systems presents a twofold advantage. First, a significant energy recovery can be achieved through the use of the produced biogas [69]. In addition, the residue can be stabilized through an aerobic treatment of the digested sludge, and can be finally used as an organic soil improver in agriculture or for environmental restoration [70]. Biogas, mostly consisting of methane (about 50-75%) [71], can be converted into almost all forms of useful energy [72]. A huge variety of organic matter is included in the definition of biomass, so a wide range of renewable energy carriers come out from different treatments. Biomass includes both low solid content and high solid content (higher than 15%) wastes [73]. The former consists of wastes such as sewage sludge [74], animal manure [75] and food processing wastewater [76], while the latter includes yard waste [77], crop residues [78] and Organic Fraction of Municipal Solid Waste (OFMSW) [79]. Biomethane generation is required to produce fuel for vehicles and/or to supply the natural gas grid, as discussed later [80]. The next section focuses on the biogas upgrading techniques and on recent alternative technologies for CH 4 production.

Biomethane Production
Biomethane can be used as a biofuel in the transport sector, either in the form of bio-CNG (Compressed Natural Gas) or bio-LNG (Liquefied Natural Gas). Liquefied biomethane is very useful in sectors that need to be decarbonized and are hard to electrify, such as in heavy-duty and marine transport [81]. At the end of 2017, at least 542 biomethane production plants were active in Europe: the great majority of such plants inject biomethane directly into the natural gas network. Germany has 203 biomethane plants, followed by the United Kingdom (85) and Sweden (67). Sweden represents a particular case in the European scenario, since most of the produced biomethane is used for transport [82]. Recently, the European Green New Deal focused the attention on the necessity to introduce cleaner, cheaper and healthier forms of private and public transport [83]. Biomethane can play an important role in such decarbonization process: it can be considered a carbon neutral energy vector, since biogenic CO 2 emissions correspond to an almost simultaneous sequestration of CO 2 from the atmosphere by the treated biomass [84]. Furthermore, biomethane appears advantageous if a well-to-wheel or LCA approach is followed in estimating total CO 2 emissions. The carbon footprint of electric vehicles, for example, is far from being negligible, when considering, for example, the impact of extracting rare minerals for electric batteries.
Qyyum et al. [85] analyzed all the major devices involved in the production of liquefied biomethane, concluding that such solution is preferrable when biomethane has to be transported over long distances, both for economical and safety reasons. Some authors investigated the profitability of the upgrading process using a techno-economic analysis. Baena-Moreno et al. [86] proposed a technical and economic analysis of an innovative system for the co-production of biomethane and urea from biogas. The proposed system was analyzed for four different sizes of biogas plants (100,250, 500 and 1000 m 3 /h) considering the financial incentives and subsidies for the production of biomethane from four European countries (Spain, Italy, Germany and the United Kingdom). The CO 2 separated from the biogas during the upgrading process was exploited in a Stamicarbon process to combine with ammonia and produce bio-urea. The cost analysis showed that only medium-and large-scale plants (500 and 1000 m 3 /h) in Italy would be profitable for the combined co-production of biomethane and bio-urea. The reason is that in Italy lots of feed-in-tariff subsidies for the biomethane production are paid by the government. Ardolino et al. [87] performed an LCA study aiming to compare biogas upgrading for road transport sector or combustion for heat and power production in the case of anaerobic digestion of the Organic Fraction of Municipal Solid Waste (OFMSW), concluding that biomethane for transport is cleaner than cogeneration.

Upgrading Technologies
This section focuses on the state of the art of the most common upgrading technologies: Physical Absorption, Chemical Absorption, Membrane Absorption, Pressure Swing Adsorption (PSA) and Cryogenic Separation. [88].

•
Physical Absorption The most common Physical Absorption technology is Water Scrubbing, based on Henry's Law for the solubility of gases in liquids. At an ambient temperature, CO 2 and H 2 S are much more soluble in water than CH 4 . Therefore, the gas flowing up from the top of the absorption column is rich in methane, because other molecules are scrubbed from water, which is then regenerated to enhance CH 4 recovery. The outlet biomethane has a high purity, up to 99% [89], but the risk in losses is very high, due to several factors. Kapoor et al. [90] carried out some experimental studies on methane loss factors during the upgrading process. Their analyses were focused on the bubble entrainment due to high pressure difference between water scrubbing column and desorption tank and gas short circuiting at the bottom of the column due to the absence of water sealing. The solution adopted in this case to avoid CH 4 losses is the integration of a pressure vessel between the scrubbing unit and the desorption tank. This solution showed a reduction of the losses thanks to a lower pressure level of the water. The same authors also proposed a flash-vessel in another work [91], which gave as a result a methane recovery of 8.46%. The main issue is, however, related to the presence of H 2 S, which is toxic and should be removed before the upgrading section, through a cleaning process [92]. Organic solvents can be used, rather than water. Figure 10 [93] shows a scheme of the classical scrubbing upgrading process. •

Chemical Absorption
Here, amines are used instead of water because of their chemical selectivity and th capacity of absorbing high amounts of CO2 and H2S, captured by means of an exotherm reaction and completely absorbed by the scrubbing system. Subsequently, the chemica Figure 10. Scheme of the water scrubbing process [93]. Here, amines are used instead of water because of their chemical selectivity and the capacity of absorbing high amounts of CO 2 and H 2 S, captured by means of an exothermic reaction and completely absorbed by the scrubbing system. Subsequently, the chemical solution is supplied to a stripping unit to be regenerated, because of its high toxicity. The whole process requires huge amount of energy. Eventually, the captured CO 2 is released, and the chemical solution is re-used for scrubbing. The efficiency of the system can reach up to 96-98%.

•
Membrane Separation The principle of membrane separation is simple and effective, which is why it is one of the most diffused upgrading systems. According to the Fick's Law, the gases blown through the membrane have different permeabilities, so some are captured and others are residual. Separation can be done with dry or wet membranes; the wet membrane also exploits the absorption mechanism that allows to capture the more soluble gases on the surface. In that case, the system has very high efficiency and biomethane usually reaches a 95% purity. Figure 11 [93] shows the working principle of a membrane separation process. Figure 10. Scheme of the water scrubbing process [93].

Chemical Absorption
Here, amines are used instead of water because of their chemical selectivity and capacity of absorbing high amounts of CO2 and H2S, captured by means of an exothe reaction and completely absorbed by the scrubbing system. Subsequently, the chem solution is supplied to a stripping unit to be regenerated, because of its high toxicity. whole process requires huge amount of energy. Eventually, the captured CO2 is relea and the chemical solution is re-used for scrubbing. The efficiency of the system can r up to 96-98%. •

Membrane Separation
The principle of membrane separation is simple and effective, which is why it is of the most diffused upgrading systems. According to the Fick's Law, the gases bl through the membrane have different permeabilities, so some are captured and other residual. Separation can be done with dry or wet membranes; the wet membrane exploits the absorption mechanism that allows to capture the more soluble gases on surface. In that case, the system has very high efficiency and biomethane usually rea a 95% purity. Figure 11 [93] shows the working principle of a membrane separa process. Figure 11. Scheme of the membrane separation process [93]. Figure 11. Scheme of the membrane separation process [93].

• Pressure Swing Adsorption
In this case, upgrading is based on the adsorption of undesired gases (H 2 S, N 2 , O 2 , CO 2 ) into a solid matrix. In a Pressure Swing Adsorption (PSA) process, the raw gas stream passes through a moving bed of a chemical selective material, usually carbon molecular sieves, such as zeolite 13X or zeolite 5A. However, H 2 S must be mandatory removed before the PSA process; otherwise, the subsequent regeneration would become impossible [89]. In Figure 12 [93], the basic principle of the process is showed.

• Cryogenic Separation
An innovative solution for methane upgrading is the Cryogenic Separation, which operates at a very high pressure and a very low temperature. It is significantly more efficient than conventional solutions in the case of Liquefied Biomethane (LBM) production [94]. In this case, the biogas mixture is dried and then compressed up to 200 bars, even if in most cases pressures are lower; then, its temperature is dropped to as low as −160 • C. In such conditions, methane becomes liquid, and can be separated from other gases and impurities. Figure 13 [93] shows a flow diagram of the process.
In this case, upgrading is based on the adsorption of undesired gases (H2S CO2) into a solid matrix. In a Pressure Swing Adsorption (PSA) process, the stream passes through a moving bed of a chemical selective material, usually molecular sieves, such as zeolite 13X or zeolite 5A. However, H2S must be ma removed before the PSA process; otherwise, the subsequent regeneration would impossible [89]. In Figure 12 [93], the basic principle of the process is showed. Figure 12. Scheme of the PSA process [93].

Cryogenic Separation
An innovative solution for methane upgrading is the Cryogenic Separation operates at a very high pressure and a very low temperature. It is significant efficient than conventional solutions in the case of Liquefied Biomethane production [94]. In this case, the biogas mixture is dried and then compressed u bars, even if in most cases pressures are lower; then, its temperature is dropped t as − 160 °C. In such conditions, methane becomes liquid, and can be separated fro gases and impurities. Figure 13 [93] shows a flow diagram of the process. In Table 3, the principal upgrading technologies are compared in terms of ef purity, capital costs for kWh of biomethane produced, based on a capacity of 1 and the percentage of utilization in the EU with data related to the year 2017 [85]  •

Cryogenic Separation
An innovative solution for methane upgrading is the Cryogenic Separation, which operates at a very high pressure and a very low temperature. It is significantly more efficient than conventional solutions in the case of Liquefied Biomethane (LBM) production [94]. In this case, the biogas mixture is dried and then compressed up to 200 bars, even if in most cases pressures are lower; then, its temperature is dropped to as low as − 160 °C. In such conditions, methane becomes liquid, and can be separated from other gases and impurities. Figure 13 [93] shows a flow diagram of the process. In Table 3, the principal upgrading technologies are compared in terms of efficiency, purity, capital costs for kWh of biomethane produced, based on a capacity of 100 m 3 /h, and the percentage of utilization in the EU with data related to the year 2017 [85]. In Table 3, the principal upgrading technologies are compared in terms of efficiency, purity, capital costs for kWh of biomethane produced, based on a capacity of 100 m 3 /h, and the percentage of utilization in the EU with data related to the year 2017 [85]. Membrane separation is a cheap technology because it is simple in terms of design and operation. It is mainly used when higher methane losses can be accepted. Water Scrubbing is also largely diffuse for its simplicity and the possibility to easily regulate gas capacity by changing pressure or temperature. Unfortunately, in this case, the operating costs are higher.
The main disadvantage of other technologies is their high cost, both in terms of capital cost and O&M costs; some of them require a higher amount of electric power, so they are particularly suitable to be integrated with PV and/or wind turbines (WT). This is the reason why these upgrading solutions may become predominant in the near future.
Other technologies also exist, despite their low diffusion. For example, Luo et al. [99] studied the desorption of CO 2 from biogas by using a new model of a degassing membrane completely merged into a degassing unit (DU) and connected to an UASB reactor. A huge variety of experiments were performed with a batch in different varying operative conditions, such as stirring rpm, total inorganic carbon (TIC) concentration or pH concentration. The results showed that the desorbed amount of CO 2 increases with stirring rpm increase and strongly decreases with pH increase. Furthermore, CH 4 concentration increased up to 94% with liquid recirculation through the DU.

Biomethane Impurities
As discussed before, biomass pretreatments are necessary to improve the degradability and, therefore, the methane yield of the processed substrate; however, some pretreatments are necessary for the upgrading of biogas to biomethane and for avoiding the presence of contaminants [100]. These could be extremely harmful for the technologies used for the process and the presence of some substances could also adversely affect the chemical reactions that occur in some cases [101]. Piechota [102] recently proposed some studies on the removal of impurities, particularly siloxanes, studying the effects that an adsorptive packed column system (APCS) would have on improving the quality of the biogas before its upgrading. This APCS unit works by means of active carbons, which enhance the removal of volatile organic compounds (VOC), halogenated compounds and, above all, siloxanes. Piechota listed them according to physical and chemical aspects to make a distinction in removing the species after the cleaning process. The results showed that both impregnated and non-impregnated APCS efficiently remove VOCs, halogenated compounds, sulfides and ammonia, up to 99.76%. The siloxanes were completely removed and the technical feasibility of this solution was confirmed. However, improvements are needed for upscaling such a technology. In [103], the same author proposed the application of a Cryogenic Temperature Condensation System (CTCS) to remove siloxanes and other impurities from the biogas. This device worked according to the principle of temperature oscillation, which ranged from +40 • C to −50 • C, and the analysis of the volatile substances was carried out by means of the gas chromatography. The CTCS system was applied both at lab scale and landfill plant size to investigate the removal of siloxanes, VOCs and halogenated compounds. A 99.87% efficiency in siloxanes removal was reached (78.36% for other substances).
The removal of siloxanes is certainly of utmost importance, but other substances can seriously affect the quality of the biogas produced, limiting its further use. Salim et al. [104] investigated the effect of adopting sulfate-reducing bacteria (SRB) in a simulated synthetic sewage reactor for the efficient removal of H 2 S. The bacteriophages families were provided by the multidrug-resistant Salmonella enterica clinical strain and the results showed a H 2 S removal ranging from 60% to 70%. The importance of this novel solution lies in the fact that many existing solutions are very expensive and cannot be applied in all cases, especially in less developed countries. The use of bacteriophages could instead represents an effective and economic solution for improving the quality of biogas. Paolini et al. [105] proposed a Vacuum Swing Adsorption (VSA) system, using zeolite 13 to produce pure biomethane from the conversion of sewage sludges in WWT plants. In the investigated system, volatile methyl siloxanes (VMS) did not represent a problem. Again, further improvements and studies are needed for the application of VSA in large scale systems.

Lignocellulosic Biomass Gasification
As previously discussed, biomethane production from biogas upgrading is very expensive due to the high capital costs and significant operating and maintenance costs (energy demand and chemicals use). Recent research works have aimed to develop alternative solutions to produce biomethane with higher efficiency and profitability [106]. In reference [107], biomethane produced from lignocellulosic biomass is presented as a "second-generation" biofuel, with respect to others produced from edible crops, sugars or starches. Gasification of lignocellulosic biomass is a thermochemical process which leads to the production of syngas. This is a mixture of hydrogen, carbon monoxide and carbon dioxide and methane. By removing CO 2 , the methanation process can occur by combining CO with H 2 . A comparison between AD and gasification processes is made by Li et al. [108], who showed that both technologies have high conversion efficiency. However, the analysis does not take into account the high heat content after the gasification process, which could be used for electricity generation. Furthermore, an economic analysis also shows that investment costs for AD upgrading process are much higher. Lignocellulosic biomass could also be used for the AD process for the so called "advanced AD". In this case, enzymatic pretreatments are required to improve the degradability of biomass, which is a complex structure of cellulose, hemicellulose and lignin [109]. Ardolino et al. [110] presented a life cycle assessment (LCA) comparison between the biogas and syngas roads to biomethane. A scheme of these pathways is proposed in Figure 14. According to the authors, the "syngas road" for biomethane production has a better environmental performance with respect to the "biogas road"; however, this debate is still ongoing, and future R&D analyses are expected to develop the high potential of both options.

Hydrogen to Biomethane
Biohydrogen production from microalgae is becoming one of the most promising solutions for renewable H2 production [111]. Microalgal biomass is called "third- According to the authors, the "syngas road" for biomethane production has a better environmental performance with respect to the "biogas road"; however, this debate is

Hydrogen to Biomethane
Biohydrogen production from microalgae is becoming one of the most promising solutions for renewable H 2 production [111]. Microalgal biomass is called "third-generation" biomass for biohydrogen production, despite the actual low industrial scale development. Specific pretreatments are required to avoid hydrogen inhibition during the dark fermentation and photo-fermentation processes [112]. Techno-economic analyses are crucial to assess the feasibility of this solution. Golkhan et al. [113] [114] studied the methane production by means of an electromethanogenic Microbial Electrolysis Cell (MEC), which allows the conversion of CO 2 into CH 4 . Furthermore, this system allows the recovery of ammonia since the MEC is coupled with a Cation Exchange Membrane (CEM) and an Ammonia Recovery System based on Hydrophobic Membrane (ARS-HM). The ammonia recovery is also useful to maintain at a lower level the value of pH for the electromethanogenic biomass and enhance the biomethane production.
Hydrogen biomethanation has been the subject of several studies, regarding both in situ [115] and ex situ [116] processes, and is considered an interesting alternative to the most common upgrading solutions. The combined production of hydrogen and methane is also becoming increasingly attractive for the development of Power-to-Gas (P2G) systems [117]. Mazzeo et al. [118] recently studied an in situ solution for hydrogen methanation, modeling a Gas Stirred Tank Reactor (GSTR), in which microbial species are randomly packed. The injected hydrogen was obtained from an electrolyzer, with an inlet flowrate ranging between 10 and 50 mL/min. Biogas recirculation through the liquid phase was also used to enhance the mass transfer between the liquid and the gaseous phase. The hydrogen mass transfer coefficient was identified as the critical factor for a correct methanation, strongly affected by the biogas recirculation. Figeac et al. [119] proposed a case study for the ex situ biomethanation, trying to evaluate the influence of the temperature on the methanation process. In fact, hydrogenotrophic methanogens, responsible for the methane production, are strongly influenced by the operating temperature. As expected, the results showed that in thermophilic conditions, between 35 • C and 55 • C, a higher methane production can be obtained.

Simulation of Biochemical and Physical-Chemical Processes
The anaerobic digestion process is a combination of different physical phenomena and biochemical reactions. Simulating such a complex process requires a suitable mathematical model. One of the most widely used and complete mathematical models for the simulation of anaerobic digestion processes is the Anaerobic Digestion Model No.1 (ADM1), developed by the IWA Task Group in 2002 [120]. The model considers both biochemical and physical-chemical processes. Biochemical reactions include the disintegration of composite particulate matter into carbohydrates, proteins, lipids and inert materials. These are hydrolyzed into sugars, amino acids and long chain fatty acids (LCFA), respectively. Acidogenesis leads to VFA and hydrogen from sugars and amino acids; acetogenesis of LCFA and VFA into acetate. The final step is methanogenesis, producing methane and carbon dioxide; such a process may take place through two metabolic pathways: acetoclastic methanogenesis, starting from acetate, or hydrogenotrophic methanogenesis, starting from hydrogen. Physical-chemical processes include ion association and dissociation and the transfer gas phase.
From a modeling point of view, the concentration of the various chemical species that take part in the AD process refers to the Chemical Oxygen Demand (COD (mg/L)). This is the quantity of O 2 , expressed in mg, required for the complete oxidation of the organic matter in 1 L of water and is an indicator of the amount of organic matter available in a sample volume. It is different from the "substrate", which is the available degradable part of the total input COD. The degradation of the substrate in all intracellular and biochemical reactions is modeled by Michaelis-Menten kinetics. Extracellular processes such as disintegration or hydrolysis (as well as growth and decay, in case of biomass) are simulated by first-order kinetics. The dead biomass remains in the system as a composite material, and is involved in the disintegration phase. Inhibition due to inadequate pH level is modeled with empirical equations. Hydrogen inhibition for acetogenic groups and free ammonia inhibition for acetoclastic methanogens are modeled by non-competitive functions. Processes are usually implemented as kinetic rate equations which consider 19 biochemical processes, 3 gas-liquid transfer processes and 24 components. This results in a set of differential equations coming out from mass balances for each state component in the liquid phase, which can be written in the form: where S liq,i is the concentration of the generic substrate i in the reactor, S in,i is the input concentration of the generic component i, q in and q out are, respectively, the input biomass and the output digestate flow rates and V liq is the volume occupied by the waste and the summing term considering the kinetic rates for process j and the biochemical coefficient of the component i involved in the process j. Several studies tested the suitability of ADM1 for simulating anaerobic digestion processes. Fatolahi et al. [121] implemented a calibrated ADM1 model in MatLab/Simulink (Albuquerque, NM, USA) to simulate a mesophilic lab-scale reactor fed with OFMSW. Shang et al. [122] used a steady-state condition to simulate two wastewater treatment CSTR plants. Rathnasiri [123] simulated the operation of a pilot scale anaerobic digester treating food waste with recycling sludge. In other works, the model was recalibrated, and kinetic model parameters properly redefined according to the case study considered. Derbal et al. [124] applied the ADM1 to a full-scale anaerobic digester treating both organic fraction of municipal solid wastes and activated sludge at a mesophilic temperature of 37 • C. A similar experience was conducted by Ozgun [125], who studied a full-scale anaerobic digester of mixed sludge, recalibrating the most significant parameters of the ADM1 model.
In several research works, the ADM1 was modified, simplified, or improved to evaluate the effect of specific phenomena or parameters on the biogas yield of the digestion process. Esposito et al. [126] investigated the effect of organic load (OLR) and waste particle size, by defining a modified version of ADM1 applied on a CSTR digester treating both OFMSW and sewage sludge. In the proposed model, the ADM1 approach was followed for the digestion of sewage sludge. A surface-based kinetic function of particle size was instead used for the disintegration of OFMSW, characterized by the following equation: where a* L 2 M −1 is the mass specific area, Ai and Mi are the disintegration surface area and the mass of the organic solid particle, respectively, δ is the complex organic substrate density and R is the organic solid particle radius. The model includes 30 ordinary differential equations (ODEs) resulting from the mass balances of suspended and dissolved materials. Three gaseous components are considered, and one algebraic equation (AE) expresses the condition of electro-neutrality in the water: where the squared brackets represent the molar concentration of the considered chemical species. The system of 31 Differential Algebraic Equations has been solved with the ODE15s algorithm in MatLab. Pastor-Poquet et al. [127] focused on the simulation of the high-solid anaerobic digestion of OFMSW. The developed mathematical model considers the significant mass/volume variation of reactor content which occurs in case of high removal of total solids. In that case different mass balances are required for global, solids, solvent (water) and inerts. The soluble apparent concentration method is used to reproduce the effect of high TS content in the AD process. Global and liquid fraction measurements are calculated as follows: Fezzani and Cheikh [128] included the degradation of phenolic compounds in the anaerobic co-digestion process of olive mill wastewaters (OMWs) and olive mill solid wastes (OMSWs) in thermophilic conditions. Parker and Wu [129] focused on the formation of odorous compounds in anaerobic sludge digestion, such as VFAs or organic and inorganic reduced sulfur compounds. Bai et al. [130] investigated the problem of free ammonia inhibition in the anaerobic fermentation of high-solid sludge. Blumensaat and Keller [131] modified the model for two-stage anaerobic digestion of sewage sludge in a pilot-scale digester. Table 4 reports a list of the works analyzed in this section, highlighting the main characteristics of the different simulation models and software adopted.  [126] Modified ADM1 X MatLab OFMSW/sewage Pastor-Poquet [127] Modified ADM1 √ MatLab High TS OFMSW Fezzani [128] Modified ADM1 √ MatLab Olive mill waste Parker [129] Modified ADM1 X AQUASIM High TS sludge Bai [130] Modified ADM1 √ AQUASIM Sewage sludge Blumensaat [131] Modified ADM1 √ MatLab/Simulink Sewage sludge

Model for a High Total Solid Content
There are several methods available in the literature for a detailed modeling of the AD process in case of a high total solid (TS) content, known as Solid State Anaerobic Digestion (SS-AD) models. Fuqing Xu et al. [132] performed a significant clustering of all the existing SS-AD models. These models can be classified into theoretical models, empirical models and statistical models.
Theoretical models include the following: • Two-particle: this model considers "seed" particles and "waste" particles inside the solid mass of SS-AD; the "seed" particles present low biodegradability and high methanogenic activity, while the "waste" particles represent substrates with high biodegradability and low methanogenic activity [133]. Both particles influence the diffusion of VFAs according to the Fick's Law: where r d (gL −1 s −1 ) is the diffusion rate of a solute, D e (cm 2 s −1 ) is the effective diffusion coefficient of a solute in the medium, L s and L w (cm) are the diameters of "seed" and "waste" particles, respectively, and S s and S w (gL −1 ) are the solute concentrations in the "seed" and "waste" particles, respectively. • Reaction front: similar to the previous model, a spatial separation of acidogenic and methanogenic zones is adopted. However, in this case, the "seed" particle is a "reaction front" with multiple layers [134]. Considering some simplifying assumptions and a cubic seeding pattern, it is possible to assume that the methane production is proportional to the surface area (cm 2 ) of the "reaction front", which decreases according to the following equation: where r is the radius of the particle and 2R the distance between each "reaction front". • Distributed: these multidimensional models consider the effect of mass transfer inside the digester. Vavilin et al. ( [135][136][137][138]) used mono-and multi-dimensional distributed models to predict the effect of spatial and temporal gradients inside the reactor. • Spatial temporal: this model considers heterogeneous mass distribution; it is based on the assumptions of both the reaction front model and distributed model. Using a 3D approach, it was demonstrated that the initial substrate and inoculum spatial distribution determine how methanogenic centers expand inside the reactor [139].
Here, the shifting of the reaction fronts is combined with the leachate downward flow and the subsequent VFAs concentration gradients.

•
Diffusion limitation: this model simulates the effects of TS percentages in AD processes due to the different physical and chemical characteristics of the input biomass [140]. More specifically, combining the principles of the two-particle and reaction front models, a better model is achieved for dry, semidry and wet processes [141]. Some models were validated with experimental data. Liotta et al. [142] developed a modified ADM1 to evaluate the different content of Total Solids in complex organic matter. Xu et al. [143] developed a model that predicts the inversion of methane production rate at around a certain threshold value of TS percentage inside cellulosic biomass.
The complexity of the outlined models required the development of simplified models which, in turn, are not able to fully model the process. In this perspective, empirical and statistical models are extremely important. The following empirical models are available in the literature:

•
Logistic model: this model was developed based on the following logistic equation: where µ max (d −1 ) is the maximal specific growth rate, B is the microbes' concentration, X the concentration of solid substrate, X 0 max is the initial value of X and X 0 is the amount of microbial accessible solid substrate in X max 0 . The model was proposed by Pommier et al. [144], posing that the methane production rate in the batch digesters follows a sigmoidal function and that kinetics depend on the moisture level inside the reactor.
where X is the DOC concentration, X 0 is the initial solid substrate concentration, X NB is the concentration of non-biodegradable substrate and h is the maximum microbial cell mass concentration that can be reached. This leads to a simplification of the model, avoiding all the microbials and the mass transfer effects [145]. Prediction models for the methane yield from OFMSW are found in the literature [146]. By associating the substrate utilization rate in the reactor with the methane production rate, the general kinetic equation for methane generation in AD is obtained.
Statistical models can be classified into linear regression models and artificial neural network (ANN) models. Linear regression models include simple linear regression models and multiple linear regression models (MLR). The latter are computational methods, allowing one to evaluate one output variable, such as methane production, by considering various input variables, such as TS content, inoculation ratio, particle size and their interactions. When these input data are non-linear, redundant or complex, ANN are preferred. Xu et al. [147] presented a comparison between two statistical models, the MLR and ANN. Both models were validated and compared to understand how some parameters affect the reliability on methane yield prediction. Other statistical models are available in the literature and were validated for the methane yield from lignocellulosic biomass [148], providing similar results [149].

Thermal Models of Anaerobic Digesters
Several literature studies are focused on the modeling of digester thermal behavior and heat exchange phenomena. Axaopoulos et al. [150] developed a mathematical model to simulate the temperature variation in a buried digester fed with pig manure with a useful volume of 45 m 3 located in Greece. Its cover is made of flat plate solar collectors that heat the digester through an immersed heat exchanger. The model considers the digester and biogas heat balance equations, implemented in the TRNSYS program to simulate the behavior of the digester for 10 days in September, referring to the local meteorological data. Considering the assumption of a fully mixed digester, a uniform operating temperature was assumed, depending only on time. Energy balances were performed for solar collectors, biogas control volume and manure. The heat losses, the digester operating temperature and the heat exchanger operating temperature are coupled using the logarithmic mean temperature difference in the heat exchanger and the heat balance. The results of both digester and manure daily operating temperatures are very close to the experimental data. It was also proved that the back heat losses from the collector positively affect the heat balance of the digester, reducing its thermal losses.
Hreiz et al. [151] developed a 0D dynamical model of a semi-buried agricultural digester. The simulated trends of digester temperature show a good agreement with the experimental data. The model allows one to identify the most significant terms in the heat balance, such as the energy required for inlet substrates heating or the heat losses to the ground and through the cover. Gebremedhin et al. [152] evaluated the energy demand of a plug-flow anaerobic digester by defining and validating a thermal model that considers: heat exchanged by influent and effluent sludge; heat exchanged along digester cover such as thermal losses or solar irradiation; heat losses along digester walls and foundation, also accounting for frozen soil. Recently, Pedersen et al. [153] developed a resistance network-based 1D time-dependent heat transfer model simulating thermal flow rates. This showed good predictive performances for three existing digesters even without a previous calibration. Two fixed-dome, buried, uninsulated and unheated household digesters were considered in Hanoi, Vietnam, and one industrial-scale anaerobic in Esbjerg, Denmark. The results of the dynamic simulation showed values of substrate temperatures very close to the experimental ones.
The need to properly manage the anaerobic digestion process in cold climate conditions inspired several researchers to develop simulation models able to estimate the thermal losses towards the environment. The main issue is to avoid significant drops in temperature, which may limit the biogas yield. Perrigault et al. [154] defined and validated a time-dependent thermal model to simulate a buried tubular digester integrated into a greenhouse in cold climate conditions. The model consists of energy balance equations written for the greenhouse cover and walls, air included in the greenhouse, digester gas holder and slurry. The comparison of simulation results with experimental data on weather conditions and digester temperatures suggests that the defined model is a good tool to predict the slurry temperature with a standard error of 0.47 • C. A similar experience was conducted by Weatherford and Zhai [155] using a modified version of the previous model. It allows one to predict the slurry temperature variation with some degree of precision in the short time period of the experiments.
Terradas-Ill et al. [156] also developed a 1D finite difference model to predict the operating temperature and biogas production of buried and unheated digesters of animal manure in developing countries, obtaining reasonably good results. Rynkowski [157] developed a 2D heat transfer model to evaluate the heat losses of two semi-buried digesters located in north-eastern Poland. Strong seasonal variations of the operating temperature with respect to the set-point value of 40 • C are considered. Teleszewski andŻukowski [158] also focused on the estimation of digester heat losses with respect to Polish climatic conditions. It was found that most of the losses occur along the digester cover, highlighting the need of additional insulation.
A useful analysis for the design of a buried digester was presented by Liu et al. [159], who developed and validated a model that uses the solar-air temperature (T solar , see Equation (9)) as a boundary condition for the soil temperature: where α is the ground solar absorption coefficient, G is the solar radiation intensity, h c is convective heat transfer coefficient on the ground surface and Q rad is the radiative thermal flow rate between the ground surface and the environment. Results were obtained for different materials of the digester, depths and fermentation temperature and they show that heat losses from the cover are at about 180 W/m 2 . For different points of the ground, the value of heat losses in stationary conditions varies from 50 W/m 2 to 80 W/m 2 . These considerations hold true also for digesters operating in mesophilic conditions, and these data can assist the engineer with relevant system design.
Thermal models are obviously gaining more and more interest with the diffusion of solar systems, integrated in biogas plants. Solar energy shows a dramatic impact on the stability of the digester operating temperature. It is widely known how the efficiency of the AD process depends on the temperature which affects the velocity of kinetics inside the reactor [160]. Tassew et al. [161] found that in mesophilic conditions, for an UASB digester, the higher the temperature, the higher the biogas production rate. Moreover, significant oscillations of temperature dramatically affect the kinetics. For temperatures of 10 • C below the operating set point temperature, the efficiency significantly decreases. This condition easily occurs when high thermal losses occur or when the solar radiation is very low or even null, such as in nighttime. To prevent these problems, thermal energy was supplied from external sources (an auxiliary heather or a solar collector). In the aforementioned work of Axaopulos et al. [150], the integration of solar panels into the semi-buried digester cover had a positive two-fold effect, reducing losses from the cover side and providing thermal energy for longer periods, thanks to the conductive effect of the panels. Gaballah et al. [162] studied the effect of solar technology integration in household digesters in rural areas in China, where the cold temperatures reached resulted in low efficiency, in terms of biogas production. In the different scenarios analyzed, the results always showed that solar collectors integration allows to keep the temperature at optimum levels in most periods of the year.

Models including Both Biological Processes and Heat Exchange Phenomena
The anaerobic digestion process is strongly affected by the operating temperature of the digester, which is strictly dependent on the environmental conditions and on the performances of the heating system. Unfortunately, in the literature there is a lack of models that couple the AD biological models and the thermal models analyzed here. However, few authors propose "hybrid" anaerobic digestion models that allow one to perform a global analysis of AD both from both kinetic and thermal points of view. In that case, it is considered that these aspects are strongly connected to each other. In a previous work, the authors [163] modeled the behavior of an 800 m 3 completely stirred tank reactor equipped with an internal heating system. The digester handled 15 t/d of OFMSW at the mesophilic temperature of 37 • C. A simplified version of the ADM1 was defined by considering 10 biochemical processes and 13 components, both substrates and microbial groups. The aim was to reduce the computational time and couple that model with more complex component models. Then, a steady-state thermal model represented by the digester thermal balance and the heat exchange equations of the heating system was developed. Digester operating temperature, concentrations, biogas production, ambient temperature and organic waste flow rate were obtained by simultaneously using both models in the MATLAB ® environment. ODE equations for the biochemical model are shown in Equation (1) and they were solved by the "ode15s" solver, whereas for thermal model, a system of DAE was used. The results of the simulation predicted a production of biogas of 0.123 Nm 3 /kg of OFMSW and a proportional increase of the biogas flow rate with the increase of the waste flow rate.
Adouani et al. [164] combined a thermal model [141] with the ADM1 to investigate different operational strategies to mitigate the variability of substrates when the aim of biogas production changes. A case study is applied to an agriculture digester in Bouzule, France, considering the operating temperature variations. As mentioned before, the thermal model integrated into the ADM1 is the transient model developed by Hreiz et al., used to predict the temperature variations of the semi-buried anaerobic digester as a function of climatic conditions. Using the Monod's kinetics model, it was found that for any reaction in the model, the maximal reaction rate µ max is given by: where T opt is the optimal temperature (45 • C), T max the maximum temperature (50 • C), µ out is the maximum reaction rate at T opt and b = 6.725 K. To integrate the ODE system, authors developed a suitable FORTRAN code of a fourth-order Runge-Kutta algorithm with a constant integration step of 10 −4 days. The simulation was carried out for 100 days at a constant feed rate followed by two years in variable feed rate conditions using digested activated feed data from Benchmark Simulation Model No.2 (BSM2). The results were shown for both open-loop and closed-loop high CH 4 production. In the first case, the temperature was fixed at 35 • C and a production rate of 70.6 kgCH 4 /day was obtained. In the second case, using a non-optimized PI controller, the CH 4 production rate was fixed at 100 kg/day and the system was stable. Liu et al. [165] presented a simplified version of the ADM1 coupled with heat and mass transfer balances, in order to model a direct absorption digester heated by solar radiation. A good agreement between simulation results and experimental data was obtained. The authors found that most of the research works investigated the kinetic or thermal performance of the anaerobic digestion and there are only few literature papers about dealing with the simultaneous analysis of these two aspects. Thanks to some simplifying assumptions, the photo biochemical transformation process is simplified to a one-dimensional process, so the energy equation of biogas slurry interior is as follows: This is a first-order Partial Differential Equation (PDE) with respect to the variable t and a second order PDE with respect to the variable x, where the source term Φ x is the energy ratio of energy absorption in region x to the total solar energy of the slurry surface. The radiative transfer equation of biogas slurry interior and the mass and energy equations of biogas slurry surface are coupled to the above mentioned PDE equation. The governing equations and boundary conditions were discretized by the finite difference method. The discretized equations were solved by the Tridiagonal Matrix Algorithm (TDMA) principle. In the calculation process, the Monte Carlo method was utilized to estimate the source term Φ x . Finally, all the parameters were obtained including volume average temperature, biogas production and pH. The results showed that the effect of solar irradiance on the biogas production rate is higher than the one on the rate of propionic acid. In addition, the slurry surface evaporation of the digester should be restrained, to increase the heat storage within the digester.

Hybrid Biomethane Renewable Plants
Heating demand is crucial in anaerobic digestion plants. The electricity demand for moving substrates, pumping heating water or treating the produced biogas flow rate is also significant [166]. Therefore, it is interesting to evaluate the possibility of combining renewable energies with anaerobic digestion. As a matter of fact, the whole process of organic matrix disposal and biogas production can be more sustainable, avoiding or reducing the use conventional energy production systems. Thus, the produced biogas can be easily upgraded into biomethane that could be employed for other goals, such as grid injection or transport fuel, providing a good economic profitability. Alternatively, one of the main strategies to produce thermal and electrical energy to power AD plants is the partial or total on-site combustion of biogas in cogeneration systems, after suitable cleaning phases.

Renewable Penetration for Biogas and Biomethane Plant Energy Supply
In this section, theoretical studies of biomethane plants coupled with several renewables are presented. In particular, solar thermal collectors are the very diffused solutions in thermodynamic and economic analyses.

Solar Thermal Energy
Solar energy is a renewable and unlimited source of energy and its employment for digesters heat and electric supply has received attention in recent decades.
A literature review shows many research works focused on the simulation of dynamic systems, including solar thermal or photovoltaic devices integrated to power anaerobic digesters. Ouhammou et al. [167] developed a solar thermal system in the TRNSYS platform consisting of two hydraulic circuits to heat a thermal modeled UASB digester of 60 L at mesophilic temperatures in Morocco. The first circuit consists of a flat plate collector and a storage tank and it covers the digester heat demand during daylight hours. The second one includes another storage tank that starts heating the UASB digester when the temperature of the first one decreases. The model results show that the proposed system can predict the temperature fluctuations and it allows one to achieve energy self-sufficiency by avoiding conventional energy sources. The power demand is 1.2 kW in summer and 3 kW in winter and the average solar fraction is 85%. Zhang et al. [168] designed a solar-biomass energy supply system to provide heat and cooking fuel for Chinese rural communities. It consists of parabolic trough collectors, a hot water storage tank, three anaerobic digesters and a biogas boiler that supports the solar subsystem by giving additional thermal power if necessary. The produced hot water is used also for digesters heating. The system was dynamically simulated by the TRNSYS software, and the results show that in summer period, the system can maintain its stable operation even when coupled with the solar subsystem. A scarce contribution is observed in the winter period. In any case, the system shows significant advantages in terms of energy and emission savings. Wang et al. [169] developed a mathematical model in MatLab of a solar-biogas hybrid system where solar collectors are used for digester heating. The model simulates biogas treatment components, power generation and heating supply subsystems in a rural garbage disposal station of China. The simulation results encourage the employment of the proposed energy system to serve rural communities. Zhang et al. [170] defined a simulation model in TRNSYS platform of a hybrid solar tower-biogas power plant. A CSP system and a biogas boiler, according to the availability of solar energy, feed a steam turbine for electricity production. The steam turbine, regulated by a PID control, can heat the anaerobic digester at the constant temperature of 35 • C with a maximum daily fluctuation of 0.8 • C. In recent works, Rostamzadeh et al. [171,172] proposed and simulated a multigeneration system driven by a hybrid biogas-geothermal heat source for heating, cooling, electric power, hydrogen and freshwater production. The plant proposed is shown in Figure 15. Model equations are implemented in EES for all the system components based on the thermodynamic analysis, Gibbs free energy, Humidification-Dehumidification (HDH) mathematical modeling and overall performance of the system. Economic, environmental and enviro-economic aspects are investigated by using single and multi-criteria optimizations. Furthermore, the economic drawbacks of each individual heat source are Figure 15. Biogas-geothermal hybrid renewable energy system [172]. Model equations are implemented in EES for all the system components based on the thermodynamic analysis, Gibbs free energy, Humidification-Dehumidification (HDH) mathematical modeling and overall performance of the system. Economic, environmental and enviro-economic aspects are investigated by using single and multi-criteria optimizations. Furthermore, the economic drawbacks of each individual heat source are solved. In the first part of [171], the results show an overall production capacity for heating, cooling, net output power, hydrogen and freshwater of 538.1 kW, 1799 kW, 443.4 kW, 0.2583 kg/s and 367.92 L/h, respectively. Thermal efficiency, exergy efficiency and total exergy destruction are equal to 62.28%, 74.9% and 2036.19 kW, respectively. In the second part of [172], the results showed that optimization increased thermal and exergy efficiency by 12.07% and 5.16%, respectively, with an overall costs reduction of 3.7%. The emission rate shows a reduction of 4.44% in greenhouse gas emissions with respect to base case model. A comparative analysis of the proposed models is reported in Table 5.  [173] analyzed the possibility to heat a lab scale digester of 53 L at a constant temperature of 40 • C. To this scope, a flat plate solar collector combined with a heat exchanger and a PID temperature controller is used. Experimental results obtained by monitoring the system during a summer day show that the solar collector coupled with PID controller allows one to reach and maintain the desired temperature constant. The calculated internal rate of return of the investment of 32.6% encourage the use of solar energy for heating requirement of bio waste reactors. Ali and Al-Sa'ed [174] monitored the biogas production of a Palestinian small-scale anaerobic digester of 0.5 m 3 treating poultry manure. The digester is assisted by a solar water heating system consisting of a 1.6 m 2 flat plate collector. The daily biogas yield ranges from 80 to 300 L and the methane content of the biogas ranges from 46% to 66%. Digester monitoring during the winter period reveals that biogas production rate increases by 33% and the temperature increases by 50% by using solar system. Wang et al. [175] proposed to couple a phase change thermal storage (PCTS) system and a solar thermal collector to heat a pilot-scale two-phase anaerobic digester at 35 • C. Important advantages in the storage of thermal energy in the winter season were found. A set of comparative field studies were carried out during the winter in Maanshan City in China, including no heating mode (P1), heated with a solar thermal and PCTS system (P2) and conventional solar heating mode (P3). The comparison shows that methane yields and the energy conversion rate of the substrates of P2 were 12.33 m 3 and 48.6%, respectively, both increased by 5.65 and 1.01 times, compared to P1 and P3, respectively. A similar experience was carried out verifying that a phase change material insulation enhances tank thermal storage capacity [176]. Aguilar Alvarez et al. [177] developed a small-scale integrated system treating organic wastes in Costa Rica, consisting of a thermal collector that heats an anaerobic digester. In addition, an electricity generator for on-site uses fed with the produced biogas and a wetland to treat liquid digestate are considered. Solar thermal collectors of 36 m 2 coupled with a thermal storage tank of 5 m 3 provide enough heat to maintain the digester of 20 m 3 at 46 • C. The system utilizes 863 kg of mixed animal and food wastes and reclaimed 550 kg water per day to generate 73 kWh renewable energy 28 kg nitrogen and phosphorus Much research shows the feasibility of coupling solar energy with household digesters in rural areas in order to properly manage organic waste. The aim is also to achieve energy self-sufficiency by producing biogas for cooking, heating, lighting and power generation [178][179][180][181]. A large-scale experience was carried out by Dong et al. [182]: solar collectors with a total area of 100.8 m 2 were used to heat the digesters of a Chinese pig farm. The comparison among the yields of a group of digesters heated with solar heated water and a group fed with river water shows that the biogas production of first group is 11.2% higher than that of the second one.
The authors found few experiments conducted on the integration of other renewables in biogas plants. In most works, solar thermal collectors are always included in the simulations when adding a new renewable source. In recent works [183], interesting analyses of solar-integrated biogas plants have been proposed in order to supply alternative energy to remote places such as islands or off-grid stations.

Solar Thermal and Photovoltaic
Recently, Singh et al. [184] presented a detailed analytical model based on Hottel-Whillier-Bliss equations and energy balances for a photovoltaic-thermal compound parabolic concentrator (PVT-CPC)-integrated biogas plant. The aim to investigate optimal functioning parameters values for the plant in variable climatic conditions for the large city of Srinagar, India. Calculations showed that the required increase in the slurry temperature make the packing factor of the PVT-CPC system a crucial parameter for optimization of thermal and electrical power output. Recently, Darwesh et al. [185] proposed a study on solar and electric energy delivered to a biogas plant in Egypt. Two digesters fed by cattle manure are investigated to perform the analyses. The results show that the solar energy contribution to biogas production varies when the operating temperature changes from mesophilic to thermophilic conditions. At 37 • C, the solar energy contribution is 75.21%, whereas at 45 • C, it is 53.58%. When the temperature increases, the biogas production increases as well. A deep thermo-economic analysis shows that the PES is about 61.28% and the payback period is 1.7 years. Khalid et al. [186] showed the use of a solar panel to produce electricity for mixing and heating a 5 L bioreactor treating palm oil mill effluent and cattle manure. As a result, this system helps maintaining the mesophilic temperature of 35 • C and saving heat and electricity. Hao et al. [187] proposed to produce heat and electricity required by an existing biogas plant and upgrading phase by chemical absorption using concentrating Fresnel photovoltaic/thermal (CPVT) collectors. Simulation results show that solar energy can provide about 7% and 12% of the required heat and electricity, respectively. The optimization problem has been solved to maximize the Net Present Value (NPV), the self-consumption rate (SCR) and the self-sufficiency rate (SSR) by finding the optimal capacity of the C-PV/T system.

Solar Thermal and Wind Energy
In the recent work of Wu et al. [188], an optimization software tool was developed to detect the optimal operating point of functioning of a biogas-solar-wind plant. The aim of the project was the development of decentralized generators for electricity and heat production. The multi-objective optimization (MOO) model was developed to optimize operational cost, CO 2 emissions and energy loss while considering digesting thermodynamic effects and uncertainty of wind and solar power. The results were then compared to that of a natural gas-solar-wind integrated energy system (IES).

Solar Thermal and SOFC Energy
Mehr et al. [189] proposed a model of a SOFC fed by biogas supplied by a WWTP integrated with Concentrating Solar Collector (CST). The system is supposed to be operating in Italy and both a complete energy and economic analysis are shown. Thermal losses from SOFC are used to meet the heating demand of the digester. Moreover, when the thermal energy is not sufficient, the heating demand is met by the CST system or alternatively an auxiliary boiler. A parametric analysis shows results for different values of the area of CST ranging from 300 m 2 to 700 m 2 to 1100 m 2 . The results show that the CST gives back an enhancement of the plant energy performance. In addition, an LCOE analysis of the electricity generated by the system reveals that it is always convenient compared to the cost of the electricity withdrawn from the grid. For a proposed area of solar collector field of 1100 m 2 , the total energy efficiency is higher than 50% and the payback time is equal to 9.

Geothermal Energy
Diamantis et al. [190] designed and constructed an 8 m 3 anaerobic digester fed by different organic wastes and supplied by geothermal energy. The system is heated by a low enthalpy geothermal fluid (50-60 • C) at the desired temperature of 35-40 • C. Geothermal energy is an interesting solution for digester thermal demand thanks to its characteristics. As a matter of fact, geothermal energy is constantly available during the whole year and the fluid temperature is almost constant and it is optimal to keep the digester temperature likewise constant. Based on these results, it was found that it is possible to recover 100% more biogas by heating the digester with geothermal energy and using organic wastes. Small and medium enterprises have great potential in exploiting low temperature geothermal flux and agro-industrial wastes to produce biofuels. Table 6 shows a comparison between the proposed studies on alternative renewable solutions.

Multi-Renewable Energy Systems
In the previous section, different cases of biogas plants coupling with solar systems were reviewed, analyzing several aspects on modeling and experimental studies. These works are cited in order to present other aspects about the use of anaerobic digestion process linked to several renewable sources. In this last section, the aim is to introduce new high-tech plants involving biomethane combined with multiple renewable sources. Recent technologies, such as photovoltaic (PV), wind turbine (WT), solid oxide fuel cells (SOFC) and geothermal energy, are considered.
Sigarchian et al. [194] proposed a hybrid power system including PV panels, wind turbines and a biogas engine which is fed by animal manure in a small village in Kenia to supply for electric energy demand. A techno-economic analysis of the system was performed by HOMER (Hybrid Optimization Model for Electric Renewables), comparing it with a similar system which includes a diesel engine instead of the biogas one. The results show that based on a Life Cycle Assessment (LCA) analysis, the total amount of CO 2 emissions saving by using biogas instead of diesel engine is equal to 670 gCO 2 /kWh. This means 17 tons of CO 2 per year with a share of renewable energy in power generation of 100%. Similar works can be found including solar system matching that kind of plants where uses of final energy are put in comparison [195] and more detailed modeling is present [196].
Bamisile et al. [197] developed a novel multigeneration system, including a wind turbine park, a 40,000 m 2 PVT-CPC field with thermal storage and a biogas digester, as shown in Figure 16. Modeling includes energy and exergy balances for multiple production of heat, power, cooling, hot water, fresh water and hydrogen. A scheme of the plant is shown in the figure. The whole system is analyzed by considering four different scenarios in which only some subsystems are operating depending on the final energy vector required. The most interesting aspect for our study is that the CPVT integrated biogas scenario with respect to the one in which only biogas in considered reveals a CO 2 emission saving of 22,662 tons/year. Multi-renewables energy system [197].
Wang et al. [198] investigated the use of biogas instead of fossil fuels for SOFC-based combined heat and power (CHP) systems. The system is modeled using zero-dimensional energy balances for power components. These are the pre-reformer, the afterburner and the heat-recovery boiler. These components are integrated with a multi scale hierarchical three-dimensional SOFC stack. The aim is to study the effects of the steam/carbon ratio, which is the critical parameter for the pre-reformer, biogas composition, stack operation voltage and thermal gradients within it. The results showed that an increase of the S/C ratio leads to an overall decrease of the system efficiency and so electric and CHP production. Furthermore, an increase in temperature gradient along the stack is observed, so this parameter should be the minimum possible.
Sanni et al. [199] recently presented a study on a hybrid Solar PV/Diesel/Biogas backup solution to address the unreliability of grid electricity. An abattoir in South West Nigeria which operates with cattle manure is considered as their case study. By implementing this system in HOMER software, an optimization analysis is carried out comparing the proposed system to a Grid/PV/Biogas one and a Grid/PV/Diesel one. The results from the thermo-economic analysis shows that the backup diesel generator coupled to the abattoir do not reduce the cost implication. A comparative analysis reveals that emissions with the Grid/PV/Biogas system are reduced by 61% when compared with the Grid/PV/Diesel system. Their work on a backup solution for the unreliability of the electric grid can be useful to design infrastructures in developing countries. Wang et al. [198] investigated the use of biogas instead of fossil fuels for SOFC-based combined heat and power (CHP) systems. The system is modeled using zero-dimensional energy balances for power components. These are the pre-reformer, the afterburner and the heat-recovery boiler. These components are integrated with a multi scale hierarchical threedimensional SOFC stack. The aim is to study the effects of the steam/carbon ratio, which is the critical parameter for the pre-reformer, biogas composition, stack operation voltage and thermal gradients within it. The results showed that an increase of the S/C ratio leads to an overall decrease of the system efficiency and so electric and CHP production. Furthermore, an increase in temperature gradient along the stack is observed, so this parameter should be the minimum possible.
Sanni et al. [199] recently presented a study on a hybrid Solar PV/Diesel/Biogas backup solution to address the unreliability of grid electricity. An abattoir in South West Nigeria which operates with cattle manure is considered as their case study. By implementing this system in HOMER software, an optimization analysis is carried out comparing the proposed system to a Grid/PV/Biogas one and a Grid/PV/Diesel one. The results from the thermo-economic analysis shows that the backup diesel generator coupled to the abattoir do not reduce the cost implication. A comparative analysis reveals that emissions with the Grid/PV/Biogas system are reduced by 61% when compared with the Grid/PV/Diesel system. Their work on a backup solution for the unreliability of the electric grid can be useful to design infrastructures in developing countries.

Energy-Cost Analysis of the Existing Biomethane-Solar Projects
Interest in biogas technology is increasingly spreading both with theoretical and experimental studies in the present renewable scenario. Unfortunately, the existing works rarely trace a full environmental and economic analysis of the improvements that renewable sources could bring to the production of biomethane. In fact, particular electric energy sources, such as photovoltaic and wind, could largely satisfy the electric energy demand of the upgrading process and consistently reduce the CO 2 emissions. Few works focusing on this issue are here reported.
The model proposed by Ouhammou et al. [167] consists of an integration of solar modules designed to satisfy the 85% of the heat demand of the plant with a 100% use of solar energy in the summer season. Although Flat Plate Collectors (FPC) have high capital costs, which represent an obstacle for the spread of such a solution, the 100% energy autonomy was reached due to the geographical position of the plant. The study was carried out in Kenitra, Morocco, where the solar irradiation is very strong. Mesophilic operating conditions, which do not require as high temperature levels as thermophilic ones, encouraged the whole system. Similar to this study is the work presented by Zhang et al. [168], where a solar PTC module and a biomass auxiliary heater were integrated into the plant. The energy and environmental analysis revealed that the optimized system with a solar fraction mean value of only 21%, reached with 24.5 m 2 collectors, leads to a value of PES = 94.98% and reduced CO 2 emissions by 2951 tons/year. The optimized system is profitable because the integrated solar-biomass system provides a thermal energy to the AD plant, which would alternatively be supplied by the biogas produced from the process. As a matter of fact, the economic analysis also shows encouraging results with an SPB = 5.15.
In a recent work, Lombardi et al. [191] carried out a similar analysis for three different locations in Italy, namely: Milano, Frosinone and Enna. For each city, the plant was simulated with different collector types, tank volumes and both in mesophilic and thermophilic conditions. As expected, PES increased with the increasing of the collectors' area and efficiency, which mainly depended on the technology chosen. In this case, the economic analysis revealed that an average SPB of about 10 years could be obtainable with 800-1000 m 2 of solar modules. To make the system profitable, important incentives are required in the reduction of the collector costs. The SPBs for some of the analyzed cases were about 12 and 15 years, respectively, for mesophilic and thermophilic conditions. An interesting application for the recovery of heat and electricity from solar energy as the integration of a biomethane plant is the one proposed by Su et al. [192]. By integrating a CPVT system in a beef-cattle plant in Lhasa, Tibet, the electric energy required from the grid was halved and the biomethane production increased by almost 90%. The technology used for the upgrade was water scrubbing and the increase in biomethane production was due to the temperature stability obtained by solar collectors. These are coupled with a solar tank that substituted an auxiliary heater fed with biogas to produce the supply heat to the digester. The annual PES = 12%, which is not very high, but the PV system only satisfies half of the electric energy demand. Moreover, the avoided CO 2 emissions are consistent with this hypothesis and are equal to 254 tons/year. The SPB in this case is 5.6 years both due to the Chinese policies and the integration criteria of renewables.
In a previous work [193], the authors simulated a full-scale AD for biomethane production coupled with CPVT collectors to partially satisfy both the electric and heating energy demand of the plant. Simulations include both biological and thermal models and an upgrading model for the membrane separation is considered. The plant was simulated by means of MatLab software and coupled with the TRNSYS 17 environment to inspect the dynamic performances. Simulations were carried out for the city of Naples, Italy, and the results showed that a 96 m 2 CPVT field leads to a PES of 7.7% within an SPB period lower than 3 years.
A synoptic review of these studies is reported in Table 7.  [193] From this comparison, it is possible to deduce that the integration of renewables allows to reduce the primary energy consumption due to the upgrading process, but the integration system must be accurately designed basing on the costs of the technology and the financial incentives. In the analyzed cases, by increasing the area of the collectors, the PES percentage increases, but the SPB becomes unprofitable. The only exception is shown by [168] because of the contemporary presence of the woodchip-fed auxiliary heater that integrates the thermal energy provided from the solar collector to a small size digester.
The EU could be the leader in biomethane production integrated with other renewable because of the high presence of biomethane plants, i.e., 497 in 2017 [200], with sizes that vary from 150 to 750 m 3 , and the widespread use of solar and wind technologies. Recent policies about the reduction in the use of energy crops put a restraint on the development of biomethane plants in the EU, which have had an exponential growth in the last 20 years. However, after a settlement period, the biomethane production should start increasing again. Political efforts should be focused on incentivizing the coupling of renewable technologies with biomethane production. Important reductions of CO 2 emissions can be achieved, especially in the road transport sector, where biomethane is an affordable substitute to other fuels.

Conclusions
A review of the current state of the art in anaerobic digestion modeling was presented. The paper also investigated all the aspects that have affected the development of anaerobic digestion plants in the last few years. Special attention was paid to the production of biogas and its upgrade into biomethane, which is suitable for road vehicles and connection to the gas grid. The ADM1 is a complete model that aims to investigate the anaerobic digestion process in its complexity. The literature review shows that comprehensive research works were carried out to model the anaerobic digestion in its various aspects.
A properly calibrated model also allows one to reasonably predict the number of final AD products. Together with the ADM1 model, some modified versions were also introduced to simplify the calculations. These modified versions of ADM1 showed good performances in the simulations of AD coupled with other renewable energy sources and SS-AD models, which provide more detailed results in the case of a high content of total solids in the biomass. Thermal models allow one to monitor digester temperature fluctuations and to identify the main thermal losses which occur during the AD process. The logarithmic mean temperature model is one of the most common methods for stationary conditions. Despite the close connection between the yields of the anaerobic digestion process and the thermal behavior of the digester, there are few models that consider both thermal and biological aspects.
A detailed review on the current uses of the AD process was included in this paper, by considering all the possible developments of this technology, varying from coupling with other renewable sources to the upgrading to pure biomethane utilization. It was shown how biogas or biomethane is used as a fuel both in large-scale and household plants, thanks to the fact that there is a large variety in the choice of organic materials that can be included in the biomass. Different models were analyzed based on the digester temperature, feeding, structure and design, even plants with coupled multiple energy systems. Solar thermal energy generation and cogeneration were the most diffuse technologies for the integration with AD. However, geothermal, photovoltaic, photovoltaic-thermal, wind turbines, SOFC cells and heat pumps are being considered more and more. The integration of renewable energies is instrumental to promote the use of biomethane for several purposes, such as SOFC, biofuel or gas grid injection and to reduce the use of fossil fuels.
The survey performed on existing plants revealed that recent advancements of AD are leading to the diffusion of innovative WWT plants. EGSB, ECSB and IC reactors and the AnMBR reactor are receiving more and more attention. Upgrading technologies is an important development, but alternative ways to produce biomethane are becoming increasingly popular. Lignocellulosic biomass gasification, which leads to high methane production thanks to methanation of syngas, is considered. Additionally, enhanced hydrogenotrophic methanogenesis due to hydrogen production from microalgae is becoming an important alternative. Moreover, plants' integration of renewables makes the whole system more efficient due to the major stability of the AD process. Solar collectors coupled with a solar tank always provide a certain amount of thermal energy, even during less-irradiated hours.
This consideration is even more interesting for EU locations, with a huge bio-climatic variety, ranging from highly solar-radiated areas to others where geothermal energy or wind are largely available. The current, significant diffusion of several technologies paves the way for a strong reduction of emissions, especially in the road transport sector, which is crucial towards energy and climate 2030 targets. Few studies have been done on the improvements that renewable energies could bring to biomethane production. However, an increasing number of studies regarding these solutions was recently observed. In any case, such solutions still need financial support to reach a real economic competitiveness.
Author Contributions: All authors contribute equally to the research activity. All authors have read and agreed to the published version of the manuscript.

Funding:
This study was carried out as part of the Italian national research project "Biofeedstock-PON ARS01_00985", funded by the Italian Ministry of University and Research (MUR).

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