## 2 Materials and Methods
### CFD Numerical Model  
#### 2.3.1 Model Geometry, Mesh and Boundary Conditions  
A 3D numerical model of a horseshoe-shaped tunnel located inside a closed mine was conducted to simulate the compression and decompression processes (air charging and discharging) that occur in the tunnel during the operation of the CAES plant. The computational domain is a tunnel with 8 m\({}^{2}\) of cross section and 50 m in length and includes both the fluid area and the solid areas around the fluid. The configuration of the simulated tunnel is illustrated in Figure 3. To improve the geomechanical performance, a 4 m\({}^{2}\) circular cross-section has been designed for the compressed air (blue area in Figure 3). The tunnel is reinforced with a 35 cm thick concrete lining and is finished with a dead-end. To avoid thermal leakage, a 20 mm thick sealing layer is considered between the air and concrete lining. Two types of sealing materials are considered: FRP and steel. The external part of the model corresponds to the 2.5 m thick sandstone rock mass existing in the mine. The total cross section of the model is 57.13 m\({}^{2}\) (8 \(\times\) 8 m) and the model volume is 2587 m\({}^{3}\). In addition, the useful volume of air reaches 200.53 m\({}^{3}\). The entire geometry is meshed with 2,690,038 hexahedral and tetrahedral cells. Finer mesh was defined in the sealing layer, concrete and air zones, with higher grid density in those regions where the gradients of the flow characteristics are extremely important.  
Four different type of materials (air, sealing layer, concrete, and sandstone) are used to simulate the heat transfer process between the air inside the mine and the surrounding media. In addition, as in the analytical model, FRP and steel are considered as sealing layers. The air is defined as real-gas to allow the simulation of the compression process. To reproduce the concrete layer existing between the sealing layer and the sandstone, a solid material zone is defined. The sandstone and sealing layer zones are also defined as solid materials. In addition, a series of thermal properties are imposed on the sandstone, concrete and sealing zones to simulate the conduction heat transfer.  
Figure 3: Computational domain. Mesh and boundary conditions used in CFD simulations.  
The numerical simulation of the compression/expansion process was carried out with the commercial software ANSYS Fluent(r) 16.2. This code was used to solve the full 3-D Unsteady Reynolds-Averaged Navier-Stokes (URANS) equations for compressible flow. The coupling between velocity and pressure was resolved by the SIMPLE algorithm. The spatial and temporal derivatives of the governing equations for the fluid flow were calculated by means of a second-order discretization, and the pressure interpolation PRESure STaggering Option (PRESTO) scheme has been used. Turbulent closure was established by the RNG k-\(\varepsilon\) model together with standard wall functions. In addition, the resolution of the energy equation for both fluid and solid volumes was activated. A constant mass flow rate was imposed as an inlet boundary condition for each model and an interface condition was established for solid/solid and solid/fluid surfaces. To reduce the computational time, air mass flow rates of 50 kg s\({}^{-1}\) and \(-\)75 kg s\({}^{-1}\) were considered in the numerical simulations. In Section 3.3, these mass flow rates are also employed in the analytical model to carry out the comparative analysis. In addition, a constant temperature of 300 K was considered in the sandstone surface. Moreover, a no-slip shear condition was imposed on the walls. The material properties used in the numerical model have been indicated in Table 1. A fixed time step of 5 \(\times\) 10\({}^{-2}\) s was selected for the simulations to ensure their stable convergence. The convergence criteria is based on the residual values of the solution solved in the numerical domain. A typical threshold of 10\({}^{-5}\) was set for continuity, momentum and energy equations.