1 Introduction

The ongoing replacement of traditional energy production by coal fired and nuclear plants with gas consuming facilities has rapidly increased the role of natural gas transport through large networks. The security of energy supply and the development of clean energy to meet environmental demands have generated a significant increase in gas consumption for electric power stations in the last decade. In these days, natural gas is considered as a bridging combustible resource on the way towards a future energy mix mainly based on low-carbon and regenerative energy (IEA 2019). The seasonally fluctuating disposability of wind and solar resources causes a growing variability in electricity production and hence also in the demands of gas transportion by pipelines. The resulting intra-day oscillations in demand for natural gas lead to new challenges for computer based modelling and control of gas pipeline operations with an increasing focus on short-term transient dynamics of gas flow. Operators have to responsively control loads to realize a reliable operational management for both gas and electricity delivery systems. The challenging new conditions demand advanced decision tools based on transient nonlinear optimization taking into account serious operating restrictions.

In this paper, we propose a novel computational approach for the reliable transient simulation and continuous optimization for gas pipeline flow through networks. The operation of compressor stations and flow schedules are determined in such a way that operating limits of compressors and pressure constraints inside the pipes are satisfied. Exemplarily, we investigate the important task of safely driving a stationary running system from an initial condition to a target state defined by shifted gas nominations at the entrances or delivery points of the network. To be usable in real-time gas management, we have designed our methods to meet user-defined accuracies while keeping the computing time for large-scale gas networks at a moderate level. The proposed method is fast enough to allow the application of uncertainty quantification by Monte Carlo or other stochastic simulations for risk analysis and reliability assessment of gas delivery.

The highly nonlinear partial differential equations representing the constraints of gas flow dynamics are locally approximated by a certain flow model taken from a whole hierarchy of decreasing complexity. Error estimates are computed from sensitivity equations and used as the basis for a straightforward criterion to verify that the model chosen provides a physically meaningful representation of the local gas flow in a pipe. Similar estimators are exploited to set up a fully adaptive spatial resolution in each individual pipe and variable time steps in a finite volume setting, which greatly reduces the size of the resulting discretized system. These strategies have been already proven to work reliably for networks of academic size (Domschke et al. 2015, 2018).

Multiple compressor stations consisting of several compressor machines often connected through intricate topological designs compensate the pressure drop due to the inherent friction or user’s excessive withdrawal of natural gas. Additionally, complex constraint envelopes delimit the allowed operating states of the compressors, making a generalized modelling and managing of such stations a challenging task of its own. To enable an efficient usage within a nonlinear optimization, we extend the approximate convex decomposition developed in Hiller and Walther (2017), Lien and Amato (2006) to a semiconvex setting. Critically, a semiconvex approximation of the characteristic work diagram for a compressor station enables a new representation of compressor constraints and can be used for a fast validation of nominations.

The development of an optimization-based, automated decision system requires the calculation of gradient information to be completed repeatedly and reliably in a short time in order to provide a decision support that is usable in a real-time gas management for large-scale pipeline systems. We propose to use a discrete adjoint approach within a first-discretize-then-optimize strategy applied to a possible splitting of the overall time horizon into smaller subintervals. A sequential quadratic programming with an active set strategy is then applied to solve the resulting nonlinear constrained optimization problems (Spellucci 1998a, b).

There are many academic and industrial studies available in the literature for the gas transport through a single pipe or even whole gas networks. In the last fifteen years, an increasing effort for the optimization of transient processes has led to a couple of publications that consider gas pipeline systems of moderate size (Burlacu et al. 2019; Domschke et al. 2011a, 2015; Ehrhardt and Steinbach 2005; Hante et al. 2017; Herty 2007; Mak et al. 2019; Pfetsch et al. 2014). Very recently, a linearization procedure that enables the use of closed-form solutions for the gas transport equations was proposed in Beylin et al. (2020) and applied to middle-sized networks. Significant progress has been made in developing sophisticated models for compressor stations, which is a key for more realistic treatment of an adjusted pressure increase under certain operating limits (Beylin et al. 2020; Rose et al. 2016; Walther and Hiller 2017). The gas flow in larger pipeline systems may be regulated by control valves and groups of compressors could be inactive in certain time intervals. Optimization of such systems leads to transient mixed-integer nonlinear problems. Although significant progress has been made to tackle these challenging problems in recent years, they still remain unsolved for real-life applications with sudden changes in gas supply and demand, which requires detailed transport models and reliable numerical solutions (Burlacu et al. 2019; Domschke et al. 2011a; Hahn et al. 2017; Mahlke et al. 2010). Model order reduction is an appropriate technique to reduce the computational cost for simulating large-scale gas networks. Surrogates based on radial functions and proper orthogonal decomposition for quasi-static approximations of the gas flow are compared in Grundel et al. (2013). However, the construction of such models in the case of highly transient flow with nonlinear compressors is still very ambitious. Recently, the tracking of internal space-time flow and pressure profiles using pressure measurements at nodal junctions and optimization-based state estimates has been investigated in Jalving and Zavala (2018) for simplified compressor models and networks of moderate size. Graph-based modeling abstractions with application to optimal control of connected gas pipelines in series is proposed in Jalving et al. (2019). The challenging task of maximizing the economic welfare of gas users for slow transients that allow a simplification of Euler’s equations is the objective in Zlotnik et al. (2019). To the best of our knowledge, in all these approaches there is no rigorous control of the discretization errors caused by the space-time resolution and model selection.

We apply our novel computation and optimization approach to real networks taken from the GasLib library (Schmidt et al. 2017). Fully model-space-time-adaptive simulations provide accuracy bounds for target functionals and can be viewed as an efficient way to automatically and safely reduce the order of the gas network model. They can be computed in the range of seconds for several hundreds of edges including pipes, valves, and compressor stations. Making use of this acceleration and calling the simulation tool within a nonlinear continuous optimization solver to determine gradient information reduces the computing time to validate nominations by several orders of magnitude compared to previously developed methods. The approach may be promising to include binary decision variables and to perform reliability studies using methods from uncertainty quantification in future extensions.

The paper is structured as follows. In Sect. 2, we outline our gas network modelling including boundary and coupling conditions, modelling of gas flow through pipes, compressor stations, and valves. Our numerical schemes for simulation and optimization are described in Sect. 3. In Sects. 4 and 5, we present results for certain case studies including nomination validation. Finally, a short summary and an outlook are given in Sect. 6.

2 Gas network modelling

We model gas supply networks as a directed graph \({\mathcal {G}} = ({\mathcal {J}}, {\mathcal {V}})\) with arcs \({\mathcal {J}}\) and vertices \({\mathcal {V}}\) (nodes, branching points). The set of arcs \({\mathcal {J}}\) contains pipes, compressor stations, simple valves and control valves. The gas dynamics within the pipes is described by a hierarchy of models of different complexity ranging from simple algebraic equations to a hyperbolic system of PDEs (see below and compare to Domschke et al. 2015). For each arc in the network that is modelled by a PDE, we consider an interval \([x_j^a, x_j^b]\) with \(x_j^a < x_j^b\), \(j \in {\mathcal {J}}_{\text {P\!\,D\!\,E}}\), where \({\mathcal {J}}_{\text {P\!\,D\!\,E}}\subseteq {\mathcal {J}}\) contains all arcs modelled with PDEs. All other network components, including coupling and boundary conditions at the nodes, are described by algebraic equations, where we also use spatial coordinates \(x_j^a\) and \(x_j^b\) to describe states at the beginning (tail) and end (head) of an arc \(j \in {\mathcal {J}} \setminus {\mathcal {J}}_{\text {P\!\,D\!\,E}}\) or denote states at the beginning/end of the arc with subscripts “in”/“out”. Note that one has to specify adequate initial, coupling and boundary conditions for a complete problem description of the gas network.

The flow through the network is described by the state variables q(xt) and p(xt). Here, q denotes the flow rate (or flux) in \(\hbox {m}^3/\hbox {s}\) under standard conditions, i.e., pressure of 1 atm and temperature of \({0}^\circ \hbox {C}={273.15}\, \hbox {K}\), and p represents the pressure in Pa.

Coupling and boundary conditions For any node \(v\in {\mathcal {V}}\), we denote by \(\delta _v^-\) the ingoing arcs of v and the outgoing arcs by \(\delta _v^+\). Respecting conservation of mass, the entire flux going into any node has to be equal to the sum of fluxes going out of that node:

$$\begin{aligned} \sum \limits _{j\in \delta _v^+} q(x_j^a,t) - \sum \limits _{j\in \delta _v^-} q(x_j^b,t) = q(v,t) \quad \forall t>0 \end{aligned}$$
(1)

where q(vt) is an auxiliary variable to model the flow rate of a feed-in or demand at node v (see below). Otherwise, it is set to zero. In addition to conservation of mass, it is widely used to claim the equality of pressure at all nodes \(v \in {\mathcal {V}}\), that is,

$$\begin{aligned} p(x_j^a,t) = p(v,t) \quad \forall j\in \delta _v^+, \quad p(x_i^b,t) = p(v,t) \quad \forall i\in \delta _v^-, \end{aligned}$$
(2)

with an auxiliary variable p(vt) for the pressure at the node v. For coupling and boundary nodes, one has to pose one more condition, which we consider of the form

$$\begin{aligned} e(p(v,t),q(v,t)) = 0\,. \end{aligned}$$
(3)

The latter allows for prescribing pressure or flux profiles as boundary condition or feed-in/demand. For example, the pressure is often described at the inflow boundary and certain flux profiles are requested by the gas consumers at the outflow boundary. Other coupling conditions like conservation of energy or entropy for isothermal, isentropic or polytropic gas flow, respectively, are discussed in Egger (2018), Lang and Mindt (2018), Mindt et al. (2019).

Modelling of gas flow through pipes Typically, gas pipeline systems are buried underground and hence temperature differences between a pipe segment and the ground can be neglected in practice. It is therefore standard to consider an isothermal process without a conservation law for the energy. As most complex model for the gas dynamics in the pipes, we take

  • (M3), the scaled isothermal Euler equations

    $$\begin{aligned} u_t + ({\mathbf {A}}u + B(u))_x = g(u)\,, \end{aligned}$$
    (4)

    with

    $$\begin{aligned} u&= \begin{pmatrix}p\\ q\end{pmatrix}\!,&{\mathbf {A}}&= \begin{pmatrix}0 &{} \displaystyle \frac{\rho _0 c^2}{A}\\[2mm] \displaystyle \frac{A}{\rho _0} &{} 0\end{pmatrix}\!,&B(u)&= \begin{pmatrix}0\\[2mm] \displaystyle \frac{\rho _0 c^2q^2}{Ap} \end{pmatrix}\!,&g(u)&= \begin{pmatrix}0\\[2mm] \displaystyle -\frac{\lambda \rho _0 c^2 |q|q}{2dAp}\end{pmatrix}\!, \end{aligned}$$

together with the equation of state for real gases, \(p=\rho zRT\), with the density \(\rho \), the compressibility factor \(z\in (0,1)\) (Koch et al. 2015), the temperature T, and the specific gas constant R. Here, \(c=\sqrt{p/\rho }\) denotes the speed of sound, \(\lambda \) the friction coefficient, d the diameter, A the cross-sectional area of the pipe, and \(\rho _0\) the density under standard conditions. Neglecting the nonlinear term B(u) on the left hand side leads to

  • (M2), the semilinear isothermal Euler equations

    $$\begin{aligned} u_t + {\mathbf {A}}u_x = g(u)\,. \end{aligned}$$
    (5)

As third and most simplest model, we consider

  • (M1), the (quasi-)stationary semilinear isothermal Euler equations

    $$\begin{aligned} {\mathbf {A}}u_x = g(u)\,, \end{aligned}$$
    (6)

which can be solved analytically,

$$\begin{aligned} q= & {} \text {const.} \,, \end{aligned}$$
(7a)
$$\begin{aligned} p_\text {out}= & {} \sqrt{p_\text {in}^2 - \frac{\lambda \rho _0^2 c^2 L}{dA^2}|q|q}. \end{aligned}$$
(7b)

Here, L denotes the length of the pipe. The flow rate q is now only represented by the pressure difference in a pipe - the so-called Weymouth equation. It is the standard model to capture long-term planning behaviour of gas networks in the quasi-stationary regime.

To summarize, the three models (M3)–(M2)–(M1) form a hierarchy of gas transport models with decreasing fidelity. For later use, it is important to mention that they are characterized by an additive structure, i.e., they are related by adding or subtracting certain differential terms. Given a reliable accuracy control, they can be used in each individual pipe adopted to the local flow behaviour without any difficulty, since the state vector \(u=(p,q)\) remains unchanged and hence two pipes can be easily interconnected by the continuity of p and q.

Modelling of compressor stations Compressor stations consist of at least one turbo compressor, where typically various ways of controlling the entire station are available (parallel, series, subsets). Thus a direct approach of modelling a compressor station leads to mixed integer control problems (Rose et al. 2016). As a simplification, an outer linear approximation of the feasible states of a compressor station is proposed in Walther and Hiller (2017). This results in a characteristic diagram given by a polyhedral model in the (Q,\(H_{\text {ad}}\))-space, where \(Q=q\rho _0/\rho \) is the volumetric flow rate in \(\hbox {m}^3/\hbox {s}\) and \(H_{\text {ad}}\) is the adiabatic head of the compressor defined by the gas compression from \(p_\text {in}\) to \(p_\text {out}\):

$$\begin{aligned} H_{\text {ad}}= zTR_s\frac{\kappa }{\kappa -1}\left( \left( \frac{p_\text {out}}{p_\text {in}}\right) ^{\frac{\kappa -1}{\kappa }} -1\right) \,. \end{aligned}$$
(8)

Here, \(\kappa \) is the isentropic exponent and \(R_s:=R/m\) is the specific gas constant with m being the averaged molar mass of the gas mixture.

We make use of such compressor station models to be able to apply methods from continuous nonlinear optimization for optimal control tasks. Therefore, \(H_{\text {ad}}\) is used as time-dependent control variable, while the underlying polyhedral model is incorporated as state constraint within the optimization procedures. The power P that is needed for the compression process is given by \(P=\rho _\text {in} Q H_{\text {ad}}/\eta _{\text {ad}}\), where \(\eta _{\text {ad}}\in [0,1]\) denotes the adiabatic efficiency depending on Q, the compressor speed, and other compressor-specific parameters (Rose et al. 2016; Walther and Hiller 2017). For later use, we denote by \({\mathcal {J}}_{cp}\) the set of all compressor stations.

Modelling of valves Valves are used to regulate the flow in gas networks. The equations describing an open simple valve are

$$\begin{aligned} q_\text {in} = q_\text {out}\,,\quad p_\text {in} = p_\text {out}\,. \end{aligned}$$
(9)

A closed simple valve is described by \(q_\text {in} = q_\text {out} = 0\,.\) A special class of valves are control valves that reduce the gas pressure by a certain amount. The corresponding equations are given by

$$\begin{aligned} p_\text {in} - p_\text {out} = \triangle p\,,\quad q_\text {in} = q_\text {out}\,, \end{aligned}$$
(10)

with a possibly time-dependent control variable \(\triangle p=\triangle p(t)\).

3 Numerical schemes for simulation and optimization

With the different models described above and all controls \((H_{\text {ad}}(t),\triangle p(t))\) given, we can solve the whole network as a system of differential-algebraic equations using adequate initial, coupling, and boundary conditions. Since the gas transport through a complex network may be very dynamic and thus changes both in space and time, an automatic control of the accuracy of the simulation is mandatory. In addition, a model adaptation, i.e., switching between models (M3), (M2), and (M1) in an appropriate way, has proven to be very useful in order to further reduce computational costs. The main idea is to use the most complex model (M3) only when necessary and to refine spatial and temporal discretizations only where needed. A complete description of the overall strategy to efficiently control model and discretization errors up to a user-given tolerance is given in Domschke et al. (2018), Domschke et al. (2015). In what follows, we will give a brief overview on the main ingredients.

3.1 Adaptive network simulation

For the discretization of the hyperbolic PDEs in the pipes, we apply an implicit box scheme (Kolb et al. 2010), which reads for model (M3)

$$\begin{aligned} \frac{u^l_{i-1}+u_i^l}{2} =&\;\frac{u^{l-1}_{i-1}+u_i^{l-1}}{2} - \frac{\triangle t}{\triangle x} \left( {\mathbf {A}}u^l_{i}+B(u^l_{i}) - {\mathbf {A}}u^{l}_{i-1}-B(u^{l}_{i-1}) \right) \nonumber \\&+ \frac{\triangle t}{2} \left( g(u^l_{i-1}) + g(u^l_{i}) \right) . \end{aligned}$$
(11)

It uses step sizes \(\triangle x\) and \(\triangle t\) in space and time, respectively, and forms a system of nonlinear equations for the approximations \(u_i^l\approx u(x_i,t_l)\). The scheme is closely related to the finite difference method proposed in Kiuchi (1994), where the midpoint rule is used to approximate the source term g(u)—a fact we were not aware of until now. Explicit methods as recently presented in Dyachenko et al. (2017), Gyrya and Zlotnik (2019) for large-scale natural gas pipeline networks can be an efficient alternative if the dynamics is not highly spread over the whole network. However, optimal control of compressor stations typically changes the dynamics close to the compressors in an unpredictable manner, which would force explicit integrators to apply very small time steps due to the well-known CFL condition. This effect can be even strengthened if the source term g(u) becomes dominant in the turbulent region. So, we have decided to use an implicit scheme in order to choose an appropriate time step with respect to accuracy requirements only.

Dropping terms with B on the right-hand side yields a discretization for model (M2). No discretization for (M3) is necessary, since it can be solved analytically. The scheme is convergent of order two in space and order one in time. It is conservative and stable under mild conditions (Kolb et al. 2010). Each pipe of the network is discretized by using one of the three gas transport models described above and an individual step size in space, where both can vary over time. The global time steps taken by this scheme are also used for all algebraic model equations including model (M1). The adaptation of the discretization parameters \(h:=(\triangle x,\triangle t,(Mk)_{k\in \{1,2,3\}}\)) is realized in a successive process of the classical loop

$$\begin{aligned} SOLVE \rightarrow ESTIMATE \rightarrow MARK \rightarrow REFINE\rightarrow SOLVE \end{aligned}$$
(12)

Given all discretization parameters collected in h, the model equations are solved and error estimators are derived. These estimators are then used to mark pipes for spatial refinement or model enhancement and to adopt the global time step. The error estimators considered are based upon the discretized model equations and are supposed to measure the influence of the currently applied models and discretizations in each individual pipe on a generic user-defined output functional

$$\begin{aligned} M(u) = \int _Q \!\! N(u) \,\text {d}(x,t) + \sum _{v \in {\mathcal {V}}}\int _0^T \!\! N_{v}(u) \,\text {d}t + \sum _{i\in {\mathcal {J}}\setminus {\mathcal {J}}_{\text {P\!\,D\!\,E}}} \!\! \int _0^{T} \!\! N_i(u_i)\,\text {d}t\,. \end{aligned}$$
(13)

Here, \(Q = \Omega \times (0,T)\) with \(\Omega = \bigcup _{j\in {\mathcal {{\mathcal {J}}_{\text {P\!\,D\!\,E}}}}} [x_j^a,x_j^b]\) and the vector \(u_i\) is defined as \(u_i(t) = (p(x_i^a,t), q(x_i^a,t), p(x_i^b,t), q(x_i^b,t))^T\) for all arcs \(i \in {\mathcal {J}}\setminus {\mathcal {J}}_{\text {P\!\,D\!\,E}}\) that are modelled by algebraic equations. The functions N(u), \(N_v(u)\), and \(N_i(u_i)\) define tracking-type costs on the respective sets (\(\Omega \), nodes, algebraic arcs) in the whole time interval (0, T). In the spirit of dual weighted residual methods, the applied error estimators are computed via sensitivity information coming from adjoint equations of the discretized model equations (Domschke et al. 2015). Here, we will demonstrate their computation for the case that model (M2) is applied in all pipes. The adjoint equations of model (M2) with respect to M(pq) are given by

$$\begin{aligned} \begin{aligned} \xi _{1_t} + \frac{A}{\rho _0} \xi _{2_x}&= -\frac{\lambda \rho _0 c^2}{2 D A} \frac{|q| q}{p^2} \xi _2 - N_p(p,q), \\ \xi _{2_t} + \frac{\rho _0 c^2}{A} \xi _{1_x}&= \frac{\lambda \rho _0 c^2}{D A} \frac{|q|}{p} \xi _2 - N_q(p,q), \end{aligned} \end{aligned}$$
(14)

together with appropriate end, coupling, and node conditions, where also the functions \(N_v\) and \(N_i\) appear (Domschke 2011; Domschke et al. 2015). The solution \(\xi = (\xi _1,\xi _2)^T\) of the adjoint equations consists of the adjoint pressure and flow rate of the semilinear model (M2) with respect to the functional M(u). Let now \(u=(p,q)^T\) be the solution of the nonlinear model (M1) and \(u^h=(p^h,q^h)^T\) the approximate solution of the semilinear model (M2). Then, the difference between the functional M(u) and \(M(u^h)\) can be approximated using Taylor expansion, i.e., \(M(u)-M(u^h)\approx M_p(u^h)(p-p^h)+M_q(u^h)(q-q^h)\). Eventually, the first derivatives \(M_p\) and \(M_q\) are replaced by using the adjoint system (14), which yields after a few calculations

$$\begin{aligned} M(u) - M(u^h)&\; \approx \sum _{j\in \mathcal {J}_p} \left( \eta _{m,j}^{\text {LIN-NL}} + \eta _{t,j}^{\text {LIN}} + \eta _{x,j}^{\text {LIN}} \right) \end{aligned}$$
(15)

with the a posteriori error estimators

$$\begin{aligned} \eta _{t,j}^{\text {LIN}}&= \int _0^T \! \int _{x_j^a}^{x_j^b} - \xi ^T \big (u_t^h - R_t(u^h)\big ) \, \text {d}x \, \text {d}t, \end{aligned}$$
(16a)
$$\begin{aligned} \eta _{x,j}^{\text {LIN}}&= \int _0^T \! \int _{x_j^a}^{x_j^b} - \xi ^T \Big ({\mathbf {A}}u^h_x - R_x({\mathbf {A}}u^h) - g(u^h) + R(g(u^h))\Big ) \, \text {d}x \, \text {d}t, \end{aligned}$$
(16b)
$$\begin{aligned} \eta _{m,j}^{\text {LIN-NL}}&= \int _0^T \! \int _{x_j^a}^{x_j^b} - \xi ^T B(u^h)_x \text {d}x \, \text {d}t\,. \end{aligned}$$
(16c)

Here, for the reconstruction operator \(R_t\) for the temporal derivative, we use central differences of order two, whereas R and \(R_x\) are defined by

$$\begin{aligned} R(u_i^h) =&\;\frac{1}{16}\left( -u^h_{i-3/2}+9u^h_{i-1/2}+9u^h_{i+1/2}-u^h_{i+3/2}\right) , \end{aligned}$$
(17a)
$$\begin{aligned} R_x(u_i^h) =&\;\frac{1}{24}\left( u^h_{i-3/2}-27u^h_{i-1/2}+27u^h_{i+1/2}-u^h_{i+3/2}\right) ,\; \end{aligned}$$
(17b)

which gives fourth-order accuracy with function values \(u^h_{i+j/2}\) at cell centers. The model error estimator \(\eta _{m,j}^{\text {ALG-LIN}}\) between the algebraic and the semilinear model and the discretisation error estimators \(\eta _{t,j}^{\text {NL}}\) and \(\eta _{x,j}^{\text {NL}}\) for the nonlinear model are derived analogously for every pipe \(j \in \mathcal {J}_p\); see Domschke (2011); Domschke et al. (2015).

Based on this information, the following strategy to adapt the applied models as well as the discretization parameters is used (Domschke et al. 2018): First, the time interval [0, T] is split into certain time blocks \([T_{k-1},T_k]\) and the output functional (13), say \(M_k\), and the error estimators (16), say \(\eta ^k_{m,j},\eta ^k_{t,j},\eta ^k_{x,j}\), are locally evaluated for the algebraic model and coarse meshes initially chosen. Second, models and discretization meshes are successively refined within the loop (12) until a user-prescribed tolerance \(\texttt {TOL}\) is achieved in the sense that

$$\begin{aligned} \frac{|M_k(u)-M_k(u^h)|}{|M_k(u^h)|}\approx \frac{|\sum _{j\in \mathcal {J}_p} \left( \eta ^k_{m,j} + \eta ^k_{t,j} + \eta ^k_{x,j} \right) |}{|M_k(u^h)|} \le \texttt {TOL}. \end{aligned}$$
(18)

The problem of finding an optimal refinement strategy is a generalisation of the knapsack problem (Domschke et al. 2018). We apply a greedy-like strategy maximum error-to-cost refinement (Domschke et al. 2018, Algorithm 3a) to keep the relative error below TOL, while retaining low computational costs. Third, once the solution meets the tolerance requirement in \([T_{k-1},T_k]\), the models and discretisations are coarsened if appropriate, the simulation progresses to the next time interval, and the cycle repeats. The possible changes of the spatial discretizations between two time blocks is treated by a conservative projection, see (Domschke et al. 2015, Sect. 6). For further details on the computation of the error estimators and the adaptive strategy, we refer to Domschke et al. (2018, 2011b, 2011c, 2015)

3.2 Gradient-based optimization methods

The approach of a fully adaptive network simulation can be used to solve optimal control problems, where we consider objective functions of the generic form (13). We apply gradient-based optimization techniques, in particular the solver Donlp2 (Spellucci 1998a, b), where a sequential quadratic programming with an active set strategy and only equality constrained subproblems is implemented. Since the computation of gradient information via difference quotients is rather inefficient, we apply a similar adjoint calculus as for the error estimators to get the necessary gradient information with respect to control variables of the respective optimization problem. The whole approach has been implemented in our in-house software package Anaconda (Kolb 2011).

Let c be the vector of control variables defined by \((H_{ad}(t),\triangle p(t))\) at certain time points and \(E(u^h,c)=0\) the system of all nonlinear discretized model equations including initial, boundary and coupling conditions. Then, our goal is to solve the constrained optimal control problem

$$\begin{aligned} \text {Minimize}_{c\in C_{ad}}&\;M(u^h,c) \end{aligned}$$
(19a)
$$\begin{aligned} \text {subject to }&\; \quad E(u^h,c) = 0,\quad \text {where } h \text { is chosen such that} \end{aligned}$$
(19b)
$$\begin{aligned}&\;\left| \sum _{j\in \mathcal {J}_p} \left( \eta ^k_{m,j} + \eta ^k_{t,j} + \eta ^k_{x,j} \right) \right| \le |M_k(u^h,c)|\cdot \texttt {TOL}\quad \text { for all } [T_{k-1},T_k], \end{aligned}$$
(19c)

where \(C_{ad}\) is the closed and convex set of admissible controls c and \(M(u^h,c)\) is the output functional defined in (13), which can now also depend on the control. We would like to solve this problem with gradient-based optimization techniques. To get the necessary gradient information, we apply the same adjoint approach as described above for the error estimators. First, given a control \(c\in C_{ad}\), we adaptively solve the model equations by a greedy-like refinement strategy such that the tolerance requirements are fulfilled with appropriate discretization parameters collected in h. We fix the discretization and solve the linear adjoint equations

$$\begin{aligned} \left( \frac{\partial }{\partial u^h} E(u^h,c)\right) ^T \xi ^h =&\;-\left( \frac{\partial }{\partial u^h}M(u^h,c)\right) ^T \end{aligned}$$
(20)

for the adjoint variables \(\xi ^h\). Then, the total derivative of the objective \(M(u^h,c)\) with respect to the control variables c reads

$$\begin{aligned} \frac{d}{dc}M(u^h,c) =&\;\frac{\partial }{\partial c}M(u^h,c) + \left( \xi ^h\right) ^T \frac{\partial }{\partial c} E(u^h,c), \end{aligned}$$
(21)

where we have used that \(\partial _{u^h}E(u^h,c)\,\partial _cu^h=-\partial _cE(u^h,c)\). This gradient is passed to the solver Donlp2, which delivers an improved control vector. The iteration is stopped if a certain tolerance prescribed for Donlp2 is reached.

4 Adaptive simulation of large gas networks

As an example from real gas networks in Germany, we consider the network GasLib-582 from gaslib.zib.de (Schmidt et al. 2017). The network consists of 582 nodes (31 sources, 129 sinks, and 422 inner nodes). The nodes are connected through 278 pipes, 269 short pipes, 26 valves, 23 control valves, and 5 compressor stations, totalling 609 edges. Figure 1 shows the network where some selected nodes are indicated that we will refer to later on.

Fig. 1
figure 1

Topology of the large real-life gas network GasLib-582

The settings of the network components with binary decisions are taken from a combined decision file originally provided by gaslib.zib.de. Initial data is generated by calculating a steady state solution for a given nomination (boundary data). For the simulation, the boundary data of some of the sinks (sink_5, sink_9, sink_21, sink_113, sink_116, sink_122) are taken time-dependent as well as the controls of the compressor stations, see Figs. 2 and 3, respectively.

Fig. 2
figure 2

Time-dependent boundary conditions for sink 5, 9, 21, 113, 116, and 122

Fig. 3
figure 3

Time-dependent controls \(H_{\text {ad}}\) for compressors 1–5

The adaptive simulations are run with tolerances ranging from \(10^{-1}\) to \(10^{-4}\). Running the compressor stations needs a certain amount of energy and is relatively costly. Thus, one target is to run the network at minimal compressor costs. Also, consumers like big companies nominate a certain amount of gas and may additionally have some contractual agreements relating to the pressure of the gas provided. Hence, the aim is to fulfil these requirements in order to prevent contractual penalties. Having these examples in mind, we define the target functional to be given by the total energy consumption of the five compressor stations supplemented by the \(L^2\)-norm of the difference between the actual pressure and a target pressure at selected nodes. These are \(S:=\{\texttt {sink}\_\texttt {9}, \texttt {sink}\_\texttt {113}, \texttt {sink}\_\texttt {116}, \texttt {sink}\_\texttt {122}\}\), the location of which can be found in Fig. 1. Thus, the objective function with appropriate weights reads

$$\begin{aligned} M(u) = 0.01\cdot \sum _{cp\in {\mathcal {J}}_{cp}}\int _0^T P_{cp}(t)\;dt + \sum _{s\in S}\beta _s\,\int _0^T\left( p_s(t)-p_{s,target}(t)\right) ^2\,dt\,, \end{aligned}$$
(22)

where \(\beta _s=(10^{-3},10^{-4},10^{-4},10^{-4})\) for \(s=9,113,116,122\), respectively.

Table 1 shows the results for the model-space-time adaptive simulations. The relative error in the target functional \(M(u^h)\) with respect to a reference solution, which is computed with \(\Delta t=20\,s\) and locally uniform spatial mesh sizes \(\Delta x\le 250\,m\) adjusted to the pipe lengths, is presented. We observe that the error in the target functional decreases nicely with the given tolerance. Please note that the error estimators do not give a strict upper bound, but the quality of the error estimation is quite impressive for higher tolerances (Domschke 2011; Domschke et al. 2015). At the same time, the CPU time needed for computation of the simulation increases moderately with the tolerance going down. Please note that for the computation of the reference solution, no adjoint equations were solved nor have any error estimators been computed. We conclude that our fully adaptive algorithm is able to simulate a real-life gas network as GasLib-582 over a time horizon of 12 h in a few seconds when, e.g., a practically sufficient tolerance \(5\times 10^{-3}\) is requested.

Table 1 Simulation results for the large network GasLib-582
Table 2 Usage of models in % for the large network
Fig. 4
figure 4

Usage of models in % for the simulation of the large network

Table 2 and Fig. 4 illustrate which models are used to what extent during the simulations depending on the tolerance. Not surprisingly, the smaller the tolerance, the more detailed models are used by the adaptive algorithm.

Fig. 5
figure 5

Models used over time for a selection of pipes

Fig. 6
figure 6

Adaptive solutions for different  TOL at sinks sink_113 and sink_122 contributing to the target functional, and sink_106 not contributing to the target functional

We are also interested in where and when the model refinement takes place. For a tolerance \(\,\texttt {TOL} =10^{-3}\), we have selected a few pipes, which are adjacent to sinks in the network, see Fig. 5. The first three pipes (p243, p256, p245) correspond to sink_113, sink_122, and sink_9, respectively. They all contribute to the target functional. The pipe p23 corresponds to sink_5, which is close to sink_9. The last two pipes (p233, p249) are away from any impact to the target functional. We clearly see that pipes adjacent or close to targets use more sophisticated models than remote pipes.

Another point of interest is how well the adaptive solution corresponds to the reference solution. Figure 6 shows the pressure at sink_113, sink_122, and sink_106 of the adaptive simulation using different values of  TOL as well as the reference solution. It can be seen that for the sinks contributing to the target functional, i.e. sink_113 and sink_122, the adaptive solution is quite close to the reference solution already for \(\,\texttt {TOL} =10^{-2}\) or \(5\times 10^{-3}\). For sink_106, this is the case for a tolerance of \(10^{-3}\) or even lower.

5 Applications to constrained optimal control

The operation of a gas network gives rise to various scenarios which can be treated by appropriate optimization tools. One important question in every day practice is concerned with the issue of nomination validation:

Given a stationary state A of the network, is it possible to reach a stationary state B satisfying certain constraints?

If the answer is yes, can we operate the network in an optimal, cost efficient way? Constraints under consideration can be lower and upper bounds on the pressure and the flow or the operating range of a compressor station. In what follows, we exemplarily apply methods from continuous optimization to answer these questions. A key point is an appropriate modelling of compressor stations, which is described next.

The physical model of a turbo compressor is determined by a characteristic field (Walther and Hiller 2017), see Fig. 7a. A compressor station typically consists of multiple compressors that can be run in different configurations: single, serial, and parallel. Each configuration is again described by a characteristic field that overlap largely, see Fig. 7b. Resulting from approximate convex decomposition (Hiller and Walther 2017; Lien and Amato 2006), we take an outer linear approximation of the physical model of the aggregated characteristic fields as a base, see Fig. 7c. In order to make such a model applicable within an optimization, we approximate it by a semiconvex set K in the Q-\(H_{\text {ad}}\)-space, see Fig. 7d. The approximation is semiconvex in the sense that for fixed \(H_{\text {ad}}\), if \((Q_1,H_{\text {ad}})\in K\) and \((Q_2,H_{\text {ad}})\in K\), then

$$\begin{aligned} (\lambda Q_1 + (1-\lambda ) Q_2,H_{ad}) \in K \qquad \forall \lambda \in [0,1]\,. \end{aligned}$$
(23)

The difference between the approximate convex decomposition model and the semiconvex approximation is displayed in Fig. 7d. Property (23) allows to incorporate the characteristic diagram of a compressor station as a state constraint for the volumetric flow rate Q through it, see (26d) below. The pressure head \(H_{ad}\) is then only restricted by a flow-independent minimum and maximum value, \(H_{ad,min}\) and \(H_{ad,max}\), respectively.

The path from A to B mainly depends on the boundary values, especially the change of the flow rate \(q_s\) at the sinks. One could prescribe this change by a certain function in time, e.g. a linear one, over an appropriate time horizon and try to find a set of controls that guarantees the compliance of all operational restrictions. However, the identification of such transfer functions is often a difficult task. A second option, which we will follow here, is to relax the inflexibility of a fixed time-dependent boundary condition by considering the outflow rates \(q_s\), \(s\in {\mathcal {J}}_q\), as part of the controls and adding a weighted tracking type functional to the objective function, resulting in

$$\begin{aligned} M_{nv}(u,c) = \alpha \cdot \sum _{cp\in {\mathcal {J}}_{cp}}\int _0^T P_{cp}(t)\;dt + \sum _{s\in {\mathcal {J}}_q}\beta _s\,\int _0^T\left( q_s(t)-q_{s,target}(t)\right) ^2\,dt\,. \end{aligned}$$
(24)

with positive weights \(\alpha \), \(\beta _s\), and \(c=(\{H_{ad}^{cp}\},\{q_s\})\)—the set of all pressure heads and outflow rates that have to be changed. It is beneficial that \(q_{s,target}(t)=q_{s}^B\) for \(t\in [T-t^\star ,T]\) for a sufficiently large \(t^\star <T\) and \(q_{s}^B\) being the desired new outflow rate at state B. The admissible set is defined as

$$\begin{aligned} C_{ad}:=\{(H_{ad}^{cp},q_s)_{cp\in {\mathcal {J}}_{cp},s\in {\mathcal {J}}_q}:H_{ad,min}^{cp}\le H_{ad}^{cp} \le H_{ad,max}^{cp}, \;q_s\in {\mathbb R}\}. \end{aligned}$$
(25)

We also consider lower and upper bounds for the flow rate \(q_s\) and the pressure \(p_s\) at certain sinks and sources with index sets \({\mathcal {J}}_{pl}\), \({\mathcal {J}}_{pu}\), \({\mathcal {J}}_{ql}\), and \({\mathcal {J}}_{qu}\), respectively. In general, \({\mathcal {J}}_{pl}\cap {\mathcal {J}}_{pu}\ne \emptyset \) and \({\mathcal {J}}_{ql}\cap {\mathcal {J}}_{qu}\ne \emptyset \) .

Fig. 7
figure 7

Modelling of compressor stations consisting of several single turbo compressors

Our resulting optimal control problem for the nomination validation reads as follows:

$$\begin{aligned}&\text {Minimize}_{c\in C_{ad}}\;M_{nv}(u^h,c) \end{aligned}$$
(26a)
$$\begin{aligned}&\text {subject to } \; \quad E(u^h,c) = 0,\quad \text {where } h \text { is chosen such that} \end{aligned}$$
(26b)
$$\begin{aligned}&\qquad \qquad \;\left| \sum _{j\in \mathcal {J}_p} \left( \eta ^k_{m,j} + \eta ^k_{t,j} + \eta ^k_{x,j} \right) \right| \le |M_k(u^h,c)|\cdot \texttt {TOL}\quad \text { for all } [T_{k-1},T_k], \end{aligned}$$
(26c)
$$\begin{aligned}&\qquad \qquad \; Q_{min}(H_{ad}^{cp}) \le Q^h_{cp} \le Q_{max}(H_{ad}^{cp}) \quad \text {for all }cp\in {\mathcal {J}}_{cp}, \end{aligned}$$
(26d)
$$\begin{aligned}&\qquad \qquad \; p^h_s(t_i)\ge p^l_s(t_i) \quad \text {for all discrete time points }t_i \text { and } s\in {\mathcal {J}}_{pl},\end{aligned}$$
(26e)
$$\begin{aligned}&\qquad \qquad \; p^h_s(t_i)\le p^u_s(t_i) \quad \text {for all discrete time points }t_i \text { and } s\in {\mathcal {J}}_{pu},\end{aligned}$$
(26f)
$$\begin{aligned}&\qquad \qquad \; q^h_s(t_i)\ge q^l_s(t_i) \quad \text {for all discrete time points }t_i \text { and } s\in {\mathcal {J}}_{ql},\end{aligned}$$
(26g)
$$\begin{aligned}&\qquad \qquad \; q^h_s(t_i)\le q^u_s(t_i) \quad \text {for all discrete time points }t_i \text { and } s\in {\mathcal {J}}_{qu}\,. \end{aligned}$$
(26h)

We apply the gradient-based SQP-solver Donlp2 (Spellucci 1998a, b), which can handle control as well as state constraints of the form (26d)–(26h).

In the following sections, we show the applicability of the continuous optimization algorithm for nomination validation including the semiconvex approximation of the characteristic diagram as constraints for the compressor stations.

5.1 Network with three compressor stations

For demonstration purpose, we firstly consider a simplified, but very illustrative network with three compressor stations, see Fig. 8.

Fig. 8
figure 8

Network with three compressor stations

At time \(t=0\), the network is in a stationary state A, resulting from a simulation with stationary boundary conditions. The aim is to operate the network as to reach a stationary state B under certain constraints. For the sinks T2 and T3, we have the following targets:

$$\begin{aligned} q_{T2,target}(t)&= {\left\{ \begin{array}{ll} 40 \,\hbox {m}^3/\hbox {s}, &{} 0\le t< {7200}\, \hbox {s}\,,\\ 5 \,\hbox {m}^3/\hbox {s}^{2} \cdot t + 30\, \hbox {m}^3/\hbox {s} , &{} {7200} \,\hbox {s} \le t< {21\, 600}\hbox {s}\,,\\ {60}\,\hbox {m}^3/\hbox {s}, &{} 21\, 600\,\hbox {s} \le t \le {43\,200}\, \hbox {s}\,, \end{array}\right. }\\ q_{T3,target}(t)&= {\left\{ \begin{array}{ll} {60}\,\hbox {m}^3/\hbox {s}, &{} 0\le t< {7200} \,\hbox {s}\,,\\ {-5} \,\hbox {m}^3/\hbox {s}^{2} \cdot t + {70}\,\hbox {m}^3/\hbox {s}, &{} {7200} \,\hbox {s} \le t < {21\,600}\,\hbox {s}\,,\\ 40\, \hbox {m}^3/\hbox {s}, &{} {21\,600}\,\hbox {s} \le t \le {43\, 200} \,\hbox {s}\,. \end{array}\right. } \end{aligned}$$

They enter the objective function in (24) with weights \(\beta _{T2}=10^{-4}\) and \(\beta _{T3}=10^{-5}\). The target state B has to be accessed under certain pressure constraints at T2 and T3,

$$\begin{aligned} \text {T2:}&\quad p \ge p_{T2}^l(t) \quad \text {with}\; p_{T2}^l(t) = {\left\{ \begin{array}{ll} {79}\,\hbox {bar} + {4/3} \,\hbox {bar}/\hbox {h} \cdot t &{} 0\le t < {3}\, \hbox {h}\,,\\ {83}\,\hbox {bar} &{} {3}\,\hbox {h} \le t \le {12} \,\hbox {h}\,, \end{array}\right. }\\ \text {T3:}&\quad p_{T3}^u\ge p \ge p_{T3}^l \quad \text {with}\;p_{T3}^u={61} \,\hbox {bar},\; p_{T3}^l={59}\, \hbox {bar}. \end{aligned}$$

The constraints for the compressor stations Cs1-Cs3 are given by identical characteristic fields as shown in Fig. 10. We choose \(\alpha =0.1\) as weight in (24).

The simulation interval is [0  h,12  h]. The discrete control vector \(c\in {\mathbb R}^{240}\) consists of the three adiabatic heads \(H_{ad}^{Csk}(t_i),\,k=1,2,3,\) of the compressor stations and the flow rates \(q_{Tk}(t_i),\,k=2,3,\) taken at the discrete control points \(t_i=i\,{900}\, \hbox {s}\), \(i=1,\ldots ,48\). We use linear interpolation between the control points whenever necessary. The optimization algorithm Donlp2 equipped with gradient information delivers solutions for tolerance \(\texttt {TOL}={5\times 10^{-4}}\) after 16.5 min computing time. The corresponding targets and constraints of the sinks T2 and T3 are shown in Fig. 9. We nicely see that the targets \(q_{T2,target}(t)\) and \(q_{T3,target}(t)\) are met very well by the control variables \(q_{T2}(t)\) and \(q_{T3}(t)\) during the optimization process and that also the constraints on the pressures \(p_{T2}(t)\) and \(p_{T3}(t)\) at the sinks are maintained.

Fig. 9
figure 9

Controlled flow rate \(q_s(t)\) (top) and pressure \(p_s(t)\) (bottom) compared to target values \(q_{s,target}(t)\) and constraints \(p_s^{l,u}(t)\) for sinks s=T2, T3

Fig. 10
figure 10

Controls \(H_{ad}^{cp}(t)\) and constraints given by the \((Q,H_{ad})\)-diagrams of the compressor stations cp=Cs1, Cs2, Cs3 (top to bottom)

The compressor stations are controlled via their individual adiabatic heads. These controls are shown in Fig. 10. On the left hand side, the controls are drawn inside the characteristic field. We see that the controls stay inside the characteristic field and thus meet the technical constraints of the compressor stations.

Eventually, we would like to mention that relaxing the tolerance of Donlp2 to \(\texttt {TOL}={5\times 10^{-3}}\) still yields satisfactory results after 7.5 min computing time, but the solutions found are less smooth.

5.2 The Greek network (GasLib-134)

As second example, we consider the real Greek network with 134 nodes including 3 sources, 45 sinks as well as 133 edges, one compressor station and one control valve, see Fig. 11. The specific data are available from gaslib.zib.de.

Fig. 11
figure 11

The Greek network (GasLib-134), reproduced from gaslib.zib.de (left), and characteristic field of the compressor station cs (right)

First, we check typical simulation results for a given control for the compressor station and varying tolerances. Exemplary results for \(T={24}\,\hbox {h}\) are presented in Table 3. Practically sufficient accuracy is achieved with \(\,\texttt {TOL} =10^{-2}\).

Second, we are again interested in computing an optimized way to transfer the gas network from a stationary state A to another stationary state B under certain constraints. Except one, all sinks and sources have the same structure for the target functional:

$$\begin{aligned} q_{s,target}(t)&= {\left\{ \begin{array}{ll} q_s^A, &{} 0\le t< t_1\,,\\ q_s^A + \frac{t-t_1}{t_2-t_1}\left( q_s^B-q_s^A\right) , &{} t_1 \le t < t_2\,,\\ q_s^B, &{} t_2 \le t \le T\,. \end{array}\right. } \end{aligned}$$

for \(s=1,\ldots ,47\), and with \(t_1={2}\,\hbox {h}\), \(t_2={6}\,\hbox {h}\), and simulation time \(T={24}\,\hbox {h}\). At source node_20, which can be identified to be the small blue triangle in the very north of Greece in Fig. 11, we prescribe the pressure in order to get a well-defined stationary state. We set

$$\begin{aligned} p_{20}(t)&= {\left\{ \begin{array}{ll} p_{20}^A &{} 0\le t< t_1\,,\\ p_{20}^A + \frac{t-t_1}{t_2-t_1}\left( p_{20}^B-p_{20}^A\right) &{} t_1 \le t < t_2\,,\\ p_{20}^B &{} t_2 \le t \le T\,. \end{array}\right. } \end{aligned}$$
Table 3 Simulation results for the Greek network GasLib-134
Fig. 12
figure 12

Controlled flow rates \(q_s(t)\) compared to target values \(q_{s,target}(t)\) for \(s=2,42\) (top), flow rate \(q_{20}(t)\) and pressure \(p_{42}(t)\) compared to constraints \(q_{20}^l\) and \(p_{42}^l\) (bottom) for discrete control points with \(\Delta t={900}\, \hbox {s}\)

In order to achieve the stationary state B in the end, we set the lower bound for the flow rate at source node_20 to be

$$\begin{aligned} q_{20}^l(t)&={\left\{ \begin{array}{ll} q_{20}^A &{} 0\le t< t_1\,,\\ q_{20}^A + \frac{t-t_1}{t_2-t_1}\left( q_{20}^B-q_{20}^A\right) &{} t_1 \le t < t_2\,,\\ q_{20}^B &{} t_2 \le t \le T\,. \end{array}\right. } \end{aligned}$$

Further constraints are defined for the sinks node_42 and node_45,

$$\begin{aligned} p_{42}(t)\ge p_{42}^l={58.3}\,\hbox {bar} \quad \text {and}\quad p_{45}(t)\ge p_{45}^l={61}\,\hbox {bar}. \end{aligned}$$

They are located in the very south and south-west of the network, respectively. The constraints for the compressor station cs is given by a characteristic field as shown in Fig. 11. We employ the semiconvex approximation of the polyhedric approximation as described above, see Fig. 7d.

The simulation interval is now [0 h,24 h]. Beside the adiabatic head \(H_{ad}^{cs}(t_i)\) for the compressor station, we consider all flow rates \(q_s(t_i)\), \(s=1,\ldots ,47\), at the discrete control points \(t_i=i\,{900}\,\hbox {s}\), \(i=1,\ldots ,96\) as control variables, which gives \(c\in {\mathbb R}^{4608}\). As a consequence, we enforce \(\Delta t\le {900}\, \hbox {s}\) in our simulations to reach every control point with our adaptive scheme. We further set \(\beta _s=10^{-5}\) for all s and \(\alpha =1\) in the objective function (24). The optimization is challenging due to the additional state constraints. It was run with Donlp2 with a tolerance \(\texttt {TOL}=10^{-3}\) and took 10.1 min. We note that the dimension of the overall discrete state vector taken over space and time reaches more than a million in certain cases. Figure 12 shows exemplary results for the targets of two selected nodes. The variable operation mode for the compressor station is plotted in Fig. 13 (top). All constraints are satisfied.

We have also reduced the discrete control points to \(t_i=i\,{3600}\,\hbox {s}\), \(i=1,\ldots ,24\), which scales down the dimension of the control space to \(c\in {\mathbb R}^{1152}\). Donlp2 was still able to find a feasible solution after 2.5 min. The corresponding operation mode for the compressor station is shown in Fig. 13 (bottom). It differs from the solution found for \(\Delta t={900}\,\hbox {s}\).

Fig. 13
figure 13

Control \(H_{ad}^{cs}(t)\) and constraints given by the \((Q,H_{ad})\)-diagram of the compressor station cs for discrete control points with \(\Delta t={900}\,\hbox {s}\) (top) and \(\Delta t={3600}\,\hbox {s}\) (bottom)

6 Conclusion and outlook

We have presented a novel optimization approach to support a transient management of large-scale gas networks with real semiconvex models for aggregated characteristic fields of compressor stations. Given the significantly reduced computational time for a one-time simulation by fully self-adaptive space-time-model discretizations and the associated inherent error control, the method proposed is a promising candidate for a reliable work horse in a predictive transient software framework that creates gas flow schedules and forecasts in near real-time. As an example, we have studied the practically important issue of nomination validations, i.e., transferring the gas network from a stationary state to another stationary state usually described by a change in the gas demands by consumers. During this process certain state constraints have to be satisfied, making the corresponding optimal control problem challenging. We could observe that treating the new outflow rates as control variables and adding regularization terms of tracking type for them to the objective function is an attractive way to find answers to the question whether a desired steady state can be reached.

In future projects, we will include mixed integer formulations to represent network topology changes and use probabilistic constraint optimization to investigate the influence of uncertainties.