Application of Phase Change Material and Artiﬁcial Neural Networks for Smoothing of Heat Flux Fluctuations

: The paper presents an innovative method for smoothing ﬂuctuations of heat ﬂux, using the thermal energy storage unit (TES Unit) with phase change material and Artiﬁcial Neural Networks (ANN) control. The research was carried out on a pilot large-scale installation, of which the main component was the TES Unit with a heat capacity of 500 MJ. The main challenge was to smooth the heat ﬂux ﬂuctuations, resulting from variable heat source operation. For this purpose, a molten salt phase change material was used, for which melting occurs at nearly constant temperature. To enhance the smoothing effect, a classical control system based on PID controllers was supported by ANN. The TES Unit was supplied with steam at a constant temperature and variable mass ﬂow rate, while a discharging side was cooled with water at constant mass ﬂow rate. It was indicated that the operation of the TES Unit in the phase change temperature range allows to smooth the heat ﬂux ﬂuctuations by 56%. The tests have also shown that the application of artiﬁcial neural networks increases the smoothing effect by 84%.


Introduction
Currently, thermal energy storage (TES) technologies are being widely developed on the global scale. The demand for heat storage arises in two cases: the instability of the operation of the heat source and the variability of heat consumption. The instability of the operation on both the heat generation and heat consumption causes variation in the flow rate and/or temperature, which results in variations in the heat flux. The purpose of heat storage is to compensate for the difference between heat supply and demand [1][2][3].
Irregularity of heat source operation may be caused by several factors, e.g., the nonstationary nature of heat generation. An example of a non-stationary process is the recovery of waste heat for reuse. Other factors affecting the irregularity of the heat source operation include external conditions such as insolation, wind force and external temperature. These external factors apply to all renewable energy sources, which are dependent on the sunlight intensity, wind force, external temperature, etc. [4]. On the other hand, the variability of heat consumption is a result of variable heat demand at different periods of time, usually occurring in a daily or annual cycle.
Depending on the abovementioned factors, heat storage may be considered as short-or long-term. Long-term heat storage is most often used in case of variable heat consumption in the annual cycle and the heat storage period ranges from several weeks to several months. As the heat capacity of storage devices must be large, the heat storage materials are expected to be low cost and commercially available [5]. The most commonly used materials are water, rock, concrete and sand. In case of short-term heat storage, the energy storage time ranges from a few hours to a few days. Because of the shorter storage time, the heat capacity of the device is smaller and the unit cost of the storage material is less significant. This type of storage is commonly used in photovoltaic installations, where the storage time is usually about 12 h [4].
The amount of stored heat is proportional to the initial and final heating temperature difference as well as the specific heat of the storage material. This heat capacity is called sensible heat [6][7][8]. This feature is an important limitation of the heat capacity of the materials, in which heat storage is achieved only by increasing their temperature. The heat capacity may be increased by phase change of the heat storage material. In this case, the heat capacity is elevated by the value of latent heat [9][10][11]. In most cases, liquid to solid phase transformation (or vice versa) is used. Two advantages of phase transformation of heat storage material can be mentioned. The first one is the increased heat storage density compared to sensible heat storage materials. The second advantage is a constant phase-change temperature, which stabilizes the heat flux on both the charging and discharging side.

Classification and Properties of PCMs
Phase change materials (PCMs) can be classified as organic compounds, inorganic compounds and eutectic mixtures ( Figure 1). Organic PCMs include paraffins and other materials; inorganic PCMs include hydrated salts and metals. The last classification includes organic and inorganic eutectic mixtures. One paper [5] provided extensive databases of different materials used in heat storage. The MatWeb website was identified as the database containing the most materials, including their thermophysical properties and applications. 2021, 14, x FOR PEER REVIEW 2 of 18 less significant. This type of storage is commonly used in photovoltaic installations, where the storage time is usually about 12 h [4]. The amount of stored heat is proportional to the initial and final heating temperature difference as well as the specific heat of the storage material. This heat capacity is called sensible heat [6][7][8]. This feature is an important limitation of the heat capacity of the materials, in which heat storage is achieved only by increasing their temperature. The heat capacity may be increased by phase change of the heat storage material. In this case, the heat capacity is elevated by the value of latent heat [9][10][11]. In most cases, liquid to solid phase transformation (or vice versa) is used. Two advantages of phase transformation of heat storage material can be mentioned. The first one is the increased heat storage density compared to sensible heat storage materials. The second advantage is a constant phasechange temperature, which stabilizes the heat flux on both the charging and discharging side.

Classification and Properties of PCMs
Phase change materials (PCMs) can be classified as organic compounds, inorganic compounds and eutectic mixtures ( Figure 1). Organic PCMs include paraffins and other materials; inorganic PCMs include hydrated salts and metals. The last classification includes organic and inorganic eutectic mixtures. One paper [5] provided extensive databases of different materials used in heat storage. The MatWeb website was identified as the database containing the most materials, including their thermophysical properties and applications. One paper [5] describes in detail the criteria of PCM selection. The selection of PCM is determined by six basic principles related to the thermal, physical, chemical, technical, dynamic and economic properties.

−
Matching phase transformation temperature of PCM with the temperature of the process in which it is to be used. − Large specific heat determining the amount of stored sensible heat at the same temperature difference. − Large phase transition enthalpy determining the amount of stored latent heat at the same phase transition temperature. Sensible and specific heat affects the density of heat stored in PCM. − Large heat transfer coefficient between PCM and the heat transfer fluid. This coefficient depends on thermal conductivities of PCM, the fluid and the structural elements of the TES Unit. Its high value influences the charging and discharging rate of the TES Unit. − Congruent melting means that PCM must have a consistent chemical composition in different phase states. This prevents phase separation phenomena caused by density differences between solid and liquid states.
2. Physical Properties: One paper [5] describes in detail the criteria of PCM selection. The selection of PCM is determined by six basic principles related to the thermal, physical, chemical, technical, dynamic and economic properties.

1.
Thermal properties: − Matching phase transformation temperature of PCM with the temperature of the process in which it is to be used. − Large specific heat determining the amount of stored sensible heat at the same temperature difference. − Large phase transition enthalpy determining the amount of stored latent heat at the same phase transition temperature. Sensible and specific heat affects the density of heat stored in PCM. − Large heat transfer coefficient between PCM and the heat transfer fluid. This coefficient depends on thermal conductivities of PCM, the fluid and the structural elements of the TES Unit. Its high value influences the charging and discharging rate of the TES Unit. − Congruent melting means that PCM must have a consistent chemical composition in different phase states. This prevents phase separation phenomena caused by density differences between solid and liquid states.

Physical Properties:
− Chemical stability during the repeated charging/discharging process; there should be no segregation, chemical decomposition of PCM and other phenomena causing a change of PCM properties. This affects the maintenance of the TES Unit performance over a long period of time and increases its durability and reliability. − Absence or low corrosivity means that PCM and TES Unit construction material do not enter into chemical reactions with each other, which leads to a lack of degradation of both PCM and the construction material. This has the effect of increasing the durability and reliability of the TES Unit. − PCM should be non-toxic, non-flammable, non-explosive and safe to use and have the least environmental impact.

Economics:
− PCM should be easily available and cheap.

6.
Technical requirements − PCM should be checked in industrial conditions, should guarantee high reliability and should provide the smallest possible TES Unit size.
The abovementioned six basic principles are essential in the design of thermal energy storage systems and materials selection. In practical applications, it is difficult to select a PCM which matches all abovementioned principles. However, some of the properties may be considered as primary, such as the phase change temperature, latent heat, thermal stability, high thermal conductivity and low corrosivity. In this paper, the presented criteria were used to select the optimal PCM.

Applications of PCMs
A large variety of applications of PCMs for energy storage has been discussed, e.g., in buildings, automotive and refrigeration [12].
One of the more commonly used organic PCMs are paraffins. Paraffins have a wide range of phase transformation temperatures (from −182 • C to 135 • C) and the heat of phase transformation is 180 J/g to 230 J/g [13,14]. Due to their good properties and low price, they have found applications in many fields. In [15], the application of PCMs to reduce the energy consumption in a building is described. Octadecane paraffin and an organic material (BioPCM) were used. Paraffins are often used in solar energy systems. In [16], a novel system consisting of a trough solar collector heating PCM through a heat pipe is described. Paraffin wax with a melting point in the range of 57-61 • C was used as a PCM. The use of a finned surface in PCM was found to improve heat transfer, resulting in shorter charging/discharging times for the system. In [17], RT50 paraffin (melting point 50 • C) was used in a solar hot water generation system. PCM was located in a pipe-in-pipe heat exchanger. Based on numerical calculations, the heat flux stability of PCM located in the inner pipe was found to be better. In addition, the melting time was reduced by almost 50% by the special arrangement of the phase change material.
Inorganic PCMs can be divided into four types: hydrated salts, molten soles, metals and alloys. An overview of hydrated salts currently used for heat storage and their thermophysical properties is given in [24]. Hydrated salts are characterized by the high density of stored heat, low price, lack of toxicity and non-flammability. The disadvantages of hydrated salts include leakage during phase transition [25], overcooling [26], phase separation [23] and low thermal conductivity [27]. Despite the mentioned disadvantages, hydrated salts have found applications in water sub-heating and space heating systems. In [27], the heat storage density obtained using modified sodium acetate trihydrate was 2.5 times higher than in traditional water tanks. The thermophysical properties of 125 hydrated salts are reported in [28]. The properties were obtained from thermogravimetry analysis (TGA) and differential calorimetry analysis (DSC). However, not all the described hydrated salts could be used as PCMs; more than 80% of the salts did not meet the conditions to be used in TES systems.
Due to their properties, molten salts have become very popular in heat storage systems in recent years. The advantages of molten salts include a wide range of phase transition temperatures; good thermal conductivity; high density of stored heat; no undesired exothermic chemical reaction; good thermal stability at high temperatures; non-toxicity; and low price. In [29], the thermophysical properties of selected salts with melting points in the range of 100-400 • C for liquid energy storage applications were compiled. Experimental studies of the properties of salts with melting temperatures below 200 • C were carried out. A composition of 16 new salts was proposed and their properties were experimentally measured.
In the work [30], six new salts were proposed for concentrated solar power applications and operating temperatures in the range of 300-600 • C. The thermophysical properties and stability of the six materials were investigated. The phase transition temperature, phase transition enthalpy and specific heat were measured using a differential scanning calorimeter. The materials studied were inorganic eutectic PCMs, four based on carbonate salts (Na 2 CO 3 , K 2 CO 3 and Li 2 CO 3 ) and two based on chloride salts (NaCl, MgCl 2 and KCl). It was emphasized that the thermophysical properties of PCMs such as phase transition temperature, phase transition enthalpy and specific heat are usually calculated and discrepant with the results obtained from measurements.
A new innovative salt, NaCl-NaF-Na 2 CO 3 , is presented in [31], of which the thermophysical properties were determined experimentally. This salt is dedicated to the application in concentrated solar systems. The undoubted advantage of this salt is its low price, which is about 35% lower than the price of NaNO 3 -KNO 3 salt commonly used in solar systems. [32]. The salt is also thermally stable up to 750 • C, and even up to 800 • C during short periods of operation.
Due to simple design of such devices, they are popular in commercial and industrial heat storage systems. A disadvantage of shell-and-tube storage tanks is the poor thermal conductivity associated with the tank design and the thermophysical properties of the salts. This paper reviews various techniques to improve heat transfer.
Metals and alloys as heat carrier and heat storage material are used for medium to high temperatures. The paper [41] reviews recent research advances in latent and thermochemical heat storage at medium and high temperatures using metals and metal compounds. Metals and metal alloys used as PCMs are characterized by high density of stored heat, high thermal conductivity, good stability, low subcooling, low vapor pressure and small volume change [42]. A major limitation in the use of these materials is their high corrosivity, increasing with temperature, and high cost. The most commonly used PCMs include Al, Cu, Fe, Mg, Zn and their alloys. Attempts are being made to use these PCMs in solar power plants and industrial waste heat recovery systems. In [43], a magnesium-zinc alloy was used as PCM and laboratory scale tests were carried out. The TES Unit consisted of two concentric pipes with a metal alloy between them. Synthetic oil was used as HTF. No overcooling effect was observed, melting and solidification temperature was 342 • C. Experimental results were compared with those obtained from CFD numerical modeling. It was found that a limiting factor of heat transfer is the oil inside the pipe and not the thermal permeability of metal PCM. The use of a two-phase fluid as HTF was proposed as a solution to this problem.
The use of phase change material reduces the fluctuation of heat flux on the heat source side. However, in industrial thermal plants, automation systems are additionally used to stabilize the heat transfer process. These systems usually operate based on traditional PID-type controllers, but artificial neural networks (ANNs) are increasingly used for this purpose [44][45][46][47][48][49][50][51].
ANNs are used for performance prediction in nonlinear systems with many inputs. ANN consists of processing elements called neurons, which can be thought of as a nonlinear mathematical function. Each neuron is connected to other neurons through directed communication links with specific weights. The weights represent the information used by the network to solve problems. The weights of each communication link are given by learning the network. Each neuron applies an activation or transfer function to its input, which is the sum of the weighted input signals to obtain the output signal [51]. Historical data (off-line) or measured data (on-line) are used to learn the neural network. Based on the historical data, ANN is able to predict selected parameters of the heat storage system. In industrial applications, ANNs are usually a master layer that changes the settings of PID controllers.
In [46], ANN was used to predict the porosity of a metal foam located in PCM. In [47], the heat transfer from PCM (RT42 paraffin) to a heat sink made of aluminum was experimentally studied. ANN was used to predict the Nusselt number during PCM melting. The maximum difference between experimental and ANN predicted data was less than 6.0%. ANNs have also been used in solar power plants. In [49], ANN was used in a solar thermal system for domestic hot water generation and space heating. ANN predicted the stratification temperature in a hot water tank with average relative errors of 1.09-1.18%. ANNs are quite commonly used in photovoltaic systems [49,[52][53][54][55].
The aim of the study was to smooth the heat flux fluctuations, resulting from a variable heat source operation. For this purpose, a Hitec eutectic salt phase change material was used, which melts at a nearly constant temperature. While Hitec salt was used as HTF in solar plants [34], there is no literature information concerning application of Hitec salt as PCM for large-scale energy storage.
In the large-scale industrial applications of energy storage systems, PID-based control systems are commonly used. The most significant drawback of PID controllers is their poor performance in the control of nonlinear and unpredictable processes. This problem may be solved by the use of ANN, which allows to enhance the control quality in case of the abovementioned processes. However, large-scale application of energy storage systems with ANN control has not been sufficiently studied in the literature.
To enhance the smoothing effect, a classical control system based on PID controllers was supported by ANN. The TES Unit was supplied with steam at a constant temperature and variable mass stream, while a discharging side was cooled with water at a constant mass flow rate.

Description of TES Installation
To perform the study, a pilot installation was built, the main component of which was a TES Unit filled with PCM. The aim of the installation was to check the possibility of supplying the absorption chiller (AbCh) with the heat from the TES Unit under the conditions of variable heat flux on its charging side, as well as under the conditions of non-charging of the TES Unit. Figure 2 shows a schematic of the installation with thermal and flow parameters marked at key points. The TES Unit was charged by 200 • C, 0.4 MPa steam supplied by a combined heat and power plant. Maximum mass flow rate of the steam was equal to 1.5 Mg/h. The mass flow rate of steam supplying the TES Unit was controlled by valve V1, while the mass flow rate of cooling water on the discharging side, was controlled by varying the speed of pump P1. The heat received from the TES Unit was directed to the district heating network. Due to the requirements of AbCh, the water temperature at the inlet and outlet of TES Unit had to have a constant value of 98 • C and 88 • C, respectively. For this reason, an additional mixing node was installed on the discharging side. their poor performance in the control of nonlinear and unpredictable processes. This problem may be solved by the use of ANN, which allows to enhance the control quality in case of the abovementioned processes. However, large-scale application of energy storage systems with ANN control has not been sufficiently studied in the literature.
To enhance the smoothing effect, a classical control system based on PID controllers was supported by ANN. The TES Unit was supplied with steam at a constant temperature and variable mass stream, while a discharging side was cooled with water at a constant mass flow rate.

Description of TES Installation
To perform the study, a pilot installation was built, the main component of which was a TES Unit filled with PCM. The aim of the installation was to check the possibility of supplying the absorption chiller (AbCh) with the heat from the TES Unit under the conditions of variable heat flux on its charging side, as well as under the conditions of non-charging of the TES Unit. Figure 2 shows a schematic of the installation with thermal and flow parameters marked at key points. The TES Unit was charged by 200 °C, 0.4 MPa steam supplied by a combined heat and power plant. Maximum mass flow rate of the steam was equal to 1.5 Mg/h. The mass flow rate of steam supplying the TES Unit was controlled by valve V1, while the mass flow rate of cooling water on the discharging side, was controlled by varying the speed of pump P1. The heat received from the TES Unit was directed to the district heating network. Due to the requirements of AbCh, the water temperature at the inlet and outlet of TES Unit had to have a constant value of 98 °C and 88 °C, respectively. For this reason, an additional mixing node was installed on the discharging side.
Both charging and discharging pipes type P245GH [56] were made of SS316L stainless steel. The pipes were insulated with mineral wool with a thermal conductivity of 0.047-0.500 W/mK (at 100 °C). NOCCHI DHR 2-50 T, with parameters qV = 3.0 m 3 /h, H = 12 m, P = 0.5 kW, was used as the P1 water pump.  Both charging and discharging pipes type P245GH [56] were made of SS316L stainless steel. The pipes were insulated with mineral wool with a thermal conductivity of 0.047-0.500 W/mK (at 100 • C). NOCCHI DHR 2-50 T, with parameters q V = 3.0 m 3 /h, H = 12 m, P = 0.5 kW, was used as the P1 water pump.

Description of the TES Unit
The TES Unit was constructed from a 2630 × 1028 × 950 mm container, filled with PCM ( Figure 3). Inside the container, there were two separate sets of charging and discharging pipes, immersed in the PCM. This design solution prevented the mixing of charging HTF and discharging HTF. In order to improve the heat transfer, fins were placed on the charging pipes. The charging pipes were made in a U-shape to compensate for thermal expansion. Figure 4 shows a view of the charging and discharging side pipes of the TES Unit.
The TES Unit was constructed from a 2630 × 1028 × 950 mm container, filled with PCM ( Figure 3). Inside the container, there were two separate sets of charging and discharging pipes, immersed in the PCM. This design solution prevented the mixing of charging HTF and discharging HTF. In order to improve the heat transfer, fins were placed on the charging pipes. The charging pipes were made in a U-shape to compensate for thermal expansion. Figure 4 shows a view of the charging and discharging side pipes of the TES Unit.
For the construction of the TES Unit, materials made of SS316L stainless steel [57] were used, and the inner pipes and tank body were made of this steel.  The selected PCM was the Hitec salt mixture [33,34,58,59] with a mass composition of 53% potassium nitrate KNO3, 40% sodium nitrite NaNO2 and 7% sodium nitrate NaNO3. This salt has been tested in practice and has excellent thermophysical properties, as well as being non-toxic and safe for humans. The thermophysical properties of the salt mixture were determined using a differential calorimetry (DSC) [60,61] and thermogravimetry (TGA) [62,63] with a NETZSCH STA 449 Jupiter thermal analyzer. The The TES Unit was constructed from a 2630 × 1028 × 950 mm container, filled with PCM ( Figure 3). Inside the container, there were two separate sets of charging and discharging pipes, immersed in the PCM. This design solution prevented the mixing of charging HTF and discharging HTF. In order to improve the heat transfer, fins were placed on the charging pipes. The charging pipes were made in a U-shape to compensate for thermal expansion. Figure 4 shows a view of the charging and discharging side pipes of the TES Unit.
For the construction of the TES Unit, materials made of SS316L stainless steel [57] were used, and the inner pipes and tank body were made of this steel.  The selected PCM was the Hitec salt mixture [33,34,58,59] with a mass composition of 53% potassium nitrate KNO3, 40% sodium nitrite NaNO2 and 7% sodium nitrate NaNO3. This salt has been tested in practice and has excellent thermophysical properties, as well as being non-toxic and safe for humans. The thermophysical properties of the salt mixture were determined using a differential calorimetry (DSC) [60,61] and thermogravimetry (TGA) [62,63] with a NETZSCH STA 449 Jupiter thermal analyzer. The For the construction of the TES Unit, materials made of SS316L stainless steel [57] were used, and the inner pipes and tank body were made of this steel.
The selected PCM was the Hitec salt mixture [33,34,58,59] with a mass composition of 53% potassium nitrate KNO 3 , 40% sodium nitrite NaNO 2 and 7% sodium nitrate NaNO 3 . This salt has been tested in practice and has excellent thermophysical properties, as well as being non-toxic and safe for humans. The thermophysical properties of the salt mixture were determined using a differential calorimetry (DSC) [60,61] and thermogravimetry (TGA) [62,63] with a NETZSCH STA 449 Jupiter thermal analyzer. The obtained measurement results indicated that the salt properties deviate to some extent from the literature data. In [33,59,64], the melting point was given as 142 • C, whereas the one obtained from measurements was 150 • C. The enthalpy of the phase transformation reported in [59] was 80 kJ/kg, while that obtained from measurements was 122 kJ/kg, which increased the heat capacity of TES Unit by about 50% at the same volume of PCM. This confirms the thesis of [30]: in real applications the properties of PCM obtained from measurements should be used because of discrepancies with calculated data. For the measured enthalpy of the phase transition, the heat capacity of the TES Unit was about 500 MJ. Figure 5 represents following layers of the steam and water flow control system. The ANN is the layer overriding the operator panel, safety system and flow control system. obtained measurement results indicated that the salt properties deviate to some extent from the literature data. In [33,59,64], the melting point was given as 142 °C, whereas the one obtained from measurements was 150 °C. The enthalpy of the phase transformation reported in [59] was 80 kJ/kg, while that obtained from measurements was 122 kJ/kg, which increased the heat capacity of TES Unit by about 50% at the same volume of PCM. This confirms the thesis of [30]: in real applications the properties of PCM obtained from measurements should be used because of discrepancies with calculated data. For the measured enthalpy of the phase transition, the heat capacity of the TES Unit was about 500 MJ. Figure 5 represents following layers of the steam and water flow control system. The ANN is the layer overriding the operator panel, safety system and flow control system. The main loop of the program is responsible for the control of the controller state. The control algorithm includes three steps: controller state update, control of the measured values that were exceeded in the TES Unit and the control output on the system actuators (valves, inverter). The ANN communication block gathers data from the measurement system and adjusts the settings of the PID controllers.

Description of the Control System with ANN
Flow meters for measuring steam and water volume flows, temperature and pressure sensors were placed in the system on the charging and discharging side. Moreover, inside the TES Unit, the temperature sensors were placed at selected points to measure the temperature distribution. Figure 6 shows a schematic of the TES measurement system. The main loop of the program is responsible for the control of the controller state. The control algorithm includes three steps: controller state update, control of the measured values that were exceeded in the TES Unit and the control output on the system actuators (valves, inverter). The ANN communication block gathers data from the measurement system and adjusts the settings of the PID controllers.
Flow meters for measuring steam and water volume flows, temperature and pressure sensors were placed in the system on the charging and discharging side. Moreover, inside the TES Unit, the temperature sensors were placed at selected points to measure the temperature distribution. Figure 6 shows a schematic of the TES measurement system. The steam flow rate on the charging side was measured with a Vortex type flow meter with an accuracy of <±0.5% of the measured value. An ultrasonic flowmeter with an accuracy of <±1% of the measured value was used to measure the water flow rate on the charging side. Temperature measurements were made using class B resistance temperature sensors with an accuracy of ±0.3%. Water and steam pressures were measured using a piezoresistive pressure transducer with an accuracy of ±0.3%. accuracy of <±1% of the measured value was used to measure the water flow rate on the charging side. Temperature measurements were made using class B resistance temperature sensors with an accuracy of ±0.3%. Water and steam pressures were measured using a piezoresistive pressure transducer with an accuracy of ±0.3%. A classical control system based on PID controllers implemented in a Siemens S7-1200 PLC was used to control the TES pilot installation. The system consisted of four control systems: steam mass flow rate control system, outlet water temperature control system, inlet water temperature control system and water pressure stabilization system. The task of the steam flow control system was to provide a variable mass flow with the set characteristics at the inlet to TES Unit. The outlet water temperature control system maintained a constant temperature by varying the mass flow rate of water flowing through the TES Unit. The inlet water temperature control system maintained a constant temperature by varying the degree of mixing of hot and cooled water. On the other hand, the water pressure stabilization system prevented the pressure on the d side from decreasing so that water evaporation did not occur.

Implementation of ANN
Due to the high variability of the mass flow rate of the charging steam and, thus, the controlling operating conditions of the installation, an overriding layer based on artificial neural networks (ANN) was used for control. Two applications of artificial neural networks were proposed for the TES installation: as a predictor of the outlet water temperature of the TES Unit and as a predictor of the charge state of the TES Unit. A recurrent neural network [65], along with the predictive controller, was implemented in a Siemens PM1207 PLC.
The ANN type selection has been restricted by the technical possibility of simple and direct implementation in the PLC controller and the possibility of operation with the classic PID controller. Due to the industrial-scale application of the TES installation, high stability and reliability of the controller is required. For this reason, Smith's predictor [66][67][68][69] has been selected, as a simple and well-established solution.
Due to the accurate prediction of outlet water temperature values by the ANN, the controller is able to respond faster to the variable charging heat flux. This is essential in case of dynamic and irregular charging heat flux variations.
The structure of the ANN is composed of three layers: a hidden layer, an input layer and an output layer. The hidden layer is used for computing the weighted sum of parameters from the input layer, which is being transformed using a nonlinear sigmoid transition function [70,71]. The hidden layer contains six neurons.
In order to predict the TES Unit charge state, the input data involved: supplied heat, discharged heat and PCM temperature. The applied ANN was composed of 32 neurons in the input layer: the water inlet and outlet temperature, the water flow rate and the temperature in the bottom and top layers of PCM. The ANN output layer included the water output temperature. The prediction of the water temperature covered 30 s ahead.
The ANN training procedure has been performed using the resilient backpropagation method [72]. In total, 90% of the 6500 samples in the dataset was used for the training procedure. After the training procedure, the ANN has been tested with reference to the remaining 10% of the samples. Figure 7 represents the results of the ANN training. The horizontal axis represents the real values of the outlet water temperature from the TES Unit, while the vertical axis represents the predicted temperature values.
In case of ideal prediction, all sample points (blue) would fit the red-colored line. The results indicate that the ANN prediction quality is accurate.
The ANN training procedure has been performed using the resilient backpropagation method [72]. In total, 90% of the 6500 samples in the dataset was used for the training procedure. After the training procedure, the ANN has been tested with reference to the remaining 10% of the samples. Figure 7 represents the results of the ANN training. The horizontal axis represents the real values of the outlet water temperature from the TES Unit, while the vertical axis represents the predicted temperature values. In case of ideal prediction, all sample points (blue) would fit the red-colored line. The results indicate that the ANN prediction quality is accurate.

Testing Methodology
Tests on the TES pilot installation consisted of setting a variable steam mass flow rate at the inlet to the TES Unit and keeping the water mass flow rate at the outlet constant. Temperatures and pressures on the charging and discharging side were measured. The value of the supply steam temperature was constant at 200 °C, while the mass flow rate varied from 0 to 1725 kg/h. The mass flow rate of water and its temperature at the inlet and outlet of the TES Unit were constant. The water flux was equal to 1800 kg/h, while the temperatures at the inlet and outlet of the TES Unit were equal to 88 °C and 98 °C, respectively.
Based on the results of the measurements of the mass flow rate, temperature and pressure, the time characteristics were plotted. The experiment was carried out by stabilizing the water temperature with traditional PID control systems and additionally with a master control system using ANN.
The specific heat of steam and water was calculated from the averaged values of temperatures and pressures between the inlet and outlet of TES Unit. The heat fluxes at the TES Unit inlet and outlet were then determined according to:

Testing Methodology
Tests on the TES pilot installation consisted of setting a variable steam mass flow rate at the inlet to the TES Unit and keeping the water mass flow rate at the outlet constant. Temperatures and pressures on the charging and discharging side were measured. The value of the supply steam temperature was constant at 200 • C, while the mass flow rate varied from 0 to 1725 kg/h. The mass flow rate of water and its temperature at the inlet and outlet of the TES Unit were constant. The water flux was equal to 1800 kg/h, while the temperatures at the inlet and outlet of the TES Unit were equal to 88 • C and 98 • C, respectively.
Based on the results of the measurements of the mass flow rate, temperature and pressure, the time characteristics were plotted. The experiment was carried out by stabilizing the water temperature with traditional PID control systems and additionally with a master control system using ANN.
The specific heat of steam and water was calculated from the averaged values of temperatures and pressures between the inlet and outlet of TES Unit. The heat fluxes at the TES Unit inlet and outlet were then determined according to: where Q is the heat flux, c p is the specific heat and ∆T is the temperature difference between the inlet and outlet. In order to determine the degree of heat flux smoothing, their mean standard deviations were calculated and histograms were prepared. Figure 8a shows the time-dependent characteristics of the TES Unit charge-side steam and discharge-side water temperatures during operation with only PID controllers. In all time axis plots, a normalized coordinate related to the length of the analyzed measurement series was used, which was 1039.5 min for this experiment. Figure 8b, on the other hand, shows the time characteristics of steam and water mass flow rates on the charging and discharging sides of the TES Unit, respectively. The drop in steam temperature from a value of about 200 • C below 50 • C is due to the absence of steam flow. The TES Unit at this time was not charging while a constant mass flow rate of water was discharging. time axis plots, a normalized coordinate related to the length of the analyzed measurement series was used, which was 1039.5 min for this experiment. Figure 8b, on the other hand, shows the time characteristics of steam and water mass flow rates on the charging and discharging sides of the TES Unit, respectively. The drop in steam temperature from a value of about 200 °C below 50 °C is due to the absence of steam flow. The TES Unit at this time was not charging while a constant mass flow rate of water was discharging. Based on the values of the mass flow rate, specific heat and temperature difference between the inlet and outlet of TES Unit, the heat flux of steam and water were calculated from Equation (1), after which the time characteristics were plotted. The characteristics were given in normalized coordinates. The steam heat flux was at its maximum value of 62 kW, while for water the heat flux varied from 7.75 kW to 41 kW.

Plant Control using PID Controllers
Histograms were also plotted (Figure 9a,b), showing the number of times the heat flux value occurred within a given range of values. For plotting the histograms, the heat flux intervals were assumed to be 0.5 kW in the range of values from 0 to 65 kW. Based on the values of the mass flow rate, specific heat and temperature difference between the inlet and outlet of TES Unit, the heat flux of steam and water were calculated from Equation (1), after which the time characteristics were plotted. The characteristics were given in normalized coordinates. The steam heat flux was at its maximum value of 62 kW, while for water the heat flux varied from 7.75 kW to 41 kW.
Histograms were also plotted (Figure 9a,b), showing the number of times the heat flux value occurred within a given range of values. For plotting the histograms, the heat flux intervals were assumed to be 0.5 kW in the range of values from 0 to 65 kW. From Figure 9a, it can be seen that the heat flux of the charging steam is distributed over the range of values from 0 to the maximum value. Due to a control method of the steam mass flow rate, the largest number of values are in the initial interval and the final intervals. On the other hand, Figure 9b shows that for cooling water, the largest number appears for a value of 7.75 kW, then decreases and ends at a value of 41 kW. The narrower range of heat flux variation is due to the operation of the TES Unit in the phase transition region, and thus, indicates the smoothing properties of PCM. Figure 10a shows the time characteristics of the temperature change of the factors on the charging and discharging sides of the TES Unit for the control system using artificial neural networks. The length of the measurement series was 270 min.  Figure 9b shows that for cooling water, the largest number appears for a value of 7.75 kW, then decreases and ends at a value of 41 kW. The narrower range of heat flux variation is due to the operation of the TES Unit in the phase transition region, and thus, indicates the smoothing properties of PCM. Figure 10a shows the time characteristics of the temperature change of the factors on the charging and discharging sides of the TES Unit for the control system using artificial neural networks. The length of the measurement series was 270 min.

Installation Control using ANN
appears for a value of 7.75 kW, then decreases and ends at a value of 41 kW. The narrower range of heat flux variation is due to the operation of the TES Unit in the phase transition region, and thus, indicates the smoothing properties of PCM. Figure 10a shows the time characteristics of the temperature change of the factors on the charging and discharging sides of the TES Unit for the control system using artificial neural networks. The length of the measurement series was 270 min.

Installation Control using ANN
As described in the previous section, the normalized time is given on the axes of all characteristics. Figure 10b shows the mass flow rate of steam and cooling water, while Figure 11b shows the normalized time characteristics of the heat flux of these factors.  As described in the previous section, the normalized time is given on the axes of all characteristics. Figure 10b shows the mass flow rate of steam and cooling water, while Figure 11b shows the normalized time characteristics of the heat flux of these factors. From the presented characteristics, it can be seen that there are smaller fluctuations of the water heat flux when using the additional control with the superordinate layer using ANN than when using the traditional control. In Figure 12a,b, the heat flux histograms are shown, from which it can be seen that the steam heat flux is distributed over the entire range of values, while the water heat flux is distributed between 25 kW and 35 kW. This clearly indicates that the use of additional ANN control smooths the variable heat flux better. of the water heat flux when using the additional control with the superordinate layer using ANN than when using the traditional control. In Figure 12a,b, the heat flux histograms are shown, from which it can be seen that the steam heat flux is distributed over the entire range of values, while the water heat flux is distributed between 25 kW and 35 kW. This clearly indicates that the use of additional ANN control smooths the variable heat flux better. To determine the degree of smoothing of the heat fluxes, their mean value and standard deviation were calculated for both steam and water heat fluxes (Table 1). It can be seen from Table 1 that the use of PCM and TES Unit operation in the phase transition temperature range smooths the variable heat flux. In addition, a better degree of smoothing is obtained by using control with ANN. To determine the degree of smoothing of the heat fluxes, their mean value and standard deviation were calculated for both steam and water heat fluxes (Table 1). It can be seen from Table 1 that the use of PCM and TES Unit operation in the phase transition temperature range smooths the variable heat flux. In addition, a better degree of smoothing is obtained by using control with ANN. The charging heat flux standard deviation (Table 1) was equal to 25.5 kW, while the discharging heat flux was equal to 11.2 kW. This means that the fluctuations were reduced by 56%. The application of the ANN resulted in an enhanced smoothing effect. In case of ANN control, standard deviation of the charging heat flux was equal to 17.7 kW while the discharging heat flux was equal to 2.8 kW. This means that the fluctuations were reduced by 84%. The application of the ANN control system has a significant impact on smoothing the heat flux variations.
The observed smoothing effect results from the application of PCM, which undergoes the phase change. Melting and solidification of PCM occurs at a nearly constant temperature. Due to the constant temperature of the heat source, the temperature difference between PCM and HTF is also constant. This results in a constant heat flux. The application of ANN allows to predict the TES Unit outlet water temperature and the TES Unit charge state. This results with enhanced smoothing of the heat flux.

Uncertainty Analysis
Based on the accuracy of measuring instruments, an error in determining the heat flux of steam and water was calculated. The total differential method has been applied to determine the error, which is represented by the following equation: ∆Q = c p ∆T ∆q m + q m ∆T ∆c p + q m c p ∆t. ( The maximum values of the relative and absolute errors of the measured and determined quantities are given in Table 2. The heat fluxes of steam and water were determined with an error smaller than 7.6%.

Conclusions
This paper presents an innovative method for smoothing heat flux fluctuations using the PCM thermal energy storage unit controlled by ANN. The aim of the study was to investigate the influence of the application of PCM and ANN on discharging heat flux fluctuations. The analysis involved comparing the standard deviation of charging and discharging heat flux in case of ANN and PID-only control.
The research was performed on the pilot large-scale installation. The main component was the TES Unit with a heat capacity of 500 MJ, which was charged by a variable heat flux. Hitec salt was used as the phase change material with a composition of 53% KNO 3 , 40% NaNO 2 and 7% NaNO 3 . The three-layer ANN, based on sigmoid function neurons with Smith's predictor, was used to control the installation. The training procedure was carried out using the resilient backpropagation method. The training quality was verified by comparing the predicted and real temperature values. The prediction quality was found to be accurate. The results indicate that the use of a TES Unit with PCM allows to smooth the variable heat flux.
The standard deviation of the charging heat flux was equal to 25.5 kW, while the discharging heat flux was equal to 11.2 kW, which means that the fluctuation was reduced by 56%. The application of the ANN resulted with an enhanced smoothing effect. In case of ANN control, standard deviation of the charging heat flux was equal to 17.7 kW while the discharging heat flux was equal to 2.8 kW, which means that the fluctuation was reduced by 84%. The application of ANN control system has a significant impact on smoothing the heat flux variations.
The smoothing effect of the application of PCM results from the PCM phase change. Melting and solidification of PCM occurs at a nearly constant temperature. Due to the constant temperature of the heat source, the temperature difference between PCM and HTF is also constant. This results in a constant heat flux. The application of ANN allows to predict the TES Unit outlet water temperature and the TES Unit charge state. This results in enhanced smoothing of the heat flux.