###### Abstract  
Clarifying the distribution of temperature and pressure in the wellbore and cavern during hydrogen injection and extraction is crucial for quantitatively assessing cavern stability and wellbore integrity. This paper establishes an integrated flow and heat transfer model for the cavern and wellbore during hydrogen injection and withdrawal, analyzing the variations in temperature and pressure in both the wellbore and the cavern. The temperature and pressure parameters of hydrogen and natural gas within the chamber and wellbore were compared. The specific conclusions are as follows. (1) Under identical injection and withdrawal conditions, the temperature of hydrogen in the chamber was 10 \({}^{\circ}\)C higher than that of natural gas, and 16 \({}^{\circ}\)C higher in the wellbore. The pressure of hydrogen in the chamber was 2.9 MPa greater than that of natural gas, and 2.6 MPa higher in the wellbore. (2) A comparative analysis was conducted on the impact of surrounding rock's horizontal and numerical distance on temperature during hydrogen and natural gas injection processes. As the distance from the cavity increases, from 5 to 15 m, the temperature fluctuation in the surrounding rock diminishes progressively, with the temperature effect in the hydrogen storage chamber extending to at least 10 m. (3) The influence of rock thermal conductivity parameters on temperature during the processes of hydrogen injection and natural gas extraction is also compared. The better the thermal conductivity, the deeper the thermal effects penetrate the rock layers, with the specific heat capacity having the most significant impact. underground hydrogen storage; salt cavern; flow and heat transfer model; hydrogen and natural gas; diversity +
Footnote †: journal: Medical  
tubing but also significantly impact cavern leakage and wellbore corrosion rates. Clarifying the distribution of temperature and pressure in the wellbore and cavern during this cycling process is crucial for quantitatively assessing cavern stability and wellbore integrity [5; 6; 7; 8]. In the practical engineering of underground salt cavern gas storage, the thermohydro-mechanical coupling effects of the surrounding rock mass are increasingly receiving widespread attention [9; 10; 11]. Researchers both domestically and internationally have conducted studies on the thermodynamic properties of in-cavity gasses. [PERSON] et al. [12; 13] proposed two methods for analyzing temperature and pressure variations within a reservoir based on the equations of mass conservation, energy conservation, and the thermal conductivity of rocks. [PERSON] et al. [14] proposed a simplified analytical solution for calculating the temperature and pressure of the cavity air building using [PERSON]'s analytical solution. [PERSON] et al. [15] validated the accuracy of the thermodynamic process calculation method for compressed air by relying on the quality of compressed air and the principles of energy conservation. [PERSON] et al. [16] developed a non-steady-state dynamic mathematical model for the coupling of salt cavern storage and wellbores in gas storage, taking into account the properties of real gasses and the convective heat transfer between the gas and the surrounding rock at the cavern walls. [PERSON] et al. [17; 18] developed a thermal model for the conditions of injection and withdrawal, investigating the effects of gas extraction rate on the temperature of the cavity. [PERSON] et al. [19] conducted a thermal analysis of cavern's natural gas storage facilities, determining the temperature, pressure within the salt caverns, and the distribution of the thermal field within the rock mass, while also analyzing various sensitivity factors. [PERSON] [20] developed a numerical model for compressed air cavern storage, analyzing the variations in temperature and pressure within the cavern over a single operational cycle. [PERSON] et al.