Benefits through Space Heating and Thermal Storage with Demand Response Control for a District-Heated

: Demand response techniques can be effective at reducing heating costs for building owners. However, few studies have considered the dynamic marginal costs for district heating production and taken advantage of them for building-level demand response. In this study, a district heating network in the Finnish city of Espoo was modeled to deﬁne dynamic district heat prices. The beneﬁts of two demand response control approaches for a Finnish ofﬁce building, the demand response control of space heating and a thermal energy storage tank, were evaluated by comparing them to each other and utilizing them together. A 5 m 3 storage tank was installed in a substation of a conventional high-temperature district heating network. A new demand response control strategy was designed to make the most of the storage tank capacity, considering dynamic district heat prices and the maximum allowed return water temperature. The results indicate that the demand response control of space heating and the storage tank cut district heat energy costs by 9.6% and 3.4%, respectively. When employing the two approaches simultaneously, 12.8% savings of district heat energy costs were attained. Additionally, thermal energy storage provides more potential for peak power limiting. The maximum heating power decreases by 43% and the power fee reduces by 41.2%. Therefore, the total cost, including the district heat energy cost and the power fee, can be cut up to 22.4% without compromising thermal comfort and heat supply temperatures to ventilation systems.


Introduction
District heat is the most common source of space heating in Finland.In 2020, it covered 45% of the market share of space heating for residential, commercial, and public buildings [1].In 2021, 54% of residential buildings, 58% of commercial buildings, and 84% of public buildings were connected to district heating (DH) networks [1].Since the aim in Finland is to be carbon neutral by 2035 [2], strategies for the decarbonization of the energy sector and for energy efficiency improvements in the building sector should be developed simultaneously.
Demand-side management is the approach of adjusting consumer demand curves to follow energy generation patterns [3].Usually, demand response (DR) encourages consumers to use more energy during off-peak hours so that peak power demand decreases.Consumers can gain monetary benefits through DR.Moreover, is the resulting peak power reduction can improve energy systems' reliability and efficiency [4].Therefore, this promotes further research on buildings' energy demand adjustment potential by demand response to match energy supply to minimize energy costs and peak loads.
By utilizing available thermal energy storage (TES), such as buildings' thermal mass and thermal energy storage tanks, demand response strategies could be applied to building energy systems for reducing peak power and load shifting.Usually, based on dynamic electricity prices, higher indoor air temperature setpoints are defined so that heat is stored in a building's thermal mass during low-price periods.Indoor air temperature decreases for discharging when the energy price is high [5,6].Recently, cases focused on district-heated buildings and their connected DH grids have increased.Hedegaard et al. established [7] a model with 159 single-family houses to examine the effectiveness of price-based demand response control by utilizing buildings' thermal mass storage to reduce district heating peaks.Dominković et al. [8] found that using thermal mass for storage provided 5.5-7.7% of flexible load regarding total DH demand.Furthermore, more solar thermal heating energy could be effectively exploited in the DH system.
For short-term TES, because of its low cost, technological simplicity, thermal characteristics, and other advantages, sensible heat TES using water as a medium offers a wide range of applications [9].In DH systems, short-term TES has usually been integrated with CHPs for production optimization [9,10].Jebamalai et al. [11] found that this resulted in greater cost reductions for a DH network by centralized storage with lower daily peak fluctuations, whereas storage installed in substations was better suited for more varied daily peak profiles.What is more, mixed-integer linear programming (MILP) or EnergyPro software was one method utilized for the optimization of energy generation components among various candidates [12,13].Benalcazar [14] evaluated the most appropriate TES capacity in CHP systems.It decreased peak power demand and reduced heat-only boilers' fuel costs.Tan et al. [15] took arbitrage in electricity and reserve markets into consideration.They developed an economic approach for a DH system which cut operational expenses, total investment, and peak load by TES.
In addition, scholars have begun to pay attention to DH markets.The heat merit order method was presented to calculate the marginal costs of DH production for bidding and wholesale [16,17].Liu et al. [18] analyzed three DH production mixes in Netherlands.They found that low-carbon heat generation technologies tend to have low short-run marginal costs.
Demand response benefits can also be gained when short-term TES is installed in DH substations.Cai et al. [19] proposed a demand response control strategy based on DH marginal costs and adjusting buildings' indoor air temperatures and DHW tanks' temperatures of all substations in a DH network.The maximum DH supply water temperature was 95 • C.Although it decreased the total DH cost, the peak heating power increased.
In ultra-or low-temperature DH systems, the designed DH supply temperature can be as low as 40 • C [20].However, for hygiene purpose, the DHW supply temperature should be high enough to inhibit the growth of legionella bacteria [21].For example, in Finland, the DHW temperature in a system must be at least 55 • C [22].Therefore, to guarantee the required DHW temperature level, short-term TES was installed in the study building and heated by heat pumps or electric heaters.The preheating strategy was designed considering PV generation potential, dynamic electricity prices, electricity load, etc. Buffa et al. [23] have offered solutions for improving the operation of DHW thermal storage systems by demand response.Similarly, Knudsen and Petersen [24] investigated the way in which a heat pump in an ultra-low temperature DH network for DHW heating was utilized to reduce peaks and save energy costs by demand response.It indicated that the presented control saved costs by about 5% per year and shifted loads to off-peak periods without sacrificing hygiene and thermal comfort.
Based on the references mentioned above, studies mainly analyzed the marginal costs trading of the DH market or demand response benefits for DH production by utilizing marginal costs.Therefore, the gap in the knowledge is that few studies have taken advantage of calculating dynamic district heat prices for building-level demand response.In addition, short-term thermal storage systems installed in DH substations were usually connected to ultra-or low-temperature DH networks with heat pumps or other units.Therefore, according to the authors' best knowledge, this is the first study to analyze demand response benefits for building owners with a short-term thermal storage tank integrated into a DH substation in a conventional high-temperature DH network.In this study, a DH network was modeled to calculate the marginal costs for defining dynamic district heat prices.The benefits of the two demand response control approaches, demand response control of space heating, and the storage tankwere evaluated by comparing them to each other and utilizing them together.Moreover, this paper examined the peak power-limiting potential of the storage tank and combined it with demand response.
In this study, a 5 m 3 storage tank was installed into a DH substation in a conventional high-temperature DH network for building-level demand response.The storage tank supplied heat for space heating, ventilation, and DHW to a Finnish office building.The maximum tank temperature was 90 • C. The maximum storage capacity was 175 kWh, with a temperature difference of 30 • C if the tank was fully mixed.A DH network in the Finnish city of Espoo was optimized to define dynamic district heat prices for demand response control.A demand response control strategy was designed to make the most of the storage tank capacity, considering dynamic district heat prices and the maximum allowed DH return water temperature.Two demand response control approaches, for space heating and for the building-level storage tank, were applied in this paper.The results section analyzes the energy flexibility provided by them.In addition, it discusses the peak power limiting potential of the storage tank and its impacts on the power fee, demand response benefits, thermal comfort, and the building-level thermal storage tank temperature.

Methodology
This section includes three parts.Firstly, Section 2.1 presents the whole simulation process.After that, Section 2.2 introduces DH production, including the modeling method, DH system, district heat prices, and power fee.Finally, the building-level simulation process is shown in Section 2.3.There are five subsections about building parameters, DH substation layouts, the simulation tool and weather data, demand response control algorithms for space heating and the building-level storage tank, and energy flexibility factors.

Description of the Simulation Process
Figure 1 shows the whole simulation process.
Therefore, according to the authors' best knowledge, this is the first study to analyze demand response benefits for building owners with a short-term thermal storage tank integrated into a DH substation in a conventional high-temperature DH network.In this study, a DH network was modeled to calculate the marginal costs for defining dynamic district heat prices.The benefits of the two demand response control approaches, demand response control of space heating, and the storage tankwere evaluated by comparing them to each other and utilizing them together.Moreover, this paper examined the peak powerlimiting potential of the storage tank and combined it with demand response.
In this study, a 5 m 3 storage tank was installed into a DH substation in a conventional high-temperature DH network for building-level demand response.The storage tank supplied heat for space heating, ventilation, and DHW to a Finnish office building.The maximum tank temperature was 90 °C.The maximum storage capacity was 175 kWh, with a temperature difference of 30 °C if the tank was fully mixed.A DH network in the Finnish city of Espoo was optimized to define dynamic district heat prices for demand response control.A demand response control strategy was designed to make the most of the storage tank capacity, considering dynamic district heat prices and the maximum allowed DH return water temperature.Two demand response control approaches, for space heating and for the building-level storage tank, were applied in this paper.The results section analyzes the energy flexibility provided by them.In addition, it discusses the peak power limiting potential of the storage tank and its impacts on the power fee, demand response benefits, thermal comfort, and the building-level thermal storage tank temperature.

Methodology
This section includes three parts.Firstly, Section 2.1 presents the whole simulation process.After that, Section 2.2 introduces DH production, including the modeling method, DH system, district heat prices, and power fee.Finally, the building-level simulation process is shown in Section 2.3.There are five subsections about building parameters, DH substation layouts, the simulation tool and weather data, demand response control algorithms for space heating and the building-level storage tank, and energy flexibility factors.

Description of the Simulation Process
Figure 1 shows the whole simulation process.For the first step, a DH production mix with a centralized TES in the network of Espoo shown in Section 2.2.2 was optimized for marginal costs.Marginal cost is defined as the cost to produce the last unit.In DH systems with several production units, the plant with the highest operational cost is the one that produces the last unit of DH [25].The DH For the first step, a DH production mix with a centralized TES in the network of Espoo shown in Section 2.2.2 was optimized for marginal costs.Marginal cost is defined as the cost to produce the last unit.In DH systems with several production units, the plant with the highest operational cost is the one that produces the last unit of DH [25].The DH system was modeled using EnergyPRO software, which is commercial software developed for simulating energy systems combining heat and electricity markets [26].It optimized the running order of the different production units according to their production costs.Following that, dynamic district heat prices were calculated as shown in step 2. Demand response control signals were designed according to the prices in step 3.The two demand response control approaches were applied for decreasing the office building's DH energy costs.Moreover, the peak power limiting potential provided by the building-level storage tank was fully utilized to reduce power fee of the building owners.

DH Network Modeling
This section includes three parts.The first paragraph briefly introduces the parameters considered in the modeling process, such as distribution costs, electricity prices, taxes, etc.The second paragraph explains the way in which the modeling period was defined and selected for analysis.The last describes the assumptions made for the heat demand of the model.The production mixes of the DH system are shown in Section 2.2.2.
In this study, hourly district heat prices were established based on an actual DH network in Espoo.The DH system was modeled to simulate the hourly DH marginal production costs.Hourly dynamic prices were generated from the results of the model.In this study, only the variable costs of DH production and distribution were considered, which include fuel costs, fuel taxes, CO 2 allowances, electricity purchases and distribution, tax, variable operation, and maintenance costs of the production units.Electricity was purchased from the spot market, and the spot price was collected from Nordpool historical data for the period from 10 January 2021 to 30 September 2022 [27].Combined heat and power (CHP) units also sold electricity to the spot market, and the revenues are subtracted from the production costs.Heat demand, the electricity demand of pumping, electricity price and distribution price, supply and return temperatures of the network, price of CO 2 allowances, and the inlet and outlet temperatures of sewage water to the heat pumps (HP) were inputted to the model as time series.
In this study, the data and outdoor temperature statistics of 2019 were used to estimate the total heat demand and heat losses of the period from 1 October 2021 to 30 September 2022.The data of 2019 were the latest available statistics from the database [28].This modeling period, 10 January 2021 to 30 September 2022, showed the price properties after the energy crisis, and the time resolution is one hour.Since demand response benefits incurred by controlling the space heating and the hot water storage tank of the building were analyzed, only the heating season data (from 10 January 2021 to 30 April 2022) were selected to be included this study.
In 2019, the heat demand of the Espoo DH network was 2141 GWh, and distribution losses were 230 GWh [28].It was assumed that 70% of the total DH demand in 2019 was annual space heating demand [29].Thus, the annual space heating demand was 1499 GWh, and the rest of the DHW demand was 642 GWh.The annual space heating demand is dependent on heating degree hours.Heating degree hours were counted for 2019 using a 24-h moving average of outdoor temperature.If it was more than 12 • C, the annual space heating demand and heating degree hours were assumed to be zero.If the 24-h moving average of outdoor temperature was lower than 12 • C, the heating degree hours were equal to the difference between the 24-h moving average of outdoor temperature and the indoor air temperature, 17 • C [30].For 2019, the heating degree-hours were 85,307 • Ch, which gives a specific value of 17.6 MWh/ • Ch for the annual space heating demand.The heating degree hours for the period from 10 January 2021 to 30 September 2022 were 91,570 • Ch.Therefore, the annual space heating demand for this period was estimated to be 1609 GWh.The DHW demand was assumed to be equal to the demand of 2019.Similarly, the total distribution heat losses for the studied period were estimated to be 247 GWh.Thus, the annual space heating demand was divided into every hour of the studied period based on the specific value of 17.6 MWh/ • Ch and hourly heating degree hours.The total annual DHW demand was 642 GWh, as mentioned above.Therefore, the hourly DHW demand was assumed to be a constant value, 73 MW.

Simulated DH System
The DH system consists of three CHP units, several heat-only boilers (HOB), heat pumps (HP) utilizing the waste heat of sewage water, and a centralized TES unit.The capacity of the 20,000 m 3 hot water storage is 858 MWh, with stratification considered.Thus, the temperature was assumed to be 87 • C in the top part of the storage and 50 • C in the bottom.The thermal losses of the storage were not taken into account.The CHP units and the HP can charge the TES.Multiple HOBs combusting the same fuel were modeled as one unit.The two HP units utilizing the waste heat of sewage water were modeled as a single HP, and the software calculated its coefficient of performance (COP) every hour according to the design parameters, the supply and return temperatures of DH, and the inlet and outlet temperatures of sewage water.The design parameters of the HP and COP are presented in Table 1.A more detailed calculation method for the COP can be found in [31].
Table 1.HP design parameters [32].The production units with their technical parameters are presented in Table 2. Fuel capacity is the maximum design amount of fuel used to generate heat or electricity.For example, at maximum load, CHP 1 consumed fuel equal to 265 MW to produce 160 MW of heat and 80 MW of electricity, considering losses.The utilization factors were calculated based on merit order modeling of these units.The largest share of DH was produced in the coal-fired CHP 1.The utilization factor is 66%, and it was operated mainly during winter.The wood chip-fired HOB 5 ran throughout almost the entire year with a utilization factor of 88%.However, due to the lower capacity, the annual share of production was lower than with the coal-fired CHP plant.The sewage water HP, wood pellet HOB, and bio-oil-fired HOB (HOB 3 and HOB 4) had utilization factors of 74%, 66%, and 49%.Because of the high prices of natural gas, the gas-fired HOB was only utilized during the highest peak demand, with a utilization factor of 6.5%.The natural gas-fired CHPs 2 and 3 were used only if the electricity price was high enough.

Thermal
Electricity was purchased from the spot market to feed the heat pumps and to meet the electricity demand of network pumping.Distribution fees, electricity tax, and a security of supply fee were also paid for the consumed electricity.The distribution fees consist of the energy fee and the load fee.The energy fee of distribution was 9.91 €/MWh during winter days, and 3.29 €/MWh at other times.CHP plants sold electricity to the spot market.Plants selling electricity must also pay the load fee.Distribution fees were selected based on to the 2021 high-voltage network pricing of the distribution network [33].The electricity costs are presented in Table 3.

Type of the Fee Price (€/MWh)
Spot price Average: 136.42 Distribution fee, winter days (7 a.m.-9 p.m., 1.12-28.2) [33] 9.91 Distribution fee, other time [33] 3.29 Electricity tax and security of supply fee (€/MWh) 22.53 Load fee, intake from the grid (€/MWh) 1.81 Load fee, output to the grid (€/MWh) 0.76 The production units that combusted fossil fuels paid emission allowances.The price of CO 2 allowances started rising rapidly in the spring of 2021, and the increased price had a significant impact on the costs of heat production based on fossil fuels.Therefore, monthly average CO 2 prices were used in the model [34].For different fuels, fixed prices were applied, and the 2021 fuel tax fees were used in this study.For CHP units, only fuels for heat production are subject to fuel taxation, and they are subject to a deducted carbon dioxide tax.The fuel costs are collected in Table 4.The fuel prices were defined as the average price in Finland during the studied period.In the production costs, the variable maintenance costs of the different units were considered as well.The maintenance costs were 4.5 €/MWh of electricity production for CHP plants, 2 €/MWh of fuel consumption for HOBs, and 3 €/MWh of heat production for HP.All the costs are presented without value-added tax (VAT).The emissions factors were collected from Statistics Finland [35].

District Heat Prices
The production mix of each hour was acquired from the EnergyPRO model of the DH system.The dynamic DH pricing was based on the marginal production costs of the DH system.The marginal production cost was equal to the production cost of the most expensive production unit running each hour.If the production cost of the most expensive unit was negative, the marginal production costs were defined to be equal to zero.This could happen if electricity price was high enough, and all the heat demand could be met using the CHP plants.The pumping costs of the network were added to the marginal production costs, and the network losses were considered by dividing the marginal costs by the network efficiency.
To ensure that the DH company's annual revenues from selling heat with dynamic pricing are realistic, the marginal production costs were scaled so that the annual weighted average price was equal to that of a local DH producer [36].
The annual average marginal cost weighted by the heat demand was 88.49 €/MWh, and the actual annual average DH price of the local DH company weighted by heat demand was 58.91 €/MWh, approximately one-third lower.Therefore, the marginal costs of heat were multiplied by a factor of 0.6657.The calculation method of the dynamic DH price is presented in Equation (1), where p DH is the hourly dynamic price of DH, c produciton is the hourly marginal production cost, c pumping is the hourly pumping cost, and η network is the hourly thermal efficiency of the DH network.
This study only analyzed the demand response benefits during the heating season.Therefore, the hourly DH prices with 24% VAT are shown in Figure 2. The maximum price was 192.5 €/MWh, and the average price was 76.5 €/MWh.It was also found that (October 2021 to April 2022) higher electricity prices decreased the customer price during the heating season due to the increased revenues of the electricity sales of CHP units.
pricing are realistic, the marginal production costs were scaled so that the annual weighted average price was equal to that of a local DH producer [36].
The annual average marginal cost weighted by the heat demand was 88.49 €/MWh, and the actual annual average DH price of the local DH company weighted by heat demand was 58.91 €/MWh, approximately one-third lower.Therefore, the marginal costs of heat were multiplied by a factor of 0.6657.The calculation method of the dynamic DH price is presented in Equation ( 1), where pDH is the hourly dynamic price of DH, cproduciton is the hourly marginal production cost, cpumping is the hourly pumping cost, and ηnetwork is the hourly thermal efficiency of the DH network.

0.6657
This study only analyzed the demand response benefits during the heating season.Therefore, the hourly DH prices with 24% VAT are shown in Figure 2. The maximum price was 192.5 €/MWh, and the average price was 76.5 €/MWh.It was also found that (October 2021 to April 2022) higher electricity prices decreased the customer price during the heating season due to the increased revenues of the electricity sales of CHP units.

Power Fee
Building owners in Finland need to pay power fee for district-heated buildings.According to the power fee calculation method for public buildings [36], the equation is: where P is the maximum heating power during the heating season, kW.The 24% VAT was considered in this equation.

Building Level Simulation
Figure 3 introduces the demand response process of space heating and of the building-level storage tank.Control signals were defined based on dynamic district heat prices.For the demand response control process of space heating, different indoor air temperature setpoints were selected to shift the space heating demand.The outdoor 24-h moving average temperature represents the average outdoor temperature of the past 24 h.Regarding the acceptable indoor air temperature range, the minimum indoor air temperature setpoint (20 °C) was selected according to the thermal environmental category II of

Power Fee
Building owners in Finland need to pay power fee for district-heated buildings.According to the power fee calculation method for public buildings [36], the equation is: Power fee = 1.24 × (62 × P−60), 5 ≤ P ≤ 80 Power fee = 1.24 × (53 × P+660), 81 ≤ P ≤ 300 (2 where P is the maximum heating power during the heating season, kW.The 24% VAT was considered in this equation.

Building Level Simulation
Figure 3 introduces the demand response process of space heating and of the buildinglevel storage tank.Control signals were defined based on dynamic district heat prices.For the demand response control process of space heating, different indoor air temperature setpoints were selected to shift the space heating demand.The outdoor 24-h moving average temperature represents the average outdoor temperature of the past 24 h.Regarding the acceptable indoor air temperature range, the minimum indoor air temperature setpoint (20 • C) was selected according to the thermal environmental category II of standard SFS-EN 16798-1 [37].The maximum indoor temperature setpoint was set as 23 • C [38].In addition, the setpoint smoothing technique was employed to prevent the rebound effect [39].
The demand response control process of the building-level storage tank considered the maximum allowed DH return water temperature (43 • C), the DHW temperature, and the minimum tank temperature setpoint.After that, they were combined to examine the benefits of the demand response control of space heating and the thermal storage tank.
The demand response control process of the building-level storage tank considered the maximum allowed DH return water temperature (43 °C), the DHW temperature, and the minimum tank temperature setpoint.After that, they were combined to examine the benefits of the demand response control of space heating and the thermal storage tank.

Simulated Building
A typical Finnish office building in Espoo was selected for this study.Table 5 lists the building parameters.The original construction period was in the early years of the 1980s, with several renovations after that.It was connected to a conventional high-temperature DH network.The building installed water radiators for space heating.The heat for DHW and the ventilation supply air was also covered by the DH network.Thus, the actual peak heating power demand during the heating season is the total maximum power including space heating, ventilation, and DHW under the weather conditions of Espoo from October 2021 to April 2022 (see Section 2.3.3) with the basic DH substation (see Section 2.3.2).This DH power demand during the simulated heating season was used as the dimensioning power of DH connection in this study.Section 2.3.2 presents the heating system parameters.
The building U-values were selected following the Finnish building code of 1985 [40].The building used triple-pane windows with a 9.5% area ratio of window to wall.The design indoor air temperature was set at 21 °C [41] during the heating season.The DHW heating energy demand was 6 kWh/m 2 [41].The occupants' internal heat gains were set at a 1.2 MET activity level with 0.75 ± 0.25 clo for sedentary activity and normal clothing during wintertime [42].The building usage time was from 8 a.m. to 4 p.m. during workdays.

Simulated Building
A typical Finnish office building in Espoo was selected for this study.Table 5 lists the building parameters.The original construction period was in the early years of the 1980s, with several renovations after that.It was connected to a conventional high-temperature DH network.The building installed water radiators for space heating.The heat for DHW and the ventilation supply air was also covered by the DH network.Thus, the actual peak heating power demand during the heating season is the total maximum power including space heating, ventilation, and DHW under the weather conditions of Espoo from October 2021 to April 2022 (see Section 2.3.3) with the basic DH substation (see Section 2.3.2).This DH power demand during the simulated heating season was used as the dimensioning power of DH connection in this study.Section 2.3.2 presents the heating system parameters.The building U-values were selected following the Finnish building code of 1985 [40].The building used triple-pane windows with a 9.5% area ratio of window to wall.The design indoor air temperature was set at 21 • C [41] during the heating season.The DHW heating energy demand was 6 kWh/m 2 [41].The occupants' internal heat gains were set at a 1.2 MET activity level with 0.75 ± 0.25 clo for sedentary activity and normal clothing during wintertime [42].The building usage time was from 8 a.m. to 4 p.m. during workdays.
Table 6 shows the VAV system with CO 2 control and the CAV system.The range of the airflow covers the maximum air change rate of all the rooms in the building.Every working day, the ventilation systems ran for two hours before opening and for another two hours after closing.In the early morning, the ventilation system ran at full speed from 6 a.m. to 8 a.m. to exhaust more material emissions.FINVAC [43] was selected to determine the design supply and exhaust airflow rates.The ventilation duct system's pressure loss and the fans' efficiencies were chosen in accordance with standard EN 13779 [44].The supply air temperature of the ventilation systems was set at 18 • C during the heating season.Table 6 shows the VAV system with CO2 control and the CAV system.The range of the airflow covers the maximum air change rate of all the rooms in the building.Every working day, the ventilation systems ran for two hours before opening and for another two hours after closing.In the early morning, the ventilation system ran at full speed from 6 a.m. to 8 a.m. to exhaust more material emissions.FINVAC [43] was selected to determine the design supply and exhaust airflow rates.The ventilation duct system's pressure loss and the fans' efficiencies were chosen in accordance with standard EN 13779 [44].The supply air temperature of the ventilation systems was set at 18 °C during the heating season.

DH Substations
The original DH substation (substation 1) in Figure 4 describes heat supply to the building without TES.C is the recommended DHW temperature leaving from the heating device to the building [45], and in the whole building DHW system, the water temperature must be at least 55 • C [22].
Figure 5 describes the way in which the supply water temperatures of DH and space heating changed with outdoor temperatures.They were also applied for substation 2. When the outside temperature was 10 • C, the heating was turned off.
The layout of substation 2 is shown in Figure 6.A 5 m 3 hot water storage tank with a total height of 2.2 m was installed for building-level demand response.There was one temperature sensor (T1) located at the height of 1.2 m from the bottom to measure the water temperature.There was another sensor (T2) to measure the primary side DH return water temperature.
temperature was 20 °C.For the ventilation systems, the supply and return water temperatures were 35 °C and 20 °C.58 °C is the recommended DHW temperature leaving from the heating device to the building [45], and in the whole building DHW system, the water temperature must be at least 55 °C [22].
Figure 5 describes the way in which the supply water temperatures of DH and space heating changed with outdoor temperatures.They were also applied for substation 2. When the outside temperature was 10 °C, the heating was turned off.The layout of substation 2 is shown in Figure 6.A 5 m 3 hot water storage tank with a total height of 2.2 m was installed for building-level demand response.There was one temperature sensor (T1) located at the height of 1.2 m from the bottom to measure the water temperature.There was another sensor (T2) to measure the primary side DH return water temperature.There were two internal heat exchangers (HX1 and HX2) to prevent mixing the tank water with the DHW and the primary DH water.Their UA-values were set as 17.5 kW/K.The tank was installed with two return water heat exchangers (HX3 and HX4) to further decrease the return water temperature of DH.Their heat transfer at the rating was 30 kW.TES was integrated for demand response and peak power limiting.

Simulation Tool and Weather Data
This study used IDA Indoor Climate and Energy (IDA ICE) to simulate the DH substations and the office building [46].The tool has been validated in accordance with the EN 15255-2007 and EN 15265-2007 standards [47].In addition, several studies have supported choosing IDA ICE.Previous studies [48] have introduced the detailed simulation model and its validation, and [49] ascertained that the computational models give reasonable values compared to other software programs such as TRNSYS.IDA ICE has been implemented in the simulation of basic thermal calculations, infiltration and ventilation etc., to test its accuracy [50].
This study considered the stratification of the building-level thermal storage.It was simplified to a one-dimensional tank model [51].A detailed model introduction of the tank has been shown in Ju   There were two internal heat exchangers (HX1 and HX2) to prevent mixing the tank water with the DHW and the primary DH water.Their UA-values were set as 17.5 kW/K.The tank was installed with two return water heat exchangers (HX3 and HX4) to further decrease the return water temperature of DH.Their heat transfer at the rating was 30 kW.TES was integrated for demand response and peak power limiting.

Simulation Tool and Weather Data
This study used IDA Indoor Climate and Energy (IDA ICE) to simulate the DH substations and the office building [46].The tool has been validated in accordance with the EN 15255-2007 and EN 15265-2007 standards [47].In addition, several studies have supported choosing IDA ICE.Previous studies [48] have introduced the detailed simulation model and its validation, and [49] ascertained that the computational models give reasonable values compared to other software programs such as TRNSYS.IDA ICE has been implemented in the simulation of basic thermal calculations, infiltration and ventilation etc., to test its accuracy [50].
This study considered the stratification of the building-level thermal storage.It was simplified to a one-dimensional tank model [51] Figure 7 shows the outdoor temperatures of the heating season from October 2021 to April 2022 in Espoo, Finland.Hourly weather data were collected from the Finnish Meteorological Institute [54].The minimum outdoor temperature was −19.8 • C in January.

Demand Response Control Algorithms and Energy Flexibility
This section includes five main parts.According to the simulation process shown in Figure 4, firstly, the control signals were defined to determine the temperature setpoints of space heating and the storage tank.After that, the demand response algorithms of space heating and the storage tank are described separately in Sections 3.2 and 3.3.The approach to control both space heating and the storage tank for demand response is explained in Section 3.3.Section 3.4 proposes energy flexibility factors.Section 3.5 lists the simulated cases.

Demand Response Control Signals
The hourly district heat price that was defined in Section 2.2.3 was used for the building-level DR to control the indoor air or the storage tank temperature setpoints.It assumed that the moving future 24-h price was known.The control signals (CS) were formed in Equation (3).They were determined according to the Behrang-Sirén method [53].The price trend was defined as decreasing, increasing, and flat, with control signal values −1, +1, and 0. The marginal values affect the sensitivity of the control signals.The lower the marginal value is, the more charging actions there are.The details can be seen in the ref.[39].A marginal value of 15 €/MWh was selected in this study.where HEP is hourly energy (district heat) price, €/MWh; HEP +1+24 avr is the moving future 24 h district heat price, €/MWh.Table 7 lists the average district heat price for each price trend.The average price of discharging is 57.1 €/MWh, with an increasing price trend.For a decreasing trend, the average price for charging is 94.4 €/MWh.

Demand Response Control Algorithms and Energy Flexibility
This section includes five main parts.According to the simulation process shown in Figure 4, firstly, the control signals were defined to determine the temperature setpoints of space heating and the storage tank.After that, the demand response algorithms of space heating and the storage tank are described separately in Sections 3.2 and 3.3.The approach to control both space heating and the storage tank for demand response is explained in Section 3.3.Section 3.4 proposes energy flexibility factors.Section 3.5 lists the simulated cases.

Demand Response Control Signals
The hourly district heat price that was defined in Section 2.2.3 was used for the building-level DR to control the indoor air or the storage tank temperature setpoints.It assumed that the moving future 24-h price was known.The control signals (CS) were formed in Equation (3).They were determined according to the Behrang-Sirén method [53].The price trend was defined as decreasing, increasing, and flat, with control signal values −1, +1, and 0. The marginal values affect the sensitivity of the control signals.The lower the marginal value is, the more charging actions there are.The details can be seen in the ref.[39].A marginal value of 15 €/MWh was selected in this study.
Table 7 lists the average district heat price for each price trend.The average price of discharging is 57.1 €/MWh, with an increasing price trend.For a decreasing trend, the average price for charging is 94.4 €/MWh.

Demand Response Control Algorithm of Space Heating
Figure 8 describes the control algorithm for the demand response control of space heating.The hourly indoor air temperatures were controlled by the space heating system.When the price trend was decreasing, the indoor air temperature was set to the minimum indoor air temperature setpoint (T SH, min , 20 • C).The normal indoor air temperature setpoint (T SH, norm , 21 • C) was employed when the price trend was flat, and the maximum indoor air temperature setpoint (T SH, max , 23 • C) was selected for the increasing price trend.Therefore, the space heating mass flow to the water radiators was adjusted based on these setpoints.To prevent overheating, T limit, out was set as 0 • C according to Martin's study [55].
Buildings 2023, 13, x FOR PEER REVIEW 13 of 24 air temperature setpoint (TSH, min, 20 °C).The normal indoor air temperature setpoint (TSH, norm, 21 °C ) was employed when the price trend was flat, and the maximum indoor air temperature setpoint (TSH, max, 23 °C ) was selected for the increasing price trend.Therefore, the space heating mass flow to the water radiators was adjusted based on these setpoints.
To prevent overheating, Tlimit, out was set as 0 °C according to Martin's study [55].

Demand Response Control Algorithm for the Thermal Storage Tank
Figure 9 presents the demand response control algorithm for the building-level storage tank.When the district heat price was decreasing, the tank temperature dropped to the minimum tank temperature setpoint (TTES, min), 55 °C .It is the lowest temperature to guarantee that the layer 8 water temperature is always high enough for the DHW supply.The normal tank temperature setpoint (TTES, norm), 60 °C was maintained when the price trend was flat.During the increasing price-trend period, the maximum tank temperature setpoint (TTES, max) was set as 90 °C .It is equal to the maximum DH supply temperature (Figure 5).This is the highest temperature that the storage tank can reach.However, the amount of energy that could be charged to the tank was limited by the maximum allowed DH return water temperature.The prerequisite was that it never exceeded 43 °C .There were two sensors (T1 and T2, see Figure 6) that measured the tank temperature and the primary DH return water temperature.When the measured return water temperature was below 43 °C and the measured tank temperature was lower than the setpoint, a signal was sent to the primary DH pump to increase the mass flow as much as possible until it reached the upper limit.The maximum mass flow was 0.48 kg/s.This was the mass flow when the heating power was the highest, 113.2 kW.When the measured return water temperature was above 43 °C or the measured tank water temperature exceeded the setpoint, the pump received a new signal to decrease the mass flow to avoid additional heat to the tank.
These two algorithms were utilized simultaneously to control both the space heating and the storage tank for demand response.Additionally, the peak power-limiting potential provided by the storage tank was examined.It was realized by limiting the DH supply water mass flow.

Demand Response Control Algorithm for the Thermal Storage Tank
Figure 9 presents the demand response control algorithm for the building-level storage tank.When the district heat price was decreasing, the tank temperature dropped to the minimum tank temperature setpoint (T TES, min ), 55 • C. It is the lowest temperature to guarantee that the layer 8 water temperature is always high enough for the DHW supply.The normal tank temperature setpoint (T TES, norm ), 60 • C was maintained when the price trend was flat.During the increasing price-trend period, the maximum tank temperature setpoint (T TES, max ) was set as 90 • C. It is equal to the maximum DH supply temperature (Figure 5).This is the highest temperature that the storage tank can reach.However, the amount of energy that could be charged to the tank was limited by the maximum allowed DH return water temperature.The prerequisite was that it never exceeded 43 • C.There were two sensors (T1 and T2, see Figure 6) that measured the tank temperature and the primary DH return water temperature.When the measured return water temperature was below 43 • C and the measured tank temperature was lower than the setpoint, a signal was sent to the primary DH pump to increase the mass flow as much as possible until it reached the upper limit.The maximum mass flow was 0.48 kg/s.This was the mass flow when the heating power was the highest, 113.2 kW.When the measured return water temperature was above 43 • C or the measured tank water temperature exceeded the setpoint, the pump received a new signal to decrease the mass flow to avoid additional heat to the tank.

Energy Flexibility Factors
Equations ( 4) and ( 5) describe the energy flexibility factors [39].They were defined to describe the proportion of charged or discharged energy during the simulated period.A higher FF + or a lower FF − indicates a more flexible building.
where FF + is the ratio of charged energy during the simulated period compared with a reference case without demand response; τ is the hours of the simulation period, h; Pcharging is the heating power with demand response charging actions, kW; Pref is the hourly heating power without demand response, kW; Pdischarging is the heating power with demand response discharging actions, kW; FF − is the ratio of discharged energy.

Description of Simulated Cases
Simulated cases are listed in Table 8.There are three reference cases, of which the first two have constant indoor air temperature setpoints of 21 °C and 20 °C without the storage tank (substation 1).The third reference case has a constant tank temperature setpoint of 55 °C (Ref.ST_55) and was simulated using the layout of substation 2.
Regarding different demand response cases, DR-SH is the case that only employed the demand response control of space heating without a storage tank (substation 1), and DR-ST was simulated to only employ the demand response control of the building-level thermal storage tank (substation 2) at a constant indoor air temperature setpoint, 21 °C .Subsequently, peak power limiting was utilized in the case DR-ST-PL.Finally, the These two algorithms were utilized simultaneously to control both the space heating and the storage tank for demand response.Additionally, the peak power-limiting potential provided by the storage tank was examined.It was realized by limiting the DH supply water mass flow.

Energy Flexibility Factors
Equations ( 4) and ( 5) describe the energy flexibility factors [39].They were defined to describe the proportion of charged or discharged energy during the simulated period.A higher FF + or a lower FF − indicates a more flexible building.
where FF + is the ratio of charged energy during the simulated period compared with a reference case without demand response; τ is the hours of the simulation period, h; P charging is the heating power with demand response charging actions, kW; P ref is the hourly heating power without demand response, kW; P discharging is the heating power with demand response discharging actions, kW; FF − is the ratio of discharged energy.

Description of Simulated Cases
Simulated cases are listed in Table 8.There are three reference cases, of which the first two have constant indoor air temperature setpoints of 21 • C and 20 • C without the storage tank (substation 1).The third reference case has a constant tank temperature setpoint of 55 • C (Ref.ST_55) and was simulated using the layout of substation 2. Regarding different demand response cases, DR-SH is the case that only employed the demand response control of space heating without a storage tank (substation 1), and DR-ST was simulated to only employ the demand response control of the building-level thermal storage tank (substation 2) at a constant indoor air temperature setpoint, 21 • C. Subsequently, peak power limiting was utilized in the case DR-ST-PL.Finally, the demand response control of space heating and thermal storage tank was combined with (DR-SH-ST-PL) and without (DR-SH-ST) peak power limiting.

Results
The results section is divided into four parts.Section 4.1 studies the variation of heat energy consumption, district heat energy cost, and power fee following demand response and peak power limiting.Section 4.2 investigates their effects on energy flexibility.Section 4.3 examines indoor air temperature changes and thermal comfort.Section 4.4 first analyzes the impacts of demand response and peak power limiting on DHW.Subsequently, it shows the tank temperature changes resulting from demand response control.demand response control of space heating and thermal storage tank was combined with (DR-SH-ST-PL) and without (DR-SH-ST) peak power limiting.

Results
The results section is divided into four parts.Section 4.1 studies the variation of heat energy consumption, district heat energy cost, and power fee following demand response and peak power limiting.Section 4.2 investigates their effects on energy flexibility.Section 4.3 examines indoor air temperature changes and thermal comfort.Section 4.4 first analyzes the impacts of demand response and peak power limiting on DHW.Subsequently, it shows the tank temperature changes resulting from demand response control.Table 9 collects the maximum DH heating power demand, heat energy consumption, district heat energy cost, power fee, and total district heat cost of simulated cases during the heating season.The district heat energy cost and the power fee were calculated based on the district heat prices (see Figure 2) and Equation (2), separately.The total cost is the sum of the district heat energy cost and the power fee.The difference of each part compared with Ref. 21 is also listed in the table.Table 9 collects the maximum DH heating power demand, heat energy consumption, district heat energy cost, power fee, and total district heat cost of simulated cases during the heating season.The district heat energy cost and the power fee were calculated based on the district heat prices (see Figure 2) and Equation (2), separately.The total cost is the sum of the district heat energy cost and the power fee.The difference of each part compared with Ref. 21 is also listed in the table.Decreasing the indoor air temperature setpoint by 1 • C (Ref.20) reduces peak power and saves heat energy consumption and district heat energy cost by about 6%.The demand response control case for space heating (DR-SH) cuts the district heat energy cost by 9.6% compared with Ref. 21.In addition, the indoor temperatures were not always 20 • C in the demand response cases, as they were in Ref. 20.Excluding the cost caused by the indoor air temperature decrease (6.2%, see Ref. 20), there were net savings of 3.4% by demand response.

Heat Energy Consumption, Costs, and Power Fee
Compared with Ref. 21, the demand response control of the building-level storage tank (DR-ST) saves 3.4% of the district heat energy cost.Although, compared with Ref. ST-55, it cuts an additional 2% of the district heat energy cost, and the maximum heating power increases with a higher power fee.However, this was mitigated when peak power limiting was utilized in DR-ST-PL.The maximum heating power is limited to 64.2 kW, which means that only 57% of the peak heating power (compared with the dimensioning power, 113.2 kW) is allowed to be used for heat supply.With a sacrifice of only 0.4% of the district heat energy cost, the power fee is cut by 41.2%, and the total cost savings are 18.7%.The power fee decreases from 8257 € to 4863 €.In addition, it illustrates that peak power limiting has almost no impact on savings by the demand response control of the storage tank.
It shows that the demand response control of space heating (DR-SH) cuts heat energy consumption by 1.4%.The total discharging hours during the simulated period was four times more than the number of charging hours (see Table 10).Therefore, the reduction was caused by decreasing the indoor air temperature setpoint to 20 • C for discharging.However, the demand response control for the building-level storage tank (DR-ST) increases consumption by 1.9%.Different from the demand response control of space heating, the indoor air temperature setpoints remain the same as with the reference cases (Ref.21 and Ref. .Changing the tank temperature setpoints from 55 • C to 60 • C or even higher for charging actions causes more heat losses.When employing the demand response control of both space heating and the storage tank (DR-SH-ST), it results in the highest district heat energy cost savings, 12.8%.After the application of peaking power limiting (DR-SH-ST-PL), although there is a compromise in the district heat energy cost savings (from 12.8% to 9.4%), the power fee is reduced by 41.2%.Therefore, the highest total cost savings are 22.4%.

Energy Flexibility
Table 10 collects the number of hours taken up by the setpoints of space heating and the building-level storage tank during the heating season.The hours of indoor air temperature setpoints for charging are about half of the hours to charge the storage tank.The reason is that there was the limiting outdoor temperature to avoid overheating for the demand response control of space heating (see Figure 8).Therefore, it causes the number of hours of indoor air temperature setpoints at 20 • C to be four times higher than that at 23 • C.Moreover, there are 1073 charging hours for the demand response control of the storage tank.The total discharging hours during the simulated period are more than twice the number of charging hours.
Table 11 lists the energy flexibility factors.Since the total discharging hours during the simulated period were four times more numerous than that of the charging hours, more energy was discharged by the demand response of space heating (DR-SH).In addition, its FF + value is higher than that of the demand response of the building-level storage tank (DR-ST) because of the larger storage capacity.The reason for a lower FF − value of the case DR-ST is the same.Since the maximum tank charging setpoint was 90 • C while there was only a 5 • C of temperature drop for discharging actions (from the normal setpoint 60 • C to 55 • C), the amount of discharging energy was less than that of charging with the demand response of the storage tank (DR-ST).FF + increases to 19.0% when applying the demand response control of both space heating and the storage tank (DR-SH-ST).Meanwhile, the FF − decreases to 19.3%.Thus, it becomes more flexible.Peak power limiting sightly limits the energy flexibility of the demand response control of the storage tank (DR-ST-PL).However, when it was employed in DR-SH-ST-PL, with the demand response control of space heating and the storage tank, the FF + value decreases by 6.5%, and the FF − factor is cut by 3.4%.

Indoor Air Temperature and Ventilation Conditions
Table 12 collects the number of hours and degree hours below 20 • C and 21 • C during the heating season of the office building's coldest room.It is a meeting room that has the lowest minimum indoor air temperature compared to the other rooms.For Ref. 20, there are 126 h (2.5%) when the indoor air temperature is below 20 • C. For DR-SH, DR-SH-ST, and DR-SH-ST-PL, which used the demand response control of space heating, there are only six or seven hours when the indoor air temperature is under 20 • C.There are only one or two degree hours.
Discharging actions in the demand response control of space heating (DR-SH) increases the number of hours of indoor air temperatures below 21  Discharging actions in the demand response control of space heating (DR-SH) increases the number of hours of indoor air temperatures below 21 °C.Oppositely, the demand response control of the storage tank (DR-ST) slightly reduces the number of hours when the indoor air temperatures are below 21 °C because the indoor air temperature setpoint in DR-ST was the same with Ref. 21, 21 °C.Only the tank temperature setpoint increased for charging.After peak power limiting (DR-ST-PL, DR-SH-ST-PL), there are more hours when the indoor air temperature drops below 21 °C.
Figure 11 presents the heating season duration of indoor air temperatures of the office building's coldest room.The minimum temperature is 19.5 °C for the coldest room of Ref. 20. Occupants stay in a lower indoor air temperature longer in Ref. 20 than in other cases.For DR-SH, DR-SH-ST, and DR-SH-ST-PL, where DR control of space heating was used, the difference to the minimum temperature to 20 °C is negligible.For the other cases, the indoor temperatures are within the acceptable range (Section 2.3).It also indicates that peak power limiting effectively reduces peak power without compromising thermal comfort.In addition, the ventilation supply air temperature was always maintained at 18 °C, which means that peak power limiting worked without sacrificing the heat supply to the ventilation system.

DHW Temperature and Tank Temperature
Figure 12 describes the DHW outlet temperature duration curves during the heating season when TES was installed (see Figure 6).The DHW outlet water would then be mixed with the cold city water to meet the required DHW temperature.C is negligible.For the other cases, the indoor temperatures are within the acceptable range (Section 2.3).It also indicates that peak power limiting effectively reduces peak power without compromising thermal comfort.In addition, the ventilation supply air temperature was always maintained at 18 • C, which means that peak power limiting worked without sacrificing the heat supply to the ventilation system.

DHW Temperature and Tank Temperature
Figure 12 describes the DHW outlet temperature duration curves during the heating season when TES was installed (see Figure 6).The DHW outlet water would then be mixed with the cold city water to meet the required DHW temperature.
The minimum DHW outlet temperature for the case with the demand response control of the building-level storage tank and peak power limiting (DR-ST-PL) is 58.9 • C.Only for the case with additional DR control of space heating (DR-SH-ST-PL) is the DHW outlet temperature lower than 58 • C (recommended design DHW temperature, Section 2.3.2).The minimum temperature is 49.5 • C and there are 30 h (0.6%) when the DHW outlet temperature is below 58 • C.This happened within the five coldest days during working hours when the minimum outdoor temperature was lower than −15 • C. Since peak power has been limited, there was a lack of heat supply when there demand response charging actions for space heating occurred during these days.The minimum DHW outlet temperature for the case with the demand response control of the building-level storage tank and peak power limiting (DR-ST-PL) is 58.9 °C.Only for the case with additional DR control of space heating (DR-SH-ST-PL) is the DHW outlet temperature lower than 58 °C (recommended design DHW temperature, Section 2.3.2).The minimum temperature is 49.5 °C and there are 30 h (0.6%) when the DHW outlet temperature is below 58 °C.This happened within the five coldest days during working hours when the minimum outdoor temperature was lower than −15 °C.Since peak power has been limited, there was a lack of heat supply when there demand response charging actions for space heating occurred during these days.
Figure 13 shows the tank temperature of each layer and the return water temperature for the coldest week for DR-ST.During charging actions with increasing price trend, +1, the tank temperature reaches about 85 °C.It is nearly fully mixed at the end of the charging period.When the price trend is flat or decreasing, 0 or −1, a clear stratification of each layer temperature can be seen.There were two heat exchangers described in Figure 6 to decrease the tank outlet temperature from layer 1.The return water temperature was regained after the heat exchange.There was a sensor installed to limit the return water temperature level (below 43 °C) during charging periods.The figure shows that the control strategy works well to prohibit overheating.The minimum DHW outlet temperature for the case with the demand response control of the building-level storage tank and peak power limiting (DR-ST-PL) is 58.9 °C.Only for the case with additional DR control of space heating (DR-SH-ST-PL) is the DHW outlet temperature lower than 58 °C (recommended design DHW temperature, Section 2.3.2).The minimum temperature is 49.5 °C and there are 30 h (0.6%) when the DHW outlet temperature is below 58 °C.This happened within the five coldest days during working hours when the minimum outdoor temperature was lower than −15 °C.Since peak power has been limited, there was a lack of heat supply when there demand response charging actions for space heating occurred during these days.
Figure 13 shows the tank temperature of each layer and the return water temperature for the coldest week for DR-ST.During charging actions with increasing price trend, +1, the tank temperature reaches about 85 °C.It is nearly fully mixed at the end of the charging period.When the price trend is flat or decreasing, 0 or −1, a clear stratification of each layer temperature can be seen.There were two heat exchangers described in Figure 6 to decrease the tank outlet temperature from layer 1.The return water temperature was regained after the heat exchange.There was a sensor installed to limit the return water temperature level (below 43 °C) during charging periods.The figure shows that the control strategy works well to prohibit overheating.During charging actions with increasing price trend, +1, the tank temperature reaches about 85 • C. It is nearly fully mixed at the end of the charging period.When the price trend is flat or decreasing, 0 or −1, a clear stratification of each layer temperature can be seen.There were two heat exchangers described in Figure 6 to decrease the tank outlet temperature from layer 1.The return water temperature was regained after the heat exchange.There was a sensor installed to limit the return water temperature level (below 43 • C) during charging periods.The figure shows that the control strategy works well to prohibit overheating.

Discussion
Flexible buildings in DH networks are significant for the integration of more renewable energies to achieve carbon neutrality.The results of this study indicate that the demand response control of a thermal storage tank and space heating could effectively decrease DH energy costs.In addition, the application of a thermal storage tank could greatly increase the peak power-limiting potential of a building and drastically decrease the power fee paid by building owners.These could be an incentive for consumers to behave more actively.
Large-scale demand response control application and peak power limiting could also be beneficial for DH producers.It could result in more profits, less CO 2 emissions, and improve DH systems' performance.Peak power limiting decreases the need for total generation capacity so that pipes would transport less power from plants to substations.Moreover, pipe sizes could also be reduced for transportation from plants to substations.In addition, since peak power limiting by building-level storage tanks cuts the peak power demand, additional consumers could be added to a DH network.Therefore, DH companies could earn more benefits from new customers and reduce the expenses for new or replaced generators.However, the investment costs required by the thermal storage tank, heat exchangers, and related electronic radiator valves were not taken into account.Therefore, the investment and life cycle costs should be investigated in future analysis.
The building-level storage tank size, sensor locations, and the inlet and outlet height all affect the actual charging capacity for demand response.The change of each factor will finally increase or decrease the heat stored during charging actions so that DH cost savings vary.Thus, a cost-optimal solution needs to be developed in further studies.
In this study, 43 • C was chosen according to the Finnish guideline [45] as the maximum allowed return water temperature of DH.However, it could be different based on the standards of other countries.For example, it could be lower than 40 • C if the supply water temperature is 70 • C [56] as in Germany.The demand response control for the building-level storage tank needs to be adjusted to different standards because the amount of energy that can be charged to the tank is limited by the maximum allowed DH return water temperature.
Related to the health of DHW supply and usage, legionella multiplies in water at temperatures between 25 • C and 45 • C.There is an exponential increase in bacterial sterilization occurring above 49 • C [21].When the stored DHW temperature is 50 • C, 90% of legionella bacteria die in 10-124 When the stored DHW temperature is at 60 • C, 90% of legionella bacteria die in two minutes [57].According to the Finnish guidelines [45], the DHW temperature leaving the heating device is recommended to be at least 58 • C. The minimum building-level storage tank temperature setpoint and the peak power limiting level were determined to guarantee that the lowest DHW outlet temperature was 58 • C. For DR-SH-ST-PL, the minimum DHW outlet temperature was 49.5 • C. Thus, one solution is not to employ the demand response control of space heating for colder days when the minimum daily outdoor temperature was lower than −15 • C.However, for example, in Denmark, the tap water temperature can be 45 • C [20].Thus, the temperature setpoint, control strategy, and the peak power-limiting need to be adjusted to different standards.
The building-level storage tank reacted quicker with demand response actions because of less storage capacity compared to the office building's thermal mass.It indicates that when the length of the charging or discharging periods is short, like three or six hours, the demand response of the storage tank performs better.When the charging or discharging periods are longer, the demand response of space heating can take advantage of the price characteristics optimally.In addition, the normal tank temperature setpoint at 60 • C was selected in this study so that there was a 5 • C drop when discharging.It is an adjustable setpoint.There will be a higher temperature difference for the discharging action when increasing it.However, more heat consumption could be needed with more heat losses.A further study could be developed to investigate the relationship between the demand response benefits of a thermal storage tank and changing the normal temperature setpoint.
In this study, radiators were selected for space heating supply.The demand response control of space heating by floor heating gained more cost savings than that by radiators, according to a study by Alimohammadisagvand et al. [58].The reason is that floor heating can take advantage of a building's thermal mass storage more optimally.Therefore, the demand response control algorithm of space heating proposed in this study might be even more beneficial with floor heating.
The results are related to a specific building type with similar climate conditions and price characteristics as the ones analyzed for DH production mixes in this study.However, the demand response control algorithms for space heating and the storage tank are general and could be applied in any building types with different climate conditions and prices.The energy flexibility gained is specific for the analyzed office building.It could vary based on building type.

Conclusions
In this study, a DH network of the Finnish city of Espoo was modeled to define dynamic district heat prices.The benefits of the two demand response control approaches for a Finnish office building, the demand response control of space heating and the buildinglevel storage tank, were evaluated by comparing them to each other and utilizing them together.A new demand response control strategy was designed to make the most of the storage tank capacity considering dynamic energy prices, variable DH supply water temperatures, and the district heating maximum allowed return water temperature.Detailed conclusions are listed below: The demand response control of space heating and the thermal storage tank are both beneficial.When employing the demand response control for space heating and the storage tank simultaneously, 12.8% district heat energy cost savings are attained.
In addition, the results indicate that thermal energy storage provides more potential for peak power limiting.The maximum heating power decreases by 43% and the power fee reduces by 41.1%.Employing the demand response control of both space heating and the thermal storage tank with peak power limiting results in the highest total cost savings, 22.3%.Moreover, according to indoor air and ventilation supply air temperatures, peak power limiting effectively reduces peak power without compromising thermal comfort and ventilation heat supply.
The demand response control of space heating provides more energy flexibility than that of the storage tank because of the larger storage capacity.It becomes more flexible when applying the demand response control of both space heating and the storage tank.Peak power limiting slightly limits the energy flexibility by the demand response control of the storage tank.
The analysis of indoor air temperatures shows that, even for the coldest room of the office building, the demand response control strategies meet the thermal comfort requirement.Therefore, demand response control strategies can be applied without sacrificing the thermal comfort of the building.
Demand response control strategies need to be adjusted according to the DHW supply temperature standard.The minimum DHW supply temperature was 49.5 • C when the demand response control of space heating and the building-level storage tank was utilized with peak power limiting.This happened within the five coldest days during working hours when the minimum outdoor temperature was lower than −15 • C.
Funding: This study is part of FINEST Twins.The FINEST Twins project is funded by the European Union (Horizon 2020 Programme, Grant No. 856602) and the Estonian government.The contributions of Pauli Hiltunen and Sanna Syri are funded by Finnish Academy project ICA-ICT for Climate Action, grant number 342123.

Data Availability Statement:
The data presented in this study are shown in the publication.

Figure 1 .
Figure 1.Description of the simulation process.

Figure 1 .
Figure 1.Description of the simulation process.

Figure 2 .
Figure 2. Dynamic district heat price with VAT 24% during the heating season.

Figure 2 .
Figure 2. Dynamic district heat price with VAT 24% during the heating season.

Figure 3 .
Figure 3. Flow chart of the building-level simulation process.

Figure 3 .
Figure 3. Flow chart of the building-level simulation process.

Figure 4 .
Figure 4. Original system connection and design temperatures (substation 1).The design temperatures were set according to the Finnish guidelines[45] and applied to substation 2. Therefore, the maximum and minimum supply temperatures of DH were 90 • C and 70 • C. 43 • C was set as the maximum allowed DH return water temperature.The maximum space heating supply temperature was 45 • C, and the return water temperature was 20 • C. For the ventilation systems, the supply and return water temperatures were 35 • C and 20 • C. 58 • C is the recommended DHW temperature leaving from the heating device to the building[45], and in the whole building DHW system, the water temperature must be at least 55 • C[22].Figure5describes the way in which the supply water temperatures of DH and space heating changed with outdoor temperatures.They were also applied for substation 2. When the outside temperature was 10 • C, the heating was turned off.The layout of substation 2 is shown in Figure6.A 5 m 3 hot water storage tank with a total height of 2.2 m was installed for building-level demand response.There was one temperature sensor (T1) located at the height of 1.2 m from the bottom to measure the water temperature.There was another sensor (T2) to measure the primary side DH return water temperature.

Figure 5 .
Figure 5. (a) Inlet water temperatures for district heating (DH) changed with outdoor temperatures; (b) Inlet water temperatures for space heating (SH) changed with outdoor temperatures.

Figure 5 . 24 Figure 6 .
Figure 5. (a) Inlet water temperatures for district heating (DH) changed with outdoor temperatures; (b) Inlet water temperatures for space heating (SH) changed with outdoor temperatures.Buildings 2023, 13, x FOR PEER REVIEW 11 of 24 et al. [52].Alimohammadisagvand et al. have validated the

Figure 6 .
Figure 6.System connection and design temperatures with a storage tank and two return water heat exchangers (substation 2).
. A detailed model introduction of the tank has been shown in Ju et al. [52].Alimohammadisagvand et al. have validated the accuracy of the stratified IDA ICE storage tank model [53].

Figure 7 .
Figure 7. Outdoor temperatures in Espoo, Finland during the heating season.

Figure 8 .
Figure 8. Demand response control algorithm for space heating.

Figure 8 .
Figure 8. Demand response control algorithm for space heating.

Figure 9 .
Figure 9. Demand response control algorithm for the storage tank.

Figure 9 .
Figure 9. Demand response control algorithm for the storage tank.

Figure 10
Figure 10 shows the hourly heating power of the office building reference case (Ref.21) during the heating season.It includes the hourly heating demand of space heating, ventilation, and DHW.The maximum heating power is 113.2 kW.

Figure 10
Figure 10 shows the hourly heating power of the office building reference case (Ref.21) during the heating season.It includes the hourly heating demand of space heating, ventilation, and DHW.The maximum heating power is 113.2 kW.Table9collects the maximum DH heating power demand, heat energy consumption, district heat energy cost, power fee, and total district heat cost of simulated cases during the heating season.The district heat energy cost and the power fee were calculated based on the district heat prices (see Figure2) and Equation (2), separately.The total cost is the sum of the district heat energy cost and the power fee.The difference of each part compared with Ref. 21 is also listed in the table.

Figure 10 .
Figure 10.Delivered heating power during the heating season of reference case Ref. 21.Figure 10.Delivered heating power during the heating season of reference case Ref. 21.

Figure 10 .
Figure 10.Delivered heating power during the heating season of reference case Ref. 21.Figure 10.Delivered heating power during the heating season of reference case Ref. 21.
• C. Oppositely, the demand response control of the storage tank (DR-ST) slightly reduces the number of hours when the indoor air temperatures are below 21 • C because the indoor air temperature setpoint in DR-ST was the same with Ref. 21, 21 • C.Only the tank temperature setpoint increased for charging.After peak power limiting (DR-ST-PL, DR-SH-ST-PL), there are more hours when the indoor air temperature drops below 21 • C.

Figure 11 .
Figure 11.Duration curves of indoor air temperatures during the heating season.

Figure 11 .
Figure 11.Duration curves of indoor air temperatures during the heating season.The minimum temperature is 19.5 • C for the coldest room of Ref. 20. Occupants stay in a lower indoor air temperature longer in Ref. 20 than in other cases.For DR-SH, DR-SH-ST, and DR-SH-ST-PL, where DR control of space heating was used, the difference to the minimum temperature to 20• C is negligible.For the other cases, the indoor temperatures are within the acceptable range (Section 2.3).It also indicates that peak power limiting effectively reduces peak power without compromising thermal comfort.In addition, the ventilation supply air temperature was always maintained at 18 • C, which means that peak power limiting worked without sacrificing the heat supply to the ventilation system.

Figure 13 .
Figure 13.Tank temperature of each layer and the return water temperature for the coldest week.

Figure 13
Figure13shows the tank temperature of each layer and the return water temperature for the coldest week for DR-ST.

Figure 13 .
Figure 13.Tank temperature of each layer and the return water temperature for the coldest week.

Figure 13 .
Figure 13.Tank temperature of each layer and the return water temperature for the coldest week.

Table 2 .
The list of production units and their technical parameters.

Table 5 .
Properties of the simulated office building.
with 65% heat recovery for office rooms and hallway 0.35-1.5 L/s, m2

Table 7 .
Average district heat price of each price trend.

Table 7 .
Average district heat price of each price trend.

Table 8 .
Simulated cases.This setpoint represents the highest temperature that the storage tank can reach.

Table 8 .
Simulated cases.This setpoint represents the highest temperature that the storage tank can reach. 1

Table 9 .
Maximum heating power, heat consumption, district heat energy cost, power fee, and total district heat cost of simulated cases.

Table 10 .
The number of hours taken up by the setpoints of space heating and the building-level storage tank.

Table 12 .
The number of hours and degree hours below 20 • C and 21 • C during the heating season.Figure 11 presents the heating season duration of indoor air temperatures of the office building's coldest room.