Methodology for Modernizing Local Gas-Fired District Heating Systems into a Central District Heating System Using Gas-Fired Cogeneration Engines—A Case Study

: Sustainability can be achieved by improving process efficiency, among other methods. In the case of heat supply systems for cities, one of the ways to increase the efficiency of fuel use, and thus reduce resource consumption and greenhouse gas emissions, is the generation of heat and electricity in one process—the use of cogeneration (CHP). The main goal of this paper is to deliver the methodology for a step-by-step modernization process for local gas-fired heating plants through the use of gas cogeneration engines in common central district heating systems. The presented methodology was applied on the basis of a real system located in north-western Poland (case study from Białogard). The profitability of cogeneration was simulated against the background of changing gas prices. The financial and environmental profit from modernization was calculated. The technical requirements that had to be met in order to adapt the existing heating system to cooperation with the new energy source were also presented. The importance of selecting the supply and return temperature of water in the heating system after modernization was emphasized. Based on investment experience, we show that installing a cogeneration engine improves a company’s financial result by 33% (calculated as the difference between the revenue from the sale of energy and the cost of gas only) and is less harmful to the environment, among other benefits, significantly reducing CO 2 emissions by 78%.


Introduction
Even the most energy-efficient buildings with low energy demand will not achieve a low primary energy input (PE) if they are powered from inefficient energy sources.Heat demand in buildings can be reduced by implementing appropriate insulation partitions (walls, roofs, windows, etc.), ensuring adequate air tightness [1], using heat recovery systems [2,3] and/or decentralized ventilation systems [4][5][6][7], and by increasing the efficiency of heat transfer in elements of the building [8].Another idea is to apply heat recovery from domestic hot water [9][10][11] or use novel heating systems [12][13][14] with phase-change materials (PCM) [15], heat pipes [16], or radiative systems [17].Other effective ideas to decrease energy demand in buildings include using earth-to-air heat exchangers [18,19], applying heat pumps into ventilation units [20], incorporating an atrium as an HAVC (Heating Ventilation and Air Conditioning) element [21], or making complex energy audits [22,23], in addition to many others that result in better thermal comfort and lowered energy usage [24].Legal requirements in the European Union require new erected buildings to be low-energy buildings that take care to ensure thermal comfort and indoor air quality [25].They have to be supplied with heat and electricity from effective energy sources which are characterized by a low value of primary energy input (PE) to meet the above-mentioned requirements.The energy strategy for heat and electricity sources in a given country impacts the design of and refurbishment strategies for its buildings [26].One of the ideas for the energy-and environmentally efficient use of fossil fuels is cogeneration systems [27], where heat and electricity are produced simultaneously in one process.This concept has been reported as beneficial [28,29].Heat obtained in the electricity production process can be treated as waste [27], and its useful use increases the energy efficiency of the system [30,31].The benefits and limitations of integrating CHP with the existing energy system have recently been described, i.e., [32,33].From this point of view, cogeneration systems should be supported by law and subsidies, i.e., by means of "white certificates" [34].This subject of discussion about the future of modernized heating plants has been explored, for example, in papers [35][36][37].Nevertheless, nowadays in Poland there are many coal-fired heat sources in use.Many of them are technologically outdated and require modernization, as was strongly highlighted in paper [38].At the same time, electricity comes from power plants, which are also often coal-fired.This means that the advantages of combined heat and electricity production-i.e., cogeneration-are not utilized.There are many studies and analyses in the world literature regarding cogeneration/CHP (combined heat and power plants).This indicates a considerable interest in the potential of using this type of energy source in a modern low-emission energy economy in order to implement the idea of Industry 4.0, as one of the pathways for electrification [39,40], or as a way of supporting the energy transition [41] and the continuity of energy production [42].Selected works in this field which outline the background of the analysis conducted in this paper are cited below.
In article [43], a multiple-criteria decision-making process was used to assess three different scenarios of existing district heating modernization: (a) existing CHP steam turbines, (b) CHP backpressure steam turbines, and (c) CHP gas turbines.In variant (a), it was assumed that fossil fuels would be replaced with biomass and the further operation of existing steam turbines.Thanks to the use of renewable fuel, this solution turned out to be the most advantageous in terms of minimizing the demand for primary energy.The possibility of using biomass-fired CHP was also analyzed in [44].Such a system has been described as "technologically mature" and has been shown to guarantee the security of obtaining benefits and independence from individual prosumers without the need to introduce significant changes to the energy infrastructure.In turn, work [45] presents the technology of biomass gasification for the purpose of powering CHP (in this solution, the fuel burned in gas engines is biogas from biomass).Organic Rankine cycle-based cogeneration systems (ORC) are presented in paper [46].Experimental investigations were performed to assess the possibility of the integration of an ORC system with a domestic central heating gas boiler.The results show that CHP based on ORC can successfully help in "reductions of dust emissions and air pollution in urban and rural areas by limiting the number of low-quality fuel combustion processes".
In paper [47], a procedure for optimizing a CHP source fired with landfill biogas was presented.The results showed that waste fuel can be used in this way, and therefore additional reductions in CO 2 emissions can be made to the benefit of the natural environment.
In the literature, one can also find examples of tri-generation systems where heat, electricity, and cold are produced, e.g., the energy and exergy analysis presented in the article [48].According to the authors of the cited work, such a system has a chance to achieve net-zero CO 2 emissions.This is confirmed by the results of the analysis carried out in [49] for the technology campus in Tallinn (Estonia).It has been shown that the use of system cooling can result in "1.9 times less primary energy for cooling generation than local cooling".
The problem of CHP that was reported in paper [50] is a significant decrease in electrical efficiency during periods of high external air temperature, when the cooling of the gas turbine is impaired.A reduction in electrical power was observed from 306.6 to 260.8 MW with an increase in air temperature from 15 to 45 • C. Another problem associated with the use of gas cogeneration is the security of the fuel supply chain.During an energy crisis, the reaction of state administration bodies plays an important role in the context of the threat of war, or during a war in another country, where global politics and sanctions affect the energy market in the region [51].
In addition to large, central cogeneration systems, there are local solutions available on the market, e.g., so-called micro-cogeneration (MCHP).Article [52] presents a technical and economic analysis of the possibility of using such a solution for buildings in Italy.It was noted that "using a micro-cogeneration system in a large complex of buildings, that the financial parameters can continually increase with the plant's capacity with the electrical load following, but with a loss of the recovered heat from the cogenerator because it may reach values that are not necessary for the users".By applying optimized thermo-energy storage to MCHP the effectiveness can be improved, ensuring-at the same time-better perspectives for integration with renewable energy sources [53].MCHP can also be supplied with biogas, as reported in [54].New constructions of highly efficient MCHP are constantly appearing in the literature, e.g., [55].The flexibility of power generation under uncertain demand has recently been highlighted [56].
Most published articles concern theoretical simulations or the optimization of the operation of existing or designed CHP systems, with some even using artificial intelligence techniques [57].For example, paper [58] presents three scenarios using CHP to ensure the carbon neutrality of a selected heating system.Article [38] discusses the technical and economic possibilities of modernizing existing heating plants in Poland through the use of CHP.Attention was drawn to the fact that "selection of modernization technology is affected, in terms of profitability, by the value and variability in time of the price relationships between energy carriers, rapidly growing charges related to CO 2 emission allowances, and costs depending on other pollutant emissions that originate from the operation of electricity and heat sources powered by fossil fuels".Theoretical variants were analyzed, and an analysis method was presented supporting the selection not only of the modernization variant, but also of the moment of its implementation, in order to obtain the best energy and financial effects.In [59], heat and power decoupling technologies were investigated with a simulation tool-Ebsilon-to obtain peak shaving flexibility.A theoretical method for power peak shaving was also described in [60].In [61], the multi-objective optimization of two cogeneration systems with different connection modes was performed on the basis of theoretical simulations using the Cuckoo Search algorithm.The optimization of a cogeneration system design (theoretical approach) with an extended automated targeting model (ATM) was described in [62].
This article presents an analysis of the modernization of the existing heating system located in north-western Poland.The existing coal heat sources were previously replaced with gas boilers and later modernized to cogeneration systems based on gas piston engines (CHP).This work presents a quantitative analysis of the energy and environmental benefits brought by the last step in the modernization of the heating system, and also describes a list of changes that the existing heating system had to undergo when replacing the heat source with an energy source (heat and electricity).In this way, this article complements existing theoretical analyses with an analysis of the realized modernization of an existing heating system.This article presents a developed methodology aimed at presenting the successive steps that a potential investor interested in the modernization of an existing local heating system based on gas boilers for the installation of a cogeneration unit should take.The proposed methodology was practically applied to a real example of modernized diffuse heat sources in north-western Poland in order to adapt it to work with a gas cogeneration engine (case study).The presented method allows for systematic analysis and decision support in the process of modernizing a heat source for gas cogeneration, and is an important and practical addition to the existing literature knowledge base in the field of the effective use of cogeneration sources of heat and electricity.
This research contributes to the goal of sustainability by presenting a method for modernizing gas heat sources that can be used to increase the efficiency of the use of fossil fuels, and thus preserve more natural resources for future generations of humanity.The application of this method on the example case study promotes the associated economy, which is a better sustainable alternative to the existing approach of separate heat and electricity sources.This article allows for a methodical and systematic implementation of modernized distributed heating systems with local heat networks, and therefore for a more sustainable organization of this process.This is an important issue due to the presence of many existing heating systems that require modernization; newly established systems, when built from scratch, have a chance to achieve much better sustainability.

Methodology-Steps to Be Taken when Modernizing a Gas Heat Source to a Cogeneration System
The simultaneous production of heat and electrical energy in one thermodynamic process is most profitable in terms of utilizing the primary energy of fuel.We can distinguish gas cogeneration based on a gas turbine or a reciprocating engine.The first solution is most commonly applied in large industrial combined heat and power plants, while the second is gaining increasing interest from local heat producers who supply energy through district heating networks to customers.Poland is one of the countries in Europe where district heating is highly developed.Approximately 50% of households are supplied from this type of source.This is a good result, but there is significant potential for further development.Expanding heat production to include additional electricity sales can be an additional source of income for companies in stable market conditions [63], and will positively impact a reduction in costs in thermal energy production.
This article proposes and presents an example methodology for modernizing a gas heat source.The decision-making and calculation steps according to the described methodology are as follows: A.
Gathering Data on the Existing District Heating System A. 1. Monthly and annual amount of heat produced.A. 2. Monthly and annual amount of heat sold (for heating purposes and heating domestic hot water).A. 3. Monthly and annual amount of consumed natural gas. A. 4. Average thermal efficiency of existing production sources.A. 5. Daily information about the outdoor temperature for a given location.

•
Minimum daily average data to perform calculations;

•
Depending on required supply temperature: • If the system is already low temperature, then no additional modifications are needed.

•
If the system is ultra-low temperature, then no additional modifications at the substation side are needed.We should consider recalculating the selection of a three-way valve in order to keep minimum temperature in return pipe at engine side at 70 • C (engine must be running at parameters 90/70, despite required temperatures at district heating side).

•
If the system is medium temperature (above 100 • C), we should consider two variants: 1.
Maintain existing temperature level and design peak gas boilers to achieve higher supply temperature (above 90 • C, i.e., the maximum supply temperature of the gas engine).This has lower investment costs.
2. Modernize all heating substations to meet new requirements at the district heating system side (maximum supply temperature 90 • C).This has higher investment costs but lower heat losses.The main scope of work necessary to be performed on the substation side is as follows: • Increase the heat exchanger surface;

•
Replace regulation valves to work at higher water flow.

•
Depending on required available pressure: • If the modernization covers only the replacement of existing boilers with a group substation, then the required available pressure at the building side (after the heat exchanger) is at the same level as before (it was generated by the main circulation pumps at the boilers).For the district heating system side (before the heat exchanger) it must be calculated taking into account the pressure drop at maximum heating water flow especially for: 1. heat exchanger, 2. control valve, 3. differential pressure regulator.

•
If the modernization covers the liquidation of boilers and installation substation in every single building, then the same calculations must be performed as mentioned above with comments below: 1.For the building with modernized internal heating installation made of plastics with appropriately selected diameters recommended available pressure at the building side is 50 kPa at maximum heat demand, 2. For an old installation made of steel pipes, where there was no water treatment, recommended available pressure at the building side is 100 kPa at maximum heat demand, B. 2. Modernization of gas boilers into group or individual single-or dualfunction substations.

•
If the heating plant supplies only heat for heating purposes, then two variants can be chosen, depending on technical and financial issues.

1.
In the first variant, each existing distribution point in the building will be modernized, and a single-function substation will be installed.In this case, it will be necessary to design equipment for the new parameters of the district heating network, both in terms of available pressure and supply temperature, as well as the desired return temperature.Additionally, the existing underground heating installation connecting buildings to the heating plant will be used as the district heating network if the technical condition of the insulation, the required pipe diameter, and the material of the pipelines allow for operation with a heating water pressure of up to 0.6 MPa.Otherwise, the existing local district heating network will also require modernization in terms of the technical parameters mentioned earlier, i.e., pipe diameter and material, along with insulation thickness.2.
In the second variant, the existing heating installation in buildings along with underground pipelines will be maintained in the current state.
Only the heating boiler will undergo modernization, being eliminated and replaced with a single group substation.In this case, only one substation will need to be designed, which can be adjusted to the new operating conditions on the primary side (district heating network), as well as adapted to the secondary side corresponding to the previ-ous operational parameters (i.e., for the needs of a low-temperature or medium-temperature heating system, depending on the option selected in point B. 1.).The downside of this solution is the lack of the possibility for individual temperature control and billing for the consumed heat, due to the lack of hydraulic separation between the buildings connected to the heat node.The advantage of this solution is significantly lower investment costs.

•
If the heating plant supplies heat for domestic hot water purposes, then two variants can also be chosen, depending on individual (1) or group (2) solutions: 1.
The advantage of this variant is the possibility of individual temperature regulation and billing for the consumed energy only using a heat meter.This requires investment in each building, significantly increasing investment costs.Additionally, it is necessary to analyze the possibility of using the central heating installation that connects the heating plant with the building to meet the operating parameters of the district heating network, both for supplying thermal power for heating and DHW.An often-overlooked advantage is the operation of underground pipelines throughout the year (in contrast to the four-pipe system, where the pipes for central heating operate only seasonally), significantly extending the maintenance-free operating time of such an installation.Another advantage is the small water capacity of the installation for which thermal overheating can be implemented to protect against legionella.It is worth mentioning that it is easier to regulate the circulation of domestic hot water in one building than in a group of buildings.2.
To reduce the investment costs, it is possible to install a group substation for domestic hot water preparation.In this variant, DHW is prepared in a central heat exchanger located in a group substation.The delivery of hot water to residents is carried out using circulation pumps and additional pipelines (supply and return) which transport the heated water to apartments and return a portion of it to maintain the appropriate temperature in the circulation circuits.In this case, the underground heat transmission infrastructure is in a four-pipe system (two pipelines for both central heating and DHW).Billing consumers for the water consumed involves installing water meter systems (on supply and circulation) at the entrance to each building, coupled with a single heat meter system in the group substation.Billing for the energy used for domestic hot water involves determining the total water heating coefficient for the entire housing estate, calculated as the ratio of the heat consumed to the amount of water used (as described in formula no.5).
Then, for each building, the difference between the supply and return water meters is determined, indicating the amount of water consumed by residents.This value is multiplied by the heating coefficient for the entire estate, and the resulting amount of consumed heat is the basis for issuing the settlement document.This calculation method can pose significant operational difficulties in the event of a water meter system failure in one building, with no reliable way to obtain information about its consumption.In such a situation, the amount of heat recorded by the main heat meter will be billed to the remaining consumers, who will cover the cost of water not accounted for by the damaged water meter.Another drawback is that the thermal modernization of DHW installation in one building does not translate into benefits solely for that property, but for all consumers.This is because the amount of heat used for heating is read from the heat meter located in the heating plant.Furthermore, a lack of adequate DHW circulation can lead to the development of Legionella bacteria.This is compounded by the extensive installation (including underground sections), which often makes it impossible to achieve proper DHW overheating to prevent the proliferation of harmful bacteria.
The decision to choose a specific scenario for a given location is usually dependent on the investment budget.All previously described variants, when the installation is properly operated, will enable a stable supply of heat and accurate billing.However, considering the increasing awareness of consumers and the desire for an individual approach in terms of installation parameters in a building (heating curve, minimum and maximum temperature, work schedule), only dual-function substations installed in buildings provide the best opportunities. 1.
Main heat source-covering 100% of heat demand for district heating system.

2.
Additional heat source: a. Depending on installation method: i. Working in parallel with the gas peak boilers-connecting cogeneration engines with the use of buffer vessels to maintain a constant water flowrate independent of variable flow in the district heating network.Recommended for low-temperature district heating systems.ii.Working in serial-heating up water in return pipeline-to avoid increased heat losses because of higher water temperature locations.Should be close to the heating plant with boilers.Recommended for high-temperature district heating systems.
b. Depending on the purpose: i.In order to produce heating power for domestic hot water only.
The engine (or two of them to increase reliability) is selected to match the heating power calculated for the summer period.ii.In order to produce heating power for domestic hot water and heating purposes.Several engines (depending on budget and reliability considerations) are selected to maximize the working time of each machine.
To provide the missing heating power between the maximum hour average heating load and the total heating power that cogeneration units can supply (cheaper solution).2.
To provide the entire required thermal power by gas boilers in the event of the shutdown or failure of all cogeneration units (more expensive solution).

F. Environmental Analysis
F. 1. Calculation of annual reduction in carbon dioxide emissions into the atmosphere.
Each of the steps (from A to F) presented above has been described in detail in the Section 3.

Formulas Used in the Calculations
Heat losses in the existing district heating system were determined as the difference between the amount of heat generated at the source and the amount of heat sold for each month: Heat losses in the new main pipeline were determined as the product of the designed length of the supply and return pipes and the unit heat losses in the pre-insulated pipeline for a given temperature: where L denotes the total length of the designed heating network [m], q denotes heat losses based on the manufacturer's data, considering the calculated temperature in the supply and return pipes and the diameter of the pipe [W/m], τ is the operating time of the heating network [h].
The average monthly thermal efficiency of existing production sources was calculated as the ratio of the heat produced to the consumed natural gas: where Q heat production is the amount of heat produced by gas boilers [GJ], V gas is the consumed amount of natural gas [m 3 ], w d is the heating value of the fuel [ GJ m 3 ].Heat consumption to cover heat losses due to transmission was calculated as follows: where The individual amount of consumed heat for domestic hot water (DHW), when using a group substation, was calculated from Equation (5). where Q total is the total amount of consumed heat for DHW, measured at the group substation [GJ], Sustainability 2024, 16, 1401 9 of 30 .
m inddhw is the amount of hot water supplied to the building m 3 , .m indcirc is the amount of circulating water returning from the building m 3 , .m total cold is the amount of cold water used for heating, measured at the group substation m 3 .

Results
The following sections discuss the use of the methodology presented in point 2. The analysis and calculations were performed for a real existing heating system.The system is characterized in Section 3.1.

A. Gathering Data on the Existing District Heating System
Following the methodology presented in point 2, in the first step, "A.Gathering data on the existing district heating system", the following data should be gathered: A. 1. Monthly and annual amount of heat produced.A. 2. Monthly and annual amount of heat sold (for heating purposes and heating domestic hot water).A. 3. Monthly and annual amount of consumed natural gas. A. 4. Average thermal efficiency of existing production sources.A. 5. Daily information about the outside temperature for a given location.
The studied district heating system located in north-western Poland consisted of seven independent local heating plants powered by natural gas (designated as K1-K7) and produced energy for domestic needs by cooperating with local heating networks.The total installed heating capacity in all boilers was 13.8 MW, with the minimum ordered power slightly exceeding 11.05 MW.The energy source was nitrogen-enriched natural gas with an average calorific value of 23 MJ/m 3 .Heat was generated in water boilers with a forced draft burner.The average efficiency of the boilers ranged around 80%, and the total heat production exceeded 81,000 GJ (as shown in Table 1, column 10, in the summary), with sales for heat and hot water production amounting to 60,700 GJ (column 4 in Table 1) and 12,700 GJ (column 6 in Table 1), respectively.Over the year, all heating plants consumed nearly 4.5 × 10 6 m 3 of natural gas.The total length of district heating networks was 7.0 km, made entirely of pre-insulated pipes.Depending on the heating plant, heat supply was either direct or indirect, and single-or dual-function.Heating plants K1, K2, and K4 supplied heat to consumers using dual-function substations and local heating systems.For two neighborhoods, production occurred exclusively seasonally for central heating purposes (K3 and K5).In the case of three heating plants (K5, K6, and K7), heat delivery for heating purposes was direct, without the involvement of substations, while in two of them (K6 and K7), domestic hot water was locally prepared in a tank.The differences between the types of used infrastructure are shown in Figures 1-4.Table 1 presents the parameters of each heating plant along with the annual heat consumption for various purposes.In the analyzed scenario, the average heating plant efficiency was approximately 80%.This means that existing heat sources did not require immediate modernization.However, due to the owner's decision to expand the scope of the production to include electrical energy in the new CHP plant, it was necessary to liquidate the existing heat sources.
In Figure 5, the locations of the existing gas boilers, marked as K1-K7 (blue rectangles), supplying local district heating networks (marked as purple arrows), are presented schematically.The red lines represent the route of the new main district heating network, which was designed to connect all heating plants through pipelines with diameters of steel carrier pipe DN250 and DN300, and PEHD (polyethylene high density) jacket pipe diameters DN400 and DN450, respectively.Between the jacket pipe and steel carrier pipe there is polyurethane foam insulation with a thickness depending on the pipe diameter.Depending on the selected solution for every heating plant (described in more detail in the next section), they will be modernized to work with a new combined heat and power plant (CHP) marked in green.

B. Concept Development
The following steps should be conducted while realizing point "B.Concept development": B. 1. Integration of existing heat sources into a unified district heating network.B. 2. Modernization of gas boilers into group or individual single-or dual-function substations.
Heating plants K1, K2, and K4 generated medium-temperature heat, which was delivered to dual-function substations installed in buildings through the local district heating network (Figure 6).In this case, the investor decided on option number 2 in point B. 1 of the methodology, i.e., the modernization of substations.Therefore, each substation was recalculated to meet the new parameters of the district heating system.The assumed maximum available pressure for each substation is 150 kPa on the district heating side.The excess available pressure will be reduced by the differential pressure valve.It should also be considered that the new heating source will be a cogeneration unit that typically achieves an output temperature not exceeding 90 °C .Considering the planned length of pipelines between the new source and the substations, it can be expected that the delivery temperature on the network side of the substation will not exceed 85 °C .Changing the operating parameters of the district heating network from 100/70 °C (medium-temperature DHS) to 85/65 °C (low-temperature DHS) will result in an almost double increase in To calculate the heat demand for a new cogeneration power plant, information on the outdoor temperature in the analyzed period is necessary.It is recommended to obtain data from local weather stations if possible.If not, data should be obtained from the nearest weather station.In Poland, it is possible to download meteorological data from the website of the government institute IMGW (Instytut Meteorologii I Gospodarki Wodnej-Institute of Meteorology and Water Management).The available data include information about daily average outside temperatures and other parameters, such as wind speed, cloudiness, relative humidity, atmospheric pressure, and rainfall/snowfall.It is not recommended to use data from outdoor temperature sensors connected to substation temperature controllers.Many of them are not located on the north wall of the building (to avoid the influence of sunlight), away from doors, windows, or air outlets.Inappropriate location leads to inaccurate temperature readings which result in large calculation errors when trying to estimate daily or hourly average heat demand for heating purposes.More detail on the use of meteorological data is given in point 3.3.4(Section C).

B. Concept Development
The following steps should be conducted while realizing point "B.Concept development": B. 1. Integration of existing heat sources into a unified district heating network.B. 2. Modernization of gas boilers into group or individual single-or dual-function substations.
Heating plants K1, K2, and K4 generated medium-temperature heat, which was delivered to dual-function substations installed in buildings through the local district heating network (Figure 6).In this case, the investor decided on option number 2 in point B. 1 of the methodology, i.e., the modernization of substations.Therefore, each substation was recalculated to meet the new parameters of the district heating system.The assumed maximum available pressure for each substation is 150 kPa on the district heating side.The excess available pressure will be reduced by the differential pressure valve.It should also be considered that the new heating source will be a cogeneration unit that typically achieves an output temperature not exceeding 90 • C. Considering the planned length of pipelines between the new source and the substations, it can be expected that the delivery temperature on the network side of the substation will not exceed 85 • C. Changing the operating parameters of the district heating network from 100/70 • C (medium-temperature DHS) to 85/65 • C (low-temperature DHS) will result in an almost double increase in the heat exchange surface area in the heat exchangers, which must be taken into account in the modernization plans.Therefore, all installed heat exchangers in the substations connected to the K1, K2, and K4 heating plants were replaced with new ones with surface areas doubled in size.This action was necessary to compensate for the lower supply temperature on the district heating system side (a drop from 100 • C to 85 • C).Control valves for heating and domestic hot water purposes were also recalculated, taking into account the new water flow and assumed available pressure.Based on this data, all valves were replaced together with the actuators.Lowering the available differential pressure will require the use of a larger diameter for the control valve.In the case of heating plant K3, which generated medium-temperature heat delivered to single-function substations installed in buildings through the local district heating network (Figure 7), the same analysis mentioned above must be conducted.This case is very similar to heating plants K1, K2, and K4, with one difference, i.e., a single-function substation.For this reason, an analogous analysis as mentioned above must be performed.In the case of heating plant K3, which generated medium-temperature heat delivered to single-function substations installed in buildings through the local district heating network (Figure 7), the same analysis mentioned above must be conducted.This case is very similar to heating plants K1, K2, and K4, with one difference, i.e., a single-function substation.For this reason, an analogous analysis as mentioned above must be performed.Figure 6.An example photo of a wall dual-function substation installed in one of the buildings powered by the K1 heating plant (after modernization).The photo shows a part of the district heating system before connecting the building's internal installation.
In the case of heating plant K3, which generated medium-temperature heat delivered to single-function substations installed in buildings through the local district heating network (Figure 7), the same analysis mentioned above must be conducted.This case is very similar to heating plants K1, K2, and K4, with one difference, i.e., a single-function substation.For this reason, an analogous analysis as mentioned above must be performed.Heating plant K5 was operated exclusively to meet the thermal power demand for central heating needs, only without the use of a substation (Figure 8).According to the investor's decision, this heating plant will be replaced with a single-function substation.This is one of the options proposed in point B. 2 in the methodology.The new substation will be designed to keep the same parameters on the installation side of the building (maximum heating temperature of 80 • C) while interacting, at the same time, with the new district heating system parameters, i.e., an available differential pressure of 150 kPa and maximum supply temperature of 85 • C (Figure 9).Heating plant K5 was operated exclusively to meet the thermal power demand for central heating needs, only without the use of a substation (Figure 8).According to the investor's decision, this heating plant will be replaced with a single-function substation.This is one of the options proposed in point B. 2 in the methodology.The new substation will be designed to keep the same parameters on the installation side of the building (maximum heating temperature of 80 °C ) while interacting, at the same time, with the new district heating system parameters, i.e., an available differential pressure of 150 kPa and maximum supply temperature of 85 °C (Figure 9).Heating plants K6 and K7, in terms of supplying heat for central heating, do not differ from heating plant K5.However, they have an additional function related to the preparation of domestic hot water (DHW).Before the modernization, the delivery of hot water to residents was accomplished using tanks installed in the heating plant equipped with coils where cold water was heated to the required temperature.The coils in the tanks were powered by a dual-function heating boiler.This solution caused major problems with billing for heat, domestic hot water temperature regulation, and its circulation between buildings.For this reason, the investor decided to choose the first variant of the methodology from point B. 2, i.e., installing an individual dual-function substation in each building (Figure 10).Heating plants K6 and K7, in terms of supplying heat for central heating, do not differ from heating plant K5.However, they have an additional function related to the preparation of domestic hot water (DHW).Before the modernization, the delivery of hot water to residents was accomplished using tanks installed in the heating plant equipped with coils where cold water was heated to the required temperature.The coils in the tanks were powered by a dual-function heating boiler.This solution caused major problems with billing for heat, domestic hot water temperature regulation, and its circulation between buildings.For this reason, the investor decided to choose the first variant of the methodology from point B. 2, i.e., installing an individual dual-function substation in each building (Figure 10) Figure 10.An example photo of a wall dual-function substation installed in one of the buildings powered by the K6 and K7 heating plant (after modernization).The photo shows a substation hanging on the wall, with the necessary control box on the right.The district heating system is connected from the bottom, the building's DHW installation from the top left, and building's heating system is connected from top right.

Heat Losses of the Existing Local Heating Networks
According to the assumed schedule, a necessary parameter for calculation is the heat loss of the existing network infrastructure.This is determined as the difference between the amount of heat produced in a given heating plant and that delivered to consumers.Heating plants K5, K6, and K7, where energy was generated, were settled directly by property managers, and they subsequently settled with residents.Therefore, it was not possible to determine heat losses because the producers did not have data on the actual Figure 10.An example photo of a wall dual-function substation installed in one of the buildings powered by the K6 and K7 heating plant (after modernization).The photo shows a substation hanging on the wall, with the necessary control box on the right.The district heating system is connected from the bottom, the building's DHW installation from the top left, and building's heating system is connected from top right.

Heat Losses of the Existing Local Heating Networks
According to the assumed schedule, a necessary parameter for calculation is the heat loss of the existing network infrastructure.This is determined as the difference between the amount of heat produced in a given heating plant and that delivered to consumers.Heating plants K5, K6, and K7, where energy was generated, were settled directly by property managers, and they subsequently settled with residents.Therefore, it was not possible to determine heat losses because the producers did not have data on the actual amount of energy delivered to residents.Due to the assumption that no new customer is connected to the network, it was also assumed that the billing method before and after modernization remains unchanged.Therefore, in this analysis, heat losses are shown only for heating plants K1, K2, K3, and K4 (Equation ( 1)).
The determined percentage heat losses in relation to the amount of sold energy range (calculated in Table 2) from 7 to 14% for the analyzed heating plants, which, in the case of pre-insulated networks, indicates good technical condition.If other parameters such as the material from which the pipelines are made or the allowable working pressure (as described in point B. 1 and B. 2 of the methodology) do not pose an obstacle to their further operation, then based on the percentage heat losses, the need for replacement can be excluded.

Heat Losses of the New District Heating Main Network
Based on the investor's project assumptions, connecting all existing heating plants with a single district heating main network will require the construction of 9 km of new pipelines (both supply and return), as shown in Figure 1.A very good solution in this situation could be a ring district heating network.It has an additional advantage related to the possibility of the two-way supply of individual recipients in the event of a failure of a section, as well as the use of its capacity as a natural heat accumulator, which is very desirable in the case of a cogeneration source.An important parameter for this type of investment is the selection of the appropriate pipe diameter.In the case of a ring network, it must be able to deliver the required amount of heat to recipients regardless of the direction; depending on the network configuration, especially in the event of a fragment failure, there may be different flow directions.Taking this into account, it is reasonable to design a main with the same diameter, which will ensure the appropriate amount of heat to recipients, taking into account losses during transmission, and will also allow the future connection of new recipients.At this stage, the investor assumed that the ring district heating network with a total length of 9 km would have a steel pipe diameter of DN250 with an insulation thickness of 75 mm (external diameter DN400).The new cogeneration plant would operate quantitatively with the assumed temperature parameters of 85 • C in the supply pipeline and 55 • C in the return pipeline.With the above data, and using the catalog card of the pre-insulated pipe manufacturer, we can easily determine the heat losses that will be generated from the new main.In the case of DN250/400 pipes, the unit heat loss in the supply pipeline will be 36 W/m, and for the return pipeline, it will be 20 W/m (based on data from pipe manufacturer-Table 3 [64]).For such a designed district heating network, the total heat loss from the hot water to the ground through the pipe will be 504 kW.

Domestic Hot Water Consumption
In the next stage, it is necessary to determine the average heat power that needs to be delivered to consumers during the summer season, when only the heating of domestic hot water is carried out.Ideally, the best source of data would be the summed heat quantities recorded by the heat meter in the domestic hot water circuit.Unfortunately, in this case, we only have the total amount of heat for residential purposes, i.e., for both space heating and domestic hot water.Therefore, it is necessary to determine the average amount of heat used when prioritizing the heating of domestic hot water, considering the summer months.At this point, we need to be sure that central heating was not activated during the analyzed period, which would affect the forecasted value.Taking into account the typical external temperatures in the summer, and considering that, in many cases, the heating season in the West Pomeranian Voivodeship ends in May and usually begins in September, it seems reasonable to analyze the period between June and August.By adopting such a mechanism, we make a certain simplification, assuming that the average heat consumption in each month of the year is at a similar level.
In the case of performing the function of heating domestic hot water, there is a certain repetitiveness in the profile of water consumption by residents during the day (Figure 11).In many studies, as well as based on our own conducted analyses, we can observe that consumers use hot water between 6:00 and 24:00 (Figure 12).For such a designed district heating network, the total heat loss from the hot water to the ground through the pipe will be 504 kW.

Domestic Hot Water Consumption
In the next stage, it is necessary to determine the average heat power that needs to be delivered to consumers during the summer season, when only the heating of domestic hot water is carried out.Ideally, the best source of data would be the summed heat quantities recorded by the heat meter in the domestic hot water circuit.Unfortunately, in this case, we only have the total amount of heat for residential purposes, i.e., for both space heating and domestic hot water.Therefore, it is necessary to determine the average amount of heat used when prioritizing the heating of domestic hot water, considering the summer months.At this point, we need to be sure that central heating was not activated during the analyzed period, which would affect the forecasted value.Taking into account the typical external temperatures in the summer, and considering that, in many cases, the heating season in the West Pomeranian Voivodeship ends in May and usually begins in September, it seems reasonable to analyze the period between June and August.By adopting such a mechanism, we make a certain simplification, assuming that the average heat consumption in each month of the year is at a similar level.
In the case of performing the function of heating domestic hot water, there is a certain repetitiveness in the profile of water consumption by residents during the day (Figure 11).In many studies, as well as based on our own conducted analyses, we can observe that consumers use hot water between 6:00 and 24:00 (Figure 12).This is also confirmed by the analysis of thermal power demand for domestic hot water (DHW) purposes presented in the above chart.The initiation of the installation is clearly visible around 5:00 a.m., around which time there is an increase in thermal power demand to heat the cooled water in the installation (in the supply and circulation pipelines).This is due to the fact that many buildings have reduced supply temperatures and operate in saving mode during the nighttime hours.Then, the so-called "morning peak" and "night peak" are visible, during which times the increased demand for thermal power is again noticeable.Taking the above into account, it was assumed that the DHW heating function is performed for 18 h per day.
Based on these assumptions, the average amount of heat consumed for DHW purposes was calculated for each boiler room over the entire month, as presented in Table 4.Such calculations were performed for each boiler room, and then the values were summed, resulting in a total of 556 kW.This means that on average throughout the year, from 06:00 to 24:00, this thermal power will need to be supplied to all consumers for space heating purposes.

Central Heating Needs
In this analysis, only data on the total heat demand for both space heating (central heating) and domestic hot water (DHW) were available.For DHW, only summer periods were considered in the analysis.To determine the amount of heat used solely for space heating, subtract the average heat quantity for DHW needs, calculated in the previous section, from the total.The result is presented in Table 5 and Figure 13.This is also confirmed by the analysis of thermal power demand for domestic hot water (DHW) purposes presented in the above chart.The initiation of the installation is clearly visible around 5:00 a.m., around which time there is an increase in thermal power demand to heat the cooled water in the installation (in the supply and circulation pipelines).This is due to the fact that many buildings have reduced supply temperatures and operate in saving mode during the nighttime hours.Then, the so-called "morning peak" and "night peak" are visible, during which times the increased demand for thermal power is again noticeable.Taking the above into account, it was assumed that the DHW heating function is performed for 18 h per day.
Based on these assumptions, the average amount of heat consumed for DHW purposes was calculated for each boiler room over the entire month, as presented in Table 4.Such calculations were performed for each boiler room, and then the values were summed, resulting in a total of 556 kW.This means that on average throughout the year, from 06:00 to 24:00, this thermal power will need to be supplied to all consumers for space heating purposes.

Central Heating Needs
In this analysis, only data on the total heat demand for both space heating (central heating) and domestic hot water (DHW) were available.For DHW, only summer periods were considered in the analysis.To determine the amount of heat used solely for space heating, subtract the average heat quantity for DHW needs, calculated in the previous section, from the total.The result is presented in Table 5 and Figure 13.The analysis of the demand for thermal power for central heating should be based on data on monthly heat consumption for this purpose.However, in this case, these data must be correlated with information on the external temperature at the specific location.Since the received data from the investor did not include such parameters, for the purpose of the analysis, it was decided to obtain them from the IMGW portal for the Kołobrzeg station, which is closest to the analyzed location (as mentioned in point 3.1).Daily air temperature data are presented in Figure 14.Since the information on the amount of heat consumed pertained to the year 2018, the same year's weather data were also collected.The analysis of the demand for thermal power for central heating should be based on data on monthly heat consumption for this purpose.However, in this case, these data must be correlated with information on the external temperature at the specific location.Since the received data from the investor did not include such parameters, for the purpose of the analysis, it was decided to obtain them from the IMGW portal for the Kołobrzeg station, which is closest to the analyzed location (as mentioned in point 3.1).Daily air temperature data are presented in Figure 14.Since the information on the amount of heat consumed pertained to the year 2018, the same year's weather data were also collected.
To determine the average daily heat power that needs to be supplied to consumers for central heating purposes throughout the year, formula no. 4 for calculating heat losses due to transmission was used.In this formula, the monthly heat quantities and the average indoor temperature (specifically, the temperature at which the weather controller installed in the heating node aimed, which was 21 • C according to data from the heat supplier) are known.Using these parameters along with information about the average external temperature from IMGW and the operating time of the installation, the value of the U × A product can be calculated (presented in Table 6).This represents the average heat loss indicator expressed in [MW/K] for all buildings in the analyzed district heating system.It is important to note that this method does not account for gains in heat from residents and, above all, from solar radiation, which is especially noticeable in the spring and autumn periods when the coefficient undergoes a significant reduction.However, when analyzing winter periods (December, January, February) to determine the maximum heat power for central heating (for which the influence of sunlight is minimal for this latitude and longitude), the convergence of parameters is observed.To determine the average daily heat power that needs to be supplied to consumers for central heating purposes throughout the year, formula no. 4 for calculating heat losses due to transmission was used.In this formula, the monthly heat quantities and the average indoor temperature (specifically, the temperature at which the weather controller installed in the heating node aimed, which was 21 °C according to data from the heat supplier) are known.Using these parameters along with information about the average external temperature from IMGW and the operating time of the installation, the value of the U × A product can be calculated (presented in Table 6).This represents the average heat loss indicator expressed in [MW/K] for all buildings in the analyzed district heating system.It is important to note that this method does not account for gains in heat from residents and, above all, from solar radiation, which is especially noticeable in the spring and autumn periods when the coefficient undergoes a significant reduction.However, when analyzing winter periods (December, January, February) to determine the maximum heat power for central heating (for which the influence of sunlight is minimal for this latitude and longitude), the convergence of parameters is observed.The average UA value for winter months (December-March) is 0.2041 MW/K.This means that in the case of an external temperature of 0 °C and a set room temperature of

Table 6.
Comparison of the values of the products of heat transfer coefficients through partitions and the surfaces all buildings in the analyzed heating system, broken down by months.The average UA value for winter months (December-March) is 0.2041 MW/K.This means that in the case of an external temperature of 0 • C and a set room temperature of 21 • C, the average daily heat demand for all analyzed buildings should be the following:

Month
The heat demand for heating purposes was calculated for the entire analyzed year using this developed method (Figure 15).
As mentioned earlier, the selection of a cogeneration unit is best based on the average daily heat demand.However, to maintain the proper operating parameters of the system and the delivery of the heating medium to buildings at the required level, the generating source needs to be supplemented with one or more heating boilers, which will be activated in the event of a temporary decrease in the parameters of the district heating network.For this purpose, data from the already functioning heating system from the years 2020 and 2021 were analyzed.The values of heat power generated on an hourly basis were compared to the daily values throughout the year (Figure 16).These parameters undergo a noticeable change in the daily cycle between 8:00 PM and 8:00 AM; there is an increase in heat power demand by about 30-35% compared to the daily average, while for the rest of the day, the opposite trend is observed.This dependence results from the variable demand for thermal power for domestic hot water.Based on the data from Table 4, the average daily demand for thermal power is 556 kW.However, according to Figure 12, the maximum hourly demand for thermal power in the so-called night peak increases to 750 kW.The difference between these two parameters is 194 kW, which is 35% of the average daily thermal power.For this reason, the selection of the power of the gas boiler to compensate for fluctuations in heat power demand must be based on a value 35% higher than the daily average power determined by this method.
The heat demand for heating purposes was calculated for the entire analyzed year using this developed method (Figure 15).As mentioned earlier, the selection of a cogeneration unit is best based on the average daily heat demand.However, to maintain the proper operating parameters of the system and the delivery of the heating medium to buildings at the required level, the generating source needs to be supplemented with one or more heating boilers, which will be activated in the event of a temporary decrease in the parameters of the district heating network.For this purpose, data from the already functioning heating system from the years 2020 and 2021 were analyzed.The values of heat power generated on an hourly basis were compared to the daily values throughout the year (Figure 16).These parameters undergo a noticeable change in the daily cycle between 8:00 PM and 8:00 AM; there is an increase in heat power demand by about 30-35% compared to the daily average, while for the rest of the day, the opposite trend is observed.This dependence results from the variable demand for thermal power for domestic hot water.Based on the data from Table 4, the average daily demand for thermal power is 556 kW.However, according to Figure 12, the maximum hourly demand for thermal power in the so-called night peak increases to 750 kW.The difference between these two parameters is 194 kW, which is 35% of the average daily thermal power.For this reason, the selection of the power of the gas boiler to compensate for fluctuations in heat power demand must be based on a value 35% higher than the daily average power determined by this method.
In the literature, information can be found about innovative heating systems using heat accumulation [65] in which phase-change materials (PCMs) are used [66].Although this is not a very popular solution yet, it is worth keeping in mind, as it can reduce peak heat demand.Then, the thermal power demand for buildings connected to the district heating system should be properly determined using heat accumulation [67].

D. Selection of Cogeneration Engines with Peak Gas Boilers
As part of the point, "Selection of Cogeneration Engines along with Gas Peak Boilers", the following steps should be performed: The following analyses were conducted based on the investor's decision to install cogeneration engines connected to gas peak boilers with the use of buffer vessels.The engines were selected to match the needs of both domestic hot water and heating power, taking into account maximizing the operating time of the machines.In the literature, information can be found about innovative heating systems using heat accumulation [65] in which phase-change materials (PCMs) are used [66].Although this is not a very popular solution yet, it is worth keeping in mind, as it can reduce peak heat demand.Then, the thermal power demand for buildings connected to the district heating system should be properly determined using heat accumulation [67].

D. Selection of Cogeneration Engines with Peak Gas Boilers
As part of the point, "Selection of Cogeneration Engines along with Gas Peak Boilers", the following steps should be performed: D. 1.Total heating power for the new CHP plant.D. 2. Selection of cogeneration engines.D. 3. Selection of gas boilers.
The following analyses were conducted based on the investor's decision to install cogeneration engines connected to gas peak boilers with the use of buffer vessels.The engines were selected to match the needs of both domestic hot water and heating power, taking into account maximizing the operating time of the machines.

Total Heating Power for the New CHP Plant
By summing up the previously determined data regarding the heat demand for central heating and domestic hot water, and taking into account heat losses in the existing pipelines and the proposed district heating network, we can obtain the value with which the cogeneration source should operate in the new combined heat and power plant.The data are presented in tabular form (Table 7) and in Figure 17.The load in the summer season is determined at 1 MW, while in the winter season, the average fluctuates around 5.5 MW.Heat losses in the summer season significantly increase compared to the scenario before the modernization.These losses are a direct consequence of the need to maintain an additional 9 km of the district heating network with an appropriate supply water temperature, with unchanged heat demand during this period from the end user.

Selection of Cogeneration Engines
The selection of a cogeneration unit with appropriate power should begin with the summer season, considering its maximum utilization.In this case, if the required thermal power in the source is 1 MW, it is reasonable to choose an engine with very similar power.This assumption can be revised after selecting additional devices to cover the heat demand in the winter season, making them multiples of the power of the device in the summer season.This greatly simplifies the operation of such a cogeneration plant and allows for alternate operation in summer during maintenance or repair work.Selecting additional devices for the heating season depends on the theoretical number of hours such a machine operates.The heating season typically lasts from early September to the end of April, giving us 8 months with a total duration of 5760 h.

Selection of Cogeneration Engines
The selection of a cogeneration unit with appropriate power should begin with the summer season, considering its maximum utilization.In this case, if the required thermal power in the source is 1 MW, it is reasonable to choose an engine with very similar power.This assumption can be revised after selecting additional devices to cover the heat demand in the winter season, making them multiples of the power of the device in the summer season.This greatly simplifies the operation of such a cogeneration plant and allows for alternate operation in summer during maintenance or repair work.Selecting additional devices for the heating season depends on the theoretical number of hours such a machine operates.The heating season typically lasts from early September to the end of April, giving us 8 months with a total duration of 5760 h.
Analyzing the chart of heat demand along with the theoretical number of operating hours for an engine with a power of 1 MW, a variant in which one device of this power is selected in the summer season and two additional devices are chosen for operation in the winter season fits well.This will be a total of 3 MW in cogeneration, producing a total of 18,096 MWh of electrical energy and 65,146 GJ of thermal energy.This constitutes 66% of the total heat that will be produced and introduced into the district heating network.
At this point, it is worth considering increasing the power of cogeneration to achieve the status of an efficient heat supply system, which is required when using units above 75%.In Poland, this provides additional benefits and compels potential investors to join such a district heating network instead of building their own gas boiler room.In this case, it would be necessary to install four engines, generating an additional 3288 MWh of  Analyzing the chart of heat demand along with the theoretical number of operating hours for an engine with a power of 1 MW, a variant in which one device of this power is selected in the summer season and two additional devices are chosen for operation in the winter season fits well.This will be a total of 3 MW in cogeneration, producing a total of 18,096 MWh of electrical energy and 65,146 GJ of thermal energy.This constitutes 66% of the total heat that will be produced and introduced into the district heating network.
At this point, it is worth considering increasing the power of cogeneration to achieve the status of an efficient heat supply system, which is required when using units above 75%.In Poland, this provides additional benefits and compels potential investors to join such a district heating network instead of building their own gas boiler room.In this case, it would be necessary to install four engines, generating an additional 3288 MWh of electrical energy and 11,837 GJ of heat, resulting in a share in the total heat production at the level of 77%.

Selection of Peak Boilers
The selection of heating boilers should be made considering the calculated maximum average daily heat load increased by 35%.In the analyzed case, it would be 7.9 MW (March 2018, Figure 8) × 1.35 = 10.67 MW.This value is identical to the current ordered heat power of all customers connected to the network, which is 11.05 MW.The power of the boilers can therefore be chosen in two variants, which will depend solely on the investor's decision and budget (the variants are calculated for the previously adopted scenario involving the installation of four cogeneration units with a total power of 4 MW): • According to the methodology point D.3.1, it will be necessary to use two identical boilers with a total power of 11 − 4 = 7 MW (e.g., 2 × 3.5 MW).This is a safer solution than installing a single 7 MW boiler, which, in case of breakdown or inspection, would not be able to supply any thermal power in the winter season.• An alternative solution, as described in point D.3.2 of the methodology, involves division into a boiler that could operate stably in the summer season (with a power of about 2 MW-stable operation at 50% power) and a cascade of boilers for operation in the winter season (e.g., 2 × 4 MW).Complicated legal regulations that are necessary to follow when producing electricity often cause delays when it comes to starting cogeneration engines.The procedure for producing heat from gas boilers is much simpler.In this situation, the investor decided to equip the new heat and power plant with three gas boilers with a total capacity of 12 MW (3 × 4 MW), which will provide the entire thermal power required by the new district heating system.

E. Economic Analysis
Under "E.Economic Analysis", the following values should be calculated: E. 1. Revenue from electricity sales.E. 2. Revenue from thermal energy sales.E. 3. Cost of purchasing natural gas.
The economic analysis of the investment was calculated based on the following price assumptions, which were converted from PLN to EUR using the exchange rate from 19 November 2023, amounting to 4.4 PLN/EUR (Table 8).According to the previously adopted assumption that the number of customers connected to the heating network remains unchanged before and after the modernization, the annual amount of sold heat was kept at the same level as in 2018, i.e., 20,389 MWh (73,400 GJ).
The consumed natural gas was determined based on the efficiency of the devices and the amount of heat delivered to customers, taking transmission losses into account.For the heating plants operating before the modernization, their average annual efficiency was 80.2%.For the new combined heat and power (CHP) plant, a thermal efficiency of 90% was assumed for gas boilers, and 43% for cogeneration engines.The electrical efficiency of the generator, according to the device documentation, reaches about 42%, resulting in a total efficiency of 85%.
Based on these assumptions, three economic scenarios were calculated, analyzing only the costs related to the purchase of natural gas and the revenue from the sale of heat and electricity (excluding other operating costs): 1.
The financial results of the company in 2018, where only heat was sold.This was calculated as the difference between the revenue from the sale of heat produced exclusively in gas boilers and the cost of gas fuel.

2.
The theoretical results of the company considering where cogeneration units have already been installed, and assuming that electricity is supplied based on the forecasted prices for 2024.This was calculated as the difference between the revenue from the sale of heat produced from both gas boilers and the cogeneration system in relation to the cost of gas fuel used by all devices.

3.
Hypothetical results of the company with installed cogeneration engines based on 2018 prices.This was calculated based on the assumptions of scenario no. 2, but based on the prices that were valid in 2018.
The analysis presented in Table 9 clearly indicates that the installation of cogeneration engines and the partial replacement of heating boilers results in additional revenue for the company, mainly due to the sale of electrical energy.In 2018 (Scenario 3), when the ratio of the price of electrical energy to the price of gas averaged 2.5, the theoretical increase in the company's revenue compared to the baseline scenario, which included only heat production, was 33%.For the projected prices in 2024, where this ratio will be 2.6, further revenue growth for the company can be expected.These results align with our engineering experience that if the ratio of the price of electrical energy to the price of gas fuel is greater than two, this ensures the profitability of such an investment.Another analysis (presented in Table 10) shows that expanding the business to include additional sales of electrical energy, especially in the summer season when heat sales may be less than 10% compared to the winter months, improves the financial liquidity of the company.In this situation, it is possible to generate additional revenue from the sale of electrical energy while keeping fixed costs unchanged, for example, by training the existing technical staff to operate cogeneration units.The average increase in financial results for the company after the installation of cogeneration units increased by 150% (Table 11), assuming that the ratio between the price of electricity and the price of gas remains unchanged at around 2.5.Working in this way over a longer period (e.g., the entire heating season) ensures a stable additional source of income that will not be exposed to daily and weekly fluctuations in electricity and gas prices.

F. Environmental Analysis
In point "F.Environmental Analysis", the F. 1. calculation of the annual reduction in carbon dioxide emissions into the atmosphere should be performed.
In Poland, approximately 70% of the generated electricity comes from coal [68].The carbon dioxide emissions from producing 1 MWh of electricity from a coal power plant are associated with emitting 850 kg of CO 2 [63].Switching to natural gas reduces the unit emissions to 185 kg of CO 2 /MWh.Therefore, the modernization of the heating system to install a gas cogeneration engine, in addition to positively impacting the company's financial flow, also results in a smaller negative impact on the environment.Such an investment aligns well with the energy policy of the Republic of Poland and other European countries.
In the economic analysis conducted in the previous section, it was assumed that the cogeneration units would produce 18,096 MWh of electricity annually.This amount of electricity produced from natural gas would be associated with an emission of 3348 Mg of CO 2 .If such an investment were not realized, the equivalent amount of energy would have to be purchased from the market, resulting in an almost five times higher emission of 15,382 Mg of CO 2 .
In addition to the positive environmental impact of reducing CO 2 emissions, significantly smaller amounts of other substances, such as nitrogen oxides, sulfur oxides, and particulate matter, are emitted.Cogeneration engines can also be fueled by biogas and, in the future, hydrogen, making them a very good and versatile solution for a local low-emission source of heat and electricity for residents.

Discussion
The planned new cogeneration plant, which will replace local gas boilers after connecting them through a district heating network, must provide power for central heating, domestic hot water, heat losses resulting from the operation of existing underground pipelines, and the planned district heating network.In the analysis, it was assumed that no new consumer was connected, so data on heat consumption for heating and domestic hot water, both before and after modernization, remained unchanged.The methodology analyzes the heat demand requirements for the building and the losses in its transmission from the new source to the recipients.Changing the topology of the heating system to ring, branch, or mixed will involve the need to calculate heat transfer and available pressure losses, which will influence the selection of a new source.In such a case, the developed methodology will also find its application.
The selection of a gas engine that will produce thermal and electrical power in cogeneration must be chosen to achieve the maximum operating time of the device throughout the year.The device is not adapted to frequent on-off cycles compared to a gas boiler burner.Many manufacturers of cogeneration units recommend a minimum continuous operation of 8 h after start-up.Frequent start-ups have a negative impact on the starter's consumption and cause greater mechanical stress, to which the machine is exposed during start-up.
Of course, the device has the ability to control the generated electrical power, which is usually comparable to the generated thermal power.The regulation range is from 50% to 100% of the device's power with a total efficiency of about 85%.However, it should be noted that operating the engine with lower power does not extend the time between inspections.The service activities required by the manufacturer, such as adjusting the fuelair mixture, valve clearances, or oil changes, are dictated solely by the device's operating time, regardless of its load.
An economic analysis of this situation indicates that the best solution is to operate the device at maximum load throughout its operation.It will be able to generate the largest source of income from selling electricity and heat to cover the fixed operating costs associated with its operation.Taking into account the above limitations associated with the use of a cogeneration engine as a main power source, the selection of electrical/thermal power should be based on the average daily values of the required thermal power delivered to consumers.Considering the inertia of the district heating network transporting the heat carrier from the source to customers, which can serve as a natural hot water accumulator, a stable system will be obtained, ensuring the continuous operation of the device.The developed methodology has its limitations in terms of economic analysis.When calculating costs, the method only takes into account revenues from the sale of electricity and heat compared to gas costs.Other company costs such as renovations, salaries, investments, and other fees related to business activity are not taken into account.An extension of this method is planned in the next article.
In summary, the construction of cogeneration engines has a positive impact on the financial results of companies, as well as on the environment, through reduced emissions of substances into the surrounding areas, especially carbon dioxide.
In Poland, there is an increasing interest in solutions based on cogeneration engines.Taking into account the possibility of using alternative fuels to power them, such as biogas, biomethane, or hydrogen, this solution may be a response to environmental protection requirements in the near future.

Conclusions
From the analysis conducted in this paper, the following conclusions can be drawn: • The modernization of heating plants must be analyzed individually each time; • At least 12 months of archived data are crucial to perform the analysis;

•
Increased heat consumption for domestic hot water leads to higher electricity production in summertime;

•
Gas engines can be used as the main heat source for low-temperature and ultra-low temperature district heating systems; • The installation of cogeneration engines and their partial replacement of heating boilers brings companies additional revenue, mainly from the sale of electricity, which may constitute up to 80% of the current revenue from heat sales; • Sales of electrical energy improve the financial liquidity of companies, especially in summer periods when it is possible to double revenue; • With a well-operated installation, revenue from heat covers the total cost of gas fuel and revenue from the sale of electricity covers other costs and generates profit; • A ratio of the price of electricity to the price of gas fuel greater than two ensures the profitability of investing in a cogeneration unit; • The power of the new boiler should be 35% higher than the registered maximum average daily thermal power during the heating period; • Cogeneration engines have a positive impact on reducing carbon dioxide emissions compared to coal-based solutions, with a difference of 78%.

•
In further work, the developed methodology will be expanded to take into account all costs related to running a business, and not only the cost of gas fuel.

1 .
Heat losses in the transmission within the existing district heating system and in the designed heating pipeline.C. 2. Average daily thermal power for domestic hot water and central heating purposes.D. Selection of Cogeneration Engines along with Gas Peak Boilers (if necessary).D. 1.Total heating power for the new CHP plant.D. 2. Selection of cogeneration engines (depending on the variant selected in point B. 1.):

Figure 1 .
Figure 1.Heat supply diagram for heating plants K1, K2, and K4 with the use of a dual-function substation.

Figure 2 .
Figure 2.An example diagram of an indirect heating system with single-function substation.Used in K3 heating plant only for heating purposes.

Figure 1 . 32 Figure 1 .
Figure 1.Heat supply diagram for heating plants K1, K2, and K4 with the use of a dual-function substation.

Figure 2 .
Figure 2.An example diagram of an indirect heating system with single-function substation.Used in K3 heating plant only for heating purposes.

Figure 2 .
Figure 2.An example diagram of an indirect heating system with single-function substation.Used in K3 heating plant only for heating purposes.

Figure 3 .
Figure 3. Direct heat supply diagram for heating plant K5.

Figure 4 .
Figure 4. Direct heat supply diagram for heating plants K6 and K7.

Figure 4 .
Figure 4. Direct heat supply diagram for heating plants K6 and K7.Figure 4. Direct heat supply diagram for heating plants K6 and K7.

Figure 4 .
Figure 4. Direct heat supply diagram for heating plants K6 and K7.Figure 4. Direct heat supply diagram for heating plants K6 and K7.The calculated average thermal efficiency of the boilers is a good indicator of the technical condition of the devices.Annual values around 85-90% for boilers indicate efficient operation of the heating plant and a good match between the installed heat power and the ordered power.Values below 75% clearly indicate the need to modernize the boilers.

32 Figure 5 .
Figure 5. Plan view of existing heating plants (K1-K7) with installed heating power and length of local heating system (marked in purple), along with the indicated designed main district heating network and the new combined heat and power plant (CHP).The lengths of the designed main pipelines between heating plants are also marked in red.

Figure 5 .
Figure 5. Plan view of existing heating plants (K1-K7) with installed heating power and length of local heating system (marked in purple), along with the indicated designed main district heating network and the new combined heat and power plant (CHP).The lengths of the designed main pipelines between heating plants are also marked in red.
Sustainability 2024, 16, x FOR PEER REVIEW 14 of 32 replaced together with the actuators.Lowering the available differential pressure will require the use of a larger diameter for the control valve.

Figure 6 .
Figure 6.An example photo of a wall dual-function substation installed in one of the buildings powered by the K1 heating plant (after modernization).The photo shows a part of the district heating system before connecting the building's internal installation.

Figure 6 .
Figure 6.An example photo of a wall dual-function substation installed in one of the buildings powered by the K1 heating plant (after modernization).The photo shows a part of the district heating system before connecting the building's internal installation.

Figure 7 .
Figure 7.An example photo of a standing single-function substation (heating only) installed in one of the buildings powered by the K3 heating plant (after modernization).The photo shows a part of the district heating system on the right.The building's internal installation is connected to it from the top.Due to the lack of drainage into the sewage system, the tank is connected to the discharge pipe of the safety valve.

Figure 7 .
Figure 7.An example photo of a standing single-function substation (heating only) installed in one of the buildings powered by the K3 heating plant (after modernization).The photo shows a part of the district heating system on the right.The building's internal installation is connected to it from the top.Due to the lack of drainage into the sewage system, the tank is connected to the discharge pipe of the safety valve.

Figure 8 .
Figure 8.An example photo of a direct heating system without substation installed in one of the buildings powered by the K5 heating plant (before modernization).The photo shows the installed three-way control valve for additional temperature control in the building, a circulation pump, and a heat meter.

Figure 8 .
Figure 8.An example photo of a direct heating system without substation installed in one of the buildings powered by the K5 heating plant (before modernization).The photo shows the installed three-way control valve for additional temperature control in the building, a circulation pump, and a heat meter.

Figure 8 .
Figure 8.An example photo of a direct heating system without substation installed in one of the buildings powered by the K5 heating plant (before modernization).The photo shows the installed three-way control valve for additional temperature control in the building, a circulation pump, and a heat meter.

Figure 9 .
Figure 9.An example photo of a wall single-function substation installed in one of the buildings powered by the K5 heating plant (after modernization).The photo shows a substation hanging on the wall, ready to connect the district heating network (supply pipe from the top, return pipe from the bottom), and the internal building installation from the top right.

32 Figure 9 .
Figure 9.An example photo of a wall single-function substation installed in one of the buildings powered by the K5 heating plant (after modernization).The photo shows a substation hanging on the wall, ready to connect the district heating network (supply pipe from the top, return pipe from the bottom), and the internal building installation from the top right.

Figure 12 .
Figure 12.The demand for thermal power by consumers over several days for the purpose of heating domestic hot water.Source: own analysis.

Figure 12 .
Figure 12.The demand for thermal power by consumers over several days for the purpose of heating domestic hot water.Source: own analysis.

Figure 13 .
Figure13.The amount of heat that needs to be supplied to consumers throughout the year, divided into central heating and domestic hot water.

Sustainability 2024 , 32 Figure 14 .
Figure 14.The average daily external temperatures from the Kołobrzeg station (the nearest to Bialogard) in the year 2018.Source: IMGW (Polish Institute of Meteorology).

Figure 14 .
Figure 14.The average daily external temperatures from the Kołobrzeg station (the nearest to Bialogard) in the year 2018.Source: IMGW (Polish Institute of Meteorology).

Figure 15 .
Figure 15.Daily average heat demand for central heating purposes for all buildings.

Figure 15 .
Figure 15.Daily average heat demand for central heating purposes for all buildings.

Figure 16 .
Figure 16.Difference between hourly average heat demand and daily average heat demand for January 2020 and 2021.

D. 1 .
Total heating power for the new CHP plant.D. 2. Selection of cogeneration engines.D. 3. Selection of gas boilers.

Figure 16 .
Figure 16.Difference between hourly average heat demand and daily average heat demand for January 2020 and 2021.

Figure 17 .
Figure 17.Estimated heat load of the new CHP plant.

Table 1 .
Characteristics of analyzed heat sources (heating plants K1-K7): installed and ordered power, annual heat sold and produced, annual gas consumption, and average efficiency of heat production.

Table 2 .
Heat losses in the transmission of heat in existing local networks (in GJ) and percentage breakdown for domestic hot water (DHW) purposes.

Table 3 .
Determination of heat losses for the designed district heating network.

Table 4 .
The monthly average heat consumption along with the determined thermal power for domestic hot water (DHW) purposes.

Table 4 .
The monthly average heat consumption along with the determined thermal power for domestic hot water (DHW) purposes.

Table 5 .
Amount of heat for central heating delivered to consumers supplied by heating plants on a monthly basis.

Table 5 .
Amount of heat for central heating delivered to consumers supplied by heating plants on a monthly basis.
13gure13.The amount of heat that needs to be supplied to consumers throughout the year, divided into central heating and domestic hot water.

Table 6 .
Comparison of the values of the products of heat transfer coefficients through partitions and the surfaces of all buildings in the analyzed heating system, broken down by months.

Table 7 .
Heat production for the new source for central heating and domestic hot water on a monthly basis.
Estimated heat load of the new CHP plant.

Table 8 .
Assumptions for financial analysis.

Table 9 .
Summary of financial results for 3 scenarios.1-beforemodernizationbased on 2018 prices; 2-after modernization based on forecasted prices in 2024 in Table4; 3-before modernization but based the same forecasted prices in 2024.

Table 10 .
Financial results of the company before modernization on a monthly basis.

Table 11 .
Financial results of the company after modernization on a monthly basis.