Getnet Tadesse Ayele
email: gtayele@kth.se

Mohamed-Tahar Tahar Mabrouk
email: mohamed-tahar.mabrouk@imt-atlantique.fr

Pierrick Haurant
email: pierrick.haurant@imt-atlantique.fr

Björn Laumert
email: bjorn.laumert@energy.kth.se

Bruno Lacarrière
email: bruno.lacarriere@imt-atlantique.fr

Massimo Santarelli
email: massimo.santarelli@polito.it

Electrified District Heating Networks: A Thermo-Economic Optimisation Based on Exergy and Energy Analyses

Keywords: Combined heat and power (CHP) plants, District heating network (DHN), Electrified district heating network, Energy hubs, Exergy, Heat pumps, Lossy branch identification, Multienergy systems, Optimal placement, Particle swarm optimisation, Thermo-economic optimisation

This paper presents a thermo-economic optimisation of an electrified district heating network consisting of wind power plant, gas-fired combined heat and power plant and heat pumps. The load flow problem of the resulting multi-energy system is formulated by considering all physical and operating parameters in both of the electricity and heat distribution networks. First, energy and exergy analyses are applied to identify and isolate lossy branches of a meshed heating network. This is followed by the optimal placement of heat pumps. Finally, supply and return temperatures are optimised. Particle Swarm Optimisation technique is implemented in order to find the best place of heat pumps, their economical dispatch and optimal temperature profile of the district heating network. Results show that up to 59.12% of the distribution heat loss and 9.37% of the operating cost can be saved by following a step-by-step methodology discussed in this paper.

Introduction

As the global warming effects are pressing more from time to time, decarbonisation of the energy sector through the integration of renewable energy sources became to be a sustainable alternative. Heating and cooling sector is getting more attention recently in that regard. More than half of the energy consumption in European Union (EU) is used for heating and cooling purposes (European Commission, 2015). Only 19.5% of this demand is covered by renewables in 2017 though countries like Sweden attained 69.1% (Eurostat, 2018). The experience of Sweden and Finland shows that combined heat and power (CHP) plants and heat pumps (HPs) are key technologies in order to decarbonise the heating and cooling sector [START_REF] Kontu | Introducing modern heat pumps to existing district heating systems -Global lessons from viable decarbonizing of district heating in Finland[END_REF][START_REF] Levihn | CHP and heat pumps to balance renewable power production: Lessons from the district heating network in Stockholm[END_REF][START_REF] Werner | District heating and cooling in Sweden[END_REF]. HPs are also found to be the best technologies in decarbonising large cities' heating system in China for a year 2030 [START_REF] Zhang | Decarbonizing a large City's heating system using heat pumps: A case study of Beijing[END_REF]. CHPs and HPs are also mentioned as key technologies to enable the 4 th generation district heating integration [START_REF] Lund | 4th Generation District Heating (4GDH): Integrating smart thermal grids into future sustainable energy systems[END_REF].

Integration of renewables and co-generation plants alone does not result into an efficient district heating network (DHN). Their dispatch should be optimised in order to minimize distribution losses and the overall operational cost of a given DHN. The temperature levels and the mass flows determine the amount of heat injected into the network from the sources, the distribution loss and the amount of heat consumed at the consumers [START_REF] Frederiksen | District Heating and Cooling[END_REF]. For a given heat demand, a higher source temperature results in a higher temperature difference with respect to the surrounding environment. It also means a lower mass flow rate with longer residence time inside pipes. This results in a higher distribution loss, but a lower pumping energy requirement [START_REF] Bergman | Fundamentals of heat and mass transfer[END_REF].

From exergy point of view, a higher temperature means a higher quality of heat [START_REF] Bejan | Thermal Design and Optimisation[END_REF]. On the other hand, district heating networks are designed mainly to harness low-grade heat from cheap sources (characterized by lower temperature) and distribute it to the end users [START_REF] Frederiksen | District Heating and Cooling[END_REF]. Hence, operating these networks at lower temperature makes them more effective from the source temperature level point of view. As a lower supply temperature means a higher mass flow rate and, as a result, a shorter residence time in the pipe, it decreases the heat that could be lost in the network. However, higher mass flows in the pipes need higher pumping energy for circulation. The circulating pumps use electricity which is regarded as a very high quality, also referred to as a pure exergy [START_REF] Bejan | Thermal Design and Optimisation[END_REF][START_REF] Dincer | Exergy: Energy, Environment and Sustainable Development[END_REF]. The trade-off between temperature levels, distribution loss and the pumping energy, therefore, needs to be optimised. Exergy analysis, which considers both quantity and quality of energy, can be used to optimize thermal systems [START_REF] Dincer | Exergy: Energy, Environment and Sustainable Development[END_REF]. Meshed DHNs are one of such systems where exergy analysis can be applied to identify lossy branches and nodes. Many literatures focused on the exergy analysis of the heat source power plants such as waste-based multi-generation plant [START_REF] Ratlamwala | Municipal solid waste based multigeneration system for different districts of Karachi[END_REF], combined heating, cooling and power plants [START_REF] Wang | Thermodynamic performance analysis and optimisation of a solar-assisted combined cooling, heating and power system[END_REF][START_REF] Yao | Thermo-economic optimisation of a combined cooling, heating and power system based on small-scale compressed air energy storage[END_REF], steam power plants [START_REF] Tontu | Performance analysis of an industrial steam power plant with varying loads[END_REF], gas-fired combi boiler [START_REF] Caliskan | Energy, exergy, thermoeconomic and sustainability analyses of a building heating system with a combi-boiler[END_REF] and biomass boiler [START_REF] Compton | Exergy approach for advancing sustainability of a biomass boiler[END_REF]. Exergy destruction analysis in a waste recovery heat exchangers is reported in [START_REF] Wang | Exergy destruction analysis of heat exchanger in waste heat recovery system in Kroll process[END_REF]. Exergy analysis of heat pumps is discussed in [START_REF] Dincer | Exergy: Energy, Environment and Sustainable Development[END_REF] and [START_REF] Bilgen | Exergy analysis and experimental study of heat pump systems. Exergy[END_REF].

On the other hand, there are only limited exergy related researches conducted on heat distribution networks. [START_REF] Curti | An environomic approach for the modeling and optimisation of a district heating network based on centralized and decentralized heat pumps, cogeneration and/or gas furnace. Part I: Methodology[END_REF] used exergy analysis to optimize emissions from a district heating system. Only the emissions from the power plants are considered in their study. The exergy destruction in the distribution networks are not taken into account. [START_REF] Terehovics | Exergy Analysis for District Heating Network[END_REF] applied exergy factor to identify the most influential component of a district heating network. Their results show that the exergy factor increases with the supply temperature . [START_REF] Li | Energy and exergy analysis of low temperature district heating network[END_REF] used both energy and exergy analysis to study the performance of low temperature district heating networks in comparison to medium and high temperature district heating networks. They found that low temperature district heating networks have lower exergy and energy losses. [START_REF] Coss | Formulation of Exergy Cost Analysis to Graph-Based Thermal Network Models[END_REF], on the other hand, used unit exergy cost of each node in a radial heat distribution network to assess their performance. Only supply pipe networks are considered in their analysis. The exergy loss on the return pipe network and the exergy requirement due to circulation pumps are not dealt in detail.

A thermodynamic analysis of a geothermal district heating system showed that a correlation exists between capital cost of the plants and the associated exergy loss [START_REF] Ozgener | Thermodynamic analysis of a geothermal district heating system[END_REF]. Similar study is presented in [START_REF] Coskun | Investigation of some renewable energy and exergy parameters for two Geothermal District Heating Systems[END_REF] with additional energy and exergy renewability factors. [START_REF] Pompei | Combining the exergy and energy analysis for the assessment of district heating powered by renewable sources[END_REF] applied combination of energy and exergy analysis to evaluate the performance of a solar-assisted DHN. However, the exergy destruction in the distribution network, both on the supply and return sides of the DHN, are not well addressed in all the papers. Neither topology optimisation is considered.

Once the critical and lossy components are identified using energy/exergy analysis, it is usually followed by optimisation of operational parameters. Both mathematical and heuristic/metaheuristic approaches of optimizing energy systems are reported in literature. The level of optimisation can be categorized into two: those at feasibility level and those at operational level. For example, HOMER (HOMER Energy, n.d.) and RETScreen (Natural Resources Canada, 2010) can be used for size optimisation of hybrid energy systems at feasibility level. The details of network topology and operational parameters are not considered in such tools. Because of that the results may become technically infeasible. On the other hand, tools like PowerWorld (PowerWorld, n.d.), consider operational network parameters to solve the economical dispatch and optimal power flow of electrical power systems. TRNSYS is used for thermo-economic optimisation of solar district heating plants [START_REF] Tian | Thermo-economic optimisation of a hybrid solar district heating plant with flat plate collectors and parabolic trough collectors in series[END_REF] and secondary distribution network of a low temperature DHN [START_REF] Park | Thermo-economic optimisation of secondary distribution network of low temperature district heating network under local conditions of South Korea[END_REF]. There are no tools, however, that can handle both electricity and heating networks' operational parameters simultaneously [START_REF] Beuzekom | A review of multi-energy system planning and optimisation tools for sustainable urban development[END_REF].

Analysing and optimizing multi-energy systems mathematically will be cumbersome, if not impossible. Thanks to the computational power of computers, metaheuristic optimisation techniques are getting wider acceptance as they are more suitable to handle highly nonlinear objective functions and constraints when compared to the conventional deterministic approaches. Varieties of optimisation techniques that are used in the energy field include: Genetic Algorithm [START_REF] Nemati | Optimisation of unit commitment and economic dispatch in microgrids based on genetic algorithm and mixed integer linear programming[END_REF][START_REF] Subbaraj | Enhancement of combined heat and power economic dispatch using self adaptive real-coded genetic algorithm[END_REF], Teaching Learning Based Algorithms [START_REF] Niknam | A new modified teaching-learning algorithm for reserve constrained dynamic economic dispatch[END_REF][START_REF] Shabanpour-Haghighi | A modified teaching-learning based optimisation for multi-objective optimal power flow problem[END_REF], Honey Bee Mating Algorithms [START_REF] Niknam | Modified Honey Bee Mating Optimisation to solve dynamic optimal power flow considering generator constraints[END_REF], Mixed Integer Linear Programming [START_REF] Mazairac | Mixed-integer linear program for an optimal hybrid energy network topology[END_REF][START_REF] Nemati | Optimisation of unit commitment and economic dispatch in microgrids based on genetic algorithm and mixed integer linear programming[END_REF][START_REF] Wang | Mixed-integer linear programmingbased optimal configuration planning for energy hub: Starting from scratch[END_REF], and Particle Swarm Optimisations [START_REF] Aote | Improved Particle Swarm Optimisation Based on Natural Flocking Behavior[END_REF][START_REF] Attous | Particle swarm optimisation based optimal power flow for units with non-smooth fuel cost functions[END_REF][START_REF] Ayele | Optimal placement and sizing of heat pumps and heat only boilers in a coupled electricity and heating networks[END_REF][START_REF] Hazra | A multi-objective optimal power flow using particle swarm optimisation[END_REF]Juneja and Nagar, 2016).

Two main gaps are identified that are not well addressed in the literatures discussed above:  Exergy analysis applied on DHN mainly focussed on the power plants and/or substations. The exergy destruction due to temperature and pressure variations across the pipes of the DHN, both on the supply and return sides, are not properly dealt.  Thermo-economic optimisation of DHNs consisting of coupling devices, such as HPs, did not take the electricity distribution losses into account. Optimal placement and sizing of heat sources is not considered either.

This paper aims at filling the above-mentioned gaps by following a step-by-step approach. An extended energy hub approach is used to formulate and solve the steady state load flow problems for both heating and electricity networks simultaneously. The details of the load flow solution, such as temperature, mass flow rate and hydraulic heads on both supply and return pipe networks of the DHN, are used to calculate exergy efficiencies of all branches and nodes in the DHN. By then, the lossy branches are isolated to get optimised DHN topology. Once the network topology is optimised, the best locations for HPs are determined using a nested Particle Swarm Optimisation (PSO) algorithm. This is followed by a thermo-economic optimisation in which temperature levels, cost of pumping energy, cost of electricity, cost of heat, capacity limits in both electricity and heating networks and sizes of HPs are duly considered.

The rest of this paper is organized as follows. The methodology is discussed in Section 2. The case study selected to demonstrate the proposed methodology is described in Section 3. Section 4 presents the results and discussions while Section 5 concludes the main findings of the paper.

Methodology

A step-by-step approach

A step-by-step approach, as shown in Fig. 1, enables us to explore and compare the added values of each step, instead of putting all of them into a single optimisation problem. It starts by formulating all the mathematical equations that describe the electricity and heat power flows and combining them into a single load flow problem (step 1 in Fig. 1). To make sure that the energy and mass balances governing both networks are guaranteed, the load flow problem needs always to converge into a feasible solution.

An integrated optimal power flow is run in order to determine the economical dispatch of the CHP, wind plant and HPs without violating network constraints (step 2 in Fig. 1). As DHNs are designed and installed by taking a margin for reliability and future expansions, it is not uncommon to find meshed DHN topologies with pipes running below their capacity. In that case, isolating non-critical branches could reduce distribution losses. Both of energy and exergy analyses are employed to identify the lossy branches iteratively (steps 2, 3, 4 and 5 in Fig. 1).

The operation of the DHN can be further improved by optimally placing and sizing movable heat sources, such as heat pumps (step 6 in Fig. 1). This is followed by consideration of thermo-economic optimisation in which the temperature profile of heat sources and the return temperature of substations on the primary side are considered to further reduce the operational cost of the DHN (steps 7 and 8 in Fig. 1). The details of the mathematical equations describing the system model and the optimisation algorithm are discussed in the following sections.

System model

An extended energy hub approach, the details of which can be found in (Ayele et al., 2018a), is used in this paper to model the interaction between different energy carriers including various energy conversion technologies. Figure 2 shows the three parts of a general multi-energy system (MES): the energy hub, the point of interconnection and the energy network. Local demands, local generations and coupling devices are altogether represented by the energy hub while the point of interconnection acts as an interface between the energy hub and the remaining part of the network. Coupled electricity and heating networks are considered in this paper.

Fig. 2. An extended energy hub representation of a general MES (with permission from (Ayele et al., 2018a)).

Model for the electricity network

For each hub k, the per unit active (Pel) and reactive (Qel) power injections, which are given by (1a) and (1b), defines the electrical sub-model (Ayele et al., 2018a). These equations are used to determine the electrical network parameters such as voltage magnitude, voltage angle, active and reactive power flows and losses in the electricity network.

𝑃 𝑒𝑙(𝑘) = ∑ |𝑉 𝑘 | 𝑁 𝑗=1 |𝑉 𝑗 |(𝐺 𝑘𝑗 𝑐𝑜𝑠𝜃 𝑘𝑗 + 𝐵 𝑘𝑗 𝑠𝑖𝑛𝜃 𝑘𝑗 ) (1a) 𝑄 𝑒𝑙(𝑘) = ∑ |𝑉 𝑘 | 𝑁 𝑗=1
|𝑉 𝑗 |(𝐺 𝑘𝑗 𝑠𝑖𝑛𝜃 𝑘𝑗 -𝐵 𝑘𝑗 𝑐𝑜𝑠𝜃 𝑘𝑗 ) (1b) where 𝜃 𝑘𝑗 is a voltage angle difference between bus k and bus j; 𝐺 𝑖𝑗 + 𝑗𝐵 𝑖𝑗 = 𝑌 𝑖𝑗 is an element of the network admittance matrix, |𝑉 𝑘 | denotes a voltage magnitude at bus k and N is the number of buses.

Model for the DHN

The steady state thermo-hydraulic model of a district heating network is defined by ( 2) -( 6) (Ayele et al., 2018a). These equations are used to determine the heating network parameters, such as temperature, mass flow rate, heat power flows and hydraulic heads. Equation (2) gives the heat power injection (Ph) into the network from hub k.

𝑃 ℎ(𝑘) = 𝐶 𝑝 𝑚̇𝑘(𝑇 𝑠𝑘 -𝑇 𝑟𝑘 ) (2)
where 𝑚̇𝑘 is the nodal mass flow rate flowing from hub k into the supply pipe network of the DHN; 𝑇 𝑠𝑘 and 𝑇 𝑟𝑘 are the supply and return temperatures at hub k, respectively. 𝐶 𝑝 is the specific heat capacity of water.

The nodal mass flow (𝑚̇𝑘) at each hub is subject to the continuity of flow equation given by ( 3) which takes all pipe flows connected to the hub. The pipe flows are further related to the hydraulic heads using pressure drop equations, as defined in (4).

∑ (all mass flows into the node) 𝑘 = ∑ (all mass flows out of the node)

𝑘

(3)

𝐻 𝑗 -𝐻 𝑖 = 𝐾 𝑖𝑗 𝑚̇𝑗 𝑖 |𝑚̇𝑗 𝑖 | (4) where 𝐻 𝑖 and 𝐻 𝑗 are hydraulic heads at nodes i and j; 𝑚̇𝑗 𝑖 is pipe mass flow from node j to node i and 𝐾 𝑖𝑗 is the corresponding pressure resistance coefficient. Equation ( 5) describes the energy balance of mixing water at a given node while (6) represent the temperature drop across a pipe.

∑(𝑇 𝑗-𝑖𝑛 𝑚̇𝑗 -𝑖𝑛 ) = 𝑇 𝑗-𝑜𝑢𝑡 ∑(𝑚̇𝑗 -𝑜𝑢𝑡 )

(5)

𝑇 𝑤_𝑒𝑛𝑑 -𝑇 𝑜 = (𝑇 𝑤_𝑠𝑡𝑎𝑟𝑡 -𝑇 𝑜 )𝑒 -( 2𝜋𝑍𝐿𝑈 𝐶 𝑝 𝑚 ̇) (6a) 𝑈 = ( 𝑅 4 𝑅 1 ℎ 𝑤 + 𝑅 4 𝑘 2 𝑙𝑛 | 𝑅 2 𝑅 1 | + 𝑅 4 𝑘 3 𝑙𝑛 | 𝑅 3 𝑅 2 | + 𝑅 4 𝑘 4 𝑙𝑛 | 𝑅 4 𝑅 3 |) -1 (6b)
Terms (𝑚̇𝑗 -𝑖𝑛 , 𝑇 𝑗-𝑖𝑛 ) in ( 5) denote the incoming mass flow rates and water temperatures at a given node j, respectively while terms (𝑚̇𝑗 -𝑜𝑢𝑡 , 𝑇 𝑗-𝑜𝑢𝑡 ) represent the corresponding values for the outgoing mass flow rates. 𝑇 𝑤_𝑒𝑛𝑑 and 𝑇 𝑤_𝑠𝑡𝑎𝑟𝑡 are outlet and inlet water temperatures, respectively. 𝑇 𝑜 is the soil temperature at the surface of the pipe; U is the overall heat transfer coefficient; 𝑅 1 , 𝑅 2 , 𝑅 3 and 𝑅 4 are the inner radius of carrier pipe, outer radius of the carrier pipe, outer radius of an insulation layer and outer radius of an outer jacket, respectively; ℎ 𝑤 , 𝑘 2 , 𝑘 3 and 𝑘 4 represent the convective coefficient of water, thermal conductivity of carrier pipe, thermal conductivity of the insulating material and thermal conductivity of the outer jacket.

Coupling equations

In addition to the above equations, which govern the network part of the energy system, there are additional equations that define the conversion between different energy carriers at each hub. These equations, as shown in (7a), relates the demands, generations, injections into the network and conversion between different energy carriers at a given hub (Ayele et al., 2018a).

[ 𝐿 𝑃𝑒𝑙(𝑘) 𝐿 𝑄𝑒𝑙(𝑘) 𝐿 ℎ(𝑘) ] = [ 𝐶 𝑘-𝑒𝑝(𝑒𝑝) 𝐶 𝑘-𝑒𝑝(𝑒𝑞) 𝐶 𝑘-𝑒𝑝(ℎ) 𝐶 𝑘-𝑒𝑝(𝑓) 𝐶 𝑘-𝑒𝑞(𝑒𝑝) 𝐶 𝑘-𝑒𝑞(𝑒𝑞) 𝐶 𝑘-𝑒𝑞(ℎ) 𝐶 𝑘-𝑒𝑝(𝑓) 𝐶 𝑘-ℎ(𝑒𝑝) 𝐶 𝑘-ℎ(𝑒𝑞) 𝐶 𝑘-ℎ(ℎ) 𝐶 𝑘-𝑒𝑝(𝑓) ] [ 𝑃 𝑒𝑙𝑔(𝑘) -𝑃 𝑒𝑙(𝑘) 𝑄 𝑒𝑙𝑔(𝑘) -𝑄 𝑒𝑙(𝑘) 𝑃 ℎ𝑔(𝑘) -𝑃 ℎ(𝑘) 𝑃 𝑓𝑔(𝑘) ] (7a)
where 𝐿 𝑃𝑒𝑙(𝑘) , 𝐿 𝑄𝑒𝑙(𝑘) and 𝐿 h(𝑘) are the active electricity, reactive electricity and heat demands at hub k; 𝐶 𝑘-𝛿(𝛾) represent a coupling coefficient at hub k relating generation type 𝛾 with load type 𝛿.

Subscripts ep, eq and h indicate active electric, reactive electric and heat carriers, respectively. 𝑃 𝑒𝑙𝑔(𝑘) , 𝑄 𝑒𝑙𝑔(𝑘) , 𝑃 ℎ𝑔(𝑘) and 𝑃 𝑓𝑔(𝑘) are active electricity, reactive electricity, heat and fuel powers locally generated at hub k.

Specifically, the coupling equations for an energy hub consisting of a CHP and an HP, both running at unity power factor can be adapted from [START_REF] Ayele | Optimal placement and sizing of heat pumps and heat only boilers in a coupled electricity and heating networks[END_REF][START_REF] Ayele | Pseudo-dynamic simulation on a district energy system made of coupling technologies[END_REF] as shown in (7b).

[

𝐿 𝑒𝑝 + 𝑃 𝑒𝑝-𝐻𝑃 𝐿 𝑒𝑞 𝐿 ℎ -𝑃 𝑒𝑝-𝐻𝑃 * 𝐶𝑂𝑃 ] = [ 1 0 0 𝜂 𝑒𝑙 0 1 0 0 0 0 1 𝜂 𝑡ℎ ] [ 𝑃 𝑒𝑝𝑔 -𝑃 𝑒𝑝 𝑃 𝑒𝑞𝑔 -𝑃 𝑒𝑞 𝑃 ℎ𝑔 -𝑃 ℎ 𝑃 𝑓𝑔 ] (7b)
where 𝑃 𝑒𝑝-𝐻𝑃 denotes the electricity consumption of the heat pump; COP stands for coefficient of performance of the HP, 𝜂 𝑒𝑙 and 𝜂 𝑡ℎ are the electrical and thermal efficiencies of the CHP plant. If any of the HP or CHP or both are missing in a given energy hub, equation ( 7b) is modified by setting the corresponding terms to zero.

Exergy analysis

Equations ( 1) -( 7), mentioned above, are solved using Newton-Raphson iterative method giving the load flow solution that describes the operating conditions of both the DHN and the electricity network. The load flow solution is then used to calculate exergy flows in the DHN.

The exergy streams involved in the DHN are the water flows at different temperature and pressure. These physical exergies are computed using (8a) while exergy balance for a branch or a node are governed by equation (8b) [START_REF] Bejan | Thermal Design and Optimisation[END_REF][START_REF] Dincer | Exergy: Energy, Environment and Sustainable Development[END_REF].

𝐵 𝑝ℎ = 𝑚̇{𝐶 𝑝 (𝑇 -𝑇 𝑜 -𝑇 𝑜 𝑙𝑛 𝑇 𝑇 𝑜 ) + 𝑃-𝑃 𝑜 𝜌 } (8a) 𝐸 𝑖𝑛 = 𝐸 𝑜𝑢𝑡 + 𝐸 𝑑𝑒𝑠𝑡𝑟𝑜𝑦𝑒𝑑 (8b)
where 𝐵 𝑝ℎ is the physical exergy of a mass flow 𝑚̇ at temperature T and pressure P with respect to the restricted dead state reference of temperature To and pressure Po. 𝜌 is density of water. 𝐸 𝑖𝑛 is the total exergy flowing into a pipe/node while 𝐸 𝑜𝑢𝑡 is the total exergy flowing out of a pipe/node. 𝐸 𝑑𝑒𝑠𝑡𝑟𝑜𝑦𝑒𝑑 is the amount of exergy destroyed in a pipe/node.

Circulation pumps are used to circulate the water in the DHN. Their electricity consumption is the sum of two parts: the first is due to the pressure drop across each pipe (We(branch)) and the second is due to the minimum hydraulic head gap required between the supply and return sides at each of the consumer substations (We(consumer)). Both of them are considered to be pure exergy flows.

For a given branch, there will be the same mass flow on both supply and return pipes. It implies that the circulation pumps on the return and supply pipes consume the same amount of electricity. Hence, the electricity consumed by the branch, We(branch) in Watt, to compensate the pressure drop on both supply and return sides can be computed using (9a) [START_REF] Ayele | Optimal placement and sizing of heat pumps and heat only boilers in a coupled electricity and heating networks[END_REF].

𝑊 𝑒(𝑏𝑟𝑎𝑛𝑐ℎ) = (1 + 𝐶 𝑙𝑜𝑐 ) * 2 ( 𝑔 * |∆𝐻 𝑖𝑗 * 𝑚̇𝑖 𝑗 | 𝜂 ) 𝑝𝑖𝑝𝑒 ( 9a
)
where 𝑔 is the gravitational acceleration (9.81m/s 2 ); ∆Hij is the frictional head loss on a straight pipe connecting nodes i and j; |𝑚̇𝑖 𝑗 | is magnitude of the mass flow through the pipe and η is efficiency of the circulation pump (it is assumed to be 80% in this study). The 𝐶 𝑙𝑜𝑐 is a fraction to take the local pressure losses due to valves and junctions into account while the factor 2 is due to equal pressure drop on both supply and return pipes.

On the other hand, the additional electricity required by the circulation pumps in order to guarantee sufficient hydraulic head at each of the heat consuming substations is computed using (9b) [START_REF] Ayele | Optimal placement and sizing of heat pumps and heat only boilers in a coupled electricity and heating networks[END_REF].

𝑊 𝑒(𝑐𝑜𝑛𝑠𝑢𝑚𝑒𝑟) = ( 𝑔 * ∆𝐻 𝑐𝑜𝑛 𝜂 |𝑚̇𝑐 𝑜𝑛 |) 𝑐𝑜𝑛𝑠𝑢𝑚𝑒𝑟 (9b)
where ∆𝐻 𝑐𝑜𝑛 is the hydraulic head difference at the consumer substation in meter while |𝑚̇𝑐 𝑜𝑛 | is the magnitude of mass flow rate on the primary side of the substation. In this study, the values of 𝐶 𝑙𝑜𝑐 and ∆𝐻 𝑐𝑜𝑛 are assumed to be 0.3 and 5.1m (≈ 50𝑘𝑃𝑎), respectively (Wang et al., 2017).

Particle Swarm Optimisation (PSO)

First developed by [START_REF] Kennedy | Particle swarm optimisation[END_REF], PSO is an optimisation algorithm which tries to find the global best value in analogy to the way a flock of birds scatter and regroup. The whole group is referred to as a swarm and its individual members are called particles. If there are M variables of optimisation, then each particle in the swarm defines a point in M-dimensional space, usually referred to as position of the particle. In each iteration, all the particles try to adjust their position by taking their own past experience and the social knowledge into account. Randomness is also included in the algorithm to minimize the possibility of being trapped by a local optimum. The position of particle i with M number of optimisation variables is defined as shown in (10a).

𝑥 𝑖 = (𝑥 𝑖1 , 𝑥 𝑖2 , … , 𝑥 𝑖𝑀 ) (10a)
The new direction and speed of the particle (𝑣 𝑖-𝑛𝑒𝑤 ) is updated using (10b) which is then added to the older position to determine the new position of the particle (𝑥 𝑖-𝑛𝑒𝑤 ) as shown in (10c).

𝑣 𝑖-𝑛𝑒𝑤 = 𝜔𝑣 𝑖𝑜 + 𝑐 1 𝑟 1 (𝑥 𝑖-𝑏𝑒𝑠𝑡 -𝑥 𝑖 ) + 𝑐 2 𝑟 2 (𝑥 𝑔-𝑏𝑒𝑠𝑡 -𝑥 𝑖 ) (10b) 𝑥 𝑖-𝑛𝑒𝑤 = 𝑥 𝑖 + 𝑣 𝑖-𝑛𝑒𝑤 (10c)
where 𝜔 is the inertia/damping factor; 𝑣 𝑖𝑜 is the current velocity of particle i; 𝑐 1 is a self-accelerating (exploration) factor; 𝑐 2 is a global accelerating (exploiting) factor; 𝑥 𝑖 is the current position of particle i; 𝑥 𝑖-𝑏𝑒𝑠𝑡 is the best position of the particle in the past; and 𝑥 𝑔-𝑏𝑒𝑠𝑡 is the global best position achieved by the swarm in the past. 𝑟 1 and 𝑟 2 are random numbers varying between 0 and 1. [START_REF] Ullmann | Comparison of PSO variants applied to large scale optimisation problems[END_REF] suggested fixed values of personal and global acceleration factors (𝑐 1 = 𝑐 2 = 1.494) while [START_REF] Aote | Improved Particle Swarm Optimisation Based on Natural Flocking Behavior[END_REF] argued that better results can be found using a step by step variation in the following order: 𝑐 1 decreasing from 2.5 to 0.5 and 𝑐 2 increasing from 0.5 to 2.5. The logic behind such variation is to explore locally in the first iterations and then fine-tune the global best towards the last iterations. Both approaches are tested for the problem at hand and the latter is found to give faster convergence. The value of 𝜔 is also made to vary from 0.9 to 0.4 [START_REF] Aote | Improved Particle Swarm Optimisation Based on Natural Flocking Behavior[END_REF]. The values of maximum iteration and the number of particles to be considered highly depend on the type of problem and its number of decision variables.

The objective function of the optimisation problem considered in this paper is minimization of the operating cost of the district heating network, as given by ( 11).

𝑚𝑖𝑛{𝐶 𝑃ℎ𝑔 + 𝐶 𝑃𝑒𝑙𝑔 + 𝐶 𝑃ℎ-𝑖𝑚𝑝𝑜𝑟𝑡𝑒𝑑 + 𝐶 𝑃𝑒𝑙-𝑖𝑚𝑝𝑜𝑟𝑡𝑒𝑑 + 𝐶 𝑊𝑒 } (11)
where CPhg, CPelg, CPh-imported, and CPel-imported are costs of the generated heat, generated electricity, imported heat and imported electricity, respectively while CWe is the cost of electricity used by circulation pumps.

There are both equality and inequality constraints that should not be violated while achieving the objective function. All the equations ( 1) -( 7) discussed Section 2.2 are taken as equality constraints while equations ( 12a) -(12e) define the main inequality constraints of the bus voltage limits, the maximum transmission line ampacity, the maximum allowed mass flow rate in each pipe, the limit on the supply temperature of heat source hubs and the allowed return temperature at heat consuming hubs, respectively. The temperature limits depend on the characteristics of heat sources, the temperature levels required at the secondary side of heat consumers and the regulations of the governing municipality, such as Legeionellosis issues [START_REF] Frederiksen | District Heating and Cooling[END_REF].

𝑉 𝑚𝑖𝑛 ≤ |𝑉 𝑘(𝑝𝑒𝑟𝑢𝑛𝑖𝑡) | ≤ 𝑉 𝑚𝑎𝑥 (12a) 0 ≤ |𝐼 𝑖𝑗(𝑟𝑚𝑠) | ≤ 𝐼 𝑚𝑎𝑥 (12b) 0 ≤ |𝑚̇𝑖 𝑗 | ≤ 𝑚̇𝑚 𝑎𝑥 (12c)
𝑇 𝑠(𝑚𝑖𝑛𝑖) ≤ 𝑇 𝑠(𝑘) ≤ 𝑇 𝑠(𝑚𝑎𝑥) , for 𝑚̇𝑘 ≫ 0 (12d)

𝑇 𝑟(𝑚𝑖𝑛𝑖) ≤ 𝑇 𝑟(𝑘) ≤ 𝑇 𝑟(𝑚𝑎𝑥) , for 𝑚̇𝑘 ≪ 0 (12e)

Case study

Base case network topology

A hypothetical DHN that has six nodes and three loops, shown in Fig 3, is considered as a case study.

The solid red lines with arrows represent the supply pipe network while the dotted lines with arrows represent the return pipe network of the DHN. The arrows indicate the positive direction of mass flows. The black solid lines without arrows represent the electric distribution network. Each hexagon represents an energy hub while the grey circles represent nodes/buses at which the corresponding hubs interact with the network. Hub1 is considered as a slack hub. An import/export of power from/to the neighbourhood is indicated by a positive/negative production of heat and electricity at this hub. As it can be seen from Fig. 3, though the DHN is meshed, the electricity distribution network is kept to be radial, as the focus is on the DHN. The electrical distribution network is considered only for delivering the electricity required by the DHN. No electrical load is considered at each hub, except for the consumption of the HPs. By doing so, the electricity lost in the network, only for electrifying the DHN, can be computed and taken into account in the optimisation.

The heat demands at each hub are summarised in Table 1. To supply these demands, a gas-fired CHP and a wind power plant are assumed to be permanently connected at Hub 3 and Hub 5, respectively. In addition, two HPs are used as means of electrifying the DHN on top of the CHP. The scope of this paper is limited to the operational optimisation. Hence, the distribution network and all the technologies are assumed existing and operational.

Table 1. Heat demand at different hubs.

Assumptions

All the DHN pipes are assumed to be DN50 type with standard insulation, and their parameters are taken from (Isoplus, n.d.). In order to avoid noise and wearing in the pipes, a maximum flow speed of 3.5 m/s is adopted (Wang et al., 2017;[START_REF] Zeng | Diameter optimisation of district heating and cooling piping network based on hourly load[END_REF] which corresponds to a maximum flow rate of 7.85 kg/s for a DN50 pipe. The electricity network is assumed to consist of balanced 4.16 kV three phase ACSR Waxwing conductors with maximum allowed line current of 480 A [START_REF] Glover | Power System Analysis & Design, SI Version[END_REF]. The allowed nodal voltage range is between 0.95 and 1.05 per-unit. The details of the pipe and insulation parameters together with the resistance and reactance of the electrical transmission lines are presented in Table A.1, Appendix A.

The water in the DHN pipes is incompressible with constant density (982.6 kg/m3), specific heat capacity (4.185 kJ/kgK), viscosity (485µNS/m2) and conductivity (0.6516 W/mk). The restricted dead state references are taken at a temperature of 268.15 K, which is equal to the presumed soil temperature at the surface of the DHN pipe (-5 o C), and a pressure of 10 5 Pa.

The CHP plant has 1000 kW of gas intake capacity with typical thermal and electrical efficiency of 47% and 38%, respectively [START_REF] Campos Celador | Feasibility of small-scale gas engine-based residential cogeneration in Spain[END_REF]. For the given simulation hour, the wind power plant has a maximum of 125 kW power output. The two HPs have 125 kW and 380 kW electrical ratings both running at a COP of 4.0. Their locations vary depending on the scenarios that are discussed in Section 3.3.

The price of imported electricity and heat from the neighbourhood are 0.22 €/kWh and 0.1 €/kWh, respectively. Selling prices of 0.132 €/kWh of electricity and zero for heat are assumed when exporting to the neighbourhood. The price of gas used by the CHP plant is 0.07 €/kWh. Operational cost of the wind power plant is negligible.

Scenarios

A stepwise procedure is followed to arrive at the best operational strategy of the system. For comparison purpose, the procedures are categorised into four scenarios. The electricity network topology remains the same in all the scenarios.

Scenario I -Base case

Scenario II -Reduced topology

In this scenario, a lossiest branch is identified and isolated one at a time. The process is repeated until all non-critical branches are isolated (steps 2, 3, 4 and 5 in Fig. 1.). A maximum of three branches can be isolated from the three loops shown in Fig 3 . The HPs are kept at the same hubs as they were in the base case scenario and the optimal power flow is run under the same conditions. First, the operating parameters of the DHN (mass flow, pressure head and temperature) that are found from the optimal power flow of the base case scenario are used to compute both energy and exergy losses across each branch. Accordingly, the 1 st lossiest branch is identified and isolated. The optimal power flow is then run again to identify and isolate the second lossiest branch. The procedure is repeated to identify the third lossiest branch, at the end giving a reduced topology of the DHN. Lastly the optimal power flow is computed on the reduced topology. The reduced network topology is further used in the consecutive scenarios.

Scenario III -Optimal placement of HPs

This scenario corresponds to step 6 in Fig. 1. A nested PSO algorithm is used to find out the optimal placement of the two HPs. In a nested PSO algorithm, the details of which is available in [START_REF] Ayele | Optimal placement and sizing of heat pumps and heat only boilers in a coupled electricity and heating networks[END_REF], the outer PSO is dedicated to find the best location of the HPs while the inner PSO solves the optimal power flow based on the location of HPs dictated by the outer PSO loop. The outer loop of the PSO has a population size of 5 and maximum iteration of 10 while the internal PSO has a population size of 20 and a maximum iteration of 100. A reduced network topology is used in this scenario while keeping the same other conditions as the previous scenarios.

Scenario IV -Thermo-economic optimisation

This scenario deals with the thermo-economic optimisation of the reduced network topology after the optimal location of the HPs are determined in Scenario III (steps 7 and 8 in Fig. 1). The supply temperature range is taken between 60 o C and 95 o C while a return temperature range is assumed between 30 o C and 55 o C. A single PSO (population size of 30 and a maximum iteration of 100) is applied to determine not only the economic dispatch but also the optimal temperature profiles at the sources and consumer hubs.

Table 3, on the other hand shows the branch level load flow results. The table shows the pipe mass flow rate, the inlet and outlet hydraulic heads and temperatures both on the supply and return pipes. It can be seen that the highest temperature drops both on the supply and return pipes occurred on the branch connecting Hubs 5 and 6. This is associated to the lowest mass flow in the branch resulting in a higher residence time and, as a result, causing higher temperature drop. The table also shows the net heat delivered, the losses and energy efficiency of each branch. It also shows the corresponding pumping energy consumption. The total heat loss in this network (as can be computed from Tables 2 or 3) is about 136.19kW giving a DHN energy efficiency of 94.33%.

Exergy analysis

The values of heating network parameters shown in Table 2 and Table 3 are used to compute the exergy flows in both supply and return pipes of the DHN. These values are in turn used to determine the exergy loss across each branch and at each node.

Each node represented by the grey circle in Fig 3 has two physically separated thermal nodes: one on the supply side and the other on the return side of the DHN. Any heat flow from/to external environment is also treated as two separate flows, i.e. one on the supply side and the other on the return side with opposite direction of flow. A complete mixing of water is assumed at all nodes. The exergy destruction at each node, due to the irreversibility of mixing of water at different temperature, is calculated by taking all the input and output exergy flows both on the supply and return nodes.

The nodal exergy efficiencies, considering both supply and return nodes, are shown in Table 4. The external input refers to the positive/negative exergy flow from/to the hub to/from the corresponding node. The total input, on the other hand, is the sum of all positive exergy flows into the node while the total output refers to the sum of positive exergy flows leaving the node. Additional exergy input due to the pumping energy requirement at the substation connecting the supply and return side nodes is indicated by We(consumer). The nodal exergy destruction is not significant as it is indicated by efficiencies that are close to 100% in Table 4. Because of the lower temperature level, the exergy destructions on the return side nodes are relatively lower than the corresponding values of the supply side nodes. Node 2 has the lowest nodal exergy efficiency (95.66%) due to the mixing of flows at different temperatures on the supply side. On the other hand, nodes 1 and 3 are at 100% efficiency because of having a single mass flow passing through the node. Table 5 shows the exergy flows in each pipe, the losses and the exergy efficiency of each branch. The exergy loss calculation for each pipe considers the exergy destruction due to heat loss and pressure drop. The exergy loss associated with the pressure drop across each pipe is equivalent to the exergy input by the corresponding circulation pump (i.e. We/2, see equation ( 9a)). The effect of friction on increasing the water temperature is neglected in this study. As it can be seen from the table, though the exergy losses in the return pipes are lower than the corresponding supply pipes, they are comparable and cannot be neglected.

The total exergy input into the DHN can be calculated by adding all the positive external flows on both supply and return sides of all nodes and the exergy inputs of the circulation pumps. This gives a total input of 825.76 kW of exergy. Out of this, 40.14 kW is destroyed in the branches and 15.05 kW is destroyed in the nodes giving an exergy efficiency of 93.32%.

Reduced topology (Scenario II)

Energy and exergy efficiencies of branches are used to isolate the three lossiest branches step by step.

Energy analysis

Referring the results of Table 3, the branch connecting Hubs 5 and 6 is the lossiest branch (81.31% efficiency). The next lossiest branches are those between Hubs 2 and 4, and Hubs 4 and 6, respectively. However, the 2 nd and the 3 rd lossiest branches may be different as the optimal power flow could result in a different solution once the 1 st lossiest branch is isolated. Having this in mind, the branch between Hubs 5 and 6 is first isolated and the optimal power flow is repeated with the new topology. The results are tabulated in Appendix B, Table B.1 and Table B.2. As it can be seen from Table B.2, the next lossiest branch is the one between Hubs 4 and 6, and not the one between Hubs 2 and 4 (contradicting with the one indicated in Table 3). This confirms the importance of a step-bystep approach. The optimal power flow is repeated again after removing the branch 4-6. The results are presented in Tables B.3 and B.4. In particular, Table B.4 shows that the third lossiest branch is the one between Hubs 1 and 2. However, this branch is mandatory to keep all hubs connected and cannot be isolated. Therefore, we take the next lossiest branch, which is branch 2-4. The remaining branches are critical to keep all nodes connected to the DHN.

Exergy analysis

Like the energy analysis, the branch exergy efficiencies of the base case scenario (shown in Table 5) are used to identify the 1 st lossiest branch. Accordingly, branch 5-6 has the lowest exergy efficiency (87.97%) which is in agreement with the energy analysis. The exergy flows in the branches after isolating the branch 5-6 are summarised in Table B.5, Appendix B. The results show that the next lossiest branch is the one between Hubs 4 and 6. The resulting exergy flows after isolating the branch 4-6 are summarised in Table B.6. Accordingly, the 3 rd lossiest branch is the one between Hubs 2 and 4. Though the three branches that are isolated at the end are the same in both energy and exergy analyses, identifying the lossiest branches using exergy analysis is found to be straightforward. 10 and Table 11.

Reduced network topology

Hubs 3 and 4 are sources of heat as they are indicated by positive nodal mass flows in Table 10 while Hubs 2 and 5 are consumers. The return temperatures of both Hubs 2 and 5 are at 30 o C which is the lower limit. It implies that the lower the return temperature from the consumers the more economical the DHN will be.

The supply temperatures of Hubs 3 and 4 are at 95 o C and 67.76 o C, respectively. Should the cost of pumping energy be not significant, both supply temperatures were expected to be equal to the minimum limit of 60 o C. However, they are higher than the lower limit and Hub 3 is rather at the maximum limit. This shows that decreasing the sources temperatures further leads to not only a decrease in distribution loss, but also to an increase in a mass flow rate, which in turn requires a higher pumping energy. The optimisation found that the cost of the additional pumping energy is more expensive than the cost of heat loss that could be saved by further decreasing the supply temperatures.

Table 10: Nodal results of the thermo-economic optimisation.

operating cost in Scenario IV is 69.26 €/h showing a 0.4% decrease from Scenario III and about 9.37% reduction from Scenario I.

Figure 5 presents the heat losses (on the left axis) and the operating costs (on the right axis) under different scenarios. It shows how much the operating cost and the total heat loss are progressively decreased and how much of the total loss is shared by each of the branches.

Fig. 5 Comparison of operating costs and heat losses at different operating scenarios.

Computational efforts

All the simulations are done on MatlabR2017a platform running on a Dell desktop computer with Intel Core i5-8400CPU processor (2.80GHz and 2.81GHz) with a 64bit Windows 10 Operating system. Each of the simulations are repeated 10 times. Although the results were very close to each other, all the discussions are based on the best values obtained. The load flow simulations are completed in fractions of seconds. The optimal power flow simulations (Scenarios I and II) took between 95 -187 seconds. The thermo-economic optimisation (Scenario IV) needed 137 -275 seconds to finish due to larger population size used in the PSO. The optimal placement of HPs (Scenario III), on the other hand, took between 860 -1040 seconds.

The simulation time step considered is one hour and all of the simulations were completed in a much shorter time. Furthermore, the optimal placement algorithm is supposed to be run only once to find best placement for the HPs. In that regard, the time it takes can be ignored. However, these numbers are rough figures and vary with the network size and operating condition of the computer. They are meant only to give an idea how the simulations can be used in a real time application. It can be said that the methodology and algorithms developed in this paper can be run on ordinary desktop computer and are suitable for small to medium size district energy system simulations running on hourly bases.

Conclusions

A step-by-step approach of applying energy and exergy analyses on the distribution pipes and nodes of a DHN is presented in this paper together with an optimal placement of coupling technologies such as HPs. The network topology optimisation based on branch efficiency showed that both of the energy and exergy analyses result in the same reduced network topology. However, the exergy analysis is found to be straightforward giving a better clarity in identifying the lossy branches and nodes in the DHN. Significant amount of exergy destruction takes place across the branches, rather than at the nodes. It has also been found that the contribution of the return pipe network in the exergy loss is not negligible, though it is much lower than the supply side pipe networks. After determining the optimal topology of the DHN, optimal placement of HPs is conducted using nested PSO technique. The optimisation results show that the location of HPs also has an impact on both distribution loss and cost of pumping. The thermo-economic optimisation further revealed that lowering the supply temperature does not necessarily result in a lower operational cost. The pumping cost may sometimes counter balance the advantages of lower supply temperatures. However, lowering the return temperature of the consumers (on the primary side) is found to be always economical.

Compared to the base case scenario, topology reduction resulted a reduction of 41.37% of the distribution heat loss while optimal placement of heat pumps and thermo-economic optimisation showed 52.93% and 59.12% loss reduction, respectively. Up to 9.37% saving on the total operating cost is also achieved.

The methodology presented in this paper can be extended by considering various technologies in a multi energy system. For example, the exergy analysis covered in this study is limited to the distribution branches and nodes of the DHN. It can be complemented by considering the exergy interaction between different energy carriers inside the energy hubs, such as HPs, CHPs and substations. The COP of each HP is also assumed to be constant for partial and full load operation. This could be improved by incorporating efficiency curves of HPs. Electricity demands with both active and reactive loads together with CHPs and HPs with lagging power factors can also be considered to study the capacity of the electricity distribution network. The sensitivity of the optimal solutions can also be further investigated by considering a range of prices for different energy carriers, such as gas, fuel, electricity and heat. A pseudo-dynamic simulation can also be incorporated by considering time series load profiles, thermal storage and wind power generation forecast.

Optimisation algorithms other than PSO can also be applied for comparative study.

Nomenclatures

Fig. 1 .

 1 Fig. 1. A step-by-step approach for operational optimisation of a DHN.

Fig. 3 A

 3 Fig. 3 A hypothetical electrified district heating network.

  This scenario corresponds to step 2 in Fig. 1. The network topology as shown in Fig 3 is considered. The 125 kWe and 380 kWe HPs are placed at Hubs 5 and 3, respectively. All sources' supply temperatures are assumed at 85 o C while all the return temperatures from the consumers are set at 40 o C. Optimal power flow is run using a single PSO (population size of 20 and a maximum iteration of 100) algorithm.

  Once all the branches 5-6, 4-6 and 2-4 are isolated from the base case topology (Fig 3), the reduced (optimised) topology of the DHN looks like as shown in Fig 4. This configuration is found to be optimal for the given load and generation conditions.

Fig. 4

 4 Fig.4The reduced network topology after isolating the lossy branches.

Table 3 :

 3 Branch results of the optimal power flow (base case).

	Hubs	Flow
		(kg/s)

Supply Pipe Network of DHN Return Pipe Network of DHN Branch i to j

	i	j		Hi (m)	Hj (m)	Tsi ( o C)	Tsj ( o C)	Hi (m)	Hj (m)	Tri ( o C)	Trj ( o C)	We(branc) (kW)	Net heat flow (kW)	Loss (kW)	Energy efficiency
	1 2	2.98	30.00 28.23	43.40	43.35	30.00 31.77	39.69	39.74	0.169	45.04	1.16	97.14%
	2 3	-3.04	28.23 50.27	83.95	85.00	31.77	9.73	39.74	39.22	2.134	561.74	19.95	96.22%
	2 4	1.00	28.23 25.51	63.84	61.44	31.77 34.49	38.43	40.00	0.087	90.13	16.65	84.34%
	3 4	3.23	50.27 25.51	85.00	84.01	9.73 34.49	39.51	40.00	2.547	594.06	20.00	96.34%
	3 6	3.09	50.27 27.46	85.00	83.97	9.73 32.54	39.05	39.56	2.248	574.32	19.93	96.28%
	4 5	-1.01	25.51 28.24	81.88	85.00	34.49 31.76	40.00	38.44	0.088	176.66	19.75	89.90%
	4 6	-0.84	25.51 27.46	79.60	83.26	34.49 32.54	40.00	38.13	0.052	139.14	19.42	87.72%
	5 6	0.51	28.24 27.46	85.00	78.95	31.76 32.54	36.57	39.56	0.013	84.24	19.35	81.31%

Table 4 :

 4 Exergy flow to/from the environment and exergy efficiency at each node (base case).

		Exergy on supply side nodes (kW)		Exergy on return side nodes (kW)	We(consumer)	Nodal exergy
	Node External input Total input Total output	External input	Total input	Total output	(kW)	efficiency
	1	49.29	49.29	49.29	-42.45	42.45	42.45	0.000	100.00%
	2	-159.64	203.87	191.63	72.41	85.99	85.96	0.314	95.66%
	3	488.91	488.91	488.91	-128.93	128.94	128.93	0.000	100.00%
	4	-280.80	282.64	280.80	87.94	87.94	87.94	0.380	99.40%
	5	79.09	79.09	79.09	-19.98	19.99	19.98	0.000	99.99%
	6	-138.75	180.98	180.93	39.91	51.12	51.11	0.173	99.90%

Table 5 :

 5 Exergy of water at the inlet and outlet of branch pipes and associated losses (base case).

	Nodes	Exergy of water in the supply pipe (kW)	Exergy of water in the return pipe (kW)		Branch i to j
	i	j	At node i	At node j	Loss	Exergy efficiency	At node i	At node j	Loss	Exergy efficiency	Net exergy flow (kW)	Exergy lost (kW)	Exergy efficiency
	1 2		49.29	49.14	0.23	99.54%	42.45	42.58	0.22	99.50%	91.59	0.44	99.52%
	2 3		154.73	158.72	5.06	96.83%	43.37	41.77	2.67	94.00%	196.51	7.72	96.22%
	2 4		31.98	29.93	2.10	93.45%	13.58	14.53	1.00	93.12%	43.50	3.10	93.34%
	3 4		168.62	164.50	5.39	96.82%	44.93	46.67	3.01	93.72%	209.43	8.40	96.14%
	3 6		161.58	157.55	5.15	96.83%	42.23	43.86	2.75	93.88%	199.78	7.90	96.19%
	4 5		49.19	52.48	3.34	93.65%	14.59	13.63	1.00	93.14%	62.81	4.34	93.54%
	4 6		39.03	42.18	3.18	92.47%	12.15	11.21	0.97	92.05%	50.24	4.15	92.37%
	5 6		26.61	23.44	3.18	88.05%	6.36	7.25	0.90	87.64%	29.80	4.08	87.97%

Table 9 :

 9 Branch results after optimal placement and sizing of the HPs. Unlike to the fixed supply and return temperatures applied in the previous scenarios, a thermoeconomic optimisation is done in this scenario by relaxing the supply temperature range between 60 o C and 95 o C and the return temperature between 30 o C and 55 o C. The nodal and branch optimisation results are presented in Table

	Hubs		Branch i to j
	i	j	We(branch) (kW)	Net heat flow (kW)	Loss (kW)	Energy efficiency
	1 2	0.000	0.00	---	---
	2 3	1.676	-500.00	19.81	96.19%
	3 4	0.225	-254.57	19.74	92.80%
	3 6	0.000	0.00	---	---
	4 5	0.123	200.00	19.79	91.00%
	4.4. Thermo-economic optimisation (Scenario IV)

Table B .

 B TableA.1: Pipe and transmission line parameters. TableB.1: Nodal results of the economic dispatch after isolating the 1 st lossy branch. 5: Exergy of water at the inlet and outlet of branch pipes and associated losses after isolating the 1 st lossy branch.

	∆𝑇 e Appendices	Temperature difference (K) Internal surface roughness of a 3 6 1.558 4 5 0.307	500.00 19.98 -280.12 19.88	95.87% 93.28%
		pipe (m) A: Branch parameters
	H			Hydraulic head (m)
	HP			Heat pump
	HP Lep		Electricity consumption of HP
	HP Phg from to Hubs Hubs	(W) (W) (mm) D1 + t1 Heat power produced by the HP (mm) (W/mK) (mm) (W/mK) t1 k2 e k3 Carrier Pipe Parameters (m) L Insulation	(mm) D3	(mm) t3 Outer Jacket (W/mK) k4	(km) L Transmission lines (Ω/km) (Ω/km) R X	(µS/km) B
	K 1 2 L 2 3	2 3 4 4	50 600 600 600	60.3 Pressure resistance coefficient 3.2 40 0.05 0.027 60.3 3.2 40 0.05 0.027 (m.s 2 /kg 2 ) 60.3 3.2 40 0.05 0.027 Length (m) 60.3 3.2 40 0.05 0.027		125 125 125 125	3.0 3.0 3.0 3.0	0.40 0.40 0.40 0.40	0.05 0.60 0.60 0.60	0.262 0.307 0.307 0.307	0.386 0.386 0.386 0.386	4.31 4.31 4.31 4.31
	Lh 3	6	600	Heat power demand (W) 60.3 3.2 40	0.05	0.027		125	3.0	0.40	0.60	0.307	0.386	4.31
	𝑚̇ 4 4	5 6	600 600	60.3 Mass flow rate from a hub (kg/s) 3.2 40 0.05 0.027 60.3 3.2 40 0.05 0.027		125 125	3.0 3.0	0.40 0.40	0.60 0.60	0.307 0.307	0.386 0.386	4.31 4.31
	𝑚̇𝑖 𝑗 5	6	600	Mass flow rate from node i to j 60.3 3.2 40 0.05 0.027		125	3.0	0.40	0.60	0.307	0.386	4.31
				(kg/s)
	MES		Multi-energy system
	Pel	Active electric power injection B. Intermediate results of topology reduction (Scenario II)
				(W)
	Pelg			Active electric power generated
				(W)
	Ph			Heat power injection (W)
	Phg			Heat power generated (W)
	P			Pressure of water (Pa)
	Po			Reference pressure (Pa)
	PSO		Particle Swarm Optimisation
	Qel			Reactive power injection (var)
	Qelg			Reactive power generated (var)
	R			Resistance of a transmission line
				(Ω)
	T			Temperature (K)
	t1			Thickness of carrier pipe (m)
	t3			Thickness of outer jacket (m)
	To			Reference temperature (K)
	V			voltage (V)
	𝑣 𝑖-𝑛𝑒𝑤		new velocity of particle i
	𝑣 𝑖𝑜			current velocity of particle i
	B We			Susceptance of transmission line electricity used for circulation
	Bph X 𝑐 1 𝑐 2 𝑥 𝑖 Cp 𝑥 𝑖-𝑛𝑒𝑤 𝑥 𝑖-𝑏𝑒𝑠𝑡 CHP 𝑥 𝑔-𝑏𝑒𝑠𝑡		pumps (W) (S) Reactance of a transmission line Physical exergy (W) (Ω) Personal acceleration factor current position of particle i Global acceleration factor new position of particle i Specific heat capacity of water Best position of particle i (J/kg.K) Combined heat and power Global best position
	CHP Pepg 𝜔	Active inertia factor electrical	power
	Subscripts	produced by the CHP (W)
	CHP Phg i, j, k COP r		Heat power produced from the Hub numbers CHP (W) Coefficient of performance Return pipe of DHN
	D, D1 s		Internal diameter of a pipe (m) Supply pipe of DHN
	D3			Outer diameter of insulating
				material(m)
	DHN		District Heating Network

Exergy of pipe on the supply side (kW) Exergy of pipe on the return side (kW) Branch i to j

	i	j	At node i	At node j	At node i	At node j	Net exergy flow (kW)	Exergy lost (kW)	Exergy efficiency
	1 2	44.84	44.71	40.97	41.10	85.68	0.41	99.52%
	2 3	154.92	158.92	43.42	41.81	196.74	7.74	96.22%
	2 4	26.10	24.09	11.03	11.97	35.11	3.00	92.12%
	3 4	165.88	161.80	44.18	45.88	205.98	8.21	96.17%
	3 6	163.90	159.85	42.74	44.40	202.59	8.06	96.18%
	4 5	77.78	81.17	22.53	21.49	99.27	4.74	95.44%
	4 6	18.28	21.34	6.05	5.16	23.44	3.97	85.52%

Table B

 B .6: Exergy of water at the inlet and outlet of branch pipes and associated losses after isolating the 2 nd lossy branch.

	Node

Exergy of pipe on the supply side (kW) Exergy of pipe on the return side (kW) Branch i to j

	i	j	At node i	At node j	At node i	At node j	Net exergy flow (kW)	Exergy lost (kW)	Exergy efficiency
	1 2	40.92	40.79	39.83	39.95	80.62	0.39	99.52%
	2 3	165.25	169.38	46.25	44.52	209.77	8.44	96.13%
	2 4	31.92	29.86	13.57	14.53	43.44	3.10	93.34%
	3 4	178.72	174.46	47.55	49.43	222.01	9.16	96.04%
	3 6	142.59	138.77	37.74	39.18	176.52	6.80	96.29%
	4 5	77.77	81.16	22.54	21.50	99.27	4.74	95.44%

Acknowledgments

The research presented is performed within the framework of the Erasmus Mundus Joint Doctorate SELECT+ program 'Environomical Pathways for Sustainable Energy Services' and funded with support from the Education, Audiovisual, and Culture Executive Agency (EACEA) (FPA-2012-0034) of the European Commission. This publication reflects the views only of the author(s), and the Commission cannot be held responsible for any use, which may be made of the information contained therein.

supported by ICTs. Author of more than 70 papers in international journals and conferences. Expert of the ETIP-SNET (European Technology & Innovation Platforms -Smart Networks for Energy Transition) working group and for the International Energy Agency Technology Collaboration Programme IEA-DHC. Involved in different European projects (ESAM, mySMARTLife, ME3, SELECT+). Holder of an industrial chair on Energy & Data (chair ValaDoE).

Results and discussions

Base case (Scenarios I)

Energy analysis

The hub-level load flow results of Scenario I are presented in Table 2. The table shows the local electricity generation (Pepg); the consumption of HPs (HP Lep); the heat generated by the HPs (Hp Phg); the electricity and heat produced by the CHP (CHP Pepg and CHP Phg); the heat generated locally (Phg); the heat demand (Lh); and the nodal mass flow rate (𝑚̇). It also shows the nodal temperatures (Ts and Tr) and hydraulic heads (Hs and Hr) on the supply and return sides of the DHN.

The total amount of heat demand is 2400 kW. The CHP generated about 470 kW of heat while the two HPs produced 2020 kW of heat, which add up to 2490 kW. Although the total heat produced is 90 kW more than the total heat demand, it is not enough to compensate the losses in the network. Hence, additional 46.19 kW of heat is imported from the neighbourhood. On the other hand, the wind and the CHP plants produced 125 kW and 380 kW of electricity, respectively. The electricity lost in the distribution network is zero because all the electricity is consumed locally by the HPs. An optimal power flow is then run to see how much saving is made in terms of both energy and money. The nodal and branch level results are summarised in Table 6 andTable 7. As it can be seen from Table 6, the imported heat is zero and there is an excess of electricity exported to the neighbourhood at Hub 1. It also shows that running the CHP at full rate is found to be economical than running the heat pumps at full rate. From the two HPs, the one installed at Hub 5 is running at its full capacity (125 kW) because of the cheap local generation of 125 kW electricity from the wind plant. It also avoids the electricity loss that could exist while exporting the excess production from Hub 5 to Hub 1.

Optimal placement of HPs (Scenarios III)

To further reduce the distribution loss, the optimal placement of HPs is determined using the nested PSO algorithm presented in [START_REF] Ayele | Optimal placement and sizing of heat pumps and heat only boilers in a coupled electricity and heating networks[END_REF]. It is found that Hub 4 and Hub 6 are the best places to install the 380 kWe and the 125 kWe HPs, respectively. The sizing of the HPs and operating parameters of the distribution network are summarised in Table 8 andTable 9. The total heat loss is now 64.11 kW which shows 52.93% and 19.72% reductions from Scenarios I and II, respectively. In comparison to Scenario II (Table 6), the amount of electricity exported has increased by 3.09 kW. As the HPs are placed relatively farther from the electricity sources, there is a higher (about 0.85 kW) electricity distribution loss. On the other hand, the heat pumps are relatively closer to the heat demands when compared to Scenario II. As a result, the pumping cost has decreased from 1.88 €/h (Scenario II) to 0.5 €/h. The total operating cost becomes 69.56 €/h which shows 8.98% saving over Scenario I. The total distribution heat loss in Scenario IV is decreased to 55.67 kW, as it can be calculated from


Legal framework on AI: merits of different type of legal instruments according to the principles to protect or to promote If the CAHAI concludes to the feasibility of a legal framework for the development of AI, three different options should be considered. I'll try to answer to the following two questions :

• What are the Instruments available within the Council of Europe legal framework? • Why choosing one than another? So, I'll briefly present to you these two points, and then I'll outline their expected effects.

I Presentation of possible instruments

1) a Recommendation

2) a Framework Convention

3) a "basic" Convention

A) Recommendation

There is already the PACE recommendation of 2017 on Technological convergence, artificial intelligence and human rights. There is also the first recommendation of the Committee of Ministers of 13 February 2019, which is broader than the CAHAI's mandate, on the manipulative capabilities of algorithmic processes.

The Committee of Ministers Recommendation is categorized in the field of soft law. Compared to hard law, it means that this category of standards are nonbinding.

The benefit of this type of standards are well known, as are the negative aspects.

• For the benefit: a simpler and smoother process

• A recommendation can be adopted easily and more promptly than a convention. • It can be the beginning of a new rule-making cycle: the universal declaration of human rights of 48 has conducted to the International Covenants of 66. • it can be modified easily ▪ If the regulation proves to be bad, unenforceable, or even a counterproductive one ▪ Or, in the event that the regulation is exceeded by the social evolution.

• Disadvantage

• the Recommendation is a restraint but not a legal restraint ▪ it may not be effective.

▪ the lack of jurisdictional guarantee. There are no possibilities to enforce these principles with regard to citizens.

B) Framework Convention

When I was first told that a Framework Convention was considered, my first reaction was ok, but what is a Framework Convention and, more precisely, what are the differences with a "basic" convention? In the French academic literature, there are very few developments on this point.

It is a convention supposed to set out principles that should serve as a basic foundation for cooperation between States Parties in a given area, while leaving to the latter the responsibility to define, through separate agreements, the appropriate modalities for this purpose.

It does not create specific obligations for the States, but establishes a process of continuous negotiation. The latter imposes on the governments the obligation to participate in good faith in the subsequent stages of the negotiations. Most often, this type of conventions serves as an umbrella for future protocols. Accordingly, a Framework Convention is not an end-point in its own sake but involves a subsequent activity which may take several forms

• treaty activity, by means of an another "basic" convention, for example, the UN Framework conventions on climate change of 1992 led to the adoption of the Paris Agreement of 2015. • institutional activity, by means of an expert committee. There are three types of functions for those committees: ▪ assisting the Council of Ministers ▪ proposing recommendations to the Council of Ministers ▪ examining State reports and checking their conformity with the Convention. Then, the Council may subsequently make recommendations to the States. • or soft law by means of a recommendation However, within the Council of Europe law, framework conventions are not the unique tool allowing the subsequent adoption of other standards or the implementation of committees. For example, the ECHR has numerous protocols. "Basic" conventions, such as the CSE or the CPT have established powerful committees. Therefore, the possibility of adopting subsequent protocols and/or implementing committees should not be a decision-making factor.

Most framework conventions deal with international environmental law (UN Framework conventions on climate change of 1992), we can also mention the WHO Framework Convention on Tobacco Control of 2003.

But the Council of Europe has an older experience in this area, namely with the following three conventions:

• The 1980 European Outline Convention on Transfrontier Co-operation (translated in french: Convention-cadre européenne sur la coopération transfrontalière) which has been developed with 3 protocols (1995,1998 and the last was from 2009).

• We have also the Framework Convention for the Protection of National Minorities of 1995.

• Framework Convention on the Value of Cultural Heritage for Society of 2005.

• A few words about the 1995's framework convention:

• this agreement fulfils an ambitious demand on minority protection, specially for the Roma people. • This experience, in my opinion, is very enlightening for the IA issue. The choice of a framework convention instead of a "basic" convention was motivated by the challenge of reaching a consensus in this particular area. ▪ So far, this initiative was not a huge success for the Council of Europe.

▪ First of all, it does not define the concept of "national minority". It would probably be unacceptable for CAHAI not to provide a definition of AI.

• By contrast, the Outline Convention of 1980 and the last mentioned of 2005 define their subjects very clearly. ▪ The Convention for the Protection of National Minorities sets out a number of "programme provisions" establishing objectives that States commit themselves to achieve. Its implementation is mainly ensured by national measures and only subsidiarily by bilateral agreements. ▪ It did not lead to the production of subsequent standards, only to the establishment of a Committee of Experts in charge of examining the application of the Convention by the States Parties. A look at the latest report does not allow us to be very optimistic about the effectiveness of this convention.

• However, this lack of effectiveness is certainly not due to the fact that the Convention is a framework convention, but to the fact that the subject matter is extremely sensitive.

C) Basic Convention

Three categories of conventions can be distinguished depending on their purpose ▪ the first one concerns the convention itself: is it self-executing? ▪ the second concerns the States: has it been recognized a direct effect in domestic law? ▪ If the answers are yes to these two questions, the convention's efficiency will be greater • Does the convention imply obligation of means or obligation of results ?

▪ ECHR is the most influent convention of the Council of Europe. It has set international standards that are followed throughout the world, on the African and American continents.

• It contains obligations of results and the European Court ensures its enforcement. ▪ Agreement of Paris of 2015 or the COP 21 is a "true" international convention but, in my opinion, with a soft law content. Obligations are expressed in a conditional form and it contains exclusively obligations of means.

II Presentation of expected effects

Each of these three types of instruments could be considered for the AI regulation, but the effects will not be the same. In fact, the choice will essentially depend on the objectives assumed by the States through this regulation.

• If the aim of the States is a simple clarification of the principles that should make possible the regulation of AI, a simple Recommendation is conceivable • If the purpose is a supervision by a CoE committee and the establishment of a certification procedure: a Framework Convention could be adequate • If the States consider that the risks involved in AI technology require binding Law: a Convention is required

A) Recommendation

A recommendation would provide standards that could inspire • national legislators when drafting future legislation.

• They can also be a useful source of inspiration for the courts: ▪ The ECHR has already quoted a recommendation of the CM in the Prisma Presse vs. France case of june 2002. • Recommendations may sometimes inspire other conventions 3 arguments can be presented against a recommendation

• No individual guarantee that these standards will be enforced • What's the point? Is the ambition of the Council of Europe to produce the one hundred and seventh ethical charter on AI? • Generally speaking, there is a huge movement in favour of the soft law. This phenomenon is explained by the conviction that soft law is self-regulation supposed to allow a more flexible society and, in the end, a more efficient regulation. In my view, the history of the soft law tells the opposite. The selfregulation effectiveness has never been proven, neither legally nor politically. In fact, the self-regulation effectiveness is a commercial argument. It is up to us not to buy it. • Soft law can be a very useful instrument for international regulation but only if it is supplemented by hard law. We know that the International Development Law could not survive only on the soft law basis.

B) Framework Convention

A framework convention could provide European harmonisation, particularly through the establishment of a consultative Committee or an expert committee in charge of periodic evaluation or through the introduction of a certification process for some AIs.

2 arguments reveal the risk of the lack of effectiveness of a framework convention. Indeed, the effectiveness of a committee depends on the social influence of its subject and the target audience of its standards:

• is the regulation intended for the States? ▪ This may be adequate, for example, the Committee for the Prevention of Torture: a part of the population is concerned by human rights conditions for the inmates. ▪ This is probably not as relevant for the "Advisory Committee on the Framework Convention for the Protection of National Minorities". The latest annual report states that the reception by the governments, the public and the media is very reticent to its efforts • is the regulation intended for the private sector?

▪ A national report would be useless since it often concerns multinational or Non-European companies. ▪ As the publication of the Council of Europe committees reports are often confidential, an NGO practice to force the moralization of the private sector is "name and shame".

• This would probably be just as useless considering that the people have become used to moral and ethical misconduct by some tech companies over the years. Has the Cambridge Analytica scandal led Facebook's users to desert it or just put less political information on their accounts? Not only the number of subscribers has continued growing, but, these users continue to freely express their political preferences.

C) "Basic" convention

A basic convention would allow the most efficient regulation of AI. It would allow all potential developments already provided for by the instruments studied previously, while at the same time being highly binding for States wishing to ratify this text.

The arguments put forward against this type of instrument are related to the risks of such classical international regulation. I will refer only to two of these arguments :

• First of all, a soft law regulation, like a recommendation, would allow a smoother transition economically. This argument is based on a comparison with international environmental law. ▪ It is a flexible law because the economic issues are very important, and the ecological transition has a huge cost that is indisputable. However, for AI, the regulation of these activities present no real risk: the establishment of a supervisory or control authority is affordable. • The development of certain AI technologies will lead to the wealth of their creators, and to the States wealth, as well, allowing their development. That's for sure. But some of these technologies seem to be in direct contradiction with our values, especially facial recognition or predictive criminal justice.

• The question -a little bit naive -we have to ask ourselves is what will Europe lose if we slow down the development of this type of particularly freedom-killing technology? Money? Maybe, it is better to preserve what constitutes our European identity, namely the protection of human rights, the rule of law and democracy, rather than engage in an economic competition over products that will allow some states to continue to violate these values?

A basic convention will allow us fighting against the risks inherent to the use of AI, not theoretical but concrete risks. Do we want the standardization of software like Compass or HART? 2 elements suggest imposing the adoption of this type of instrument:

• The need to criminalize specific behaviours. For example, the use of AIs that could lead to discrimination. • The need to establish digital fundamental rights. This would allow people to oppose these guarantees both to the government and to the private sector.

In conclusion, I would like to suggest that the regulation of AI should be seen in the same way as the regulation of other beneficial but potentially dangerous products. For example, pharmaceuticals or nuclear products. Today, no one can deny that the international community needs the regulation of these products, just as no one can deny that their development has not led to an improvement of the human condition.

  Cooperation Convention (European Convention on Extradition) • Convention "à la carte" : European Social Charter or the European Charter of Local Self-Government: Governments can choose a minimum from a core set of rights.

	• The adoption of a convention is not a guarantee of effectiveness. It depends
	on
	• what follows
	▪ another convention, protocol or nothing ?
	• how the convention is incorporated into domestic law. Basically, there are
	two conditions:

• Harmonization Convention (ECHR or Convention 108 on data protection) •

•

  Secondly, a soft law regulation would prevent Europe from being left behind in the research and development of European AI. A binding convention would limit such research and business, although the USA and China are already well ahead of the Council of Europe member states in this field. ▪ This cost argument can be balanced with the Council of Europe values if AI is developed without limits.