## 2 Methodology
### Presumptions for the Successful Integration of Green Hydrogen and Biomethane Production Processes
#### 2.3.1 Utilization Possibility of All Products from Electrolysis in WWTP
Since the physical properties of nitrogen are closer to methane than to CO\({}_{2}\), when using Pressure Swing Adsorption (PSA) technology, a separate line may be required for nitrogen removal, and in the case of membrane technology, additional purification stages may be required. In any case, the equipment becomes significantly more expensive, and electricity costs increase. The problem can be solved by using pure oxygen instead of air. However, compared to aeration, sulfur removal requires significantly less amount of oxygen. Heat Demand at the Wastewater Treatment Plant  
The total thermal energy demand in a WWTP can reach 2245-6033 MWh (without and with sludge drying) per year for 100,000 population equivalent. The primary heat consumers in WWTPs of moderate climate countries are the following processes: AD reactor heating (about 30% of the total heat demand) and sludge drying (about 45% of the total heat demand). For heat production, many WWTPs use biogas, which is burned in cogenerators or water heating boilers. If the energy of their own biogas is not enough, fossil fuels are used--natural gas or liquid fuel. If the WWTP is located near the city's district heating network, it is possible to use heat from the district heating system to heat the reactors. This is especially advanced when renewable fuels are used in the district heating system (the case of Lithuania). Low-parameter heat (about 45 \({}^{\circ}\)C) is sufficient for heating the reactors. Sludge drying requires heat of much higher parameters (85-95 \({}^{\circ}\)C). Advanced urban district heating systems are switching to low-temperature networks, where heat of 45-65 \({}^{\circ}\)C is supplied to the network. It is impossible to use heat of such parameters for sludge drying directly. However, waste heat from hydrogen production in an electrolyzer is perfectly suitable for sludge drying, as its temperature for Proton Exchange Membrane (PEM) electrolyzers reaches up to 200 \({}^{\circ}\)C [64]. The heating demand for the AD reactors can be evaluated as 10% of the energy content of the biogas [65]. The study [14] presents a comprehensive techno-economic assessment of four power-to-gas systems based on ex situ biomethanation and gasification technologies in a real UK WWTP, treating 198,000 m\({}^{3}\)/a sewage sludge and 33,673 m\({}^{3}\)/a digestate after dewatering. In the simplest scenario, the heat demand is 0.65 MW only for the digesters. The heat generation is 1.61 MW in the electrolyzer and 1.21 MW in the biomethanation reactor. Heat generation exceeds heat demand by 4.3 times. The most sophisticated scenario involves a 7 MW PEM electrolyzer, a biomethanation reactor for the treatment of 9201 t/a of CO\({}_{2}\) and a sludge gasification plant. The heat demand is 0.65 MW for digesters and 1.1 MW for digestate drying before gasification. The heat generation is 1.61 MW in the electrolyzer, 1.5 MW in the biomethanation reactor and 1.1 MW in the gasification. Heat generation exceeds heat demand by 2.4 times. If gasification was removed but sludge drying was left in, heat generation would exceed heat demand by 1.8 times. Hydrogen Demand at the Wastewater Treatment Plant  
There are not many practical examples of hydrogen use on an industrial scale in WWTPs. This is still the subject of more theoretical research, experimental or pilot tests. The main possibility of using green hydrogen in WWTP is the use of hydrogen for the methanation of biogenic CO\({}_{2}\)[13; 14; 66]. When biogas is purified using the most common methods in practice (membrane separation, PSA, water scrubber), gaseous CO\({}_{2}\) is separated from methane [54]. This CO\({}_{2}\) is not convenient without additional compression to transport and use for other purposes, e.g., in industry, and is usually released into the atmosphere. In the case of cryogenic biogas upgrading, liquefied biomethane and liquefied CO\({}_{2}\) are obtained during the same process, but cryogenic purification is rarely used due to high capital and operating costs [54].