District heating simulation in the aspect of heat supply safety

District heating systems as strategic objects from the point of view of state security must ensure reliability and security in supply of heat to their customers [1, 2]. Thanks to computer simulation methods, district heating companies can analyse the operation of the heating networks at the design and operation stage. Computer simulations also offer a wide range of possibilities in the aspect of optimization of the district heating operation as well as prediction and analysis of network failure effects [36]. The paper concerns the simulation of a district heating network. The methods for the simulation of heating networks were characterized and simulations of district heating system were carried out. The effects of the failure were analysed at different values of outside temperatures and for different durations of failure. The value of compensation for undelivered heat was also determined. Simulations were carried out for an actual district heating system located in Rzeszow.


Introduction
A district heating system is a set of devices used for heat energy transport through the pipelines from the heat source to the customers through a heat medium, which is most often water or steam.According to data from the Energy Regulatory Office, the total thermal power installed by licensed heat producers in 2016 was 54 259.8 MW, and the available power 53 434.7 MW [7].Among the heat sources, there are mostly small sources with a capacity of up to 50 MW (58.1% in 2016).Only 10 companies had a thermal power exceeding 1 000 MW.The length of the heating network available to licensed heating companies amounted to 20 744.9 km, including heating networks connecting sources with district heating substations and low-parameter networks [7].
Heating networks, as strategic objects from the point of view of the security of the state and its citizens, are part of the critical infrastructure.Critical infrastructure protection should ensure the continuity of power supply and the prevention of threats [1].An important element of protection is also the ability of the system to neutralize the effects of adverse events and the possibility of recovery in the event of a failure.In addition to the security risks, failures of heating networks can lead to economic and technical losses.
The operation of heating networks should be carried out in a technical and economically justified way, with the reduction of energy consumption and the minimization of transmission losses.The production and transmission of thermal energy may be a source of environmental pollution, therefore the operation of the system should be carried out in a way that takes into account environmental protection [8].In the operation process, the system's resistance to security threats to the heat supply is important, as the ability to regenerate after disturbances or a negative event [9][10][11][12].
Computer simulations of heating networks make it possible to analyze network operation without having to physically interfere with their structure.Thanks to the use of computer models, the network can be analysed in the event of failure, extension and connection of new heat sources and new customers.Simulation models give an opportunity to optimize the operation of the heating network [4,11], thanks to which the network behaviour in case of an emergency situation can be predicted at the design stage.

Theoretical basis for the simulation of heating networks
Computer simulations make it possible to recreate a given phenomenon based on mathematical models [3,5,6,10].In the case of a system in which variables are not a function of time, static models are built, described by algebraic equations.For a stationary flow of hot water in the pipelines, the mathematical models are a non-linear algebraic equation.This model describes the relations between pressure drop, flow, geometric dimensions of pipelines, properties of pipelines and hot water.
Static simulations of the heating network are developed on the basis of Kirchhoff's first and second law and flow equations.
According to Kirchhoff's first law, the algebraic sum of flows in each node of the heating network is zero.The nodes of the network are points where three or more pipelines meet, heat consumption or delivery to the grid, pumps, valves, etc. installed.For each node, the equation resulting from Kirchhoff's first law can be written as [3]: where: α -factor including the way of connecting the element to the node: α = 1 -when the flow direction is to the node, α = -1 -when the flow direction is from the node, α = 0when there is no connection to the node, ṁe -flow rate in the element, ṁi -flow rate in the node.
According to the Kirchhoff's second law, the algebraic sum of pressure drops in s given loop is zero.For each loop, the equation resulting from Kirchhoff's second law can be written as [3]: where: β -factor equal: β = 1 -when the element belongs to the loop and is consistent with it positive direction, β = -1 -when the element belongs to the loop and is consistent with its opposite direction, β = 0 -when the element does not belong to the loop, Δpe -pressure drop.
Because in Kirchhoff's first law, the mass flow rate are independent variables, and the quantity of pressure drops in Kirchhoff's second law, it is necessary to determine the relations between them.For the loop method it can be written as [3]: For the nodal method [3]: From the point of view of the amount of data needed for calculations, simulations based on static models are less demanding than dynamic models, which are built using differential equations.Dynamic models are used when the system has variables that are a function of time.

Simulation analysis of the security of heat supply to recipients 3.1 Methodology
The security of heat supply in the Energy Law [13] is determined by the system's ability to ensure network security and to balance energy supply with demand.Providing it with energy security and the safety of people is the main task of heating companies.
The simulations were carried out using the EC.GIS software (Energetyka Cieplna -Geographic Information System) [14], developed by Globema.EC.GIS software allows heating companies to manage network assets, record data, maintain traffic, operation, planning investments and carry out simulations of heating networks in normal operating conditions and in emergency situations.
For simulated cases of network failures, the values of allowance related to undelivered heat were determined in accordance with the tariff regulation [15].Allowances can be presented in the form of functions related to the limitation of heat supply and thermal power delivered to recipients and can be presented in the form of functions of several variables [1]: ( , , , ) where: n -ordered thermal power at the recipient n, ti -duration of the heating power limit, xi -percent of the heating power supply limit, e -design temperature of the outside air, adopted depending on the climate zone of the location of the object supplied with heat.
If the energy companies fail to meet the quality standards of customer service, the heat output will be limited (unless the heat sale contract states otherwise), the recipients will be entitled to an allowance [15], the amount of which is calculated as follows: • if the thermal power limit is up to 40%, the amount of the allowance is calculated according to the formulas: • if the thermal power limit is above 40%, the amount of allowance is calculated according to the formulas: 0,5 ( ) : 365 where: Su -total allowance for limitation in the heat supply, Sum -allowance for reducing thermal power, Suc -allowance for undelivered heat, t -thermal power determined based on the calculated flow rate and heat carrier parameters specified in the regulatory table [MW], r -actual thermal power, determined based on the flow rate and the actual heat carrier parameters [MW], 24 -multiplier, 24 hours a day [h], hp -the number of days when there were limitations in the supply of heat caused by the energy company's failure to meet the quality standards of customer service, Cn -price for ordered thermal power for a given tariff group [PLN/MW], Cc -heat price for a given tariff group [PLN/GJ].

Case study
Simulations were carried out for the actual heating network of Rzeszow, managed by the Municipal Heat Supply Company [14].Two thermoelectric power plants are the source of thermal energy: Rzeszow Power Station, a branch of PGE Mining and Conventional Energy S.A., which covers about 80% of the city's demand for thermal energy and the Fenice Thermoelectric Power Plant covering the remaining 20%.The Rzeszow district heating system is a ring system.Two selected failures of the heating network were analyzed.Table 2 shows the capacity of the separated network and the time of filling the separated section of the network after repairing the damage.Failure of the heating network at the analyzed point led to total cut-off the Rzeszow University of Technology and five other recipients from the thermal energy supply.It was not possible to provide heat to the recipients during the repair time.The filling time of the separated network after damage repair was 8 hours and 4 minutes with a filling speed of 30 m 3 /h.Fig. 2 shows the amount of undelivered heat depending on the duration of the failure for different external temperatures.As the temperature rises, the amount of undelivered heat decreases.At a temperature of -20ºC, the amount of undelivered heat for a failure lasting 5 days was almost 2500 GJ, and for a temperature of 10ºC it was 1083 GJ.Fig. 3 shows the location of the second analyzed heating network failure.The second failure involves a part of the network, made from pre-insulated pipes, cutting through Lukasz Cieplinski St. near Galeria Rzeszow.The results of the second failure simulation are shown in table 3.In the case of the second failure, the length of the excluded pipelines was 347.82 m.Failure caused the cutting off of 1 recipient with 1 heat substation, which is Galeria Rzeszow.The total thermal power ordered in winter by the disconnected recipient was 3.16 MW.Table 4 shows the capacity of the separated network and the time of filling the separated section of the network after repairing the damage.In the case of the second failure, the filling time of the network, due to smaller capacity compared to the first failure amounted to 46 minutes.Filling speed [m 3 /h] 30 Filling time [h] 0,77 For buildings located near Galeria Rzeszow, which were supplied with the same pipeline, thanks to the use of a ring network in the district heating system, thermal energy was delivered from a different direction.
Fig. 4 shows the amount of undelivered heat depending on the duration of the second failure.Simulations were carried out for the same external temperature values as for the first failure.For the second failure, as in the case of the first failure, the relationship between undelivered heat and failure duration is linear.In the case of a failure lasting 5 days, the amount of undelivered heat was 1 365 GJ for the external temperature of -20ºC, and 1 060 GJ for the temperature of 10ºC.It can be noticed that in the case of the second failure, differences in the amount of undelivered heat depending on the external temperature are smaller than for the first failure.
For the analyzed failures, allowances for the undelivered heat were calculated.Calculations were made for thermal energy prices, determined by the Municipal Heat Supply Company.The price for ordered thermal power is 2 292.92PLN/MW and the heat price is 14.96 PLN/GJ.Fig. 5 shows the relation between the allowances for undelivered heat and failure duration.After 5 days, the allowances resulting from the first accident would amount to 29 159.79PLN, and for second failure 16 337.76PLN.

Summary
Simulations of the heating network allow possibilities for assessing the operation of the system in various scenarios of events related to the risk of a lack of heat supply.The use of the Geographic Information System (GIS) allows heating system operators quick access to documentation and the ability to reduce the number of field inspections and related costs.
Network simulation in conditions of damage allows the opportunity to assess the system from the point of view of the of heat supply to of emergencies in the heating network shows what the effects and extent of damage to the pipelines can be.Failures can lead to the interruption of heat supply to consumers, which may pose a threat to human health or life.Damage to pipelines supplying a great amount of customers with significant ordered power also leads to high economic losses that may affect both consumers and heating companies.This type of analysis can be helpful for heating companies in managing the system in the aspect of caring for resilience to threats, optimizing network operation as well as assessing the risk of a lack of heat supply to recipients being a measure of security loss.

Fig. 1
shows the exact location of the first analyzed damage of the heating network.The failure is located at the Rzeszow University of Technology at Poznanska St.The pipeline made with traditional technology has failed.

Fig. 1 .
Fig. 1.Location of the first failure.The results of the first failure simulation are shown in table 1.As a result of damage the pipeline in the place marked in Fig. 1 part of the network with a length of 1030.53 m was excluded.Failure caused the cutting off of 5 recipients, equipped with 26 heat substations, including 21 heat substations located in Rzeszow University of Technology.The total thermal power ordered in winter by disconnected recipients was 5.64 MW.

Fig. 5 .
Fig. 5. Relationship between allowance for undelivered heat and failure duration.

Table 1 .
Results of network failure simulation at the Rzeszow University of Technology.

Table 2 .
Capacity of the separated network and filling time.

Table 3 .
Results of network failure simulation near Galeria Rzeszow.

Table 4 .
Capacity of the separated network and filling time.