| With the exploitation and application of natural gas increasing, the construction of large -diameter, high-pressure, long-distance and complication become the trend of trunk gas network now. So the management of gas network responds to being more difficult. With the simulation of gas network, we can know the network's operating law well. It has factual meaning for gas network's rational dispatch and optimum operation.With the analysis of steady-state and unsteady-state flow, it sets up exact mathematical simulation model reflecting the gas flow in gas networks, established on equations of mass conservation, momentum conservation, energy conservation and BWRS state equation for real gases. For steady-state simulation, nodal approach is used to establish isothermal networks'simulation model and with improved square root method to solve equations. And four-order Runge-Kutta numerical computing method is used to solve non-isothermal networks. For unsteady-state simulation, the implicit central difference method is used to transform partial differential equations into difference equations because its time-step isn't strict and it has good stability. Newton-Ralfson's method is used to solve nonlinear equations because of its relaxation of the requirements for initial iteration.The steady-state and unsteady-state simulation program for gas networks is adaptable. When the pressure and flow rate are low, isothermal simulation program is used to get the simulation results. And non-isothermal simulation program is used to meet more accuracy requirements. As a result, it can reduce the waste of resources. In the process of program's implementation, combination method is used to save the structure of gas networks so that all forms of gas network structures are convenient to store and read.Triple table is used to only store non-zero matrix elements to improve the program's efficiency of storage and computation because simulation model's Jacobian matrix is serious sparse. With a few simulation examples and some simulation results compared with TGNET's and SPS's, simulation program's higher reliability is verified.For Sichuan to East pipeline project ,Non-isothermal simulation program is applied to simulate its operating conditions and optimize its process systems, such as the optimal setting of compressor stations, the setting of coating, the influence of ambient temperature to gas network's operation and the problem of storage and peaking, etc. Following conclusions are reached by simulation and optimization : a reasonable compressor stations setting can save energy and investment; trunk gas lines setting with the coating can not only slow down corrosion, but also can improve gas supply efficiency and reduce the cost of the pipelines; the rising of ambient temperature would not only make compressors'operating conditions deteriorate, but also reduce the efficiency of pipelines; rational use of the law of the last paragraph pipeline's storage and peaking can be a good solution to the short-term imbalance of gas supply and using. |