Thermal–hydraulic coupling model and operating conditions analysis of waxy crude oil pipeline restart process after shutdown

To realize the safe and economic operation of a waxy crude oil pipeline, a thermal–hydraulic model in an unsteady state was established for the restart process of waxy crude oil. The model is based on the thermodynamic and hydraulic characteristics of crude oil within a pipeline intercoupling with media outside the pipeline during the restart process of the crude oil pipeline. The characteristics of waxy crude oil are considered, and the model includes the continuity equation, momentum conservation equation, and energy conservation equation. This article suggests a method for developing the model based on shockwave theory combined with the characteristic line method, numerically simulates the restart process of a certain buried oil pipe in summer and winter, and analyzes how the oil temperature at the beginning and terminal of the pipeline and the pressure at the beginning of the pipeline change during restart. In addition, this article confirms the safe duration of shutdown in two seasons for a waxy oil pipe, which are 37 h in summer and 33 h in winter.


Introduction
Most of the crude oil produced in China is waxy crude oil with a high viscosity. The waxy crystals precipitate as the temperature decreases and thus become condensed during piping. Meanwhile, the crude oil pipe would inevitably shut down during practical production, which seriously impacts the safe and economical operation of the pipe. After the crude oil pipe shuts down, the oil temperature within the pipe starts to decrease. Due to the high content of paraffin in waxy crude oil, wax precipitates as the temperature decreases and forms a net structure, and then, the wax deposition phenomenon occurs, by which the liquidity of crude oil constantly deteriorates. The gelation structure is gradually formed, which affects normal transportation. The high freezing point of waxy crude oil generates a condensed oil layer once the oil temperature decreases below the freezing point, which increases the possibility of a condensed pipe and the difficulty of restarting the pipe. The physical characteristics of crude oil, the temperature distribution along the pipe during stable operation, the shutdown duration, the temperature decrease during shutdown, the thermal insulation of the pipeline, variations in the environmental parameters, and the limited loading capacity of the pipeline could have an impact on restart, which makes this process very complicated. Therefore, it is necessary to study the restart process after shutdown for the waxy crude oil pipeline transportation process.
Researchers have conducted various studies of thermodynamic and hydraulic numerical calculations and the law of changes for pipeline restart. DE Thornton 1 proposed an analytic solution by comparing the thermodynamic variations during restart of thermo-isolated and non-thermo-isolated pipelines and compared how both pipelines changed. C Li et al. 2 studied the restart of gelled oil following shutdown in a massive experiment, suggested that the yielding of gelled oil could be divided into three stages and constructed a restart model able to reflect the yielding of gelled oil. C Li and Z Zeng 3 constructed a semi-infinite mathematical thermal model of the soil temperature field and obtained an analytical solution for changes within a pipeline and the soil temperature field outside of the pipeline. Sestak et al. 4 used the Houska model, which describes the thixotropy of waxy crude oil, to study the restart process of a waxy crude oil pipeline. Cawkwell and Charles 5 suggested that the compressibility and rheological characteristics have a powerful effect on restart based on the Sestak model. C Huang et al. 6 divided the pipeline restart and recovery process into three parts: the original yielding stage, the stage when the yielding value decreases through breakdown, and the residual yielding stage. J An et al. 7 solved a model of shutdown-restart by numerical methods and developed a calculation software for solving the restart equation, which is able to precisely simulate the parameter variations of the restart process. D Wang et al. 8 suggested several theories and related calculation methods to solve pipeline restart issues and constructed a hydraulic calculation model for shutdown-restart, with the Zhongluo Pipeline as the research target. Researchers have extensively analyzed the oil pipeline restart process in various ways, 9,10 but the amount of research on the coupled thermodynamic and hydraulic characteristics during the restart process of a waxy crude oil pipeline is limited. Therefore, to confirm the safe shutdown duration and the pressure for restarting an oil pipeline to ensure that the restart process works well, it is necessary to consider the characteristics of waxy crude oil pipelines to construct a precise thermal model and a coupled thermodynamic and hydraulic model for the restart process.
Based on the thermodynamic and hydraulic characteristics of the coupling of the crude oil inside a pipeline and the media outside the pipeline during pipeline restart, 11,12 and considering the effects of the contractibility, compressibility, and thixotropy of crude oil on the restart characteristics, this study constructed an unstable coupled thermodynamic and hydraulic mathematic model for the restart process that is supported by the continuity equation of crude oil, the momentum conservation equation, the energy conservation equation, boundary conditions, and original conditions. Furthermore, shockwave theory combined with the characteristic line method was adopted to solve the restart process. Meanwhile, programs for calculating the shutdown-restart process were developed for a certain pipeline in summer and winter, and the effects of changes in the oil temperature at the beginning and terminal of the pipeline and while flowing through the pipeline during the restart process and changes in the pressure in the pipeline at the beginning were simulated and analyzed. This article provides a theoretical basis for planning the restart process and a theoretical guarantee that the restart process will work well.

Construction of the restart process model
Construction of the physical model of the restart process A buried pipeline containing heated oil, soil media, the media inside the pipeline, and the atmosphere combine to form a thermodynamic system of a heated oil pipeline, 13 as shown in Figure 1. At the initial moment when the waxy crude oil pipe shuts down, the oil reserved in the pipe has a high temperature, with natural-convection heat transfer as its main form of heat transfer. 14 When the temperature of the crude oil in the pipe decreases to the wax precipitation point, the wax dissolved within the heated oil starts to precipitate, and the form of heat transfer inside the pipe changes from natural-convection heat transfer to convection heat transfer, and heat conduction coexists. The natural-convection heat transfer of the internal wall of the pipe weakens first, which causes solidification to appear first near the wall. As the oil temperature decreases further and all of the crude oil within the pipe gels, only heat conduction remains for heat transfer, and heat is emitted into the surrounding media. 15,16 The physical model of the restart process is shown in Figure 2, assuming the heated oil and the oil reserved within the pipe contact each other on a plane (changes in the radial direction are extremely small compared with the pipe length). The thrusting process is shown in Figure 2(a). 17,18 At t = 0, the restart process initiates, heated oil flows into the pipe, and a portion of the cold oil at the contact surface starts to condense. At the initial moment of 0\t\t 0 , thrusting initiates, and the initiating pressure provided by the pump acts on the oil reserved in the pipe. When the initial pressure exceeds the static yield stress of the reserved oil, the oil changes its crystal structure and fractures. The pressure wave reaches the end of the pipe, and the oil starts to flow. When t = t 0 , the yielded section reaches the terminal of the pipe, and the reserved oil is replaced by the heated oil, which means the restart has completed. The pipe model is shown in Figure 2(b). Assume that the radius of the pipe is R, the length is L, the buried depth is H, and the radical and axial coordinates are shown by r and x, respectively.

Construction of the coupled thermodynamic and hydraulic model of the restart process
The thrusting fluid is pushed into the pipe to condense and fluidify the reserved oil in the pipe during the restart process. Fluids in pipes follow the three principles of conservation of mass, conservation of momentum, and conservation of energy as well as the corresponding initial conditions and boundary conditions. The thermodynamic and hydraulic transits of oil flow within a pipe take place simultaneously during restart. The flowing parameters of the oil flow are related to the physical characteristics of the oil, which are related to the crude oil within the pipe; the temperature change of the oil within the pipe is also related to the flow in the pipe, and both are coupled with each other. 19 The following assumptions are made for the coupling process: 1. Assume the soil is isotropic. 2. Ignore axial heat transfer after shutdown. 3. The flow in the pipe is dimensional and balanced through the cross section. 4. The temperatures along the cross section of the pipe are only related to their axial position and moment of shutdown. 5. The initial earth temperature along the pipe is the average local annual earth temperature. 6. Ignore the flow within the pipe caused by differences in altitude.
With the above assumptions and based on the three principles, we can infer the continuity equation, the momentum conservation equation, and the energy conservation equation. [20][21][22] Continuity equation. Randomly pick two effective sections 1-1 and 2-2 in the pipe, and make the space shaped by them and the wall into a control volume. After an interval of dt, the control volume does not move, while the fluid flows in through section 1-1 and out through 2-2. The distance between the two effective sections is dz. Assume that the area of the selected section is A, the flow velocity is v, and the density of the fluid is r. Thus, the continuity equation based on the mass conservation principle can be inferred Momentum equation. The principle of the momentum conservation of flow within the pipe could be described as follows. At a certain moment, the resultant of all the external forces affecting the system equals the gradient of the momentum of the system with respect to time. Take the space shaped by 1-1-2-2 as the control volume. Assume that the area of the selected section is A, the length is dz, the direction of the flow is z, and the angle between the pipe and the horizontal is u. The momentum equation based on the principle of momentum conservation can be inferred as follows Energy equation. Infer the energy conservation equation based on the energy conservation principle We have the coupled thermodynamic and hydraulic model of oil flow during restart based on the above equation Boundary conditions. Suppose the direction of fluid motion is the wavefront, and the other side is the waveback. According to the law of conservation of mass and the law of conservation of momentum where 0 is the physical quantity of the wavefront, b is the physical quantity of the waveback, and a is the propagation velocity of the pressure wave, m=s.
In the initial stage, the crude oil is static before the pressure wave reaches it. Then, when v 0 = 0, P 0 = 0, and equations (5) and (6) are combined together, the following can be obtained Thermodynamic boundary conditions. Because the outbound temperature of the pipe is known, the upstream boundary condition is a first kind of boundary condition, known as T (x, y, 0, t) = T R . The heat transfer between the oil flow within the pipe and the pipe wall is a third kind of boundary condition.
Hydraulic boundary conditions. The upstream boundary condition is P 1 = const. The downstream boundary condition is p b = r 0 av b before the pressure wave reaches the terminal of the pipe and p n = 0 after it reaches the terminal of the pipe.
Effect of the rheological properties on the restart process of the waxy crude oil pipeline In exploring the restart of the waxy crude oil, the rheological properties of crude oil need to be analyzed. When the temperature increases, the viscosity of waxy crude oil decreases. Waxy crude oil is a typical thixotropic fluid with shear dilution. Under a constant shear rate and before the temperature reaches the freezing point, the shear stress gradually decreases with time. To achieve the restart of the crude oil pipeline, it is necessary to overcome the static yield stress of the pipeline and change the oil storage structure. Crude oil shows a strong brittle structure below the freezing point temperature, but at and above the freezing point temperature, the gelation structure shows a certain ductility, and with the decrease in the temperature, the yield value increases exponentially.
Generally, the start-up process after shutdown is divided into two situations. In one situation, the shutdown time is shorter, the oil temperature in the pipeline is still high, and there is no yield value. At this time, the start-up pressure only needs to overcome the viscosity of the crude oil, the flow tends to be stable, and the pressure and temperature gradually return to normal and finally reach equilibrium. In the other situation, the shutdown time is longer, and the crude oil in the pipeline has a yield value. At this time, the restart pressure first needs to overcome the pipeline. Only the yield value of the internal crude oil can make it flow, and then, the pipeline system gradually returns to a steady state.

Solution of the restart process model
Solution of the initiating pressure with the hydraulic characteristic line And then the continuity equation can change into That is According to the definition of volume elasticity coefficient of liquid where K = a 2 r. It can be obtained that Equation (14) is substituted into equation (11), and the following equation can be acquired The operators are defined as Let L 2 + lL 1 , the following equation can be obtained It can be inferred from the equation that and results in l = 6 1 ra Therefore, four hydraulic line equations are acquired dv dt + 1 ra dp dt dv dt À 1 ra dp dt After calculation, we know that once the crude oil within the entire section starts to flow, the value of a is almost 1000, while the magnitude of v is only in the single figures. In addition, when v ł a, formulas (9) and (11) can be approximated as Although the temperatures of the points along the pipe change, which makes the a values change, we know from the calculation that the difference in the a values for different positions is so small that the wave velocity could be considered as a constant. Integrate C + equations to have From the equation, we have 1 A ap Q p À Q a À Á + p p À p a r ap a ap + g sin u ap Dt Therefore Integrate C À equations as well Therefore We have the interior node flow based on the inference above Then, we have the pressure Solution of the temperature of the crude oil with the thermodynamic characteristic line For inferring the thermodynamic characteristic equation, transform the energy equation into where h is the specific enthalpy, J=kg; and u is the fluid thermodynamic energy, J=kg. Based on the energy conservation equation, we have Total energy = Thermodynamic energy + Macro kinetic energy + Gravitational potential energy that is Substituting equations (29)

and (30) into equation (3) for transformation gives
Set l 2 and l 3 are two unknown factors that form a linear equation To have the total derivative dh=dt, dp=dt, dv=dt, and dr=dt, we have Then, l 3 = À v and l 2 = À p=r: The equation is transferred into Based on dh = c p dT + ½v br À T (∂v br =∂T ) p dp and the definition of coefficient of cubical expansion where T is the temperature,°C; and v br is the specific volume, m 3 =kg, v br = 1=r. Equation (46) is transformed into where c p is the specific heat capacity at constant pressure, J=(kg K), and The equation set of thermodynamic characteristic line is (C D ) Integrate the energy equation to have Programming the restart process The restart process consists of two stages: the initial filling process and the thrusting process after filling is accomplished. The restart calculation process is shown in Figure 3.

Parameter selection for calculations
With previous research, to further understand the restart characteristics during the restart process, we simulate how the inbound and outbound temperatures, pressures, and flows change with time during the restart process of a certain pipe in Daqing as an example after different shutdown durations in the summer and winter and confirm the safe shutdown duration of the pipe. The specific parameters are given below.
Pipe parameters. The pipe parameters are given in Table 1.
Physical characteristics of oil. The physical characteristics of oil are given in Table 2.
Temperature parameters. The temperature parameters of oil are given in Table 3.
Specific heat capacity of soil. The specific heat capacity of soil generally changes within 800;1800 J=(kg 8C), and the specific value depends on temperature. It can be calculated by the equation below 23,24 c s = c soil + 0:  Figure 3. Calculation steps of the restart process. where c s is the specific heat capacity of soil when the temperature is t8C, J=(kg 8C); c soil is the specific heat capacity of soil when the temperature is 0°C, J=(kg 8C); and t is the temperature,°C.
Heat transfer coefficient of soil. Based on the literature, we know that the heat transfer coefficient of soil changes within 0:5;2:5 W=(m 8C). Environmental factors greatly affect the heat transfer coefficient of soil, which changes continuously with temperature. It can be calculated by the equation given below 25 where l s is the heat transfer coefficient of soil when the temperature is t°C, J=(kg 8C); l soil is the heat transfer coefficient of soil when the temperature is 0°C, J=(kg 8C); and t is the temperature,°C.

The restart process of the pipe in summer
After the pipe has been shut down for a while, restart the flow with 70°C crude oil as the thrusting liquid under a constant flow of 0.05 m 3 /s to make the oil start to flow. By calculating the restart processes after shutdown at 10 h, 20 h and 30 h, we can determine how the filling pressure, temperature recovery along the pipe and flow at the terminal of the pipe, respectively, change with time during restart process. The velocity of the restart pressure wave along the pipe is shown in Table 4. [26][27][28] It is known from the table that with the same shutdown duration, the propagation of the pressure wave continuously accelerates as the pressure decreases more along the pipe. Effected by crude oil's compressibility, the longer the duration of shutdown is, the faster the pressure wave within the pipe is. The process of the first line of pressure wave propagating from pipe entrance to pipe terminal is called the starting filling process. Figure 4 shows how pressure changes at the entrance during the restart filling process in summer.
By calculations, we know that in summer after shutdowns of 10, 20, and 30 h, the first line of the pressure wave of the restart reaches the terminal of the pipe after 44.6, 44.3, and 44 s, respectively. During the process, the pressure at the entrance of the pipe continuously increases rapidly from 0 to 1507.4 kPa, 1875.8 kPa, and 2279.6 kPa, respectively. When the pressure wave reaches the terminal of the pipe, because the inertia pressure decrease disappears, the pressure stabilizes at 1133 kPa after a while.
With shutdown durations of 10, 20, and 30 h, 29,30 we calculate how the oil temperature changes within the pipe, as shown in Figures 5-7.
It is known by calculations that during the restart process after a shutdown of 10, 20, and 30 h in summer, the times when the thrusting liquid reaches the terminal of the pipe are 10.3, 10.7, and 11.2, respectively. It is known from the calculations above that before the hot oil head has been reached, the temperature of the oil close to the entrance of the pipe increases gradually, and the temperature of the oil within the pipe far from the entrance of the pipe first slowly decreases and then gradually increases. When the heated oil head is reached, the oil temperature within the pipe increases rapidly and then soon tends to slow down before it finally becomes invariant. Changes of the temperature and flow at the terminal with time after shutdowns of 10, 20, and 30 h are shown in Figures 8 and 9.
It is known from Figures 8 and 9 that the trend of the oil temperature at the terminal of the pipe gradually changes from a slow decrease to a slow increase before the heated oil head is reached, and the temperature tends to be stable following a drastic leap in a short period after the heated oil head has been reached. Before the heated oil head is reached, the flow of the terminal of the pipe first slowly increases, then drastically leaps and gradually stabilizes after the heated oil head has been reached.

The pipeline restart process in winter
For restart in winter, take 75°C crude oil as the thrusting liquid and restart with a constant flow of 0.05 m 3 /s  to make the oil flow. Calculate the restart process after shutdowns of 10, 20, and 30 h to obtain the filling pressure at the entrance of the pipe and the temperature recovery along the pipe and how the flow at the terminal of the pipe changes with time during the restart process. The propagating velocity of the restarting pressure wave along the pipe is shown in Table 5. Compared with that in the summer, the oil temperature within the pipe is lower in winter, and the pressure wave velocity is more affected by compressibility and continuously increases with pressure decreases along the pipe. The oil at the terminal starts flowing when the first line of the pressure wave reaches the outbound end of the pipe. Figure 10 shows how pressure changes at the inbound end of the pipe during the filling process of restart in winter.
It is known from the calculations that after shutdowns of 10, 20, and 30 h, the first line of the pressure wave of restart takes 44.1, 43.7, and 43.5 s, respectively, to reach the terminal of the pipe during which the pressure at the entrance of the pipe drastically leaps from 0 to 1799.3 kPa, 2422.2 kPa, and 3193.5 kPa, respectively. When the pressure wave reaches the terminal of the pipe, the pressure stabilizes at 1120 kPa, and the inertia pressure decrease disappears.
Calculate how the oil temperature within the pipe changes after winter shutdowns of 10, 20, and 30 h, as shown by Figures 11-13.    Based on the calculations, we know that during the restart process after shutdowns of 10, 20, and 30 h, the thrusting liquid takes 11, 11.5, and 12.1 h, respectively, to reach the terminal of the pipe. Compared with summer restart, the oil temperature within the pipe is lower, and the heated oil head takes a longer time to reach the terminal of the pipe. As a result, oil temperature of pipe's terminal recovers slower. It changes with time as shown in Figures 14 and 15.
It is known from Figures 14 and 15 that the oil temperature at the terminal of the pipe changes with the     restart time with the same trend as the shutdown and restart in summer. The terminal oil temperature first slowly decreases and then gradually increases before the heated oil head is reached, and the temperature of the oil within the pipe drastically leaps for a short time after the heated oil head has been reached and tends to be stable at last. The flow at the terminal of the pipe first slowly increases before heated oil head is reached and then drastically leaps after heated oil head has been reached and tends to be stable at last.

Confirmation of the safe shutdown duration of the waxy crude oil pipeline for restart
Based on the definition of the safe shutdown duration and calculation in this article, the maximum safe     shutdown duration of the crude oil pipe depends on the pressure bearing limitation of the pipe. During the restart process, the maximum initiating pressure should be lower than the pressure bearing limitation of the pipe. The pressure bearing limitation of the pipe selected for this article is 4.2 MPa, so the shutdown duration corresponding to the initiating pressure of 4.2 MPa is the maximum shutdown duration of the pipe. The thermodynamic condition takes the upstream outbound temperature as the first type of boundary condition and the heat transfer between the oil within the pipe and the inner wall as the third type of boundary condition. The hydraulic boundary condition is P 1 = const. The downstream boundary condition before the pressure wave reaches terminal of the pipe is p b = r 0 av b , and the boundary condition after the pressure wave reaches the terminal of the pipe is p n = 0. Calculate the maximum initiating pressure needed after various shutdown durations in summer and winter. The result is shown in Figure 16. It is known from Figure 16 that with a prolonged shutdown duration of the pipe, the initiating pressure needed for restart also gradually increases. The faster the initiating pressure increase is, the higher the requirement on the pressure bearing limitation of the pipe is. The pressure bearing limitation of the pipe calculated in this article is 4.2 MPa, for which the allowed maximum safe shutdown duration is 37 h in summer and 33 h in winter.

Conclusion
1. Based on calculations, we know that the temperature decrease during the pipe shutdown process is divided into two stages. The first stage is the initial shutdown stage, during which a high oil temperature within the pipe highly deviates from the temperature of the pipe's wall, and the crude oil cools down rapidly and approaches the outer wall's temperature. The second stage is under the effect of the temperature field of the soil, and the crude oil within the pipe and the temperature field of the soil simultaneously cool down slowly, approach the final temperature, and tend to be the same. 2. This article simulates the restart process by establishing a coupled thermodynamic and hydraulic model. The crude oil temperature within the pipe first slowly increases and then drastically leaps after the heated oil head is reached and gradually tends to be stable. Restart restores the stability of the oil temperature at the terminal, which changes in three stages: the initial stage of slow temperature decrease, the stage with a drastic temperature leap after the heated oil head is reached, and the stage in which the stability of the oil temperature has been restored. 3. During the restart process, the outbound flow of the pipe changes in a similar way with the temperature. Before the heated oil head has been reached, the flow at the terminal of the pipe first slowly increases then drastically leaps for a short time after the heated oil head has been reached and gradually tends to be stable. The restart succeeds when the stable working condition of the pipe has been restored after a while. 4. The shutdown and restart process of a pipe in summer and winter is simulated with software. The safe shutdown durations of the pipe in summer and winter are confirmed to be 37 and 33 h, respectively.

Author note
Jinwei Yang is also affiliated with SINO-Pipeline International Company Limited, Beijing, China.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.