Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide an online simulation method of a large-scale complex natural gas pipe network system, which is suitable for static, dynamic and online simulation models of natural gas pipe networks with any structures and scales, and realizes online simulation according to SCADA real-time communication technology and pipe network online simulation model construction technology, and tracks real-time hydraulic change processes of pressure, flow rate and the like of the pipe network system, thermal working conditions of temperature and the like, fluid property change processes of flow rate, density, viscosity, sound velocity, entropy, enthalpy and the like, and real-time change processes of pressure at pipe storage and special points.
In order to achieve the above purpose, the technology of the invention is realized by the following scheme:
an online simulation method of a large complex natural gas pipe network system comprises the following steps:
firstly, establishing a pipe network simulation model, namely establishing a fluid model and a pipe network simulation model according to actual pipeline parameters, fluid physical parameters, instrument conditions, compressor parameters and valve parameters in order to enable the pipeline system model to be consistent with an actual pipeline;
step two, SCADA data connection, analysis, classification, arrangement and recording of the collected real-time data, release of the processed real-time data through an OPC protocol, and supply of the processed real-time data to a pipe network simulation model for subsequent work;
thirdly, associating the real-time data with a simulation model, and driving the simulation model to run by taking the real-time data as a simulated boundary condition, wherein the real-time data required to be associated comprises station pressure, flow and temperature, compressor rotating speed, valve inlet and outlet pressure difference or valve opening, and the inlet and outlet temperature of a heat exchanger/a heater;
step four, static simulation, namely establishing a static simulation model of element flow according to node connection conditions, loops and path equations, calculating the pressure of each node by using real-time data as control conditions and a pressure balance method, determining the pressure distribution of the system, and then determining other hydraulic thermodynamic distributions;
fifthly, online simulation, namely describing flow states, distribution and change processes at all moments under the real-time condition of a pipe network, describing response and change processes of various operations, controls and events, and giving out hydraulic and thermal change trends; and (3) carrying out finite center difference on a gas pipeline mass conservation equation, a momentum conservation equation and an energy conservation equation, obtaining a difference equation about pipeline gas flow, taking a gas state equation into consideration, taking real-time data as a boundary condition, establishing an online analysis model, namely a nonlinear algebraic equation set, solving by a Newton-Lafson iteration method, calculating layer by layer, and finally obtaining the dynamic simulation of the pipeline real-time state.
The fifth step specifically comprises the following steps:
(1) Discretization of pipe network simulation model
On a plane rectangular coordinate system consisting of tube length displacement (x) and time (t), gridding a plane by using a pipeline step length delta x and a time step length delta t, and carrying out finite center difference on the formula (1-1), so that the partial differential problem on the whole plane is converted into a differential problem about a certain amount of plane grid points, and then obtaining state equations (1-2) to (1-4) of the state subspace in the following form;
conservation of grid mass:
lattice conservation of momentum:
grid energy conservation:
wherein the method comprises the steps of
In the above formula:
a-cross-sectional area of the inner section of the pipe, m 2 ;
Density of ρ -fluid, kg/m 3 ;
M-fluid mass flow, kg/s;
p-absolute fluid pressure, pa;
t is a simulation time variable, s;
x-the length variable of the pipeline unit, m;
g-local gravity acceleration, 9.801m/s 2 ;
dz/dx-the slope of the pipeline, z is the elevation of the pipeline, m;
f-friction coefficient;
d, the inner diameter of the pipeline, m;
v-fluid flow, m/s;
h-enthalpy of the fluid, J/kg;
q is the heat exchange quantity of the fluid and the outside, J/s;
-density of fluid at i position, j+1 moment in grid, kg/m
3 ;
-density of fluid at point i+1, j+1 in grid, kg/m
3 ;/>
Density of fluid at point i, j in grid, kg/m
3 ;/>
-density of fluid at point i+1, j in grid, kg/m
3 ;
-the i+1 position in the grid, the flow rate of the fluid at the j moment, m/s;
-the i+1 position in the grid, the flow rate of the fluid at j+1 time, m/s;
-the flow rate of the fluid at points i, j, m/s in the grid;
-the i position in the grid, the flow rate of the fluid at time j+1, m/s;
-the absolute pressure of the fluid, pa, at the point i+1, j in the grid;
-the absolute pressure of the fluid, pa, at the i+1 position, j+1 time in the grid;
-absolute pressure of fluid at point i, j in the grid, pa;
-the absolute pressure of the fluid, pa, at the i position, j+1 time in the grid;
-the enthalpy value of the fluid at point i, j+1 in the grid, J/kg;
-the enthalpy value of the fluid at point j+1, J/kg at point i+1 in the grid;
-enthalpy of fluid at point i, J in the grid, J/kg;
-enthalpy of fluid at point J, J/kg at position i+1 in the grid;
Δt-the same position in the grid, the time interval between adjacent moments, s;
deltax-distance m between adjacent positions at the same time in the grid;
in the middle of
Is the value of the (i, j) node, i represents the position, j represents the time, Q represents any flow and state parameter in the formula, and for the state subspace of any one unit grid of the pipeline, the partial differential conservation relation of the mass, the momentum and the energy is F
1 、F
2 And F
3 The 3 nonlinear algebraic equations form a nonlinear equation set related to flow and state variables on grid points for each time layer of the pipe network system, and the flow states of all time layers can be obtained by simultaneous solving;
the pipeline system directly measures the flow M, the pressure P and the temperature T, other variables and parameters involved in the model can be converted by the measuring parameters, such as M=VA rho, the density rho, the enthalpy h and the like can be calculated by the temperature T and the pressure P of the fluid;
(2) Establishing an implicit single tube mixed problem state space model and solving
The mixing problem of single pipe transient flows can be described by the formula (1-5):
the model is a nonlinear algebraic equation set (state equation) consisting of n state subspace models of the pipeline, and under the condition that the initial flow, pressure and temperature distribution of the pipeline are known (initial conditions), the pressure, flow and temperature distribution of each grid point and endpoint of the pipeline at different moments, and the change rule and process (state vector) of flow and state parameters of all points are calculated according to operation control conditions (boundary conditions) implemented by two endpoints of the pipeline;
(3) Establishing an implicit pipe network system simulation model and solving
(3.1) establishing a modeling basic relation
Node relation: the hydraulic and thermal characteristics of all elements are related through a node conservation relation, a pipe network system simulation model is finally formed, and the node relation is shown in the following formula (1-6):
formulas (1-6) describe the balance of node pressure and the connected element endpoint pressure, node mass conservation and energy conservation relationships, respectively;
process equipment relationship: a wide variety of process equipment may be included in the pipe network system, which is described by formulas (1-7):
wherein F is 1 Is a hydraulic flow relation, F 2 Is a thermodynamic equilibrium relation, which must be satisfied during the simulation process, where subscripts H and K represent the upstream and downstream of the device, respectively, thereby relating the pressure and temperature upstream and downstream of the device to the corresponding parameters of the connected node; wherein M will participate in mass and energy conservation analysis of the connected nodes; it should be noted that the device relation is only an upstream-downstream relation, and no geometric position exists; in addition, the influence of the dynamic change process of the equipment on the flow of the pipe network system is small and ignored, the relation has no time concept, and the established model is always aimed at the time layer needing to be calculated at present;
fluid model: in the hydraulic thermal analysis of a pipe network, the property of the fluid is expressed as formulas (1-8), and is related to the pressure and the temperature of the fluid, and for each point in the pipe network, the property is calculated according to the pressure and the temperature of the fluid;
(3.2) establishing a State space and a simulation model ()
For a given pipe network system with any scale and structure, a dynamic simulation model of the pipe network system can be obtained according to the relational expressions from the formulas (1-6) to the formulas (1-8), namely the formulas (1-9):
the real-time boundary control conditions collect current real-time data of the pipeline through an OPC protocol, and flow of the gas source point and the separate transmission point, pressure, temperature and valve state in the station along each station and RTU valve chamber.
The invention has the beneficial characteristics that:
(1) The system is suitable for pipe networks of any structures and scales, is particularly suitable for large-scale complex gas and liquid pipe network systems, and breaks through the limitation of fluid media;
(2) The accurate description of the flow of the pipe network provides a reliable basis for planning, designing, operating, controlling and optimizing the pipe network;
(3) Real-time tracking and monitoring of the hydraulic and thermodynamic working conditions of the pipe network are realized, and scientific basis is provided for the establishment of the pipeline production scheme.
Detailed Description
The invention will now be described in detail with reference to the drawings and to specific embodiments.
An online simulation method of a large complex natural gas pipe network system comprises the following steps:
in order to enable the pipeline system model to be matched with an actual pipeline, the fluid model and the pipeline network simulation model are built according to actual pipeline parameters (such as pipe diameter, pipe length, elevation change, wall thickness, heat insulation layer thickness, heat conductivity coefficient and the like), fluid physical parameters (such as specific gravity, components and the like), instrument conditions (such as precision, position numbers and the like), compressor parameters (characteristic curves, rotating speeds and the like), valve parameters (valve characteristic curves, valve opening and the like).
Step two, SCADA data connection, namely providing real-time bidirectional communication with an SCADA system and other OPC application software through a standard OPC communication interface; according to the online simulation data, the online simulation software is developed, and the online simulation software is configured and configured to periodically (for example, 20 seconds) check the communication state of the SCADA system, the OPC server state, the state of each measurement data and the validity of the data; converting the transmission unit and the internal unit, and automatically reading real-time operation data (such as pressure, flow and temperature) and equipment state parameters (such as valve position, compressor start/stop/power/rotation speed and the like) of the SCADA system according to requirements; and analyzing, classifying, sorting and recording the acquired real-time data, releasing the processed real-time data through an OPC protocol, and providing the real-time data for an online simulation system to perform subsequent work.
And thirdly, associating the real-time data with the simulation model, and driving the simulation model to operate by taking the real-time data as a simulated boundary condition, wherein the real-time data required to be associated comprises site pressure, flow and temperature, compressor rotating speed, valve inlet and outlet pressure difference or valve opening, and the inlet and outlet temperature of the heat exchanger/heater.
Step four, static simulation, namely establishing a static simulation model of element flow according to node connection conditions, loops and path equations, calculating the pressure of each node by using real-time data as control conditions and a pressure balance method, determining the pressure distribution of the system, and then determining other hydraulic thermodynamic distributions; the static simulation of the pipe network describes the flow state and distribution of the pipe network under the steady condition, the system flow does not change with time, the final result of various events is provided, the hydraulic and thermal distribution conditions are given, and the basis for designing and formulating an operation scheme is provided; it reflects the final state of various operations, controls, or the average flow results of various planning, design, and delivery requirements. Pipe network static simulation is often applied to design of pipe network system and formulation of operation scheme, and finally meets the task requirement of conveying through different system configuration, operation control and dynamic change processes.
Step five, online simulation, wherein the online simulation of the pipe network describes the flow state, distribution and change process of the pipe network at each moment under the real-time condition, describes the response and change processes of various operations, controls and events, and gives out the hydraulic and thermal change trend; and (3) carrying out finite center difference on a gas pipeline mass conservation equation, a momentum conservation equation and an energy conservation equation, wherein the equation (1-1) can obtain a difference equation about pipeline gas flow, taking a gas state equation into consideration, taking real-time data as a boundary condition, establishing an online analysis model, namely a nonlinear algebraic equation set, solving by a Newton-Lapherson iterative method, calculating layer by layer, and finally obtaining the dynamic simulation of the pipeline real-time state.
The fifth step specifically comprises the following steps:
(1) Discretization of pipe network simulation model
On a rectangular plane coordinate system composed of tube length displacement (x) and time (t), the plane is gridded by a pipeline step length deltax and a time step length deltat (see figure 1), and the finite center difference is carried out on the formula (1-1), so that the partial differential problem on the whole plane is converted into the differential problem on a certain amount of plane grid points, and the state subspace is obtained from the following state equations (1-2) to (1-4).
Conservation of grid mass:
lattice conservation of momentum:
grid energy conservation:
wherein the method comprises the steps of
The following formulas:
a-cross-sectional area of the inner section of the pipe, m 2 ;
Density of ρ -fluid, kg/m 3 ;
M-fluid mass flow, kg/s;
p-absolute fluid pressure, pa;
t is a simulation time variable, s;
x-the length variable of the pipeline unit, m;
g-local gravity acceleration, 9.801m/s 2 ;
dz/dx-the slope of the pipeline, z is the elevation of the pipeline, m;
f-friction coefficient;
d, the inner diameter of the pipeline, m;
v-fluid flow, m/s;
h-enthalpy of the fluid, J/kg;
q is the heat exchange quantity of the fluid and the outside, J/s;
-density of fluid at i position, j+1 moment in grid, kg/m
3 ;
-density of fluid at point i+1, j+1 in grid, kg/m
3 ;
Density of fluid at point i, j in grid, kg/m
3 ;
-density of fluid at point i+1, j in grid, kg/m
3 ;
-the i+1 position in the grid, the flow rate of the fluid at the j moment, m/s;
-the i+1 position in the grid, the flow rate of the fluid at j+1 time, m/s;
-the flow rate of the fluid at points i, j, m/s in the grid;
-the i position in the grid, the flow rate of the fluid at time j+1, m/s;
-the absolute pressure of the fluid, pa, at the point i+1, j in the grid;
-the absolute pressure of the fluid, pa, at the i+1 position, j+1 time in the grid;
-absolute pressure of fluid at point i, j in the grid, pa; />
-the absolute pressure of the fluid, pa, at the i position, j+1 time in the grid;
-the enthalpy value of the fluid at point i, j+1 in the grid, J/kg;
-the enthalpy value of the fluid at point j+1, J/kg at point i+1 in the grid;
-enthalpy of fluid at point i, J in the grid, J/kg;
-enthalpy of fluid at point J, J/kg at position i+1 in the grid;
Δt-the same position in the grid, the time interval between adjacent moments, s;
Δx—distance between adjacent positions, m at the same time in the grid.
In the middle of
Is the value of the (i, j) node, i represents the position, j represents the time, Q represents any flow and state parameter in the formula, and for the state subspace of any one unit grid of the pipeline, the partial differential conservation relation of the mass, the momentum and the energy is F
1 、F
2 And F
3 The 3 nonlinear algebraic equations form a nonlinear equation set related to flow and state variables on grid points for each time layer of the pipe network system, and the flow states of the time layers can be obtained by simultaneous solving.
The pipeline system directly measures the flow M, the pressure P and the temperature T, other variables and parameters involved in the model can be converted by the measured parameters, such as M=VA rho, the density rho, the enthalpy h and the like, and the temperature T and the pressure P of the fluid can be calculated.
(2) Establishing an implicit single tube mixed problem state space model and solving
The mixing problem of single pipe transient flows can be described by the formula (1-2):
the model is a nonlinear algebraic equation set (state equation) composed of n state subspace models of the pipeline, and under the condition that the initial flow, pressure and temperature distribution of the pipeline are known (initial conditions), the pressure, flow and temperature distribution of each grid point and end point of the pipeline at each different moment, and the change rule and process (state vector) of flow and state parameters of all points are calculated according to operation control conditions (boundary conditions) implemented by two end points of the pipeline.
(3) Establishing an implicit pipe network system simulation model and solving
(3.1) establishing a modeling basic relation
Node relation: the pipe network system connects each single process equipment into a network system through nodes, the flow relation and the characteristics of the nodes are the basis for establishing a pipe network system model, in pipe network system simulation, the hydraulic and thermal characteristics of each element are related through the node conservation relation, and finally, the pipe network system simulation model is formed, and the node relation formula is shown in the following formula (1-6):
equations (1-6) describe the balance of node pressure and connected element endpoint pressure, node mass conservation and energy conservation relationships, respectively.
Pipeline discretization and conservation relation: equations (1-5) describe the conservation relations of the pipe discretization, these nonlinear algebraic equations and the flow parameters and variables at the grid points will be directly brought into the pipe network system model. For the dynamic simulation of the pipe network system, only the pipeline model has the time and space concept, the flow changes along with the time and space, and other elements and equipment models only have upstream and downstream, and the dynamic change process between the elements and the equipment models has little influence on the flow of the pipe network system and is ignored.
Process equipment relationship: a wide variety of process equipment, such as valves, compressors, heat exchangers, etc., may be included in the pipe network system and are described by formulas (1-7):
wherein F is 1 Is a hydraulic flow relation, F 2 Is a thermodynamic equilibrium relation, which must be satisfied during the simulation process, where subscripts H and K represent the upstream and downstream of the device, respectively, thereby relating the pressure and temperature upstream and downstream of the device to the corresponding parameters of the connected node; where M will participate in mass and energy conservation analysis of the connected nodes. It should be noted that the device relation is only an upstream-downstream relation, and no geometric position exists; in addition, in the case of the optical fiber,the dynamic change process of the equipment has little influence on the flow of the pipe network system and is ignored, the relational expression has no time concept, and the established model always aims at the time layer which needs to be calculated currently.
Fluid model: in the hydrodynamic thermal analysis of a pipe network, the properties of the fluid are always involved, and these properties parameters are constantly changing. Although the different properties of the fluid are each characteristic, they can be expressed as formulas (1-8), which are related to the pressure and temperature at which the fluid is located, and for each point in the network, calculate its properties from its pressure and temperature.
(3.2) establishing a State space and a simulation model
For a given pipe network system with any scale and structure, a dynamic simulation model of the pipe network system can be obtained according to the relational expressions from the formulas (1-6) to the formulas (1-8), namely the formulas (1-9):
the real-time boundary control conditions collect current real-time data of the pipeline through an OPC protocol, and flow of an air source point and a separate transmission point, pressure, temperature and valve states in stations along each station and RTU valve chamber.
Equations (1-9) define the state variables (the amount of solution needed), the state space simulation model (the set of nonlinear algebraic equations) and the solution conditions (initial and real-time boundary conditions) of the on-line simulation of the pipe network. The state space variables include not only the operating parameters of the nodes, pipes and various devices, but also the flow parameters of the grid points inside the pipes. The real-time boundary control conditions reflect the operation control requirements of all operation points of the pipe network system, and the control conditions change along with different operation requirements and simulation targets.
Examples
A specific embodiment demonstration comprising the steps of:
step one, a pipeline network simulation theory is applied to establish a Nanle-zihe section pipeline model, dynamic simulation monitoring parameters are set for pipeline nodes, and fig. 3 is the established section pipeline network simulation model, and the model is composed of 11 nodes, 9 pipelines and a pressure regulating device.
The supplied natural gas was analyzed by a chromatograph in the elm line, and the composition data was obtained as shown in table 1.
TABLE 1 fluid composition in pipes
Component (A)
|
Measured value/Mol%
|
Component (A)
|
Measured value/Mol%
|
Methane (C1)
|
92.6588
|
Isopentane (nC 5)
|
0.0747
|
Ethane (C2)
|
4.1025
|
Neopentane (NEO-C5)
|
0.000
|
Propane (C3)
|
0.9213
|
Hexane (C6)
|
0.0879
|
N-butane (iC 4)
|
0.1843
|
Nitrogen (N2)
|
0.5612
|
Isobutane (nC 4)
|
0.1861
|
Carbon dioxide (CO 2)
|
1.1774
|
N-pentane (iC 5)
|
0.0408
|
——
|
—— |
Establishing an OPC channel for transmitting the SCADA real-time data and the simulation model, and automatically reading the real-time operation data and the equipment state parameters of the SCADA system according to the requirement; the real-time operation data comprises pressure, flow and temperature; the device status parameters include valve pressure drop; the data connection is shown in fig. 4.
And thirdly, associating the real-time data with the simulation model, and distributing the acquired real-time data to the corresponding equipment model according to the actual condition of the site. If the real-time pressure of the south Hash station is related to the south Hash station node simulation model, the real-time flow of the zither station is related to the zither station node simulation model.
Step four, static simulation is carried out on the pipe network model, the south Happy station pressure, the Qihe station pressure, the pressure regulating pry pressure difference are used as control conditions of the static simulation, the static simulation of the pipe network is realized, and the static simulation result is used as an on-line simulation initial condition;
and fifthly, online simulation. And (3) reading pipe network real-time operation and control parameters of the SCADA system, and taking south Happy station pressure, qihe station pressure, pressure regulating pry differential pressure and real-time scale flow of the chat station as boundary control conditions of online simulation to drive a dynamic simulation model so as to realize online simulation. After the on-line simulation model is established, real-time on-line calculation of flow parameters of the pipe network system can be realized, flow and pressure of any site can be presented, flow velocity, viscosity and other conditions of each node and pipe section can be calculated in a simulated mode, and the gas storage capacity of the pipe network can be obtained. And (3) according to the real-time flow parameters, the operation condition analysis of the natural gas network system, emergency working condition alarm, the formulation of a natural gas peak regulation scheme and the formulation of various construction schemes are realized.
The elm-Jinan on-line simulation model is that a pipe section of a Nanle station-a Qihe station does not perform pipe cleaning operation for a long time, the pipeline conveying efficiency is reduced, and in order to improve the pipeline conveying efficiency of the section, the Nanle-Qihe pipe section is subjected to pipe cleaning operation. The flow rate of the gas in the pipeline is an important index for influencing the cleaning effect, and the running speed of the cleaning pig is generally controlled to be between 12 and 18km/h and about 3.33 to 4.17m/s according to the requirements of the cleaning operation procedure of SY-T6383-1999 long-distance natural gas pipeline. However, since the south Le-Qihe section has no trunk metering, the traditional static simulation cannot calculate the real-time flow velocity in the pipeline, which brings great inconvenience to the implementation of pipeline cleaning operation.
By establishing the on-line simulation model of the section, calculating the real-time flow velocity data of the section by using Happy, thereby obtaining the flow velocity of the clean pipe section under the current working condition, providing reference for the formulation of a cleaning pipe accelerating scheme, and ensuring the pressure and flow velocity distribution to be shown in fig. 5, wherein the line at the start of xy intersection point 0 in the figure represents the pressure, and the other line represents the flow velocity. As can be seen from the figure, the pressure of the Nanle-zihe pipe section is 5.765 MPa-5.820 MPa, and the flow rate is-0.46 to-0.94 m/s, wherein "-" indicates that the flow direction is opposite to the pipeline direction. The flow rate is far from meeting the requirements of the cleaning operation, and therefore, the cleaning and accelerating scheme formulation is necessary.