Neural Identiﬁcation of a Temperature Field in the Storing Phase of Thermal Energy in Rock Bed Thermal Storage

: Thermal energy stored within a rock bed thermal storage system, which is mostly used in agriculture, can be identiﬁed during the storage phase using mathematical models based on heat transfer, which concerns batteries running in a vertical setting. However, this requires the conversion of differential equations into algebraic equations, as well as knowledge about the initial and boundary conditions. Furthermore, a lack of information or incomplete information about the initial conditions makes it difﬁcult or impossible to evaluate the volume of stored energy, or can cause signiﬁcant errors during evaluation. Such situations occur in systems equipped with a rock battery, in which solar collectors act as source of energy. Considering the above, as well as the lack of a model for batteries in a vertical setting, we identiﬁed the need for research into the storage phase of rock bed thermal storage systems, working in a horizontal setting, and generating MLP-type neural models. Among these models, MLP 4-7-1 turned out to be the best both in terms of the values of regression statistics and possibilities of generalization. According to the authors, artiﬁcial neural models depicting temperature changeability in storage phase will be helpful in the development of a new methodology that can predict the heat volume in rock bed thermal storage systems.


Introduction
The amount of energy in a power system that is stored in a rock bed is one of several possible, mostly unconventional, sources of energy, and is not particularly hard to identify. In this case, automatic regulation systems were applied, which disabled the flow of the medium through the deposit when the output temperature fell below the required value. However, with a limited number of unconventional sources and a sensible thermal energy management system, information about the quantity of heat stored in any rock bed would be welcome [1][2][3]. This Such cases occur in agriculture, where solar panels (characterized by a variable amount of energy supply) are used as one of the energy sources [4,5]. The effective and economically viable use of such energy sources, for example, to dry crops or heat greenhouses, requires not only the use of heat accumulators with a simple structure, such as rock bed storage, but also a method for assessing the amount of thermal energy they accumulate, which would be simple and acceptable in practice.
In order to achieve this goal, the following mathematical models of heat flow should be used [4][5][6][7]. Although the storage phase is the most difficult phase to model, we currently have mathematical models that describe this stage of a rock bed heat accumulator's operation [8,9].
A comprehensive description of heat flow during the stagnation phase of rock bed thermal storage, presented in the form of deductive mathematical models, can be found in the work of Stamps and his research team [10,11]. The authors proposed two models that differed as their assumed simplifications and considered accumulators worked in a vertical setting. In addition to the single temperature model (based on only one field of temperatures, assuming an identical rock bed and air temperature), we shall focus on the two-temperature model, as it bears more similarity to the empirical system. This model consists of several equations of flow continuity and momentum, and two equations of energy balance for the air and the deposit, as appropriate (Equations (1)-(4)).
A flow continuity equation: where U-averaged air velocity in an elementary volume [m·s −1 ]. A momentum equation: where: where: where: The solution to the above equations proposed by Stamps' research team [8,11] required them to be converted into a non-dimensional form, using vector potential and the simultaneous formulation of the initial and boundary conditions. Next, the resulting mathematical structures formed the basis for using numerical methods to obtain the solution. Thus the fields of discrete temperature obtained enabled the identification of the energy accumulated in the deposit. It is possible to use this procedure in a real situation, assuming we have an Appl. Sci. 2021, 11, 10711 3 of 11 accumulator working in the vertical setting, an IT system to map the model, and the initial and boundary conditions. As mentioned before, the problem in evaluating the amount of thermal energy that was accumulated may be the unavailability and ignorance of the initial conditions based on the temperature distribution in the deposit at the beginning of the storage process.
The available models are converted into algebraic equations, regarding layers of rock in a vertical system/layout. Having mathematical models to identify the temperature fields is necessary to determine the amount of energy stored within the deposits; however, first one must determine the initial input and boundary conditions [9,10]. In practice, due to economic reasons, we lacked all the information on the conditions, and the data on the initial conditions were particularly sparse. This was a concern for almost all situations, especially the one in which a solar collector was used as a source of thermal energy. The stochastic character of this source, combined with the heterogenous flow of air during the loading phase preceded by the phase of battery stagnation, hindered the determination of the initial conditions, which are necessary in order to evaluate the volume of currently collected thermal energy within the battery using the available mathematical models. From a practical perspective, it is considered appropriate to find a limitation with regard to the economical points of temperature measurement within the rock deposit, the readings of which would allow one to determine the volume of thermal energy stored there. Knowing the initial conditions would then no longer be necessary. This mainly concerns situations that involve the battery being charged from a thermal source of stochastic character. The aim of the study is to answer the following question: To what extent can they be helpful in building up the methods of neural modeling? The answer to the above question must be preceded by a statement that confirms the possibility of designing neural models and describes the phase of storing thermal energy. This specific problem is the subject matter of this article. Having neural models depicting changeable temperatures in field, and in the function of time and space, allows us to identify thermal energy currently collected in a given deposit. This, in turn, will allow us to search for the smallest possible point or points of temperature measurement (considering economic reasons), which will allow us to identify thermal energy stored in rock deposits at any moment, independently of the initial conditions and with a broader knowledge of the boundary conditions [12,13].

Storage Phase of the Rock Bed Thermal Storage
An alternative to the classical description and an analysis of empirical systems was found in modern methods, such as artificial neural modeling [14,15]. Artificial neural networks (ANN) are a branch of science that has developed intensively [16], and the main advantage of the neural models has been their ability to generalize the knowledge acquired through training. The fields of application in which neural models have proved to be effective include forecasting, recognition or classification and diagnostics, for example, in agriculture [17,18]. As opposed to the traditional information-processing methods offered by computers, which execute a series of pre-developed algorithms, the basis for the development and subsequent operation of neural networks has been the use of what are known as training algorithms. This use of advanced optimization training algorithms has allowed an appropriate neural network structure to be designed, and a selection of the parameters set to suit the specific problem that requires solving [19]. Among these problems, others have emerged that relate to the use of thermal energy supplied from unconventional energy sources in agriculture [20][21][22][23]. Generally, the techniques of neural modeling in this area are often used to describe the temperature distribution [24,25].
An effective way of identifying the amount of thermal energy accumulated in a rock bed could be based on artificial neural networks as predictive instruments. However, this requires prior evaluation of the usefulness of the neural models for describing the thermal energy storage phase of the thermal accumulator. Many authors have made successful attempts to develop neural models to describe the charging phase [26], which have proved useful, for example, in the process of identifying uneven air flows through the deposit. The basis for building the original neural models originated from the results of a natural experiment, in which the subject was a rock bed thermal storage system working in a horizontal setting and designed to work with a solar collector. The work of the sun collector was steered with the heater, as illustrated in Figure 1. Broken granite stone with an average substitute diameter of 0.039 m, calculated on the basis of measurement of the volume of deposit elements, was used as a warehouse filling. Granite is characterized by relatively good heat properties such as thermal properties and specific heat. From an economic perspective, this material is highly recommended. The two remaining volumes were compensatory chambers. The simplified construction of the test stand, along with its simplified structure and layout of temperature sensors, is shown in Figures 1 and 2. PT100 sensors that measured temperature with a measuring accuracy of 0.1 • C were arranged in three perpendicular dimensions. The temperature measurement was also used to determine the inequality of airflow during the charging stage. Heat processes in the battery were related as low-frequency variables. As such, temperatures were registered at 5 min intervals. Due to the characteristics of the battery filling, this was included in the short-term storage group and was insulated with a layer of polystyrene with a thickness of 0.06 m. The total volume of the battery was 3 m 3 , of which 83% consisted of a bed and the remainder an equalizing chamber that improved the uniformity of air flow during the charging and discharging phases. The duration of the thermal energy storage phase did not exceed 15 h. Subsequently, the temperatures recorded during the storage phase emerged as the essential source of data necessary to develop the neural models.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 4 of 12 mal energy storage phase of the thermal accumulator. Many authors have made successful attempts to develop neural models to describe the charging phase [26], which have proved useful, for example, in the process of identifying uneven air flows through the deposit. The basis for building the original neural models originated from the results of a natural experiment, in which the subject was a rock bed thermal storage system working in a horizontal setting and designed to work with a solar collector. The work of the sun collector was steered with the heater, as illustrated in Figure 1. Broken granite stone with an average substitute diameter of 0.039 m, calculated on the basis of measurement of the volume of deposit elements, was used as a warehouse filling. Granite is characterized by relatively good heat properties such as thermal properties and specific heat. From an economic perspective, this material is highly recommended. The two remaining volumes were compensatory chambers. The simplified construction of the test stand, along with its simplified structure and layout of temperature sensors, is shown in Figures 1 and 2. PT100 sensors that measured temperature with a measuring accuracy of 0.1 °C were arranged in three perpendicular dimensions. The temperature measurement was also used to determine the inequality of airflow during the charging stage. Heat processes in the battery were related as low-frequency variables. As such, temperatures were registered at 5 min intervals. Due to the characteristics of the battery filling, this was included in the short-term storage group and was insulated with a layer of polystyrene with a thickness of 0.06 m. The total volume of the battery was 3 m 3 , of which 83% consisted of a bed and the remainder an equalizing chamber that improved the uniformity of air flow during the charging and discharging phases. The duration of the thermal energy storage phase did not exceed 15 h. Subsequently, the temperatures recorded during the storage phase emerged as the essential source of data necessary to develop the neural models.

Neural Models of Temperature Distribution
The neural models for predicting the temperature recorded during the storage phase of the accumulator were developed in the Matlab environment, using the Neural Network Toolbox add-on. The network's structures consist of an Multi-Layer Perceptron

Neural Models of Temperature Distribution
The neural models for predicting the temperature recorded during the storage phase of the accumulator were developed in the Matlab environment, using the Neural Network Toolbox add-on. The network's structures consist of an Multi-Layer Perceptron (MLP) [17,[27][28][29][30] with 4 inputs, a diverse number of neurons in the hidden layer (5 or 10 neurons) and 1 neuron in the output layer.
The one-way multilayer networks of the multilayer perceptron type are among the most studied and most commonly used network topologies. ANN-type MLP represents the so-called parametric neural model class. For example, they are characterized by the fact that the number of neurons forming their structure is markedly lower than the learning file size. The defined input variables and output variable are shown in Table 1. The collection of data necessary to develop the neural model was, by default, divided, in the ratio 2:1:1, into the following files: training, validation and testing. These files included, respectively: 1008, 504 and 504 cases. The testing file was not used in the network training process, as this was essential for the final evaluation of the neural model. A fragment of the training file (cases from 331 to 337) is shown in Table 2. The developed ANNs were trained using an error back propagation algorithm (BP) with Bayesian regularisation. Mean Squared Error (MSE) was used as the error function. The neural networks generated were designated as MLP 4-5-1, MLP 4-7-1 and MLP 4-10-1. The sigmoid function was used as the activation function for the hidden layer neurons, and a linear function was used for the output layer neurons. The structure of the neural model MLP 4-7-1 is shown in Figure 3.
In the network training process in the Matlab environment, the following algorithm stoppage criteria were adopted: The developed ANNs were trained using an error back propagation algorithm (BP) with Bayesian regularisation. Mean Squared Error (MSE) was used as the error function. The neural networks generated were designated as MLP 4-5-1, MLP 4-7-1 and MLP 4-10-1. The sigmoid function was used as the activation function for the hidden layer neurons, and a linear function was used for the output layer neurons. The structure of the neural model MLP 4-7-1 is shown in Figure 3. In the network training process in the Matlab environment, the following algorithm stoppage criteria were adopted:

Results
The standard measure of quality for the generated neural model is the RMS error, which is defined as follows: where:

Results
The standard measure of quality for the generated neural model is the RMS error, which is defined as follows: where: • The created MLP with 4-5-1, 4-7-1 and 4-10-1, respectively, were characterized by generally low error values with a falling tendency together with the increase in the number of neurons in the hidden layer. Complete and full statistics of regression for all created models are presented in Table 3. Having noticed the fact that the network with 10 neurons within the hidden layer showed a tendency to over-learn, a decision was made to use a model with an MLP 4-7-1 network in the process of modeling temperature layout in the rock regenerator. Notably, this model showed good generalization abilities/capabilities.  Figure 4 presents the information on the linear regression between the temperature values obtained using the MLP 4-7-1 model and the values of that parameter for the testing file. Information on the absolute error of temperature determination was also included in the form of a histogram ( Figure 5). The regression coefficient for the model was 0.998. Thus, one may assert that the results of the temperature prediction as a function of position, and charging time obtained using the model that was generated, closely reflected the results of the natural experiment included in the testing file.
The high quality of the generated MLP 4-7-1 network as a prediction instrument was identified by the regression statistics presented in Table 3. The statistics included the following indicators: • Correlation-the standard Pearson R correlation coefficient for the values required and obtained at the output.
The two final indicators presented in Table 3, namely, the ratio of standard deviations and correlation, were essential for evaluating the predictive capacity of the developed neural network. The lower the ratio of the standard deviations (closer to zero) and the higher the correlation (closer to one), the better the network. Table 3 shows that the correlation was about 0.998, which was a close approximate for the files: training, validation and testing, although the ratio of the standard deviations for the errors and for the data was in the 0.05 range.
The indicative visualization of the neural network operations that were generated was a 2-dimensional function, referred to as the network response area. For variables Z and t (at the defined X = 0.5 and Y = 0.5), the response surface of the MLP 4-7-1 network is shown in Figure 6. Undoubtedly, the visualization of the temperature distribution in the rock bed heat storage during the stagnation phase, based on this neural model, more fully represented the heat flow caused mainly by free convection.
In the case of the generated surface, with all the assumed principles (at the defined X = 0.5 and Y = 0.5), by MLP 4-10-1 network, we can observe some disturbances in the layout, namely the occurrence of two temperature maximums at the end of the storage process (see Figure 7). Such a temperature layout has no physical grounds and was the reason this neural model was rejected. In the opinion of the authors, this was the effect of network's over-learning. The created MLP with 4-5-1, 4-7-1 and 4-10-1, respectively, were characterized by generally low error values with a falling tendency together with the increase in the number of neurons in the hidden layer. Complete and full statistics of regression for all created models are presented in Table 3. Having noticed the fact that the network with 10 neurons within the hidden layer showed a tendency to over-learn, a decision was made to use a model with an MLP 4-7-1 network in the process of modeling temperature layout in the rock regenerator. Notably, this model showed good generalization abilities/capabilities. Figure 4 presents the information on the linear regression between the temperature values obtained using the MLP 4-7-1 model and the values of that parameter for the testing file. Information on the absolute error of temperature determination was also included in the form of a histogram ( Figure 5). The regression coefficient for the model was 0.998. Thus, one may assert that the results of the temperature prediction as a function of position, and charging time obtained using the model that was generated, closely reflected the results of the natural experiment included in the testing file.  The high quality of the generated MLP 4-7-1 network as a prediction instrument was identified by the regression statistics presented in Table 3. The statistics included the following indicators: The two final indicators presented in Table 3, namely, the ratio of standard deviations and correlation, were essential for evaluating the predictive capacity of the developed neural network. The lower the ratio of the standard deviations (closer to zero) and the higher the correlation (closer to one), the better the network. Table 3 shows that the correlation was about 0.998, which was a close approximate for the files: training, validation and testing, although the ratio of the standard deviations for the errors and for the data was in the 0.05 range. and t (at the defined X = 0.5 and Y = 0.5), the response surface of the MLP 4-7-1 network is shown in Figure 6. Undoubtedly, the visualization of the temperature distribution in the rock bed heat storage during the stagnation phase, based on this neural model, more fully represented the heat flow caused mainly by free convection.
(a) (b) Figure 6. Temperature distribution in dimensionless function of deposit height and time for definite dimensionless value X = 0 and Y = 0 (according to Figure 2) obtained from the model MLP 4-7-1 network.
In the case of the generated surface, with all the assumed principles (at the defined X = 0.5 and Y = 0.5), by MLP 4-10-1 network, we can observe some disturbances in the layout, namely the occurrence of two temperature maximums at the end of the storage process (see Figure 7). Such a temperature layout has no physical grounds and was the reason this neural model was rejected. In the opinion of the authors, this was the effect of network's over-learning.
(a) (b) Figure 6. Temperature distribution in dimensionless function of deposit height and time for definite dimensionless value X = 0 and Y = 0 (according to Figure 2) obtained from the model MLP 4-7-1 network.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 10 of 12 and t (at the defined X = 0.5 and Y = 0.5), the response surface of the MLP 4-7-1 network is shown in Figure 6. Undoubtedly, the visualization of the temperature distribution in the rock bed heat storage during the stagnation phase, based on this neural model, more fully represented the heat flow caused mainly by free convection.
(a) (b) Figure 6. Temperature distribution in dimensionless function of deposit height and time for definite dimensionless value X = 0 and Y = 0 (according to Figure 2) obtained from the model MLP 4-7-1 network.
In the case of the generated surface, with all the assumed principles (at the defined X = 0.5 and Y = 0.5), by MLP 4-10-1 network, we can observe some disturbances in the layout, namely the occurrence of two temperature maximums at the end of the storage process (see Figure 7). Such a temperature layout has no physical grounds and was the reason this neural model was rejected. In the opinion of the authors, this was the effect of network's over-learning.
(a) (b) Figure 7. Temperature distribution in dimensionless function of deposit height and time for definite dimensionless values X = 0 and Y = 0 (according to Figure 3) obtained from the model MLP 4-10-1 network.

Conclusions
Research into the storage phase of thermal energy in a rock bed thermal storage system working in a horizontal setting has provided the necessary date to generate an optimum MLP 4-7-1 neural model. The qualitative evaluation of the neural model as a

Conclusions
Research into the storage phase of thermal energy in a rock bed thermal storage system working in a horizontal setting has provided the necessary date to generate an optimum MLP 4-7-1 neural model. The qualitative evaluation of the neural model as a tool for predicting the deposit temperature as a function of position and time has been successful. This has also been confirmed with diagrams, which depicted the moving of areas with the highest temperature to the top of the deposit along with the passing of time in storage, and was the result of natural convection. Out of three MLP models that were analyzed, the one that was characterized by the lowest error value and maintained generalization abilities/capabilities was a neural network with seven neurons in the hidden layer. The positive values of regression statistics proved the usefulness of neural modeling for the description of the deposit temperature field variation in the stagnation phase. They suggested the usefulness of further research aimed at using this tool in the process of developing a new method of identifying the amount of energy aggregated in rock bed thermal storage, and one that would be convenient and financially viable.
This new methodology depends on determining the position of point or points of temperature measurement with limited numbers within a deposit. Independent of the readings of the initial conditions, such temperature measurements would be sufficient to evaluate the amount of thermal energy stored in a horizontal rock deposit.