Internet system for hydraulic calculations of pipeline systems by the methods of the theory of hydraulic circuits *

. The paper is focused on a characteristic of an innovative technology for remote application of methods of the theory of hydraulic circuits for modeling the operation of multi-loop water and gas pipeline systems, using the Internet browser. The aims, objectives and implementation principles of the technology resting on the concept of object-oriented modeling of pipeline systems and client-server architecture of the distributed software are presented. The results of its application are demonstrated.


Introduction
Considerable energy conservation and enhancement of pipeline systems efficiency are impossible without proper organization of their operating conditions.This in turn requires advanced methods of mathematical and computer modeling for calculation, analysis and quantitative substantiation of the conditions.
To date many organizations of Russia (MESI SB RAS, Politerm Ltd [1], JSC "Potok" [2] and others) and other countries (Intergraph Corporation [3], Sunrise Systems Ltd [4], Bentley Systems Incorporated [5], etc.) have developed and continue to develop and adopt a great many software packages.They are however intended to solve a specific class of modeling problems (analysis, synthesis, control) in a specific area (design, operation, dispatching) and are applied to certain types of pipeline systems (heat, water, gas, etc.).
Based on the scientific area successfully developed by Melentiev Energy System Institute SB RAS, namely the theory of hydraulic circuits [6,7], the Institute has originated a unique arsenal of effective methods for mathematical modeling, calculation and optimization, that can be applied to a pipeline system of any type and purpose.In this context, there is an obvious contradiction between the potential commonality of these methods and ineffective doubling of investigations on their software implementation and adaptation to the specificity of application.
The object of the studies is an information-computation technology that can be used to solve the problems of flow distribution in pipelines of different types on the basis of general calculation methods.The purpose of the research is to develop principles, implement and test such a technology.
The following objectives are set to achieve the purpose: 1) implement the methods for calculation of steady-state isothermal flow distribution in the pipeline system, that are independent of the fluid (gas) flow patterns in the elements of the system; 2) systematize the flow patterns and develop the principles of implementation of the models that are responsible for the specifics of these patterns and interaction with the methods for calculation of flow distribution of the entire pipeline system; 3) develop a software architecture providing the required information, computation and analytical functions within a single user interface for the pipeline systems of different types; 4) implement and test such software with orientation to the application on the Internet.
The following interrelated ways are proposed to reach the above objectives: 1) transition to the concept of object-oriented modeling of pipeline systems in order to separate the software components that implement general calculation methods from the components responsible for specifics of the pipeline systems or a problem solved [8]; 2) develop the methods of the theory of hydraulic circuits with orientation to this concept [9]; 3) develop the software based on the client-server technology ensuring independence of development, upgrading and application of certain components of the application without reprogramming the rest [10].
This will enable: 1) a multiple use of once-implemented general methods in different software packages, for different purposes, applications and for different types of pipeline systems: 2) remote application of these methods in local or global computer networks; 3) minimization of the software support and development costs; 4) acceleration of adoption of the most advanced new and effective methods for conventional or new tasks in pipeline system modeling.

The problem and methods for calculation of flow distribution in pipeline systems
A traditional model of steady-state isothermal flow distribution in pipeline system includes two analogs of Kirchhoff laws and closing relations (flow patterns): where A -( ) m n  incidence matrix in the calculation scheme with elements 1( 1)   incidence matrix formed from A by deleting one of the rows; x , y - n -dimensional vectors of flow rates and pressure differences in the branches of the calculated scheme; f( ) xn -dimensional vector function with elements f ( ) , that reflect the patterns of the pressure drop depending on flow rate (flow patterns) in the branches of the considered scheme; Q -( 1 m  )-dimensional vector of nodal flow rates with elements 0( 0) j Q   for source (sink) at node j and 0 The task is to determine vectors x , y , P at specified matrix A , vector Q , known form of ( ) and set pressure at one of the nodes ( m P ).There are many known methods and algorithms for solving this problem based on model (1).The basic methods however, as shown in monograph [6], are the Newton-Raphson loop and nodal methods.Both methods are based on the Newton method but with a preliminary decrease in the order of linear systems of equations.
For example, the nodal method suggests search for a solution in the space of nodal pressures and is reduced to the organization of process   P P P , and in its each kth iteration the correction k P is obtained by solving the system where 1 , at point k x ;  -vector function inverse to f with elements ( ) . Thus, the computational procedure of the nodal method does not depend on form f( )  y x , which should only meet the requirements of monotonous increase to provide the uniqueness of a solution to the flow distribution problem [8].However, the specific features of this method implementation depend on specifics of calculating ( ) The relationship where i s implicitly depends on i x are also often applied.We will exemplify this by the known Darcy-Weisbach formula [11] for head loss in the pipeline which specifies f( ) , where d, l -diameter and length of the pipeline, (m); g -free fall acceleration (m/s 2 ); There are a lot of formulas to calculate  .They reflect the purpose of the pipeline, its type, material of inner cover, service life, flow conditions (laminar, transitional, turbulent), etc.In Russia, the most widely used formula is Shevelev formula [12] 1 0 , where 0 1 , , , A A C  -coefficients depending on pipe material and flow conditions.Let us generalize all known cases of formulas for calculation of  , then the i-th passive branch of the considered scheme will have the form , where 2 5 s ( ) ( )8 ( ) Expression for the derivative in this case has the form , where 2 3 7 , , / 32 / ( )  for a pipeline of any type and purpose requires only specification of , / . In this case, search for k i x can be performed iteratively [8].
The relationships for modeling a gas compressor unit (GCU), for example, cause the major difficulty.The simplest relationship has the form [13] where 0 2 ,   -coefficients obtained by quadratic approximation of a rated characteristic for the compression ratio, 1 2 , p p -GCU inlet and outlet pressure, x -performance referred to inlet conditions.
In principle, in this case we can apply the technique of double iteration cycles.According to this technique, in the internal iteration cycle, the traditional flow distribution problem is solved by the traditional methods (Newton-Raphson loop and nodal methods) at fixed values of parameters ( , ) s Y of classical closing relations, and in the external iteration cycle, the values of these parameters are specified depending on the obtained values of flow rates and pressures.For example, relationship (2) . Thus, the technique of double iteration cycles is rather universal, however it involves a many-fold increase in computational time for the flow distribution calculation compared to the traditional case.In [9,14], the authors propose modifications of the Newton-Raphson loop and nodal methods that exclude the need for this technique to take into account random closing relations including those implicit with respect to flow rate and dependent on pressure.
According to the technology of object-oriented modeling of pipeline systems, the method of flow distribution calculation, which is of general significance, should be implemented in an individual object "Network model" as an internal method for calling program.The properties of this object will contain information on topology of the considered scheme and values of boundary conditions (consumption and pressure of the medium at nodes).It is proposed to include the algorithms for modeling the hydraulic circuit elements in the object "Models of elements" whose properties will characterize the parameters of elements according to their types (for example, length, diameter, material of pipelines, pump characteristics, etc.).Internal methods of this object will calculate f ( ) x and ( ) . Moreover, each object should support mechanisms of initial data input, for example by calling corresponding methods with arguments, and output of calculation results.Thus, the calculation process will be reduced to preliminary parameterization of properties and interaction of these objects.This approach makes it possible to apply ready implementations of calculation methods for modeling hydraulic conditions of different types of pipeline systems only at appropriate adaptation of the object "Models of elements".Programming of the calculated objects is proposed for example in the form of shared program libraries on the basis of component object model technology, which will allow their use independently in the programming languages of the software.

Purpose, main capabilities and case study of the software application
The software "Internet Hydraulic Calculation System" (IHCS) represents an example of the final implementation of the proposed approaches and is designed to model the conditions of water and gas pipeline systems on the Internet through remote application of advanced methods of the theory of hydraulic circuits.Accordingly, the software offers the possibility of calculations at any time, at any place and for any number of consumers provided they have the Internet connection and a standard web-browser.It can be useful for design and operation organizations, scientific and research institutions, engineers, post graduates, and students.The software has an intuitively understandable user interface, simple menu and its own mechanisms for constructing and editing the network scheme and data, which considerably reduces learning and application time.
The software is based on a client-server architecture.Client side -graphical user interface (Fig. 1) is implemented based on Microsoft Silverlight [15], a special software compo-nent intended for the development of programs operating in the web-browser environment.
The IHCS software solves the flow distribution problems for pipeline systems of a random structure (with a random number and allocation of sources, pumping stations, reservoirs, consumption nodes and other elements) and configuration (multi-loop, tree, mixed) with fixed [6] and non-fixed [16] loads.The library of the calculation modules in the IHCS software contains implementations of several different methods of solving the flow distribution problem both for classical (Newton-Raphson loop and nodal methods) and new ("chord" nodal pressure method [17], fixed point iteration method [18][19][20], modified Newton-Raphson loop and nodal methods).In this case, the sparseness is used to solve the system of linear algebraic equations in these methods, which in most of the cases reduces the total time of calculation by two orders on average [10].It is planned to further expand the library as the existing methods evolve and alternative methods appear.
The user can choose not only the method for calculation but also a calculated dependence.For example, the software can apply the formulas of Shevelev, Shifrinson [21], Prandtl-Nikuradze [22], Colebrook-White [11] or Hazen-William (which is used to a greater extent in other countries) to calculate the head losses in a water system pipeline section.
The IHCS software has been in pilot operation in open access (see 51.isem.irk.ru) on the Internet since 2013.An analysis of the data on the number of calculations of real networks and their fragments that were performed by users from different cities (Fig. 2) makes it possible to conclude that these is a considerable and growing demand for this development despite the fact that there was not special work on its promotion.
Owing to the adopted computational capabilities [10], the IHCS software enables calculation for the schemes consisting of up to 1000 nodes which is correlated with the number of citizens of a populated settlement or a city district of about several tens of thousands of people.The time spent on the calculation is no more than 5 sec.

Conclusion
The paper demonstrates the IHCS software that represents an innovative development enabling for the first time a remote application of the effective methods of the theory of hydraulic circuits for modeling the hydraulic conditions of water and gas pipeline systems on the Internet.Until now, the IHCS software has been used to make tens of thousands of multivariate calculations for hundreds of hydraulic networks by a great number of the Internet users from tens of cities of Russia and FSU countries.
velocity, (m/s); x -mass flow rate, (kg/s); i i y gh   ;  -density of a transported medium (kg/m 3 ).Coefficient of hydraulic resistance  depends on the Reynolds number Re( ) / V Vd  , where  -coef- ficient of kinematic fluid viscosity, m 2 /s, which is assumed constant for isothermal flow.