1 Introduction

Hydrogen plays a growing role in approaches for transforming the overall energy system. In particular, power-to-gas (PtG) plants, which can convert electrical power to hydrogen by means of electrolysis, are considered as an important ingredient for employing excess power from renewable ressources. Hydrogen can be injected to existing networks for transport of natural gas, or separate hydrogen networks could be used. However, such approaches need intense planning and optimization based on simulations for several reasons. Among them, impacts of injecting larger amounts of hydrogen to systems which were originally designed for transporting and compressing natural gas have to be analyzed thoroughly. One of these impacts might be less security. Hence, intense contingency analysis should be performed to estimate locations of probable failures and magnitudes of additional capacity needed.

Contingency analysis is widely used for electrical networks. A so-called \(N-1\) analysis is standard. For each of the N decisive components, impacts of its failout or breakdown are analyzed (based on simulation). \(N-k\) with \(k=2\) or even more would be better, but is often regarded as computationally too expensive, especially for networks with many elements.

For gas transport networks or coupled networks, a comparable analysis can be performed, but is not standard.

A certain simulation-free, very restricted variant, the so-called gas \(N-1\) standard of the EU Regulation, is necessary for assessing security of the gas supply of a European country. “The N-1 formula is used to estimate whether the gas infrastructure of the country or area of study has enough technical capacity as to satisfy the total gas demand in the event of disruption of the single largest gas infrastructure during a day of exceptionally high gas demand occurring with a statistical probability of once in 20 years” Rodríguez-Gómez et al. (2018). In Rodríguez-Gómez et al. (2018), it is discussed that a hydraulic simulation of the \(N-1\) scenario shall be used for assessing security, not only the \(N-1\) formula. Results for two neighboring (smaller) countries prove their proposition numerically.

For an overview of literature on contingency analysis for power grids, gas networks and coupled networks, see Sect. 2. To summarize findings, contingencies are modeled as outages of supply nodes or (certain) single network edges. Alternatively, an \(N-k\) problem with a low k is studied. To our knowledge, constructive approaches to set up multi-element contingencies, avoiding optimization, are not available for power as well as gas networks yet.

Distributors and collectors are not explicitly addressed in the literature. Within the typical graph representation of an energy network, such elements can be described by so-called supernodes. In particular for gas networks, they should be analyzed as well, as explained in Sect. 2.3.

In this paper, novel methods for contingency analysis based on topological reduction and so-called supernodes are introduced, among them CONT-S. They use stationary simulations, but are free of optimization, both for the time being. Novel features compared to available methods as mentioned above are

  • So-called supernodes are introduced as a way to determine a reasonable set of elements for an adapted \(N-1\) analysis as well as an analysis of multi-element contingencies. This way, not only the breakdown of one or just a few decisive components is analyzed, but all compressor stations, regulator stations, pressure and flow supplies, as well as distributors and collectors are taken into account.

  • Several measures and respective plots support an intuitive analysis.

  • Simulation is based on a full set of Euler equations including enthalpy, advanced compressor thermodynamics, and an accurate gas law, particularly allowing to analyze networks with up to 100\(\%\) hydrogen.

  • Even larger, realistic network models can be solved efficiently due to topological reduction methods.

The paper is organized as follows. After an overview on methods for contingency analysis of power, gas and some cross-sectoral scenarios in Sect. 2, modeling and simulation of gas transport networks as relevant for this paper are summarized in Sect. 3. TREERED is introduced in Sect. 4, the three new methods for contingency analysis, namely CONT-C, CONT-1 and CONT-S, in Sect. 5. A summary of the demonstrator used for testing the methods can be found in Sect. 6. To be more specific, based on the so-called partDE data set, a coarse version of a decisive part of the long-distance gas network of Western Germany, and an own study on existing PtG projects with (planned) injection of larger amounts of hydrogen, a demonstrator called partDE-Hy was recently assembled. In this paper, this demonstrator is used to present and discuss results of the methods developed. In particular, it is shown in Sect. 7 that the newly developed CONT-S method can estimate locations and magnitudes of additional capacities (injection, buffering, storage etc.) with a reasonable performance for networks of practical relevant composition and size. A new concept for contingency analysis is proposed at the end of Sect. 7. The paper closes with a summary and an outlook.

2 Energy networks and contingencies

The topology of a network for transporting power, water (drinking or sewage water, district heating or cooling) or gas is modeled by means of a graph. There are physical analogies between the fundamental through and across variables - current and voltage for power grids, flow and pressure (as well as temperature) for water and gas networks. Several analogies between decisive network elements can be found as well, see Table 1.

Table 1 Analogies of some typical node and edge elements between power, water and gas networks

Remarks: Prosumers and storages can be modeled as flexible generators or supplies, respectively. Resistors etc. might be modeled standalone or as part of other elements. Gas or water networks can contain heaters, coolers or heat exchangers, in addition. Note that there are elements which are modeled as subnets containing basic elements and/or subnets. For instance, a three-winding transformer can be formed by three two-winding transformers. A compressor station can be composed of one or more compressor machine units as well as resistors and valves; a compressor machine unit can consist of a compressor, drive, regulator(s), cooler, resistors, valves, and a regulator station of a heater, regulator, resistors, valves.

2.1 Power grids

Contingency analysis is widely used for power grids. Most often, at least TSOs (transmission system operators, i.e. entities entrusted with transporting energy on a national or regional level) are enforced to perform contingency analysis based on simulations. Note that contingency analysis is typically carried out for intermeshed networks only. Purely radial networks can obviously not fulfill an \(N-1\) criterion. Grids on national or regional level should be intermeshed. Distribution grids, however, might be radial only.

The principal arrangement and coverage of a contingency analysis for power grids depends on (super)national rules, see e.g.Footnote 1 and.Footnote 2 According to,\({^{1}}\) Articles 3 and 33, "‘contingency analysis’ means a computer based simulation of contingencies from the contingency list", "The contingency list shall include both ordinary contingencies and exceptional contingencies ...", "‘exceptional contingency’ means the simultaneous occurrence of multiple contingencies with a common cause", and "‘ordinary contingency’ means the occurrence of a contingency of a single branch or injection".

Such ordinary contingencies entering the contingency list are marked in Table 1. An \(N-1\) analysis is then based on such a list. According to,Footnote 3 the fulfillment of the respective " “\(N-1\)” [criterion] means that the grid shall be capable of experiencing outage of a single transmission line, cable, transformer or generator without causing losses in electricity supply. \(N-1\) takes no account of the probability of such outages, and fails to distinguish between which, and the magnitude of, areas that may be impacted by power losses."

Whether or not switches (and maybe other edge elements such as resistors) enter the list, is not specified. Transformers are typically included, see e.g. Hedman et al. (2010). For their \(N-1\) analysis, they take into account "the loss of any single element in the system: a transmission element or generator". Note that a transmission element is a line or transformer. However, several authors consider transmission lines only, see e.g. Wong et al. (2014) discussing a large American benchmark case.

There is critism of the \(N-1\) criterion, see e.g. Ovaere (2016): "the \(N-1\) criterion lacks transparency and flexibility, and ignores the economic trade-off between costs and benefits. Hence, scholars are developing reliability criteria that respond to these criticisms". Iver Bakken et al. (2020) discusses impacts of flexible resources in distribution systems on the security of electricity supply more generally. Probabilistic reliability criteria are developed and discussed in Sperstad et al. (2021), for instance.

Exceptional contingencies can be modeled as simultaneous outage of several elements or as a cascade of events. For instance, Abul’Wafa et al. (2019) considers \(N-1-1\) events. The so-called \(N-k\) problem asks whether there exists a set of k or fewer elements whose simultaneous outage will cause the system to fail. Many variants for solving this optimization problem can be found in the literature. For an overview, see Bienstock and Verma (2010) and Sundar et al. (2018). Other approaches are discussed as well. For instance, Mendes et al. (2010) solves contingency problems in distribution networks, which are radial due to the current switching configuration, by means of an optimization method for a reconfiguration via switching operations. Their number is only restricted by the network. However, an exact procedure to specify exceptional contingencies is not available.

2.2 Gas networks and cross-sectoral applications

Typical reasons for contingencies in gas networks are discussed in Groos et al. (2018) for Germany, showing that appropriate countermeasures have reduced the number of critical events due to corrosion or incidents at construction sites considerably. However, technical defects, extreme weather events as well as attacks have to be analyzed routinely. This is particularly true due to the ongoing integrations of gas and power networks. A survey on models for integrated power and natural gas networks coordination is presented in Farrokhifar et al. (2020).

Power-to-gas scenarios are a prominent example here. Both, hydrogen injections to networks for natural gas as well as pure hydrogen networks are discussed intensily. Müller-Syring and Henel (2014) analyzes tolerances of the infrastructure for hydrogen fractions of up to 10%. Wanzenberg et al. (2019) discusses a method for simulation of cracks in pipe segments and t-pieces. A review on hydrogen related degradation in pipeline steel can be found on Ohaeri et al. (2018).

Kwabena Addo et al. (2017) discusses coupled gas and power network simulation for the purpose of contingency analysis. A respective analysis is performed for two single elements, namely one compressor and one storage facility, of a small gas network with 25 nodes coupled to a modified IEEE 30-bus system. Chen et al. (2019) considers \(N-1\) contingencies w.r.t. electricity transmission lines only and presents a small benchmark case. More, similar methods for analyzing gas networks are available. Among them are methods such as Sayedab et al. (2019), Qiao et al. (2017), Rostami et al. (2020) for resiliently or securely operating integrated natural gas and power networks. For instance, Liua et al. (2020) discusses optimization of networks taking uncertainties into account.

The recent Ahumada-Paras et al. (2021) presents a method for so-called \(N-k\) interdiction modeling for natural gas networks, also motivated by applications integrating gas networks with power systems. They use “convex relaxations for natural gas flow equations to yield tractable formulations for identifying sets of k components whose failure can cause curtailment of natural gas delivery”.

To summarize, \(N-1\) is only applied to some most critical elements in case of gas networks (supplies, compressors) or the gas subsystem of a cross-sectoral application (supplies, compressors and gas-fired power plants). A constructive approach to set up multi-element contingencies for a gas network is not available yet.

2.3 Critical components of a gas network

Analogously to power grids, gas transport networks have a hierarchical structure. A country possesses at least one national grid with typically several regional and/or distribution grids coupled to it. For instance, in Europe, also the national gas networks are coupled to form a large European infrastructure.

Gas networks on the national level are intermeshed to a certain extend, similar to power grids. See Figs. 3 and 8 for an example. Realistic models of them should reflect this and also contain details of regional grids, either as more or less detailed network models or at least as demand nodes, possibly including the respective regulator station.

Typically, a regional or distribution model is coupled to a national model by means of (at least) one t-piece. A t-piece is modeled by means of a node with three edges attached to it. A grid might also possess other nodes with more than two edges attached to it.

One reason is its intermeshed structure. Important pipeline systems such as TENP (see Fig. 8) or MEGAL, both being part of the German gas grid and also present in the partDE demonstrator, possess two or three parallel threads which are interconnected at several places.

Also, compressor stations can possess such nodes. On long onshore pipelines, a compressor station is typically installed every 100 to 200 km. Such a station typically contains two or more compressor machine units in serial, parallel and/or mixed operation modes to achieve a sufficient performance and/or redundancy.

All nodes with more than two edges attached to them, regardless of flow direction, are called supernodes in this paper. The number of edges attached is called degree. Such nodes can be interpreted as collectors and/or distributors depending on the flow directions of the attached edges.

A contingency can now occur due to leaks (holes, cracks, ruptures), congestion or other blockages of pipes, t-pieces, larger distributors or collectors or malfunction of other network elements.

Supply nodes and compressor machine units are the most critical components, storages (if present) and regulators should be considered as well. In realistic models, their overall number is small compared to the number of elements. Damages to an edge of a supernode sufficiently close to this node might influence the whole supernode, in particular in case of leaks. Due to this and their special importance for coupling of different grid levels and building up the intermeshing, supernodes should be seen as critical network components as well.

Note that contingency analysis could simulate a leakage. However, the respective part of the network is assumed to be cut off in the literature cited above and also in this paper, analogously to typical analysis scenarios for power grids. In practice, a (considerably) larger part of the network might have to be disconnected by means of valves.

This gives rise to the question whether (more or less) all edges of non-radial parts should be considered for outage, as it is usually done for power grids (see Table 1). On the one hand, realistic gas network models can easily possess several ten thousands of elements nowadays (roughly half of it are edges). On the other hand, compressor machine units, regulator stations, supply nodes, supernodes and their principal connections already characterize a transmission network to a large extent. For realistic models, their number is considerably smaller than the number of edges. The connecting pipelines might "just" possess additional demands - directly modeled "on" the pipeline or at its end, see Fig. 1 for an illustration -, valves and/or flaptraps.

Fig. 1
figure 1

Different cases considered by TREERED: gray boxes indicate supply nodes or supernodes (with a degree \(\ge 3\) as shown in the box). A gray box with cyan filling indicates a supernode which is additionally a root for a tree-like structure. A cyan box marks a root of a tree which is upgraded to a supernode again

3 Modeling and simulation of gas transport networks

In the following, the fundamental equations modeling gas transport networks are described, and their numerical solution by our simulator MYNTS is outlined. Principally, any other simulator or optimizer suitable for long-distance gas transport networks might be employed for the contingency analysis introduced in this paper, among them the open-source pandapipes simulator.Footnote 4 However, if larger amounts of hydrogen are to be considered, a simulator offering a suitable gas law such as GERG2008 as well as an adequate modeling of compressors is needed, see below.

Also note that the topological reduction method TREERED introduced in Sect. 4 and employed for the contingency analysis discussed here is separate from potentially used reduction methods for speeding up simulations. For instance, methods described in Ríos-Mercado et al. (2002), Clees et al. (2018a), Baldin et al. (2020) could be used additionally, cf. Sect. 3.2.

3.1 Euler equations

The Euler equations are a system of nonlinear hyperbolic partial differential equations. In the stationary case and (one-dimensional) space x for gas flowing through a pipe, they read

$$\begin{aligned} \frac{1}{\partial x} \left( \rho v \right)&= 0 \end{aligned}$$
(1)
$$\begin{aligned} \frac{1}{\partial x} \left( p + \rho v^2 \right)&= -\frac{\lambda }{2D}\rho v|v|-g\rho h' \end{aligned}$$
(2)
$$\begin{aligned} \partial _x \left( \rho \left( \frac{1}{2}v^2+e \right) v+pv \right)&= -\frac{c_h}{d}(T-T_S) \end{aligned}$$
(3)

with \(\rho =\rho (x)\) being the density, \(p=p(x)\) the pressure, \(e=e(x)\) the specific energy, \(T=T(x)\) the temperature, and \(v=v(x)\) the velocity of the gas, \(h'=h'(x)\) the slope, \(D=D(x)\) the diameter, \(\lambda =\lambda (x)\) the friction coefficient, \(T_S\) the surface temperature (temperature of the soil, assumed to be constant here) and \(c_h=c_h(x)\) the heat transfer coefficient of the pipe w.r.t. its surroundings (weather-dependency neglected here), and g the constant of gravitation. Note that equation (3) can be reformulated in terms of the specific enthalpy \(h=e+p/\rho \).

An additional equation is necessary. In our case, it is a so-called gas law. AGA8-DC92 International Standard: ISO 12213-2 (2016) is often used in simulation software and can be used for typical compositions of natural gas with some constraints. For our purposes, the most important ones are: a minimum of 70\(\%\) methane and a maximum of 10\(\%\) hydrogen is allowed. Nowadays, GERG2008 Kunz and Wagner (2012) is the most accurate gas law and can be used for all compositions of the 21 typical components of natural gas including compositions with up to 100\(\%\) hydrogen. It has a much more complex description then AGA8-DC92. Here, z is modeled based on the Helmholtz free energy, split into parts for ideal gas and residual fluid. A large amount of measurement data for different combinations of gases is used to fit the considerable number of coefficients. See Kunz and Wagner (2012) and ISO 20765-2/3 for details. GERG2008 (or at least one of its predecessors) is used in a few (commercial) software products already, among them MYNTS. Clees et al. (2021a) shows that it should be used instead of AGA8-DC92.

Kirchhoff’s laws are used for connecting the components of the network (pipes, compressors, regulators, valves, heaters, coolers, etc.).

Sources (supplies) and sinks (demands) are necessary to complete the system. At one or more nodes, input pressure, gas temperature and composition are prescribed (pressure supplies), and consequently at at least one, but typically many nodes power output is prescribed (flow demands). One can additionally allow for supplies with prescribed power input and gas composition (flow supplies). For more details on modeling gas transport networks and their components, see Domschke et al. (2017) and the references given therein.

3.2 MYNTS software

For simulation and analysis of gas networks, we develop a (commercial) software called MYNTS. It has been compared to a widely used simulator intensively. In particular, we developed a theoretical background (see Clees et al. (2018b) for basics and Clees et al. (2018a) for compressors) which guarantees existence and uniqueness of solutions in relevant situations and a corresponding numerical method, employing IPOPT and an own nonlinear solver. For speeding up simulations, topological reduction methods are available Clees et al. (2018a), Baldin et al. (2020), and model-order techniques are investigated (see e.g. Grundel et al. (2014)). They can be used in addition to TREERED.

MYNTS solves (stationary as well as instationary) Euler equations with advanced models for compressor thermodynamics and mixing of currently 21 gas components. As discussed in Clees et al. (2021b, 2021a), MYNTS uses a semi-coupled approach; isothermal Euler equations, namely eqs. (1) and (2) and the GERG2008 gas law are iterated with equation (3), taking the spatially (and temporally) resolved gas composition \(\xi \) and temperature changes into account. As discussed in Clees et al. (2021a), compressor map shifting is used to model the dependency of characteristic maps from \(\xi \).

4 TREERED-a method for topological reduction

In order to determine meaningful supernodes and, at the same time, clean up the network to be analyzed, a novel method for topological reduction is developed and built into MYNTS. It preserves simulation results of the respective scenario (mass-conservative), but represents the scenario with fewer nodes and edges. In particular, radial parts that serve for pure gas delivery purposes, are collapsed. This method called TREERED, is described in the following. Necessary terms and definitions are summarized first.

4.1 Basic graph-related terms and definitions

In MYNTS, a gas network is modeled as a directed graph \({\mathcal {G}} = ( {\mathcal {N}}, {\mathcal {E}} )\) of its elements, namely nodes \({\mathcal {N}}\) and edges \({\mathcal {E}} \subseteq \{ (x,y)\,|\, (x,y) \in {\mathcal {N}}^2 \text { and } x\ne y \}\). Directions are discussed below. Note that mixed graphs (with directed and undirected edges) could be used alternatively. This is not discussed here.

Pipes, compressors, regulators, resistors, valves, shortcuts, flaptraps, heaters and coolers are modeled as edges. The set of nodes consists of supplies, demands and inner nodes.

MYNTS allows for a hierarchical representation. Subnets can be set up. They can contain basic elements as mentioned above and, in addition, already defined subnets. A compressor station is a subnet and consists of basic elements (for describing all routes) and (compressor) machine units. A regulator station is a subnet and consists of basic elements (for describing all routes) and regulator units. Machine units (one compressor with its drive and cooler, valves, etc.) and regulator units (one heater, one regulator, etc.) are subnets consisting of basic elements only.

In the following, we assume that stations are resolved one step, so that the set of edges consists of machine units, regulator units, pipes, resistors, valves, shortcuts, and flaptraps only.

Let the subset \({\mathcal {E}}_u \subseteq {\mathcal {E}}\) consist of all pipes, resistors, valves and shortcuts and \({\mathcal {E}}_d \subseteq {\mathcal {E}}\) of all other types of edges considered here, i.e. machine units, regulator units, and flaptraps. The direction of all edges in \({\mathcal {E}}_u\) can be chosen arbitrarily, but their specification is necessary for interpreting the sign of flow values. The direction of all edges in \({\mathcal {E}}_d\) has to be modeled in the technically meaningful way, i.e. from inlet to outlet.

In addition, each element possesses properties. For the following, states of machine units, regulator units and valves are important. For a description of TREERED, it is sufficient to distinguish between “closed” and “open” (not closed). Let \({\mathcal {E}}_i \subseteq {\mathcal {E}}\) consist of all machine units, regulator units and valves with closed state each (inactive edges). Then, \({\mathcal {E}}_a := {\mathcal {E}} \setminus {\mathcal {E}}_i \) denotes the set of “open” (i.e. non-inactive) edges, and \({\mathcal {G}}_a := ( {\mathcal {N}}, {\mathcal {E}}_a )\) the graph with open edges only.

\(\tilde{{\mathcal {G}}} := ( {\mathcal {N}}, \tilde{{\mathcal {E}}} )\) extends the original set of edges so that all physically meaningful flow directions are represented, i.e.

$$\begin{aligned} \tilde{{\mathcal {E}}} = {\mathcal {E}} \cup \{ (x,y) \,|\, (y,x) \in {\mathcal {E}}_u \} \end{aligned}$$
(4)

Analogously, \(\tilde{{\mathcal {G}}}_a := ( {\mathcal {N}}, \tilde{{\mathcal {E}}}_a )\) with

$$\begin{aligned} \tilde{{\mathcal {E}}}_a = {\mathcal {E}}_a \cup \{ (x,y) \,|\, (y,x) \in ( {\mathcal {E}}_u \setminus {\mathcal {E}}_i ) \} \end{aligned}$$
(5)

A path \({\mathcal {P}}(n,m,{\mathcal {N}},\tilde{{\mathcal {E}}})\) is a connected subgraph of \(\tilde{{\mathcal {G}}}\) with non-recurring \(k>1\) nodes and \(k-1\) edges so that the nodes can be listed in an order \(n_1, n_2, ... , n_k\) with \(n=n_1\) and \(m=n_k\) such that the edges are the \((n_i, n_{i+1}) \in \tilde{{\mathcal {E}}}\) where \(i=1,2,...,k-1\). Analogously, a path of \(\tilde{{\mathcal {G}}}_a\) is defined. It is also called an open path of \(\tilde{{\mathcal {G}}}\).

Let \({\mathcal {C}}_n({\mathcal {V}}) := \{ \{x,y\} \,|\, (x,y)\in {\mathcal {V}}\text { and } (n=x \text { or } n=y)\}\) denote the set of “edges treated without direction” (i.e. direction is removed, and edges of \({\mathcal {E}}_u\) are not counted twice) attached to a node n w.r.t. a set \({\mathcal {V}}\) of edges. The degree of a node n w.r.t. \({\mathcal {V}}\) is \(|{\mathcal {C}}_n({\mathcal {V}})|\) then.

4.2 Important definitions for TREERED

  • Dead parts do not have a topological connection w.r.t. \(\tilde{{\mathcal {G}}}\) to a pressure supply. To be more specific: An edge e (a node n) is called dead if \(\tilde{{\mathcal {G}}}\) does not possess a path containing e (n) starting from a pressure supply.

    Note that a flow supply would not be enough to feed a connected component of \(\tilde{{\mathcal {G}}}\) since pressure would not be defined for that part.

    Here, the state of an element is ignored, i.e. if there is a connection via a closed valve etc., the part is not dead. In practice, simulation models can contain dead parts, even if they are (currently) useless for simulation. Typically, this happens during the step-by-step extension or reconfiguration of a model.

  • Inactive parts are not dead, but cut off from pressure supplies w.r.t. \(\tilde{{\mathcal {G}}}_a\) due to closed valves, regulator or machine units. In other words: they cannot be reached via open pathes starting from pressure supplies.

    To be more specific: An edge e (a node n) is called inactive if it is not dead, but \(\tilde{{\mathcal {G}}}_a\) does not possess a path containing e (n) starting from a pressure supply.

  • A (directed rooted) out-tree structure \(({\mathcal {N}}_T,{\mathcal {E}}_T)\) with \({\mathcal {N}}_T \subseteq {\mathcal {N}}\) and \({\mathcal {E}}_T \subseteq \tilde{{\mathcal {E}}}_a\) denotes a connected subgraph of \(\tilde{{\mathcal {G}}}_a\) which fulfills the following property:

    $$\begin{aligned} \exists \, n_r\,\in \,\mathcal {N_T}\quad \forall \, n\,\in \,{\mathcal {N}}_T,\, n\ne n_r \quad \exists ! \,P(n_r,n,{\mathcal {N}}_T,{\mathcal {E}}_T) \end{aligned}$$
    (6)

    This node \(n_r\) which can act as as the starting node of unique pathes to each other node is called a root. The root might not be unique.

  • A radial end denotes an out-tree structure of \(\tilde{{\mathcal {G}}}_a\) with a root \(n_r\) and a set of edges \({\mathcal {E}}_{T}\)

    $$\begin{aligned} \forall \, n\in {\mathcal {E}}_T,\,n\ne n_r \quad {\mathcal {C}}_n({\mathcal {E}}_{T}) = {\mathcal {C}}_n({\mathcal {E}}_a) \end{aligned}$$
    (7)

    Note that \({\mathcal {C}}_n({\mathcal {E}}_a)={\mathcal {C}}_n(\tilde{{\mathcal {E}}}_a)\) for all nodes \(n\in {\mathcal {N}}\). Hence, only the root is allowed to have connections to the remainder of \(\tilde{{\mathcal {G}}}_a\). Note that if such connections are cut from \(n_r\), the radial end does not necessarily become an out-tree since it can possess edges belonging to \({\mathcal {E}}_u\), i.e. the physically undirected edges. In practice, such edges are most often pipes.

  • A simple radial end (SRE) denotes a radial end of \(\tilde{{\mathcal {G}}}_a\) which does not contain machine units, regulator units, and supplies (of all kinds). In other words, a SRE is a part of the network for radial gas delivery and/or with blind alleys.

4.3 An algorithm for constructing radial ends

An out-tree structure cannot possess loops. Therefore, end nodes \(n_e\) of the longest possible pathes \(P(n_r,n_e,{\mathcal {N}}_T,{\mathcal {E}}_T)\) have a degree \({\mathcal {C}}_{n_e}({\mathcal {E}}_T)=1\). Vice versa, radial ends and their roots can be constructed by the following algorithm starting with such end nodes:

  1. 1.

    Set \(k=0\) and \(\tilde{{\mathcal {E}}_a}^{(0)}:=\tilde{{\mathcal {E}}_a}\).

  2. 2.

    Start from nodes \(n_e\) with a degree of 1 w.r.t. \(\tilde{{\mathcal {E}}_a}^{(k)}\), and travel back to the starting node \(n_s\) of the only edge \((n_s,n_e)\) connected to it.

  3. 3.

    Remove all such edges \((n_s,n_e)\) and also \((n_e,n_s)\), if it belongs to \(\tilde{{\mathcal {E}}}_a\) as well, from the graph to construct \(\tilde{{\mathcal {E}}_a}^{(k+1)}\).

  4. 4.

    Increase k by 1.

  5. 5.

    Determine nodes with degree 1 w.r.t. this new set of edges \(\tilde{{\mathcal {E}}_a}^{(k)}\). Only the \(n_s\) are candidates for such nodes.

    • For all \(n_s\) with a degree of 1, continue with step 2.

    • If \(n_s\) does not have a degree of 1, it is a root.

  6. 6.

    This iterative process stops at a set \(\tilde{{\mathcal {E}}_a}^{(k_e)}\) if all of its nodes do not have a degree of 1 w.r.t. \(\tilde{{\mathcal {E}}_a}^{(k_e)}\).

Depending on the actual implementation, it is sufficient to mark respective edges and nodes for deletion and treat them appropriately during the algorithm.

The radial ends of \(\tilde{{\mathcal {G}}}_a\) start at the roots found during the algorithm. In a natural way, this algorithm can be restricted to find SREs only.

4.4 TREERED algorithm

TREERED removes dead and inactive parts and collapses simple radial ends. To be more specific:

  1. 1.

    Determine all dead and inactive parts of \(\tilde{{\mathcal {G}}}\), and mark them for deletion.

  2. 2.

    Collapse all SREs of \(\tilde{{\mathcal {G}}}_a\) by marking respective edges and nodes for deletion, and aggregate all demands on the fly. For that purpose, the algorithm sketched in Sect. 4.3 has to be extended in its step 3: The aggregated power demand is stored as an additional property of this node. If the root is a supply or demand itself, this aggregated value is the surplus from the respective SRE.

  3. 3.

    Create a new network (with a graph \({\mathcal {K}}\) along with properties of its nodes and edges) by copying only the nodes and edges of the original \({\mathcal {G}}\) which have not been marked for deletion.

  4. 4.

    Check each of the roots \(n_r\) found above: if its aggregated power value is nonzero, compute its degree \(|{\mathcal {C}}_{n_r}({{\mathcal {E}}}_a)|\) w.r.t. the original set of edges, and store this number as a property of the node. It is used later on for a possible update of this node to a supernode. See Fig. 1 for an illustration: three nodes are marked as a supernode, one (upper left) not.

Note that the above algorithm can be modified for ensembles and/or time-dependent runs by determining edges which are open in at least a part of the simulation runs of the ensemble and/or the time. Activate them all temporarily, and run TREERED to obtain a basic reduction which can be used for all runs planned. For the specific simulation runs / during the time progression, the states of the edges are reset if necessary.

4.5 Remarks on solutions of original and TREERED-compressed networks

For instance, Ríos-Mercado et al. (2002), Clees et al. (2018a, 2018b) contain proofs that a gas network simulation model (at that time with fixed temperature and composition), with a prescribed pressure and one or more flow demands has a unique solution (which might be infeasible physically). In Clees et al. (2018a, 2018b), it is also described how this can be employed to reduce tree-like substructures of a network to arrive at equivalent, but shorter network models with an explicit reconstruction process for solution values of the reduced parts. Baldin et al. (2021) extends all findings of Clees et al. (2018a, 2018b) to cases with advanced compressor modeling and changing temperature and gas compositions and describes a constructive solution approach, implemented in MYNTS. Note that solutions might be physically infeasible. They have negative pressure values for some parts of the network then and can be classified easily.

Consequences for TREERED are as follows:

  • TREERED is a loss-free compression, it does not alter the simulation results. In particular, if the overall model has a unique solution, the reduced network provides the same solution.

  • After TREERED, a detailed analysis of pressure distributions behind root nodes is not possible directly. However, after a simulation with a TREERED-tackled network, for all tree-like substructures, flow values can be computed starting from the final nodes of the leaves. Vice versa, starting from its root node, pressure drops along the leaves of the tree can be computed then.

  • Respective simulations for the trees can be performed in parallel in order to compute the missing details (not considered in this paper).

Note that simulation scenarios with non-unique solutions can exist in practice, particularly for large models. In such a case, a simulation result after TREERED can differ from results for the original model by more than round-off differences. Results of a successful simulation run will particularly satisfy pressure/flows at pressure/flow supplies and flows at demands, but flow-shifts in one or more parts of the network can appear.

5 Contingency analysis

Contingency analysis comprises an ensemble of scenarios which are analysed and/or simulated. For each member of the ensemble, one or more elements are “destroyed” (here: deleted from the network) prior to the analysis/simulation step and restored afterwards. Classically, such elements comprise compressor machine units and important supply nodes at least, as discussed in Sect. 2.3.

In the following, three methods for contingency analysis are presented. All are extensions or adaptations of the classical procedure. All work with a list of nodes \({\mathcal {N}}_0\) \(\subseteq {\mathcal {N}}\) as well as a list of edges \({\mathcal {E}}_0\) \(\subseteq {\mathcal {E}}\).

For the methods described in the following, the list of edges contains compressor machine units, regulator units, valves, pipes, resistors, shortcuts, and flaptraps. Hence, compressor stations and regulator stations are resolved one step as for TREERED.

5.1 CONT-C: a classical method for \(N-1\) contingency analysis

This method extends the concept described in the few \(N-1\) methods seen for gas networks so far (see Sect. 2.2). There, compressor machine units and important supply nodes are considered. CONT-C is based on that. It adds regulator units, all pressure supply nodes, and those flow supply nodes for which the estimated averaged supply exceeds a threshold \(\tau _P\). Here, \(\tau _p = \) 500 MW. To be more specific, CONT-C proceeds as follows:

  1. 1.

    set up \({\mathcal {N}}_0\)  from all pressure supply nodes, and the flow supply nodes with an estimated averaged supply above the threshold.

  2. 2.

    set up \({\mathcal {E}}_0\)  from all compressor machine units and regulator units, and all edges connected to a node from \({\mathcal {N}}_0\).

  3. 3.

    in parallel: ensemble simulation based on \({\mathcal {E}}_0\):

    1. (a)

      for each edge of \({\mathcal {E}}_0\), one ensemble member is created by deleting the respective edge from the original scenario (which is not changed during the process)

    2. (b)

      perform simulation for this ensemble member

  4. 4.

    collect simulation results and compute residuals to supply and demand settings for original scenario

  5. 5.

    visualize and analyze (see Sect. 5.5)

CONT-C can be applied to all networks. An application after TREERED (and/or other reduction methods) speeds up the process. A detailed analysis of the collapsed tree structures could then be performed as indicated in Sect. 4. However, in most cases, it is sufficient to analyze the aggregated power demand values, see Sect. 5.5.

5.2 CONT-1: an adapted method for \(N-1\) contingency analysis based on supernodes

The CONT-1 method extends CONT-C. Here, TREERED is a prerequisite to form the scenario to work with: the network is cleaned from unwanted parts, and particularly pure distribution trees are excluded - this includes their inner supernodes which would be meaningless for a contingency analysis. Remaining supernodes then represent branches to distribution trees, the intermeshed structure, and compressor-station complexity (see also Sects. 2.3 and TREERED).

For each node, its degree \(n_g\) is calculated. If this number is higher or equal to k, the node is regarded as a supernode of degree \(n_g\) and enters \({\mathcal {N}}_0\). Here, we use \(k=3\). Note that original degrees of roots, as stored by TREERED, are taken into account in all CONT-methods presented here.

This way, all nodes acting as distributors or collectors (depending on the flow direction) are considered. In addition, all flow supply nodes are considered now (\(\tau _P=0\)) and enter \({\mathcal {N}}_0\)  as well.

With the respective \({\mathcal {N}}_0\), CONT-1 can proceed analogously to CONT-C, steps 2 to 5. Obviously, the ensemble is (much) larger, but also more realistic compared to CONT-C, since supernodes (distributors/collectors) can be regarded as critical infrastructure as well, as explained in Sect. 2.3. However, just a single edge connected to a supernode is taken out at a time. Overall, CONT-1 is still an \(N-1\) method.

The result of the supernode computation for a simple case is shown in Fig. 1. In Sect. 6, results for the demonstrator are presented and discussed.

5.3 CONT-S: supernode contingency analysis

As CONT-1, the CONT-S method focusses on supernodes, supplies, compressor machine units and regulator units. Again, a topological reduction as provided by TREERED is a prerequisite to form the scenario to work with (called RED-scenario below).

However, the princple idea differs from CONT-1. As explained in Sect. 2.3, supernodes are reasonable candidates for multi-element contingencies. More specifically, CONT-S focusses on complete outages of four types of nodes, namely supernodes and supplies, as well as inlet nodes of compressor machine units and regulator units.

To be more specific, CONT-S proceeds as follows:

  1. 1.

    set up \({\mathcal {N}}_0\) from all supernodes and all pressure and flow supplies.

  2. 2.

    Add the inlet nodes of all compressor machine units and regulator units to \({\mathcal {N}}_0\).

  3. 3.

    in parallel: ensemble simulation based on \({\mathcal {N}}_0\):

    1. (a)

      for each node n of \({\mathcal {N}}_0\), set up its \({\mathcal {E}}_n\) by finding all edges connected to this node.

    2. (b)

      one ensemble member is created by deleting all edges of the current \({\mathcal {E}}_n\) from the RED-scenario

    3. (c)

      perform simulation for this ensemble member

  4. 4.

    collect simulation results and compute residuals to supply and demand settings for original scenario

  5. 5.

    visualize and analyze (see Sect. 5.5)

5.4 Overview on the three CONT methods

Table 2 summarizes the edges that are considered in the contingency methods discussed in this paper.

Table 2 Consideration of network edges and outages in the contingency methods

5.5 Visualization and analysis

For an analysis, several measures have to be computed from the simulation results. Let \(n_s\) denote the number of ensemble members and, hence, simulation runs. Then, the aggregated \(r_{agg}\) and maximum power residuals \(r_{max}\) at a node n are defined as follows for each nonzero demand or flow supply

$$\begin{aligned} r_{agg}(n)&= \sum _{k=1\dots \,n_s} \left| P_k(n) - P_{set,k}(n) \right| \end{aligned}$$
(8)
$$\begin{aligned} r_{max}(n)&= \max _{k=1\dots \,n_s} \left| P_k(n) - P_{set,k}(n) \right| \end{aligned}$$
(9)

with \(P_k(n)\) being the power output and \(P_{set,k}(n)\) the power demand at node n for run k. Note that negative values are used for flow supplies, consequently.

Note also that in case of a non-negative difference \(P_k(n) - P_{set,k}(n)\), the respective demand or supply was not over-fulfilled, i.e.

$$\begin{aligned} |P_k(n)| \le |P_{set,k}(n)| \quad \text {and}\quad P_k(n)\cdot P_{set,k}(n) \ge 0 \end{aligned}$$
(10)

Now, the last step of the CONT methods proceeeds as follows:

  1. 1.

    set up a network with all nodes from \({\mathcal {N}}_0\) and (global) \({\mathcal {E}}_0\) deactivated

  2. 2.

    compute the connected parts of this network, and assign each part a center; for the position of a center, the mean values of x- and y-coordinates of the nodes are used

  3. 3.

    for each center c, initialize \(c_{agg}(c)=0\) and \(c_{max}(c)=0\)

  4. 4.

    calculate aggregated and maximum power residuals at all flow supply and demand nodes:

    1. (a)

      for each node n in \({\mathcal {N}}_0\),

      1. i.

        compute \(r_{agg}(n)\) and \(r_{max}(n)\)

      2. ii.

        and visualize at the coordinates of n, here by means of a light blue circle with a suitable radius

    2. (b)

      for all other nodes n,

      1. i.

        find the center c(n) of n

      2. ii.

        compute \(r_{agg}(n)\) and \(r_{max}(n)\)

      3. iii.

        add it to \(c_{agg}(c(n))\) and \(c_{max}(c(n))\), respectively

  5. 5.

    all aggregated values are divided by the number of simulation runs (see also below!)

  6. 6.

    for each center c, visualize \(c_{agg}(c)\) and \(c_{max}(c)\) at the respective coordinates of center c, here by means of a light orange circle with a suitable radius

For deeper insights, this analysis differentiates between successful and failed simulation runs. For a combination of a scenario and a method, the following compilation of four plots is useful:

  • Plot1: aggregated and Plot2: maximum residuals for successful runs

  • Plot3: aggregated residuals and Plot4: location of failed runs

Location refers to the leading supernode or element of the respective simulation run. Note that there are two categories of failed runs in MYNTS:

  • There are situations were the numerical solution does not fulfill some bounds of compressors or regulators or some local residuals up to the specified numerical tolerance, but up to a less restrictive tolerance. They are not completely failed and depicted with yellow circles below (warnings).

  • In the remaining failed cases, red circles are used (errors).

6 partDE-Hy demonstrator

6.1 The partDE-Hy topology and scenario basics

Based on TUB-ER: partDE data set (2019) and power-to-gas (PtG) projects with a planned injection of larger amounts of hydrogen, a first demonstrator called partDE-Hy was assembled by Clees et al. (2021b) for analyzing gas networks with hydrogen injection.

The partDE data set is a coarse version of a decisive part of the long-distance gas network of Western Germany (cf. the public dashboardFootnote 5 and map of OGEFootnote 6). Compared to Clees et al. (2021b), the topology has been extended in Clees et al. (2021a) by publicly available data (websites of TSOs); several hydrogen injection points have been added, and realistic transient scenarios (for the granularity considered here) have been developed. Currently, it contains 1204 elements (nodes plus edges), including 25 compressor machine units. See Table 3 and Fig. 2 for the version used in this paper.

Fig. 2
figure 2

The partDE-Hy network (in green) with larger power-to-gas projects (cyan) and hydrogen supply nodes (blue, brown)

6.2 The BA and HY scenarios

In order to calculate effects of hydrogen injection, realistic input profiles are necessary. Given the current granularity of the partDE-Hy network, it seems appropriate to estimate an input profile for the 11 federal states of Germany close to the network (see Fig. 3). Transient profiles for all federal states of Germany are derived by the method introduced in Clees et al. (2021a), based on publicly available data from 50Herz Transmission GmbH, Amprion GmbH, TenneT TSO GmbH, TransnetBW GmbH (2019), Fraunhofer-Institut für Solare Energiesysteme ISE (2020), BDEW Bundesverband der Energie- und Wasserwirtschaft e.V. (2017), Föderal Erneuerbar (2019), Deutsche Energie-Agentur (2019). Since analysis is based on stationary scenarios here, for each transient profile an estimated average is used:

Base scenario (S-BA) For each hydrogen injection node for a federal state, a low value is used as described in Clees et al. (2021b). Eemshaven and Elten have a fixed flow supply of 1000 MW each. The injection setup is depicted in Fig. 4 (left). The MYNTS simulation model for the BA scenario is shown in Fig. 3. This scenario shall demonstrate distribution of hydrogen in case of a low to moderate injection mainly from two realistic locations. Here, it represents a moderate case for contingency analysis since gas injection, composition, temperatures etc. vary moderately.

Scenario with more hydrogen (S-HY) For each hydrogen injection node, its power average over a day is calculated for the “Average Saturday in Winter” profile, see Clees et al. (2021a). Eemshaven and Elten have a fixed flow supply of 5000 MW each. The injection setup is depicted in Fig. 4 (right). This scenario shall demonstrate distribution of hydrogen in case of a moderate to high injection with a realistic magnitude and direction, mainly from North to South. Here, it represents a more challenging case for contingency analysis due to the larger amount of injection nodes and amounts.

Fig. 3
figure 3

The partDE-Hy network, its three pressure supplies (orange) and flow supplies (injection of hydrogen) per federal state of Germany, Eemshaven and Elten with a simulation result for S-BA. Color depicts the local hydrogen fraction according to the color bar

Fig. 4
figure 4

Location and magnitude of flow supplies (light green circles) and demands (light blue circles) for S-BA (left) and S-HY (right). The underlying network was created from TREERED, see Sect. 4

7 Numerical results

With CONT-C, consequences of breakdowns of the most important elements of a network can be analyzed. However, with an increasing amount of volatile gas sources - whether this will be hydrogen or methane injected to a pure hydrogen network, a network on a transition path or a pure methane network -, more points of failure have to be analyzed. CONT-1 and, moreover, CONT-S shall provide a basis. In the following, this is demonstrated by means of the partDE scenarios described in Sect. 6.

For the original network and its base scenario (“orig BA”) as well as the network after TREERED with the BA and the HY scenarios, all three CONT methods explained above are applied. Runs with “orig BA” are mainly performed to compare run times and compute speedup factors. Afterwards, the BA and HY scenarios are compared in more detail in order to find weaknesses and estimate locations and magnitudes of additional capacities (injectors, buffers, storages).

7.1 TREERED

Statistical results of TREERED applied to partDE-Hy are shown in Table 3. A comparison of the topologies and simulation results for the original partDE-Hy and the reduced net for the base scenario can be found in Figs. 5 and 6. Since the original simulation scenarios have a unique solution each, simulation results are the same up to numerical tolerance, as explained in Sect. 4. See also Table 4. Run times are compared in Table 5.

Table 3 Number of elements before and after TREERED
Fig. 5
figure 5

Simulation results for the partDE-Hy base scenario. Absolute power values are shown

Fig. 6
figure 6

Simulation results for the partDE-Hy base scenario after topological reduction with TREERED. Absolute power values are shown

7.2 Supernodes

The result of the supernode computation is shown in Fig. 7. Especially on the TENP (large part to Switzerland, see also Fig. 8), one can see many supernodes of degree 3 and, on top of it, some of degree 4, due to the highly intermeshed structure of this two-thread pipeline system. One might think that such supernodes would add too many elements to \({\mathcal {E}}_0\). However, asFootnote 7 summarizes, starting in 2017 and planned to end in September 2020, several problematic parts of the TENP had to be switched off (not all at a time though). Problems were due to corrosion resulting from insufficient, old coating (cf. Sects. 2.2 and Groos et al. (2018)). As a consequence, capacity on the TENP was reduced by a factor of around 50\(\%\). A more detailed analysis of all possible fail-outs has been asked for. As explained in Sect. 2.3, supernodes provide a basis for that.

Table 4 Numerical differences of simulation results before and after TREERED for the partDE-Hy base scenario
Fig. 7
figure 7

Supernodes: (left) location and number of edges \(n_g\) (degree) attached, (right) corresponding histogram for the degrees

Fig. 8
figure 8

Top part of TENP (large part on the bottom of partDE-Hy to Switzerland), topologically deskewed and rotated to the left

7.3 Comparison of performance

Performance of the methods is shown in Table 5 and Fig. 9. Obviously, CONT-1 needs significantly more runs than CONT-C, but CONT-S considerably reduces this again. Overall, even without any parallelization, the methods are efficient enough. TREERED speeds up each method considerably. One should note that the network considered has already a relevant constitution and size for practical purposes.

Table 5 Run times (median, mean, overall), number of runs overall and failed runs \(n_f\) as well as speedup factors for the scenarios and methods
Fig. 9
figure 9

Overall run times in comparison for the three scenarios and methods

Fig. 10
figure 10

CONT-C: elements of failed runs for (left) S-BA and (right) S-HY

7.4 Rough analysis with CONT-C

For S-BA and S-HY in combination with CONT-C, only locations of failed runs are visualized in Fig. 10 since they are only a part of CONT-1 results. A comparison of locations already gives rough guidelines though: it can already be seen for CONT-C, that the HY scenario is much more demanding than the BA scenario with its much smaller hydrogen injections.

The largest gas supply of both scenarios is located in the North and (together with the two hydrogen injectors) responsible for the large security of the BA scenario.

The HY scenario suffers from much larger variations due to the considerable hydrogen injection. Even if the sum of input power from hydrogen injectors (cf. Fig. 4) covers just a part of the overall power demands of HY, the gas composition varies already substantially, because calorific values of hydrogen (ca. 3.5 kWh/Nm\(^3\)) and e.g. methane (ca. 11.0 kWh/Nm\(^3\)) differ substantially. As a consequence, pressure drops, temperature and velocity changes are larger, for instance. Moreover, compressors are not able to reach pressure ratios of more than 1.04 in case of hydrogen, whereas they can reach around 1.4 (1.7) in case of natural gas (methane) Rimpel et al. (2019), Clees et al. (2021a).

Fig. 11
figure 11

S-BA, CONT-1: (top left) aggregated, (top right) max. power residual for successful runs, (bottom left) aggregated power residuals for and (bottom right) failed runs

Fig. 12
figure 12

S-BA, CONT-S: (top left) aggregated, (top right) max. power residual for successful runs, (bottom left) aggregated power residuals for and (bottom right) failed runs

Fig. 13
figure 13

S-HY, CONT-1: (top left) aggregated, (top right) max. power residual for successful runs, (bottom left) aggregated power residuals for and (bottom right) failed runs

Fig. 14
figure 14

S-HY, CONT-S: (top left) aggregated, (top right) max. power residual for successful runs, (bottom left) aggregated power residuals for and (bottom right) failed runs

7.5 More detailed analysis

For S-BA and S-HY in combination with CONT-1 and CONT-S, results are visualized as explained above in Figs. 11121314. Results clearly reveal the larger security of BA compared to HY. Since a transition from BA to HY demonstrates a possible future scenario, countermeasures shall be discussed exemplarily. Usage of CONT-1 and CONT-S is compared for this task.

As can be seen from Figs. 11 and 12 for the BA scenario, the locations of failed runs are roughly contained (geographically) in the larger set produced by CONT-S. Small deviations are present, in particular for scenarios ending with a warning (yellow). Analogously, this is true for the HY scenario, see Figs. 13 and 14. In addition, CONT-S estimates a few more severe runs compared to CONT-1. Both effects are to be expected since a failout of a complete supernode should have a bit different and more severe consequences.

While the locations of failed runs indicate zones with higher need of action, the residuals quantify sensitivity of regions. Maximum residuals for successful runs provide “worse”-case data for the failouts considered - the worst case would be shown by data from the failed runs. However, they cover the whole supply scenery for CONT-1 and CONT-S, and just serve as an overview of the scenario (cf. Fig. 4).

The two remaining plots visualize aggregated residuals for successful and failed runs. They estimate probability of missing power supply at the respective location. Maxima of both estimate magnitude of additional capacities. Such values can be used for determining priority of actions as well. CONT-S estimates higher values compared to CONT-1 and should be favored for such tasks.

Solutions might be provided by additional sources or storage facilities or other extensions/changes of the network. Note that linepack buffering might already help, but need transient analysis. In the scenarios, BA should obtain additional capacities first in the South on the TENP, then on the MEGAL (connecting France and the Czech Republic), whereas HY should obtain additional capacities in the South and North (more or less) simultaneously, before additional actions on the MEGAL and other locations in between shall be considered.

7.6 A concept for TSOs

All CONT-methods have their range of applicability:

  • CONT-C allows a quick analysis of the most critical elements of a gas network.

  • CONT-1 provides a realistic subset of \(N-1\) contingencies due to the introduction of supernodes (after TREERED). Note that a consideration of all network elements for the contingency list is computationally too expensive for realistic network models and not necessary - just a few demands, valves, flaptraps might be left over in between the critical elements of the contingency list. It seems most efficient to add them manually to the list.

  • CONT-S is computationally considerably more efficient and allows for analyzing multi-element contingencies. As argumented in the paper, these should be more realistic compared to single-edge outages, at least for transmission gas networks considered here. Heuristically, one can see that both methods find a comparable set of most problematic network locations. Therefore, CONT-S should be preferred.

Note that even CONT-C for the partDE-scenarios reveals critical cases. Therefore, partDE does not even fulfill the \(N-1\) criterion. For gas networks, it is currently not enforced and might be problematic economically (cf. also criticism of \(N-1\) for power grids indicated in Sect. 2.1).

The goal here is to allow for an efficient analysis of critical cases and provide a basis for planning and comparing possible countermeasures. For this purpose, a TSO can employ results of a contingency analysis with one of the CONT-methods as follows:

  • failed runs:

    • They provide an overview on most critical network components and should be analyzed completely (also as part of staff trainings, cf. Groos et al. (2018)).

    • Aggregated power residuals for such failed runs can be used to localize deficacies of the current network (model) and optimize it:

      • compressor stations: operation modes, power of machine units, number of machine units, interplay with regulator operation

      • supply nodes, t-pieces: add capacities (increased injection of renewable ressources, storages, larger pipelines and/or diameters for buffering), add routes (redundancy, buffering)

    • Since the runs were failed, new simulation (optimization) runs have to be performed in order to arrive at valid numerical values to assess countermeasures proposed.

    • Changes to operation modes and capacities have an impact on other runs of the CONT ensemble. Hence, the contingency analysis should be repeated with the new model.

  • successful runs:

    • Identify critical network components:

      • rank contingencies by their aggregated power residuals - they estimate probability of missing power supply at the respective location.

      • decide on a threshold

    • (at least) for contingencies above this threshold, identify locations and magnitudes of new/enlarged storage capacities:

      • re-calculate maximum values if set of contingencies is restricted due to the threshold

      • rank maximum power residuals

      • use them as a basis for planning (optimization) of additional capacities (more renewable ressources, storages, larger buffering) and routes (redundancy, buffering)

Note that countermeasures discussed in Groos et al. (2018), such as cathodic corrosion protection and enhancement of organisatorial measures for protection against third-party intervention, have to be implemented anyway.

8 Conclusion and outlook

Novel methods, CONT-C, CONT-1 and CONT-S for an adapted \(N-1\) contingency analysis of gas transport networks are presented, the efficiency of CONT-S discussed for the partDE-Hy demonstrator, and a new concept for TSOs proposed.

The novel methods are based on the TREERED method for topological reduction and supernodes. Stationary Euler equations with advanced compressor thermodynamics and a gas law allowing for gas compositions with up to 100\(\%\) hydrogen are used. Several measures and plots support an intuitive comparison and analysis of the results. In particular, it is shown that CONT-S can estimate locations and magnitudes of additional capacities (injection, buffering, storage etc.) with a reasonable performance for networks of practical relevant composition and size.

Future work shall extend the method in several aspects. Among them are probabilistic methods, analogously to methods for power grids (cf. Sect. 2.1), transient cases, incorporation of model-order reduction as well as \(N-k\) interdiction modeling (cf. Sect. 2.2).

As indicated in Sect. 2, power, water and gas networks are similar to a certain extend. A transfer of the new methods proposed in this paper to district heating, power networks and especially cross-sectoral applications (e.g. coupled gas-power networks or power-heat-gas-networks) shall be analyzed in future work. Some concepts might be useful for railway systems or big data network topologies as well.