Transient Temperature Distribution of Underground Carbon Dioxide Salt Cavern Storage With State Space Model

Underground salt caverns have become one of the potential methods for carbon dioxide (CO2) storage due to its advantages including high storage capacity and easy construction. The wellbore and salt cavern heat transfer models for the CO2 injection process was developed and solved by the state space method. This method can not only solve the partial differential equation, but can also be used as the basic model of automatic control. The results indicate that the temperature of annulus and the salt cavern are significantly influenced by the injection rate during the injection process, while the brine temperature in tubing remains almost unchanged. When the injection process stops, the temperature of annulus and the salt cavern are dominated by the formation temperature. The temperature of tubing brine mainly changes after a few hours, causing crystals to separate out from the brine, which can also explain why the tubing is blocked when the gas injection stops.


INTRODUCTION
With the advent of industrial development, carbon dioxide (CO 2 ) has an increasingly high concentration in the atmosphere as a result of the combustion of fossil fuels, such as coal, petroleum, and natural gas, which has caused the rising trend in the Earth's average temperature. There are nearly 1.03 × 10 9 tons of CO 2 emissions in China every year (Li et al., 2017). How to deal with carbon dioxide emissions has become a global problem. Carbon capture and storage (CCS) is a technique of lower carbon utilization for fossil fuels on a large scale (Li et al., 2015). This technique was developed in the 1970s and has been used in enhanced oil recovery with CO 2 (CO 2 -EOR), in enhanced geothermal systems with CO 2 (CO 2 -EGS), CO 2 storage with gas recovery (CO 2 -EGR), and CO 2 storage with saline water recovery (CO 2 -EWR) (Wang et al., 2012;Sun et al., 2013;Boot-Handford et al., 2014;Li et al., 2014;Luo et al., 2014;Middleton et al., 2015;Wei et al., 2020). In recent years, a group of underground salt cavern storages with various advantages have been built in China . Firstly, man-made salt caverns can be sized by specific demands by water-jet and the capacity of one salt cavern is usually 2-5 × 10 5 m 3 (Bérest, 2019). Furthermore, using a salt cavern as CO 2 storage is different from traditional methods, where CO 2 can be drawn from all the time. Therefore, the salt cavern has extensive application properties for CO 2 storage (Kushnir et al., 2012).
The accurate prediction of wellbore and cavern temperature plays an important role in keeping the storage a safe and smooth process. It has great significance for judging the strength and stability of wellbore and salt caverns. For the underground salt cavern system, while the injection has stopped for a few hours, the crystal in tubing brine may separate out as the temperature changes, which would block the tubing, and affect the CO 2 storage system performance. What is more, when CO 2 approaches a supercritical state (31.1 • C, 7.38 MPa) drastic change would occur somewhere along the wellbore and in the salt cavern, which would not be expected during the injection process (Li et al., 2017).
Studies on wellbore temperature distribution have been conducted since the 1950s. Both numerical and analytical approaches have been adopted to estimate the wellbore temperature (Hasan and Kabir, 1996;Wei et al., 2020). The earliest study of wellbore temperature was by Ramey. He drew charts for predicting bottom-hole circulating temperatures (Ramey, 1962;Wei et al., 2020) and proposed a steadystate model for obtaining the hole wellbore temperature distribution, which could not be applied to transient behavior (Hasan and Kabir, 2002;Yang et al., 2017;Wei et al., 2020). Raymond proposed the first numerical model for predicting temperature distributions for both transient and pseudo-steadystate conditions (Raymond, 1969). Hasan proposed the analytic methods for wellbore temperature prediction (Hasan et al., 1997(Hasan et al., , 1998. For CO 2 injection, the flow and thermal behavior in the wellbore involves some unique characteristics. Many researchers also developed CO 2 two-phase flow models under isothermal conditions (Wang et al., 2011a,b;Guo and Zeng, 2015;Li et al., 2016;Wei et al., 2020). Although using a salt cavern for CO 2 storage is not equal to injecting CO 2 into the wellbore. It needs to consider the heat transfer of annulus, tubing, and the salt cavern (Zhang and Goh, 2015;Wang et al., 2019. There have been few research topics that have focused on this field before (Kyuro and Yuichi, 2011;Goh and Zhang, 2012).
This study develops mathematical models to calculate the wellbore and salt cavern heat transfer models during CO 2 injection and injection-stopped periods, and models were solved by the state space method. This method can not only be used for solving partial differential equations, but also as an automatic control model. The results demonstrated that wellbore and cavern temperatures were significantly influenced by the injection rate during the injection process, and the tubing brine temperature had remained approximately constant. When the injection stopped, the wellbore and cavern temperatures were dominated by the formation temperature. The main variation in the tubing brine temperature occurred a few hours after the injection had stopped which would cause crystals to separate out from the brine. This is the reason why the tubing may be blocked after the injection process is stopped. The model can be used to design CO 2 injection parameters and monitor salt cavern states, and reduce the risk to the underground salt cavern system. Figure 1 shows the phase change of CO 2 , when CO 2 approaches the supercritical state (31.1 • C, 7.38 MPa), which is likely to occur somewhere along the wellbore and in the salt cavern (Li et al., 2017;Wei et al., 2020). Figure 2 describes the process of injecting CO 2 into the salt cavern storage which can be divided into two parts. The first part: the fluid of CO 2 is injected into the salt cavern storage through annulus. The second part: the fluid of brine in the salt cavern storage flows through the tubing to the ground. Based on the principle of the conservation of energy, the dynamic mathematical model of heat transfer in the process of injecting CO 2 into the salt cavern storage is established (Wei et al., 2020).

The Heat Transfer Model of Annulus
According to Figure 2, in the CO 2 heat transfer model of annulus, the energy change is equal to the heat generated by the axial flow of CO 2 , the heat transfer between the CO 2 of annulus and the tubing, and that between the well wall and the CO 2 of annulus. Therefore, the heat transfer model is Li et al. (2017) and Wei et al. (2020): where T a is the annulus fluid temperature of CO 2 , • C. T w is the tubing temperature, • C. T f is the well wall temperature, • C. ρ a is the CO 2 density of annulus, kg/m 3 . A a is the area of annulus, m 2 . C a is the CO 2 specific heat of the annulus fluid, J/kg. • C. M a is the mass flow of injected CO 2 , kg/s. r 1 is the radius of annulus, m r 2 is the outer radius of tubing, m. λ 1 is the convective heat transfer coefficient of annulus CO 2 and the well wall, W/m 2.• C. λ 2 is the convective heat transfer coefficient of annulus CO 2 and tubing, W/m 2.• C.

The Heat Transfer Model of Tubing Fluids
The fluid in the tubing is brine, the energy change of it is equal to the heat generated by the axial flow of the brine, and the heat exchange with the tubing brine and the tubing. Therefore, the heat transfer model is: where T p is the tubing fluid temperature of brine, • C. ρ p is the density of the tubing fluid, kg/m 3 . A p is the area of the tubing, m 2 . C p is the specific heat of tubing brine, J/kg. • C. r 3 is the inner radius of tubing, m. v p is the fluids flow velocity in the tubing, m/s. λ 3 is the convective heat transfer coefficient between the tubing brine and tubing, W/m 2 . • C.

The Heat Transfer Model of Tubing
For the tubing, the energy change is equal to the convection heat transfer between the annulus CO 2 and the tubing, and that between the brine and the tubing. Therefore, the heat transfer model is: where ρ w is the density of tubing, kg/m 3 . A w is the area of tubing, m 2 . C w is the specific heat of tubing, J/kg • C.

Heat Transfer Model of Salt Cavern Storage
For the CO 2 which is stored in the salt cavern storage, the energy change is equal to the heat transfer between the CO 2 and the salt cavern storage wall, and that between the CO 2 and the brine in the salt cavern storage, and the energy entered from the annulus. Therefore, the heat transfer model is: where, T c is a cavern's CO 2 temperature, • C. T fc is a cavern's formation temperature, • C. T b is the brine in the salt cavern storage temperature, • C. T ad is the CO 2 temperature that flows into the cavern from the annulus, • C. m c is the CO 2 quality in the salt cavern storage, kg. C c is the CO 2 heat capacity in the salt cavern storage, J/kg. • C. A f 1 is the contact area of the CO 2 and the salt cavern storage wall, m 2 . A c is the contact area of the brine in the salt cavern storage and the CO 2 in the salt cavern storage, m 2 . λ f 1 is the heat transfer coefficient between the CO 2 and the salt cavern storage wall, W/m 2.• C. λ bc is the heat transfer coefficient between the CO 2 and the brine in the salt cavern storage, W/m 2.• C. M a is the mass flow rate of injected gas, kg/s. T ad is the temperature of the CO 2 which is injected into the salt cavern storage from annulus, • C. The brine energy change in the salt cavern storage is equal to the heat transfer between brine and the salt cavern wall, and that between the brine and the CO 2 . Therefore, the heat transfer model is: (5) where, m b is the quality of brine in the salt cavern storage, kg. C b is the heat capacity of the brine in the salt cavern storage, J/kg. • C. A f 2 is the contact area of the brine and the salt cavern storage wall, m 2 . A c is the contact area of the CO 2 in the salt cavern and the brine in the salt cavern, m 2 . λ f 2 is the heat transfer coefficient of the brine and the salt cavern storage wall, W/m 2.• C. λ cb is the heat transfer coefficient of the brine and CO 2 in the salt cavern storage, W/m 2.• C.

INITIAL CONDITION AND BOUNDARY CONDITION AND STATE-SPACE METHOD FOR THE WELLBORE
In the process of gas injection, mass flow and injection temperature is measured on the ground. The formation temperature is attained using the surface temperature and the formation temperature gradient, the formation temperature gradient is 3 • C/100 m, thus T f = T f 0 + yz, T f 0 is the formation temperature, y is the formation temperature gradient, and z represents depth. The state space method is a basic model of modern control theory. So it can not only solve the partial differential equation, but can also be used as the basic model of automatic control.
For Equations (1-4), using difference instead of integral, therefore: Equation (1) can be expressed as: The depth of wellbore is divided into L nodes, each discrete time is represented by k, according to the linear system theory, each grid temperature in the tubing and annulus is an independent state. Set the gas injection temperature as T a k, 0 , and set x 1 = − M a t ρ a A a z , x 2 = 2π r 2 λ 2 t ρ a A a C a , x 2 = 2π r 3 λ 3 t ρ a A a C a , and the state space model for the wellbore heat transfer system can be obtained. Equation (1) converts to Wei et al. (2020): where, T A k = T a k, 1 , T a k, 2 , T a k, 3 , · · · T a k, L T L×1 T W k = T w k, 1 , T w k, 2 , T w k, 3 , · · · T w k, L T L×1 where, T A is the state vector of the heat transfer state space model for annulus fluid of CO 2 , T W is the state vector of tubing temperature, T F is the state vector of formation temperature, U d is the input vector for the state space model, and A a is the system matrix. In the same way, set z 1 = −v p t z , z 2 = 2π r 1 λ 1 t ρ P A P C P , and the brine temperature from the cavern that entered into the tubing as T p k, 0 , we can get the state space model of the brine temperature in the tubing (Wei et al., 2020).
T P k + 1 = A P T P k + B P T W k + D P U P k where, T P k = T P k, 1 , T P k, 2 , T P k, 3 , · · · T P k, L T L×1 T W k = T w k, 1 , T w k, 2 , T w k, 3 , · · · T w k, L T L×1 where, T P is the state vector of the heat transfer state-space model for the tubing fluid of brine, U p is the input vector, and A p is the system matrix. Salt cavern storage temperature state space model: (3), (4) can be transformed into the state space model for calculating the temperature of gas and brine in salt cavern storage The CO 2 gas in the salt cavern storage satisfies the gas equation. Before calculation, the initial density of gas in the salt cavern storage can be calculated according to the initial pressure of the gas in the salt cavern storage and the gas state equation.
where M is the molecular mass of natural gas, and Z is the pressure factor, which can be obtained by: + 0.044T 2 r − 0.164T r + 1.15 where Pr is the pseudo-reduced pressure, dimensionless; Tr is the pseudo-reduced temperature, dimensionless; Pc is the critical pressure of CO 2 gas, Pa; Tc is the critical temperature of gas, K (Ren et al., 2016). After every step, the mass of CO 2 gas in the cavern is:m c k + 1 = M a t + m c k . The density of natural gas in the cavern is: According to , the pressure of the cavern can be obtained. To ensure that the carbon dioxide in the salt cavern storage will not have a phase change, the allowed pressure of the cavern is generally <7 MPa.

CASE STUDY
The state space model was used to show the transient temperature distribution of underground CO 2 salt cavern storage, supposing the salt cave's shape is cylindrical and its simulation data were shown in Table 1 Bérest, 2019). The wellbore temperature profiles, as a function of well depth under different injection times, are calculated by the state space method. As shown in Figure 3A, the temperature decreases with injection and reaches a quasi-stable state temperature of 27.5 • C at the bottom of annulus. The time needed to reach the quasi steady state is about 20 min. Therefore, special attention should be paid to monitoring in the first 20 min during the injection process. Figure 3B signifies the annulus temperature profiles after injection for 0.1, 1, and 2 h. With the increase of injection time, the annulus temperature decreases, its temperature variation is 1.5 • C at the bottom of the annulus. Figure 3C manifests the effect of different gas injection times on the brine temperature distribution in the tubing. The steady state temperature of the tubing brine remains almost unchanged at two injection times. Therefore, the crystal separating out from brine due to the temperature changes would not occur during the injection process.
The tubing heat transfer effect was neglected in the Raymond model while tubing's influence on temperature distribution of the annulus was considered in the state space model. The material of the tubing used is steel which is used in petroleum and matches the American Petroleum Institute (API) specifications. Figure 3D displays the tubing heat transfer effect on the annulus temperature distribution. More heat would enter the annulus from the formation transferring without considering it. The annulus CO 2 temperature calculated by the Raymond model is about 3-4 • C lower than that by the state space model. Therefore, when calculating the annulus CO 2 temperature, the influence of tubing heat transfer could not be ignored. Figure 4 presents the change of the salt cavern temperature and pressure during the injection process. The pressure prediction is also very important for stable operation of the gas storage. For salt cavern gas storage, the general pressure range is about 5-25 MPa. As shown in Figure 4A, salt cavern pressure increases from 5 to 6.1 MPa in an 80-h injection. It is in the allowable operating pressure range. Figure 4B shows the temperature variation of salt cavern CO 2 and brine in a 60-h injection, and CO 2 temperature decreases to a new quasi-steady state. According to Figure 1, there is no CO 2 phase change during the injection process so it meets the design requirement. We can calculate that the CO 2 mass is 1.9978 × 10 7 Kg. Figure 5 is the effect of the gas injection rate on CO 2 storage system operation state. Figure 5A demonstrates the annulus CO 2 temperature profiles in CO 2 injection rates of 13, 16, and 20 kg/s. Different CO 2 injection rates have little influence on the annulus temperature above 100-m depth. The annulus temperature in the middle and lower part gradually decreased with the increased injection rate. Figure 5B shows the temperature variation of the brine in the tubing. When the CO 2 injection rate changed, the brine temperature changed very little. Figure 5C manifests the CO 2 gas pressure in the salt cavern at different CO 2 injection rates. When the CO 2 injection rates were 13, 16, and 20 kg/s, the CO 2 gas pressure in the salt cavern was 5.9, 6.1, and 6.4 MPa, respectively, after an 100-h CO 2 injection. The CO 2 gas pressure in the salt cavern increased significantly with the increase of the gas injection rate. Figure 5D shows the variation of CO 2 gas temperature in the salt cavern at different injection rates. As the injection rate increased, the CO 2 gas temperature in the salt cavern decreased significantly, and reached new and different quasisteady states. Figure 6 is the change of the temperature in the wellbore and salt cavern when the well was shut in. Figure 6A signifies the change of CO 2 gas temperature in the salt cavern storage when the well was shut in. During the injection process, the temperature of injection CO 2 plays a dominant role in the salt cavern's temperature. When CO 2 injection stops, the heat transfer between the formation and salt cavern's CO 2 plays a dominant role in the salt cavern's temperature. The CO 2 gas temperature in the salt cavern storage increases after the well is shut in, but the increasing trend slows and gradually approaches the formation temperature. Figure 6B shows the change of CO 2 gas pressure in salt cavern storage when the well is shut in. When the well was shut in, the CO 2 gas  pressure in salt cavern storage changes with the temperature change, but the change is very small. Figure 6C shows the distribution of annulus CO 2 temperature at different time points when the well is shut in. Due to the heat transfer between the formation and the brine in the tubing, the annulus temperature firstly increases and then decreases. At first, the annulus temperature is lower than the formation temperature, then it becomes higher than it, and finally approaches the current formation temperature. Figure 6D shows the brine temperature in the tubing in 1, 5, and 20 h after the well was shut in, and the brine temperature in the tubing gradually approached the formation temperature. The result shows that heat transfer between the wellbore and formation play a dominant role in the brine temperature distribution in the tubing after the well is shut in. Figure 7 shows the distribution of the temperature variation between the temperature when the well was shut in for 20 h and the temperature just after gas injection was stopped. The change of brine temperature in the tubing mainly occurs when the well was shut in. The change of temperature will cause crystals to separate out from the brine, which can explain the blockage of the tubing when the well was shut in.

CONCLUSION
This thesis proposes a new method (using underground salt cavern storage) for CO 2 storage and a mathematical model for transient temperature distribution during the CO 2 injection process. Furthermore, state space method is used for solving this model, where CO 2 storage's temperature-pressure can be predicted, and parameters of CO 2 storage can be monitored and optimized during the CO 2 injection process.
The operating parameters analysis manifests that flow rates have a significant impact on the temperature of the wellbore and the cavern. In addition, when the injection is stopped, heat transfer is dominated by the formation temperature, resulting in a remarkable increase in annulus temperature. The temperature of tubing brine mainly changes when injection stops, which is very important in preventing blockages in the tubing.
This research may help interpret the mechanism of wellbore and cavern heat transfer during CO 2 injection. This heat transfer model of wellbore and cavern is our primary work. Future work will be focused on the CO 2 releasing process and the phase variation in the process.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

AUTHOR CONTRIBUTIONS
ZY and YZ: stimulation, data curation, and writing manuscript. MW: construction of thesis ideas, establish mathematical model, and provide research fund. XL: manuscript review. All authors contributed to the article and approved the submitted version.