# Numerical Monitoring of Natural Gas Distribution Discrepancy Using CFD Simulator

Authors: Vadim E. Seleznev
Journal: Journal of Applied Mathematics
 (2010)

---

## Abstract

The paper describes a new method for numerical monitoring of discrepancies in natural gas supply to consumers, who receive gas from gas distribution loops. This method serves to resolve the vital problem of commercial natural gas accounting under the conditions of deficient field measurements of gas supply volumes. Numerical monitoring makes it possible to obtain computational estimates of actual gas deliveries over given time spans and to estimate their difference from corresponding values reported by gas consumers. Such estimation is performed using a computational fluid dynamics simulator of gas flows in the gas distribution system of interest. Numerical monitoring of the discrepancy is based on a statement and numerical solution of identification problem of a physically proved gas dynamics mode of natural gas transmission through specified gas distribution networks. The identified mode parameters should have a minimum discrepancy with field measurements of gas transport at specified reference points of the simulated pipeline network.


---

## Body

## 1. Introduction

In the last 20 years, operation of complex gas distribution systems has been associated with an acute problem of credible commercial accounting of natural gas supply under the deficiency of respective field measurements [1–4]. In large communities, natural gas is supplied to the consumers using medium or low pressure ring mains, being several dozen kilometers long. Gasfrom the supplier is transmitted to such mains through a gas transmission network after its pressure is reduced by means of a system of gas reducers installed at inlet gas distribution stations (GDSs) (Figure 1). Major parameters of gas supplied by the gas transportation company to the seller are also measured at the GDS outlets. Here, major parameters of natural gas include its flow rate, pressure, and temperature.Figure 1
A diagram of the gas distribution network under consideration.Gas from inlet GDSs is delivered to the ring main via the connecting gas pipelines (CGPs) network of the gas seller. Consumers receive gas from the ring mains through outlet CGPs leading from the ring main to the consumer. The length of the CGPs can range from several hundred meters to several kilometers. In the first approximation, each consumer is considered independent and provided with gas through one CGP, which is completely associated with the consumer (called “associated CGP” as the text goes). Consumer independence means that the consumer’s gas cannot be delivered to other consumers.Thus, the gas distribution network (GDN) under consideration comprises inlet CGPs from inlet GDSs, a ring main and associated CGPs. In Figure1, the GDN under consideration is shown with gray color.If the GDN operates properly, the seller seeks to sell the whole amount of gas received from the supplier. An exception in this case is natural gas forcedly accumulated in the GDN.For settlement of accounts, consumers submit reports to the seller, in which they indicate estimated volumes of received gas. These reports are usually generated either by processing the consumers’ field flow meter readings or by simplified calculations based on the rates formally established for the given category of consumers. Verification of data provided by the consumers consists in the comparison of their estimates with data obtained by processing the seller’s flow meter readings in compliance with current guidelines.The central difficulty in such verification is that the amount of field measurements of supplied gas that can be used as a reliable basis is rather limited in the present-day gas industry. Such a situation results in occasional discrepancies (especially during the heating season) in analyzing the volume of natural gas supplied to the consumers. The total discrepancy over a given time period is determined as a difference between two estimates of the gas volume. The first estimate represents the total gas volume actually received during the time period in question as reported by all consumers, and the second estimate represents the total volume of natural gas delivered by the supplier to the seller which is less than the gas volume accumulated in the GDN.It is necessary to note that in gas industry field measurements [4] were the basic tools for solving a discrepancy monitoring problem for the last decades. The given methods are effective in case of expensive high-precision measuring equipment and providing that flow rate sensors are being installed at all associated CGPs and inlet GDSs of GDN in question. Up to the present day methods of GDN numerical analysis have been of limited application. They were used for GDN geometrical parameters estimation, GDN ultimate capacity analysis, and gas deliveries problem solution [1, 3, 4]. This paper proposes to apply numerical simulation for revealing discrepancy sources of gas delivered through a GDN in the event of lack of measurement information(some of associated CGPs are not equipped with flow rate sensors) and information with a significant level of errors.The suggested approach to numerical monitoring of the discrepancy is based on a statement and numerical solution of identification problem of a physically proved gas dynamics mode of natural gas transmission through specified gas distribution networks. Identification problem solution is aimed at restoration of space-time distribution of gas flow parameters (pressure, flow rate, and temperature) along the pipelines which constitute GDN in question, on the basis of the incomplete measurement information. The identified mode parameters should have a minimum discrepancy with field measurements of gas transmission at specified reference points of the simulated pipeline network. As such, to numerical evaluation of space-time distribution of gas flow parameters along GDN, one should use the computational fluid dynamics simulator (CFD simulator) [5].Numerical estimations of gas flow parameters along GDN obtained from the identification problem solution further can be applied for discrepancy monitoring to replace missing measurement information on associated CGPs. Moreover, the comparison of gas volume values calculated and declared by consumers makes it possible to reveal gas volumes which were not paid by a particular consumer. Such approach to gas discrepancy monitoring has never been applied in the gas industry before.Section2 describes a mathematical model variant which is used in CFD simulator computational kernel for obtaining calculated estimates of gas transportation parameters.Section3 is devoted to statement and numerical solution of identification problem of a physically proved gas dynamics mode of natural gas transmission through specified gas distribution networks.Other sections of the paper are dedicated to validation and practical application of the approach suggested to numerical monitoring of gas discrepancy.


## 2. Numerical Kernel of the CFD Simulator

The kernel of the CFD simulator uses a model of gas transmission in branched graded trunk lines [6, 7]. It can be represented as a combination of two types of models: models of gas flow in long pipes adjoining a junction and models of gas flow in junctions.Branched trunk lines are long, branched, multisection pipelines. For numerical evaluation of parameters of steady and transient, non-isothermal processes of the gas mixture flow in branched trunk lines, a CFD simulator uses a model developed by tailoring the full set of integral fluid dynamics equations to conditions of the gas flow through long branched pipeline systems [7]. Transform of the 3D integral problem to an equivalent one-dimensional differential problem is implemented by accepting the minimum of required simplifications and projecting the initial system of equations onto the pipeline's geometrical axis. As such, special attention is given to the adequacy of simulation of pipeline junction nodes where the 3D nature of the gas flow is strongly displayed.There are two mathematical models of fluid flow through branched pipeline: heat conductive model of pipeline junction and nonconductive model of pipeline junction.These models were developed by Pryalov and Seleznev at the turn of the century. These alternatives differ in a way of simulation of gas heat transfer within pipeline junction. The principle underlying the simulations is to observe the major conservation laws as strictly as possible. In practice the simultaneous implementation of the models makes it possible to find an accurate solution in short time.The basis for the mathematical models of fluid flow through branched pipeline was the geometrical model of a junction (Figure2) proposed by Seleznev et al.[8]. In this model, volume V(0) can be depicted as a right prism with base area Sbase and height H (Figure 2(a)). For the prism lateral surface with linear dimensionsδ(n), true is the following relation:δ(n)=f(n)/H, where f(n) is the cross-sectional area of the pipe adjacent to the junction coreV(0). It should be noted that the summarized volume of the joint is equal toV=⋃n=0NV(n), whereV(n), n=1,…,N, is the volume of an infinitely small section of the pipe adjacent to the junction coreV(0) (see Figure 2(b)). The prism base area can be represented as follows: Sbase=ςbaseδ2(1), where ςbase is the factor depending on the prism base geometry only. Now volumeV(0) can be determined by the following formula:V(0)=HSbase=Hςbase(f(1)/H)2=ςbasef2(1)/H, which means that limH→∞V(0)=limH→∞[ςbasef2(1)/H]=0. The application of this geometrical model enabled us to approximate compliance with mass, momentum, and energy conservation laws at the pipelines junction.A Schematic of a pipeline junction:(a) 3D drawing; (b) plain scheme.
(a)(b)Simplifications and assumptions used to construct the heat conductive model of pipeline junction include the following:(1) when gas mixture flows join together, pressure can change with time, but at each time step it will have the same value at the boundaries of the pipeline junction; (2) the simulations take account of “downwind” heat and mass exchange due to heat conduction and diffusion; (3) in the pipeline junction, the gas mixture instantaneously becomes ideally uniform all over the pipeline junction volumeV(0) (see Figure 2(b));  (4) effects of gas mixture viscosity in the pipeline junction (inside the volumeV(0)) can be ignored; (5) there are no heat sources in V(0) (inside the volumeV(0)); (6) pipeline diameters near the pipeline junction are constant.Then, the heat conductive fluid dynamics model of a transient, non-isothermal, turbulent flow of a viscous, chemically inert, compressible, multicomponent gas mixture through multiline GPS which consist of pipes of round cross-sections and rigid rough heat conductive walls is represented in the following way [7, 8]:(i)
for each pipe (bend or nonbranched segment of a ring collector),(2.1)∂(ρf)∂t+∂∂x(ρwf)=0,(2.2)∂∂t(ρYmf)+∂∂x(ρYmwf)-∂∂x(ρfDm∂Ym∂x)=,m=1,NS-1¯,YNS=1-∑m=1NS-1Ym,(2.3)∂(ρwf)∂t+∂(ρw2f)∂x=-f(∂p∂x+gρ∂z1∂x)-π4λρw|w|R,(2.4)∂∂t[ρf(ε+w22)]+∂∂x[ρwf(ε+w22)]=-∂∂x(pwf)-ρwfg∂z1∂x-p∂f∂t+Qf+∂∂x(kf∂T∂x)-Φ(T,Tam)+∂∂x(ρf∑m=1NSεmDm∂Ym∂x).(ii)
for each junction (boundary sections of pipelines adjoining the junction),(2.5)∂ρ∂t+∑n=1NΘ(n)(∂(ρw)∂x)(n)=0,(2.6)∂(ρYm)∂t+∑n=1N(∂(ρYmw)∂x)(n)Θ(n)-∑n=1N[∂∂x(ρDm∂Ym∂x)]Θ(n)(n)=0,m=1,NS-1¯,YNS(n)=1-∑m=1NS-1Ym(n),(2.7)(∂(ρw)∂t)(n)+(∂(ρw2)∂x)(n)=-(∂p∂x)(n)-gρ(∂z1∂x)(n)-0.25(λρw|w|R)(n),n=1,N¯,(2.8)∂(ρε)∂t+∑n=1N(∂(ρεw)∂xΘ)(n)=-∑n=1N(p∂w∂xΘ)(n)+0.25∑n=1N(λρ|w|3ΘR)+Q(n)+∑n=1N([∂∂x(k∂T∂x)]Θ)(n)-∑n=1N(Φ(T,Tam)fΘ)(n)+∑n=1N∑m=1Ns([∂∂x(ρεmDm∂Ym∂x)]Θ)(n),(2.9)(n)T=T(ξ),ε=ε(n)=ε(ξ),(εm)(n)=(εm)(ξ),ρ=ρ(n)=ρ(ξ),p(n)=p(ξ),k(n)=k(ξ),(Dm)(n)=(Dm)(ξ),Ym=(Ym)(n)=(Ym)(ξ),(z1)(n)=(z1)(ξ)for anyn,ξ∈1,N¯,m∈1,NS¯,(2.10)∑n=1N(wfs)(n)=0;∑n=1N(∂T∂xfs)(n)=0;∑n=1N(∂Ym∂xfs)(n)=0,(2.11)s(n)={1if(n⃗(0)·n⃗(n))<0,-1if(n⃗(0)·n⃗(n))>0,Θ(n)=V(n)V=fL(n)γ(n)∑k=1N(fL(k)γ(n)),0<Θ(n)<1,∑n=1NΘ(n)=1,(iii)
equations of state (EOS)(2.12)p=p({Smix}),ε=ε({Smix});k=k({Smix}),εm=εm({Smix}),Dm=Dm({Smix}),m=1,NS¯,T1=T2=⋯=TNS=T,whereρ is the density of the gas mixture;f is the flow cross-sectional area of pipeline; t is time (marching variable);x is the spatial coordinate over the pipeline's geometrical axis (spatial variable);w is the projection of the pipeline flow cross-section averaged vector of the mixture velocity on the pipeline's geometrical axis (on the assumption of the developed turbulence);Ym is a relative mass concentration of the m component of the gas mixture;Dm is a binary diffusivity of component m in the residual mixture;NS is the number of components of the homogeneous gas mixture;p is the pressure in the gas mixture;g is a gravitational acceleration modulus;z1 is the coordinate of the point on the pipeline's axis, measured, relative to an arbitrary horizontal plane, upright;π is the Pythagorean number;λ is the friction coefficient in the Darcy-Weisbach formula;R=f/π is the pipe's internal radius;ε is specific (per unit mass) internal energy of the gas mixture;Q is specific (per unit volume) heat generation rate of sources;k is thermal conductivity;T is the temperature of gas mixture;εm is specific (per unit mass) internal energy of them component;Tm is the temperature of them component;N is the number of pipes comprising one junction (see (2.5)–(2.11))s(n) are auxiliary function which is necessary for conjugation  of axial direction for thenth pipeline (ren⃗(0)·,i⃗(n); see Figure 2(b)); Θ(n) are auxiliary weighting function, estimating contribution of  thenth pipeline for gas flow in junction;{Smix} is a set of parameters of gas mixture.  FunctionΦ(T,Tam) is defined by the law of heat transfer from the pipe to the environment and expresses the aggregate heat flow through the pipe walls along perimeterχ of the flow cross-section with areaf(Φ(T,Tam)>0 is cooling),Tam is the ambient temperature. To denote the relationship of a value to the pipe numbered byn, we use a parenthesized superscript on the left side of the value, for example,ρ(n). In (2.1)–(2.12), we use physical magnitudes averaged across the pipeline's flow cross-section.  The set of (2.1)–(2.12) is supplemented by the boundary conditions and conjugation conditions. As to conjugation conditions it is possible to specify boundary conditions simulating a complete rupture of the pipeline and/or its shut-off, operation of valves, and so forth.As was stated above, the energy equations (2.4) and (2.8) comprise function Φ(T,Tam) describing the heat exchange between the environment and natural gas in the course of its pipeline transmission. The space-time distribution of function Φ(T,Tam) is defined, in the CFD simulator, at specified time steps of the numerical analysis of parameters of the transient mode of gas transmission by solving a series of conjugate 2D or 3D problems of heat exchange between the gas flow core and the environment [8].As a rule, Redlich-Kwang equation [4, 8, 9] is used for thermal EOS in (2.12) and calorific EOS—are well-known thermodynamic relations (e.g., ε(p,T)=h(p,T)-p/ρ;dh=cpdT+(∂h/∂p)dp, where h is specific (per unit mass) enthalpy of the mixture; cp is heat capacity at constant pressure [8]).Simulation of steady processes of gas mixture flow through branched trunk lines is a less complicated task compared to (2.1)–(2.12). These models can be easily derived by simplifying the set of (2.1)–(2.12).To solve (2.1)–(2.12) numerically, the kernel of the CFD simulator generally uses grid methods [8, 10]. Unfortunately, distribution trunk lines contain a large number of CGPs located extremely irregularly at general collectors. In our case, this results in the necessity of considerable spatial grid refinement and, consequently, in a much longer runtime. To resolve this situation, the kernel of the CFD simulator offers a hybrid modification of the known integro-interpolation method [11].The solution of (2.1)–(2.12) allows to obtain calculated estimates of space-time distribution of gas transportation along GDN. These parameters are used in the net section for identification problem of a physically proved gas dynamics mode of natural gas transmission through specified gas distribution networks.


## 3. Numerical Detection of Discrepancy Origins

The following problem setup can be used for numerical monitoring of gas distribution discrepancy using CFD simulator.


### 3.1. Input Data

The input data are Layout chart of the GDN; sensor locations in the GDN, where gas parameters are measured; given time interval of GDN operation; results of field measurements of gas parameters in the GDN in the given time interval; actual (or nameplate) errors of instruments used to measure gas parameters; data on received gas volumes as reported by each consumer for the given time interval.


### 3.2. Target Data

The target data are(1) Physically based gas flow parameters in the GDN in the given time interval having a minimum discrepancy compared to respective field measurement data at identification (control) points and providing the closest possible agreement between calculated flow rate values at the outlet of each associated CGP and corresponding reported values (further as the text goes, this mode will be called “the identified gas flow”); (2) associated CGPs with underreported gas volumes as against the identified gas flow; (3) calculated estimates of discrepancies between gas volumes delivered in the given time interval through each associated CGP as an arithmetic difference between the calculated gas volume corresponding to the identified gas flow and the reported value; (4) calculated estimates of discrepancies between gas volumes delivered in the given time interval through each inlet GDS as an arithmetic difference between the calculated gas volume corresponding to the identified gas flow and the reported value.Correct simulation of item 1 in the problem statement makes it possible to obtain credible information on physically consistent space-time distributions of flow rates, pressures, and temperatures for the gas flow, which is most reasonable for the given time interval with the given field measurement data. Convergence of calculated and reported gas flow values for individual consumers increases the level of objectivity of numerical analysis, as it seeks to maintain the highest possible trust in the data on received gas volumes reported by the consumers.It follows from the above problem statement that numerical monitoring of gas distribution discrepancy under items 2–4 in the list of target values in essence consists in performing straightforward arithmetic operations with output data of item 1. Therefore, special attention below will be paid to the algorithm of this calculation. In the first approximation, we consider the process of gas flow through the GDN to be steady state.In order to calculate non-isothermal steady-state gas flow parameters in the GDN under consideration, the following boundary conditions of “Type I” need to be specified: pressure, temperature, and composition are defined at the outlet of each inlet GDS; mass flow rate and gas temperature are defined at the outlet of each associated CGP.Using the CFD simulator with the given BC and fixed GDN characteristics, one can unambiguously determine physically based spatial distributions of calculated estimates of steady-state GDN operation parameters. Spatial distributions of parameters here mean their distributions along the pipelines.A diagram of identification locations is generated on the given layout of sensor locations in the GDN. The preferred location of each identification point should correspond to the key requirement: a considerable change in the fluid dynamics conditions of GDN operation should be accompanied by considerable changes in the gas parameters actually measured at this point. The distribution of identification points over the GDN diagram should be as uniform as possible. An identification point can be located both inside the GDN and at its boundaries. At each identification point, different combinations of major gas flow parameters can be measured. These combinations can be varied for every identification point.The process of finding the identified gas flow comes to the statement and solution of the problem of conditional optimization:(3.1)min∥f⃗calc(X⃗)-f⃗measconst∥LsubjecttoX⃗∈Ω⊂Rn,
where ∥⋯∥L is the vector norm, the type of which is determined by the value of the parameter L,(L=0,1,2) (see below); f⃗calc(X⃗),fcalc:Rn→Rm, is the vector function of calculated estimates of controlled transported gas variables at the identification points in the m-dimensional Euclidean space Rm (these calculated estimates are obtained using the CFD simulator with application of (2.1)–(2.12), where X⃗ is boundary condition at CFD analysis (see below (3.3)–(3.6) and (3.10));  f⃗measconst∈Rm is a given vector of measured values of controlled transported gas variables at the identification points; m is the number of given identification points in the GDN diagram; X⃗∈Ω⊂Rn is the vector of independent controlled variables in the n-dimensional Euclidean space Rn;(3.2)X⃗∈Ω={X⃗∈Rn:a⃗≤X⃗≤b⃗;∥q⃗calcGDS(X⃗)-q⃗meas_GDSconst∥0≤τflow_rateGDS};a⃗∈Rnandb⃗∈Rn are correctly defined vectors setting limits in simple constraints for the range of admissible variation of the vector of independent controlled variables (see below); n is the number of independent controlled variables (see below); ∥⋯∥0 is the cubic vector norm (e.g., ∥Y⃗∥0=max1≤i≤n|yi|,Y⃗∈Rn); q⃗calcGDS(X⃗),qcalcGDS:Rn→Rl, is the vector function of calculated estimates of mass flow rates through inlet GDSs in the l-dimensional Euclidean space Rl (these calculated estimates are obtained using the CFD simulator); q⃗meas_GDSconst∈Rl is a given vector of measured mass flow rates at GDS outlets; l is the number of GDSs; τflow_rateGDS=const is a given upper estimate of actual (nameplate) absolute error of flow meters installed at the inlet GDSs. The constraint in the form of a one-sided weak inequality in (3.2) formalizes the assumption that the probability of gas underdelivery by the supplier is small.Componentsxi of the vector of independent controlled variables here mean some boundary conditions of “Type I” specified in the simulations of steady-state fluid dynamics conditions using the CFD simulator. As practice shows, problem (3.1)-(3.2) can be solved successfully if as components of the vector of independent variables one uses an integrated set of mass flow rates at outlet boundaries of associated CGPs (xi,i=1,k¯) and pressures at outlet GDSs (xi,i=k+1,n¯,n=k+l), where k is the number of associated CGPs.Components(ai,bi,i=1,k¯) (see (3.2)) establish the ranges for controlled variables, the size of which is largely attributed to the degree of the seller’s actual trust in a certain consumer. The following conditions should be necessarily observed:(3.3)ai+τflow_ratecons<[qconsconst]i<bi-τflow_ratecons,i=1,k¯,ai+τflow_ratecons<[x0]i<bi-τflow_ratecons,i=1,k¯,(3.4)∑i=1k[x0]i=∑i=1k{[qconsconst]i+[Δqsellconst]i}=∑j=1l[qmeas_GDSconst]j,
where q⃗consconst∈Rk is a given vector of mass flow rates at outlet boundaries of associated CGPs; τflow_ratecons=const is a given upper estimate of the actual (nameplate) absolute error of flow meters installed at outlet boundaries of associated CGPs; X⃗0∈Rn is the starting point of the conditional optimization problem; Δq⃗sellconst∈Rk is the increment vector for reported mass flow rates at outlet boundaries of associated CGPs, which is chosen by the gas seller depending on the degree of trust in a certain consumer. Fulfillment of conditions (3.3) is a guaranty for the consumers that the discrepancy analysis will necessarily account for their reported values of received gas volumes. Constraints (3.4) serve to implement quasi-steady-state operating conditions of the pipeline network of interest from the very starting point of the conditional optimization problem. The values of remaining components (ai,bi,i=k+1,n¯) are generally defined in accordance with conditions(3.5)ai+τpressureGDS<[x0]i<bi-τpressureGDS,i=k+1,n¯,[x0]i=[pmeas_GDSconst]i-k,i=k+1,n¯,
where p⃗meas_GDSconst∈Rl is a given vector of measured pressures in the GDS; τpressureGDS is a given upper estimate of the actual (nameplate) absolute error of pressure gauges installed in the GDS. As a result of fulfillment of conditions (3.3) and (3.5), the starting point of optimization problem (3.1)-(3.2) will be the inner point with respect to simple constraints on controlled variables, which by far extends the range of methods that can be used for conditional minimization.Thus, based on (3.3)–(3.5),(3.6)ai<{min([x0]i-τflow_ratecons;[qconsconst]i-τflow_ratecons),i=1,k¯;[pmeas_GDSconst]i-k-τpressureGDS,i=k+1,n¯},bi>{max([x0]i+τflow_ratecons;[qconsconst]i+τflow_ratecons),i=1,k¯;[pmeas_GDSconst]i-k+τpressureGDS,i=k+1,n¯}.
Problems (3.1)–(3.6) can take different forms depending on the type of the vector norm chosen in (3.1). For example, if we choose the cubic vector norm (L=0), we come to a discrete minimax problem [12] with constraints in the form of one-sided weak inequalities and simple constraints on independent controlled variables:(3.7)min{max1≤i≤m|[fcalc(X⃗)]i-[fmeasconst]i|}subjecttoX⃗∈Ω⊂Rn.Solution to (3.7) provides so-called uniform agreement between calculated estimates of gas flow parameters and their measured values [13]. Choosing the octahedron vector norm (L=1) transforms initial problem (3.1)–(3.6) into a general nonlinear programming problem represented in the following way:(3.8)min∑i=1m|[fcalc(X⃗)]i-[fmeasconst]i|subjecttoX⃗∈Ω*={X⃗∈Rn:a⃗≤X⃗≤b⃗;|[qcalcGDS(X⃗)]j-[qmeas_GDSconst]j|-tflow_rateGDS≤0,j=1,l¯}.
Choosing the Euclidean vector norm (L=2) in (3.1) results in the statement of a new conditional optimization problem, which is almost equivalent to (3.2)–(3.6) and (3.8):(3.9)min∑i=1m([fcalc(X⃗)]i-[fmeasconst]i)2subjecttoX⃗∈Ω*={X⃗∈Rn:a⃗≤X⃗≤b⃗;|[qcalcGDS(X⃗)]j-[qmeas_GDSconst]j|-tflow_rateGDS≤0,j=1,l¯}.Solution of (3.2)–(3.6) and (3.9) provides root-mean-square agreement between calculated estimates of gas flow parameters and their measured values. It should be stressed here that statement (3.2)–(3.7) is stricter than (3.2)–(3.6) and (3.9).Problems (3.2)–(3.7), (3.2)–(3.6), (3.8), and (3.2)–(3.6), (3.9) can be solved numerically using the method of modified Lagrange functions [14, 15], which is quite suitable for this purpose. Note that in practice the time of numerical solution of (3.2)–(3.6) and (3.9) in most cases is much shorter than the time of numerical solution of problems (3.2)–(3.7) or (3.2)–(3.6) and (3.8).To choose a certain type of the target function in problem (3.1)-(3.2), a series of numerical experiments were conducted and more than a hundred applied tasks were simulated. The best (in terms of the accuracy/runtime ratio) results in simulating the identification problem (3.1)-(3.2) were obtained using target function (3.9).Based on the above considerations, in order to provide efficiency and improved accuracy of industrial applications, it is reasonable to propose the following algorithm for finding the identified gas flow in the GDN at the initial stage.Step 1.
Define the starting pointX⃗0∈Rn in accordance with conditions (3.4) and (3.5). Define the vectors a⃗andb⃗ in simple constraints according to (3.6).Step 2.
Solve optimization problem (3.2)–(3.6) and (3.9). Results of its numerical solution become input data in searching for the conditional minimum at Step 4.Step 3.
Analyze correctness of solution results from Step2. The correctness criterion in this case is the condition of necessary fulfillment of all constraints in problem (3.2)–(3.6) and (3.9). If this criterion is satisfied, proceed to Step 4. If not, extend the variation range of independent variables with subsequent transition to Step 2, that is, ({a⃗,b⃗}⇒{a⃗*,b⃗*}). Usually, the range extension algorithm used here is heuristic and based on the experience gained in the course of actual simulations.Step 4.
Find numerical solution to problem (3.2)–(3.7) from the starting point, obtained at Step 2, by the method of modified Lagrange functions. Execution of Step 4 makes it possible to reduce or completely eliminate individual local peaks in discrepancy between calculated estimates and measured values, which may appear at Step 2.Step 5.
Analyze correctness of the results obtained at Step4, that is, check the necessary fulfillment of all constraints in problem (3.2)–(3.7). If the correctness criterion is not fulfilled, solution of Step 3 is assumed to be the target solution.Step 6.
The vector of controlled variables corresponding to the optimal solution at Step5 is designated as X⃗init, with X⃗init∈Φ⊂Rn. The found fluid dynamics condition of GDN operation is taken as the primary fluid dynamics mode. Its calculated parameters have uniform (i.e., strictest) agreement with respective measured values.At the final stage of identification, the primary fluid dynamics mode is corrected within the available measured information, in order to minimize possible discrepancies between calculated and reported estimates of gas volumes transmitted through each associated CGP in the given time interval. This stage is legal by nature, because given the limited amount of measured data the gas seller has no right to accuse the consumer a priori of deliberate misrepresentation of reported received gas volumes. This stage consists in the solution of the general nonlinear programming problem:(3.10)min∥q⃗calccons(X⃗)-q⃗consconst∥2subjecttoX⃗∈Θ={X⃗∈Rn:ai**≤xi≤bi**,i=1,k¯,[pinit_GDSconst]i-τpressureGDS≤xi≤[pinit_GDSconst]i+τpressureGDS,i=k+1,n¯,|[fcalcident(X⃗)]s-[finit_identconst]s|-τpressureident≤0,s=1,h¯,|[qcalcGDS(X⃗)]j-[qmeas_GDSconst]j|-τflow_rateGDS≤0,j=1,l¯},
where q⃗calccons(X⃗)⊂X⃗,[qcalc(x)]i=xi,i=1,k¯, is the vector function of calculated mass flow rates for outlet boundaries of associated CGPs in the k-dimensional Euclidean space Rk; p⃗init_GDSconst∈Rl is a given vector of GDS pressure corresponding to the primary fluid dynamics mode at X⃗init∈Rn; f⃗calcident(X⃗),fcalcident:Rn→Rh, is the vector function of calculated estimates of controlled variables at internal identification points in the h-dimensional Euclidean space Rh (these calculated estimates are obtained using the CFD simulator); f⃗init_identconst∈Rh is a given vector of controlled variables at internal identification points corresponding to the primary fluid dynamics mode at  X⃗init∈Rn; h is a given number of internal identification points; τpressureident=const is a given upper estimate of the actual (nameplate) absolute error of pressure gauges at internal identification points.The first group of simple constraints on the controlled variables in (3.10) is partly redundant. It assures that numerical search for solutions in industrial applications is always performed in the domain of practically significant results. The second group of simple constraints and the second group of one-sided weak inequality constraints in problem (3.10) account for the imperfectness of corresponding existing instruments in favor of consumers. The first group of one-sided weak inequality constraints in (3.10) formalizes the demand for the closest possible uniform agreement between calculated estimates and reported volumes of gas received by each consumer.Problem (3.10) can be solved using modified Lagrange functions [14]. In accordance with this method, we derive the modified Lagrange function L̃c(X⃗,μ⃗):(3.11)L̃c(X⃗,μk⃗)=ω(X⃗)+12ck∑j=1l{[max{0;μkj+ckgj(→X)}]2-(μkj)2},
where μk⃗∈Rl is the vector of Lagrange multipliers at the kth iteration of the modified Lagrange functions method; ω(X⃗)=∑i=1m([fcalc(X⃗)]i-[fmeasconst]i)2 (see (3.9)); ck is the scalar parameter at the kth iteration of the modified Lagrange functions method; g⃗(X⃗),g:Rn→Rl, is the constraint vector function in the form of one-sided slack inequalities in (3.2), that is,(3.12)g⃗(X⃗)=(|[qcalcGDS(X⃗)]1-[meas_GDSconst]1|-tflow_rateGDS⋯|[qcalcGDS(X⃗)]l-[qmeas_GDSconst]l|-tflow_rateGDS)∈Rl.For the Lagrange multiplier vectorμk⃗ given at the kth iteration and the value of the scalar parameter ck, the vector Xk⃗ is defined as a minimum of function (3.11) with simple constraints on the variables (a⃗≤X⃗≤b⃗) (see (3.10)). The minimization problem for function (3.11)-(3.12) with simple constraints on variables can be solved, for example, by the modified conjugate directions method [12], which is stable with respect to the accumulation of arithmetic errors. Then we calculate [14](3.13)μk+1j=max{0;μkj+ckgj(Xk⃗)},j=1,m+l¯,ck+1={βckif∥g⃗(Xk⃗)∥0>γ·∥g⃗(Xk-1⃗)∥0,ckif∥g⃗(Xk⃗)∥0≤γ·∥g⃗(Xk-1⃗)∥0,
where β is a given numerical factor, 4≤β≤10 [14]; γ is a given numerical factor corresponding to the linear  constraint residual decay rate, 0<γ<1 [15]. We recommend using the following pair [14, 15]: β=10; γ=0,25.The initial vectorμ0⃗ is chosen as close as possible to the optimal vector μopt⃗. For this purpose, we use available a priori information about the solution. The initial value of the parameter c0 should not be too large in order to avoid making the function minimization problem (3.11)–(3.13) artificially ill-conditioned.As a starting point here we useXinit⃗∈Rn. The target result of the simulation should necessarily be correct, that is, it should fulfill all simple constraints and inequality constraints of problem (3.10). Otherwise, the primary fluid dynamics mode is taken as a solution to (3.10).


## 3.1. Input Data

The input data are Layout chart of the GDN; sensor locations in the GDN, where gas parameters are measured; given time interval of GDN operation; results of field measurements of gas parameters in the GDN in the given time interval; actual (or nameplate) errors of instruments used to measure gas parameters; data on received gas volumes as reported by each consumer for the given time interval.


## 3.2. Target Data

The target data are(1) Physically based gas flow parameters in the GDN in the given time interval having a minimum discrepancy compared to respective field measurement data at identification (control) points and providing the closest possible agreement between calculated flow rate values at the outlet of each associated CGP and corresponding reported values (further as the text goes, this mode will be called “the identified gas flow”); (2) associated CGPs with underreported gas volumes as against the identified gas flow; (3) calculated estimates of discrepancies between gas volumes delivered in the given time interval through each associated CGP as an arithmetic difference between the calculated gas volume corresponding to the identified gas flow and the reported value; (4) calculated estimates of discrepancies between gas volumes delivered in the given time interval through each inlet GDS as an arithmetic difference between the calculated gas volume corresponding to the identified gas flow and the reported value.Correct simulation of item 1 in the problem statement makes it possible to obtain credible information on physically consistent space-time distributions of flow rates, pressures, and temperatures for the gas flow, which is most reasonable for the given time interval with the given field measurement data. Convergence of calculated and reported gas flow values for individual consumers increases the level of objectivity of numerical analysis, as it seeks to maintain the highest possible trust in the data on received gas volumes reported by the consumers.It follows from the above problem statement that numerical monitoring of gas distribution discrepancy under items 2–4 in the list of target values in essence consists in performing straightforward arithmetic operations with output data of item 1. Therefore, special attention below will be paid to the algorithm of this calculation. In the first approximation, we consider the process of gas flow through the GDN to be steady state.In order to calculate non-isothermal steady-state gas flow parameters in the GDN under consideration, the following boundary conditions of “Type I” need to be specified: pressure, temperature, and composition are defined at the outlet of each inlet GDS; mass flow rate and gas temperature are defined at the outlet of each associated CGP.Using the CFD simulator with the given BC and fixed GDN characteristics, one can unambiguously determine physically based spatial distributions of calculated estimates of steady-state GDN operation parameters. Spatial distributions of parameters here mean their distributions along the pipelines.A diagram of identification locations is generated on the given layout of sensor locations in the GDN. The preferred location of each identification point should correspond to the key requirement: a considerable change in the fluid dynamics conditions of GDN operation should be accompanied by considerable changes in the gas parameters actually measured at this point. The distribution of identification points over the GDN diagram should be as uniform as possible. An identification point can be located both inside the GDN and at its boundaries. At each identification point, different combinations of major gas flow parameters can be measured. These combinations can be varied for every identification point.The process of finding the identified gas flow comes to the statement and solution of the problem of conditional optimization:(3.1)min∥f⃗calc(X⃗)-f⃗measconst∥LsubjecttoX⃗∈Ω⊂Rn,
where ∥⋯∥L is the vector norm, the type of which is determined by the value of the parameter L,(L=0,1,2) (see below); f⃗calc(X⃗),fcalc:Rn→Rm, is the vector function of calculated estimates of controlled transported gas variables at the identification points in the m-dimensional Euclidean space Rm (these calculated estimates are obtained using the CFD simulator with application of (2.1)–(2.12), where X⃗ is boundary condition at CFD analysis (see below (3.3)–(3.6) and (3.10));  f⃗measconst∈Rm is a given vector of measured values of controlled transported gas variables at the identification points; m is the number of given identification points in the GDN diagram; X⃗∈Ω⊂Rn is the vector of independent controlled variables in the n-dimensional Euclidean space Rn;(3.2)X⃗∈Ω={X⃗∈Rn:a⃗≤X⃗≤b⃗;∥q⃗calcGDS(X⃗)-q⃗meas_GDSconst∥0≤τflow_rateGDS};a⃗∈Rnandb⃗∈Rn are correctly defined vectors setting limits in simple constraints for the range of admissible variation of the vector of independent controlled variables (see below); n is the number of independent controlled variables (see below); ∥⋯∥0 is the cubic vector norm (e.g., ∥Y⃗∥0=max1≤i≤n|yi|,Y⃗∈Rn); q⃗calcGDS(X⃗),qcalcGDS:Rn→Rl, is the vector function of calculated estimates of mass flow rates through inlet GDSs in the l-dimensional Euclidean space Rl (these calculated estimates are obtained using the CFD simulator); q⃗meas_GDSconst∈Rl is a given vector of measured mass flow rates at GDS outlets; l is the number of GDSs; τflow_rateGDS=const is a given upper estimate of actual (nameplate) absolute error of flow meters installed at the inlet GDSs. The constraint in the form of a one-sided weak inequality in (3.2) formalizes the assumption that the probability of gas underdelivery by the supplier is small.Componentsxi of the vector of independent controlled variables here mean some boundary conditions of “Type I” specified in the simulations of steady-state fluid dynamics conditions using the CFD simulator. As practice shows, problem (3.1)-(3.2) can be solved successfully if as components of the vector of independent variables one uses an integrated set of mass flow rates at outlet boundaries of associated CGPs (xi,i=1,k¯) and pressures at outlet GDSs (xi,i=k+1,n¯,n=k+l), where k is the number of associated CGPs.Components(ai,bi,i=1,k¯) (see (3.2)) establish the ranges for controlled variables, the size of which is largely attributed to the degree of the seller’s actual trust in a certain consumer. The following conditions should be necessarily observed:(3.3)ai+τflow_ratecons<[qconsconst]i<bi-τflow_ratecons,i=1,k¯,ai+τflow_ratecons<[x0]i<bi-τflow_ratecons,i=1,k¯,(3.4)∑i=1k[x0]i=∑i=1k{[qconsconst]i+[Δqsellconst]i}=∑j=1l[qmeas_GDSconst]j,
where q⃗consconst∈Rk is a given vector of mass flow rates at outlet boundaries of associated CGPs; τflow_ratecons=const is a given upper estimate of the actual (nameplate) absolute error of flow meters installed at outlet boundaries of associated CGPs; X⃗0∈Rn is the starting point of the conditional optimization problem; Δq⃗sellconst∈Rk is the increment vector for reported mass flow rates at outlet boundaries of associated CGPs, which is chosen by the gas seller depending on the degree of trust in a certain consumer. Fulfillment of conditions (3.3) is a guaranty for the consumers that the discrepancy analysis will necessarily account for their reported values of received gas volumes. Constraints (3.4) serve to implement quasi-steady-state operating conditions of the pipeline network of interest from the very starting point of the conditional optimization problem. The values of remaining components (ai,bi,i=k+1,n¯) are generally defined in accordance with conditions(3.5)ai+τpressureGDS<[x0]i<bi-τpressureGDS,i=k+1,n¯,[x0]i=[pmeas_GDSconst]i-k,i=k+1,n¯,
where p⃗meas_GDSconst∈Rl is a given vector of measured pressures in the GDS; τpressureGDS is a given upper estimate of the actual (nameplate) absolute error of pressure gauges installed in the GDS. As a result of fulfillment of conditions (3.3) and (3.5), the starting point of optimization problem (3.1)-(3.2) will be the inner point with respect to simple constraints on controlled variables, which by far extends the range of methods that can be used for conditional minimization.Thus, based on (3.3)–(3.5),(3.6)ai<{min([x0]i-τflow_ratecons;[qconsconst]i-τflow_ratecons),i=1,k¯;[pmeas_GDSconst]i-k-τpressureGDS,i=k+1,n¯},bi>{max([x0]i+τflow_ratecons;[qconsconst]i+τflow_ratecons),i=1,k¯;[pmeas_GDSconst]i-k+τpressureGDS,i=k+1,n¯}.
Problems (3.1)–(3.6) can take different forms depending on the type of the vector norm chosen in (3.1). For example, if we choose the cubic vector norm (L=0), we come to a discrete minimax problem [12] with constraints in the form of one-sided weak inequalities and simple constraints on independent controlled variables:(3.7)min{max1≤i≤m|[fcalc(X⃗)]i-[fmeasconst]i|}subjecttoX⃗∈Ω⊂Rn.Solution to (3.7) provides so-called uniform agreement between calculated estimates of gas flow parameters and their measured values [13]. Choosing the octahedron vector norm (L=1) transforms initial problem (3.1)–(3.6) into a general nonlinear programming problem represented in the following way:(3.8)min∑i=1m|[fcalc(X⃗)]i-[fmeasconst]i|subjecttoX⃗∈Ω*={X⃗∈Rn:a⃗≤X⃗≤b⃗;|[qcalcGDS(X⃗)]j-[qmeas_GDSconst]j|-tflow_rateGDS≤0,j=1,l¯}.
Choosing the Euclidean vector norm (L=2) in (3.1) results in the statement of a new conditional optimization problem, which is almost equivalent to (3.2)–(3.6) and (3.8):(3.9)min∑i=1m([fcalc(X⃗)]i-[fmeasconst]i)2subjecttoX⃗∈Ω*={X⃗∈Rn:a⃗≤X⃗≤b⃗;|[qcalcGDS(X⃗)]j-[qmeas_GDSconst]j|-tflow_rateGDS≤0,j=1,l¯}.Solution of (3.2)–(3.6) and (3.9) provides root-mean-square agreement between calculated estimates of gas flow parameters and their measured values. It should be stressed here that statement (3.2)–(3.7) is stricter than (3.2)–(3.6) and (3.9).Problems (3.2)–(3.7), (3.2)–(3.6), (3.8), and (3.2)–(3.6), (3.9) can be solved numerically using the method of modified Lagrange functions [14, 15], which is quite suitable for this purpose. Note that in practice the time of numerical solution of (3.2)–(3.6) and (3.9) in most cases is much shorter than the time of numerical solution of problems (3.2)–(3.7) or (3.2)–(3.6) and (3.8).To choose a certain type of the target function in problem (3.1)-(3.2), a series of numerical experiments were conducted and more than a hundred applied tasks were simulated. The best (in terms of the accuracy/runtime ratio) results in simulating the identification problem (3.1)-(3.2) were obtained using target function (3.9).Based on the above considerations, in order to provide efficiency and improved accuracy of industrial applications, it is reasonable to propose the following algorithm for finding the identified gas flow in the GDN at the initial stage.Step 1.
Define the starting pointX⃗0∈Rn in accordance with conditions (3.4) and (3.5). Define the vectors a⃗andb⃗ in simple constraints according to (3.6).Step 2.
Solve optimization problem (3.2)–(3.6) and (3.9). Results of its numerical solution become input data in searching for the conditional minimum at Step 4.Step 3.
Analyze correctness of solution results from Step2. The correctness criterion in this case is the condition of necessary fulfillment of all constraints in problem (3.2)–(3.6) and (3.9). If this criterion is satisfied, proceed to Step 4. If not, extend the variation range of independent variables with subsequent transition to Step 2, that is, ({a⃗,b⃗}⇒{a⃗*,b⃗*}). Usually, the range extension algorithm used here is heuristic and based on the experience gained in the course of actual simulations.Step 4.
Find numerical solution to problem (3.2)–(3.7) from the starting point, obtained at Step 2, by the method of modified Lagrange functions. Execution of Step 4 makes it possible to reduce or completely eliminate individual local peaks in discrepancy between calculated estimates and measured values, which may appear at Step 2.Step 5.
Analyze correctness of the results obtained at Step4, that is, check the necessary fulfillment of all constraints in problem (3.2)–(3.7). If the correctness criterion is not fulfilled, solution of Step 3 is assumed to be the target solution.Step 6.
The vector of controlled variables corresponding to the optimal solution at Step5 is designated as X⃗init, with X⃗init∈Φ⊂Rn. The found fluid dynamics condition of GDN operation is taken as the primary fluid dynamics mode. Its calculated parameters have uniform (i.e., strictest) agreement with respective measured values.At the final stage of identification, the primary fluid dynamics mode is corrected within the available measured information, in order to minimize possible discrepancies between calculated and reported estimates of gas volumes transmitted through each associated CGP in the given time interval. This stage is legal by nature, because given the limited amount of measured data the gas seller has no right to accuse the consumer a priori of deliberate misrepresentation of reported received gas volumes. This stage consists in the solution of the general nonlinear programming problem:(3.10)min∥q⃗calccons(X⃗)-q⃗consconst∥2subjecttoX⃗∈Θ={X⃗∈Rn:ai**≤xi≤bi**,i=1,k¯,[pinit_GDSconst]i-τpressureGDS≤xi≤[pinit_GDSconst]i+τpressureGDS,i=k+1,n¯,|[fcalcident(X⃗)]s-[finit_identconst]s|-τpressureident≤0,s=1,h¯,|[qcalcGDS(X⃗)]j-[qmeas_GDSconst]j|-τflow_rateGDS≤0,j=1,l¯},
where q⃗calccons(X⃗)⊂X⃗,[qcalc(x)]i=xi,i=1,k¯, is the vector function of calculated mass flow rates for outlet boundaries of associated CGPs in the k-dimensional Euclidean space Rk; p⃗init_GDSconst∈Rl is a given vector of GDS pressure corresponding to the primary fluid dynamics mode at X⃗init∈Rn; f⃗calcident(X⃗),fcalcident:Rn→Rh, is the vector function of calculated estimates of controlled variables at internal identification points in the h-dimensional Euclidean space Rh (these calculated estimates are obtained using the CFD simulator); f⃗init_identconst∈Rh is a given vector of controlled variables at internal identification points corresponding to the primary fluid dynamics mode at  X⃗init∈Rn; h is a given number of internal identification points; τpressureident=const is a given upper estimate of the actual (nameplate) absolute error of pressure gauges at internal identification points.The first group of simple constraints on the controlled variables in (3.10) is partly redundant. It assures that numerical search for solutions in industrial applications is always performed in the domain of practically significant results. The second group of simple constraints and the second group of one-sided weak inequality constraints in problem (3.10) account for the imperfectness of corresponding existing instruments in favor of consumers. The first group of one-sided weak inequality constraints in (3.10) formalizes the demand for the closest possible uniform agreement between calculated estimates and reported volumes of gas received by each consumer.Problem (3.10) can be solved using modified Lagrange functions [14]. In accordance with this method, we derive the modified Lagrange function L̃c(X⃗,μ⃗):(3.11)L̃c(X⃗,μk⃗)=ω(X⃗)+12ck∑j=1l{[max{0;μkj+ckgj(→X)}]2-(μkj)2},
where μk⃗∈Rl is the vector of Lagrange multipliers at the kth iteration of the modified Lagrange functions method; ω(X⃗)=∑i=1m([fcalc(X⃗)]i-[fmeasconst]i)2 (see (3.9)); ck is the scalar parameter at the kth iteration of the modified Lagrange functions method; g⃗(X⃗),g:Rn→Rl, is the constraint vector function in the form of one-sided slack inequalities in (3.2), that is,(3.12)g⃗(X⃗)=(|[qcalcGDS(X⃗)]1-[meas_GDSconst]1|-tflow_rateGDS⋯|[qcalcGDS(X⃗)]l-[qmeas_GDSconst]l|-tflow_rateGDS)∈Rl.For the Lagrange multiplier vectorμk⃗ given at the kth iteration and the value of the scalar parameter ck, the vector Xk⃗ is defined as a minimum of function (3.11) with simple constraints on the variables (a⃗≤X⃗≤b⃗) (see (3.10)). The minimization problem for function (3.11)-(3.12) with simple constraints on variables can be solved, for example, by the modified conjugate directions method [12], which is stable with respect to the accumulation of arithmetic errors. Then we calculate [14](3.13)μk+1j=max{0;μkj+ckgj(Xk⃗)},j=1,m+l¯,ck+1={βckif∥g⃗(Xk⃗)∥0>γ·∥g⃗(Xk-1⃗)∥0,ckif∥g⃗(Xk⃗)∥0≤γ·∥g⃗(Xk-1⃗)∥0,
where β is a given numerical factor, 4≤β≤10 [14]; γ is a given numerical factor corresponding to the linear  constraint residual decay rate, 0<γ<1 [15]. We recommend using the following pair [14, 15]: β=10; γ=0,25.The initial vectorμ0⃗ is chosen as close as possible to the optimal vector μopt⃗. For this purpose, we use available a priori information about the solution. The initial value of the parameter c0 should not be too large in order to avoid making the function minimization problem (3.11)–(3.13) artificially ill-conditioned.As a starting point here we useXinit⃗∈Rn. The target result of the simulation should necessarily be correct, that is, it should fulfill all simple constraints and inequality constraints of problem (3.10). Otherwise, the primary fluid dynamics mode is taken as a solution to (3.10).


## 4. Method Validation

A series of test simulations was performed to test the performance and efficiency of the method for the numerical detection of discrepancy origins described in Section3. Let us acquaint ourselves with the statement and results of one test simulation. In this test, we considered a hypothesized GDN. Its computational diagram is shown in Figure 3. Pipeline parameters in the model GDN are shown in Tables 1 and 2.Table 1
Pipe parameters in test.
Roughness, mHeat conduction coefficient of pipe wall, W⁄(m·K)Thickness of film insulation, mHeat conduction coefficient of film insulation, W⁄(m·K)Height of pipe axis of symmetry,  mWalltemperature,  KWall thickness, m0.0004546.70.0010.150273.150.0125Table 2
Pipeline parameters in test.
PipeLength, mQuantityof nodes ofspace meshOuter diameter of pipeline, mCGP (ring)14000151.220CGP (towards to consumers)10020.520CGP (from GDNs)9000101.220Figure 3
A testing diagram of the hypothesized gas distribution network.As a consistency test of the method developed, we performed a series of simulations of steady-state gas transport in the hypothesized GDN. The boundary conditions for these simulations are given in Table3. For the purpose of the test simulation, this kind of transport was taken as the basic identified gas dynamic mode.Table 3
Boundary Conditions.
ObjectType of BCFlow rate, kg/sPressure, PaTemperature, KCGPFlow rate, Q39.409721147721.0282.6CGP 2Flow rate, Q39.409721147721.0282.6CGP 3Flow rate, Q39.409721147721.0282.6CGP 4Flow rate, Q39.409721147721.0282.6CGP 5Flow rate, Q39.409721147721.0282.6CGP 6Flow rate, Q39.409721147721,0282.6GDS 1Pressure, P78.819441180056.5267.2GDS 2Pressure, P78.819441180056.5267.2GDS 3Pressure, P78.819441180056.5267.2The layout of identification points (or reference points) in the hypothesized GDN is shown in Figure4. Depending on the type of the identification parameter, these points are marked with circles or triangles. Note that the identification points are located not only at the boundaries of the system of interest but also inside it, at Valve 2, Valve 5, and Valve 8. The identification parameters and their values are listed in Table 4.Table 4
Gas flow parameters at identification points.
ObjectParameterValueDimension of valueCGP 1pressure1147720.99[Pa]CGP 2pressure1147720.99[Pa]CGP 3pressure1147720.99[Pa]CGP 4pressure1147720.99[Pa]CGP 5pressure1147720.99[Pa]CGP 6pressure1147720.99[Pa]GDS 1flow rate78.81944[kg/s]GDS 2flow rate78.81944[kg/s]GDS 3flow rate78.81944[kg/s]Valve 2pressure1157667.38[Pa]Valve 5pressure1157667.38[Pa]Valve 8pressure1157667.38[Pa]Figure 4
A diagram of identification points placement (triangles indicate flow rate monitoring points, circles indicate pressure monitoring points).Stage1of the test simulation is usually performed to test the efficiency of numerical implementation of the initial gas dynamic mode identification algorithm in the CFD simulator kernel. According to the test conditions, the initial state of the given GDN should differ from the basic identified mode. Such an initial state is defined by a starting point, which is characterized by a set of flow rate values at the outlet boundaries of CGPs and gas pressure at GDS outlets. Based on this, one can distinguish three groups of test problems: (1) starting point is shifted to a larger (with respect to the basic) flow rate at CGPs; (2) starting point is shifted to a smaller (with respect to the basic) flow rate at CGPs; (3) starting point is shifted to a smaller (with respect to the basic) flow rate for some CGPs, and to a larger flow rate for other CGPs. This simulates existing inaccuracies in the consumer-reported values. In addition, the shift in the pressure values at GDS outlets simulates the inaccuracy of sensor-measured values of respective parameters. The objective of the test is that the simulated gas dynamic mode of the system should return to the basic identified mode.The simulation was performed using the Alfargus/Mosregiongaz computer analytical system (CAS), developed by the Physical & Technical Center, LLC. (Sarov, Russia), which employs the methods described in Sections2 and 3 (see above). This CAS was based on the Alfargus/Mosregiongaz CFD simulator.There were a total of more than 400 similar runs of Stage 1 of the test simulation. The worst case is represented in Tables 5 and 6.Table 5
The worst results after Stage 1 of the test simulation.
Test 1Maximum relative accuracy (pressure), [%]0.000001Maximum relative accuracy (flow rate), [%]0.002858Test 2Maximum relative accuracy (pressure), [%]0.000001Maximum relative accuracy (flow rate), [%]0.000236Test 3Maximum relative accuracy (pressure), [%]0.000261Maximum relative accuracy (flow rate), [%]0.055928Table 6
Starting point of Stage 1 of the test simulation.
Test numberObjectParameterDimension of valueBasic pointStart pointDeviation, [%]1CGP 6Flow rate[kg/s]39.4097240.592023.00CGP 5Flow rate[kg/s]39.4097240.592023.00CGP 4Flow rate[kg/s]39.4097240.592023.00CGP 3Flow rate[kg/s]39.4097240.592023.00CGP 2Flow rate[kg/s]39.4097240.592023.00CGP 1Flow rate[kg/s]39.4097240.592023.00GDS 3Pressure[Pa]1180056.461198885.221.60GDS 2Pressure[Pa]1180056.461198885.221.60GDS 1Pressure[Pa]1180056.461198885.221.602CGP 6Flow rate[kg/s]39.4097238.42448-2.50CGP 5Flow rate[kg/s]39.4097238.42448-2.50CGP 4Flow rate[kg/s]39.4097238.42448-2.50CGP 3Flow rate[kg/s]39.4097238.42448-2.50CGP 2Flow rate[kg/s]39.4097238.42448-2.50CGP 1Flow rate[kg/s]39.4097238.42448-2.50GDS 3Pressure[Pa]1180056.461164365.82-1.33GDS 2Pressure[Pa]1180056.461164365.82-1.33GDS 1Pressure[Pa]1180056.461164365.82-1.333CGP 6Flow rate[kg/s]39.4097240.197922.00CGP 5Flow rate[kg/s]39.4097237.83333-4.00CGP 4Flow rate[kg/s]39.4097240.986114.00CGP 3Flow rate[kg/s]39.4097237.04514-6.00CGP 2Flow rate[kg/s]39.4097240.197922.00CGP 1Flow rate[kg/s]39.4097237.04514-6.00GDS 3Pressure[Pa]1180056.461162355.65-1.50GDS 2Pressure[Pa]1180056.461162355.65-1.50GDS 1Pressure[Pa]1180056.461162355.65-1.50Stage2of the test simulation is aimed at revealing the minimum necessary number of internal identification points in the test problem (see Figure 4). For this purpose, we first found the basic mode without internal identification points. Then, internal identification points were introduced one by one by adding gas pressure monitoring sensors at Valve 2, Valve 5, Valve 6, Valve 8, and so forth.Test results (see Tables7 and 8) demonstrated that the best closeness to the basic identified mode is obtained for the scheme with three and more internal identification points. The starting point was the same for the first four tests. In the fifth test, the starting point was changed in order to improve reliability of testing. Note that in the tests, the upper estimate of the actual (rated) error of flow meters installed at GDS outlets was taken equal to tflow_rateGDS=2,5% (see (3.8)). Therefore, the found solutions to tests 1–5 were internal points with respect to the assumed constraints. This evidences the existence of multiple acceptable solutions within the problem statement. However, the identification solution becomes unique and the closest to the basic mode only if there are three and more internal points.Table 7
The results after Stage 2 of the test simulation.
Test 1 (without internal identification points)Maximum relative accuracy (pressure), [%]0.000000Maximum relative accuracy (flow rate), [%]2.497864Test 2 (1 internal identification point)Maximum relative accuracy (pressure), [%]0.000000Maximum relative accuracy (flow rate), [%]2.490145Test 3 (2 internal identification points)Maximum relative accuracy (pressure), [%]0.000000Maximum relative accuracy (flow rate), [%]2.374343Test 4 (3 internal identification points)Maximum relative accuracy (pressure), [%]0.000001Maximum relative accuracy (flow rate), [%]0.002597Test 5 (4 internal identification points)Maximum relative accuracy (pressure), [%]0.000001Maximum relative accuracy (flow rate), [%]0.002589Table 8
Starting point of Stage 2 of the test simulation.
Test numberObjectParameterDimension of valueBasic pointStart pointDeviation,[%]1 – 4CGP 6Flow rate[kg/s]39.4097237.83333-4.00CGP 5Flow rate[kg/s]39.4097237.83333-4.00CGP 4Flow rate[kg/s]39.4097237.83333-4.00CGP 3Flow rate[kg/s]39.4097237.83333-4.00CGP 2Flow rate[kg/s]39.4097237.83333-4.00CGP 1Flow rate[kg/s]39.4097237.83333-4.00GDS 3Pressure[Pa]1180056.461202023.351.86GDS 2Pressure[Pa]1180056.461202023.351.86GDS 1Pressure[Pa]1180056.461202023.351.865CGP 6Flow rate[kg/s]39.4097238.42448-2.50CGP 5Flow rate[kg/s]39.4097238.42448-2.50CGP 4Flow rate[kg/s]39.4097238.42448-2.50CGP 3Flow rate[kg/s]39.4097238.42448-2.50CGP 2Flow rate[kg/s]39.4097238.42448-2.50CGP 1Flow rate[kg/s]39.4097238.42448-2.50GDS 3Pressure[Pa]1180056.461205161.152.13GDS 2Pressure[Pa]1180056.461205161.152.13GDS 1Pressure[Pa]1180056.461205161.152.13Stage3of the test simulation included testing of the third stage of the gas dynamic mode identification problem simulation (see (3.10)), which provides for the correction of the primary gas dynamic mode to minimize possible discrepancies between simulated and reported estimates of the gas volume supplied through each CGP. Thus, the objective of the third stage of testing was to validate the numerical implementation of the maximum consumer credibility criterion.For this purpose, the result of the first two stages of the identification problem simulation was taken as the primary gas dynamic mode. The resulting mode is shown in Table9. Here, flow rates reported by some consumers differ from the basic values: flow rates at CGP 4 and CGP 6 (see Table 10). Following this, problem (3.10) is set up and simulated with the starting point of the primary mode.Table 9
Starting point of Stage 3 of the test simulation.
ObjectParameterDimensionof valueBasic pointThe result ofStage 2solutionDeviation, [%]Initial modeCGP 6Flow rate[kg/s]39.4097239.409720.00CGP 5Flow rate[kg/s]39.4097239.409720.00CGP 4Flow rate[kg/s]39.4097239.409710.00CGP 3Flow rate[kg/s]39.4097239.409720.00CGP 2Flow rate[kg/s]39.4097239.409720.00CGP 1Flow rate[kg/s]39.4097239.409730.00GDS 3Pressure[Pa]1180056.461180056.460.00GDS 2Pressure[Pa]1180056.461180056.460.00GDS 1Pressure[Pa]1180056.461180056.460.00Table 10
Stated mode of natural gas supply to consumers.
ObjectParameterDimension of valueBasic pointStated valueDeviation,[%]Stated modeCGP 6Flow rate[kg/s]39.4097239.409720.00CGP 5Flow rate[kg/s]39.4097239.409720.00CGP 4Flow rate[kg/s]39.4097237.04514-6.00CGP 3Flow rate[kg/s]39.4097239.409720.00CGP 2Flow rate[kg/s]39.4097237.04514-6.00CGP 1Flow rate[kg/s]39.4097239.409720.00GDS 3Pressure[Pa]1180056.461180056.460.00GDS 2Pressure[Pa]1180056.461180056.460.00GDS 1Pressure[Pa]1180056.461180056.460.00In (3.10), the specified upper estimate of the actual (rated) error of pressure sensors at internal identification points tpressureident was taken equal to0,01%·Pscal_p, where Pscal_p=1569064Pa is the given pressure sensor scale value. Also, the upper estimate of the actual (rated) error of flow meters installed at GDS outlets was taken equal to tflow_rateGDS=1,5% (see (3.10)).Simulation results presented in Tables11 and 12 show that the simulated flow rates at CGP 2 and CGP 4 became as close to the reported values as possible subject to the above constraints on monitoring sensors (see the relative deviation for GDS flow meters and absolute deviation for pressure monitoring sensors at CGP 2, CGP 4, Valve 2, Valve 5, and Valve 8). These results indicate that the criterion of (3.10) is satisfied.Table 11
The results after Stage 3 of the test simulation.
ObjectParameterDimension of valueInitial modeResulting modeDeviation,[%]Final modeCGP 6Flow rate[kg/s]39.4097238.79193-1.57CGP 5Flow rate[kg/s]39.4097238.98765-1.07CGP 4Flow rate[kg/s]39.4097138.77240-1.62CGP 3Flow rate[kg/s]39.4097238.86608-1.38CGP 2Flow rate[kg/s]39.4097238.77241-1.62CGP 1Flow rate[kg/s]39.4097339.01146-1.01GDS 3Pressure[Pa]1180056.461179249.86-0.07GDS 2Pressure[Pa]1180056.461179248.98-0.07GDS 1Pressure[Pa]1180056.551179409.71-0.05Table 12
Final deviations between numerical estimates of gas flow parameters and the results of their measurements.
ObjectParameterDimensionof valueInitial modeResultingmodeRelativedeviation,[%]AbsolutedeviationCGP 1Pressure[Pa]1147720.8991147759.4390.00335838.540622CGP 2Pressure[Pa]1147720.9031147877.8090.013671156.906444CGP 3Pressure[Pa]1147720.9021147830.9830.009591110.080606CGP 4Pressure[Pa]1147720.9061147877.8120.013671156.906295CGP 5Pressure[Pa]1147721.1741147771.60.00439450.425668CGP 6Pressure[Pa]1147721.1731147871.1270.013065149.953759GDS 1Flow rate[kg/s]78.81944877.9275851.1315260.891863GDS 2Flow rate[kg/s]78.81944877.6371631.4999911.182285GDS 3Flow rate[kg/s]78.81944877.6371681.4999851.182280Valve 2Pressure[Pa]1157667.2821157510.3760.013554156.906437Valve 5Pressure[Pa]1157667.2791157510.3730.013554156.906265Valve 8Pressure[Pa]1157667.5521157512.290.013412155.261578Stage 1 of the test simulation included more than 100 tests to check the correctness of the CAS kernel operation. Results of these tests were similar to the above results of the first test.


## 5. On the Aspects of Practical Applications of the Proposed Methods

Note that as the Lagrange particles method (LPM) modification for the energy equation discussed in Section2 is not related directly to the finite difference grid employed for solving the continuity and motion equations, this grid has almost no effect on the accuracy of the proposed method. Thus, high-accuracy calculated values of gas temperature are obtained without grid refinement, which significantly speeds up the computations.Due to the absence of direct connection between the LPM method and the finite difference grid, this method is free of the so-called “scheme” viscosity [10]. As a result, the method makes it possible to obtain solutions without scheme smoothing of temperature fronts, which corresponds to real physical processes. This significantly increases the adequacy of simulations compared to the use of difference schemes for the energy equation.As for the method of numerical detection of discrepancy origins (see Section3), one should note that it provides the closest possible approximation to consumer-reported gas volume values to within the measurement error of instruments installed at identification points. The simulation outcome of optimization problem (3.10) is the final solution to the problem of finding the identification gas flow in the GDN. The target identified gas flow is completely defined by the vector X⃗ident∈Θ⊂Rn+1, corresponding to the optimal solution of problem (3.10), and is characterized by the fulfillment of the following conditions: (1) calculated gas flow parameters at each identification point should be as close as possible to corresponding field measurement data; (2) calculated estimates of gas volumes supplied to the GDN in a given time interval should correspond to the supplier-reported values within actual (nameplate) absolute errors of the flow meters installed in the GDS; (3) calculated estimates of gas volumes received by each consumer in the given time interval should be as uniformly close as possible to the values reported by the consumers.


## 6. Example of Production Simulations

The above approach to the numerical monitoring of natural gas distribution discrepancy using the CFD simulator is successfully used in the Russian gas industry. Over the period of 2008–2010, this method of numerical monitoring of the supplier share in gas deliveries has demonstrated its efficiency as applied to the production simulations of Mosregiongaz for the analysis of the mechanisms of discrepancy occurrence in the natural gas supplies through the Moscow Ring Gas Distribution Pipeline System (MRGDPS). Figures5 and 6 show an example of production simulations by the method at Mosregiongaz. The simulation was performed using the CAS system by Mosregiongaz operators jointly with system developers from the Physical & Technical Center, LLC.Figure 5
Numerical simulation of natural gas supply from GDS-17 to Moscow Ring Gas Distribution Pipeline System (an example of instant of time).Figure 6
Numerical simulation of natural gas transmission along MRGDPS (an example of CAS application in Mosregiongaz Control Room).Different colors in Figure5 show shares of gas supply from the given GDS. The influence of the GDS on a specific group of consumers is denoted qualitatively by the color of the associated branch, and quantitatively, by the representation of simulation results in the form of tables indicating gas proportions (in percent) consumed by a specific group of consumers from each GDS, which supplies gas to the MRGDPS.The simulation was performed using CAS by Mosregiongaz operators. Color arrows in the figure indicate the direction and the intensity of gas flows, and spheres of different diameter and color correspond to the actual contribution of each consumer to the discrepancy in MRGDPS gas supply estimates.


## 7. Conclusion

The developed method enables high-accuracy numerical analysis of discrepancies in natural gas supplies to consumers and scientifically based search for their origins. This method can be fully computerized based on ordinary computers available to gas industry specialists. This makes the method available to gas distribution company specialists, who have no special knowledge in the area of mathematical modeling. With minor modifications, it can be used for the numerical analysis of different networks of trunk and distribution pipelines at power engineering facilities, which transport commercial gases.



---

*Source: 407648-2010-10-04.xml*