1. Introduction
Natural gas, as a stable, low-cost, high-calorific green energy, plays an important role in protecting the ecological environment and transitioning from fossil energy to clean energy. As natural gas is a low-density, compressible fluid, pipeline transportation is the most economical way for long-distance transportation. As the natural gas pipeline network becomes larger, research development on reliability [
1], design [
2], and operation optimization [
3] is necessary, as well as the simulation of natural gas pipeline networks, to accurately reproduce the distribution of gas pressure, temperature, and flow in the pipeline, and carry out pipeline network design planning and operation scheduling based on these parameters. The conventional numerical simulation method of the natural gas pipeline is to establish a mathematical model according to the mass, momentum, and energy conservation equations, and then use a suitable numerical method to solve the equations [
4]. The choice of different mathematical models and numerical solutions determines the precision and accuracy of the simulation method [
5,
6]. For the hydraulic equation centered on the mass equation and the momentum equation, the common simplification method is to ignore the inertial term in the momentum equation. The studies found that the neglect of the inertial term will lead to large errors in the case of fast transients [
7]. The thermodynamic equation dominated by the energy equation has often been simplified by isothermal or adiabatic flow process in previous studies. However, the gas state changes with the variation of pressure and temperature, and the assumption of isothermal and adiabatic process is inconsistent with practical engineering, which leads to large errors in the temperature simulation of natural gas pipelines.
With the development of computer technology, the natural gas pipeline simulation, based on the three complete basic equations without simplification, has become mainstream. To solve complex gas pipeline flow equations, there are a variety of numerical methods. The finite difference method is commonly used to discretize the continuous solution domain into a grid of abscissa distance and ordinate time. In the finite volume method [
8], the derivative term is integrated into an expression of the state variable of the interface, and the interface value approximated from the local distribution is substituted to obtain a complete discretization equation. The characteristic line method [
5] is a method for solving hyperbolic partial differential equations based on characteristic theory, which transforms the partial differential equation into a total differential problem along the characteristic line. The idea of the state space model method [
9,
10] originates from modern control theory. Based on the Laplace transformation, the time domain functions are converted into frequency domain functions to obtain a set of closed ordinary differential equations. The state space method needs to omit the inertial system of momentum equation and use it under adiabatic or isothermal conditions, with high calculation efficiency and low calculation accuracy.
In recent years, in order to solve the problem that the accuracy and calculation speed of conventional numerical simulation methods cannot be achieved simultaneously, some scholars have begun to use data-driven modeling methods. In 2015, Hadian used neural networks to model the hydraulic steady state of a large natural gas pipeline network, and combined it with a model predictive control algorithm for pressure control [
11]. In 2018, based on deep learning algorithms, Su used time windows and autoencoders to predict the operation status of natural gas pipeline networks [
12]. In 2020, Cui used the calculation results of neural networks as the initial value in the iterative process of steady-state hydraulic calculation to speed up the calculation [
13]. In 2022, Yin adopted the idea of the surrogate model, combined with BP neural networks and genetic algorithms to carry out data-driven modeling and control of natural gas station pipeline networks [
14]. At present, the research on data-driven natural gas pipeline simulation technology is still in its infancy. The existing research is mainly based on the steady-state model considering only hydraulics, which are lack of temperature transient models.
In first principle models, the heat exchange between the natural gas in the pipeline and the environment is an important part of the thermal simulation. In some simplified thermal models, it is assumed that the total heat transfer coefficient of the pipeline and the ambient temperature around the pipeline remain unchanged. When Fourier law is used to calculate the heat transfer, the periodic changes of the ambient temperature with time are ignored in this assumption, which makes the description of the temperature field of the pipeline and the surrounding environment deviate, which results in large calculation deviations when it is brought into the thermal equation. Targeting this problem, a transient heat transfer model was developed, which iteratively solves the pipeline problem according to the time and space division, and the calculation results are more accurate than the steady-state model. However, due to the large number of calculations and the inability to obtain the environmental parameters along the line in practical application, it is difficult to apply the algorithm for engineering requirements.
When physics-based simulation models are used to simulate the natural gas temperature, steady-state thermodynamics are used to speed up the calculation, or transient thermodynamics are used to improve the simulation accuracy. Therefore, a data-driven thermal model for long distance natural gas pipelines is proposed in this paper. Using the measured temperature at both ends of the pipeline, three methods, the NARX neural network [
15], time series decomposition, and system identification [
16,
17], are used to model the temperature of the natural gas pipeline. To verify the advantages of different approaches in different aspects, three data-driven models are compared with first principle models in simulation. Finally, the calculation accuracy and applicability of different methods are judged from calculation times and errors.
This paper contributes the following:
To improve the simulation efficiency, this paper proposes an agent simulation method using data-driven methods to simulate the natural gas pipeline outlet temperature, which includes the NARX neural network, time series decomposition, and system identification.
The input parameters of the data-driven model are determined based on the mechanism analysis, which avoids the problem of blind parameter adjustments of the data-driven model and ensures the rationality of the operation and the reliability of the results.
The data-driven methods are verified by a section of the actual operating pipeline, and their simulation error influencing factors are analyzed.
5. Conclusions
Six methods in the thermal simulation of natural gas pipelines were studied in this paper: the Sukhov model, the steady-state heat transfer model, the transient heat transfer model, the NARX neural network method, the time series decomposition method, and the system identification method. The actual cases were designed to compare the simulation accuracy between the physics-based simulation models and the data-driven models. From the numerical results, the following conclusions can be made:
- (1)
The average simulation errors of the three data-driven models were 1.98%, 2.35%, and 3.01%, which satisfy the requirements for simulation accuracy in pipeline operations. The main accuracy loss of data-driven models occurred under abnormal working conditions, such as a sudden change of ambient temperature and natural gas cooling and transportation, while the calculation accuracy was very high under normal working conditions. Therefore, when the requirements for simulation accuracy are high, the data-driven model can be used for simulation under stable working conditions.
- (2)
The time calculations of the data-driven models were 4.0382 s, 1.67 s, and 1.683 s, which were faster than that of the first principle model. Among them, the total time of time series decomposition and system identification were almost consistent. The NARX neural network and system identification models need to obtain the applicable model through the analysis of historical data. The time to establish the model was relatively long, while the time series decomposition model was calculated directly, which was shorter than the NARX neural network.
- (3)
In terms of applicability, the three first principle models did not need to be calculated with actual known data, and have strong applicability to different pipelines, but the physical parameters, such as ambient temperature, thermal conductivity between the pipe and the surrounding environment should be known; the solutions of the three data-driven models were obtained by analyzing the known data. Therefore, the models obtained for different pipelines and even different working conditions were different, and there are requirements for the acquisition of actual data. Too little data will lead to the model output not being in line with the reality, and a large difference in data under different working conditions will also lead to a deviation of calculation capacity under different working conditions.
The numerical results show that data-driven models have high calculation accuracy, high simulation efficiency, and have good applicability to the direction of rapid calculation demand, such as pipeline control engineering and parallel simulation of pipe networks. Moreover, simulation results could replace part of the calculation results of the mechanism model to simplify the complex hydrothermal coupling solution method. The input parameters of the data-driven model were determined based on the physics analysis, which avoided the problem of the blind parameter adjustment of the data-driven model and ensured the rationality of the operation and the reliability of the results.
In future research, sensitivity analysis of input parameters of the data-driven model can identify pipeline parameters. In addition, it is necessary to use the data-driven model as a proxy model to speed up solving the process of thermohydraulic simulation.