An Algorithm for Calculating Gas Transmission System Optimal Stationary Mode

. In this paper, we consider the problem of calculating the optimal stationary mode of the gas transmission system. The maximum throughput of the gas transmission system was used as optimization criterion. Presented are the problem statement and the solution procedure. The original problem is divided into two interrelated components: the MINLP problem and the temperature calculation. To solve the MINLP problem, the Successive Linear Programming (SLP) method was used in combination with the branch and boundary method applied to integer variables. Modeling of compressor shop operating modes was performed using integer variables. Described are the approaches to improving the convergence of the algorithm: the introduction of an additional optimization subcriterion and additional constraints for gas flows through GTS sections.

In this paper, we consider approaches to optimizing the GTS stationary mode according to the maximum throughput criterion. At the same time, the proposed approaches are valid when using other optimization criteria (minimization of gas consumption at compressor stations etc.). The value of GTS maximum throughput is influenced by many factors: input and output boundary conditions, ambient temperature, repair works, technical condition of GTS objects and so on. Maximum throughput values of sections of the Unified Gas Supply System (UGSS) of Russia are widely used in the national gas industry in solving various practical problems. Section 2 of this paper describes the problem statement. Subsection 3.1 contains the algorithm for solving the problem. Section 3.2 describes dividing the original problem into the MINLP problem and the temperature calculation. Subsection 3.3 contains the method applied to resolving the MINLP problem. Subsection 3.4 describes an approach to modeling of compressor shop operation modes. Sections 3.5 and 3.6 contains approaches to improving the convergence of the algorithm. Section 4 provides a practical example of the calculation.

Problem Statement
It is required to calculate the GTS optimal stationary mode according to the maximum throughput criterion. Within the GTS frames, we distinguish two boundary conditions (input and output), which we call «transit» boundary conditions and we set pressure constraints for them. For other boundary conditions, we set gas flow rates. It is assumed that a compressor shop can operate in «discharge» and «bypass» modes. The mode type of the compressor shop «discharge» is modeled using a set of polynomials [16]. The mode type of the compressor shop «bypass» corresponds to the equality of the compression ratio to one. The problem of calculating the maximum throughput mode is to find the operating modes of the compressor shops and the GTS condition (gas flows through GTS sections, pressure and temperature values at GTS nodes) corresponding to the maximum of gas flow rates at the input trans   The calculation of the GTS optimal stationary mode is an iterative process. Break-down of the original problem into two interrelated components is performed: the MINLP problem [17] and the temperature calculation (subsection 3.2). Firstly, the GTS equivalence procedure is performed (removal of elements without hydraulic resistance, aggregation of successive gas pipelines with the same parameters etc.). The initial approximations for parameters fixed in the MINLP problem are set: gas temperature values at nodes, average gas temperature values along the length of gas pipelines, gas properties (compressibility factor, etc.) for gas pipelines and compressor shops. The MINLP problem is solved (subsection 3.3). Next, the temperature calculation is performed (Subsection 3.2). The source data for the temperature calculation are as follows: gas flows through GTS sections, compression ratio of compressor shops and pressure values for the «transit» boundary conditions. The results of the temperature calculation are values of gas temperature at GTS nodes, average gas temperature values along the length of the gas pipelines and gas properties (compressibility factor, etc.) for gas pipelines and compressor shops. The stop criterion is checked, which is reaching of allowable difference for two adjacent iterations per gas flows through GTS sections, gas pressure and temperature values at GTS nodes.
Starting with the iteration number

Problem Dividing
Let's divide of the original problem into two parts: 1) MINLP problem [17]; 2) 1. Temperature calculation. The MINLP problem is obtained from the original problem by fixing part of unknown variables, values of which are specified within the frames of the temperature calculation. In particular, MINLP problem has fixed (known) parameters like gas temperature values at GTS nodes and average gas temperature values along the length of the gas pipelines, gas properties (gas compressibility factor, etc.) for gas pipelines and compressor shops. In the temperature calculation, the known ones are considered to be the gas flows through GTS sections, compression ratios of compressor shops, gas pressure values for «transit» boundary conditions. When performing the division of the original problem, much attention was paid to the analysis of the «degree» of nonlinearity of the obtained MINLP problem because it is the solution of that problem represents the greatest computational complexity and time consumption.

MINLP Problem Solving
The MINLP problem consists of equations for gas pipelines, compressor shops, boundary conditions and Kirchhoff's first law. The optimization criterion of the MINLP problem is the maximum throughput (1). The integer variables of the MINLP problem are the variables of the operating mode type and the number of active gas-compressor units of compressor shops. To solve the MINLP problem, the method of Successive Linear Programming (SLP) [18][19][20][21] is used in combination with the branch and bound method [17] in respect to integer variables.

Modeling of Compressor Shop Modes
For each compressor shop two integer variables are used: binary variable x for operating mode type ( Conventionally, we denote a group of equations describing the «discharge» mode as 1 () y X , and the group of equations describing «bypass» mode as 2 () y X . The group that is executed will be determined by the criterion () F X . As a result, we get the following problem: Let's perform conversion of the problem (2) and bring it to the form (3). To do this, each equality is equivalently replaced by two inequalities, and a constant A is introduced, its value obviously being more than right-hand sides of equations in both groups. The form (3) problem is used for the MINLP problem (subsection 3.2)

Introduction of Additional Criterion
The MINLP problem (Section 3.

Introduction of Additional Constraints on Gas Flows through GTS Sections
Another approach to improvement of the algorithm convergence is to introduce additional constraints on gas flows through GTS sections, starting with the iteration number 1 tt  : These constraints mean that the value of gas flow through the GTS section at the next iteration t q can deviate from the value at the previous iteration 1 t q  by no more than a relative value  . Dependence of the  parameter on the iteration number t can be given in various ways. In this paper, the introduction of additional constraints for gas flows through GTS sections started with the iteration number

Results
The described algorithm was implemented using the C# programming language and was connected to a graphical interface as a calculation module, which allows visual editing of the GTS and displaying the calculation results. In consequence of which optimal stationary modes were calculated according to the maximum throughput criterion for different sections of the Unified Gas Supply System (UGSS) of Russia.
As an example, let's consider the calculation of the maximum throughput for one section of the UGSS of Russia (Fig. 2). This GTS includes 339 gas pipelines, 42 compressor shops, 55 boundary conditions and 2 «transit» boundary conditions.

Fig. 2. Calculated gas transmission system
The calculation was performed for 8 t  iterations. The first three iterations were continuously-integer, after that integer variables of the MINLP problem were fixed and then 5 continuous iterations were performed.
Additional constraints on gas flows through GTS sections were added since iteration number 1 4 t  with the initial value 0 1 . As a result of the calculation, the maximum throughput (per input) value was 580.4•10 6 m 3 /day. A similar calculation was made using «Astra-gas» (the most frequently used computing complex in PJSC Gazprom), the maximum throughput (per input) value was: 584.2•10 6 m 3 /day (difference 0.6%).

Conclusions
This paper covers the problem of calculating the GTS optimal stationary mode by the maximum throughput criterion. The proposed approaches are also valid when calculating the optimal GTS stationary modes according to other criteria (for example, minimization of gas consumption at compressor shops). The problem of GTS optimal stationary mode is divided into the MINLP problem and the temperature calculation. To solve the MINLP problem, the Successive Linear Programming (SLP) method is used combined with the branch and bound method in respect to integer variables. The approaches to improve the convergence of the algorithm are proposed: the introduction of an additional subcriterion and additional constraints of gas flows through GTS sections. The calculation of maximum throughput for one of the sections of the UGSS of Russia is handled as an example.