An Adaptive Model Switching and Discretization Algorithm for Gas Flow on Networks

Similar documents
Order of Accuracy. ũ h u Ch p, (1)

Consider a function f we ll specify which assumptions we need to make about it in a minute. Let us reformulate the integral. 1 f(x) dx.

LIMITS AND DERIVATIVES CONDITIONS FOR THE EXISTENCE OF A LIMIT

Chapter 5 FINITE DIFFERENCE METHOD (FDM)

Numerical Differentiation

How to Find the Derivative of a Function: Calculus 1

Introduction to Derivatives

NUMERICAL DIFFERENTIATION. James T. Smith San Francisco State University. In calculus classes, you compute derivatives algebraically: for example,

Lecture 15. Interpolation II. 2 Piecewise polynomial interpolation Hermite splines

Parameter Fitted Scheme for Singularly Perturbed Delay Differential Equations

Exam 1 Review Solutions

Simulation and verification of a plate heat exchanger with a built-in tap water accumulator

5 Ordinary Differential Equations: Finite Difference Methods for Boundary Problems

MATH745 Fall MATH745 Fall

Convergence and Descent Properties for a Class of Multilevel Optimization Algorithms

Chapters 19 & 20 Heat and the First Law of Thermodynamics

Material for Difference Quotient

1. Introduction. We consider the model problem: seeking an unknown function u satisfying

The Verlet Algorithm for Molecular Dynamics Simulations

f a h f a h h lim lim

lecture 26: Richardson extrapolation

Test 2 Review. 1. Find the determinant of the matrix below using (a) cofactor expansion and (b) row reduction. A = 3 2 =

Mathematics 5 Worksheet 11 Geometry, Tangency, and the Derivative

Polynomial Interpolation

LECTURE 14 NUMERICAL INTEGRATION. Find

Chapter 4: Numerical Methods for Common Mathematical Problems

ch (for some fixed positive number c) reaching c

Finding and Using Derivative The shortcuts

Combining functions: algebraic methods

Copyright c 2008 Kevin Long

Pre-Calculus Review Preemptive Strike

Optimal parameters for a hierarchical grid data structure for contact detection in arbitrarily polydisperse particle systems

THE IDEA OF DIFFERENTIABILITY FOR FUNCTIONS OF SEVERAL VARIABLES Math 225

Exercises for numerical differentiation. Øyvind Ryan

Lecture 21. Numerical differentiation. f ( x+h) f ( x) h h

Numerical Experiments Using MATLAB: Superconvergence of Nonconforming Finite Element Approximation for Second-Order Elliptic Problems

4. The slope of the line 2x 7y = 8 is (a) 2/7 (b) 7/2 (c) 2 (d) 2/7 (e) None of these.

158 Calculus and Structures

REVIEW LAB ANSWER KEY

Arbitrary order exactly divergence-free central discontinuous Galerkin methods for ideal MHD equations

Numerical Analysis MTH603. dy dt = = (0) , y n+1. We obtain yn. Therefore. and. Copyright Virtual University of Pakistan 1

Department of Mathematical Sciences University of South Carolina Aiken Aiken, SC 29801

1 Power is transferred through a machine as shown. power input P I machine. power output P O. power loss P L. What is the efficiency of the machine?

HOW TO DEAL WITH FFT SAMPLING INFLUENCES ON ADEV CALCULATIONS

1. Questions (a) through (e) refer to the graph of the function f given below. (A) 0 (B) 1 (C) 2 (D) 4 (E) does not exist

AMS 147 Computational Methods and Applications Lecture 09 Copyright by Hongyun Wang, UCSC. Exact value. Effect of round-off error.

Math 102 TEST CHAPTERS 3 & 4 Solutions & Comments Fall 2006

Volume 29, Issue 3. Existence of competitive equilibrium in economies with multi-member households

APPROXIMATION OF CRYSTALLINE DENDRITE GROWTH IN TWO SPACE DIMENSIONS. Introduction

Derivation Of The Schwarzschild Radius Without General Relativity

1. Which one of the following expressions is not equal to all the others? 1 C. 1 D. 25x. 2. Simplify this expression as much as possible.

CHAPTER (A) When x = 2, y = 6, so f( 2) = 6. (B) When y = 4, x can equal 6, 2, or 4.

lim 1 lim 4 Precalculus Notes: Unit 10 Concepts of Calculus

HOMEWORK HELP 2 FOR MATH 151

1watt=1W=1kg m 2 /s 3

A = h w (1) Error Analysis Physics 141

1 Calculus. 1.1 Gradients and the Derivative. Q f(x+h) f(x)

ADAPTIVE MULTILEVEL INEXACT SQP METHODS FOR PDE CONSTRAINED OPTIMIZATION

Variational Localizations of the Dual Weighted Residual Estimator

Precalculus Test 2 Practice Questions Page 1. Note: You can expect other types of questions on the test than the ones presented here!

Investigating Euler s Method and Differential Equations to Approximate π. Lindsay Crowl August 2, 2001

Key Concepts. Important Techniques. 1. Average rate of change slope of a secant line. You will need two points ( a, the formula: to find value

The derivative function

The total error in numerical differentiation

SECTION 3.2: DERIVATIVE FUNCTIONS and DIFFERENTIABILITY

Flavius Guiaş. X(t + h) = X(t) + F (X(s)) ds.

Sin, Cos and All That

Lines, Conics, Tangents, Limits and the Derivative

Polynomial Interpolation

. If lim. x 2 x 1. f(x+h) f(x)

Definition of the Derivative

A method of Lagrange Galerkin of second order in time. Une méthode de Lagrange Galerkin d ordre deux en temps

Chapter 1 Functions and Graphs. Section 1.5 = = = 4. Check Point Exercises The slope of the line y = 3x+ 1 is 3.

Topics in Generalized Differentiation

CONVERGENCE OF AN IMPLICIT FINITE ELEMENT METHOD FOR THE LANDAU-LIFSHITZ-GILBERT EQUATION

A finite element approximation for the quasi-static Maxwell Landau Lifshitz Gilbert equations

arxiv: v3 [cs.ds] 4 Aug 2017

Effect of the Dependent Paths in Linear Hull

Learning based super-resolution land cover mapping

WYSE Academic Challenge 2004 Sectional Mathematics Solution Set

Simulations of the turbulent channel flow at Re τ = 180 with projection-based finite element variational multiscale methods

On convexity of polynomial paths and generalized majorizations

Continuity. Example 1

Mass Lumping for Constant Density Acoustics

1 The concept of limits (p.217 p.229, p.242 p.249, p.255 p.256) 1.1 Limits Consider the function determined by the formula 3. x since at this point

2.11 That s So Derivative

Math 2921, spring, 2004 Notes, Part 3. April 2 version, changes from March 31 version starting on page 27.. Maps and di erential equations

, meant to remind us of the definition of f (x) as the limit of difference quotients: = lim

Numerical analysis of a free piston problem

CONVERGENCE ANALYSIS OF FINITE ELEMENT SOLUTION OF ONE-DIMENSIONAL SINGULARLY PERTURBED DIFFERENTIAL EQUATIONS ON EQUIDISTRIBUTING MESHES

A Numerical Scheme for Particle-Laden Thin Film Flow in Two Dimensions

1.5 Functions and Their Rates of Change

Continuity and Differentiability Worksheet

Blanca Bujanda, Juan Carlos Jorge NEW EFFICIENT TIME INTEGRATORS FOR NON-LINEAR PARABOLIC PROBLEMS

ERROR BOUNDS FOR THE METHODS OF GLIMM, GODUNOV AND LEVEQUE BRADLEY J. LUCIER*

UNIVERSITY OF SASKATCHEWAN Department of Physics and Engineering Physics

Higher Derivatives. Differentiable Functions

Taylor Series and the Mean Value Theorem of Derivatives

Click here to see an animation of the derivative

5.1 We will begin this section with the definition of a rational expression. We

Transcription:

Procedia Computer Science 1 (21) (212) 1 1 1331 134 Procedia Computer Science www.elsevier.com/locate/procedia International Conference on Computational Science, ICCS 21 An Adaptive Model Switcing and Discretization Algoritm for Gas Flow on Networks Pia Domscke, Oliver Kolb and Jens Lang Tecnisce Universität Darmstadt, Department of Matematics and DFG Graduate Scool of Excellence Computational Engineering, Dolivostr. 15, 64293 Darmstadt Abstract We are interested in te simulation and optimization of gas transport in networks. Tose networks consist of pipes and various oter components like compressor stations and valves. Te gas flow troug te pipes can be modelled by different equations based on te Euler equations. For te oter components, purely algebraic equations are used. Depending on te data, different models for te gas flow can be used in different regions of te network. We use adjoint tecniques to specify model and discretization error estimators and present a strategy tat adaptively applies te different models wile maintaining te accuracy of te solution. c 212 Publised by Elsevier Ltd. Open access under CC BY-NC-ND license. Keywords: model adaptivity, adjoint equations, gas flow 1. Introduction Intense researc as been done in te field of simulation and optimization of gas transport in networks in te last years [1, 2, 3, 4, 5, 6, 7]. Te aim of operating a gas transmission network is to minimize te running costs of te compressor stations wereas te contractual demand of te customers as to be met. Te large extent of gas networks and teir ig complexity make te optimization a difficult computational task. For te optimization, it is necessary to efficiently solve te underlying equations on networks witin a certain tolerance. In tis paper, we present an adaptive model switcing and discretization algoritm tat is suitable for tese requirements. Te equations describing te flow of gas troug a pipe are based on te Euler equations, a yperbolic system of partial differential equations. Te transient flow of gas may be described appropriately by equations in one space dimension. Oter components of te network, like compressor stations and valves, follow algebraic equations. For te wole network, adequate initial, boundary (at sources and sinks) and coupling conditions ave to be given. Solving yperbolic PDEs in one space dimension does not pose a callenge, but te complexity of te wole problem increases wit te size of te network. Tus, we use a ierarcy of tree models tat describe te flow of gas wit different accuracy, but also wit different computational effort. We ten want to use te simplified models in regions wit low activity, wile sopisticated models ave to be used in regions, were te dynamical beaviour as to be resolved in detail. Email address: domscke@matematik.tu-darmstadt.de (Pia Domscke) 1877-59 c 212 Publised by Elsevier Ltd. Open access under CC BY-NC-ND license. doi:1.116/j.procs.21.4.148

1332 P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 P. Domscke et al. / Procedia Computer Science (21) 1 1 2 Since te beaviour of te network canges bot in space and time, an automatic steering of te model ierarcy as well as te discretization is necessary. We introduce error estimators for te discretization and te model errors using adjoint tecniques and present a strategy to automatically balance tose errors wit respect to a given tolerance. Existent software packages like SIMONE [8] may also use different models for te simulation task. However, one model as to be cosen in advance, wic is often too restrictive. Te paper is organized as follows. Te modelling of te network as well as te different models are introduced in Sect. 2. In Sect. 3, error estimators for bot, te model and te discretization error, are derived using adjoint tecniques. We present a strategy to adaptively balance model and discretization error in Sect. 4. Numerical Results are given in Sect. 5. 2. Model Hierarcy and Network In tis section, we describe te modelling of te network. We introduce a ierarcy consisting of tree different models describing te flow of gas troug a pipe. Eac model results from te previous one by making furter simplifying assumptions [1]. Te most complex model is te nonlinear model followed by te linear model. Te most simple model used is te algebraic model (see Fig. 1). Also, furter network components are given. nonlinear model semilinear model algebraic model v c p t = q t = Figure 1: Model ierarcy 2.1. Network Te gas network is modelled as a directed grap G = (J, V) wit edges J and vertices V (nodes, brancing points). Te set of edges J consists of pipes j J p, compressor stations c J c and valves v J v. Eac pipe j J p is defined as an interval [x a j, xb j ] wit a direction from xa j to x b j. In eac pipe, one of te models olds and adequate initial and coupling as well as boundary conditions ave to be specified. Valves and compressor stations are described by algebraic equations. 2.2. Nonlinear Model Te isotermal Euler equations, wic describe te flow of gas, consist of te continuity and te momentum equation togeter wit te equation of state for real gases. Wit some simplifying assumptions, as te pipe being orizontal and a constant speed of sound [7], te equations are p t + ρ c 2 A q x =, q t + A p x + ρ c 2 ρ A ( ) q 2 p x = λρ c 2 q q 2dAp. (1) Here, q denotes flow rate under standard conditions (1 atm air pressure, temperature of C), p te pressure, c te speed of sound, λ te friction coefficient, d te diameter and A te cross-sectional area of te pipe, and ρ te density under standard conditions. 2.3. Semilinear Model If te velocity of te gas is muc smaller tan te speed of sound, i.e., v c wit v = ρq ρa, we can neglect te nonlinear term in te spatial derivative of te momentum equation in (1). Tis yields a semilinear model p t + ρ c 2 A q x =, q t + A ρ p x = λρ c 2 q q 2dAp. (2)

P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 1333 P. Domscke et al. / Procedia Computer Science (21) 1 1 3 2.4. Algebraic Model A furter simplification leads to te stationary model: Setting te time derivatives in (2) to zero results in an ordinary differential equation, wic can be solved analytically: q = const., p(x) = p(x ) 2 + λρ2 c2 q q (x da 2 x). (3) Here, p(x ) denotes te pressure at an arbitrary point x [, L]. Setting x =, tat is, p(x ) = p() = p in at te inbound of te pipe, and x = L, tat is, p(x) = p(l) = p out at te end of te pipe, yields te algebraic model [9]. 2.5. Furter Network Components Besides pipes, tere are some oter components a network can consist of. Tose are, for example, compressor stations and valves. Tese components are, like te pipes, modelled as edges. Tis way, te coupling conditions at te intersections are still valid. Flow rate and pressure are determined by algebraic equations tat can be nonlinear. Compressor Station. A compressor station is a facility tat increases te pressure of te gas. Running a compressor is relatively costly since te compressor station consumes some of te gas. Te equation for te fuel consumption of a compressor is given by [1] te compressor power P is determined by F(p in, p out, q in ) = c F q in P(p in, p out, q in ) = c P q in ( pout p in ( pout p in ) γ 1 γ ) γ 1 γ 1, (4) 1. (5) Here, γ is te isentropic coefficient of te gas, and c F and c P are compressor specific constants. Te control of te compressor is given by te pressure difference. Valves. Valves are used to regulate te flow of te gas by opening or closing. In case of an open valve, te equations q in = q out, p in = p out old. If te valve is closed, it is q in = q out =. 3. Error Estimators Wit te different models for te pipes and te oter network components we can solve te wole network as a system using adequate initial, boundary and coupling conditions. A way to acieve a compromise between te accuracy of te solution and te computational costs is to use te more complex model only wen necessary and to refine te discretization only were needed. Using te solution of adjoint equations as done in [11, 12, 7], we deduce a model and a discretization error estimator to measure te influence of te model and te discretization on a user-defined output functional M. Te functional M can be of any form, for example measuring te pressure value trougout te network over te wole time interval, M(p) = p(x, t)dx. Anoter possibility is to measure te costs of te compressor stations in form of te power consumption, T M(p, q) = F c (t)dt. (6) c J c Ω

1334 P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 P. Domscke et al. / Procedia Computer Science (21) 1 1 4 Let ξ = (ξ 1,ξ 2 ) T be te adjoint pressure and flow rate of one of te models wit respect to te functional M. We now use te adjoint equations to assess te simplified models wit respect to te quantity of interest. Let u = (p, q) T be te solution of te nonlinear model (1) and u = (p, q ) T te discretized solution of te semilinear model (2). For te discretization of te PDE, we apply an implicit box sceme [13]. Ten te difference between te output functional M(u) and M(u ) can be approximated using Taylor expansion. Inserting te solution ξ of te adjoint system, we get a first order error estimator for te model and te discretization error respectively as in [7] (see also [12]): wit te estimators η m and η as follows: η -NL m = Ω η = Ω M(u) M(u ) η m + η (7) ξ T ξ T ρ c 2 (q ) 2 Ap dx dt (8) x p t + ρc2 A q x q t + A ρ p x + λρc2 q q 2dAp dx dt. (9) If, te oter way round, u denotes te solution of te semilinear model (2) and u te discretized solution of te nonlinear model, one gets te same estimator for te model error (except for te sign), and te discretization error reads as follows, = p ξ T t + ( ρc2 A q x Ω q t + A ρ p x + ρc2 (q ) 2 dx dt. (1) A p )x + λρc2 q q 2dAp Since te algebraic model can be solved exactly, te discretization error disappears and one only gets an estimator for te model error ( ) p η ALG- m = ξ T dx dt (11) Ω q t wit ξ being te solution of te adjoint equations eiter of te semilinear model or of te algebraic model. Here, u = (p, q) T denotes te solution of te stationary model (3). Te discretization error estimators and η may be split up into a temporal and a spatial discretization error estimator as follows. Let u be te exact and u be te discretized solution of te nonlinear model (1). We use a sort notation of (1), i.e., u t + f (u) x = g(u), wic yields = ξ ( T u t + f (u ) x g(u ) ) dx dt Ω = ξ ( T (u t u t ) + ( f (u ) x f (u) x ) (g(u ) g(u)) ) dx dt Ω since u is te exact solution of (1). We may split te integral into two parts = ξ T (u t u t )dxdt + ξ ( T ( f (u ) x f (u) x ) (g(u ) g(u)) ) dx dt Ω Ω } {{ }} {{ } =: t =: x (12) Te temporal and spatial discretization error estimator for te semilinear model are derived analogously. For te computation, te exact solution is approximated by a iger order reconstruction using neigboring points. For te time derivative, we use a polynomial reconstruction of order 2 and denote it by u t R t (u ). Te spatial derivative of f and te value of g are reconstructed wit order 4, giving f (u) x R x ( f (u )) and g(u) R(g(u )), respectively.

P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 1335 P. Domscke et al. / Procedia Computer Science (21) 1 1 5 Te estimators computed are ten t ξ ( T u t R t (u ) ) dx dt, Ω ( ( ξ T f (u ) x R x ( f (u )) ) ( g(u ) R(g(u )) )) dx dt. x 4. Balancing Model and Discretization Error Ω Wit te above defined estimators, we can introduce a strategy to balance te model and discretization error inside te network. In practice, often smaller time orizons are optimized. Tus, we do not control te overall error any more, but te relative error piecewise. For tis, we divide te time interval [, T] into subintervals of equal size [T k 1, T k ]. Regarding one subinterval [T k 1, T k ], we can compute te forward as well as te backward/adjoint solution and evaluate te error estimators, wic yields M k (u) M k (u ) η m,k + η t,k + η x,k. Given a tolerance TOL for te relative error, we can approximate te exact error by te estimators giving M k (u) M k (u ) η m,k + η t,k + η x,k M k (u) M k (u ) TOL. (13) We first ceck te discretization error to ensure te discretization to be adequate. Ten, te model error is taken into account. A sceme of te algoritm is given in Fig. 2. Ceck discretization error. First, te discretization is cecked. Given te tolerance TOL as above, we ensure te discretization error to be small compared to te model error by decreasing TOL by a user-defined factor <κ<1 giving κ TOL =: TOL. We demand te discretization error estimator to satisfy η t,k + η x,k < TOL Mk (u ). If te error estimator exceeds te given upper bound, te temporal and spatial discretization errors are treated individually, tat is, η 1 t,k < 2 TOL Mk (u ) and ηx,k 1 < 2 TOL Mk (u ). Ceck Temporal Discretization Error. If te temporal error estimator exceeds te given tolerance, te time step size is marked for refinement. After cecking te spatial discretization error, te time interval [T k 1, T k ] as to be computed again. If, in contrast, te error estimator ηt,k is muc smaller tan te upper bound, te time step size is marked for coarsening. If te current time interval as to be recomputed due to spatial or model errors, te temporal coarsening is neverteless directly applied. Ceck Spatial Discretization Error. Now, te spatial discretization error is estimated locally for eac pipe. We can split up te discretization error estimator from (12) for eac pipe, giving for te nonlinear model x,k = Tk T k 1 j J p x b j x a j ξ ( T ( f (u ) x f (u) x ) (g(u ) g(u)) ) dx dt = x,k, j, j J p analogously for te oter models. Tus, we can estimate te spatial discretization error for eac pipe in te time interval [T k 1, T k ] wit te corresponding model, wic yields < 1 2 TOL Mk (u ). j J p η x,k, j

1336 P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 P. Domscke et al. / Procedia Computer Science (21) 1 1 6 start: k = 1 solve for interval [T k 1, T k ] compute adjoint for [T k 1, T k ] refine temporal and/or spatial discretization ceck discretization error ceck spatial discretization error discretization ok? NO ceck temporal discretization error YES ceck total error total error ok? NO ceck model error and adjust models YES accept [T k 1, T k ], k = k + 1 coarsen temporal and/or spatial discretization and switc down model were possible Figure 2: Sceme of te balancing algoritm

P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 1337 P. Domscke et al. / Procedia Computer Science (21) 1 1 7 For te inequality to old, it suffices to claim η 1 x,k, j < 2 TOL Mk (u ). j J p In order to get an upper bound for eac pipe itself, we uniformly distribute te target functional, i.e., we divide it by te number of pipes, giving η 1 x,k, j < 2 TOL M k (u ) J j J p. p If ηx,k, j exceeds te given tolerance, te pipe is marked for refinement. If instead, te error estimator is muc smaller tan te rigt and side, te pipe is marked for coarsening. Te time interval [T k 1, T k ] is computed again wit a finer discretization were needed. Ceck Total Error. If te discretization error is accepted, te total error estimator ηm,k + η t,k + η x,k is evaluated. If η m,k + η t,k + η x,k TOL Mk (u ), te time interval [T k 1, T k ] is accepted, k is increased and te next interval is computed. Ceck Model Error and Adjust Models. If te discretization error is small enoug, but te total error is not, te model errors of all pipes are cecked, i.e., te model error estimators (8) and/or (11) are evaluated for eac pipe. For te pipes using te semilinear or algebraic model, first te estimators wit respect to te iger models are evaluated. If te error estimator exceeds te given tolerance, tat is, η m,k, j TOL m Mk(u ) J, p wit TOL m := (1 κ) TOL, te pipe is supposed to use te model above subject to te ierarcy. Ten, te estimators wit respect to te lower models are computed for te pipes using te nonlinear or te semilinear model. If te error estimator is muc less tan te given tolerance, tat is, η m,k, j < s TOL m Mk(u ) J, p wit a sift down factor s 1 (e.g. 1 1 or 1 2 ), te pipe can use te lower model for te next calculations. Te time interval [T k 1, T k ] is computed again wit te adjusted models. 5. Numerical Results In tis section, we give numerical results for a medium sized real life network. Te network consists of 12 pipes (P1 P1, wit lengts between 3km and 1km), 2 sources (S1 S2), 4 consumers (C1 C4), 3 compressor stations (Comp1 - Comp3) and one control valve (CV1). Te grap of te network is sown in Fig. 3. Te simulation starts wit stationary initial data. Te boundary conditions and te control for te compressor stations are time-dependent. Te target functional is given by te total fuel gas consumption of te compressors, i.e. T M(u) = F c (t)dt. c J c Te simulation time is 144 seconds wit an initial time step size Δt = 18s. Te subintervals are 36s eac. Te initial spatial step size is Δx = 1m. Te factor κ is set to 1 1.

1338 P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 P. Domscke et al. / Procedia Computer Science (21) 1 1 8 C1 S1 P4 S2 Comp1 Comp2 Comp3 P1 P2 P3 P5 P6a P7a P9 P1 C3 P6b P7b C4 CV1 P8 C2 Figure 3: Network wit compressor stations and control valve Table 1 sows te maximal relative error in te target functional M k (u) M k (u ) rel.err. = max, k M k (u) te total target functional, te maximal and te minimal time and spatial step size used and te total time for te computation subject to te tolerance TOL. As an approximation of te exact solution we computed a solution wit te nonlinear model and a finer discretization tan used in te adaptive algoritm, wic is sown in te last row. For a comparison of te computation time, we computed a solution witout adaptivity using te nonlinear model. Te discretization was cosen to be similar to te one used at tolerance 1 4, but no error estimators were calculated. Te time needed for computation was 4.2e+1 seconds, i.e., te overead for te adaptive model switcing and discretization is only 3.2%. Clearly, te adaptive algoritm also delivers reliable information about te accuracy of te discrete solution. Te computation was done on a 31MHz AMD Atlon TM 64 X2 Dual Core 6+. Table 1: Result of te algoritm using different values of TOL TOL rel.err. M(u ) max/min Δt max/min Δx time [s] 1e-1 5.5264e-2 13.24217 18/18 2,/1, 7.2e-2 1e-2 4.234e-3 12.756843 9/9 2,/1, 1.84e-1 1e-3 2.5513e-4 12.73996 112.5/112.5 2,/2,5 1.18e+ 1e-4 3.3264e-5 12.728721 7.3125/7.3125 1,/625 4.34e+1 reference solution 12.728459 3.515625 312.5 1.46e+2 Besides te discretization, it is also interesting ow te model switcing part works depending on TOL. Table 2 sows ow often wic model is used during calculation. It can be seen tat te smaller te tolerance te better models are used. Table 2: Models used during calculation depending on te tolerance TOL TOL ALG NL 1e-1 1% % % 1e-2 5.% 5.% % 1e-3 8.3% 91.7% % 1e-4.% 75.% 25.%

P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 1339 P. Domscke et al. / Procedia Computer Science (21) 1 1 9 Figure 4 sows a snapsot of te simulation at time t = 36s wit TOL = 1 4. At te sources and sinks, te upper numbers denote te pressure in bar, te lower ones denote te flow rate. At te compressor stations, te upper numbers are te increase in pressure and also te flow rate is sown below. At all inner nodes, only te pressure is printed. At eac pipe, also te used model is indicated. Te small wite dots in te tick black lines represent te discretization. Note tat te picture is not to scale. 6.2 1. 63.3 59.5 21.25 +8.87 +7.37 6. NL NL NL 149.4 59.5 56.5 35.43 65.3 6.6 58. 253.54 65.4 +.75 62.3 198.94 63. 62.8 17.5 62.8 1. 62.7 time = 36. seconds 62.7 6.6 52. Figure 4: Snapsot of te network at time t = 36 s 6. Summary We presented an adaptive model switcing and discretization algoritm. For tat we used a ierarcy of models tat describe te flow of gas troug a pipe qualitatively different. Using adjoint tecniques, we introduced error estimators for te model errors as well as for te discretization errors. Wit tese estimators we developed an algoritm tat balances te model and discretization errors subject to a given tolerance and automatically switces between te models in te ierarcy. It could be seen tat for different tolerances, te discretization was adaptively adjusted and also te different models were used. Also, if te algoritm is used in an optimization framework, many nonlinearities can be avoided, since te nonlinear model is only used were needed. Tat means a dramatic reduction of complexity and degrees of freedom for te optimization part. Acknowledgments. Tis paper was supported by te German Researc Foundation (DFG) under te grant LA1372/5-1. References [1] P. Bales, Hierarcisce Modellierung der Eulerscen Flussgleicungen in der Gasdynamik, Diploma tesis, Tecnisce Universität Darmstadt, Department of Matematics, Darmstadt (25). [2] M. Banda, M. Herty, A. Klar, Coupling conditions for gas networks governed by te isotermal euler equations, NHM 1 (2) (26) 295 314. [3] A. Martin, M. Möller, S. Moritz, Mixed integer models for te stationary case of gas network optimization, Matematical Programming 15 (26) 563 582. [4] S. Moritz, A mixed integer approac for te transient case of gas network optimization, P.D. tesis, TU Darmstadt (26). [5] P. Bales, B. Geißler, O. Kolb, J. Lang, A. Martin, A. Morsi, Combination of nonlinear and linear optimization of transient gas networks, Tec. Rep. 2552, TU Darmstadt (28). [6] M. Banda, M. Herty, Multiscale modeling for gas flow in pipe networks, Mat. Met. Appl. Sci. 31 (28) 915 936. doi:1.12/mma.948.

134 P. Domscke et al. / Procedia Computer Science 1 (212) 1331 134 P. Domscke et al. Procedia Computer Science (21) 1 1 1 [7] P. Bales, O. Kolb, J. Lang, Hierarcical modelling and model adaptivity for gas flow on networks, in: Computational Science - ICCS 29, Vol. 5544 of Lecture Notes in Computer Science, Springer Berlin / Heidelberg, 29, pp. 337 346. [8] Simone software. URL ttp://www.simone.eu/simone-simonesoftware.asp [9] E. Sekirnjak, Transiente Tecnisce Optimierung, Entwurf, PSI AG (November 2). [1] M. Herty, Modeling, simulation and optimization of gas networks wit compressors, Networks and Heterogeneous Media 2 (1) (27) 81 97. [11] R. Becker, R. Rannacer, An optimal control approac to a posteriori error estimation in finite element metods, Acta numerica 1 (21) 1 12. [12] M. Braack, A. Ern, A posteriori control of modeling errors and discretization errors, SIAM Journal of Multiscale Modeling and Simulation 1 (2) (23) 221 238. [13] O. Kolb, J. Lang, P. Bales, An implicit box sceme for subsonic compressible flow wit dissipative source term, Numerical Algoritms 53 (2) (21) 293 37. doi:1.17/s1175-9-9287-y.