1 Introduction

Deceleration of climate change is currently a driving force for many global actions [1]. One of them is energy management of buildings, the role of which is emphasized in the countries having a long and cold heating season [2]. In principle we a dealing with a simple issue: in order to reach the climate goals the source of energy should be renewable, and its consumption needs to be minimized [3]. However, in practice the situation gets often quite complex. We may have several sources of energy, the degree of renewability typically varies and, in addition, renewables typically fluctuate. When we are targeting some set point temperatures of indoor air and domestic water, we typically have several operational options. Naturally we also need to include the price of energy, which may often be time-dependent. And furthermore, in addition to the price of energy, during the following years we will probably have a separate price also for power, at least in Finland [4]. These open new possibilities for demand response, peak shaving and energy storages [5, 6].

Smart Case NZEB (Nearly Zero-Energy Buildings) is a Finnish-German joint project that aimed to find optimized solutions for energy management of buildings. In this project, battery energy storage and heat pump integrated latent heat storage had important roles in energy management. Finnish partner in the project was Tampere University of Applied Sciences [7] and the corresponding German partner was Munich University of Applied Sciences [8]. The project was funded by Business Finland and Federal Ministry of Economics and Technology of Germany.

Energy management of buildings is a complicated task that requires sophisticated numerical modelling software. An example of such a software is IDA ICE, which was used to carry out the main modelling in the project [9]. In addition, we needed a simple and reliable model to simulate the effects of new energy solutions, such as electric and thermal energy storages, in existing buildings. Hence, the computational model presented in this paper was created. The implementation of the model was carried out in Matlab, but no special computational features are required [10]. In other words, any spreadsheet program will offer necessary features to implement the model.

2 Computational model

The starting point for modelling is an existing building with well-known energy consumption profile. This data is required, since it is utilized to calibrate the simple heat balance based model. Thus, convective heat transfer coefficients will be adjusted such that computed energy consumptions match with the measured ones as a function of outdoor temperature. With this calibrated model, the effects of new energy solutions, such as heat pumps, solar energy systems and electric and thermal energy storages, can be modelled quite simply and reliably.

2.1 Heat balance based core of the model

Due to simplicity, target building is modelled as parallelepiped object. Although the real geometry of the building is omitted, it is essentially important that real areas and volumes are included. Thus, inner volume of the building has to match with the real one, as well as the areas of walls and rooftop. Then, the heat balance equations of closed volumes (Fig. 1) are written for indoor air and walls of the building

$${P}_{\text{i}\text{n}}+{P}_{\text{g}1}={P}_{12}+{P}_{\text{s}\text{t}1},$$
(1)
$${P}_{12}+{P}_{\text{g}2}={P}_{\text{o}\text{u}\text{t}}+{P}_{\text{s}\text{t}2}.$$
(2)

Symbol P stands for heat power, and subscripts in, g, out and st refer to incoming, generated, outgoing and stored, respectively. Furthermore, \({P}_{12}\) models the heat transfer from indoor air to walls. As presented in Fig. 1, heating of the building is modelled with \({P}_{\text{i}\text{n}}.\) In addition, \({P}_{\text{g}1}\) represents for example a fireplace or another additional source of heat. \({P}_{\text{s}\text{t}1}\) and \({P}_{\text{s}\text{t}2}\) model the power of energy storage in indoor air and walls, respectively. Heat transfer from indoor air to walls (\({P}_{12}\)) and from walls to outdoors (\({P}_{\text{o}\text{u}\text{t}}\)) is modelled as convection. As lumped parameter model is used, spatial variation of temperatures is omitted. Thus, temperatures of indoor air and walls are assumed to vary only as a function of time [11].

Fig. 1
figure 1

Principle of simple heat balance based model

When Eqs. (1) and (2) are written out assuming \({P}_{\text{g}1}\) = \({P}_{\text{g}2}\) = 0 W, we get

$${P}_{\text{i}\text{n}}={h}_{1}{A}_{\text{i}\text{n}\text{n}\text{e}\text{r}\text{w}\text{a}\text{l}\text{l}}\left({T}_{1}{-T}_{2}\right)+{\rho }_{1}{C}_{\text{m}1}{V}_{1}\frac{{dT}_{1}}{dt},$$
(3)
$${h}_{1}{A}_{\text{i}\text{n}\text{n}\text{e}\text{r}\text{w}\text{a}\text{l}\text{l}}\left({T}_{1}{-T}_{2}\right)={h}_{2}{A}_{\text{o}\text{u}\text{t}\text{e}\text{r}\text{w}\text{a}\text{l}\text{l}}\left({T}_{2}{-T}_{\text{o}\text{u}\text{t}}\right)+{\rho }_{2}{C}_{\text{m}2}{V}_{2}\frac{{dT}_{2}}{dt}.$$
(4)

Here subscripts 1 and 2 refer to indoor air and walls, respectively. In addition, \(h\), \(A\) and \(T\) are convective heat transfer coefficient, area of convection and temperature, respectively. The terms of heat storage have also been written out with \(\rho\), \({C}_{\text{m}}\) and \(V\) referring to density, mass-related heat capacity and volume, respectively.

In order to have time derivatives of temperatures for numerical model, they were solved from Eqs. (3) and (4) as

$$\frac{{dT}_{1}}{dt}=\frac{{P}_{\text{i}\text{n}}-{h}_{1}{A}_{\text{i}\text{n}\text{n}\text{e}\text{r}\text{w}\text{a}\text{l}\text{l}}\left({T}_{1}{-T}_{2}\right)}{{\rho }_{1}{C}_{\text{m}1}{V}_{1}},$$
(5)
$$\frac{{dT}_{2}}{dt}=\frac{{h}_{1}{A}_{\text{i}\text{n}\text{n}\text{e}\text{r}\text{w}\text{a}\text{l}\text{l}}\left({T}_{1}{-T}_{2}\right)-{h}_{2}{A}_{\text{o}\text{u}\text{t}\text{e}\text{r}\text{w}\text{a}\text{l}\text{l}}\left({T}_{2}{-T}_{\text{o}\text{u}\text{t}}\right)}{{\rho }_{2}{C}_{\text{m}2}{V}_{2}}.$$
(6)

Now, starting from some initial values (\({T}_{1}\left(0\right),{T}_{2}\left(0\right)\)) equilibrium temperatures corresponding to certain heat transfer flows can be iteratively calculated from

$${T}_{1}(t+\varDelta t)={T}_{1}\left(t\right)+\frac{{dT}_{1}}{dt}\bullet \varDelta t,$$
(7)
$${T}_{2}(t+\varDelta t)={T}_{2}\left(t\right)+\frac{{dT}_{2}}{dt}\bullet \varDelta t.$$
(8)

In practice, we set a target temperature for indoor air. Then, as outdoor temperature is known, we iteratively search for such \({P}_{\text{i}\text{n}}\) that results in desired temperature of indoor air.

2.2 Calibration of model to match the measured data

Next, the model presented in Sect. 2.1 is calibrated with measured data. Therefore, electric energy consumption profile of the existing building is required. The idea is to adjust the coefficients of the model such that simulated results equal with the measured ones. The symbols in Eqs. (5) and (6) are quite distinct physical quantities, but much uncertainty is included in the values of convective heat transfer coefficient \(h\). Consequently, \({h}_{1}\) and \({h}_{2}\) are used to calibrate the model. We aim to find such values for \({h}_{1}\) and \({h}_{2}\) that result in realistic value of \({P}_{\text{i}\text{n}}\) as a function of outdoor temperature. Sometimes additional information may also be required. For example, if fireplace is utilized for heating, its scheduling cannot necessarily be directly concluded from energy consumption profiles. In such cases, further details of additional heating are required to achieve reliable modelling results.

Once the calibration is completed, the model can be used to estimate the effects of new energy solutions. For example, if direct electric heating is replaced with some heat pump solution, it will be modelled with coefficient of performance (COP), which is defined as the quotient of delivered heating power and consumed electric power. With direct electric heating COP = 1, in which case consumed electric power equals \({P}_{\text{i}\text{n}}\). But if for example air source heat pump is installed, COP will vary between 1 and 5 depending on outdoor temperature. On the other hand, if photovoltaic system is installed, the produced power can be entered as free of charge portion of \({P}_{\text{i}\text{n}}\). And if electric and thermal energy storages are also included, they can be utilized for multiple purposes. For example, peak shaving of electric power taken from the grid or thermal power taken from the district heating network can be carried out with electric and thermal energy storages.

The presented model has its shortages, and consequently, there is no reason to claim that we would have built any physically accurate model. For example, simulated variations in the total heat demand as a function of outdoor temperature are excessive, since the dampening effects of the previous time step are omitted. Consequently, real power figures as a function of time are less saw-edged than the modelled ones. However, it has to be emphasized that we aimed for a simple and reliable model, which gives realistic power figures as long as the calibration with measured data has been carried out. Regardless of shortages, the calibrated model can be considered reliable, since its core is in the thermodynamic physical phenomena taking place in the background. As a result, the model cannot appropriately be used to simulate energy consumption of a new building from scratch. Instead, careful calibration with measured data is essentially important. But once properly calibrated, quick and reliable modelling results can be achieved.

3 Case study: target building of smart case NZEB project

The general view of the project’s target building is presented in Fig. 2. This building offers sports and fitness facilities for students and personnel, and its renovation was completed in 2016. From the project point of view this modern building offered a great test laboratory, since it has multiple energy sources and targets of consumption. Thermal and electric energy for the building are produced with ground-source heat pumps, solar heating system, photovoltaic system and district heating. Originally energy storage is accomplished with bore holes and water boilers, but during autumn 2021 also battery system (92 kWh, 184 kW) was installed. In addition, Munich University of Applied Sciences has been developing heat pump integrated latent heat storage (15 kWh) to enhance heat pump operation. In November 2021 the combination of a new ground-source heat pump and the latent heat storage system was installed in the target building. Figure 3 presents both the installed storages in their real environment of the target building.

Fig. 2
figure 2

General view of target building that offers sports facilities for students and personnel at Tampere University of Applied Sciences

Fig. 3
figure 3

92 kWh battery energy storage (left) and heat pump integrated 15 kWh latent heat storage (right) installed in target building at Tampere University of Technology

The overall horizontal dimensions of the building presented in Fig. 2 are about 54 × 49  m2.

The overall height is about 6.5 m, and the lower rooftop is about 3 m above the ground level. In the simplified model used in this paper, the target building was modelled as parallelepiped object having the same volume and areas of walls and rooftop as the real one.

After installing the new heat pump with integrated latent heat storage, the heating system of the target building is primarily based on altogether three ground-source heat pumps. They are mainly responsible for heating of domestic water, water-based floor heating and radiators, and also ventilation. The primary heat pump (9 kW thermal power) is connected to the thermal energy storage (15 kWh capacity), while the secondary ones (64 kW thermal power) only supply the loads. If the combined power of ground-source heat pumps is insufficient to reach target temperatures, district heating will be utilized to supply auxiliary power. Solar energy is also utilized in the target building. Solar heating system is connected to the water boilers of domestic and heating water, and in addition, 14 kWp photovoltaic system supplies electric energy to building’s power grid.

As a case study, the coefficients of convective heat transfer for the target building were calibrated by means of measured data of energy consumption. Then, simulations related to the utilization of electric and thermal energy storages were carried out.

3.1 Results of modelling

In the following, simulated energy behavior of the target building including electric and thermal energy storages is presented. In practice, both the storages (electric 92 kWh, thermal 15 kWh) will be used for peak shaving operation, which we wanted to simulate. The idea of electric peak shaving in this case is to limit the maximum grid power to 65 kW. If the battery has energy, it will be used to deliver the exceeding power. On the other hand, if the grid power is less than 65 kW and the battery’s state of charge differs from 100%, the battery will be charged with the difference power [12]. In addition, since also the peak shaving of district heating is interesting and relevant topic in Finland, in this study the latent heat storage is used to limit the maximum thermal power of district heating to 10 kW. In practice, the heat pump integrated latent heat storage will also have other roles than peak shaving in the energy management of the target building.

3.1.1 Electric behaviour

The simulated results of electric behaviour for one Finnish winter day are presented in Fig. 4. During this day, the outdoor temperature remains just below zero degrees centigrade (red curve). The consumption of electric power is presented with blue color. The solid blue curve represents the grid power with the peak shaving operation by means of the energy storage, whereas the blue dots represent the electric power without the battery. For example, during the first hours of the day the grid power (blue dots) would remain below 60 kW, but as the battery is charged, the grid power is raised to 65 kW. And when the capacity of battery reaches 92 kWh (green curve), the grid power decreases below 60 kW, since the battery is no longer charged. Battery power is presented with solid black curve. Positive and negative power refer to charging and discharging, respectively.

Fig. 4
figure 4

Simulated electric behaviour during typical Finnish winter day: outdoor temperature (red curve), battery power (black curve), battery energy (green curve) and grid power with (blue curve) and without (blue dots) battery are presented (colour figure online)

As can be seen from Fig. 4, high peaks of electric power take place during the evening. These are caused by the sauna stove having the nominal power of 26 kW. Peaks are produced by its operation, in which the electric power varies between 26 kW and zero during every other 15 min. As can be seen, total electric power exceeds 65 kW always when the sauna is on (blue dots). However, peaks are shaved to 65 kW by means of energy storage.

In order to further clarify the peak shaving operation of the battery system, another modelling of three consecutive Finnish winter days was carried out. Results are presented in Fig. 5. During the first day the outdoor temperature varies around − 8 °C, which is just enough to keep the grid power below 65 kW limit. Consequently, charging of battery is enabled until the sauna stove is switched on in the evening. During the second day the outdoor temperature decreases to around − 10 °C, and consequently, the heating related grid power occasionally exceeds 65 kW. As can be seen from the black curve, charging of the battery is still most of the time enabled, and the capacity reaches about 70 kWh, until the sauna stove is switched on in the second evening. After the stove is switched off, the capacity of battery has decreased to about 10 kWh. Then some charging still takes place, but as the outdoor temperature decreases to about − 12 °C during the third day, the heating related grid power mainly exceeds 65 kW preventing charging. Consequently, the battery is empty during the third day, and the peaks generated by the sauna stove cannot be shaved anymore. Thus, peak powers approaching 100 kW are taken from the grid during the evening of the third day.

Fig. 5
figure 5

Simulated electric behaviour for three consecutive winter days, where outdoor temperature decreases gradually from − 8 to − 12 °C. Colors correspond to same variables as in Fig. 3 (colour figure online)

3.1.2 Thermal behaviour

In order to clarify the operation of thermal energy storage, the simulation of thermal behaviour of the target building during two typical consecutive Finnish autumn days was carried out. In the simulated case the thermal energy storage was used for peak shaving of district heating. If the heat pumps (9 + 64 kW) are not able to fulfill the heat demand, district heating will be utilized. Thermal energy storage is used to limit the power taken from the district heating network to 10 kW. Thus, if the demand for district heating exceeds 10 kW, exceeding thermal power will be taken from the storage. However, the maximum charge and discharge power of the storage is 4 kW constraining the ability for peak shaving. Anyway, in suitable weather conditions having significant temperature differences between day and night-time the peak.

shaving of district heating can be carried out quite successfully. The modelling results of the thermal behaviour in such conditions are presented in Fig. 6.

Fig. 6
figure 6

Simulated thermal behaviour during two consecutive Finnish autumn days: outdoor temperature (red curve), total heat demand (black curve), power of secondary 64 kW (blue curve) and primary 9 kW heat pumps (violet curve), power of district heating (yellow curve) and energy (green curve) and power (green dots) of thermal energy storage (colour figure online)

During the midwinter in Finland it is quite typical that the daily variations of outdoor temperature remain modest. Thus, it is not uncommon that midday and midnight have nearly the same outdoor temperature, as was assumed in the simulations of Figs. 4 and 5. However, during autumn days the situation is different, since the temperature variation between night and day may easily approach 10 centigrade. Consequently, the outdoor temperature profile (red curve) presented in Fig. 6 was used in autumn simulations. As can be seen, in the first night the temperature is about 6 °C and increases to about 12 °C during the first afternoon before dropping again in the first evening. The second day has a similar profile, but a slight general cool down occurs. During the second day, the high and low are about 10 and 5 °C, respectively. The variation of outdoor temperature directly affects the total heat demand (black curve), as can be seen from Fig. 6. During the first night, the average of total heat demand is about 84 kW and decreases to about 46 kW during the first day. During a bit colder second day the corresponding values are about 90 and 58 kW. Due to quite high heat demand, the primary heat pump operates at its 9 kW nominal power all the time (violet curve). As the additional power comes from the secondary heat pumps, their thermal power (blue curve) can be seen to vary from the nominal 64 kW to about 35 kW during the first day. During slightly colder second day the minimum value for the power of secondary heat pumps is about 42 kW, as can be seen from Fig. 6. If the nominal power of the heat pumps (9 + 64 kW) exceeds the total heat demand, the thermal energy storage will be charged. The maximum power for charging and discharging is 4 kW.

When the total heat demand exceeds 73 kW, heat pumps are not anymore able to fulfill the demand. District heating is then utilized to deliver auxiliary power. However, by means of thermal energy storage we wanted to limit the power taken from the district heating network to 10 kW. This peak shaving operation is presented in Fig. 7, which is just a zoom of Fig. 6 in order to increase clarity. In the beginning of the first day the storage is assumed to be half full (7.5 kWh, green curve) and the goal of discharging the storage (negative green dots) is to limit the power of district heating (yellow curve) to 10 kW.

Fig. 7
figure 7

Simulated thermal behaviour during two Finnish autumn days: curves correspond to the same variables as in Fig. 5

As can be seen from Fig. 7, peak shaving is successful during the first day. Power of district heating is limited to 10 kW by discharging the thermal storage, and after 10 a.m. in the first day the increase of outdoor temperature ensures that the total heat demand can be entirely responded with the heat pumps. Then, charging of the storage begins, and the full capacity of 15 kWh is reached at about 1:30 p.m. During the evening the outdoor temperature decreases, and the storage is discharged again to limit the power of district heating. However, during the second night the peak shaving becomes unsuccessful, as can be seen from Fig. 7. As the outdoor temperature gets a bit colder, the discharging of storage results in zero capacity at about 4 a.m. (28 h in Fig. 6) in the second morning. Consequently, the power peaks of district heating approaching 20 kW emerge. Warming morning of the second day (from about 11 am, 35 h in Fig. 6) drops the district heating power again below 10 kW, which is soon followed by the charging of thermal energy storage. Peak shaving is again enabled, but as already shown, in these conditions the 15 kWh storage will not be able to limit the district heating power to 10 kW for the whole night. In order to enable the peak shaving for the whole night, the limit of allowed district heating power should be increased by a few kilowatts.

4 Discussion

In general, modelling of energy management of buildings is a complicated task requiring advanced numerical computational software. IDA ICE is an example of such a software. However, in order to have a method of comparison, in Smart Case NZEB project we needed an additional simple model to simulate the effects of new energy solutions in existing buildings. Hence, the computational model presented in this paper was created. In Smart Case NZEB project a detailed modelling was carried out with IDA ICE, which enabled a comparison between computational models. Some comparison was carried out and its results strengthened the following observation: once properly calibrated, the results of the simple model presented in this paper can be considered quite reliable, since its core is in the thermodynamic physical phenomena taking place in the background.

It is clear that some assumptions made in Sect. 2 for the presented model are not physically valid. For example, spatial independence of temperature in the walls of any building is clearly an invalid assumption. In addition, omitting of real geometries is another one. Furthermore, since the dampening effects of the previous time step are omitted, the real power figures as a function of time are less saw-edged than the modelled ones. However, since this model was mainly designed to support detailed IDA ICE modelling, simplicity and agility were its key targets. And regardless of somewhat bold assumptions, calibrated models give surprisingly reliable results as a function of outdoor temperature. Hence, we suggest that the results can be considered as reliable. In addition to the target building of Smart Case NZEB project presented in this paper, calibration was tested with two typical Finnish detached houses. The first one had direct electric heating, and another one was equipped with exhaust air heat pump system. After the heat transfer coefficients were calibrated based on measured consumption profiles, in both cases the modelling gave realistic results as a function of outdoor temperature. However, it seems that any generally applicable values for the heat transfer coefficients of the model cannot be given. Instead, they are clearly case-dependent and have to be adjusted individually for each modelled building. In practice this all means that the shortages of modelling accuracy are mainly hidden in the values of convective heat transfer coefficients. Since the thermodynamic behaviour of the simple model corresponds well to the real world, the shortages in modelling accuracy are mostly compensated by the calibrated values of convective heat transfer coefficients. However, it has to be emphasized that the role of the simple model was just to give quick results and support more detailed and time-consuming modelling. Thus, the simple model presented in this paper cannot be used to replace more detailed modelling.

The simple model presented in this paper is not inherently accurate enough to model the energy management of buildings from scratch. Instead, calibration based on measured consumption profiles is required to enable reliable modelling. After the calibration, the created model can be quite quickly and reliably utilized to simulate the effects of new energy solutions in existing buildings. Along with the calibration, reliability is based on realistic thermodynamic behaviour, which is inherent feature of the model initiating from the principle of heat balance in closed volume. In this paper, only technical aspects of utilizing energy storages in the energy management of buildings were investigated. No stand on economic profitability was taken.

5 Conclusion

Smart Case NZEB is a Finnish-German joint-project, which aimed to find optimized energy solutions for modern buildings. In the project, modelling and practical tests of new energy solutions were carried out in the sports building of Tampere University of Applied Sciences, which due to its versatile and modern energy solutions offers great test laboratory for investigations. During the project, battery energy storage was installed for peak shaving, and latent heat thermal energy storage developed by Munich University of Applied Sciences was installed to support the ground-source heat pumps. In the project, detailed energy management of the target building was carried out with IDA ICE. In addition, a simple and agile model was needed to support IDA ICE modelling. Consequently, the model presented in this paper was created.

The simple model presented in this paper is based on the principle of heat balance in closed volume. In order to achieve agility and simplicity of modelling, some unrealistic assumptions had to be made. For example, spatial variation of temperature in the walls of a building was omitted. Consequently, the model cannot be considered to be realistic enough to model energy management of a building from scratch. Instead, calibration of convective heat transfer coefficients is required based on the measured energy consumption profiles of the target building. However, based on the tests carried out for several existing buildings, the calibrated models give reliable results as a function of outdoor temperature. Thus, we suggest that the model presented in this paper can be quite quickly and reliably utilized to simulate the effects of new energy solutions in existing buildings.

In this paper it was shown how the model can be adopted to simulate the utilization of energy storages in peak shaving operation. In the project the battery system with the capacity of 92 kWh was installed to constrain the electric power taken from the grid to 65 kW. As presented in Sect. 3, the peaks in the target building are mainly generated by the sauna stove. As a result of modelling, the electric power taken from the grid can be constrained to 65 kW as long as external wintry conditions do not get too frosty. In addition, latent heat thermal energy storage developed by Munich University of Applied Sciences was simulated for peak shaving of district heating. According to results, peaks of district heating power can be shaved off by means of thermal energy storage, as long as power limit is chosen according to the total heat demand.

For future investigations, the simple model will be further developed to support IDA ICE simulations carried out in the project. And after gathering sufficient amount of real measured data of the installed energy equipment in different operating conditions, comparisons of measured and simulated results of the target building’s energy management will be of very high investigative interest.