## 2 Methodology
### District Heating Network
#### 2.3.5 Use of Renewable Energy Carriers Produced in WWTP for WWTP Needs
The main energy source naturally produced in the WWTP is biomethane, which is obtained by biogas upgrading and CO\({}_{2}\) methanation [14]. The green hydrogen required for methanation is, in turn, obtained in an electrolyzer integrated into WWTP, effectively utilizing the electrolysis by-products in other wastewater treatment processes [13]. However, biogas production in WWTPs is often limited [107]. For example, in Sweden, more than 1100 million m\({}^{3}\) of wastewater are treated every year in 453 WWTPs across the country; of these, only 5% of the plants treat wastewater from >100,000 PE, while 60% of the WWTPs have a size of <10,000 PE [112]. Only 135 WWTPs in Sweden have a digester for biogas production from sludge, since many WWTPs are small and it is not profitable to build one [42]. As the incoming wastewater flow decreases, the demand for all electrolysis products--hydrogen, oxygen, and heat--decreases. Although technically possible, installing an electrolyzer in a WWTP may not make economic sense in the case of insufficient wastewater volumes. At present, AD is mostly used in WWTPs with a capacity exceeding 20,000 m\({}^{3}\)/d. Integrating co-digestion into small WWTPs can be a solution for economically viable biogas production in these plants [113]. The main possibility for increasing biogas production in WWTPs is co-digestion of internal residue from wastewater treatment and external organic feedstock originated from sources close to WWTP [107]. The literature provides some examples of co-digestion, where the amount of biogas in WWTP is increased by supplying additional raw materials to the WWTP [107,114]. According to different authors, co-digestion has some benefits in improving the quantity and quality of biogas and bio-fertilizer [107] mainly due to (i) increasing C:N ratio, microbiological activity, buffering capacity, and nutrient recycling [115]; (ii) available readily biodegradable waste [116]; (iii) improving AD through direct interspecies electron transfer (DIET) process via conductive materials such as biochar [117]; (iv) enabling in situ biogas clean-up by physicochemical characteristics of biochar [117]; (v) diluting pollutants by addition of clean biowaste [118], (vi) adding feedstocks to AD tanks to compensate the reduction of organic load in the winter season [119]. Another solution for small WWTPs could be merging by transporting dewatered and thickened sludge from several surrounding WWTPs to the centralized location for digestion to improve the economical viability of biogas production and upgrading to biomethane [120]. Most often used externally derived organic wastes for co-digestion in WWTP are animal manure, agro-industrial residues, garden waste, sludge from fish farming (manure and excess feed), the organic fraction of municipal solid waste (OFMSW) or slaughterhouse waste [114]. Some important wastes derived internally and their utilization in AD, including screenings, grease trap sludge and fine sieved fractions (FSFs), are under investigation [107]. Biochar and algal biomass can be obtained from internal and external waste sources. However, co-digestion of these resources is mainly on laboratory or pilot scale [107]. One of the most important sources of additional raw materials for co-digestion can be sorted food waste (FW). According to the EU Waste Framework Directive [121], from 2024, in the EU member states, biological waste, including food and kitchen waste from households, offices, retail and wholesale trade, and catering establishments, must be collected separately or composted in households. As can be found in European household FW studies, the FW amounts vary from 43 kg/cap/a to 129 kg/cap/a, with the European average at 71 kg/cap/a [122, 123, 124, 125]. For example, FW amount in Denmark is 48 kg/cap/a, Finland--56.4 kg/cap/a, Sweden--69 kg/cap/a, Norway--80.2 kg/cap/a, the Netherlands--61.8 kg/cap/a, Poland--61.7 kg/cap/a. Almost 55% of this amount is edible food waste (EFW), the remaining 45% is inedible food waste (IFW) [122].