Keywords

1 Introduction

The Role of Hydrogen for Energy Storage

To reach the goals of reducing carbon dioxide emissions in Europe set out by the Paris Climate Agreement (keep global warming beneath 2 °C (United Nations Climate Change, 2020)) and the European Green Deal (no net greenhouse gas emissions in Europe until 2050 (European Commission, 2020)), hydrogen will play a significant role in the future energy system. If the installed power of highly fluctuating renewable power generators rises, the need to store surplus electrical energy is obvious. In addition to battery storage systems and pumped storage, the generation of green hydrogen via electrolysis will be essential.

Hydrogen is a versatile energy carrier, which could be used for several sectors:

  • Industry, for instance, steel production.

  • Mobility, such as fuel cell vehicles or further processed to liquid hydrocarbons (Fischer–Tropsch synthesis).

  • Residential and commercial buildings, for instance, combined heat and power generation with stationary fuel cells.

In June 2020, the German federal government released a framework for action concerning hydrogen technologies, the “National Hydrogen Strategy” (BMWi, 2020). The 38 measures include the installation of 5 GW hydrogen generation capacity until 2035 and the extended funding of fuel cell heating systems.

This paper presents the results of a case study that focuses on the heat generation for a rural residential district with a fuel cell combined heat and power (CHP) unit. In this sector, the use of hydrogen should not be considered as a competitive technology to direct electrification via heat pumps and batteries, but rather as a useful supplement with the ability of large-scale seasonal storage and sector coupling.

2 Related Work/State of the Art: Research

Hydrogen Production, Storage, and Use in Residential Districts

In the case study, hydrogen is stored as compressed gas. Other possibilities to locally store large amounts of hydrogen over seasonal durations include its conversion to organic molecule, such as liquid organic hydrogen carriers (LOHC) (Teichmann et al., 2012) and formic acid or formate, respectively (Lust et al., 2019).

Fuel Cell CHP

Several research papers deal with the usage of fuel cells as CHP units and the optimization of the operation to reduce primary energy demand. Similar conclusions of different research activities suggest that the design of the fuel cell CHP (stack size, auxiliary systems) and the control strategy must be carefully evaluated for each specific use case.

In their review article, Dodds et al. (2015) highlight that in the UK (and other cold climate locations), the peak thermal demand of residential buildings matches with the national peak electrical demand. Thus, the use of fuel cell CHPs offers an additional value to the energy system and complements heat pumps.

Windeknecht and Tzscheutschler (2015) describe a fuel cell CHP (SOFC) for a single-family household fueled by natural gas. They state that lowering the storage temperature from 60 °C to 35 °C increases the heat output of the fuel cell but requires additional systems. The temperature level of fuel cell-based heating systems must therefore be carefully evaluated, taking various factors into account.

There are different options for the heat recovery of solid oxide fuel cell (SOFC) and proton exchange membrane fuel cell (PEMFC) CHPs, including the possibility of an afterburner, to generate additional heat from unreacted hydrogen at the anode exhaust gases (Adam, Fraga, & Brett, 2015). Also, the concept of a complete self-sufficient public building with power generation (PV, wind), electrolysis, and fuel cells is described by Marino, Nucara, Pietrafesa, and Pudano (2013).

Realized Project

A currently realized project with water electrolysis and hydrogen use in a residential area is the “Neue Weststadt” project in the city of Esslingen east of Stuttgart (Energiewendebauen, 2020). In this project, power is generated with 220 kWp PV and used in an alkaline electrolyzer (500 kW) to produce hydrogen on site with waste heat utilization to supply the district with heat. The produced hydrogen is not stored but rather injected into the natural gas grid. In a later project phase, hydrogen is filled into trailers, and a refueling station for fuel cell vehicles is planned (Marx, 2020).

Control of Fuel Cell CHPs

To optimize the control strategy of a fuel cell CHP, Cappa, Facci, and Ubertini (2015) suggest to minimize a cost function, including the costs of the fuel (Cs), maintenance (Cm), cold start (Cs), and electricity export. Compared to a reference scenario (electricity from grid, heat from gas fueled boiler), this optimized control strategy of the fuel cell CHPs allows to reduce the annual net expenditure of 47% (40% with thermal driven control). In the past, incentives for CHP systems in Germany have been granted for heat-led systems only or in some cases with feed-in bonus for heat-led systems. The aim of this incentive strategy was to avoid excessive heat rejection and waste of fuel (Erhart, 2015). Especially for city quarters with district heating systems, the main purpose of the CHP was to provide thermal energy, with electricity as by-product. In the past few years, the share of electric heating systems and power-to-heat systems has increased (Agora Energiewende, 2017). With higher envelope standards, specific heat demand for houses decreases (Günther et al., 2020). Furthermore, the number of heat pumps installed per year over the last 18 years increased by a factor of around 10 (BWP, 2020). Therefore, electricity as main energy thermal source for heating homes is becoming more and more central.

Application of Forecasting Models Based on Machine Learning in the Field of Energy Management

Several research companies have dealt with the question of load curve prediction. The method of artificial neural networks (ANNs) is often used for this purpose, which also includes the multiple layer perceptron (MLP) model (A. S. Ahmad et al., 2014). However, far fewer projects have dealt with the application of decision trees or ensembles with decision trees (random forest, gradient boosting) (M. W. Ahmad, Mourshed, & Rezgui, 2017). In those projects in which the random forest (RF) or gradient boosting (GB) model is applied, the results are quite comparable to those of ANNs (M. W. Ahmad et al., 2017; Moon, Kim, Son, & Hwang, 2018; Robinson et al., 2017).

Moon et al. (2018) use a hybrid model consisting of a multiple layer perceptron and a random forest for the prediction of load profiles. For this purpose, the electrical demand data of a Korean university are used. The patterns are also used to allocate the different electrical load profiles. These data are then fed into the hybrid model, which is trained by this information.

In the work of M. W. Ahmad et al. (2017), the models ANN and RF are explicitly compared, and the results are contrasted. For this purpose, a 5-min resolved HVAC data set of a hotel in Madrid is used. Also, daily bookings and weather data are determined. The results of this work show that the artificial neural network prevails over the random forest but that the results for both systems are highly satisfactory. The random forest can show a coefficient of determination of 0.92 compared to 0.95 for the artificial neural network. This corresponds to a very good prediction performance for both models.

3 Methodology

Figure 10.1 depicts the procedure of this work. Measurement data (24 h-averaged) and white-box model data are used to set the fuel cell heating power. On that basis, all other system parameters are determined by evaluating a target function with evolutionary algorithms. The unaveraged (1-min time step) measured and white-box data is used to calculate the system performance with the optimized parameters. Besides, forecasting algorithms are trained on the measured and white-box data. In the long run, these algorithms should replace the white-box data for faster computation. The forecasted data could be used to optimize the system operation on a minute-based time scale.

Fig. 10.1
figure 1

Methodology—flow diagram

Simulation Environment

INSEL is an acronym for the Integrated Simulation Environment Language of doppelintegral GmbH, a graphical programming language for the creation and execution of simulation applications mainly used in the renewable energy sector. INSEL comprises a graphical model editor (JAVA) with calculation sub-routines written in C++ or Fortran. INSEL has a large variety of predefined functions, the so-called blocks, for different domains (solar, electric, chemical, thermal, meteorological).

The workflow of the simulation is shown in Fig. 10.2. Load curves for the generated power and the heat demand must be provided via prior simulations or measurement data. A Python script specifies the system’s parameters and generates an executable INSEL file from a template. The INSEL runtime environment is started from the Python script. After the simulation run finishes, an output file is generated from INSEL and processed in Python. Finally, the simulation results are visualized using GNUplot scripts. This workflow also allows the implementation of forecast and optimization algorithms with Python as a common programming interface.

Fig. 10.2
figure 2

Simulation workflow

Optimization

To determine the optimal size of the system components, a genetic algorithm was applied to the system model, varying the size of the electrolyzer, the battery, and the storage tank. This was realized in Python via the DEAP toolbox (Distributed Evolutionary Algorithms in Python (DEAP, 2021)). Thereby, the optimization is based on the following target function:

$$ \boldsymbol{f}={\boldsymbol{P}}_{\boldsymbol{E}\boldsymbol{l}}\cdotp {\boldsymbol{c}}_{\boldsymbol{E}\boldsymbol{l}}+{\boldsymbol{E}}_{\boldsymbol{BAT}}\cdotp {\boldsymbol{c}}_{\boldsymbol{Bat}}+{\boldsymbol{V}}_{\boldsymbol{tank}}\cdotp {\boldsymbol{c}}_{\boldsymbol{tank}}+\left(\mathbf{0.8}+{\boldsymbol{N}}_{\boldsymbol{refill}}\right)\cdotp {\boldsymbol{c}}_{\boldsymbol{H}\mathbf{2}}\cdotp \frac{{\boldsymbol{V}}_{\boldsymbol{tank}}\cdotp {\boldsymbol{p}}_{\boldsymbol{tank}}}{{\boldsymbol{R}}_{\boldsymbol{s}}\cdotp \boldsymbol{T}} $$

This economic optimization aims at identifying the local hydrogen production and the amount of needed external hydrogen refills. In this scenario, the size of the fuel cell and hence the cumulated hydrogen demand is fixed.

For the economic optimization, the EAC (equivalent annual cost), which represents the annual cost of owning, operating, and maintaining the different system components, was calculated based on the annuity method according to the guideline VDI 2067 “Economic efficiency of building services systems” (Verein Deutscher Ingenieure, 2012). Furthermore, to take into account inflation, a procedure according to Hessisches Umweltministerium (1999) was used, assuming the specific investment costs according to Table 10.1. They resulted in corresponding annual costs with the assumption of a lifetime of 20 years.

Table 10.1 Target function parameters

Assumptions:

  • Battery costs depend on the battery capacity, not on the power.

  • All costs scale linear.

  • Type I (steel cylinder) hydrogen tanks fulfill safety issues for stationary outdoor storage.

  • Hydrogen refills via trailers are logistically feasible.

  • Hydrogen costs consist of market price (9.5 €/kg) + 20% delivery costs (initial hydrogen fill without delivery costs ➔ (0.8 + Nrefill) · cH2).

  • Lifetime of electrolyzer, battery, and storage tanks: 20 years.

  • All parameters are bounded to keep the component design within reasonable limits.

Forecast Models

Scikit-Learn: A Toolbox for Developing Forecast Models in the Field of Machine Learning

Scikit-Learn is an open-source project, in which different tools of machine learning are offered. The project is constantly being developed, and the range of models and tools to be used is constantly increasing. For example, support vector machines or neural networks based on the multi-layer perceptron can be created and applied simply by configuring and adjusting the hyperparameters (Pedregosa et al., 2011). This toolbox is applicable in the popular programming language Python and thus allows an easy use of models from the field of statistics as well as machine learning (Müller & Guido, 2015).

Scikit-Learn: Decision Tree, Random Forest, and Gradient Boosting

The Scikit-Learn library has some models for the application of decision trees and their ensembles which can be used for classification as well as regression. In this work, the classical (decision tree regressor) as well as the random forest and gradient boosting of the Scikit-Learn library are used. Grid search and cross-validation are used to discuss the best models (Geron, 2017; Ng & Soo, 2018).

Statistical Tools for the Evaluation of the Models

In this work, the statistical evaluation of the forecast is done with three tools. These are the coefficient of determination (R2), the mean absolute percentage error (MAPE), and the mean absolute error (MAE). They are often used in the field of machine learning (A. S. Ahmad et al., 2014; M. W. Ahmad, Mourshed, Yuce, & Rezgui, 2016; Geron, 2017).

Application of the Forecasting Model

The application of machine learning in this work makes it possible to predict the energetic user behavior in order to optimize building services equipment and its operation. For this purpose, measured values from the past are often used to train a model (M. W. Ahmad et al., 2016; Jain, Smith, Culligan, & Taylor, 2014; Zhang, Grolinger, Capretz, & Seewald, 2019). Since there are no consistent measured data of the buildings in the investigated area over longer periods (1 year or more), the simulation results, based on previously calibrated white-box models (Brennenstuhl et al., 2019; Brennenstuhl, Lust, Pietruschka, & Schneider, 2021), of 5 years were used to train the model. Weather data from the year 2019 is used for the forecast. The optimization of the building services engineering is further the subject of the research and is not addressed in this paper.

Figure 10.3 shows the process of the forecast. First, the data is provided by monitoring or simulation. In this case, the data are initially simulation data. These must be pre-processed. This means that errors have to be detected and filtered, the format has to be adapted, and features have to be added or reduced. Since measured values or simulations usually do not have a stratified data set, it still has to be re-sorted. This ensures that when the data set is divided into training, test, and validation data, all possible constellations of characteristics and output values are equally distributed. The trained model is checked for its performance using the test data set. Particularly strong models are checked for overfitting to the test data set using the cross-validation procedure and the validation data set. During the cross-validation, the test data set as well as the training data set is completely changed once. If the prediction quality remains more or less constant, a well-generalized model can be assumed.

Fig. 10.3
figure 3

Process of the forecast

Another test is the application of a validation data set. It is removed from the entire data set in advance and is usually used for final testing. If the qualitative values of this application are similar to those of the previous tests, the model is valid and can be used for the forecast.

Table 10.2 shows the used features. The temporal characteristics are generated using Unix time. The ambient temperature and the global radiation are taken from the respective data set. Floating point numbers are limited to two decimal places to reduce variation. Not all features are applied to the respective models. For example, it has been shown that electricity demand can be better predicted without the ambient temperature and global radiation. However, these two characteristics play an important role in the prediction of heat demand.

Table 10.2 Used features

In order to generate the best output, the hyperparameters of each model must be adjusted. It can be done automatically with a grid search, which either already contains a cost function and thus determines the best value itself or determines hyperparameters by random range hyperparameter and thus scans a certain range. In this work, the grid search was performed by a random range of values (Geron, 2017; Müller & Guido, 2015). The training of the procedure is done with minute data. The output or the forecast can be in minute values, quarter hours, and hourly values. In this case, the output is in hours, because errors are averaged and the curve is smoother. Because of this smoothing to hours, the results of the forecast are better than with minute values.

Case Study: Building Cluster in the Municipality of Wüstenrot

The case study described within this paper focuses on the rural municipality Wüstenrot in Baden-Wurttemberg and in detail on a newly built plus energy district called “Vordere Viehweide.” Wüstenrot is not connected to a natural gas grid, and thus, many of the existing buildings are heated by oil-fired boilers. To counteract this, measures to increase the share of renewable energy (RE) in the community’s heat and electricity supply were developed as part of the EnVisaGe research project (Municipality of Wüstenrot, 2018), which was carried out between 2012 and 2016. This included the development of several local heating networks and the realization of a new plus energy district. The latter consists of 23 residential buildings with high-energy standard (see Fig. 10.4). All buildings are equipped with decentral heat pumps that are supplied by a cold district heating grid that is connected to a large-scale low-depth geothermal system (“Agrothermie”). All buildings have PV systems installed with a peak power output between 6 kWp and 29 kWp (overall, 97.39 kWp). Within six buildings, all thermal and electrical energy flows and temperatures are monitored in detail. The energy flows of six additional buildings are measured. This monitoring data is accessible via a cloud-based monitoring and control system.

Fig. 10.4
figure 4

The Plus Energy Settlement “Vordere Viehweide”

As Table 10.3 and Fig. 10.7 indicate, more PV electricity is produced than consumed by the households and heat pumps. In addition, larger differences occur due to the imbalance of heating demand and PV production on a seasonal level (see Fig. 10.5) but also on a daily basis. In this context, short- and long-term storage solutions are beneficial to reduce electrical grid stress. Short-term storage solutions could be battery storages, and long-term seasonal storage could be provided by hydrogen-based systems. The heating power demand of the building cluster during the course of 1 year is shown in Fig. 10.6 (Fig. 10.7).

Table 10.3 The plus energy settlement’s energy balance
Fig. 10.5
figure 5

Case study monthly electricity balance for 10 Buildings (Simulation Output According to Metrological Data from 2019)

Fig. 10.6
figure 6

Heating power demand of the building cluster

Fig. 10.7
figure 7

PV power production and domestic electricity demand

4 Hydrogen System: Modeling, Design, and Control

In this study, the existing heating system with decentral heat pumps is replaced by a central hydrogen-based energy system. The investigated hydrogen system consists of a central unit with a PEM electrolyzer and a buffer battery, electrically connected to the building cluster and the power grid. The hydrogen produced by the electrolyzer is compressed to 25 MPa and locally stored, whereas the produced oxygen is not further utilized. A PEM fuel cell is used to generate heat and power from hydrogen. The produced heat is distributed via a heating network to the building cluster (see Fig. 10.8).

Fig. 10.8
figure 8

Schematic representation of the investigated hydrogen system

Simulation Models

The models of the individual components of the hydrogen system are described in the subsequent section. All models are written in C++ and compiled as INSEL blocks.

PEM Electrolyzer

At the anode of a PEM electrolyzer, water molecules are split to protons, electrons, and oxygen. The membrane is permeable for protons, which at the cathode combine with electrons to form hydrogen. Overall, one molecule of hydrogen and half a molecule of oxygen are formed per converted water molecule.

Anode:

H2O → 2 H+ + 2 e + 0.5 O2

Cathode:

2 H+ + 2e → H2

Overall:

H2O → H2 + 0.5 O2

For a detailed description of PEM electrolyzer modeling, see Carmo, Fritz, Mergel, and Stolten (2013).

Compressor

The hydrogen compression process is modeled as isothermal (approximately true for multi-stage compressors) and hydrogen treated as an ideal gasFootnote 1 corrected with a compressibility factor Z (from empirical equations (see Lemmon, Huber, and Leachman (2008) and Zheng et al. (2016)) or interpolated from table data).

The power needed for the compression calculates as follows:

$$ {P}_0=\dot{\frac{m}{\mathrm{d}t}}\cdotp {R}_s\cdotp T\cdotp Z\cdotp \ln \left(\frac{p_{\mathrm{storage}}}{p_{\mathrm{in}}}\right) $$
(10.1)

If the efficiency of the compressor is considered, the power consumption of the compressor results from Eq. (10.2).

$$ P=\frac{P_0}{\eta } $$
(10.2)

Storage Cylinder

To determine the pressure in the storage tank, the net hydrogen mass flow is calculated by the currently occurring inflow from the electrolyzer and outflow requested by the fuel cell (Eq. 10.3).

$$ {\dot{m}}_{H_2}={\dot{m}}_{H_{2,\mathrm{inflow}}}-{\dot{m}}_{H_{2,\mathrm{outlfow}}} $$
(10.3)

With the net mass flow and the amount of hydrogen present in the previous time step results the overall mass of hydrogen in the storage device (Eq. 10.4).

$$ {m}_{H_2}=\int {\dot{m}}_{H_2}\cdotp \mathrm{d}t $$
(10.4)

In real compressed gas storage situations, the heating of the gas due to compression and the opposite effect, cooling due to relaxation (Joule-Thomson effect), must be considered, as this effect lowers the storage capability. This is especially observed in fast filling processes (e.g., filling stations). In this case, these effects are neglected (in Eq. 10.5, Tgas = Tamb) because the incoming hydrogen mass flow is low compared to the storage capacity. The pressure in the storage tank (in Pa) is calculated with the ideal gas law (Eq. 10.5).

$$ {p}_{\mathrm{storage}}(t)=\frac{{m_H}_2(t)\cdotp {R}_S\cdotp {T}_{\mathrm{gas}}}{V} $$
(10.5)

PEM Fuel Cell

As an electrochemical device with similarities to PEM electrolyzers, the model of the fuel cell is at this point not further described. A profound introduction into PEM fuel cell modeling is, e.g., given by Spiegel (2008).

Fuel Cell Design

In this scenario, the fuel cell was designed so that the minimal occurring part load represents 25% of the fuel cells’ nominal thermal power. This design point was chosen to minimize the on-off cycles of the fuel cell. The minimal occurring part load was determined from the 24 h-averaged heat demand of the building cluster. The resulting parameters for the fuel cell are summarized in Table 10.4.

Table 10.4 Fuel cell parameters

Figure 10.9 shows the load duration curve of the annual heat demand and the fuel cell thermal power (15 kW).

Fig. 10.9
figure 9

Load duration curve—heat demand

Control

Input Power Distribution Algorithm: The surplus electrical powerFootnote 2 generated by the PV devices is divided between the electrolyzer, the battery, and the power grid, according to the algorithm shown in Fig. 10.10.

Fig. 10.10
figure 10

Power distribution algorithm

To keep the electrolysis power within the operating boundaries of the electrolyzer, the two parameters Pel, min and Pel, max are determined in the controller. It is tried to ensure the minimal electrolysis power if possible, by using the energy stored in the buffer battery. This control strategy avoids standby phases for the electrolyzer.

In this scenario, the minimal electrolysis power Pel, min is determined by the battery power. In further studies, this value should be optimized according to the specific system design (battery power compared to electrolyzer power) and the characteristics of the electrolyzer (warm-up time, part load capability).

Electrolyzer Temperature Control: Besides the input power of the electrolyzer, as shown above, also the cell temperature is controlled with a PID controller (only cooling, no heating). The temperature setpoint is set to 80 °C.

Fuel Cell Control: In this scenario, the fuel cell is operated as a thermal driven CHP device. For the operation of the fuel cell, setpoints for the heat demand and the cell temperature are specified. The regulating variable for the heat demand is the current I, which affects the hydrogen consumption rate. To keep the cell temperature at the setpoint, the mass flow of a cooling loop is adjustable (see Fig. 10.11).

Fig. 10.11
figure 11

FC control scheme

The upper limit for the current controller is determined by the operating point (OP) at which the cell power density is maximized. It is recognizable from Fig. 10.12 that the maximal power density of the fuel cell is achieved at a current density of about 80% (0.88 A/cm2) of the limiting power density (1.1 A/cm2) The voltage-current-charactersitic is of the fuel cell is shown in Fig. 10.13.Footnote 3

Fig. 10.12
figure 12

FC current–power–density characteristics

Fig. 10.13
figure 13

FC current–density–voltage characteristics

5 Simulation Results and Discussion

Evaluation of Prediction Algorithms

For the grid search, the random forest model has proven to be the best for the data sets. Not only the output quality is better but also the training time of the model with the RF method is significantly faster than that of the gradient boosting or the DTR. With a training data set size of 6 times 2,628,000,000 features and an output, this is, among other things, an essential feature.

Table 10.5 shows the results of the grid search. It can be seen that the RF method has a much better coefficient of determination and MAPE for both outputs (heat demand and household electricity demand). The MAE is also much lower in the RF method than in the other methods. The RF method is therefore used for the forecasts. The output of the data is in the form of hourly values.

Table 10.5 Grid search for the best hyperparameters and the best output results

Figure 10.14 shows a section of the household power demand by the “Vordere Viehweide” in Wüstenrot (black) and the corresponding forecast (red). The course of the day is described very well by the model. The hyperparameters were determined by grid search (see under random forest) and amount to 23 estimators and 7834 leaves. Combined with the 2019 weather data, the model achieves a determination rate of 82% with a MAPE of 9.12%. The MAE is 0.44 kW (see also Table 10.6).

Fig. 10.14
figure 14

Forecast of the electricity demand

Table 10.6 Statistic results of the forecasts

Figure 10.15 shows a section (February 13 to February 23) of the heat demand for the year 2019 (black) and the associated forecast. The forecast was trained with the best model that was found by the grid search and created with the input data of the year 2019. The hyperparameters for the model consist of 22 estimators and 7314 leaves. Table 10.6 shows the statistical results. In the model for the heat demand, a determination of 75% is reached with a MAPE of 41.9%. The MAE corresponds to 3.95 kW.

Fig. 10.15
figure 15

Forecast of the heat demand

The results (Table 10.6) with the prediction by the RF should be viewed critically, since these are synthetic load curves and thus exclude the user dynamics in many respects. Furthermore, the grid search does not provide all the possibilities of the best hyperparameters due to the systematic nature of the search, so it cannot be automatically said that these hyperparameters provide the best results. However, this investigation has the potential to predict the course of a load profile to a certain degree and thus possibly optimize the control of the system.

Optimization Results

The optimization loop was executed with 200 generations and 40 populations with results shown in Table 10.7.

Table 10.7 Optimized system parameters

These system parameters lead to 23 necessary refills (Nrefill = 23) and to a best target function result of −65,689.37 €. The distribution of the costs of the individual items is shown in Fig. 10.17. Eighty-four percent of the system costs are caused by the necessary external refills of the hydrogen tank. However, the market price of hydrogen will most likely decrease with additional global and national production capacity. An independency of hydrogen imports could be achieved by the installation of more electricity production capacity (additional PV or supplementary wind turbines) and more electrolysis power, combined with a bigger hydrogen storage capacity (Fig. 10.16).

Fig. 10.16
figure 16

Cost distribution

Figure 10.17 indicates that 93% of the annual surplus electrical energy (PV production minus household demand) is directly utilized in the electrolyzer to produce hydrogen. Another 5% is temporarily stored in the battery and utilized in the electrolyzer if the input power is lower than minimal operating power of the electrolyzer. Only 2% (1862 kWh) of the surplus power could not be used directly and is fed into the electricity grid.

Fig. 10.17
figure 17

Surplus electrical energy distribution

Monthly heat demand and production (Fig. 10.18) and monthly power demand and production (Fig. 10.19) show that the deficits of the heat coverage in the winter months go along with a high excess of electrical energy, which could be used to produce additional heat via heat pumps.

Fig. 10.18
figure 18

Monthly heat demand and production

Fig. 10.19
figure 19

Monthly power demand and production

The following sections will discuss the results for the individual components.

Electrolyzer

The optimized electrolyzer results in a rated electrolysis power of 56 kW meaning 64 cells in series with a cell area of 300 cm2.

Figure 10.20 shows the annual load duration curve of the building cluster’s surplus power. With an installed PV power of about 97 kWp, the optimized electrolysis power is about 58% of the electricity production capacity.

Fig. 10.20
figure 20

Load duration curve of surplus power

A rated electrolysis power of 56 kW in combination with a 33 kWh, 14 kW battery leads to 613 full-load hours (7% of the year) and 5818 standby hours (66.4%) of the electrolyzer. This setup leads to 5343 off-on switches (see Table 10.8).

Table 10.8 Simulation results—electrolyzer

Although PEM electrolyzers are known for short start-up times and good part load behavior, a future optimization goal could be the reduction of standby hours which mostly occur during the winter season (see Fig. 10.21). A significant reduction of the standby hours could be achieved with an installation of wind turbines.

Fig. 10.21
figure 21

Electrolysis power (24 h-Avg)

The temperature of the electrolyzer during the year is shown in Fig. 10.22. As the temperature setpoint is at 80 °C, the electrolyzer is cooled, if the temperature rises above this value. The waste heat could potentially be used to raise the overall system efficiency. However, in this setup, the setpoint temperature is not reached.

Fig. 10.22
figure 22

Electrolyzer temperature

The hydrogen production rate of the electrolysis process is proportional to the electrolysis current (see Eq. 10.9). Thus, Figs. 10.23 and 10.24 show similar curves with peak hydrogen production and current in the middle of the simulation run (summer months with high PV loads). The voltage also follows the rise of the electrolysis current due to higher voltage losses. A maximal hydrogen production rate of 1.07 kg/h is achieved.

Fig. 10.23
figure 23

Hydrogen production rate (24 h-Avg)

Fig. 10.24
figure 24

Electrolyzer Current and Voltage (24 h-Avg)

Fuel Cell

In this scenario, the fuel cell produces 84,696 kWh of heat per year with a maximum thermal power of 14.9 kW. This amount covers 63% of the overall heat demand (Table 10.9). Additionally, 122,507 kWh of electrical power is produced with a maximal electrical power of 22.5 kW, which could be fed into the electrical grid or utilized to produce additional heat.

Table 10.9 Simulation results—fuel cell

Figure 10.25 shows that especially at the beginning and the end of the year (heating period), the heating capacity of the fuel cell is not sufficient to cover the heating demand. Hence, the investigated system could not be operated independently and must be complemented by other heating technologies (afterburner, heat pumps, boilers) and heat storages. As expected from the characteristic electrical behavior of galvanic cells, the voltage of the fuel cell drops, if high currents are removed (see Fig. 10.26). In a heat-driven mode, the current corresponds to the demanded heat generation.

Fig. 10.25
figure 25

Heat demand and production (24 h-Avg)

Fig. 10.26
figure 26

FC current and voltage rate (24 h-Avg)

Figures 10.27 and 10.28 show the temperature and the electrical power output of the fuel cell. It is high at the beginning and the end of the simulation run, which matches with higher electrical demand in these periods of the year and is good to be used to generate additional heat via heat pumps. Hence, it closes the gap of the heat demand and the generated heat of the fuel cell.

Fig. 10.27
figure 27

FC temperature (24 h-Avg)

Fig. 10.28
figure 28

FC electrical power output

Storage

The hydrogen storage device in this scenario starts with filled hydrogen tanks (10 m3 at 25 MPa). In the course of the year, 23 refills with delivered hydrogen are needed (see Fig. 10.29). It is also visible from this figure that the amount of produced hydrogen in the summer is not sufficient to fill the storage. In fact, only the emptying of the storage tank is slowed down.

Fig. 10.29
figure 29

Storage pressure

With standard gas cylinder packages (12 × 50 l), 17 packages are necessary to achieve a storage capacity of 10 m3. This number of packages would cover an area of about 15.4 m2 (see Fig. 10.30). The storage setup with individual cylinder packages enables a straightforward adjustment of the overall storage capacity depending on the given system setup.

Fig. 10.30
figure 30

Hydrogen storage dimensions

Battery and Compressor

The net power flow in and from the battery and the battery state of charge are shown in Fig. 10.31. The curve points to high fluctuations of the battery load, which might decrease the battery performance and lifetime.

Fig. 10.31
figure 31

Battery power flow (24 h-Avg)

Figure 10.32 displays the power demand of the hydrogen compressor with 24 h-averaged values. High loads occur in the summer month, where the hydrogen production rate from the electrolyzer maximizes. Overall, the yearly energy demand of the compressor is 3859 kWh with a peak load of 2574 W.

Fig. 10.32
figure 32

Compressor power

6 Conclusions

The main steps and results of this study are summarized here:

  • A model for a hydrogen-based district heating system was introduced.

  • The model was applied on a building cluster with PV in a rural area with a combination of measured and white-box model data for heat demand and power generation.

  • The fuel cell was designed with 15 kW thermal power and 37 kW overall rated power.

  • Evolutionary algorithms were used to determine the size of an electrolyzer, a battery, and a hydrogen storage based on a target function with economic assumptions.

  • An electrolyzer rated power of 56 kW was found to be optimal for this scenario (58% of the installed PV power). With this setup, 93% of the surplus power is directly used in the electrolyzer, and 2% is fed into the power grid (5% is temporarily stored in the battery).

  • The fuel cell covers 63% of the annual heat demand. The generated surplus of electrical power could be used for further heat production.

  • The optimized storage size of 10 m3 is not sufficient to match the hydrogen demand of the fuel cell without external hydrogen deliveries which are responsible for 84% of the overall annual costs.

  • By RF prediction, a coefficient of determination for household electricity demand of 82% can be achieved, and a MAPE of 9.12% can be achieved.

  • The prediction by RF for the heat demand reaches a coefficient of determination of 75% and a MAPE of 41.9%.

7 Outlook

Studies following this work have to aim at rising the overall heat demand coverage of the system by integrating a central heat pump, which consumes the electrical power produced by the fuel cell. Another step would be to additionally utilize the waste heat of the electrolyzer. Wind turbines will be integrated into the system model in order to achieve independency of external hydrogen deliveries.

Furthermore, the forecasting tool based on the RF will be integrated into the work process. The forecast serves to optimize the work process and represents an optimizer in this respect. In addition, it will also be investigated how this optimizer can affect a real plant engineering.

Next steps:

  • Model validation and improvement with measurement data from a hydrogen test rig.

  • Dynamic coupling of the hydrogen system model with the building and the PV models.

  • Integration of a central heat pump, wind turbines, a heating network, and thermal storage in the system model.

  • Evaluation of other hydrogen storage technologies, for instance, hydrogen storage as formic acid.

  • Integration of the RF prediction tool with a self-learning component.

  • Optimization of the hydrogen system operation based on a prediction tool.