1 Introduction

The flow of gas in a horizontal pipeline of constant cross section is described by [2]

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(1)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(2)

Here A and D are the cross section and diameter of the pipe, and λ is a dimensionless friction parameter. The functions ρ, p, and m describe the density, pressure, and mass flow rate of the gas. Under isothermal flow conditions, one has

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(3)

with constant c denoting the speed of sound. In practically relevant scaling regimes, the nonlinear term on the left hand side of (2) is usually neglected, which can be justified by an asymptotic analysis [2, 7]. Using this simplification and Eq. (3) to eliminate the density, one arrives at evolution problems of the general form

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(4)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(5)

where a and b are positive constants and d = d(p, m) denotes a state dependent friction coefficient. For our analysis, we will consider d = d(x) as a function depending only on space which can be justified, e.g., by linearization around a steady state. Corresponding models for the gas flow on pipe networks are obtained by coupling the flow equations for single pipes via algebraic conditions [9, 10]; see below.

The discretization of (4)–(5) and its extension to pipeline networks has been discussed intensively in the literature. In [9], a Galerkin approximation for (1)–(2) with cubic Hermite polynomials is investigated numerically. The discretization of transient gas flow models is also studied [2, 8]. An entropy stable finite volume method is proposed in [10], and an energy stable mixed finite element approximation is investigated in [3]. Apart from [9], all methods discussed above are of lowest order and no rigorous convergence analysis is given.

In this paper, we study the discretization of (4)–(5) by a Petrov-Galerkin approach of potentially high order. The resulting scheme is shown to be stable which allows us to prove order optimal convergence rates. By using an appropriate functional analytic setting, the convergence results can be generalized almost verbatim to pipeline networks. A hybridization strategy will be discussed that facilitates the implementation and that allows to incorporate non-standard coupling conditions. The proposed method formally also allow to treat nonlinear models of gas transport and, in principle, high order convergence can be obtained in practically relevant regimes.

2 Notation and Preliminaries

Let x L < x R and denote by L p(x L, x R) and W k, p(x L, x R), k ≥ 0 the standard Lebesgue and Sobolev spaces. The scalar product and norm of L 2(x L, x R) are written as (v, w) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \). Other norms will be designated by subscripts. We write H k(x L, x R) = W k, 2(x L, x R) for the Hilbert spaces and define

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

for convenience. The reason for introducing the space H(div) will become clear when considering networks, where the spaces H 1 and H(div) have different continuity properties across junctions. By L p(0, T;X) and W k, p(0, T;X) we denote the Bochner spaces of functions f: [0, T] → X with values in X. The value of f(t) may then itself be a function. In the following, we consider the linear system

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(6)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(7)

for x L < x < x R and t > 0 with homogeneous boundary conditions

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(8)

Inhomogeneous and more general boundary conditions can be considered as well and our analysis applies with minor modifications. We will assume that

(A1):

a, b are positive constants, and

(A2):

d ∈ L (x L, x R) with \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and constants \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \).

For given f, g ∈ L 2(0, T;L 2(x L, x R)) and initial values \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), m(0) ∈ H(div), existence of a unique solution follows from semigroup theory. Any smooth solution of problem (6)–(8) also satisfies \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), m(t) ∈ H(div), and

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(9)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(10)

for all \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and all 0 < t < T. This variational characterization will be the starting point for our discretization approach introduced in the next section.

3 Petrov-Galerkin Approximation

Let x L = x 0 < x 1 < … < x N = x R be a partition of the interval [x L, x R] into elements T n = [x n−1, x n]. We call T h:= {T n: 1 ≤ n ≤ N} the mesh and denote by h n = |x n − x n−1| and h =maxn h n the local and global mesh size, respectively. Let

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(11)

be the space of piecewise polynomials on the mesh T h. We fix k ≥ 1 and search for approximations for the solutions p(t), m(t) of problem (6)–(8) in the spaces

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(12)

of continuous piecewise polynomials with appropriate boundary conditions. As finite dimensional test spaces for the variational problem (9)–(10), we choose

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(13)

consisting of discontinuous piecewise polynomials of lower order k − 1. We denote by \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) the H 1-projection operator, defined by

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(14)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(15)

and let \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) be the L 2-orthogonal projection, satisfying

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(16)

Note that both projection operators \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) can be defined locally on every element. Moreover, they are mutually related other by the commuting diagram property

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(17)

For the approximation of problem (6)–(8), we then use the following approximation.

Problem 1 (Inexact Petrov-Galerkin Method)

Find functions \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), m h ∈ H 1(0, T;V h) with \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), and such that

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(18)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(19)

for all \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), and for all 0 ≤ t ≤ T.

The well-posedness of this problem follows from the results of the next section.

4 Discrete Stability Estimates

We now derive some discrete stability estimates that yield well-posedness of the semidiscrete method and that allow us to establish error estimates of optimal order.

Lemma 1

Let p h , m h denote a solution of Problem 1 . Then

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

with constant C(T) ≤ CT and C independent of T and the solution.

Proof

Let us first note that \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) for all q ∈ H 1(x L, x R). By testing (18)–(19) with \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), we then get

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

By identity (17), integration-by-parts, and the boundary conditions (8), one can verify that \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \). Via Cauchy-Schwarz and Young inequalities, and using positivity of d, we then obtain the estimate

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

The Gronwall lemma and the choice α = 1∕T finally yields the assertion. □

Note that the above estimate does not yet give full control over the solution. A repeated application, however, allows us to prove the following stability estimate.

Lemma 2

Let p h , m h denote a solution of Problem 1 . Then

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

for all 0 ≤ t  T with C′(T) = C′T and C′ independent of T and of the solution.

Proof

As a direct consequence of the Poincaré inequality, one has

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

The first terms in these estimates are already covered by Lemma 1. From the two Eqs. (18)–(19) with \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), we further deduce that

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

Bounds for \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) can be obtained by formally differentiating (18)–(19) with respect to time and applying Lemma 1 for the resulting system. A combination of the above estimates then yields the assertion of the lemma. □

Remark 1

Problem 1 formally amounts to a finite dimensional system of differential algebraic equations. From the stability estimates of Lemma 2 and [6, Theorem 4.12], one can deduce that this system is solvable for any choice of admissible initial values. The semidiscretization is thus well-defined. Further note that the stability constants in Lemma 1 and 2 are independent of the polynomial degree k.

5 Error Estimates

As usual, we decompose the error according to \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) into approximation and discrete error components. The first part can be handled by the following estimates [11]. To simplify notation, we assume that the mesh is quasi-uniform in the following.

Lemma 3

Let w  H s+1(T h), 0 ≤ s  k. Then

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(20)

For any w  L 2(x L, x R) ∩ H s(T h), 0 ≤ s  k, one has

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(21)

Here H s(T h) = {w  L 2(x L, x R): w|T ∈ H s(T)} is the space of piecewise smooth functions and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) is the corresponding seminorm. Moreover, the constant C in the estimates is independent of h and k.

Using Eqs. (9)–(10) and (18)–(19) characterizing the continuous and the discrete solutions, one can see that the discrete error components \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) satisfy Eqs. (18)–(19) with initial values \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), and right hand sides given by

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

By the a-priori estimates of Lemma 2, one then obtains the following result.

Lemma 4

Let d  P 0(T h) be piecewise constant. Then for all 0 ≤ t  T one has

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

with a constant C″(T) = CT and Cindependent of h, k, T, and of the solution.

Proof

We apply Lemma 2 for \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and then estimate the terms on the right hand side of the result step by step. By definition of the initial values, we have \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \). Moreover,

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

where we used the definition of the initial value m h(0) in the second and (17) in the third step. Thus \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), and in a similar manner, one can show \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \). This explains the first two terms in the estimate in the lemma. The terms under the integral are derived by estimating \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and the derivatives \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) via the triangle inequality, and noting that

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

where we used that d is piecewise constant. □

Remark 2

A similar result can be proven for piecewise smooth d ∈ W 1, (T h) and additional terms of the form \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) arise. For d ∈ W 1, (T h), the product of the two terms again has optimal approximation order.

By combination of the above estimates, we finally obtain the following result.

Theorem 1

Let (A1)–(A2) hold and d  W 1, (T h). Furthermore, let (p, m) be a sufficiently smooth solution of (6)(8). Then for all 0 ≤ t  T, one has

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

For sufficiently smooth solutions, the proposed method thus converges at optimal order in h and at almost optimal order in the polynomial degree k.

6 Extension to Networks

We now illustrate that our method and the convergence results of the previous section can be generalized easily to pipe networks. Let \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) denote a directed graph with vertices \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and edges \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \); see Fig. 1 for illustration. For any edge e = (v 1, v 2), we define n e(v 1) = −1 and n e(v 2) = 1. The matrix N with entries N ij = n ej(v i) then is the incidence matrix of the graph. For any vertex \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), we define \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), and we set \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) which gives a decomposition \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) into interior and boundary vertices.

To every edge e, we associate a positive length e, and we identify e with [0, e] in the sequel. This allows us to define spaces \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) of, respectively, integrable and piecewise smooth functions on the graph. The flow of gas in a pipe network is then described as follows: On every edge e representing a pipe, we require that

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(22)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(23)

where f e = f|e denotes the restriction of a function \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) to one edge. The equations for the individual pipes are coupled by algebraic conditions

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(24)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(25)

at the pipe junctions, and at the boundary vertices, we assume that

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(26)

Inhomogeneous and other types of boundary conditions can again be incorporated with minor modifications. For the analysis of the problem, we now utilize the spaces

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(27)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(28)
Fig. 1
figure 1

Directed graph \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) modeling the pipe network topology used for numerical tests

which are the natural generalization of those used for the analysis on a single pipe. Any solution (p, m) of (22)–(26) then again satisfies \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), m(t) ∈ H(div), and

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(29)
$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(30)

for all \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), and all 0 < t < T. Here (v, w) =∑e(v e, w e)e with (v e, w e)e =∫e v e w e dx denotes the scalar product on \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \).

Remark 3

Let us note that (29)–(30) has exactly the same form as the variational problem (18)–(19) on a single pipe. The inexact Petrov-Galerkin method and all results derived in the previous sections therefore translate almost verbatim to the network setting; let us refer to [4] for details and similar results for a different method, and to Sect. 9 for numerical illustration.

7 Remarks on the Efficient Implementation

In the discretization of (29)–(30), also compare with (18)–(19), the continuity and boundary conditions (24)–(26) are directly incorporated in the definition of the spaces \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and V h ⊂ H(div). For the implementation, it may be more convenient to use larger spaces \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \), and to enforce some of the boundary and coupling conditions (24)–(26) explicitly by additional equations. Using the wording of [1], this approach of relaxing continuity conditions might be called hybridization. Since the resulting method is algebraically equivalent to the original scheme based on function spaces with incorporated coupling and boundary conditions, all results of the previous sections apply verbatim also to the method obtained after hybridization.

8 Nonlinear Problems

The formal extension of the Petrov-Galerkin method to nonlinear problems is straight-forward. The discrete variational formulation for (1)–(2), for instance, reads

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$

Numerical quadrature can be used in practice to facilitate the handling of the nonlinear terms. We do not give a complete convergence analysis here, but instead, we will demonstrate by numerical tests that for smooth solutions, the convergence results of Theorem 1 remain valid, at least in the practically relevant case of nonlinear friction.

9 Numerical Results

We now illustrate the theoretical results of Sect. 5 by numerical tests. For our computations, we consider the pipe network depicted in Fig. 1. As a first test case, we consider the linear problem (22)–(25) with inhomogeneous boundary conditions

$$\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} $$
(31)

and we set \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) and \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) in the following. All pipes are chosen of unit length  = 1 and the model parameters are set to a ≡ b ≡ d ≡ 1. The simulation is started from a stationary state for the boundary values at initial time. The results of the computations are summarized in the left column of Table 1. As predicted by our theoretical results, we observe second order convergence.

Table 1 Errors e h = (ap h(T) − p h∕2(t)∥2 + bm h(T) − m h∕2(T)∥2)1∕2 at time T = 10 obtained with the Petrov-Galerkin approximation for the network problem with different gas flow models: linear model (left), semilinear model (middle), and quasilinear model (right)

We now repeat our numerical tests for the same network but with a semilinear gas flow model resulting from (1)–(3) by dropping the nonlinear term \(\displaystyle \begin{aligned} \begin{aligned} u_t + f(u)_x &= 0, & (x,t) \in \mathbb{R}\times \mathbb{R}_{+},\\ u(0) &= u_0, \end{aligned} {} \end{aligned} \) in Eq. (2). The model parameters are chosen as A = 1, c = 1, and λ∕(2D) = 7∕2; the latter was selected such that average of the resulting mass flow was similar to that of the linear model considered above. The computational results are depicted in the middle column of Table 1. Also for this nonlinear friction model, we observe second order convergence. These results can be explained theoretically in a similar way as those for the linear case by using a perturbation argument. In the right column of Table 1, we display the corresponding results for the quasilinear flow model (1)–(3) with the same parameters as used in the semilinear case. Note that a decrease in the convergence rates to first order is observed here. This is no surprise, since our analysis heavily relied on the anti-symmetry of the spatial derivative terms in (18)–(19), which is no longer valid for the quasilinear model (1)–(2).

In Fig. 2, we display the flow rates m|v at the boundary vertices v 1 and v 6 for the three different gas flow models discussed above as function of time. The results are in reasonable agreement. In summary, the semilinear model seems to yield the best compromise between modelling errors and convergence order.

Fig. 2
figure 2

Flow rates at boundary vertices v 1 and v 6 for linear, semilinear, and quasilinear flow models