## 2 Materials and Methods
### Numerical Model
#### 2.2.3 Energy Balance Time Terms for PCM Configuration  
Firstly, it is necessary to consider a slight change in the energy balance for the HTF, corresponding to the replacement of the temperature of the solid material by the average temperature between the HTF and the PCM material in the phase change process (melting point). \[F_{pcm}=A\cdot\Theta_{f,j+1}\leftrightarrow A^{-1}\cdot F_{pcm}=\Theta_{f,j+1}, \tag{8}\]  
\[F_{pcm}=\frac{1}{\Lambda}(\Theta_{m})+\frac{1}{\Delta t}\Big{(}\Theta_{f,j} \Big{)}+\frac{1}{2\Delta x}\cdot\Pi, \tag{9}\]  
Regarding the term energy balance of the PCM material, considerable modifications related to the quantification of the fusion energy of the material were adopted together with the inclusion of the liquid mass ratio concerning the total mass. \[C\cdot\zeta_{j+1}=D_{pcm}\rightarrow\zeta_{j+1}=C^{-1}\cdot D_{pcm}, \tag{10}\]  
The procedure to find the solution in this case of PCM configuration is as follows:  
1. Solve steering Equation (10) for the entry point \[\frac{\partial\Theta_{r}}{\partial\Psi}=-\frac{\mathbb{H}}{\Lambda}\Big{(} \Theta_{r}-\Theta_{f}\Big{)},\] (11)
2. Monitor the temperature at each time step given in Equation (11). If the temperature is greater than the melting temperature, the solution for that time step and the subsequent ones is obtained with the phase change Equations (8) and (10). 3. For each time step solved using Equation (  
* Charge process; \[t=0,\ \ \Theta_{f}=f_{2}(x)\ \ \ \ \ \ \ \ \ \ \ \Theta_{m}=cte,\ \ \zeta=0,\] \[t>0,\ \ X=1,\ \ \Theta_{f}=1,\ \ \zeta=1,\]  
With the established temperature distribution, that is to say, the obtained solution of the system of equations, the discharge energy in the HTF concerning time can be calculated using the following equation:  
\[E_{discharge,too}=\int_{0}^{t}\dot{m}C_{f}\Big{[}T_{f,out}(t)-T_{L}\Big{]}dt, \tag{12}\]  
\(T_{L}\) is the lowest temperature of the HTF coming from the power generation system. This method is generalist and somewhat theoretical. A more exact method corresponds to determining the energy inside the tank at each point of time traveled \(j=1,\,2,\,\ldots,\,N\). This way, the tank energy at each spatial and temporal node can be calculated according to Equation (13). \[E_{X,\overline{Y}}=\Big{(}\Theta_{Y_{X},\overline{Y}}\rho_{r}C_{r}A_{ss}(1- \epsilon)H\Delta X+\Theta_{f_{X,\overline{Y}}}\rho_{f}C_{f}A_{ss}eH\Delta X \Big{)}(T_{H}-T_{L}), \tag{13}\]  
where \(A_{ss}\) is the sectional area of the tank; therefore, adding through the spatial nodes results in the energy in the given time. The present numerical model for simulating phase change material (PCM) behavior in a thermal energy storage system introduces several distinct advancements over existing models found in PCM-related literature, i.e., [40; 41]. Unlike many conventional models focusing solely on thermal behavior, this model incorporates structural dynamics to address thermal ratcheting effects--a common issue in PCM systems due to repeated melting and solidification cycles. This integration ensures the structural integrity and longevity of the storage system. The model optimizes the design of a thermocline tank with a unique configuration of multiple tunnels, enhancing heat transfer and reducing thermal gradients within the PCM. This approach contrasts with simpler tank designs in previous studies, offering improved efficiency and storage capacity. Also, the model was tailored for off-grid small-scale industrial applications, such as remote mining operations in Chile. The model demonstrates the system's viability in scenarios with limited access to consistent power sources. This focus on practical, site-specific challenges marks a significant departure from more generalized or grid-connected applications often found in the literature. Similarly, the model provides an in-depth analysis of the system's thermal behavior, efficiency, degradation over time, and energy storage capacity.