## 2 Materials and Methods  
### Analytical Model  
A one-dimensional analytical model has been developed in MATLAB to study the thermodynamic performance during the operation time of the CAES system in a closed mine. Figure 2 shows the scheme of the 50 m long model. A lined tunnel with a usable volume of 200 m\({}^{3}\) and a cross section of 8 m\({}^{2}\) has been considered. A 20 mm thick sealing layer, a 35 cm thick concrete lining and a 2.5 m thick sandstone rock mass have also been considered in the model around the fluid. The evolution of the temperature (\(T_{a}\)), density (\(\rho_{a}\)) and air pressure (\(Pa\)) over time has been analyzed considering different air mass flow rates (\(\dot{m}\)). The heat flux through the contact surfaces, i.e., air-sealing layer (\(\dot{Q}_{1}\)), sealing layer-concrete (\(\dot{Q}_{2}\)), and concrete-sandstone (\(\dot{Q}_{3}\)), has been estimated. Finally, the temperature on the sealing layer wall (\(T_{1}\)), concrete wall (\(T_{2}\)), and sandstone wall (\(T_{3}\)) have also been estimated during the operation time considering an external temperature (\(T_{4}\)) of 300 K.  
The energy equation has been applied following Equation (1), where \(\dot{Q}\) is the net heat transfer, \(\dot{W}\) is the net work done, \(e\) is the specific energy, \(\rho\) is the density in kg m\({}^{-3}\), \(V\) is the reservoir volume, \(v\) is the air velocity and \(S\) is the cross section of the tunnel. In the air domain, the first term of Equation (2) represents the heat convection from the air to the sealing layer, which depends on the film coefficient of heat transfer (\(h\)), in Wm\({}^{-2}\) K\({}^{-1}\), the sealing layer surface in contact with the fluid (\(A_{1}\)) and the temperature difference between the air and the concrete wall (\(T_{a}\)-\(T_{1}\)). The second term of Equation (2) corresponds to the energy variation within the reservoir where the air pressure increases, which depends on the air mass inside the reservoir (\(m\)), the specific heat at constant volume (\(C_{v}\)) and the air temperature (\(T_{a}\)). Finally, the third term represents the input and output of energy in the control volume due to the energy provided by the air jet in the form of heat (\(T_{0}\)) and kinetic energy. The air mass inside the reservoir at an instant of time, \(t\), depends on the initial air mass (\(m_{0}\)) and the air mass flow rate (\(\dot{m}\)), and is obtained by applying Equation (3). \[\dot{Q}-\dot{W}=\frac{\partial}{\partial t}\int\rho e\;dV+\oint\rho\dot{e}\; (\dot{b}dS) \tag{1}\]  
Figure 2: Scheme of the deep tunnel with a sealing layer, concrete lining and sandstone rock mass. (**a**) 3D model (not to scale); (**b**) Cross section. \[-hA_{1}(T_{a}-T_{1})=\frac{d}{dt}(mC_{v}T_{a})-\dot{m}\bigg{(}C_{v}T_{0}+RT_{0}+ \frac{v^{2}}{2}\bigg{)} \tag{2}\]  
\[m=m_{0}+\dot{m}\ t \tag{3}\]  
After some algebra, the air temperature (\(T_{a}\)) is calculated by applying Equation (4). The air temperature and density increase as the air pressure increases in the reservoir, and therefore the wall temperature increases by heat convection. \[\frac{dT_{a}}{dt}=\frac{\dot{m}}{m}\bigg{[}\frac{C_{p}}{C_{v}}T_{0}+\frac{1}{2 C_{v}}\bigg{(}\frac{\dot{m}}{m}L\bigg{)}^{2}-T_{a}\bigg{]}-\frac{h2\pi r_{1}L}{C_{v}m}(T_{ a}-T_{1}) \tag{4}\]  
The temperatures on the sealing layer wall (\(T_{1}\)), the concrete wall (\(T_{2}\)) and sandstone wall (\(T_{3}\)) are obtained applying the equations of non-stationary heat transfer in sealing layer, concrete and sandstone domains (solid regions) considering an external temperature (\(T_{4}\)) of 300 K and a temperature of the air mass flow inlet (\(T_{0}\)) of 310 K. The heat flux reaches the sealing layer by convection. A part of this heat is transmitted to the concrete by conduction while another part increases the temperature of the sealing layer. A similar mechanism takes place for the concrete lining. Equations (5)-(7) represent the heat transmission on the sealing layer, concrete and sandstone formation, respectively.