Building hvac retrofitting using a pv assisted dc heat pump coupled with a pcm heat battery and optimal control algorithm

. In the last years, the EU and scientific community put a lot of effort in trying to increase the sustainability in renovated buildings by introducing novel concepts and technologies. This paper presents the outcomes of a retrofit case study carried out within the Heat4Cool H2020 project concerning space heating (SH) and domestic hot water (DHW) systems. The case study is a multi-family residential building located in Chorzow, Poland, where the SH and DHW are provided by natural gas boilers present in each apartment. The proposed approach is to combine the existing gas boilers with phase change material storages (PCM) and a direct current air source heat pump (DC-EHP) assisted by a photovoltaic system (PV) connected to the grid. TRNSYS was used for the dynamic simulations, and to support the introduction of the retrofit layout. New custom TRNSYS’ types were developed for each technology and tested against experimental data provided by industrial partners. Furthermore, a state-of-the-art rule-based controller was developed combining TRNSYS with a MATLAB’s script and tested against an interior point optimal control algorithm. In the best-case scenario the yearly primary energy savings are more than 30% accounting for the PV energy sold to the grid and around 11% considering only self-consumption, while the pay-back time is around 10 years considering EU28 economic conditions and 20% overall discount for the renovation project.


Introduction
Residential and commercial buildings account for around 40% of the total primary energy in the EU [1], 76% of which goes towards the Heating, Ventilation and Air Conditioning system (HVAC). The built environment represents most of the building stock in Europe and given the decreasing trend of new building permits, building retrofit is key to reduce the overall building sector energy consumption [2]. In fact, among the Horizon 2020 initiatives incentivized by the EU to promote a low carbon economy, building renovation was taken into consideration. This paper presents the outcomes of a study carried out within the Heat4Cool [3] H2020 project. The Heat4Cool project aims to tackle this problem by proposing an innovative, efficient and cost-effective solution to optimize the integration of a set of renewable and energy efficient systems in the retrofit of space heating (SH) and domestic hot water (DHW) system. The chosen case study for this article is a multi-family residential building located in Chorzow, Poland, where the SH and DHW are currently mainly provided by natural gas boilers present in each apartment. The proposed approach is to combine the existing gas boilers with a centralized phase change material storage (PCM) and direct current air source heat pump (DC-EHP) assisted by a photovoltaic field (PV) connected to the grid. Starting from the building energy audit, a dynamic model of the building was derived. Afterwards, to support the introduction of this specific HVAC retrofit, new custom TRNSYS [4] types were developed for each technology and tested against experimental data provided by industrial partners. Furthermore, a state-of-the-art heuristic-rule-based controller (HRBC) was developed combining TRNSYS with a MATLAB's script and tested against a model predictive controller (MPC) using the optimal control interface Imperial College London Optimal Control Software (ICLOCS) [5] based on the engine Interior Point OPTimizer (IPOPT) [6]. Several dynamic simulations were carried out varying: a) the size of the photovoltaic system from zero to the maximum available surface (around 26 kWp); b) the amount of PCM considering a 40 kWh and 90 kWh storage; c) the PCM melting temperature considering a 34 °C and a 49 °C solution; d) the control logic of the DC heat pump by considering two operating modes depending on the PV production and energy needs. The objective of the work is to demonstrate that the introduction of these technologies in the building retrofit will reduce the primary energy consumption and CO2 emissions of the building, while having a reasonable payback time and accounting for the demand flexibility that is introduced by distributed energy systems [7]. The main obstacle when dealing with building retrofit is the integration of the new technologies with the existing systems and building infrastructure, which can lead to very high installation costs. This is true especially for conventional sensible heat thermal storages, which can be bulky and difficult to install inside the building. The proposed PCM solution instead having by its nature a higher energy density thanks to the latent heat and its modularity is easier to install.

Methodology
The first step in the retrofit of the specific case study consists in identifying the suitable technologies among the array available technologies in the Heat4Cool project. Given the climatic conditions in Chorzow the chosen retrofit layout consists of a centralized PV assisted DC-EHP coupled with a PCM thermal storage for DHW and a boiler for DHW and SH purposes in each apartment shown in Fig. 1.

Figure 1 Retrofit layout scheme
To allow the simulation and parametric study of this layout multiple TRNSYS types were developed and the overall TRNSYS model was coupled with a control algorithm developed in MATLAB.

Modelling
A total of seven TRNSYS types were developed starting from the pilot site audit, datasheets and experimental data provided by the industrial partners. A standard TRNSYS type was used for modelling the components in the overall system that do not have a specific subsection here, such as, the PV system (Type 103), the pumps (Type 114), the thermostats (Type 166) and low-level controllers.

Building model
A detailed mathematical model of the building was developed using the TRNSYS Type 56 building model. However, the use of the Type 56 results in a very long simulation time because the time step must be under 20 (s) to properly simulate all the components, which is around the time constant of the temperature variation in the PCM. Therefore, starting from the results of the Type 56 model a grey-box Resistance-Capacity (RC) circuit analogy model for three sample apartments was derived to allow faster simulations for the parametric analysis using MATLAB's parameter identification toolbox. Each apartment is split in three temperature nodes, one for the external walls, one for the internal air and one for the floor; to each node is associated a thermal capacity and all the nodes are connected by thermal resistances, for a detailed explanation of the model [8]. Furthermore, heat transfer between the apartments was considered by creating an intrazonal type that takes into consideration the temperature difference as shown in the equation 1.
Where (Qij) is the heat transfer between the i and j apartments, (UAij) is the overall heat transfer coefficient between the apartments, (Ti) and (Tj) are the temperatures in the apartments. In Fig. 2 is reported the comparison between the monthly energy needs taken from energy audit, TRNSYS-Type56 and the simplified RC model.

Figure 2 Monthly Space Heating demand comparison Energy Bills vs TRNSYS-56 vs TRNSYS-RC
Summarizing the figure above, the simulation results have a 11% yearly difference for space heating energy needs with a total consumption for space heating of 93 583 kWh for the energy bills and 103 700 kWh for the simulation using TRNSYS-RC model.

PCM model
Starting from manufacturer data the model for the PCM storage was developed as TRNSYS type. In order to account for temperature distributions, the heat exchanger was divided in ten temperature nodes as shown in Eq. (4) represents the dynamic energy balance for each water node in the heat exchanger, while eq. (5) is the dynamic energy balance for the PCM material. The PCM (Cp) is a function of time and space, meaning that it changes depending on the PCM temperature and current state of charge to simulate the phase change of the material.
Comparing the results of the simulation against the experimental data of discharge test for 900 s with a time step of 1 s the coefficient of determination R2=0.99 with an average temperature difference of on the temperature of the water inside the thermal storage ΔT=0.0136 (°C) with a maximum ΔT=1 (°C), the maximum happens at the end of the discharge test, and it due to the fact that the considered model is one-dimensional, while in reality some of the PCM material far from the heat exchanger pipes will still be in phase changing, this leads to a higher water temperature at the outlet. It is worth mentioning that the discharge test and model was derived from a PCM with a melting temperature of 58 °C. A more detailed description of the PCM heat battery is available in [9].

DC-EHP and Gas Boiler
Starting from data available in the datasheet, a model based on performance maps was developed for the air-towater electrical heat pump. The maps contain the values of rated heating power (Q) transferred to the fluid and power consumption (P) in function of the fluid outlet temperature (Tw.out) and external air temperature. In Fig.  4 is reported the coefficient of performance (COP), which is the ratio between (Q) and (P).

Figure 4 COP for different values of External air temperature and Tw,out
The model also accounts for the transient operation of the DC-EHP by considering the delivered (Q) and (P) as dynamic states, while it has been neglected the effect of partial load operation on the COP under the assumption that the DC-EHP nominal power is lower than the average heat rate demand. For the boilers it was used an average constant efficiency η=0.85 calculated using gross heating value (GHV) taken from the energy audit of the building.

Piping and valves
Specific TRNSYS types were developed to account for the distribution heat losses in the piping system. Each pipe is considered as a thermal node and the heat transfer coefficients to the environment are estimated given the geometrical, physical properties of the pipe, the indoor temperature, the fluid properties and velocity.

Climate and schedules
Two days were chosen starting from typical year Meteonorm weather data available for the near city Katowice, the reason behind this choice is the computational burden of having a small time step to properly simulate the temperature variation in the PCM. Considering just two days month the overall simulation time is around 3 hours.  Each month was divided into two groups of days by taking the average temperature and radiation as discriminant, then the values of the first day were taken as the average of the external temperature and radiation below the monthly average (Tmin,Gmin), while the second day is the average of the group of days above the monthly average (Tmax,Gmax). The typical year weather data used for the simulations are shown in  Since only two days were considered for each month, the building temperature may not have enough time to decrease especially when passing from Summer to Autumn, thus changing the real energy needs for the month. However, this was taken into account and the simulation results were compared to energy audit data and detailed simulations in TRNSYS using the whole typical year and Type 56 building model. For the heating schedule a survey was conducted in the pilot site leading to the profile shown in Fig. 9. For the DHW demand, the profile was taken from the Polish regulation and is shown in  The daily amount of water draw for a three people household is 200 l for a total energy consumption of around 12 kWh considering that the water is heated from 10°C to 60°C.

Control approach
To ensure a proper control of this complex system two control layers are present to run the simulation on TRNSYS, a high-level control based on a heuristic rulebased controller (HRBC) using a MATLAB's script and low-level controls based on TRNSYS type 166 thermostat.
The high-level HRBC mainly governs the heat pump system and its circulating pumps. There are two operating modes: i) preheat the water in the heat exchanger that will go to the boiler and in the radiators, in this mode the heat pump is used at nominal capacity and the on-off operation is determined by the predetermined set-point temperatures of the thermostat in each apartment derived from MPC; ii) the second mode uses the heat pump in the central hours of the day to exploit the photovoltaic production to charge the PCM storages at partial load to maximize the heat pump efficiency and the share of photovoltaic used. The boiler controller for SH is a thermostat with a climatic curve, while a differential controller controls the boiler and PCM storage outputs to satisfy DHW demand.
To properly tune the heuristic rule-based controller (HRBC), a deterministic model predictive controller (MPC) was developed in MATLAB environment using the ICLOCS [5] interface and IPOPT [6] solver. A schematic of the MPC is reported in Fig. 7.The MPC algorithm exploits forecasts of weather, apartment temperature set-points, occupancy profiles and energy prices to estimate the best operation of the hybrid heating system from an economic standpoint of view [10]. The output of the MPC is the on-off and temperature set-point operation of the DC-EHP to minimize the economic expenses while ensuring thermal comfort inside the building. However, since the MPC time step is 20 seconds a post-processing component has been added to smooth the DC-EHP control signal, to account for the DC-EHP internal time constant. Therefore, there is a need for a postprocessing phase to reduce the switching frequency.

Figure 7 Simulation with Model Predictive Controller layout
The postprocessed output was used to determine the rules behind the HRBC described at the beginning of the section, in Fig. 8 is reported an example of the DC-EHP operation for one winter day comparing the control  strategy of the MPC against the derived HRBC by looking at the electric power absorbed by the DC-EHP.

Figure 8 Electric power DC-EHP, MPC (solid lines) vs RBC (dotted lines), for SH (black) and PCM charging (blue)
From Fig. 8 the two operating modes of the DC-EHP are clear and there is only a slight hourly shift between the HRBC and the MPC apart from the spike at the beginning of charging the PCM due to the prediction of the MPC of DHW load and therefore the DC-EHP is used at nominal power, this is further supported by the average performance of the DC-EHP COP and the operating cost of the SH and DHW system as shown in Table 1. In terms of average COP for the heating season, the MPC and HRBC performance are similar (3.12 vs 3.15), and also the economic savings with respect to the Baseline (10% vs 12%), which is the system before the retrofit considering the gas boilers, are similar. The reason behind these savings are due to the very small cost of natural gas reported in Table 4 and the assumption that the old boilers still work with their nominal efficiency (0.85). Comparing the two controllers from a comfort perspective we can look at Fig. 9. The performance in terms of comfort is very close between the two cases because it is governed by the thermostat regulating the gas boiler with a climatic line shown in Table 2.

Text (°C) Tset-boiler (°C) -25
65 0 50 20 20 identical for MPC and RBC. In conclusion the overall performance of the heuristic HRBC is close to the one of the MPC controller and from now on the HRBC will be used for the simulations for computational time purposes.

Results
In this section is discussed the thermal performance of the retrofitted HVAC system, the size of the DC-EHP was pre-determined from the manufacturer as a 36-kW thermal peak power unit, while the boilers are already present in the building, therefore most of the simulated scenarios regard the size, the melting temperature and the control of the PCM storage: -two PCM heat batteries sizes 40 kWh and 90 kWh, two PCM melting temperatures 34 °C and 49 °C; -two control modes to charge the PCM heat battery using the heat pump changing the setpoint temperature, the first mode the DC-EHP is used at partial load (pl) while in the second mode is used almost at full load (fl) capacity.
In Table 3 are reported the simulation tags according to the considered specific scenario.

Thermal performance
In Chorzow only heating is necessary, in Fig. 10 the yearly heat generation for space heating (SH) and domestic hot water purposes (DHW) comparing the air source heat pump (DC-EHP) and the gas fired boiler (B) is shown. The overall heat provided by the retrofitted HVAC system is always slightly higher than the baseline due to PCM heat battery losses and distribution losses along the piping of the central HP.
Looking at Q_SH in the bar chart the HP always provides less than half of the total heating demand. This is not just due to the DC-EHP being under-sized with respect to the peak power demand of the building, namely 90 kW, but to the fact that the climate in Chorzow is too cold for the heat pump to reach the needed setpoint in the climatic curve. Therefore, the DC-EHP can only preheat the space heating water.
In the PCM34 simulations the HP can provide a higher share of space heating (up to 47%) and this is since it takes longer for the PCM49 to charge during the central hours of the day, when the heat pump works best because the external temperature is higher. The opposite happens for the share of DHW which is higher for the PCM49 (up to 79%). The share of DHW is also influenced by the melting temperature and the size of the PCM heat battery, and the control approach chosen.
To better evaluate the performance of the DC-EHP, in the Fig. 11 is shown the yearly average COP, accounting for different thermal losses and the yearly average temperature of the PCM heat battery for all the simulation scenarios. Indeed, COP(1) is calculated considering only HP fan, compressor and control, while COP(2) considers all HP auxiliaries and distribution thermal losses, lastly COP(3) considers also the PCM storage thermal losses.

Figure 11
On the left Y-axis yearly average COP(*), on the right Y-axis the yearly average PCM temperature (°C) and on the X-axis the different simulation scenarios The average overall COP(1) does not have a significant variation by changing the PCM melting point temperature, the size and the control approach, since the biggest contribution of the HP is the SH which is similar for all the simulation scenarios. By considering the COP(1) for just DHW the PCM34 has an average COP 5% higher with respect to the PCM49 case due to the higher working temperature of the HP to charge the PCM49 as shown in the right y-axis of the chart. Moreover, also the control at Tmax affects the COP due to higher working temperature. In fact, the PCM34 COP drops by an additional 5%, while it does not affect as much the PCM49 because the working temperature is already high. Lastly, also due to higher working temperatures the PCM and distribution losses are higher in the PCM49 case bringing down COP(3) by 12% respect COP(1) considering that the distribution system is properly insulated. This drop in COP is not surprising since having a higher setpoint temperature for an air source HP in a cold environment such as the one in Chorzow is very penalizing. The thermal performance of the different simulation scenarios and subsequent analysis indicate that the adoption of the PCM49 and Tmax control strategy allows to increase the use share of the heat pump and potentially increasing the self-consumption of the PV system with respect to the PCM34 and Tmin scenario. However, this strategy comes at the cost of a lower COP of the HP when charging the PCM storage, which increases the HP consumption cancelling the beneficial effect of increased PV self-consumption. To have a final answer on which is the best alternative, a cost-benefit analysis is needed.

Cost benefit analysis
To compare the results of the retrofitted layout configurations and the baseline, a set of performance indicators is considered: i) primary energy savings, ii) avoided of CO2 emissions and iii) Pay Back Time (PBT) and Net Present Value (NPV), which is one of the standard approaches as shown in [11]. In Table 4 are reported the parameters used for the techno-economic analysis. To estimate the economic parameters the data was taken from Eurostat website and industrial partners. However, it is worth mentioning that c_el and c_ng were taken from the trend of EU28 dataset and not from Poland alone, because the Polish government is increasing its attention towards environmental issues that together with normal economic growth will bring the cost of energy closer to the EU28 scenario. The feed_in tariff was calculated based on Polish regulation which allows owners of PV plants below 40 kW to detract from energy bills up to 70% of the PV yearly overproduction, which is sent in the power grid, under that assumption that the electrical consumption throughout the year is higher than 70% of the PV energy overproduction, this equals to say that the feed_in tariff correspond to 70% of the c_el. From these parameters and the simulation results, the NPV and PBT for each simulation scenario could be calculated

Photovoltaic sizing
The first step considered was the PV power plant sizing, which is independent from the SH and DHW needs as the Heuristic Rule Based Controller (HRBC) does not uses the PV as input to control the overall system. Both in the worst-case scenario for PV self-consumption, namely PCM34_40_Tmin and the best-case scenario PCM49_90_Tmax, the lowest PBT and highest NPV are achieved when the maximum amount of PV modules is installed, for a total of 26 kW. This happens because both in the Polish and EU28 economic conditions the feed_in tariff is high enough to incentives the installation of a PV system without considering the retrofit technologies.

KPI analysis
Using the Polish economic conditions, the retrofit does not repay itself within its lifetime, estimated at 25 years. This is due to the very low cost of natural gas and electricity being produced mostly using coal power plants. Considering instead the EU28 economic scenario, the KPIs analysis is more encouraging, especially under the assumption that the technologies employed are novel, therefore a 20% discount on the overall investment cost was considered to account for production cost optimization and that the boilers have a lower efficiency than the nominal one reported in the datasheet after years operation equal to around 0.75. In Fig 12 the  Figure 12 KPI analysis, on Y-axis is shown the PBT, on Xaxis is shown the final NPV for the system lifetime of 25 years.
The red scenarios are for PCM49 while the blue are for PCM34, the discounted case is green and the dimension of the balls shows the primary energy savings with respect to the baseline only accounting for PV self-consumption.
In terms of PBT and NPV the PCM34 overall outperforms the PCM49, because as shown in Fig 11, it is charged at lower temperatures allowing a more efficient use of the DC-EHP. Furthermore, PV-self consumption is not incentivized given the high feed-in tariff on selling the electricity generated by the PV system. The same logic can be applied to the PCM size and control strategy, because the higher the size the higher the PV selfconsumption but also the investment cost and charging the PCM material at nominal power using the DC-EHP "Tmax", allows a higher PV self-consumption at the expense of a lower COP. In conclusion taking a look at Fig 12 the best overall solution accounting for all the KPIs is the PCM storage with a melting temperature of 34 °C with a storage size of 90 kWh and charging It using the DC-EHP at partial load , namely in simulation tag PCM34_90_Tmin, which is also considered for the discounted analysis.

Conclusions
The TRNSYS models for the Heat4Cool retrofit solution proposed were developed and tested against experimental data provided by industrial partners. From the dynamic simulations resulted that in a cold climate such as Chorzow the heat pump alone cannot provide all the space heating and domestic hot water demand, therefore it should be coupled with an auxiliary system.
For the same reason the PCM34 resulted in a better choice with respect to the PCM49, since it has lower working temperatures, meaning a higher COP for the heat pump.
The sizing of the PCM is highly dependent on the existing feed-in tariffs for PV systems, the higher the feed-in tariff the smaller should be the PCM heat battery and vice versa depending on the economy of scale.
The control of the heat pump plays a key role, therefore the control system used should either be a tailored rulebased controller or a predictive controller, to maximize the efficiency and prevent failure of the system. The best configuration found is: 90 kWh PCM storage with a melting temperature of 34 °C, charging cycle using the DC-EHP at partial load, maximum number of PV panels on the roof available space. Indeed, it leads to an 11% primary energy savings considering only selfconsumption, while more than 50% considering also the green electricity produced by the PV and exported. Given the current economic conditions in Poland, the retrofit invest would not be able to repay itself within the life time of 25 years. However, by guessing that Poland will reach the EU28 economic conditions the best Payback time becomes 10 years.