Effective estimation of the state-of-charge of latent heat thermal energy storage for heating and cooling systems using non-linear state observers

An effective quantification of the energy absorbed and supplied by latent heat thermal energy storage (LHTES) units is critical to maximise their use within thermal systems. An effective control of the charging and discharging processes of these units demands an accurate estimation of the state-of-charge (SoC). However, a direct and reliable SoC estimation requires incorporating internal sensors to monitor the temperature gradient of the phase change material (i.e. the storage medium), resulting in higher instrumentation costs and technical specifications. These issues may be relieved by adopting state observers for SoC estimation to drastically reduce the number of measurements. This paper bridges this gap by presenting a novel and direct method for estimating the SoC of LHTES units, both for heating and cooling applications, based on a non-linear state observer. The observer is based on a simple one-dimensional dynamic model of the thermal store and the thermophysical properties of the storage medium and the heat transfer fluid, which are usually provided by manufacturers. This enables the estimation of the internal temperatures of the LHTES unit and, in turn, SoC calculation. The observer implementation is simple as it requires three measurements only as input variables (i.e. the mass flow rate and the input and output temperatures of the heat transfer fluid). The SoC estimation approach is assessed through dynamic simulations of two LHTES units: one for a heating application and one for a cooling application. The results show that the SoC can be estimated with root mean square and mean absolute errors of less than 4.6% and 3.62%, respectively, compared with experimental measurements.


Introduction
Thermal energy storage (TES) considers a range of technologies capable of storing thermal energy, enabling the energy stored to be used at a later stage when required.This is achieved by modifying the enthalpy of the storage medium by heating or cooling it.A thermal store is used to act as a buffer between supply and demand schedules.Making an analogy with electricity networks, a TES unit operates essentially as a thermal battery.Depending on the specific TES technology, the thermal energy can be used within hours, days or even months later, and deployed into industrial processes, an individual household, buildings, a district network, or perhaps a community, either for heating and cooling applications or for power generation.For instance, water tanks are widely used in households for domestic hot water provision [1], while in a district cooling system, ice tanks may be adopted [2].A thermal store can be also used as a buffer tank to avoid the short cycling of a heat pump in a heating system [3].
TES systems may play a critical role in decarbonising the building and industrial sectors [4][5][6].The operational flexibility afforded by incorporating TES devices into thermal systems enables the efficient management of energy supply and demand through the implementation of load shaping techniques (e.g.peak demand, load shifting, valley filling) [7,8].In turn, this flexibility also allows for the use of low-carbon technologies, such as heat pumps [9,10], the adoption of intermittent renewable energy sources [11] including solar collector systems [12] and concentrated solar power [13], and the integration of different energy vectors -bringing substantial economic and environmental benefits.For instance, a TES plant may be used to facilitate the optimal integration of solar energy into heating systems and reduce their operational cost [14].In the same vein, the feasibility of adopting TES systems in buildings has been assessed in [15] for a wide variety of technologies.
The adoption of TES units requires implementing effective control strategies to regulate their operation.For instance, model predictive control has been employed to analyse the optimal charging period of thermal stores while reducing operational costs and achieving thermal comfort [16,17].On the other hand, optimisation algorithms have been https://doi.org/10.1016/j.apenergy.2022 implemented to achieve an optimal operation of the TES units [18,19].Nevertheless, these analyses do not consider key variables such as temperatures and mass flow rates.Therefore, to guarantee their Refers to Weibull PDF performance during charging and discharging processes, automatic controllers must be designed considering the thermal-hydraulic dynamics of the TES units and the type of sensors available for monitoring the state-of-charge (SoC).For instance, hot water tanks, which use the sensible heat of water to store thermal energy, can be effectively charged or discharged by monitoring the temperature gradient of the water within the tank.To this end, temperature sensors are mounted through the tank's height.The SoC is then estimated using the temperature measurements and the specific heat capacity of water [20].Unlike sensible heat TES (SHTES) units, latent heat TES (LHTES) devices store thermal energy using a heat transfer fluid (HTF) and the heat capacity of a storage medium, termed phase change material (PCM).A PCM is a substance that releases or absorbs a large amount of energy during its phase transition, which takes place at a nearly constant temperature [21,22].These materials have a wide range of applications, including solar cookers [23], transport refrigeration vehicles [24], wallboards to store solar heat in buildings [25], thermocrete walls (concrete modification with PCM incorporation) [26], and ceiling boards for active cooling in refurbished buildings [27], to name only but a few.Solid-liquid PCM is the most suitable storage medium to be used for an LHTES unit [4].Compared to SHTES units, the substantially larger energy density per unit of mass of the storage medium [28,29] makes LHTES units an often-employed technology to support the efficient management of thermal systems.However, effectively monitoring the temperature gradient in a PCM is arguably costly and challenging.The phase change causes the total volume of the PCM to temporarily fractionate into liquid and solid volumes irregularly distributed in the unit.Thus, reliable and accurate temperature measurements are only achieved when several sensors are installed [21,30].
Methods for determining the temperature gradient in a PCM using a reduced number of temperature sensors have been presented in the literature [31].However, their limited accuracy results in significant SoC estimation errors.Instead, other methods for indirectly determining the SoC have been developed.For instance, pressure sensors may be used to estimate the SoC by establishing a relation between the pressure changes and the change in the phase fraction of a PCM [32].For ice tanks where the PCM is water, an often-used approach is based on the difference in density between the liquid and frozen water.A differential pressure transducer is employed to measure the change in volume when ice is formed.Although the method is simple and highly accurate (with a reported 2% accuracy of the full scale of the sensor), the amount of ice may be over or understated due to the presence of air pockets or compression effects [33].The interested reader is referred to [31] for a detailed analysis of all these methods, including advantages and drawbacks.
To circumvent the costly implementation of internal temperature sensors, a concept borrowed from modern control theory may be adopted for the management of TES units [20,34,35]: the state observer (also called state estimator).An observer is a computer-implemented dynamic system used to estimate the internal state of the system under study from measurements of its inputs and outputs [36].Thus, it can estimate the temperature gradient in a PCM using only the input and output temperature and flow rate measurements of the HTF circulated through the storage unit.The use of observers has been analysed mainly for electrical energy storage systems [37][38][39], with limited application in thermal stores.Ref. [20] is relevant though, where an observer is used to estimate the internal temperature of a hot water tank (i.e. a SHTES system).
An observer to estimate the temperature distribution of an LHTES unit requires a mathematical model of the thermal store which accurately reproduces its dynamic behaviour.For instance, one-dimensional (1-D) and two-dimensional (2-D) models of TES units have been presented in [40,41].Their modelling approach is based on the energy balance and spatial discretisation of the unit's volume into a finite number of volumes or nodes (also called control volumes).A set of ordinary differential equations (ODEs) describes the behaviour of the temperatures of the HTF and PCM in each node.This approach is suitable for observer design, as the temperatures fully describe the internal state of the system.Then, the SoC can be calculated using the estimated values of all PCM nodes.
A pioneering work using state estimation was presented in [35], where a Kalman filter and a spatially discretised 2-D model of an LHTES unit are used.Here, the SoC is defined as the mean liquid phase fraction of the PCM, which is a function of the internal temperature of the storage unit.SoC calculation requires the solution of 12 partial differential equations, which are simplified to a set of low-order nonlinear ODEs using spatial discretisation.Although the phase fraction describes accurately the energy released or absorbed during phase change, an integral of the function representing this process needs to be evaluated, which substantially increases the computation time.To incur less computational effort, the specific enthalpy of the PCM can be used instead to describe the thermal dynamics as it has a direct relation with energy balance [40,42].Ref. [31] follows this approach, where the SoC is calculated using the specific enthalpy of the phase transition of the PCM; however, the results obtained have limited accuracy.
To the best of the authors' knowledge, the use of state observers to estimate the SoC of an LHTES unit which considers the whole temperature range of the storage medium within the unit is restricted to [35,43].Despite their good accuracy, these observers are based on extended Kalman filters, which involve a highly complex design process.In other words, simple non-computationally demanding methods are yet to be developed to estimate the internal temperature of LHTES units to, in turn, enable SoC calculation with a reduced number of sensors.
To bridge the aforementioned research gap, this paper presents a methodology for obtaining the SoC of practical LHTES units for heating and cooling applications.The approach employs a simple non-linear observer to accurately estimate the temperatures of the PCM and the HTF.As the observer is based on a 1-D spatially discretised model of the thermal store defined by a set of ODEs, this has a significantly simpler structure than the observer models reported in [35,43], which are based on 2-D models.
Experimentally verified models available in the public literature have been adopted for observer design.The LHTES unit model reported in [42] is used for the heating application, while the model of an ice TES tank in [40] is used for the cooling application.The SoC is calculated using the temperatures estimated by the observers and the specific enthalpy curve of the PCM (obtained from the characterisation of the specific heat curve) and implemented as a look-up table.This is important as it reduces the computation time compared to integrationbased approaches such as those in [35].The SoC estimation method was verified using the data reported in [41], where the total stored energy and the SoC are provided.
The main contributions of this paper are summarised as follows: • The design and implementation of a non-linear observer to estimate the internal temperature gradient of the PCM and the HTF in LHTES units.• A method to calculate the SoC of LHTES units based on the outputs of the observer and the characterisation of the specific heat curve of the PCM.• The verification of the SoC calculation method using simple 1-D dynamic models of LHTES units available in the open literature (and which have been experimentally validated).

Description and modelling approach of LHTES units
The dynamic modelling approach used in this paper is dictated by the internal structure of the LHTES unit.Different structures for commercial units are available.For instance, the PCM can be encapsulated in containers with different shapes, such as spheres, cylinders, or slabs, with a HTF flowing through the space between the capsules to charge or discharge the unit.However, tube arrangements submerged into the PCM may be adopted to enable the flow of the HTF [44].Metallic fins within the PCM may be incorporated to enhance the heat transfer between the HTF and the PCM [41].
The thermal stores for heating and cooling applications adopted in this paper possess an internal structure of non-encapsulated PCM with submerged HTF tubes -with relevant parameters and properties provided in Appendix B. Fig. 1 shows a shell and tube TES unit for heating applications.The shell is filled with a high-density polyethylene PCM (Rigidex HD6070EA) [45].This PCM exhibits an enthalpy hysteresis, where the melting temperatures for charging (120 • C) and discharging (135 • C) are different.A high-performance synthetic organic transfer medium is used as the HTF, which flows through 72 parallel tubes within the thermal store.The dynamic model of the TES unit was obtained following a 1-D modelling approach.Further details on the mathematical model are available in [42] for the interested reader.
For cooling applications, an ice TES tank manufactured by Calmac was adopted.The ICEBANK 1098 tank model uses water as the PCM, harvesting ice to store cooling.The internal tube arrangement is shown in Fig. 2 and consists of 34 spiralled tube pairs made of polyethylene.A mixture of water and glycol at 34% is used as the HTF.The dynamic 1-D model of the ice TES tank is available in [40].In the reference, model verification was conducted by comparing experimental results reported in [46,47] with simulation results obtained with the model.
The 1-D models reported in [40,42] constitute the basis for the observer designs presented in Section 3 of this paper.The rationale behind the choice of these rather different units is to demonstrate the capabilities and simplicity of the developed methodology, to explore its adaptability to different internal geometries and different types of PCM, and to show the feasibility of the use of non-linear observers to estimate internal temperatures, without the use of additional sensors, to enable SoC calculation for both a hot and a cold store.For completeness, the modelling approach in these references is briefly explained next.

Dynamic modelling
The heat transfer occurring during charging and discharging of the LHTES units is described in [40,42], where the energy balance between the HTF and the PCM is assessed and the overall heat transfer coefficient is calculated.Equal hydraulic and temperature conditions  are assumed for all the tubes in the TES units.Thus, the analysis done over a single tube in the shell and tube TES unit and for a pair of tubes in the ice TES tank is considered as representative of the behaviour of all tubes.In both cases, the tanks are assumed to be well-insulated and, thus, heat losses are assumed negligible.
To apply energy balance it is necessary to define a control volume.Fig. 3 shows the lateral and frontal cross-sectional views of a single internal tube with the boundaries of a control volume.This includes the HTF inside the tube flowing at a certain temperature   , where   [J/s] is the heat injected by the HTF crossing the tube,  [W/(m 2• C)] is the overall heat transfer coefficient,   [m 2 ] is the heat transfer area,  [ • C] denotes temperature, and subscripts ' ' and '' stand for HTF and PCM.Further details on the derivation of ( 1) and (2) can be found in Appendix A for the interested reader.The heat transfer produced by the forced convection between the HTF and the internal wall of the tube, and conduction in the radial direction into the tube and the PCM are included in the calculation of  .The reader is referred to [42] for further details.On the other hand, the ice TES tank model presented in [40] includes two tubes within the control volume.Thus, three heat transfer coefficients are considered: between the HTF and PCM, between the PCM volumes around the tubes, and between the PCM volume that achieves the phase change and the PCM volume that stays at 0 • C.
Note: The calculation of  is carried out dynamically for both the model of the LHTES unit and the observer, which are discussed in Section 3.This means that changes in the mass flow rate and the temperature of the HTF are considered by this calculation.In addition, the values of the thermophysical properties of the HTF, which are temperature dependent, are updated according to the value of the temperature of the HTF at any given time.Additional details on the calculation of  are provided in Appendix C.
The last stage of the modelling approach is to discretise the volume of the tubes into  nodes (or discrete volumes).The discretisation over a single tube of the shell and tube TES unit is schematically shown in Fig. 4. For the ice TES tank, for clarity, the discretisation process is schematically shown in Fig. 5(a) for a single spiralled tube out of the tube pair.However, to simplify the modelling, these tubes (denoted '' and '') are assumed unrolled [40].This is shown in Fig. 5(b), with the discretisation of the two unrolled tubes shown in Fig. 5(c).Therefore, the energy balance described by ( 1) and ( 2) is established for each node of a single tube of the shell and tube unit and tubes '' and '' of the ice TES tank.Each node thus includes two ODEs for the model of the shell and tube TES unit and four ODEs for the model of the ice TES tank.The corresponding total number of equations is, respectively, 2 and 4.
The modelling approach used in [40]- [42] simplifies the mathematical representation of an LHTES unit by assuming an equal internal Fig. 3. Lateral (left) and cross-sectional (right) view of a tube inside an LHTES unit with the definition of control volume.White and red arrows show the radial direction of the heat flow between the HTF and the PCM.For a heat flow from the PCM to the HTF, which implies a higher PCM temperature, the white arrows illustrate the heat transferred to the HTF.Conversely, for a higher HTF temperature, the red arrows denote the heat transferred to the PCM.The sign convention is adopted based on the energy balance of the HTF volume.flow and an equal temperature distribution for all tubes throughout the tank.Thus, the energy balance implementation for a single tube in the shell and tube TES unit and for two tubes in the ice TES tank is representative of the dynamic behaviour for all tubes (i.e.72 tubes in total for the shell and tube TES unit and 34 pairs of enrolled tubes for the ice tank).Accurate simulation results are reported in the three references following this approach.

On the differences between the two TES configurations
Although both TES units employ a similar internal structure (i.e.tubes submerged into a PCM), the material of the tubes is substantially different and the tubes are arranged in a different way.The ice tank has pairs of spiralled tubes made of polyethylene, while the shell and tube TES unit has straight tubes made of the carbon alloy steel P235GH.In addition to impacting the number of differential equations representing the heat transfer between the HTF and the PCM (i.e. the ice tank considers twice as many equations compared to the shell and tube TES unit if the same number of nodes is used for the discretisation process), the tube arrangement has an effect in the overall heat transfer coefficient.For both units, heat losses were not considered.However, for modelling simplicity of the ice tank, the tubes were assumed unrolled.Although these assumptions simplify the calculation of the overall heat transfer coefficient, an error is caused.This has been minimised by using a correction factor defined through a fitting process of the simulation results with the available experimental data.(For further information on the calculation of the heat transfer coefficient, the reader is referred to Appendix C.) The PCM being employed is another important difference in the TES units under study, where water is used for the ice tank and polyethylene RigidexHD6070EA for the shell and tube unit.In addition, a mixture of water-glycol at 34% is employed as the HTF for the ice tank, whereas for the shell and tube TES unit this is the synthetic organic heat transfer medium Marlotherm SH [49].

Description of the observer
Since the TES models adopted in this paper exhibit a high nonlinearity arising from the temperature dependence of the thermophysical properties of the PCM and the HTF, such as specific heat and density, non-linear observers are required to estimate the internal temperatures.

Observer design
Using state-space notation, the models of the LHTES units are described in compact form by where ,  and  are the input, state, and output vectors, ẋ =  (, ) is the set of non-linear ODEs of the dynamic model, and  () is the scalar system output, which is the output temperature of the HTF.Given the different number of tubes used to formulate the models of the two TES units adopted in this paper, the design of their respective observer is explained separately.

Note:
In non-linear control theory, variable  is commonly used to define the output vector of a system.To avoid confusion with the notation for specific enthalpy (ℎ) and specific latent heat (ℎ  ), variable  is adopted instead to denote a vector of system outputs (and  for a single output).
The observer structure is defined as [36] where x is the estimated state vector and  is a diagonal matrix of constant coefficients. must be designed to ensure the estimation error for all states converges to zero (ẽ =  − x = 0).The observer is defined using the same differential equations (i.e. (, )) of the system model.

Design for the shell and tube TES unit
Using the notation adopted in [42], ,  and  are defined as where ṁ [kg/s] is the mass flow rate of the HTF (water),   , [ • C] is the temperature of the HTF at the inlet of the tube and   , [ • C] at the outlet of the tube,   , [ • C] is the temperature of the HTF in the th node, and  , [ • C] is the temperature of the PCM in the th node (see Fig. 4).A schematic for the observer implementation is shown in Fig. 6.The design of  requires analysing the observability of the system.This is challenging considering the high non-linearity of the system.However, positive entries of  guarantee the estimation error converges to zero.For the shell and tube TES unit, the state observer is described by (8) given in Box I, where   [J/(kg • C)] is the specific heat,  is the number of nodes,  [kg/m 3 ] is the density, and  [m 3 ] is the volume in each node.Details on the derivation of ( 8) have been provided in Appendix D. The diagonal elements of  4), explicitly appearing in (8), were heuristically defined as 0.1.The specific heat was characterised using probability density functions (PDFs), with details given in Appendix E. All parameters related to the thermophysical properties of the HTF and the PCM are provided in Appendix B.

Design for the ice TES tank
The model of the ice TES tank considers a pair of tubes forming a counter-flow heat exchanger.This is representative of the 34 counterflow heat exchangers formed by all the spiralled pairs of tubes (68 tubes in total), as shown in [40].The notation in [40] for the temperatures of the nodes is used, where subscripts ' ' and '' stand respectively for the HTF and the PCM (in this case water), and subscripts '' and '' are used to distinguish between each tube.Since energy balance is applied for each pair of tubes, four states are included in each node when the system is discretised and, thus, the total number of states is 4.Using state-space notation,  is defined by As the mass flow rate of the HTF is assumed to be evenly distributed in both tubes, only two variables are included in : where   , is the input temperature of the HTF and ṁ is the total mass flow rate of the HTF entering the tank divided by the total number of tubes.
The internal tank configuration gives rise to two system outputs, which are the temperatures of the HTF at the opposite ends of the tubes, and the observer must consider both (although in the real system both HTFs merge through the system headers to form a single output [40]).The inlet of tube '' and the outlet of tube '' are located in node 1. Conversely, the outlet of tube '' and the inlet of tube '' are located in node .Thus,  is defined as Fig. 7 shows a schematic of the observer.Based on the mathematical model of the tank and the definition of , , and , the observer is described by (12) given in Box II, where index  is equal to 4 ( − 1) + 1 ∀  ∈ {1, 2, … , },  is the overall heat transfer coefficient between the HTF and water,   is the heat transfer coefficient between the control volumes of water of both tubes, and   is the heat transfer coefficient between the portion of water with the phase change completed and the portion remaining at 0 • C [40].As in the design for the shell and tube unit,  was here obtained heuristically and its diagonal elements were set as 0.5.Derivation of ( 12) follows a similar procedure as that for (8), which is provided in Appendix D.

Observer implementation
The observers were implemented in MATLAB/Simulink.Charging and discharging processes of the TES units were simulated to assess the observer performance under different operating conditions.

Observer performance for the shell and tube TES unit
The operating conditions reported in [41] were used.These include the input temperature profile of the HTF (  , ) for charging and discharging and a constant mass flow rate of 1.02 kg/s for both processes.The PDFs used in the calculation of the specific heat have been adapted from a Weibull distribution for charging and a Lognormal distribution for discharging [41], and are provided in Appendix E. The TES model and the non-linear observer were each discretised into 20 nodes, which was deemed sufficient to achieve accurate simulation results without incurring significant computation time [42].
Fig. 8 shows the responses of the observer for the simulation of the charging process.The temperatures of the HTF and PCM for node  are given by the system states   , =  2−1 and  , =  2 .For clarity, only the temperatures in nodes 1, 11 and 20 are provided, namely ] Box II.
conditions of the observer states were set to 50 To further assess the performance of the observer, the plots of the estimation error for all states are shown in Figs.8(c) and 8(d).The error converges to zero in about 1 min for the temperatures of the HTF (see Fig. 8(c)) and in approximately 5 min for the temperatures of the PCM (Fig. 8(d)).These convergence times are deemed acceptable considering the slow dynamics exhibited by TES units [21].
The estimation errors for the temperatures of the HTF exhibit a behaviour that changes with the node location.For the nodes closer to the HTF inlet, the error converges to zero faster than for those closer to the HTF outlet.On the other hand, a slower but more homogeneous response is presented for the error of the PCM temperatures.conditions of the system reported in [41], the observer was able to reduce the estimation error to zero in 1 min for the HTF temperatures and in about 5 min for the PCM temperatures.It can be concluded that the observer has a comparable dynamic performance for charging and discharging even when the specific heat curve for each process is different.

Observer performance for the ice TES tank
The thermophysical properties of the HTF (glycol at 34%) are defined in [40] and reproduced in Appendix B, whereas the specific heat curve for the PCM (water) is provided in Appendix E. The initial temperature conditions of the observer were set to 0 • C. For clarity, only the temperatures and estimation errors for tube '' are plotted (i.e.numbers starting in 1 and 2, increasing in steps of 4, denoting the node temperatures of the HTF and the PCM, where subscript '' stands for tube '').
Fig. 10 shows the results for the charging process, where a constant mass flow rate of 20 kg/s was adopted and the input temperature of the HTF was reduced from 12 Fig.10(a) shows the input and output temperatures of the HTF.The HTF and PCM actual and estimated temperatures (dashed traces and solid traces, respectively) are shown in Fig. 10(b), where it is evident that the observer successfully tracks the behaviour of the system.As shown in Fig. 10(c), the estimation error of the HTF temperatures converges to zero in less than 150 s, while for the PCM temperatures this occurs in around 300 s (see Fig. 10(d)).
Fig. 11 shows the simulation results for discharging.The estimation errors converge to zero in a similar timeframe as for charging, which is an acceptable performance given the slow dynamics of the ice TES tank.

SoC calculation method and its implementation
For simplicity and clarity in the explanation of the SoC calculation method, a normal PDF is adopted to describe the specific heattemperature curve of a fictional PCM.Then, the implementation of the method is described and its suitability for spatially discretised dynamic models of LHTES units is discussed.

SoC calculation
The specific latent heat is the energy necessary per unit of mass to produce a change of phase in a PCM [28].For instance, the specific latent heat to bring a mass of water at atmospheric pressure from liquid to solid and vice-versa is 334 kJ/kg [40].During the phase change, the release or absorption of thermal energy occurs at a specific range of temperature.Thus, the storage capacity of an LHTES unit   [J] is calculated using the total mass of the PCM  [kg] and its specific latent heat ℎ  [J/kg] as A specific enthalpy-temperature curve shows how the energy within a PCM suddenly increases or decreases during phase change [35].Thus, it is possible to determine the internal energy of a storage unit at a particular PCM temperature.Let the specific enthalpy-temperature curve be defined by and the specific latent heat as where  empty [ • C] and  full [ • C] are the temperatures of the PCM that limit the transition zone between phases.The specific heat-temperature curve is obtained by differentiating (14), which is necessary as the modelling approach followed in this paper is based on energy balance.However, some PCM manufacturers directly provide a specific heattemperature curve, which is obtained by implementing methods such as differential scanning calorimetry or three-layer calorimetry [50,51].
As reported in the literature, this curve may be analytically defined using temperature dependent PDFs [35,40,41].
To further explore this idea, let the specific heat-temperature curve of a fictional PCM with a latent heat value of 5 kJ/kg be described by Eq. ( 16) is effectively a Gaussian PDF scaled by the factor 5000 to represent the latent heat value of the PCM, where  and  are dimensionless parameters (which, respectively, stand for standard deviation and mean).Scaling is necessary as a Gaussian PDF is a normal distribution which has an integral (area below the curve) equal to 1.The specific enthalpy-temperature curve following integration of ( 16) is given as where 'erf' is the Gauss error function, which is a complex variable function.Within the context of this work,  and  are used to define the shape of the specific heat-temperature curve.For instance, a value of  = 20 would be used to define a melting point at 20 • C, whereas  would be adjusted to modify the width of the curve.Fig. 12(a) shows the specific heat-temperature curve of the fictional PCM described by (16), with  = 20 and  = 1.A peak temperature of 20 • C is exhibited.In addition, the specific latent heat is well-defined within the temperature range  empty = 16.5 • C and  full = 23.5 • C.This means that the fictional PCM stores heat when it is liquid.A trapezoidal numerical integration method was adopted to evaluate the specific enthalpy-temperature curve (17) using the MATLAB function trapz.Then, it was divided by the specific latent heat, namely |ℎ|.Eq. ( 16) enables calculating the amount of specific latent heat by integrating it from  empty to the current PCM temperature   [ • C].This value may be employed to determine the SoC of the PCM.If (17) denotes the specific enthalpy-temperature curve for a heating application, the full discharge of the storage unit occurs when solidification has been completely achieved (  ≤  empty ).Conversely, full charge happens when the PCM is liquid at   ≥  full .Thus, for this fictional where the integral of the specific heat-temperature curve evaluated from  empty to   is divided by the specific latent heat ℎ  to quantify the percentage of energy (in form of latent heat) remaining in the PCM.The SoC for three different temperatures is shown in Fig. 13 to illustrate this idea.In the figure, the stored latent heat is labelled ℎ ,SoC alongside the corresponding value of SoC.For a cooling application, energy is stored when the PCM solidifies at low temperatures and released when it melts at higher temperatures. full and  empty thus swap their position in (18) compared to the heating application, yielding

Implementation of the SoC calculation method
The spatially discretised model presented in Section 2 facilitates this process.If the temperatures of the control volumes in the TES unit models are known, the SoC of the tank is obtained by calculating the average SoC of all  nodes of the tank [35] with where   stands for the temperature at node .To illustrate the SoC calculation method, a pipe wrapped with a PCM layer is used.This is shown in Fig. 14.During discharging, a 'cold' HTF is circulated inside the pipe to extract the heat stored by the 'hot' PCM.The temperature of the PCM closer to the HTF inlet will decrease faster than the temperature of the PCM near the outlet.Therefore, the latent heat in the PCM control volumes near the inlet will be smaller than for those control volumes close to the outlet, as shown in Fig. 14.Correspondingly, the evaluation of the integral of the specific heattemperature curve will change as the temperature of the PCM varies during the discharging process.
Based on the previous discussion, the SoC calculation requires evaluating (14) subjected to continuous variations in the temperature of the PCM.By having several control volumes, this calculation may become computationally intensive.To significantly reduce the computational burden, a look-up table was adopted instead, which enables an easier implementation of the method.This approach is illustrated in Fig. 15.
The estimation of the PCM temperatures using the non-linear observer presented in Section 3 enables SoC calculation using the approach presented in Fig. 15.Fig. 16 shows a schematic summarising the complete process for SoC calculation, where temperature and mass flow rate measurements (  , ,   , and ṁ ) are fed to the observer.The observer outputs, namely the estimated values of PCM temperatures, are used to calculate the SoC using (20).As shown in the example of Section 4.1, obtaining the SoC curve exclusively requires the specific heat curve of the PCM.This implies that the internal structure of the LHTES unit does not impact SoC calculation.Therefore, a successful implementation of the SoC calculation method depends on the performance of the non-linear observer.
The specific heat curves used to obtain the look-up tables for SoC calculation were adopted from [40,41], where the models of the LHTES units were verified against experimental results for charging and discharging processes.The parameters of these curves are shown in Appendix E. The definition of  empty and  full for the curves is based  (a) Specific heat-temperature curve of the PCM (water) for the ice TES tank as in [40] and SoC calculation using the look-up table.(b) Specific enthalpy calculation using (14).
on the latent heat value reported in [40] for water and in [41] for Rigidex HD6070EA.Other specific considerations of SoC calculation for the shell and tube TES unit and for the ice TES tank are discussed in the following subsections.

SoC calculation for the shell and tube TES unit
This was done using the PDF included in Appendix E (Gumbel minimum distribution) and illustrated in Fig. 17.Fig. 17(a) shows the specific heat-temperature curve of the PCM (Rigidex HD6070EA, see the red trace labelled  , G ).The look-up table for SoC calculation was obtained using the specific heat-temperature curve, Eq. ( 18), and the specific latent heat ℎ  G = 259.95kJ/kg.ℎ  G was obtained using (15) and represented by the area below the specific heat-temperature curve using a red shading.The transition zone where the latent heat is absorbed or released and the trace of the SoC (see blue trace) fully match.This that once the PCM has a temperature  empty = 109.5• C, the TES unit is considered as fully discharged (SoC = 0%).full charge when the PCM temperature is above  full = 138 • C (SoC = 100%).Fig. 17(b) shows the specific enthalpy-temperature curve (denoted ℎ  G ) obtained using (14), where  empty and  full are clearly identified to highlight the specific latent heat.

SoC calculation for the ice TES tank
A PDF included in Appendix E (Lognormal distribution) is used to define the specific heat-temperature curve for water in [40] and reproduced in Fig. 18(a).The specific latent heat (ℎ  = 334 kJ/kg) is represented by the area below the specific heat-temperature curve (see blue trace labelled  , ) using a light blue shading.This area is limited by  full = −5.7 • C and  empty = 0 • C. The figure includes the SoC calculation using (19), whose value is 100% when the water reaches temperature  full (i.e.full charge).A complete discharge occurs when the water has a temperature above  empty .For this cooling application, the SoC curve and the location of  full and  empty are inverted when compared with the heating application.The specific enthalpy-temperature curve (denoted ℎ  ) is shown in Fig. 18(b), where the specific latent heat ℎ  is also highlighted and limited by  full and  empty .

Quantification of sensible and latent heat
Both sensible and latent heat contribute simultaneously to the charging and discharging processes of LHTES units.Distinguishing the contribution from each heat source in a real system is a challenging task, although a good mathematical model of the thermal store may enable this.Sensible heat was not considered in ( 18) and ( 19) to prevent overcomplicating the SoC calculation.However, clearly identifying its contribution will help assessing the validity of the presented method.
The contribution of sensible heat depends on the initial and the operating conditions of the storage units.For instance, if the initial temperature of the PCM is far from  empty or  full , the available sensible heat is considerably large.Conversely, if the initial temperature is close to  empty or  full , it is significantly low.
The quantification of the heat provided by the latent and sensible heat was obtained using the node temperatures of the PCM and Eq. ( 2) while restricting it with  empty and  full .Thus, the latent heat contribution   [J/s] to the heat transfer process for heating applications is given by whereas for cooling applications it is described by The sensible heat   [J/s] contribution for a heating application is calculated with whereas for a cooling application it is defined by These amounts were compared with the total HTF power   during charging and discharging, which is defined by The specific contribution from each heat source is graphically identified for both LHTES units in the following subsections.

Shell and tube TES unit
The mathematical model presented in [42] was used to simulate charging and discharging processes, with results shown in Fig. 19.For charging, the HTF input temperature was increased to a maximum value   , = 150 • C, while all initial HTF and PCM node temperatures were set to 100 • C. Conversely, for discharging the HTF input temperature was decreased to a minimum value   , = 100 • C with all initial conditions of temperature set at 150 • C. For both simulations, a constant mass flow rate of 1.03 kg/s was used.Figs.19(a) and 19(d) show the input and output temperatures of the HTF (  , with a red trace and   , with a blue trace) for charging and discharging, respectively.Only the PCM temperatures of nodes 1 and 20 are presented for clarity.
Figs. 19(b) and 19(e) show the charging and discharging power   (see black traces) obtained with (23).The total energy provided by the latent heat is given by the area below the power curve   (red traces).Similarly, the total energy provided by the sensible heat is given by the area below   (blue traces).The shaded red area   [J] explicitly highlights the latent heat and the shaded blue area   [J] the sensible heat.For the discharging process, to prevent showing negative values of power as   , is lower than the initial conditions of the node temperatures, the results were multiplied by −1.
Dashed orange lines were added in Figs.19( As shown in Fig. 19(b), sensible heat also contributes to charging once the temperature of the PCM in the first node reaches  full (when full charging has been almost achieved).This means that the increment of the temperature for all other nodes reaching  full will be achieved by the absorption of sensible heat only.
Figs. 19(c) and 19(f) show the total energy provided by the HTF for charging and discharging, respectively, in terms of the heat source.Latent heat contributes 11.6 kWh (76.3%) and sensible heat 3.3 kWh (21.7%) of the total energy (15.2 kWh) for either process.These values were obtained by calculating the integral of the corresponding power curves shown in Figs.19(b) and 19(e).

Ice TES tank
A simulation with a 20-nodes discretised model was conducted to quantify the energy stored during charging and discharging processes of the ice TES tank, with results shown in Fig. 20.A HTF input temperature varied between −6 • C to 12 • C was used.Constant mass flow rates of 20 kg/s and 5 kg/s were used for charging and discharging processes, respectively.Figs.20(a) and 20(d) show the temperature of the HTF entering and leaving the tank (  , with a red trace and   , with a blue trace) and the PCM temperatures (i.e.water) in nodes 1 and 20 of the mathematical model.In this case, the power during charging was multiplied by −1 to prevent showing negative values.
empty and  full have been highlighted in Figs.20(a), 20(b), 20(d) and 20(e) to show the beginning and the end of the release or absorption of latent heat.The contribution of sensible heat is shown at the beginning of the charging process (see Fig. 20(b)).This starts to decrease when the temperature of the PCM in the first node ( ,1 ) reaches  empty , and finishes when the temperature in the last node ( ,20 ) also reaches this value.Conversely, the latent heat contribution starts when  ,1 =  empty and finishes when  ,20 =  full .Once the PCM is completely charged, only sensible heat is present.For discharging, the sensible heat contribution lasts until  ,20 =  full (see Fig. 20(e)).The latent heat contribution starts when  ,1 =  full and lasts until  ,20 =  empty .given by the HTF and contributions from latent heat and sensible heat; (c) total energy and energy provided by latent heat and sensible heat.Discharging process: (d) input and output temperatures of the HTF and temperature of PCM nodes 1 and 20; (e) thermal power given by the HTF and contributions from latent heat and sensible heat; (f) total energy and energy provided by latent heat and sensible heat.
The energy provided by each heat source is shown in Fig. 20(c) for charging and Fig. 20(f) for discharging, which were obtained by calculating the integral of the power curves (given in Fig. 20(b) and Fig. 20(e), respectively).A similar contribution of sensible heat is shown in both processes since the same operating range for   , was used and the same initial conditions for HTF and PCM nodes were adopted.The latent heat accounts for 72% of the total energy absorbed or released.
Note: As the phase change in a PCM occurs irregularly throughout the volume of an LHTES unit, accurately quantifying the sensible heat contribution to the SoC is a challenging task.In addition, the contribution of sensible heat to the energy stored or supplied by the unit will depend on the charging and discharging processes defined by the input temperature of the HTF.To prevent the SoC calculation method from becoming too complex, the transition zone where the phase change of the PCM occurs is considered only, which is well-defined by the PCM's specific heat curve.This approach also exploits the main attribute of a PCM, which is its large storage capacity during phase change.Such an idea is supported by commercial manufacturers, which define the storage capacity of a TES unit as the total mass of the PCM times its latent heat value [52][53][54].The temperature range of the phase change is critical for selecting an LHTES unit for a specific application as this determines the ideal charging and discharging temperatures to support a thermal process.

Results
To assess the performance of the SoC calculation method presented in this paper, simulations of the mathematical models of the LHTES units discussed in Section 2 were conducted and compared against experimental data available in the literature.Validity of these models was verified in [40,42].Fig. 21(a) shows the schematic illustrating the approach here followed.Screenshots depicting the implementation in MATLAB/Simulink of the model of the TES unit, the non-linear observer, the definition of the SoC look-up table, and the charging/discharging power calculation are shown in Fig. 21(b).MATLAB/Simulink S-functions were used to code both the dynamic model of the thermal store and its non-linear observer To assess the performance of the non-linear observer and the SoC calculation method, the next steps were followed for a sequence of charging and discharging processes: (1) definition of the look-up table for SoC calculation based on the specific heat-temperature curve of the PCM (using (18) for the heating application or (19) for the cooling application), (2) quantification of the sensible and latent heat for charging an discharging using ( 21) and (22), and (3) SoC calculation using observer outputs (estimated PCM temperatures) and employing (20).

Shell and tube TES unit
To verify the performance of the 1-D dynamic model, its observer and the SoC calculation method, simulation results during a sequence of charging and discharging processes were compared with experimental data presented in [41].The experimental data is constituted by three key measurements: the output temperature of the HTF, the total supplied energy by the TES unit and its SoC.A discretised mathematical model of the TES unit with 20 nodes was employed in the simulation.Similarly, the non-linear observer was discretised into 20 nodes.A constant mass flow rate of 1.09 kg/s was used.The initial temperature conditions for the model of the TES unit and the observer states were set to 80 • C and 50 • C, respectively.A Gumbel minimum distribution was used to define the specific heat-temperature curve (see Section 4.2 and Appendix E).The plots of the simulated and the experimental results are shown together for a graphical comparison.To provide a numerical quantification of the agreement between simulation results with the experimental data, an error analysis was conducted.This analysis consists of calculating the root mean square error (RMSE) and the mean absolute error (MAE) for each variable with respect to the experimental data.
Fig. 22(a) shows the HTF input and output temperature profiles   ,, (red trace) and   ,, (blue trace) used in the experiments, where subscript '' is used to denote experimental data.The HTF input temperature profile was fed to the mathematical model.The output temperature of the HTF obtained through simulation is shown (solid black trace, defined by the temperature of the last node,   ,20 =   ,, , where subscript '' denotes simulation results).The estimated temperature of the last node of the model is an output of the observer (dashed grey trace, T,20 =   ,, ), also shown in the graph.An error analysis of the simulated output temperature of the HTF (  ,, ) with respect to the experimental data (  ,, ) demonstrates the accuracy of the 1-D model, with an RMSE of 2.13 • C and an MAE of 1.81 • C, which represent 1.33% and 1.13%, respectively, of the maximum value this variable may take (i.e.160 • C, which is the maximum input temperature of the HTF).Moreover, the observer can estimate the HTF output temperature (  ,, ) with an estimation error (  ,, −   ,, ) quickly converging to zero during the simulation period (see Fig. 23).
The The observer had a successful performance for the whole simulation period, reducing all estimation errors to zero in less than 300 s even when there is a difference of 30 • C between the initial conditions of the TES unit model and observer.The match of the experimental profile   ,, (blue trace) with the estimated output temperature of the HTF   ,, (dashed grey trace) is further assessed by calculation of the RMSE and MAE, yielding 2.21 • C and 1.84 • C, which respectively represent 1.38% and 1.15% of the maximum value for HTF temperature.These values are very close to those obtained from the simulation model, providing confidence in both the performance of the 1-D model adopted in this paper and the non-linear observer design.
The total stored energy (  ) and the SoC calculated during the simulation were compared with those reported in [41], with results shown in Fig. 24.Experimental (  , ) and simulated total energies (  , ) are shown in Fig. 24(a).In this case, the RMSE is 0.57 kWh and the MAE is 0.49 kWh, which represent, respectively, 3% and 1.6% of the maximum value (18.5 kWh).These small errors confirm the high accuracy of the mathematical model.The contributions of latent heat and sensible heat,  , and  , , to   , are presented in Fig. 24(b).[41] with the SoC given by the proposed method.
The experimental data for SoC reported in [41] (see dashed red trace SoC  ) and the SoC calculated with the method presented in this paper (blue trace SoC  ) are very close through the whole simulation, exhibiting an RMSE of 4.58% and an MAE of 3.61%.The contribution of the energy provided by the latent heat (solid black trace  , ) is also shown in Fig. 24(b) to afford a graphical comparison.The match between the graphs and the small errors give confidence in the validity of the presented method for SoC calculation, which only considers the contribution of latent heat -facilitated by the successful performance of the non-linear observer as previously described.
For completeness, Table 1 summarises the information on the error analysis.

Ice TES tank
The non-linear observer and the SoC calculation method were assessed for two complete charging and discharging cycles of the ice TES  Fig. 26 shows the observer estimation errors.The observer performance is adequate, with the errors converging to zero within the first 200 s of the simulation.However, the errors of the PCM temperatures slightly increase at around 4.5 h (see the zoomed-in enclosed plot within Fig. 26(b)).These increments occur when the phase change of the PCM has been completed and only sensible heat is present.This produces a sudden change in temperature, as seen in the profiles of states  2 ,  42 and  78 in Fig. 25(c).However, the observer reduces all errors to zero after approximately 1.5 h.The maximum value of these errors before convergence to zero is about 0.1 • C, without causing significant impact in SoC calculation.The total energy (  , ) and the contribution of latent heat ( , ) and sensible heat ( , ) are shown in Fig. 27(a).At the end of each discharging process the total latent heat supplied as cooling is 310 kWh.This means that the stored energy increases to release the cooling.Conversely, the stored energy decreases during charging process as the PCM temperature is decreased to harvest ice.Therefore, to compare with the SoC curve, the energy provided by latent heat is multiplied by −1.Fig. 27(b) shows the latent heat profile ( , ) and the SoC.The initial value of SoC is 0% because the initial conditions of the observer were set to 0 • C. Nevertheless, after the estimation error is reduced to zero the SoC agrees well with the latent heat profile.This verifies the accuracy of the presented method for SoC calculation using the estimated values of the PCM temperature inside the ice TES tank.

On the limitations of the presented work
The simulation results presented in the paper have demonstrated that simplified dynamic 1-D models of LHTES units are sufficient to estimate the internal temperatures of the storage medium.Nevertheless, this process heavily depends on the availability of the thermophysical properties of the elements involved in the heat transfer: the HTF, the PCM and the material of the tubes enclosing the HTF.Although some PCM and TES manufacturers provide this information, in some cases it may not be publicly available.In addition, both the 1-D dynamic model and its non-linear observer require the parameters and dimensions of the internal geometry of the thermal store.This information may not be disclosed by manufacturers.
Although the non-linear observers and the SoC calculation methods achieve a successful performance when adopting the 1-D models borrowed from [40,42], these in the end are simplified representations of complex dynamic systems.For instance, some dynamic phenomena, such as supercooling, are not reproduced by the models.Supercooling occurs when a liquid does not solidify even if its temperature is lower than the crystallisation point [55], and this can be attributed to the primary nucleation of a PCM and the mechanism of crystal growth.However, the effects of supercooling are challenging to incorporate to 1-D or 2-D models.Investigating supercooling and its effect on SoC estimation is a topic that requires further investigation.
It should be noted that the presented method for SoC estimation was verified under specific operating conditions for charging and discharging.Conducting additional experiments which consider variations in the input temperature and mass flow rate of the HTF may help to increase reliability of the method for a wide operating range.In addition, verifying the SoC estimation method for thermal stores with a different internal geometry from the ones investigated in the paper would be desirable to extend the range of applications that could benefit from it.

Conclusions
The effective control over the charging and discharging processes of LHTES units is necessary to improve the performance of thermal systems where they are employed.To develop adequate control strategies that maximise the use of these thermal stores, SoC monitoring is critical.Following this line, a non-linear observer to estimate the temperatures of the HTF and PCM inside an LHTES unit and a SoC calculation method were presented and assessed in this paper.The accurate estimation of the internal states of the storage unit afforded by the state observer enables SoC calculation with no need to install internal temperature sensors.As it has been demonstrated, only the measurements of the mass flow rate and the input and output temperatures of the HTF are necessary for an accurate estimation.Thus, a costly direct measurement for SoC calculation is relieved by the proposed approach.
Two different LHTES units were analysed in this work.A shell and tube TES unit was investigated for a heating application and an ice TES tank was assessed for a cooling application.The performance of their respective observer was evaluated by comparing simulation results with experimental data available from references.The observer design was based on highly accurate and validated 1-D dynamic models (also available in the literature).These models are substantially simpler than representations requiring computational fluid dynamics.To initialise the observers, although there are no established criteria to define their initial conditions, setting up these values near the melting temperature of the PCM would speed up the initial estimation of the system states.Charging and discharging operation modes were assessed.Simulation results show a good performance of the observers for both applications, ensuring convergence of the estimation errors of the HTF and PCM temperatures to zero within 5 min.
The SoC was defined as the mean of the latent heat released (or absorbed) by the PCM inside the storage units.A look-up table for SoC calculation was implemented based on the specific heat-temperature curve and the PCM temperature.Such an approach reduces the computational burden from methods based on numerical integration.The presented SoC calculation method performs well using the observer's estimated temperatures.This is evidenced by the small errors in the SoC calculation when compared to the available experimental data, with values of less than 4.6% in RMSE and 3.62% in MAE.
The results in this paper demonstrate that an effective SoC calculation depends only on the availability of an accurate 1-D dynamic model of the TES unit and knowledge of the thermophysical properties of the PCM, which are usually provided by manufacturers.This was demonstrated using two LHTES units with different internal geometries and intended for different applications (one for heating and one for cooling).Thus, the SoC calculation approach based on a suitably designed observer represents a feasible and reliable option for the management of LHTES units.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.Note: An average value of the thermal conductivity of liquid water/ice is assumed during the phase transition, as the model in [40] does not calculate the liquid or solid fraction of water during phase change and only considers the energy released during this transition.
The thermophysical properties of the HTF (Marlotherm SH) are given by the following temperature dependent equations: The thermophysical properties of the HTF (mixture of water-glycol at 34%) are provided in polynomial form as [40]: where Pr  is the Prandtl number of the HTF.

Appendix C. Calculation of the overall heat transfer coefficient
This appendix presents a general procedure to calculate the overall heat transfer coefficient  for the 1-D dynamic model of a TES unit and its non-linear observer.The procedure is reproduced from [40]  where  is a correction factor.This correction factor is used to reduce the error given by the heat losses presented in an LHTES unit.In [40],  is also used to reduce the error from assuming that the spiralled tubes in the ice tank have been modelled as unrolled tubes.
The previous procedure can be employed to accurately calculate  and, thus, model different TES configurations.Moreover, the calculation of  is done dynamically, so this considers any changes in the operating conditions, such as varying flow rates and temperatures of the HTF.

Appendix D. Derivation of the non-linear observer
The observer structure employed in this work is defined in Eq. ( 4) within Section 3.For completeness, its implementation for the SoC calculation of the shell and tube TES unit is explained in this section.
The shell and tube TES unit is described by a set of ODEs represented by  (, ), where  stands for the states and  for the inputs of the system.The system states are the temperatures  of the discretised volumes of the HTF and the PCM.The 1-D dynamic model of the shell and tube TES unit is given by [42]  where subscripts ' ' and '' stand for the HTF and the PCM.The use of a state-space representation facilitates the design and implementation of an observer.To adopt a state-space notation, variable  is replaced by , which denotes a state variable within the state vector .For the TES unit, the number of nodes is defined by the system discretisation and represented by .Each node considers two temperatures:   and   .Each temperature represents a system state, and the number of the system states is 2.This way, the state-space representation is given by The next step in the design is defining the outputs of the system (within output vector ) that are used to feed the observer.For the shell and tube TES unit, only the output temperature of the HTF is needed.This is incidentally a system state, given by ) and replacing the state vector  by the vector with the estimated states x, the observer (8) is obtained.
A similar procedure was followed to develop the observer (12) of the ice TES unit, for which the 1-D dynamic model presented in [40] was adopted.

Fig. 2 .
Fig. 2. (a) Internal geometry of an ice TES tank showing the direction of the HTF in each level [40].(b) Location of the two external and two internal headers [48].
[ • C] and mass flow rate ṁ [kg/s], the PCM enclosing it, and the wall of the tube.The size of the control volume is defined by  through the length of the tube  [m].Thus, the rate of change of the energy stored by the HTF ( Ė [W]) and the PCM ( Ė [W]) is defined as

Fig. 5 .
Fig. 5. Tube arrangement for an ice TES tank (figures reproduced from [40]).(a) Single tube tank split into  nodes.(b) Unrolled tubes with the counter flow directions of the fluid and the ice growing in the first nodes for tube '' and the last note for tube '' (the white shading depicts ice formation).(c) Control volumes of both tubes.

Fig. 6 .
Fig. 6.Implementation of the non-linear state observer for the shell and tube TES unit.

Fig. 7 .
Fig. 7. Implementation of the non-linear state observer for the ice TES tank.

Fig. 9
shows the temperature of nodes 1, 11 and 20 during discharging.Although all initial temperature conditions of the observer were established uniformly at 50 • C, about 100 • C less than the initial

Fig. 8 .
Fig. 8. Performance of the observer for the shell and tube TES unit during the charging process.(a) Input and output temperatures of the HTF.(b) States of the system and its observer (HTF and PCM temperatures are shown for nodes 1, 11, and 20).Estimation errors for the node temperatures of the (c) HTF and (d) PCM.

Fig. 9 .
Fig. 9. Performance of the observer for the shell and tube TES unit during the discharging process: (a) Input and output temperatures of the HTF.(b) States of the system and its observer (HTF and PCM temperatures are shown for nodes 1, 11, and 20).Estimation errors for the node temperatures of the (c) HTF and (d) PCM.

Fig. 10 .
Fig. 10.Performance of the observer for the ice TES tank during the charging process.(a) Input and output temperatures of the HTF.(b) States of the system and its observer (HTF and PCM temperatures are shown for nodes 1, 11, and 20).Estimation errors for the node temperatures of the (c) HTF and (d) PCM.

Fig. 11 .
Fig. 11.Performance of the observer for the ice TES tank during the discharging process.(a) Input and output temperatures of the HTF.(b) States of the system and its observer (HTF and PCM temperatures are shown for nodes 1, 11, and 20).Estimation errors for the node temperatures of the (c) HTF and (d) PCM.

Fig. 12 .
Fig. 12.(a) Specific heat-temperature curve defined by a normal PDF.(b) Integral of the specific heat-temperature curve divided by the specific latent heat.

Fig. 12 (
Fig. 12(b) shows |ℎ|, where the minimum value of 0 (dimensionless) at 16.5 • C and the maximum value of 1 (dimensionless) at 23.5 • limit the transition zone between solid to liquid, labelled |ℎ  |.Eq.(16) enables calculating the amount of specific latent heat by integrating it from  empty to the current PCM temperature   [ • C].This value may be employed to determine the SoC of the PCM.If(17) denotes the specific enthalpy-temperature curve for a heating application, the full discharge of the storage unit occurs when solidification has been completely achieved (  ≤  empty ).Conversely, full charge happens when the PCM is liquid at   ≥  full .Thus, for this fictional

Fig. 15 .
Fig.15.Schematic of the method for SoC calculation through numerical integration and using a look-up table.

Fig. 16 .
Fig.16.Block diagram for the implementation of the SoC calculation method using a non-linear observer.

Fig. 17 .
Fig. 17.(a) Specific heat-temperature curve of the PCM for the shell and tube TES unit and SoC calculation using the look-up table.(b) Specific enthalpy calculation using (14).

Fig. 18 .
Fig. 18.(a) Specific heat-temperature curve of the PCM (water) for the ice TES tank as in[40] and SoC calculation using the look-up table.(b) Specific enthalpy calculation using(14).

Fig. 19 .
Fig.19.Simulation results for the shell and tube TES unit.Charging process: (a) input and output temperatures of the HTF and temperature of PCM nodes 1 and 20; (b) thermal power given by the HTF and contributions from latent heat and sensible heat; (c) total energy and energy provided by latent heat and sensible heat.Discharging process: (d) input and output temperatures of the HTF and temperature of PCM nodes 1 and 20; (e) thermal power given by the HTF and contributions from latent heat and sensible heat; (f) total energy and energy provided by latent heat and sensible heat.
a), 19(b), 19(d) and 19(e) to highlight when node 1 reaches temperature  empty = 109.5• C and when node 20 reaches  full = 138 • C.This was done to show when the contribution of latent heat starts and finishes.The absorption of latent heat thus initiates when the temperature of the first node of the PCM ( ,1 ) reaches  empty and the provision of sensible heat declines.The absorption of latent heat finishes when the last node of the PCM ( ,20 ) reaches  full .

Fig. 20 .
Fig. 20.Simulation results for the ice TES tank.Charging process: (a) input and output temperatures of the HTF and temperature of PCM nodes 1 and 20; (b) thermal powergiven by the HTF and contributions from latent heat and sensible heat; (c) total energy and energy provided by latent heat and sensible heat.Discharging process: (d) input and output temperatures of the HTF and temperature of PCM nodes 1 and 20; (e) thermal power given by the HTF and contributions from latent heat and sensible heat; (f) total energy and energy provided by latent heat and sensible heat.

Fig. 21 .
Fig. 21.(a) Block diagram of the LHTES unit model, non-linear observer and SoC look-up table.(b) Screenshot of the implementation in MATLAB/Simulink: S-function of the 1-D model of the TES unit, S-function of the non-linear observer, and SoC look-up table and calculation of the HTF power.
estimated states for nodes 1, 11 and 20 (x 1 , x21 and x39 for the HTF, x2 , x22 and x40 for the PCM) are shown in Fig. 22(b) and presented alongside the states from the mathematical model of the TES unit ( 1 ,  21 and  39 for the HTF, and  2 ,  22 and  40 for the PCM).As it can be seen, the states of the model are accurately estimated by the observer during the simulation.Fig. 23 shows the estimation error for all 40 states, with Fig. 23(a) illustrating the HTF temperatures and Fig. 23(b) the PCM temperatures.

Fig. 22 .
Fig. 22.(a) Experimental input temperature of the HTF, and experimental, simulated, and estimated output temperature of the HTF for the shell and tube TES unit.(b) Comparison of the actual state and estimated state variables of the mathematical model and the non-linear observer for nodes 1, 11 and 20.

Fig. 23 .
Fig. 23.Estimation errors for the shell and tube TES unit during a sequence of charging and discharging processes.Temperatures of the (a) HTF and (b) PCM.

Fig. 24 .
Fig. 24.(a) Experimental and simulated total stored energy by the shell and tube TES unit, and energy provided by latent heat and sensible heat.(b) Comparison between the SoC and the energy provided by the latent heat reported by[41] with the SoC given by the proposed method.

Fig. 25 .
Fig. 25.Results for the ice tank.(a) Mass flow rate profile.(b) Input and output temperature of the HTF given by the mathematical model, and estimated output temperature of the HTF.(c) Comparison between the actual state variables and the estimated state variables for nodes 1, 11 and 20.

Fig. 26 .
Fig. 26.Estimation errors for the ice TES tank during a sequence of charging and discharging processes.Temperatures of the (a) HTF and (b) PCM.

Fig. 27 .
Fig. 27.(a) Total stored energy by the ice TES tank and energy provided by latent heat and sensible heat.(b) Comparison between the SoC calculated by the proposed method and the energy provided by the latent heat.

Table 1
RMSE and MAE of simulated and observed output temperature of HTF (  ,, ,   ,, ), SoC and total energy (  ) with respect to experimental data.
Relevant parameters of the ice tank are provided in TableB.3.
where  is used to indicate temperature [ • C], and   [kg/m 3 ],  , [J/(kg • C)],   [W/(m • C)], and   [Ns/m 2 ] are the density, specific heat, thermal conductivity, and dynamic viscosity of the HTF, respectively.The density   [kg/m 3 ] and the thermal conductivity   [W/(m • C)] but included here for completeness.The first step is to calculate the mean velocity   [m/s] of the HTF with   [m 2 ] is the cross-section area of the tubes inside the LHTES unit,  [m]is the internal radius of the internal tubes of the LHTES unit, ṁ [kg/s] is the mass flow rate of the HTF and   [kg/m 3 ] is the density of the HTF.The second step is to calculate the Reynolds number Re, given by  [m]is the hydraulic diameter of the tube and   [Ns/m 2 ] is the dynamic viscosity of the fluid.The value of Re determines whether the fluid is laminar or turbulent.For simplicity, the transition zone between laminar and turbulent flow is not considered.Thus, for laminar flow, it is assumed that the Nusselt number Nu, which is key for calculating the convection heat transfer coefficient, has a constant value of Nu = 4.36.For a turbulent flow, this is defined instead by Nu = 0.023Re 4∕5 Pr  , (C.3) where Pr is the Prandtl number of the HTF, with  = 0.4 for a heating process and  = 0.3 for a cooling process.The convection heat transfer coefficient   [W/(m 2• C)] of the HTF is calculated by   [W/(m • C)] is the thermal conductivity of the fluid.On the other hand, the conduction heat transfer coefficient in the tube wall  , [W/(m 2• C)] is calculated as   [W/(m • C)] is the thermal conductivity of the tube.The conduction heat transfer coefficient presented in the PCM  , [W/(m 2• C)]   [W/(m • C)] is the thermal conductivity of the PCM and   is the radius of the control volume of the PCM.Finally, the overall heat transfer coefficient  [W/(m 2• C)] is given by ,1 (   , −  ,1 )