# Improved Adaptive Time Step Method for Natural Gas Pipeline Transient Simulation

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Implicit Finite Difference Method

#### 2.1. Governing Equations

#### 2.2. Discretization

#### 2.2.1. Hydraulic Equations

#### 2.2.2. Thermodynamic Equation

#### 2.2.3. Boundary Conditions

## 3. Improved Adaptive Time Step Method

#### 3.1. The Procedures of the Improved Adaptive Time Strategy

#### 3.2. The Energy Number

#### 3.3. Notes

- The value of $\theta $ is always greater than 1, because of the H211b controller. Equation (21) itself has the function of adjusting the time step. When ${\epsilon}_{t}^{j+1}\le TO{L}_{t}$, the values of ${\left(\frac{TO{L}_{t}}{{\epsilon}_{t}^{j+1}}\right)}^{{\beta}_{1}}$ and ${\left(\frac{TO{L}_{t}}{{\epsilon}_{t}^{j}}\right)}^{{\beta}_{2}}$ in Equation (21) are less than 1, and the time step of the next time layer will decrease, which also plays a role in adjusting the time step. Compared with the estimation method of $\Delta {t}^{j+1}=\frac{\Delta {t}^{j+1}}{2}$, the change in time step is relatively mild, which is the first point of improvement.
- Energy number, $\varphi $, is a synthetic parameter that needs to be calculated after the transient simulation of each time layer. It can directly judge whether the time step adjustment is appropriate, rather than changing the pipe network state [2], so as to reduce the calculation of transient simulation in the process of adjusting the time step and improve the efficiency of the time step adjustment, which is the second point of improvement.
- The time step should be in a suitable range to avoid time steps too small or large.
- The tolerable error should also be suitable. Referring to the adaptive simulation of the natural gas pipeline [22], the tolerable errors are set as $TO{L}_{t}^{P}={\Vert p\Vert}_{2}\times {10}^{-3}$, $TO{L}_{t}^{m}={\Vert m\Vert}_{2}\times {10}^{-1}$, and $TO{L}_{t}^{\varphi}=0.001$.

## 4. Results and Discussion

#### 4.1. The Virtual Pipeline

#### 4.1.1. Simulation Case

^{3}/h, 15 °C, and 3 MPa, respectively. The outlet flow rate changes suddenly from 0 Nm

^{3}/h to 1.0 × 10

^{5}Nm

^{3}/h at the beginning, jumps to 0.5 × 10

^{5}Nm

^{3}/h at the 24th hour, and then jumps to 0.1 × 10

^{5}Nm

^{3}/h at the 48th hour; one more time, the inlet temperature jumps from 15 °C to 30 °C at the beginning and jumps to 40 °C at the 24th hour, as shown in Figure 2. The inlet pressure remains 3 MPa during the entire 72 h.

#### 4.1.2. The Computational Accuracy

#### 4.1.3. The Effect

#### 4.1.4. The Efficiency

#### 4.2. The Actual Pipeline

#### 4.2.1. Simulation Case

#### 4.2.2. The Computational Accuracy

#### 4.2.3. The Effect

#### 4.2.4. The Efficiency

#### 4.3. Discussion

## 5. Conclusions

- High accuracy. In the virtual transient case, the accuracy of the results obtained by the improved time step method is almost the same as that in reference [22]. In addition, in the actual transient case, the pressure relative errors of the improved method at the last moment are only 0.184%.
- Acceptable effect and high efficiency. The improved time step method can not only adjust the time step according to the state change of the pipeline but can also consider the change in boundary conditions. When the boundary conditions change rapidly, the time step is adjusted more efficiently.

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Zhang, X.; Wu, C.; Zuo, L. Minimizing fuel consumption of a gas pipeline in transient states by dynamic programming. J. Nat. Gas Sci. Eng.
**2016**, 28, 193–203. [Google Scholar] [CrossRef] - Zapukhliak, V.; Poberezhny, L.; Maruschak, P.; Grudz, V., Jr.; Stasiuk, R.; Brezinová, J.; Guzanová, A. Mathematical modeling of unsteady gas transmission system operating conditions under insufficient loading. Energies
**2019**, 12, 1325. [Google Scholar] [CrossRef] [Green Version] - Fan, D.; Gong, J.; Zhang, S.; Shi, G.; Kang, Q.; Xiao, Y.; Wu, C. A transient composition tracking method for natural gas pipe networks. Energy
**2021**, 215, 119131. [Google Scholar] [CrossRef] - Zhang, H.; Li, J.; Su, Y.; Wang, P.; Yu, B. Effects of hydrogen blending on hydraulic and thermal characteristics of natural gas pipeline and pipe network. Oil Gas Sci. Technol. Rev. D’ifp Energ. Nouv.
**2021**, 76, 70. [Google Scholar] [CrossRef] - Kiuchi, T. An implicit method for transient gas flows in pipe networks. Int. J. Heat Fluid Flow
**1994**, 15, 378–383. [Google Scholar] [CrossRef] - Wylie, E.B.; Stoner, M.A.; Streeter, V.L. Network: System transient calculations by implicit method. Soc. Pet. Eng. J.
**1971**, 11, 356–362. [Google Scholar] [CrossRef] - Luskin, M. An approximation procedure for nonsymmetric, nonlinear hyperbolic systems with integral boundary conditions. SIAM J. Numer. Anal.
**1979**, 16, 145–164. [Google Scholar] [CrossRef] - Keenan, P.T. Thermal Simulation of Pipeline Flow. SIAM J. Numer. Anal.
**1995**, 32, 1225–1262. [Google Scholar] [CrossRef] [Green Version] - Helgaker, J.F.; Ytrehus, T. Coupling between Continuity/Momentum and Energy Equation in 1D Gas Flow. Energy Procedia
**2012**, 26, 82–89. [Google Scholar] [CrossRef] [Green Version] - Wang, P.; Yu, B.; Deng, Y.; Zhao, Y. Comparison study on the accuracy and efficiency of the four forms of hydraulic equation of a natural gas pipeline based on linearized solution. J. Nat. Gas Sci. Eng.
**2015**, 22, 235–244. [Google Scholar] [CrossRef] - Madoliat, R.; Khanmirza, E.; Moetamedzadeh, H.R. Transient simulation of gas pipeline networks using intelligent methods. J. Nat. Gas Sci. Eng.
**2016**, 29, 517–529. [Google Scholar] [CrossRef] - Wang, P.; Yu, B.; Han, D.; Sun, D.; Xiang, Y. Fast method for the hydraulic simulation of natural gas pipeline networks based on the divide-and-conquer approach. J. Nat. Gas Sci. Eng.
**2018**, 50, 55–63. [Google Scholar] [CrossRef] - Xiang, Y.; Wang, P.; Yu, B.; Sun, D. GPU-accelerated hydraulic simulations of large-scale natural gas pipeline networks based on a two-level parallel process. Oil Gas Sci. Technol. Rev. D’ifp Energ. Nouv.
**2020**, 75, 86. [Google Scholar] [CrossRef] - Bermúdez, A.; Shabani, M. Modelling compressors, resistors and valves in finite element simulation of gas transmission networks. Appl. Math. Model.
**2021**, 89, 1316–1340. [Google Scholar] [CrossRef] - Thalhammer, M.; Abhau, J. A numerical study of adaptive space and time discretisations for Gross–Pitaevskii equations. J. Comput. Phys.
**2012**, 231, 6665–6681. [Google Scholar] [CrossRef] [Green Version] - Guermond, J.-L.; Minev, P. High-Order Adaptive Time Stepping for the Incompressible Navier—Stokes Equations. SIAM J. Sci. Comput.
**2019**, 41, A770–A788. [Google Scholar] [CrossRef] [Green Version] - Mayr, M.; Wall, W.; Gee, M. Adaptive time stepping for fluid-structure interaction solvers. Finite Elem. Anal. Des.
**2018**, 141, 55–69. [Google Scholar] [CrossRef] [Green Version] - Boffie, J.; Pounders, J. An adaptive time step control scheme for the transient diffusion equation. Ann. Nucl. Energy
**2018**, 116, 280–289. [Google Scholar] [CrossRef] - Tentis, E.; Margaris, D.; Papanikas, D. Transient gas flow simulation using an adaptive method of lines. Comptes Rendus Mec.
**2003**, 331, 481–487. [Google Scholar] [CrossRef] - McGuire, D. Numerical Modeling of a Thermal-Hydraulic Loop and Test Section Design for Heat Transfer Studies in Supercritical Fluids. Doctoral Dissertation, Carleton University, Ottawa, ON, Canada, 2012. [Google Scholar]
- Shampine, L.F. Error estimation and control for ODEs. J. Sci. Comput.
**2005**, 25, 3–16. [Google Scholar] [CrossRef] - Wang, P.; Yu, B.; Han, D.; Li, J.; Sun, D.; Xiang, Y.; Wang, L. Adaptive implicit finite difference method for natural gas pipeline transient flow. Oil Gas Sci. Technol. Rev. D’ifp Energ. Nouv.
**2018**, 73, 21. [Google Scholar] [CrossRef] - Peng, W. Study on the Fast, Accurate and Robust Simulation Method for a Complex Natural Gas Pipeline Network and Its Application. Doctoral Dissertation, China University of Petroleum (Beijing), Beijing, China, 2016. [Google Scholar]
- Jianguo, Z. Research and Implementation on Simulation Engine of Large-Scale Gas Pipe Network. Doctoral Dissertation, Southwest Petroleum University, Chengdu, China, 2012. [Google Scholar]
- Benedict, M.; Webb, G.B.; Rubin, L.C. An empirical equation for thermodynamic properties of light hydrocarbons and their mixtures I. Methane, ethane, propane and n-butane. J. Chem. Phys.
**1940**, 8, 334–345. [Google Scholar] [CrossRef] - Colebrook, C.F.; Blench, T.; Chatley, H.; Essex, E.; Finniecome, J.; Lacey, G.; Williamson, J.; Macdonald, G. Correspondence. turbulent flow in pipes, with particular reference to the transition region between the smooth and rough pipe laws.(includes plates). J. Inst. Civ. Eng.
**1939**, 12, 393–422. [Google Scholar] [CrossRef]

**Figure 3.**The result of the simulation. (

**a**) The flow rate at the inlet; (

**b**) The pressure at the outlet; (

**c**) The temperature at the outlet.

U | B | F |
---|---|---|

$\left[\begin{array}{l}p\\ m\end{array}\right]$ | $\left[\begin{array}{cc}0& \frac{1}{A}{\left(\frac{\partial p}{\partial \rho}\right)}_{T}\\ \left[A-\frac{{m}^{2}}{A{\rho}^{2}}{\left(\frac{\partial \rho}{\partial p}\right)}_{T}\right]& \frac{2m}{A\rho}\end{array}\right]$ | $\left[\begin{array}{l}{\left(\frac{\partial p}{\partial T}\right)}_{\rho}\frac{\partial T}{\partial t}-\frac{\lambda}{2}\frac{m\left|m\right|}{dA\rho}\\ -A\rho g\mathrm{sin}\theta +\frac{{m}^{2}}{A{\rho}^{2}}{\left(\frac{\partial \rho}{\partial T}\right)}_{p}\frac{\partial T}{\partial x}\end{array}\right]$ |

$T$ | $m/\left(\rho A\right)$ | $\frac{1}{\rho {c}_{v}}\left[\begin{array}{l}-T{\left(\frac{\partial p}{\partial T}\right)}_{\rho}\frac{\partial \left(m/\left(\rho A\right)\right)}{\partial x}\\ +\frac{\lambda}{2}\frac{\rho {\left|w\right|}^{3}}{d}-\frac{4K\left(T-{T}_{g}\right)}{D}\end{array}\right]$ |

Hydraulic Equations | Thermodynamic Equation | |
---|---|---|

Inlet of the pipe | $p=p\left(t\right)$$\text{}\mathrm{or}\text{}m=m\left(t\right)$ | $T=T\left(t\right)$ |

Outlet of the pipe | $p=p\left(t\right)$$\text{}\mathrm{or}\text{}m=m\left(t\right)$ | None |

Boundary Conditions | Energy Number |
---|---|

Pressure (Pa) | $\raisebox{1ex}{$p$}\!\left/ \!\raisebox{-1ex}{$\rho g$}\right.$ |

Mass flow (kg/s) | $\raisebox{1ex}{${m}^{2}$}\!\left/ \!\raisebox{-1ex}{$2g$}\right.$ |

Temperature (K) | $\raisebox{1ex}{${c}_{v}T$}\!\left/ \!\raisebox{-1ex}{$g$}\right.$ |

Length | Diameter | Thickness | Roughness | Ground Temperature | Total Heat Transfer Coefficient |
---|---|---|---|---|---|

24 km | 323 mm | 8 mm | 0.02286 mm | 15 °C | 0.5 W/(m^{2}·K) |

CH_{4} | C_{2}H_{6} | C_{3}H_{8} | N_{2} | CO_{2} |
---|---|---|---|---|

97.07 | 0.17 | 0.02 | 0.71 | 2.03 |

CH_{4} | C_{2}H_{6} | C_{3}H_{8} | H_{2}S | CO_{2} |
---|---|---|---|---|

96.65 | 1.8 | 0.45 | 0.45 | 0.65 |

Total Number of Executions | The Number of Time Levels | The Difference | |
---|---|---|---|

Adaptive time step method | 2174 | 2008 | 166 |

Improved adaptive time step method | 1587 | 1507 | 80 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Guo, Q.; Liu, Y.; Yang, Y.; Song, T.; Wang, S.
Improved Adaptive Time Step Method for Natural Gas Pipeline Transient Simulation. *Energies* **2022**, *15*, 4961.
https://doi.org/10.3390/en15144961

**AMA Style**

Guo Q, Liu Y, Yang Y, Song T, Wang S.
Improved Adaptive Time Step Method for Natural Gas Pipeline Transient Simulation. *Energies*. 2022; 15(14):4961.
https://doi.org/10.3390/en15144961

**Chicago/Turabian Style**

Guo, Qiao, Yuan Liu, Yunbo Yang, Tao Song, and Shouxi Wang.
2022. "Improved Adaptive Time Step Method for Natural Gas Pipeline Transient Simulation" *Energies* 15, no. 14: 4961.
https://doi.org/10.3390/en15144961