A hydrogen-containing comprehensive energy system modeling method considering dynamic component tracking
Patent Information
- Application Number
- CN202611173668.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本发明要解决的技术问题是针对上述现有技术的不足,提供一种计及动态组分追踪的含氢综合能源系统建模方法,以解决现有技术因忽略气体组分动态变化,导致能流计算偏差大,且电力系统与含氢天然气管网系统时间尺度差异难以协调仿真的技术问题
[0013] The beneficial effects of adopting the above technical solution are as follows: This invention provides a modeling method for a hydrogen-containing integrated energy system that considers dynamic component tracking. By establishing a set of partial differential equations including continuity equations, momentum equations, energy equations, and concentration diffusion equations, it achieves real-time, full-domain dynamic component tracking of hydrogen-containing natural gas in both time and space dimensions, overcoming the computational bias in hydrogen-containing natural gas pipeline systems caused by traditional fixed component assumptions. This invention employs the implicit central difference method and first-order Taylor expansion to construct a pipeline matrix solution model based on the transfer matrix, effectively reducing the computational complexity of dynamic solutions for complex pipeline networks. This invention introduces real-time changes in gas composition into the electrical coupling interface, realizing dynamic updates of coupled calorific values and accurate mapping of energy conversion quantities. This invention also constructs a multi-rate asynchronous time-series matching mechanism between the power system and the hydrogen-containing natural gas pipeline system, using asynchronous alternating iterations of fast and slow subsystems to balance simulation accuracy and computational efficiency.
Smart Images

Figure CN122925786A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy system modeling and operation analysis technology, and in particular to a method for modeling a hydrogen-containing integrated energy system that takes into account dynamic component tracking. Background Technology
[0002] With the deepening of global energy transition and the "dual-carbon" goal, the consumption of high proportions of renewable energy and the synergistic optimization of energy networks have become core research directions for modern energy systems. Against this backdrop, power-to-gas (P2G) technology can convert electricity into hydrogen and inject it into natural gas pipelines, enabling large-scale hydrogen storage and transportation. The blended hydrogen-containing natural gas can further achieve efficient gas-to-electricity energy feedback through coupling equipment such as gas turbine generators (GPGs), thus constructing a core link for multi-energy complementarity and bidirectional energy flow in a hydrogen-containing integrated energy system. However, the composition of hydrogen-containing natural gas changes dynamically during pipeline transmission, exhibiting strong nonlinear characteristics, and the dynamic process of the hydrogen-containing natural gas pipeline system progresses slowly; while the coupled power system typically exhibits quasi-steady-state characteristics. This heterogeneous network characteristic of "intertwined fast and slow dynamics" poses a significant challenge to traditional multi-energy flow calculations and real-time dynamic tracking of gas components.
[0003] Existing research generally assumes a constant natural gas composition when calculating energy flow in hydrogen-containing integrated energy systems. However, in hydrogen transportation scenarios, the injection of hydrogen into the natural gas pipeline network causes the composition of the mixed gas to change continuously with time and spatial location. Key physical properties of natural gas, such as density, calorific value, and compressibility factor, all shift significantly with compositional changes. Due to the significant time-delay characteristics of hydrogen-containing natural gas pipeline network transmission, ignoring changes in gas composition within the pipeline will lead to large deviations in the calculated pressure, flow rate, and temperature results, ultimately resulting in distorted system operation status assessments. Furthermore, existing research often uses steady-state or conventional isothermal models to model and analyze hydrogen-containing natural gas pipeline network systems, neglecting the inherent multi-timescale characteristics of hydrogen-containing integrated energy systems—that is, the dynamic response of the power system is on the order of seconds or milliseconds, while the dynamic response of the hydrogen-containing natural gas pipeline network system is on the order of minutes or even hours. This difference in timescales means that the "synchronous equal-step simulation" strategy is not the optimal choice in terms of computational efficiency and numerical accuracy. Moreover, due to the strong coupling between the power-to-gas equipment and the gas generator set, there is a significant bidirectional energy interaction between the power system and the hydrogen-containing natural gas pipeline network system. Existing iterative simulation methods typically employ a fixed calorific value constant for energy conversion, failing to achieve real-time dynamic tracking of the entire network's gas composition and accurate dynamic updates of calorific value. Furthermore, they lack a multi-rate asynchronous simulation method capable of accurately reflecting the varying dynamic characteristics of the power system and the hydrogen-containing natural gas pipeline network. Therefore, a modeling method for integrated hydrogen-containing energy systems that considers dynamic component tracking is urgently needed to overcome the shortcomings of existing technologies. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a modeling method for hydrogen-containing integrated energy systems that takes into account dynamic component tracking, in order to solve the technical problems of large deviations in energy flow calculations and difficulty in coordinating simulations of the time scale differences between the power system and the hydrogen-containing natural gas pipeline network system due to the neglect of dynamic changes in gas components.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: This invention provides a modeling method for a hydrogen-containing integrated energy system that takes into account dynamic component tracking, comprising the following steps: Step S1: Based on the flow and component diffusion characteristics of hydrogen-containing natural gas, establish a set of partial differential equations describing the dynamic process of the hydrogen-containing natural gas pipeline network system, which together form the component tracking equation set of the hydrogen-containing natural gas pipeline network system; the set of partial differential equations includes the continuity equation, momentum equation, energy equation, concentration diffusion equation and BWRS gas state equation. Step S2: Discretize and linearize the component tracking equations of the hydrogen-containing natural gas pipeline network system, and perform total differential expansion on the density increment and enthalpy increment of the mixed gas. Then, construct the transfer matrix equation for each spatial pipe segment to establish the mapping relationship between the state variables at both ends of the pipe segment. Combine the mixed node constraints and boundary conditions to assemble the coefficient matrix and constant term column vector of the state variables of the whole network to construct the hydrogen-containing pipeline network matrix model. Step S3: Based on the power system network structure, establish the AC steady-state power flow equation of the power system, and introduce the coupled equipment model of the power-to-gas conversion equipment and the gas generator set to form an energy flow solution model of the hydrogen-containing integrated energy system with time and space discrete variables; Step S4: Based on the energy flow solution model of the hydrogen-containing integrated energy system and the hydrogen-containing pipeline network matrix model, construct a multi-rate asynchronous time-series matching mechanism for the power system and the hydrogen-containing natural gas pipeline network system, and perform multi-rate asynchronous simulation solution for the hydrogen-containing integrated energy system.
[0006] Further, in step S2, the implicit central difference method is used to discretize and linearize the component tracking equations of the hydrogen-containing natural gas pipeline system. During the discretization process, the time partial derivative is discretized using first-order backward difference, the spatial partial derivative is discretized using central difference, and the non-derivative terms are approximated by the arithmetic mean of adjacent node values to obtain the discretized equations of the natural gas pipeline, which constitute the residual equations for the state variables of each node of the pipeline. A first-order Taylor expansion is performed on each residual equation at the current iteration point, and the variable increment is set to the difference between the current iteration value and the previous iteration value to obtain the linearized equations of the hydrogen-containing natural gas pipeline system.
[0007] Further, in step S2, the density increment and enthalpy increment of the mixed gas are expanded using total differential equations, including: determining the density of the mixed gas as a composite function of node pressure, temperature, and the mass fraction of each component using the BWRS gas state equation; expanding the density increment as the sum of the first-order partial derivatives of the pressure increment, temperature increment, and the mass fraction increment of each component using the total differential theorem; determining the enthalpy of the mixed gas as a composite function of node pressure, temperature, and the mass fraction of each component using the enthalpy calculation equation; expanding the enthalpy increment as the sum of the first-order partial derivatives of the pressure increment, temperature increment, and the mass fraction increment of each component using the total differential theorem; and substituting the expanded expressions of the density increment and the enthalpy increment into the linear equations of the hydrogen-containing natural gas pipeline network to establish the relationship between the increments of the state variables at each node.
[0008] Furthermore, the hydrogen-containing pipeline network matrix model mentioned in step S2 includes the transfer matrix equations of each pipe segment in the hydrogen-containing natural gas pipeline network system and the node constraint model of the pipeline network, specifically including: The coefficients of each variable in the linear equations of the hydrogen-containing natural gas pipeline network are collected. All unknown state variables at the nodes at both ends of the pipeline segment are arranged in order into a vector form. The coefficients of the corresponding variables in the linear equations of the hydrogen-containing natural gas pipeline network are extracted to form a Jacobian matrix. The constant terms on the right side of the equations are incorporated into the residual vector to obtain the transfer matrix equation of a single spatial pipeline segment. For complex hydrogen-containing natural gas pipeline networks with multiple branch intersections, a node constraint model is established based on the pipeline network topology and the mixing node deviation equations and the characteristics of components before and after mixing. The node constraint model includes node pressure balance equations, node mass flow balance equations, node component mixing equations, and node energy mixing equations.
[0009] Furthermore, the coupled equipment model in step S3 includes an electric-to-gas converter and a gas generator set. The electric-to-gas converter is used to convert electrical energy into hydrogen and inject it into the hydrogen-containing natural gas pipeline network system. The electrical power consumed and the mass flow rate of the gas produced are determined by the efficiency of the electric-to-gas converter. The gas generator set is used to convert hydrogen-containing natural gas into electrical energy. The mass flow rate of the gas consumed and the active power generated are determined by the characteristic coefficient of the gas generator set. The energy flow solution model uses AC steady-state power flow equations to describe the operating state of the power system. The boundary conditions of the power system include node power balance constraints, upper and lower limits of generator active power output constraints, upper and lower limits of generator reactive power output constraints, and node voltage amplitude constraints.
[0010] Furthermore, the specific method for step S4 is as follows: The power system is treated as a fast-response subsystem, and the hydrogen-containing natural gas pipeline network is treated as a slow-dynamic subsystem. The time step of the slower hydrogen-containing natural gas pipeline network is used as the basic synchronization period for system state updates. A time-series matching and data exchange mechanism is established to exchange energy data of coupled equipment at the time boundaries of the two subsystems. The global convergence state of the two subsystems is determined by an alternating electric-gas method.
[0011] Furthermore, the timing matching and data exchange mechanism is specifically as follows: the power system and the hydrogen-containing natural gas pipeline network are advancing synchronously, and the energy data exchange between the coupled devices is carried out at the time boundary with the slower step size of the hydrogen-containing natural gas pipeline network system as the basic period.
[0012] Furthermore, the specific method for determining the global convergence state of the two subsystems using an alternating electric-gas iterative approach is as follows: In the first stage, the Newton-Raphson method is used to solve the nonlinear AC steady-state power flow equations of the power system to obtain state variables such as node voltage, node phase angle, power consumption of the electric-to-gas conversion equipment, power generation of the gas generator set, and line power flow; the power consumption of the electric-to-gas conversion equipment and the power generation of the gas generator set are extracted, and using a coupled equipment model, the power is converted into the mass flow injection and mass flow of the hydrogen-containing natural gas pipeline network system nodes, thereby dynamically reconstructing and refreshing the flow boundary conditions of the hydrogen-containing natural gas pipeline network subsystem; in the second stage, the hydrogen-containing natural gas pipeline network system is dynamically solved; based on the updated flow boundary conditions, the established transfer matrix equation is used to solve the hydrogen-containing natural gas pipeline network system, and the pressure, flow rate, temperature, and hydrogen composition distribution are iteratively updated using the Newton-Raphson method until the hydrogen-containing natural gas pipeline network system meets the internal convergence conditions; in the third stage, the global convergence is determined using the mass flow changes caused by the gas generator.
[0013] The beneficial effects of adopting the above technical solution are as follows: This invention provides a modeling method for a hydrogen-containing integrated energy system that considers dynamic component tracking. By establishing a set of partial differential equations including continuity equations, momentum equations, energy equations, and concentration diffusion equations, it achieves real-time, full-domain dynamic component tracking of hydrogen-containing natural gas in both time and space dimensions, overcoming the computational bias in hydrogen-containing natural gas pipeline systems caused by traditional fixed component assumptions. This invention employs the implicit central difference method and first-order Taylor expansion to construct a pipeline matrix solution model based on the transfer matrix, effectively reducing the computational complexity of dynamic solutions for complex pipeline networks. This invention introduces real-time changes in gas composition into the electrical coupling interface, realizing dynamic updates of coupled calorific values and accurate mapping of energy conversion quantities. This invention also constructs a multi-rate asynchronous time-series matching mechanism between the power system and the hydrogen-containing natural gas pipeline system, using asynchronous alternating iterations of fast and slow subsystems to balance simulation accuracy and computational efficiency. Attached Figure Description
[0014] Figure 1 A flowchart of a hydrogen-containing integrated energy system modeling method considering dynamic component tracking provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the topology of a hydrogen-containing integrated energy system provided in an embodiment of the present invention; Figure 3 The solution process for the multi-rate asynchronous simulation algorithm provided in the embodiments of the present invention is as follows. Detailed Implementation
[0015] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0016] This embodiment provides a modeling method for a hydrogen-containing integrated energy system that takes into account dynamic component tracking. It is preferably applied to hydrogen transportation scenarios where power-to-gas equipment converts electrical energy into hydrogen and injects it into a natural gas pipeline network, and to energy feedback scenarios where a gas generator set converts hydrogen-containing natural gas into electrical energy.
[0017] like Figure 1 As shown, the method of the present invention mainly includes the following steps: Step S1, based on the flow and component diffusion characteristics of hydrogen-containing natural gas, establish a set of partial differential equations describing the dynamic process of the hydrogen-containing natural gas pipeline network system. The set of partial differential equations includes a continuity equation, a momentum equation, an energy equation, and a concentration diffusion equation; Step S2, perform discretization and linearization on the set of partial differential equations, and perform total differential expansion on the density increment and enthalpy increment of the mixed gas. Combine the mixing node constraints and boundary conditions to assemble the coefficient matrix and constant term column vector of the entire network state variables to construct a hydrogen-containing pipeline network matrix model; Step S3, based on the hydrogen-containing pipeline network matrix model, establish the AC steady-state power flow equation of the power system, and introduce the coupled equipment model of the power-to-gas conversion equipment and the gas generator set to form a hydrogen-containing integrated energy system energy flow solution model with time and space discrete variables; Step S4, based on the hydrogen-containing integrated energy system energy flow solution model, construct a multi-rate asynchronous time-series matching mechanism between the power system and the hydrogen-containing natural gas pipeline network system, and perform multi-rate asynchronous simulation solution of the hydrogen-containing integrated energy system.
[0018] In this embodiment, the hydrogen-containing integrated energy system is specifically as follows: Figure 2As shown, the system includes a power grid and a hydrogen-containing natural gas pipeline network, as well as power-to-gas (PTO) equipment and gas generator sets. Power grid nodes are connected via transmission lines, while hydrogen-containing natural gas pipeline network nodes are connected via natural gas pipelines. The PTO equipment and gas generator sets serve as bidirectional coupling interfaces between the power grid and the hydrogen-containing natural gas pipeline network, respectively. The PTO equipment generates hydrogen by consuming electricity and injects it into the hydrogen-containing natural gas pipeline network. The gas generator sets utilize natural gas combustion to generate electricity, achieving gas-to-electricity energy feedback. In actual operation, hydrogen-containing natural gas is injected into the pipeline network from the gas source nodes and transported via pipelines to various load nodes and gas generator set nodes. The PTO equipment is typically located near power grid nodes rich in renewable energy generation to absorb excess electricity locally; the gas generator sets are typically located near power load centers and nodes with good natural gas pipeline supply conditions to provide nearby power support.
[0019] Step S1: Establish the system of partial differential equations; Based on the flow and component diffusion characteristics of hydrogen-containing natural gas, this step establishes a set of partial differential equations describing the dynamic process of the hydrogen-containing natural gas pipeline network system, which together form the component tracking equations in the hydrogen-containing natural gas pipeline network system.
[0020] Step S1-1: For hydrogen-containing natural gas pipeline systems, the dynamic gas transport process is described by the continuity equation and the momentum equation. The continuity equation reflects the conservation of gas mass in the pipeline, that is, the change in gas mass within a small segment of the pipeline per unit time is equal to the difference between the mass flow rate flowing into and out of that small segment; the momentum equation reflects the conservation of gas momentum in the pipeline, that is, the balance between the pressure gradient force, frictional resistance, and inertial force experienced by the gas as it flows in the pipeline.
[0021] The continuity equation is expressed as: (1); In equation (1), For gas density, m For gas mass flow rate, A The cross-sectional area of the pipe. x For spatial variables, It is a time variable; The momentum equation is expressed as: (2); In equation (2), p For gas pressure, d For pipe diameter, The friction factor of the pipeline; To achieve accurate tracking of natural gas components, a gas state equation describing the relationship between gas pressure, temperature, density, and components is required. This embodiment selects the BWRS (Benedict-Webb-Rubin-Starling) state equation with 11 parameters. This equation is an improvement on the classic BWR equation, adding more parameters to broaden its applicability, and is particularly suitable for describing the thermodynamic properties of hydrocarbon mixtures and their mixtures with hydrogen.
[0022] The specific expression for the BWRS state equation is: (3); In equation (3), The gas molar density, T For gas temperature, R The gas constant is , , , , a, b, c , , These are the 11 parameters of the BWRS gas equation of state, where e is an exponential function.
[0023] During the tracking of gas components, the enthalpy of the gas mixture changes with parameters such as composition and temperature. Enthalpy is a crucial physical property parameter in the energy equation, and its calculation accuracy directly affects the accuracy of the solution. This embodiment derives the equation for calculating the enthalpy of the gas mixture by combining the thermodynamic residual enthalpy relationship with the BWRS equation of state. Residual enthalpy refers to the deviation of the enthalpy of the actual gas from that of the ideal gas. This deviation is caused by intermolecular forces and is particularly significant under high pressure or low temperature conditions. The actual enthalpy of the gas mixture is obtained by adding the residual enthalpy correction term to the ideal enthalpy: (4); (5); In equations (4) and (5), h is the actual enthalpy of the mixed gas. The ideal enthalpy value for the gas mixture. Let be the enthalpy of the m-th component in the gas mixture. Here is the relative molecular mass of the gas. , , , , , All are the first Calculation constants of ideal gas enthalpy for each pure component of natural gas.
[0024] Step S1-2: Based on the principle of energy conservation, and combining the aforementioned continuity equation, momentum equation, definition of the actual enthalpy of a gas mixture, and BWRS equation of state, the energy equation for a natural gas pipeline can be obtained. The energy equation reflects the conservation of energy in the gas within the pipeline; that is, the change in internal energy of the gas within a small segment of the pipeline is equal to the energy difference between the inflow and outflow from that segment, the work done on the gas by the external environment, and the heat exchange between the gas and the pipe wall.
[0025] The specific expression for the energy equation is: (6); In equation (6), D is the outer diameter of the pipe, and K is the heat transfer coefficient between the pipe and the outside world. The ambient temperature.
[0026] Steps S1-3: To achieve dynamic tracking of each component of natural gas in the pipeline, this embodiment selects the concentration diffusion equation to describe the transport process of each component in the pipeline. The concentration diffusion equation reflects the mass conservation of each gas component (such as methane, hydrogen, etc.) in the pipeline, that is, the change in the mass of a certain component in a micro-segment of the pipeline per unit time is equal to the difference between the mass flow rate of that component flowing into and out of that micro-segment.
[0027] The concentration diffusion equation is expressed as: (7); In equation (7), For the first m The density of each component For the first m The mass fraction of each component.
[0028] The four equations—continuity equation (1), momentum equation (2), energy equation (6), and concentration diffusion equation (7)—together form the component tracking equation set in the hydrogen-containing natural gas pipeline network system. This constitutes the basic governing equation system describing the dynamic process of the hydrogen-containing natural gas pipeline network system. The component tracking equation set is expressed by the following set of partial differential equations: (8); All physical quantities in the component tracking equation (8) are consistent with the previous equation.
[0029] S2: Discretization and matrix model construction; This step discretizes and linearizes the above component tracking equations, and performs total differential expansion on the density increment and enthalpy increment of the mixed gas. Combining the mixing node constraints and boundary conditions, it assembles the coefficient matrix and constant term column vector of the state variables of the hydrogen-containing natural gas pipeline network system to construct a matrix model of the hydrogen-containing natural gas pipeline network, including the transfer matrix equations of each pipe segment in the hydrogen-containing natural gas pipeline network system and the node constraint model of the pipeline network. Step S2-1: Discretize the above component tracking equations using the implicit central difference method. The implicit difference scheme has better numerical stability than the explicit difference scheme, allowing for larger time steps without causing numerical oscillations, which is particularly important for pipeline network simulations with high computational efficiency requirements. During discretization, the time partial derivatives are discretized using first-order backward difference, the spatial partial derivatives are discretized using central difference, and the non-derivative terms are approximated using the arithmetic mean of adjacent spatial node values.
[0030] The above discrete schemes are represented as follows: (9); (10); (11); In equations (9), (10), and (11), Functions with variables i and k These are the difference grid numbers in the spatial and temporal directions, respectively. and These are the time step and the spatial step, respectively.
[0031] Using equations (9), (10), and (11), the component tracking equations shown in formula (8) are discretized to obtain the discretized equations for the natural gas pipeline, which are represented by unknown quantities (such as gas density, pressure, mass flow rate, mass fraction, etc.) at each node of the pipeline. Specifically, they are expressed as follows: (12); (13); (14); (15); Equations (12), (13), (14), and (15) constitute a set of residual equations concerning the state variables of each node in the pipeline, where, As an intermediate variable, , , These are the discrete forms of the last three terms of the energy equation. , , , These represent the residual functions of the continuity equation, the momentum equation, the energy equation, and the concentration-diffusion equation, respectively.
[0032] Step S2-2: Perform a first-order Taylor expansion on each of the above residual equations at the current iteration point to obtain the residuals of the continuity equation, momentum equation, energy equation, and concentration-diffusion equation. The core idea of the Newton-Raphson method is to linearize the nonlinear equation system at the current iteration point and gradually approximate the true solution of the nonlinear equation system by repeatedly solving the linearized equation system. The first-order Taylor expansion retains the linear terms of the residual function with respect to each variable and discards higher-order terms.
[0033] Based on the first-order Taylor expansion Taylor expansion of equations (12)-(15) yields the linearized equations for hydrogen-containing natural gas pipeline networks: (16); (17); (18); (19); In equations (16) to (19), , , , These are respectively represented as the residuals of the continuity equation, momentum equation, energy equation, and concentration-diffusion equation expanded at the current iteration point. Indicates the increment symbol.
[0034] Step S2-3: From the BWRS gas law, the density of the mixed gas is... Essentially, it can be characterized by nodal pressure p, temperature T, and the mass fraction of each component. The composite function, i.e. This means that density changes are not only directly controlled by pressure and temperature, but also indirectly affected by changes in gas composition (such as compositional shifts caused by hydrogen injection). According to the total differential theorem in calculus, when density is a function of multiple independent variables, its increment is equal to the sum of the products of the partial derivatives of each independent variable and the increments of the corresponding variables. The density increment can be directly expanded as: (20); Similarly, the actual enthalpy of the gas mixture h Also node pressure p ,temperature T and the mass fraction of each component The composite function, i.e. The enthalpy increment can be directly expanded as: (twenty one); Substituting equations (20) and (21) into the linearized equation set for the hydrogen-containing natural gas pipeline network, i.e., equations (16) to (19), we can obtain the relationship between pressure, mass flow rate, temperature, and gas mass fraction between adjacent spatial nodes (i.e., regarding...). , , , and , , , The linearized equations for hydrogen-containing natural gas pipeline networks.
[0035] In this embodiment, we take formula (16) as an example. Substituting formulas (20) and (21) into formula (16) and expanding them, we get: (twenty two); For the sake of simplicity in matrix form, the superscript k+1 for future times is omitted in the following equation.
[0036] Step S2-4: By collecting the coefficients of each variable in the linearized equations of the hydrogen-containing natural gas pipeline network, a transfer matrix equation can be constructed for each pipeline segment. Specifically, all unknown state variables at the nodes at both ends of the pipeline segment are arranged in order into a vector form. The coefficients of the corresponding variables in the linear equations of the hydrogen-containing natural gas pipeline network are extracted to form a Jacobian matrix. The constant terms on the right-hand side of the equation are incorporated into the residual vector to obtain the transfer matrix equation for a single spatial pipeline segment. (twenty three); In equation (23), and For Jacobi submatrices, It is the residual vector of the four linear equations calculated in the current iteration step. and These are spatial nodes and The variable at that location.
[0037] Let the transfer matrix And the constant correction term is denoted as ,get and The final relation is: (twenty four); in, and The first and the The state variable correction amount at each spatial node. For the transfer matrix, This is the modified driving term after conversion.
[0038] The specific expansion form of the transfer matrix equation for a single spatial pipe segment is as follows: (25); in, , , , The respective Pressure correction, pipeline flow correction, temperature correction, and component mass fraction correction at each spatial node. , , , The first Pressure correction, pipeline flow correction, temperature correction, and component mass fraction correction at each spatial node. , , , These are the converted pressure, pipeline flow rate, temperature, and component mass corrections, respectively.
[0039] The above derivation constructs the transfer matrix equation for a single spatial pipe segment. For complex natural gas pipeline networks containing multiple gas source injections and multiple branch junctions, it is necessary to further combine the pipeline topology and establish a node constraint model of the pipeline network based on the mixing node deviation equation and the component characteristics before and after mixing. At the junction nodes of the pipeline network, the gases from each branch pipe mix. The pressure before and after mixing should be equal, the mass flow rate should be conserved, the mass fraction of each component should be recalculated according to the mixing ratio, and the energy after mixing should be redistributed according to the principle of energy conservation. Assuming there are several mixing nodes in the pipeline network, the following node equilibrium equations must be satisfied: (26); (27); (28); (29); Equation (26) is the pressure balance equation for the mixed nodes. and Representing hybrid nodes Pressure corrections for inflow and outflow branches; Equation (27) is the mass flow balance equation for the mixing node. and Representing hybrid nodes Mass flow correction for inflow and outflow branches. Indicates a hybrid node The mass conservation residual at the current iteration point; Equation (28) is the mixing equation for the mixed node components. and Representing hybrid nodes No. The mass fraction reference values of each component in the inflow and outflow branches. and Representing hybrid nodes No. Corrections for each component in the inflow and outflow branches and Representing hybrid nodes Mass flow rate baseline values for inflow and outflow branches. Indicates a hybrid node The component conservation residual at the current iteration point; Equation (29) is the energy mixing equation for the mixing node. and Representing hybrid nodes Reference values for the enthalpy of gases in the inflow and outflow branches. and Representing hybrid nodes Enthalpy correction for gases flowing into and out of the branch. Indicates a hybrid node The energy conservation residual at the current iteration point.
[0040] Step S3: Establish the energy flow solution model; This step combines the power system network structure to establish the AC steady-state power flow equations of the power system to describe the operating state of the power system, and introduces the coupled equipment model of the power-to-gas conversion equipment and the gas generator set to form an energy flow solution model of the hydrogen-containing integrated energy system with time and space discrete variables.
[0041] Step S3-1: Considering the extremely high propagation speed of electromagnetic waves in a power system, and that the dynamic process of a power system is much faster than the transmission dynamics of a natural gas pipeline network, AC steady-state power flow equations can be used to describe the operating state of the power system. AC power flow equations, based on Kirchhoff's laws, reflect the balance between the active and reactive power injected into each node of the power system and the voltage amplitude, phase angle, and network parameters of that node. (30); (31); In equations (30) and (31), and For spatial nodes i The imbalance between active and reactive power. and For spatial nodes i The active and reactive power generated by the generator. and For spatial nodes iThe active and reactive power consumed by the load. The active power consumed by the electro-gas conversion equipment. The active power generated by the gas generator set. and For spatial nodes i, j voltage amplitude, For spatial nodes i, j voltage phase angle difference, and For spatial nodes i, j The real and imaginary parts of the admittance matrix, For nodes The set of all connected nodes.
[0042] Step S3-2: The power system and the hydrogen-containing natural gas pipeline network system are mainly coupled through power-to-gas (PTO) equipment and gas generator sets. The PTO equipment converts electrical energy into hydrogen and injects it into the natural gas pipeline network, representing the energy conversion link in the "electricity → gas" direction; the gas generator sets convert the heat energy generated from the combustion of hydrogen-containing natural gas into electrical energy, representing the energy feedback link in the "gas → electricity" direction. To achieve precise dynamic mapping of energy conversion at the coupling interface, the gas components need to be... A coupled model of the power-to-gas (P2G) generator and the gas generator set is introduced. Specifically, the relationship between the electrical power consumed by the P2G generator and the hydrogen mass flow rate produced is determined by the efficiency of the P2G generator; the relationship between the natural gas mass flow rate consumed by the gas generator set and the active power generated is determined by the heat rate characteristic curve of the gas generator set, which is usually expressed as a quadratic polynomial. The coupled equipment model of the P2G generator and the gas generator set (GPG) is as follows: (32); (33); (34); In equations (32), (33), and (34), For nodes i The mass flow rate of gas consumed by the gas generator set. For nodes i The active power generated by the gas generator set. The calorific value of the mixed gas. This refers to the calorific value of hydrogen. For the first Calorific value per unit mass of each gas component The number of components in the gas mixture. , , The characteristic coefficient of the gas generator set. For nodes iThe mass flow rate of the gas produced by the electro-gas conversion equipment. For nodes i The active power consumed by the electro-gas conversion equipment. For the efficiency of the electro-gas conversion equipment.
[0043] To ensure that the energy flow solution model for the hydrogen-containing integrated energy system can yield a unique solution, the power system must also satisfy the following boundary conditions: (35); (36); (37); (38); Equation (35) represents the node power balance constraint, which requires that the injected power at each node satisfy a balance relationship with the load power and the power consumed by the electric-to-gas equipment and gas generator set. For nodes With nodes The active power of the line between them; Equation (36) represents the upper and lower limits of the active power output of the generator in the power system, and Equation (37) represents the upper and lower limits of the reactive power output of the generator, reflecting the physical regulation capability of the power generation equipment. and These represent the generator's minimum and maximum active power output, respectively. and These represent the minimum and maximum reactive power output of the generator, respectively; Equation (38) represents the node voltage amplitude constraint, ensuring that the power system operates within the allowable voltage range. and These represent the minimum and maximum allowable voltages for the node, respectively.
[0044] Step S4: Multi-rate asynchronous simulation; Based on the energy flow solution model of the hydrogen-containing integrated energy system mentioned above, this step constructs a multi-rate asynchronous time-series matching mechanism for the power system and the hydrogen-containing natural gas pipeline network system, and performs multi-rate asynchronous simulation solution for the hydrogen-containing integrated energy system.
[0045] Step S4-1: Considering the inherent timescale difference between the dynamic processes of the power system (which occur on the order of seconds or milliseconds) and the dynamic processes of the hydrogen-containing natural gas pipeline network (which occur on the order of minutes or even hours), this embodiment treats the power system as a fast-response subsystem and the hydrogen-containing natural gas pipeline network as a slow-dynamic subsystem. The two subsystems interact through power-to-gas conversion equipment and gas generator sets, using the slower time step of the hydrogen-containing natural gas pipeline network system as the basic synchronization period for the state updates of the two systems.
[0046] Establish a timing matching and data exchange mechanism: The power system and the hydrogen-containing natural gas pipeline network subsystems advance synchronously, with the hydrogen-containing natural gas pipeline network system taking a slower step. The basic cycle involves energy data exchange between the coupled devices at time boundaries.
[0047] Prepare the data required for dynamic energy flow calculation. Basic input data includes the topology parameters of the power system and the hydrogen-containing natural gas pipeline network system, the load demand of each node, and the characteristic coefficients of the coupling equipment in the hydrogen-containing integrated energy system. Simultaneously, calculate the initial time of the hydrogen-containing integrated energy system. The initial running state serves as the starting point for subsequent dynamic simulations.
[0048] Due to the deep coupling and bidirectional influence between the power system and the hydrogen-containing natural gas pipeline network system—that is, the power consumption of the power-to-gas conversion equipment affects the power flow distribution of the power system, while the power generation of the gas generator set is affected by the gas supply and composition of the hydrogen-containing natural gas pipeline network system, and the composition distribution of the hydrogen-containing natural gas pipeline network system is affected by the hydrogen injection amount of the power-to-gas conversion equipment—the two subsystems form a closed-loop mutual influence relationship. This embodiment uses alternating electric-gas iteration to determine the global convergence state of the two systems.
[0049] Step S4-2: In the first stage, the Newton-Raphson method is used to solve the nonlinear AC steady-state power flow equations of the power system, obtaining state variables such as node voltage, node phase angle, power consumption of power-to-gas conversion equipment, power generation of gas generator sets, and line power flow. The Newton-Raphson method is one of the most commonly used iterative methods for solving nonlinear algebraic equations. Its core idea is to linearize the nonlinear equations at the current iteration point and gradually approximate the true solution by repeatedly solving the linearized equations. Its convergence form is given by the following equation: (39); In equation (38), For the first In the next iteration, the node Active power and reactive power at the location, For the first In the next iteration, the node Active power and reactive power at the location, This represents the current iteration number. For the set of nodes in the power system, The convergence accuracy threshold for power system power flow calculation is typically set to a value of [value missing]. .
[0050] The electrical power consumed by the power-to-gas (P2G) equipment and the power generated by the gas generator set, calculated in the above steps, are extracted. Using a coupled equipment model, the electrical power is converted into the mass flow rate injection and consumed gas mass flow rate of the hydrogen-containing natural gas pipeline network system nodes. This dynamically reconstructs and refreshes the flow boundary conditions of the hydrogen-containing natural gas pipeline network subsystem. Specifically, the electrical power consumed by the P2G equipment is converted into hydrogen mass flow rate through P2G efficiency, serving as the injection boundary condition for the hydrogen-containing natural gas pipeline network system nodes; the natural gas consumption corresponding to the power generated by the gas generator set is converted into gas mass flow rate through the GPG calorific rate characteristic curve, serving as the consumption boundary condition for the hydrogen-containing natural gas pipeline network system nodes.
[0051] Step S4-3, the second stage, involves the dynamic solution of the hydrogen-containing natural gas pipeline system: Based on the updated flow boundary conditions, the established transfer matrix equations are used to solve the hydrogen-containing natural gas pipeline system. The pressure, flow rate, temperature, and hydrogen composition distribution are iteratively updated using the Newton-Raphson method until the hydrogen-containing natural gas pipeline system satisfies the internal convergence condition. The following convergence forms are considered for solving the hydrogen-containing natural gas pipeline system: (40); In equation (40), For the first In the next iteration, the nodes of the hydrogen-containing natural gas pipeline network system State variables, For the first In the next iteration, the nodes of the hydrogen-containing natural gas pipeline network system State variables, It is a set of nodes in a hydrogen-containing natural gas pipeline network system. The convergence accuracy threshold for power flow calculations in hydrogen-containing natural gas pipeline systems is typically set to a value of [value missing]. .
[0052] Step S4-4, the third stage, utilizes the mass flow rate change caused by the gas generator for global convergence determination. After determining the precise composition and state distribution of the hydrogen-containing natural gas pipeline network at the current time step, a global coupling convergence determination is required. The physical meaning of global coupling convergence is that the energy exchange state between the power system and the hydrogen-containing natural gas pipeline network system should remain consistent after the two subsystems are solved independently. That is, the electrical power consumed by the power-to-gas conversion equipment and the amount of hydrogen injected satisfy the coupling characteristic relationship, and the amount of gas consumed by the gas generator set and the power generation satisfy the coupling characteristic relationship. If the hydrogen concentration at node i where the gas generator set is located changes between two global alternating iterations... The difference in mass flow rate caused by the change satisfies: (41); In equation (41), For the first The flow rate consumed by the gas generator in the next iteration. For the first The flow rate consumed by the gas generator in the next iteration. This is the threshold for global coupling convergence accuracy, typically set to a value of [value to be filled in]. .
[0053] Then proceed to the next step.
[0054] Step S4-4: If the above convergence conditions are met, it is considered that the power system and the hydrogen-containing natural gas pipeline network have reached global convergence within the current time step, and the time axis is advanced forward by one hydrogen-containing natural gas pipeline network system step. Otherwise, return to step S4-2, recalculate the data of the power-to-gas equipment and gas generator set using the latest feedback data from the hydrogen-containing natural gas pipeline network (including real-time calorific value, hydrogen concentration distribution, gas consumption, etc.), and recalculate the power flow until global convergence.
[0055] In this embodiment, the multi-rate asynchronous simulation process is specifically as follows: Figure 3 As shown, a multi-rate asynchronous simulation method is used to achieve dynamic coordination solution of the integrated energy system. First, the system topology parameters, load parameters, and coupled equipment parameters are input, and the system operating state is initialized, including initial values of voltage amplitude and phase angle at each node of the power system, and initial values of pressure, flow rate, temperature, and component distribution at each node of the hydrogen-containing natural gas pipeline network. Then, the solution loop for the current time step k is entered.
[0056] In the first stage, the power system solution stage, the Newton-Raphson method is used to solve the AC power flow equations, obtaining state variables such as node voltage, unit output, power consumption of the power-to-gas conversion equipment, and power generation of the gas generator units. Once the power system meets the internal convergence condition, the power information of the coupled equipment is extracted, and the electrical power is mapped to the mass flow rate boundary conditions and hydrogen injection boundary conditions in the natural gas system through the coupled equipment model.
[0057] In the second stage, namely the solution stage of the hydrogen-containing natural gas pipeline network system, the hydrogen-containing natural gas pipeline network system is solved using the established transfer matrix model based on the updated boundary conditions. The pressure, flow rate, temperature and hydrogen composition distribution are continuously updated iteratively using the Newton-Raphson method until the natural gas system meets the internal convergence conditions.
[0058] In the third stage, global convergence is determined using the mass flow rate changes caused by the gas generator. After completing the dynamic solution of the hydrogen-containing natural gas pipeline system at the current time step, coupled information such as real-time calorific value, hydrogen concentration, and gas consumption in the hydrogen-containing natural gas pipeline system is fed back to the power system, and the operating state of the power system is recalculated. Then, it is determined whether the global coupling convergence condition is met between the power system and the hydrogen-containing natural gas pipeline system. If not, the process returns to the power system solution stage to continue alternating iterations; if it is met, the state of the integrated hydrogen-containing energy system at the current time step is considered to have reached consistency.
[0059] After the current time step satisfies global coupling convergence, the time is advanced to the next time step of the hydrogen-containing natural gas pipeline network system. The above solution process is repeated until the set simulation termination time is reached, and the final output of the dynamic operation results of the entire network is obtained, including the node voltage and phase angle of the power system, the pressure distribution, flow distribution, temperature distribution and hydrogen composition distribution of the hydrogen-containing natural gas pipeline network system.
[0060] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the present invention.
Claims
1. A modeling method for a hydrogen-containing integrated energy system considering dynamic component tracking, characterized in that, Includes the following steps: Step S1: Based on the flow and component diffusion characteristics of hydrogen-containing natural gas, establish a set of partial differential equations describing the dynamic process of the hydrogen-containing natural gas pipeline network system, which together form the component tracking equation set of the hydrogen-containing natural gas pipeline network system; the set of partial differential equations includes the continuity equation, momentum equation, energy equation, concentration diffusion equation and BWRS gas state equation. Step S2: Discretize and linearize the component tracking equations of the hydrogen-containing natural gas pipeline network system, and perform total differential expansion on the density increment and enthalpy increment of the mixed gas. Then, construct the transfer matrix equation for each spatial pipe segment to establish the mapping relationship between the state variables at both ends of the pipe segment. Combine the mixed node constraints and boundary conditions to assemble the coefficient matrix and constant term column vector of the state variables of the whole network to construct the hydrogen-containing pipeline network matrix model. Step S3: Based on the power system network structure, establish the AC steady-state power flow equation of the power system, and introduce the coupled equipment model of the power-to-gas conversion equipment and the gas generator set to form an energy flow solution model of the hydrogen-containing integrated energy system with time and space discrete variables; Step S4: Based on the energy flow solution model of the hydrogen-containing integrated energy system and the hydrogen-containing pipeline network matrix model, construct a multi-rate asynchronous time-series matching mechanism for the power system and the hydrogen-containing natural gas pipeline network system, and perform multi-rate asynchronous simulation solution for the hydrogen-containing integrated energy system.
2. The method for modeling a hydrogen-containing integrated energy system considering dynamic component tracking according to claim 1, characterized in that, In step S2, the implicit central difference method is used to discretize and linearize the component tracking equations of the hydrogen-containing natural gas pipeline system. During the discretization process, the time partial derivative is discretized using first-order backward difference, the spatial partial derivative is discretized using central difference, and the non-derivative terms are approximated by the arithmetic mean of adjacent node values to obtain the discretized equations of the natural gas pipeline, which constitute the residual equations for the state variables of each node of the pipeline. A first-order Taylor expansion is performed on each residual equation at the current iteration point, and the variable increment is set to the difference between the current iteration value and the previous iteration value to obtain the linearized equations of the hydrogen-containing natural gas pipeline system.
3. The method for modeling a hydrogen-containing integrated energy system considering dynamic component tracking according to claim 2, characterized in that, Step S2 involves performing total differential expansion on the density and enthalpy increments of the mixed gas, including: determining the density of the mixed gas as a composite function of node pressure, temperature, and the mass fraction of each component using the BWRS gas state equation; expanding the density increment as the sum of the first partial derivatives of the pressure increment, temperature increment, and the mass fraction increment of each component using the total differential theorem; determining the enthalpy of the mixed gas as a composite function of node pressure, temperature, and the mass fraction of each component using the enthalpy calculation equation; expanding the enthalpy increment as the sum of the first partial derivatives of the pressure increment, temperature increment, and the mass fraction increment of each component using the total differential theorem; and substituting the expanded expressions of the density and enthalpy increments into the linear equations of the hydrogen-containing natural gas pipeline network to establish the relationship between the increments of the state variables at each node.
4. The method for modeling a hydrogen-containing integrated energy system considering dynamic component tracking according to claim 3, characterized in that, The hydrogen-containing pipeline network matrix model mentioned in step S2 includes the transfer matrix equations of each pipe segment in the hydrogen-containing natural gas pipeline network system and the node constraint model of the pipeline network, specifically including: The coefficients of each variable in the linear equations of the hydrogen-containing natural gas pipeline network are collected. All unknown state variables at the nodes at both ends of the pipeline segment are arranged in order into a vector form. The coefficients of the corresponding variables in the linear equations of the hydrogen-containing natural gas pipeline network are extracted to form a Jacobian matrix. The constant terms on the right side of the equations are incorporated into the residual vector to obtain the transfer matrix equation of a single spatial pipeline segment. For complex hydrogen-containing natural gas pipeline networks with multiple branch intersections, a node constraint model is established based on the pipeline network topology and the mixing node deviation equations and the characteristics of components before and after mixing. The node constraint model includes node pressure balance equations, node mass flow balance equations, node component mixing equations, and node energy mixing equations.
5. The method for modeling a hydrogen-containing integrated energy system considering dynamic component tracking according to claim 4, characterized in that, The coupled equipment model in step S3 includes an electric-to-gas (EPG) converter and a gas generator set. The EPG converter is used to convert electrical energy into hydrogen and inject it into the hydrogen-containing natural gas pipeline network system. The electrical power consumed and the mass flow rate of the gas produced are determined by the efficiency of the EPG converter. The gas generator set is used to convert hydrogen-containing natural gas into electrical energy. The mass flow rate of the gas consumed and the active power generated are determined by the characteristic coefficient of the gas generator set. The energy flow solution model uses AC steady-state power flow equations to describe the operating state of the power system. The power system boundary conditions include node power balance constraints, upper and lower limits of generator active power output constraints, upper and lower limits of generator reactive power output constraints, and node voltage amplitude constraints.
6. The method for modeling a hydrogen-containing integrated energy system considering dynamic component tracking according to claim 5, characterized in that, The specific method for step S4 is as follows: The power system is treated as a fast-response subsystem, and the hydrogen-containing natural gas pipeline network is treated as a slow-dynamic subsystem. The time step of the slower hydrogen-containing natural gas pipeline network is used as the basic synchronization period for system state updates. A time-series matching and data exchange mechanism is established to exchange energy data of coupled equipment at the time boundaries of the two subsystems. The global convergence state of the two subsystems is determined by an alternating electric-gas method.
7. The method for modeling a hydrogen-containing integrated energy system considering dynamic component tracking according to claim 6, characterized in that, The timing matching and data exchange mechanism is as follows: the power system and the hydrogen-containing natural gas pipeline network are advancing synchronously, and the energy data exchange between the coupled devices is carried out at the time boundary with the slower step size of the hydrogen-containing natural gas pipeline network system as the basic period.
8. The method for modeling a hydrogen-containing integrated energy system considering dynamic component tracking according to claim 7, characterized in that, The specific method for determining the global convergence state of two subsystems using an alternating electric-gas iterative approach is as follows: In the first stage, the Newton-Raphson method is used to solve the nonlinear AC steady-state power flow equations of the power system, obtaining state variables such as node voltage, node phase angle, power consumption of the electric-to-gas conversion equipment, power generation of the gas generator set, and line power flow. The power consumption of the electric-to-gas conversion equipment and the power generation of the gas generator set are extracted, and using a coupled equipment model, the power is converted into the mass flow injection and mass flow of the hydrogen-containing natural gas pipeline network system nodes, thereby dynamically reconstructing and refreshing the flow boundary conditions of the hydrogen-containing natural gas pipeline network subsystem. In the second stage, the hydrogen-containing natural gas pipeline network system is dynamically solved. Based on the updated flow boundary conditions, the established transfer matrix equation is used to solve the hydrogen-containing natural gas pipeline network system, and the pressure, flow rate, temperature, and hydrogen composition distribution are iteratively updated using the Newton-Raphson method until the hydrogen-containing natural gas pipeline network system meets the internal convergence conditions. In the third stage, the global convergence is determined by the change in mass flow caused by the gas generator.