A methodology for designing decentralised energy systems with predictive control for heat pumps and thermal storage

Decentralised energy systems provide the potential for adding energy system flexibility by separating demand/supply dynamics with demand side management and storage technologies. They also offer an opportunity for implementing technologies which enable sector coupling benefits, for example, heat pumps with controls set to use excess wind power generation. Gaps in this field relating to planninglevel modelling tools have previously been identified: thermal characteristic modelling for thermal storage and advanced options for control. This paper sets out a methodology for modelling decentralised energy systems including heat pumps and thermal storage with the aim of assisting planning-level design. The methodology steps consist of: 1) thermal and electrical demand and local resource assessment methods, 2) energy production models for wind turbines, PV panels, fuel generators, heat pumps, and fuel boilers, 3) bi-directional energy flow models for simple electrical storage, hot water tank thermal storage with thermal characteristics, and a grid-connection, 4) predictive control strategy minimising electricity cost using a 24-hour lookahead, and 5) modelling outputs. Contributions to the identified gaps are examined by analysing the sensible thermal storage model with thermal characteristics and the use of the predictive control. Future extensions and applications of the methodology are discussed.


Introduction
Decentralised energy systems locate the production of energy closer to electrical and heat demands, a shift from the traditionally centralised, fossil-fuel based power systems. They consist of generation, demand, and storage components which can be connected by private wire networks, virtually through the wider grid infrastructure or cloud platforms, and via district heating. The control of shifting demand and production is known as Demand Side Management (DSM) and is enabled by storage technologies such as electrochemical batteries, hot water tanks, hydrogen electrolysers, etc [1]. DSM capability provides an energy system with flexibility.

Heat pumps and thermal storage
Heat pumps are a decentralised technology which combine the electrical and thermal sectors. They efficiently use electricity and low-grade heat sources to provide useful heat, commonly for a single household for the purposes of hot water and space heating, while district heating and industrial applications also exist.
Previous studies have identified large-scale heat pumps for district heating as providing 25-30% of heat in future roadmaps for Europe [2] and concluded the technology is mature for deployment [3]. Heat pumps offer sector coupling benefits such as utilising excess wind power generation. The economic viability of large-scale heat pumps is dependent on local conditions, i.e. demand density and local electricity production, and grid dynamics, i.e. power prices and carbon intensities. When there are low power prices and high renewable power production is on the grid, electrical consumption with heat pumps can provide low-cost and low-carbon heat. Power prices, local demand and renewable production can be forecast meaning there is a role for predictive control strategies in design. A local system may also have existing renewable generation or fossil fuel infrastructure, such as the gas grid which covers large parts of the UK, available to utilise which influences energy technology choices.
Thermal storage can provide flexibility to an energy system with heat pumps by decoupling heat demand and electrical consumption. The value of thermal storage in literature has been reviewed [4] and several benefits identified: (i) enabling grid services such as frequency response and demand side response, (ii) shifting electricity consumption to low pricing with day/night tariffs and intra-day spot markets, (iii) increasing local generation self-consumption, (iv) plant optimisation (reducing generating size and increasing usage), and (v) enhancing service and resilience. The motivation for using district-scale thermal storage is from capital savings both due to scaling storage volume and in comparison to electrical storage costs [5].
Heat pumps and thermal storage can play a successful role as part of a decentralised system by providing sector coupling benefits and adding flexibility.

Review of modelling
Heat pump and thermal storage models have been developed in previous studies to perform sizing studies and plan operation using different controls. A model was developed and validated a model of a solar powered heat pump paired with a Phase Change Material (PCM) storage tank to investigate transient behaviour within the storage tank [6]. Ground and air source heat pumps coupled to thermal storage were simulated using TRNSYS to investigate sizing configurations to improve cost effectiveness and energy savings [7].
Predictive controls and non-predictive controls have also been studied. A finned PCM and heat pump model was developed to benefit from off-peak electricity tariffs by shifting heat pump production leading to reduced operational costs [8]. A rule-based controller was compared to a Model Predictive Control (MPC) finding that MPC is vital when sizing thermal storage for household application [9].
A tool selection process [10] for identifying planning-level tools which pass essential capability criteria for modelling community-scale energy systems was applied to a system with heat pumps and thermal storage plus wind turbines, PV, and a grid-connection. The study identified gaps in planning-level modelling tools in temperature dependence of thermal component modelling and the lack of the use of predictive controls. It is important that for design at the planning-level modelling of heat pumps and thermal storage is performed in enough detail such that benefits from sector coupling and added flexibility are captured.

Contribution of this work
This paper sets out a modelling methodology to aid planning-level design of decentralised energy systems with large-scale heat pumps and thermal storage for district heating. The structure consists of the following steps: 1) resource and demand assessment methods, 2) models for electrical and thermal production technologies, 3) models for battery storage and hot water tank thermal storage, 4) an electricity cost optimisation predictive control strategy, and 5) modelling outputs. The value in using temperature dependence for heat pump and thermal storage models and the predictive control, and extensions and applications of the methodology are discussed. The paper then ends with the conclusions.

Modelling framework
The steps of the modelling methodology are outlined in the following sections and an overview of the modelled technologies and energy flows is provided in Figure 1. The modelling framework showing the work flows of the methods and models is displayed in Figure 2.
The resource assessment method is used to feed weather conditions into the wind turbine, PV, hot water tank and heat pump models as well as the district heating demand predictor. The demand assessment method is used to develop the district heating demand predictor and the electrical demand. The renewable production is then subtracted from the electrical demand to produce an electrical deficit/surplus profile.
The district heating demand predictor, electrical deficit/surplus profile, auxiliary electrical production models, thermal production models, storage models, and a 24-hour electricity cost prediction are all fed into the predictive controller. The controller generates a 24-hour ahead operation schedule which ensures electrical and thermal demands are met and minimises electricity cost. The scheduled action is taken in that hour and in the following hour a new 24-hour ahead schedule is generated, and henceforth over a period of a design year.

Local resources
Assessing available historical data on local resources requires access to the necessary databases. For weather resources on an hourly basis local stations and reanalysis climate databases can be used to obtain datasets for several years. Typically, it is easier to access a greater number of year datasets from reanalysis databases than from weather stations (where often access requires payment). The website renewables.ninja [11] provide free and easy access to hourly data from the NASA MEERA reanalysis (worldwide) and CM-SAF SARAH (Europe) datasets. This includes direct and diffuse solar radiation, windspeed, air temperature, etc.
Data obtained from the MEERA reanalysis dataset is compared against local weather station data for the available years and calibration steps taken where necessary.

Electrical demand
Electrical demand profiles on an hourly timestep are generated using HOMER Pro software. This tool contains a module which allows the user to generate a profile based upon building types: residential, commercial, industrial and community. Choice of peak demand month accounts for seasonal variability, and a random variability parameter is used to include hourly and daily variability. The resultant hourly profile over a year can be scaled to match the building mix to be modelled by using CIBSE benchmarks [12] for different building types. The resultant profile is not a function of local weather conditions and therefore is fixed for any year. It could be adjusted to include an ambient temperature dependence to improve prediction.

District heating demand
Predicting heat demand is necessary to generate an hourly profile over a year and for use in a predictive control in order to provide predictions over lookahead periods. A review of existing, similar methods can be found in [13] which highlights the need for a simplified approach.
A method for generating hourly profile for the district heating demand of a residential scheme was developed using regression analysis of pre-simulated housing standard profiles, scaling based on floor area, and applying diversity using a normalised smoothing method. This method builds on work done in the development of the demand assessment method used in the Biomass Decision Support Tool [14] which generates a design day demand profile and an annual energy estimation. The described method uses simple inputs typically available at the planning-level design stage.
The flow diagram, Figure 3, shows the flow of this method. The steps below describe the method in more detail: 1. Buildings to be modelled are split into archetypes based upon the following ages and types. It is assumed that the age of the building indicates the building regulations applied during construction. Detailed building simulation models provide standard profiles for each age and type and are a function of a discrete (1°C step) range of outdoor temperatures and of hour of day (see [14] for floor areas, U-values, ventilation rates, and controls used in the detailed simulation). Regression models are applied to the standard profiles to predict demand as a function of hour of day and outdoor temperature.
To reduce the calculation speed the outdoor temperature parameter is discretised from a continuous input by round and sorting into bins sized to 0.01°C. 3. The standard profiles are linearly scaled according to floor area which is calculated from the user input number of bedrooms and then each of the building types are multiplied by the number of each type. 4. Diversity is applied by smoothing the demand in each hour across multiple hours using a normal distribution with the following standard deviation [14]: 5. Underground piping heat losses are calculated using industry standard pipe sizing software [15] which take the types, lengths and diameters of the different piping sections of the network, the design flow and return temperatures, and a design ambient temperature to calculate day heat loss. Using average ambient temperatures for each day of the design year the tool is used to calculate the heat loss every day of a year. This is uniformly distributed across each hour of that day and added to the diversified heat demand.
This results in a method for predicting demand for any hour of the design year as a function of outdoor temperature for use in the control strategy.

Production technologies models 4.1 Electrical production technologies
The electrical production technologies modelled are electrical generator, wind turbine and photovoltaics (PV). It is assumed that these local production units can directly meet the local electrical demand via a (virtual-) private wire network. An optional grid connection provides limitless import and export. Renewable electricity production technologies are modelled to analyse how they match with the electrical demand, in addition to investigating sector coupling by utilising local, zero marginal cost electricity production in heat pumps.
An electrical generator which transforms a fuel into electricity at a fixed efficiency is included as an auxiliary unit for times where the non-dispatchable renewable generation does not meet demand or there is no gridconnection.
Windpowerlib [16] is a Python library which contains functions and classes for calculating the power output from wind turbines and is used in this methodology. A choice between a user input wind curve and selecting from a database of power curves from different manufacturers is provided to simplify the input requirements of the user. Hub height and rotor diameter are the additional technical inputs. Local condition inputs are wind speed (including measurement height) and roughness length as mandatory, and pressure, air density, air temperature, and wind speeds at different heights as optional. The power produced in hourly timesteps is the output.
PV is modelled using the PVLIB Python library [17]. The model consists of a module and an optional inverter, and the power output is dependent on location inputs. A database for the module and inverter is used to input measured performance characteristics based on PVUSA test conditions. The surface azimuth, surface tilt, surrounding surface type, and a multiplier are also used to complete the technical model. PV location is defined by latitude, longitude, and altitude and local conditions by wind speed, air temperature and at least two of direct normal irradiance, diffuse normal irradiance, and global horizontal irradiance. The power produced in hourly timesteps is the output.

Heat pumps and auxiliary heat units
Thermal production technologies modelled are largescale heat pumps as primary units, and fuel boilers as auxiliary units (modelled as fixed efficiency for transforming fuel to heat). In this methodology these are used to provide hot water for use in district heating. Heat pumps are commonly modelled at the planning stage using simple energetic models which do not account for temperature dependent COP. Additionally, Figure 3. Flow diagram of district heating demand prediction method with user inputs in text bold available data for specific heat pumps is often limited and COP under one set of conditions is provided. This leads to an overestimation of seasonal performance.
The method set out is for modelling large-scale heat pumps (capacity > 100kW). Air source heat pumps (ASHP) require additional modelling consideration with respect to the defrost cycles which effect performance in temperature regions where freezing conditions are possible. Water source heat pumps (WSHP) are assumed to have a constant flow or limitless supply of ambient water, meaning that there is no degradation of the source temperature. Ground source heat pump (GSHP) models have been developed throughout literature [18] and these can be included in this methodology framework as future work.
General inputs required for the heat pump modelling are heat pump type (ASHP or WSHP), modelling approach, rated thermal capacity of the heat pump, the difference between the source in and out temperatures, operation mode (variable or fixed speed), auxiliary heat requirement (monovalent or bivalent), and data input type (peak performance if data does not include defrost cycling).
Three separate approaches for modelling ASHP and WSHP of increasing modelling detail and different input requirement can be used in the methodology. The first two approaches can be classified as steady-state as dynamic effects are ignored and the third as quasi-steady state as it includes a reduction in performance to account for dynamic effects without fully capturing them.
The first uses a generic regression performance map to form the COP as a function of flow temperature and ambient temperature. The following regression relations were obtained from [19] and are based upon surveys of industrial datasheets and field trials. While they were obtained for household-scale heat pump, the assumption is made that they are also applicable to large-scale heat pumps. For the COP of an air source heat pump (ASHP) where ∆ is the difference between flow temperature and ambient temperature is: = 6.81 − 0.121∆ + 0.000630∆ 2 15 ≤ ∆ ≤ 60 The same paper includes a regression function for a generic ground source heat pump (GSHP) and is included here as representative of a water source heat pump (WSHP) due to similar dynamics of the ambient sources: This approach is useful when quickly appraising heat pumps without data for a specific heat pump.
The second approach involves calculating a real COP based upon one set of operating conditions and then calculating the maximum COP (Lorentz efficiency) under the same operating conditions. The real COP divided by the Lorentz efficiency gives the heat pump efficiency. For each timestep the Lorentz efficiency for the conditions is calculated and then multiplied by the heat pump efficiency to give the modelled COP. The maximum thermal output in the given timestep is given by the input maximum electrical capacity multiplied by the modelled COP. This follows the same modelling approach as used in a standard industry modelling tool EnergyPRO EMD and the detailed equations can be found in the user manual [20]. This approach is useful with limited data (performance under a single operating condition), but likely leads to overestimation of performance in other operating conditions.
The third approach is based on multiple variable linear regression analysis using measured COP and duty (maximum thermal output) at a range of test conditions. Ambient temperature (Ta) and flow temperature (Tf) are used as the two independent variables. Coefficients for the following 2 nd degree polynomial functions for COP and duty are calculated automatically based on the input data. Predictions are made in each of the timesteps using these equations and the flow and ambient temperatures.
If the data input is at integrated performance, then cycling behaviour and dynamic effects are included in the testing. This should be the case if measurements are taken under standard test conditions according to EN14511 [21].
Part load effects on COP for variable speed heat pumps are neglected in all three modelling approaches.
This method is the most detailed of the three approaches and should yield realistic heat pump performance across a wider operational range. However, the necessary data is not always readily available. Using standard test conditions means that manufacturers should possess the necessary data and correspondence should be sought to obtain this data.

Storage models
Storage models for battery storage and hot water tanks are employed to investigate DSM strategies. Battery storage was chosen as it is currently the most commonly used form of electrical storage. Hot water tanks provide a cheap form of mid-term (from days to minutes) thermal storage, particularly when used at scale for district heating, and in comparison to battery storage.

Simple battery model
Electrical storage models have been developed in detail in previous studies and utilised in different tools [10]. In this methodology a simple battery model is used which captures the essential technical parameters which are capacity, initial state, max charging/discharging, efficiency charging/discharging, min/max state of charge, and self-discharge and are displayed in Figure 5.
Given the generic and simple nature of the model any electrical storage technology (flow batteries, lithium-ion batteries, lead-acid batteries, etc.) which operates on the appropriate timestep can be modelled with simplifying assumptions.
The stored energy Q at the time + ∆ can be expressed as (6) where ∆ is the timestep, is the charging efficiency, is the discharging efficiency, (∆ ) is the charging energy, (∆ ) is the discharging energy, (∆ ) is the self-discharge, is the max charging rate, is the max discharging rate, C is the capacity, and M is the minimum state of charge.

Hot water tank model
Gaps have been identified in modelling tools in representing the temperature dependence of thermal storage. In this methodology this has been addressed by utilising similar modelling methods to those implemented in detailed building design simulation such as TRNSYS.
The hot water tank is modelled as a cylinder which is vertically orientated with an outside shell of insulation. The tank is configured using a 4-port connection and the use of 5 temperature sensors, in accordance with CIBSE guidance [22] for district heating design.
The main characteristics [23] which require capturing in the modelling are: • Capacity per unit volume • Temperature range of operation • Means and power requirements of charging and discharging • Structural elements of tank • Control • Degree of stratification Physical processes of hot water tanks include: (i) heat losses through tank due to difference in internal temperature and external ambient temperature, (ii) conduction heat transfer in the water due to temperature differences at different layers, (iii) convective flows due to cooling of water at edge of tank resulting in density differences, (iv) buoyancy induced flows due to load temperature being lower than temperature of layer it is entering at, (v) entering fluid mixing with lower temperature water due to high flow rate (carrying kinetic energy), and (vi) recirculation of water from connections.
A selection process [24] was used to select a model to represent the stratification in the tank. The main selection decisions were to select a suitable model for simulating without data and a balance between accuracy and computational time. The multi-node model was chosen as it fits these criteria. In addition, due to the use of 5 temperature sensors a 5-node model was selected.
A detailed description of the multi-node model can be found in [23]. The final energy balance equation for node i contains terms for (i) heat loss between inside and ambient conditions outside of the tank, (ii) for mixing between nodes, (iii) charging energy function, and (iv) discharging energy function. Each term has an explicit node temperature dependence.
The ambient heat loss term, (i) above, in the energy balance equation is a function of the tank U-value (different insulation can be selected: polyurethane 0.02 W/mK, rockwool 0.045 W/mK, and glasswool 0.04 W/mK), tank surface area, specific heat of water, and the difference between the internal tank temperature and ambient temperature (if outdoors use outdoor temperature or if in plant room assumption of 15°C).
The multi-node model may over represent stratification of the tank but should be an improvement on the commonly used approaches such as fully mixed or moving boundary models.

Predictive control
Model predictive control (MPC) was chosen as the supervisory control strategy with the aim of minimising electricity cost.  . Configuration of 4-port connection between heat pump, thermal store, and heat network, modified [27] The controller generates a 24-hour ahead operation schedule which ensures electrical and thermal demands are met and minimises electricity cost. The scheduled action is taken in that hour and in the following hour a new 24-hour ahead schedule is generated, and henceforth over a period of a design year.
The main components of a MPC controller [25] are: (i) the objective function which is based on the main control goal and in this case is minimising electricity costs, (ii) the prediction horizon is the lookahead period which is optimised over, chosen to be 24 hours, (iii) the decision time step which is the interval between generating optimised schedules, chosen to be 1 hour, (iv) the manipulated variables which can be varied by the optimiser, chosen to be the heat pump thermal output, and hot water tank energy content and temperature at different nodes, (v) the optimisation algorithm which is applied in the optimisation process, (vi) the feedback signal which provides the necessary information on variables for next optimisation step, i.e. updates on predicted demands and renewable generation.
The MPC controller has capability of predicting the demands and renewable electricity production over the 24 hour lookahead by weather prediction and optimising operational schedules to minimise electricity costs. Nonpredictive controllers only consider the immediate system conditions when making operational decisions.
A day/night tariff can be input, and a representation of an intra-day spot market is made using historical data from the APX electricity spot market. This data can be extracted from the Elexon Portal [26].

Modelling outputs
It is important that modelling outputs reflect the value which can be obtained from the sector coupling enabled by heat pumps and the increased system flexibility introduced by thermal storage. Outputs from the modelling methodology are outlined in Table 1.

Discussion and Conclusions
The developed methodology described will be applied to case studies. For example: (i) an ecovillage of 50 mixed use buildings with existing wind turbines, PV, and micro-district heating looking at the technical requirements to decarbonise heating via installing heat pumps to utilise local wind generation and reduce export to the grid, and (ii) a housing cooperative of 550 flats with existing biomass district heating looking to investigate the economic feasibility of changing to heat pumps and thermal storage. Additionally, monitoring data obtained from these two sites will allow validation and calibration of the modelling methods.
The electrical demand method is independent of external conditions and could be improved by including an outdoor temperature dependence as with the district heating demand predictor. In applying diversity in the district heating demand method, the standard deviation used should be adjusted to reflect monitoring data obtained for UK district heating. More detailed modelling of the district heating network losses would allow better comparison of the effect on system performance of changes in flow and return temperature.
The most detailed heat pump model described is quasi-steady state where the dynamic effects are incorporated as a reduction in performance and part load conditions are neglected. For timesteps ≤10 minutes a dynamic model is needed to capture start-up characteristics. Part-load performance for large-scale heat pumps also needs further investigation.
Utilising temperature dependent models for the heat pumps and thermal storage should capture realistic performance. This is an improvement on the simple energetic models typically employed in planning-level design modelling tools.
A predictive control strategy based on MPC has been described with the objective of minimising electricity costs associated with the electrical demand and heat pump. Currently this has capability with day/night tariff and intra-day spot markets, and this should be extended to include provision of grid services such as frequency response and demand side response. Additionally, real forecast data for electricity prices and weather should be implemented along with uncertainties. In conclusion, a methodology for designing decentralised energy systems with predictive control for heat pumps and thermal storage has been outlined. It addresses previously identified modelling gaps and has application in a range of case studies to aid in planninglevel design to provide modelling for studies such as heat pump and thermal storage sizing, feasibility studies, and operation scheduling.