A LOCAL TIME STEPPING METHOD FOR DISTRICT

continuity equation leads to (3) @xv= 0 : Knowing that vis constant in space the momentum equation can be trans-formed into ... Note that this is expe...

0 downloads 94 Views 624KB Size
A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS RAUL BORSCHE, MATTHIAS EIMER, AND NORBERT SIEDOW Abstract. In this article a new numerical solver for simulations of district heating networks is presented. The numerical method applies the local time stepping introduced in [11] to networks of linear advection equations. In combination with the high order approach of [4] an accurate and very efficient scheme is developed. In several numerical test cases the advantages for simulations of district heating networks are shown.

Keywords: District heating, high order scheme, ADER, advection, local time stepping, network 1. Introduction In densely populated regions, district heating is a possible alternative to conventional heating systems. Heat is generated in central plants and distributed to private and commercial consumers, providing space heating and hot water. There are systems with a high energy efficiency and the pollution can be reduced compared to local boilers. In order to find an efficient control for such systems, fast and accurate simulations are needed. Mathematically the distribution of the temperature in the district heating system can be modeled by a network of linear scalar balance laws [18]. Such very simple equations can be solved efficiently by various numerical methods for hyperbolic conservation laws [25, 20]. Among these methods high order schemes provide more accurate numerical results for comparable computational effort [16, 24, 8, 6]. Not all of these schemes can be directly extended onto networks of conservation laws, but members of the broad class of upwind type methods can be applied [13, 12, 7]. In order to increase the accuracy at fixed computational costs high order schemes on networks have been developed in [4, 22, 5, 19]. In all these methods the time steps are chosen according to CFL conditions. In case of flows on networks the time steps are synchronized in the whole system, i.e. ∆t takes the smallest values of all edges in the network. In this paper we relax this limitation by applying the local time stepping approach of [11]. If the speeds on the edges vary strongly this alone can improve the numerical efficiency. But due to the simple structure of the linear equations the computational costs can be further reduced. As the time steps can be chosen independently for every edge, each ∆t is selected such ¨ t Kaiserslautern, Department of Mathematics, Technische Universita ¨ dinger-Straße, 67663 Kaiserslautern, Germany Erwin-Schro Fraunhofer ITWM, Fraunhoferplatz 1, 67663 Kaiserslautern, Germany E-mail addresses: [email protected] 1

2

RB, ME, AND NS

that the cell values are just shifted in the direction of the flow. Thus the exact values in the pipes are obtained by almost no costs. This lowers the computation times for the entire simulation significantly. This algorithm can be combined with the high order approach of [4] to obtain an efficient tool for accurate and very fast simulations of district heating systems. This paper is organized as follows: In section 2 the model for the flow of hot water in district heating systems is presented. In section 3 the numerical scheme is introduced. This includes a detailed description of the local time stepping and the fluxes across the junctions. Further the extension to a high order method is discussed. Finally, in section 4, three numerical test cases are shown. The numerical efficiency is investigated and the results of the local time stepping scheme are compared to those of high order ADER methods.

2. Modelling A network of a district heating system is composed by several different components. First we describe the mathematical models of the flow in a single pipe. These can be joined to a network and connected to the houses via suitable coupling conditions. The modeling follows the approach presented in [18].

2.1. A single Pipe. Consider a closed pipe filled completely with hot water. A mathematical model can be derived from the conservation of mass and the balance of momentum and energy, which is given by

(1)

∂t ρ + ∂x q = 0   2 λ q|q| q +p =− − g(∂x b) ρ ∂t q + ∂x ρ 2d ρ 4k ∂t (cp ρT ) + ∂x (qcp T ) = − (T − Text ) . d

Here ρ denotes the density of the water, v its velocity in x direction, q = ρv, p the pressure and T is the temperature of the fluid. λ is a friction coefficient for the Darcy-Weisbach friction formula and d the diameter of the tube. The term g(∂x b) ρ takes the vertical elevation b into account, where g is the gravitational acceleration. The right hand side in the third equation is modeling the cooling related to the outer temperature Text with the thermal transmittance k. To obtain a closed model often a closure relation for the pressure p is used. Instead of following this approach we directly provide a closure relation for the density ρ. As the water in the pipes is almost incompressible, but its density is still varying with the temperature, we assume the density to be a function just of T , i.e. ρ = ρ(T ).

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

3

Inserting this Ansatz into the energy equation and with help of the continuity equation (1) we obtain 4k (T − Text ) d 4k cp ρ∂t T + cp T ∂t ρ + qcp ∂x T + cp T ∂x q = − (T − Text ) d 4k ∂t T + v∂x T = − (T − Text ) . cp dρ ∂t (cp ρT ) + ∂x (qcp T ) = −

(2)

By multiplying with ∂T ρ this results in ∂t ρ + v∂x ρ = −

4k∂T ρ (T − Text ) . cp dρ

As the variations of the density due to the external temperature are small we can neglect the term on the right hand side. Using this and again the continuity equation leads to (3)

∂x v = 0 .

Knowing that v is constant in space the momentum equation can be transformed into ρ∂t v + ∂x p = −

λ v|v|ρ − g(∂x b) ρ , 2d

which are the well known incompressible Euler equations [21]. These equations can be further simplified by integrating over the length of the pipe [0, L]. Aside from v(t, x) = v(t) we obtain (4)

ρ¯∂t v + p(L) − p(0) = −

λ 1 v|v|¯ ρ − g(∂x b)¯ ρ, 2d L

RL where ρ¯ = L1 0 ρ dx is the averaged density and we assumed that the vertical slope in the tube is constant. On a single pipe the system composed by the equations (3),(4) and (2) has to be supplemented with boundary conditions. A common choice for v > 0 is to provide p and T at the left and q at the right end. For a pipe in a network these boundary conditions are replaced by coupling conditions in the junctions. 2.2. Network. In a district heating network the hot water is distributed to the houses via a system of pipes. A network of the same structure transports the colder water back to the power plant. Such networks can be modeled by connecting the equations for the pipes via suitable coupling conditions. In order to simplify the notation we assume that all pipes at a junction are orientated away from the junction. This can be realized by local variable transformations of all directed quantities. In both networks we consider the

4

RB, ME, AND NS

following coupling conditions N X

(5)

Ai qi = 0

i=1

(6) (7)

pi = pj N X

i, j = 1, . . . , N, i 6= j

cp Ai qi Ti = 0

i=1

(8)

Tj = Ti

for i, j outgoing flows ,

where all quantities are evaluated at x = 0. The junction is assumed to connect N pipes and Ai denotes the cross section of the i-th pipe. Equation (5) states the conservation of mass and (7) the conservation of energy at the node, as the respective fluxes of (1) are balanced. The continuity of the pressure across the junction is a widely used condition, as e.g. in [1, 9, 10]. Additionally we assume a perfect mixing of flows at the junction, i.e. all outgoing flows have the same temperature (8). Note that this is expected to be the correct number of coupling conditions for the system of (3), (4) and (2). The equations (3) and (4) require one coupling condition independent of the orientation of the flow, which are provided by (5) and (6), while (7) and (8) set the values required by (2) for the outgoing flows. An additional important component in a district heating system are the consumers. Each consumer is demanding a certain amount of thermal power Qk (t). Further the outgoing temperature Tout is assumed to be a fixed value and no mass is lost. This leads to the following equations (9)

qin = qout Qk (t) = cp Aqin (Tin − Tout ) ,

where Tin is the temperature of the flow arriving at the house. These relations of the three quantities qin , qout and Tin are connecting the supplying network with the one for the return flow. Note that (9) can be viewed as the coupling conditions for the flow equations (3) and (4), the boundary value for the temperature is given by the fixed value of Tout . 3. Numerical Method The complete mathematical model of district heating networks is a complex system system of algebraic and partial differential equations. In order to simplify the numerical computations we consider the flow equations and those for the temperature separately. The flow is described by the equations (3), (4), (5), (6) and (9). To close the model the pressures of in- and outflow to the network are specified. The evolution of the temperature follows (2), (7) and (8). Additionally a temperature profile is provided at the entrance of the network and the outflow at the consumers is fixed to Tout . The coupling of these two sub systems is bidirectional. For the temperature equation (2) the velocity has to be provided by the flow solver. On the other hand the flow at the consumers depends on the local temperature (9) at these nodes.

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

5

Numerically this decomposition leads to a splitting algorithm [20], i.e. for a given time interval first the flow is computed and the resulting velocities are used to update the temperatures. Such a splitting reduces the accuracy of the coupled scheme to first order. The equations for the flow can be solved efficiently using solvers which exploit the underlying structure of the network [14, 18, 15]. In the following we focus on numerical methods for the temperature equations. If a flow solver is needed the method described in [15] is used. The time step of the splitting is chosen according to the fastest waves in the temperature model. The equations describing the evolution of the temperature form a network of linear scalar balance laws. For hyperbolic conservation laws many different numerical methods are available [20, 25]. For networks of hyperbolic PDEs mainly upwind type schemes should be considered, as the orientation of the waves can be analyzed individually [3]. For scalar equations often the Godunov method is used [7, 13, 2], which coincides with the Upwind scheme in the linear case [12]. Further there exist some recent approaches extending high order methods on networks of conservation laws [4, 22, 5, 19]. All of these explicit schemes have in common that they operate with the same time step on the whole network. This synchronized time step is determined by the minimal bound of the CFL conditions in all edges ∆tnet = min ∆te , e

where ∆te is the maximal time step allowed on edge e. In the description of the numerical schemes each edge of the network is discretized with an equidistant grid with the spacing ∆x. In the following it is assumed that ∆x is identical on all the edges, but all methods can be used with variable ∆x. 3.1. The Upwind scheme. The upwind scheme is one of the classical first order schemes for scalar conservation laws. If applied to an advection equation (10)

∂t T + v∂x T = 0

with initial condition T (0, x) = T0 (x) it reads ( n+1  ∆t n vTin − vTi−1 Ti = Tin − ∆x  ∆t n − vT n Tin+1 = Tin − ∆x vTi+1 i

if v > 0 , if v < 0 .

R x+1/2 1 n The values Tin = ∆x xi−1/2 T (t , x)dx denote the cell averages on the cell [xi−1/2 , xi+1/2 ] at the time tn . It is well known that for ∆t = ∆x v it computes cell averages at the next time level without numerical error, since the exact solution is given by T (t, x) = T0 (x − vt). In this case the cell averages are just shifted in the direction of the flow. The smaller ∆t is compared to ∆x v the more the numerical solution deviates from the exact values due to numerical diffusion. At a junction only the values for the outgoing edges have to be specified. These share all the the same value due to (7) which is according to (8) given

6

RB, ME, AND NS

by (11)

1

k T1,i =P

j∈Eout cp Aj qj

X

k cp Ai qi Ti,L . i

i∈Ein

Here 1 is the index of the ghost cells at the left end of the edges and Li is the index of the last cell at the right end of edge i. Here it is used that in the Upwind scheme for v > 0 the fluxes across the interfaces are given by the left cell. This notation assumes that v > 0 in all edges and the indices collected in Eout are those of the edges orientated away from the junction and Ein those ending there. This can be achieved by local transformations without changing the actual flows. As mentioned above the time step is determined for all edges as the minimum of all involved CFL conditions. This leads to a ∆t which might be significantly below ∆x vi for some edges i. This can induce strong numerical diffusion in those edges. Corresponding numerical results are provided in section 4. 3.2. A local time stepping scheme. Motivated by the above observation we will construct a procedure which decouples the time step in the network. Note that an exact CFL condition ∆t = ∆x vi could also be achieved by choosing ∆x in each edge independently such that equality is restored with a global time step. But if the vi vary over time this would involve a remeshing after every update, which is costly, especially when higher order methods are considered. In the following we describe an approach where the states in the edges are given at different time levels, each of them following its local time step. The time steps ∆t for an edge are chosen adaptively according to Z t+∆t (12) v(τ )dτ = ∆x . t

This ensures a CFL number equal to 1, even for v varying in time. As the solution T travels exactly one cell in each time step, no computations for the inner cells of the edge are needed. However the update of a given pipe can only be computed if the flux at the first interface, i.e. at the junction, is known. According to (7) these values can only be computed, if the values of all ingoing edges are already determined. Thus the state of an edge can only be updated, if its time step is such that the new time level does not exceed the time level of the ingoing pipes. That means, if (te , ∆te ) are the current time level and time step size of pipe e, the next step is performed if (13)

te + ∆te ≤ tk + ∆tk

is fulfilled for all ingoing pipes k. If (13) is satisfied the ingoing fluxes for pipe e can be computed and its state is updated to the next time level te → te + ∆te . Note that the ingoing pipes not necessarily are already at the time level tk + ∆tk , but their flux at the final interface is determined. In the following we illustrate the procedure for a single junction , where all states are given at time t1 . With these values the fluxes across the last interfaces can be computed and the CFL condition specifies the time span

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

7

for which these values hold. Assume the minimal time span in the network is t2 − t1 , i.e. the fluxes at least up to t2 are known for every edge. Thus the two nodes adjacent to the edge for which the validity of the fluxes expires at t2 can compute all their fluxes up to t2 . These fluxes are used to update the values of this edge to the new time level and to compute new fluxes with a new lifespan. The next edge to be updated is now the one for which the flux expires next at t3 . But the contribution of the previous edge has to be composed by the flux for t2 − t1 and the one for t3 − t2 . Therefore we introduce memory variables for each edge. These store the amount of thermal energy which should enter the corresponding pipe. Following (11) the thermal energy entering an edge i in the time step t2 − t1 is given by   X qi Ai (14) ∆Qi =  qj Aj cp Tj  P (t2 − t1 ) . j∈Eout qj Aj j∈Ein

Accordingly the memory variable MV i is filled via (15)

sign(vi )

MV i

sign(vi )

= MV i

+ ∆Qi .

Note that we introduce for each edge i two memory variables, one at the left end MV 1i and another at the right end MV −1 i . This is needed if the orientation of the flow changes, i.e. there is always a memory variable at the inflow. Whenever a pipe fulfils the update criterion (13), after the node update for both adjacent nodes, its cell values are updated. For positive (negative) flow velocity, the inner cells simply shift to the right (left). The energy stored in the last (first) cell exits and is transferred to other pipes. The first |v | (last) cell value is computed as the average over all fluxes stored in MV i i : (16)

|v |

MV i i . T = qi Ai cp ∆ti

Since all thermal energy has entered the pipe, the value of MV i is reset to zero. The ordering of the local time steps is illustrated in figure 1 for a junction connecting three pipes with flow entering from the e1 and exiting into e2 and e3 . It is assumed that the CFL bounds of the edges restrict the local time steps to ∆t1 = 1, ∆t2 = 0.5 and ∆t3 = 32 respectively. The vertical axis in the sub figures displays the time, possible time steps are drawn in light gray, completed time steps in dark gray. Starting at t = 0, all states have to reach the final time level tend = 2. In every step, the algorithm calculates the next time level for all pipes satisfying condition (13). Since ∆t2 ≤ ∆ti , i = 1, 3 the first pipe to be updated is e2 , see figure 1a. The energy flux over the junction can be computed up to t = 0.5. The corresponding amount of thermal energy is stored in the memory variables MV 2 and MV 3 . MV 1 stays void. As e2 is updated the values in the internal cells are shifted to the right, the energy in MV 2 is filled in the first cell according to (16). After its content was transported, the value of

8

RB, ME, AND NS

t ∆t2 ∆t1

e2 e1 e3

∆t3

(a)

t

t

t

e2 e1

e2 e1

e2 e1

e3

e3

e3

(b)

(c)

(d)

t

t

e2 e1

t

e2 e1

e2 e1

e3

e3

e3

(e)

(f)

(g)

Figure 1. Illustration of the local time steps at a single node. MV 2 is set to zero. Finally the fluxes of the new state are computed, which completes the time step. The next CFL bound is active in e3 at t = 32 . Thus the fluxes in the junction from t = 0.5 to t = 23 can be filled into the memory variables. The update of e3 moves its time level from 0 to t = 32 . For the next time level the edges e1 and e2 can be updated simultaneously, as their fluxes expire at the exact same time. Similarly the procedure continues until the final time tend = 2 is reached. Note that, in contrast to this example, in general the last time steps do not reach tend exactly but would end at a later time level. For this final step a classical upwind step is performed with ∆t ≤ ∆x v , what might introduce some numerical diffusion. In general this effect is only hardly visible, as it occurs in just a single iteration. The local time stepping has two advantages compared to the classical upwind scheme. First it is more accurate since numerical diffusion is only added at the junction. There the fluxes entering the node transport the exact

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

9

amount of thermal energy exiting the edge, but since it is assumed that the flux is constant in the corresponding time interval the resulting accuracy is only of first order. The second advantage is that it is less expensive from a computational point of view. The management of the time steps does not require significant computational time. In reward it reduces the total number of time steps in the network. Further, along the edges no actual computation has to be carried out, since with the exact CFL condition the cell values are just shifted into the direction of the flow. This reduces the computational effort significantly. 3.3. High order coupling. As pointed out above the local time stepping procedure combined with the upwind scheme is only first order accurate. This can be improved by using the ADER approach [4] at the coupling points, without loosing the advantages of the local time steps. In the following we summarize the modifications needed to obtain a method of arbitrary order of accuracy. Along the edges still the exact CFL condition holds, because the exact solution already is accurate enough. Thus only the fluxes entering the junction have to be computed with the ADER approach. The aim is to obtain an accurate temporal evolution of the fluxes at the node. The first step is a polynomial reconstruction of the value at the last interface using the given cell averages. A detailed description of the WENO reconstruction is given in [16], a one sided reconstruction based on polynomials with increasing degrees is presented in [23]. In [17] a refinement of the weight of the first, i.e. constant, polynomial is introduced. This reconstruction provides a spatial polynomial, which can be transformed via the Cauchy-Kowalevskaya or Lax-Wendroff procedure into a temporal one. Since the equation is linear the coefficients of the new polynomials up to order K are (17)

∂tk T = (−v)k ∂xk T

k = 0, . . . , K .

With these the temporal evolutions the fluxes entering the junction can be computed. The approximation of the outgoing fluxes can be determined by the temporal derivatives of the coupling conditions X cp Ai qi ∂tl Ti = 0 for l = 0, . . . , K, ∂tl Tj = ∂tl Ti

and i, j outgoing flows .

This is a linear system of equations, which gives the temporal derivatives of the outgoing flows, depending on the ingoing ones. Once the evolution in time of the outgoing fluxes is known, their contribution for the time step ∆t ∆Qj = ∆tρcp

k X l=0

∆tl ∂ l Tout (l + 1)! t

can be added to the memory variable. 3.4. Extension to time dependent velocity field. In the previous section the local time stepping scheme was discussed for velocities constant in time. The numerical methods still can be applied if v = v(t) changes over time, i.e. if (10) is replaced by (18)

∂t T + v(t)∂x T = 0 .

10

RB, ME, AND NS

In the following we assume v(t) to be known and regular enough to apply higher order methods. The CFL condition (12) was already formulated for variable v. Also the further steps of the time step management remain unchanged. When a higher order method is used the Cauchy-Kowalevskaya procedure is more involved than (17), due to the product rule. The resulting lengthy expressions can be determined using packages for symbolic manipulations. Further in the integration of the thermal fluxes at the nodes v is involved Z t+∆t ρcp v(τ )Tout (τ )dτ . (19) ∆Q = t

The update inside the pipes remains unchanged, since in (12) ∆t is chosen exactly such that the values can be shifted by one cell. 3.5. Source terms. Finally we discuss the incorporation of the source term in the local time stepping scheme. Note that the the source term on the right hand side of (2) is linear and not varying in space. These two features can be exploited to further reduce the computational costs. For (2) the exact solution even with source term can be given explicitly, i.e. in each time step the cell values are not just shifted in the direction of the flow but also adjusted according to the source term. If the values of T are only needed at the outflow and not used in the interior of the pipes, the computational costs can be further reduced by applying the source term only at the outflow. Therefore inside the pipe just the advection according to the homogeneous PDE (10) is considered. For the source term we keep track of the time span which the cell value at the outflow stayed in the pipe. Then the outflow is changed by applying the source term for this complete time interval. This is only possible, if both the PDE and the source term are linear and the source term independent of x. 4. Numerical Examples In this section several numerical examples are presented in order to investigate the properties of the local time stepping scheme. These test cases include a comparison with the high order ADER scheme in terms of accuracy and efficiency, as well as a case study on a larger realistic network. 4.1. Split network. As first examples a simplified supply branch of a district heating network is considered. As depicted in figure 2 the network is composed of 6 pipes and 4 junctions. The heat is supplied at the node A, a e2 A

e1

e3

e4 e5

e6

B

Figure 2. Graph of a small supply network. single consumer is located at B. The lengths of the pipes are L1 = L6 = 1 and L2 = L3 = L4 = L5 = 0.5. The velocities along the edges do not change

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

11

over time but have the following different values v1 = v6 = 1, v2 = v4 = 31 and v3 = v5 = 32 . Furthermore no external temperature is considered. The initial temperature is zero in all pipes, the inflow profile at node A is given by  sin(πx)4 , t < 1 TA (t) = (20) 0, t≥1.

The quality of the schemes is compared via the temperature at the final node TB (t), as this is a major quantity of interest when operating district heating systems. ∆x = 2−7 ∆x = 2−5 ∆x = 2−3

0.6

∆x = 2−6 ∆x = 2−4 ∆x = 2−2

TB

0.4

0.2

0 6

7

8 t

9

10

Figure 3. TB for different spatial grid resolutions computed with the third order ADER scheme (left) and the third order local timestepping scheme (right). In figure 3 the values of TB in the time interval [6, 10] are plotted. The picture on the left hand side shows the solution obtained with the third order ADER scheme for different spatial resolutions in all edges. For a coarse grid with only two or four cells per pipe the strong numerical diffusion lowers the peaks of the temperature significantly. As the spatial, and with it also the temporal, resolution is increased, the two signals separate and become more pronounced. The solutions seem to converge to a given profile, but only for the last two resolutions the curves in the picture can not be distinguished any more. The values obtained with the local time stepping scheme are shown on the right hand side. Even for the coarsest resolution the two peaks are separated. Their heights are comparable with those of the ADER scheme on a grid with twice as many cells. Already for a resolution of ∆x = 2−4 the final shape is reached. In figure 4 the numerical solutions with a fixed spatial grid with ∆x = 2−5 are shown. The curves in red are the ADER schemes of order one up to order 5, the blue curves display the solutions of the local time stepping scheme for an increasing order of accuracy. For both approaches the accuracy increases with the order of the method. The ADER schemes can capture the height of the first peak for order three or more, but for the second peak the full height is never reached. In contrast to this, the local time stepping scheme provides more accurate solutions. For all orders both peaks have the correct

12

RB, ME, AND NS

0.6 LT5 LT4 LT3 LT2 LT1

T

0.4

0.2

reference ADER5 ADER4 ADER3 ADER2 ADER1

0 6

7

8 t

9

10

Figure 4. Schemes of different order on the same grid with ∆x = 2−5 .

height, but the values of the second peak seem to be on a coarser grid. This is related to the coarse resolution and the varying velocities in the network. The signal TA send into the e1 is split at the first node into one peak traveling along e2 , e4 and another one along e3 , e5 . Since the flow in edge two and four is significantly slower, the arriving peak is compressed into very few grid cells. This loss of resolution can not be recuperated when the flows merge again, nor excluded by the present high order approach. Thus the coarser signal is transferred to the faster flow in e6 . The tables 1 and 2 show the L1 -errors, rates of convergence and computational times for the ADER and the local time stepping schemes. The L1 errors are computed in comparison with a numerical reference solution obtained with the fifth order ADER scheme on a grid with ∆x = 2−10 . Note that the fifth order ADER scheme can not be used on the coarsest grid, as there are not sufficient cells for the polynomial reconstruction available. For all schemes the solution converge to the reference solution when the spatial grid is refined. With the ADER methods this is paid by quadratically increasing computational costs. For the local time stepping schemes this increase is only linear. Here the numerical effort is almost independent of the number of cells and just scales with the increase of the number of time steps. The orders of convergence are visualized in figure 5. For fine enough grids all schemes achieve the predicted order of convergence. Except for the fifth order schemes, the local time stepping schemes are about one order of magnitude more accurate compared to the ADER methods. In figure 6 the efficiency of the schemes is studied. The local time stepping scheme needs significantly less time to obtain accurate numerical results, e.g. the fifth order local time stepping scheme on the finest grid with ∆x = 2−9 takes as long as the first order upwind scheme with ∆x = 2−5 , but the error is 3.266e-9 in contrast to 2.104e-1.

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

ADER1 ∆x 1.25e-1 6.25e-2 3.13e-2 1.56e-2 7.81e-3 3.91e-3 1.95e-3

L1

error 3.477e-1 2.840e-1 2.104e-1 1.451e-1 9.276e-2 5.446e-2 2.890e-2

order 0.29 0.43 0.54 0.64 0.77 0.91

ADER3 time 0.1 0.2 0.6 1.6 5.4 19.7 74.6

L1

error 1.713e-1 8.495e-2 2.791e-2 3.577e-3 3.818e-4 4.226e-5 4.460e-6

order 1.01 1.61 2.96 3.23 3.18 3.24

time 0.8 1.0 3.8 14.5 55.9 221 880

ADER5 ∆x 1.25e-1 6.25e-2 3.13e-2 1.56e-2 7.81e-3 3.91e-3 1.95e-3

L1 error 2.413e-2 7.892e-4 2.728e-5 8.280e-7 2.580e-8 9.715e-10

order 4.93 4.85 5.04 5.00 4.73

time 0.9 2.4 6.0 22.8 90.0 355 1411

Table 1. L1 -errors, rates of convergence and computational times for the ADER schemes.

LT1 ∆x 1.25e-1 6.25e-2 3.13e-2 1.56e-2 7.81e-3 3.91e-3 1.95e-3

L1

error 1.157e-1 5.508e-2 2.507e-2 1.202e-2 5.877e-3 2.876e-3 1.363e-3

order 1.07 1.14 1.06 1.04 1.08 1.33

LT3 time 0.1 0.2 0.4 0.8 1.4 2.7 5.9

L1

error 1.035e-1 2.556e-2 3.996e-3 5.269e-4 6.669e-5 8.328e-6 9.988e-7

order 2.02 2.68 2.92 2.98 3.00 3.06

time 0.1 0.2 0.4 0.7 1.5 3.4 6.7

LT5 ∆x 1.25e-1 6.25e-2 3.13e-2 1.56e-2 7.81e-3 3.91e-3 1.95e-3

L1 error 1.133e-1 3.612e-2 2.260e-3 9.352e-5 3.227e-6 1.042e-7 3.266e-9

order 1.65 4.00 4.59 4.86 4.95 5.00

time 0.1 0.2 0.4 0.8 1.6 3.2 7.0

Table 2. L1 -errors, rates of convergence and computational times for the local time stepping schemes.

13

14

RB, ME, AND NS

10−1

ADER1 ADER2 ADER3 ADER4 ADER5 LT 1 LT 2 LT 3 LT 4 LT 5

e

10−3 10−5 10−7 10−9 10−3

10−2 ∆x

10−1

Figure 5. Convergence plots for the different schemes.

10−1

ADER1 ADER2 ADER3 ADER4 ADER5 LT1 LT2 LT3 LT4 LT5

e

10−3 10−5 10−7 10−9 10−1

100

101

102

103

104

t Figure 6. Efficiency plots for the different schemes.

A

e1

e2

e3

B

Figure 7. Three pipes in a row with slightly varying velocities. 4.2. Slightly varying velocities. In this simple test case three pipes in a line are considered, as depicted in figure 7. The pipes are all of the same length 1, but there is a small variation in the width of the tubes. The diameters are d1 = d3 = 10.00 and d2 = 10.01. Thus the velocities resulting 1 from the constant flow 102 π are given by v1 = v3 = 1 and v2 = 1.001 , i.e. the small variation in the width directly transfers to the velocities. The temperature of the inflow is again given by (20).

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

1 0.8

T

0.6 0.4 0.2 0 2

2.2

2.4

2.6

2.8

3

15

LT3, ∆x = 2−7 LT3, ∆x = 2−6 LT3, ∆x = 2−5 LT3, ∆x = 2−4 ADER3, ∆x = 2−7 ADER3, ∆x = 2−6 ADER3, ∆x = 2−5 ADER3, ∆x = 2−4

t Figure 8. Temperature in node B computed with third order schemes for different grid sizes. In figure 8 the numerical results for the temperature at the outflow of the third pipe is shown. As expected all numerical schemes provide accurate approximations. For this setting, there is no notable advantage for the local time stepping in terms of the accuracy. This is also confirmed by the errors given in table 3. For the fifth order schemes the errors of the local time stepping method is slightly bigger due to the larger ∆ts. ADER3 LT3 ∆x l1 error time l1 error time 6.25e-2 3.62e-04 0.3 1.39e-04 0.1 3.13e-2 2.45e-05 0.9 8.54e-06 0.3 1.56e-2 1.82e-06 3.5 4.37e-07 0.6 7.81e-3 1.35e-07 13 2.80e-08 1.2 3.91e-3 8.48e-09 48 2.66e-09 2.6 1.95e-3 3.69e-10 194 2.34e-10 5.5 Table 3. L1 errors and computational times of the third order schemes for three pipes in a row.

But the computational costs, listed in table 3, are significantly smaller when the local time stepping is applied. This is achieved by avoiding numerical computations along the pipes due to the exact CFL condition. Note that the computational savings considered in [11] are only due to the reduced number of time steps, which are negligible in the present test case. Here the linearity of the considered equation allows to further exploit the advantages of the exact time steps. 4.3. A district heating network. In the final test case we study the numerical algorithms on a more realistic setting for a district heating network. The layout of the system is shown in figure 9. The supply branch (red)

16

RB, ME, AND NS

and the return branch (blue) consist of nine edges each. Each pipe has a diameter 0.1 and the lengths are L1 = L18 = L6 = L13 = 500, L2 = L17 = L5 = L14 = L7 = L12 = L9 = L10 = 282, L3 = L16 = L8 = L11 = 400 and L4 = L15 = 424. N4 e4

N 1 e3

e15

e5 e2

e1

e16

e17 e9

A

e6

N5

e14

e18

e8

e7

e12

e13

e10 N2

e11N 3

Figure 9. Graph of a district heating network. The five green vertical lines indicate the locations of the consumers. Each of them has a given energy demand Q1 (t) = Q2 (t) = Q3 (t) = 3000, Q4 (t) = 6000 and Q5 (t) = 9000, which enters into the mathematical model via equation (9). The thermal energy is provided by the boundary conditions for e1 at the node A by ( 120 t < 3600 TA (t) = 80 t > 3600 . At the same location the pressure of the supply branch is p1 (t) = 3 and p18 (t) = 2. In the houses thermal energy is consumed such that the temperature is cooled down to Tout = 60. The external cooling the parameters are k = 0.1, λ = 0.006 and Ti nf = 20. In the numerical integrations spatial discretizations from ∆x = 40 up to ∆x = 2.5 are considered. The cell along the edges are equally spaced, i.e. ∆x is slightly decreased if the length of the pipe is not a multiple of the given value. This leads to 8 up to 13 cells for the coarsest grids and 118 up to 200 cells on the fines level. The simulation is run up to the time tend = 36000. In figure 10 the evolution of the temperature in the node N 1 and N 4 are shown. As no flows mix, a part of the input signal passes almost unchanged. Just the slight cooling due to the outer temperature can be observed in N 4. All numerical schemes give accurate results. More complex is the behaviour of the temperature at node N 5. In figure 11 the results for the local time stepping scheme are compared to those of the ADER methods on a grid with ∆x = 20. The temperature varies over time, since it is a mixture of waves passing the upper branch e2 , e3 and e5 with those of the lower branch e9 , e8 and e7 . The first order ADER scheme is not able to resolve these features. For the local time stepping method even the first order is more accurate than the fifth order ADER scheme.

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS LT3,∆x = 10 A3,∆x = 10

LT3,∆x = 5 ADER3,∆x = 5

LT3,∆x = 20 A3,∆x = 20

120

120

110

110

100

100

T

T

LT3,∆x = 5 A3,∆x = 5

90

LT3,∆x = 10 ADER3,∆x = 10

LT3,∆x = 20 ADER3,∆x = 20

90

80 80 70

0

0.2

0.4

0.6

0.8

1

0

1

2 t

·104

t

3

4 ·104

Figure 10. Temperature at the node N 1 (left) and N 4 (right). 120

T

110 LT5 LT3 LT1 ADER5 ADER3 ADER1

100 90 80 0

0.5

1

1.5

2

2.5

3

t

3.5 ·104

Figure 11. Temperature in N 5 computed with schemes of different orders with ∆x = 20. 120 LT3, ∆x = 5 LT3, ∆x = 10 LT3, ∆x = 20 ADER3, ∆x = 5 ADER3, ∆x = 10 ADER3, ∆x = 20

T

110 100 90 80 0

0.5

1

1.5

2 t

2.5

3

3.5 ·104

Figure 12. Temperature in N 5 computed with schemes of order 3 for different spatial resolutions.

17

18

RB, ME, AND NS

ADER1

ADER3

L1

∆x error time 40 4.76 4 20 4.01 9 10 3.26 19 5 2.54 44 2.5 1.88 109 Table 4. L1 -errors and schemes.

L1

error time error time 2.80 6 1.75 16 1.28 20 0.98 45 0.66 57 0.52 126 0.32 185 0.26 446 0.14 664 computational times for the ADER

LT1 ∆x 40 20 10 5 2.5 Table 5.

ADER5 L1

LT3

L1

LT5

L1

L1

error time error time error time 1.17 7 1.15 7 1.16 8 0.61 13 0.65 13 0.63 14 0.30 24 0.30 25 0.28 28 0.19 47 0.18 48 0.17 54 0.11 96 0.10 97 0.09 118 L1 -errors and computational times for the LT schemes.

Figure 11 shows that all methods converge to the same solution as the grid is refined.

v

0.35 LT5 LT3 LT1 ADER5 ADER3 ADER1

0.3

0.25

0

0.5

1

1.5

2 t

2.5

3

3.5 ·104

Figure 13. The velocity on edge e1 for ∆x = 20 Note that with differing values in T also influence the flow solver, i.e. also the velocity profile changes. In figure 13 the velocity on edge e1 is plotted. The values fluctuate over time as the inflow has to adjust according to the needs of all consumers simultaneously. Similar to the temperature, the first order ADER scheme can not capture all features of the solution, while the local time stepping methods provide very accurate results. In the tables 4 and 5 the L1 errors and the computation times for the ADER and the local time stepping methods are shown. Here the reference

A LOCAL TIME STEPPING METHOD FOR DISTRICT HEATING NETWORKS

19

solution is computed with the local time stepping scheme of order five on a grid with ∆x = 0.625. The errors are calculated after transforming the time interval to [0, 1]. For all numerical schemes the errors decrease and the computation times increase when the grid is refined. The errors of the local time stepping schemes are below those of the fifth order ADER method. Further the results are obtained in much shorter time. Note that the gain in terms of computation time is not as big as in the previous examples. This is due to the flow solver, which is identical for all methods. It occupies about 30 seconds on the finest grid. These costs could be reduced by exploiting the structure of the network or considering stationary version of (4) as in [18]. 5. Conclusion In this work we constructed a numerical method for simulating the transport of thermal energy in district heating networks. By applying a local time stepping, the advection equations along the edges can be solved exactly. This increases the numerical accuracy and simultaneously reduces the computational costs, such that it is even more efficient than high order ADER schemes. The developed method is restricted to linear problems, but extensions to systems of linear equations, e.g. the wave equation, will be subject to future research. Acknowledgements This research was supported by the Stiftung Rheinland-Pfalz f¨ ur Innovation with the project 961 − 386261/1172. The first author is supported by the Deutsche Forschungsgemeinschaft (DFG) grant BO 4768/1. References [1] Mapundi K. Banda, Michael Herty, and Axel Klar. Coupling conditions for gas networks governed by the isothermal Euler equations. Netw. Heterog. Media, 1(2):295– 314, 2006. [2] S. Blandin, D. Work, P. Goatin, B. Piccoli, and A. Bayen. A general phase transition model for vehicular traffic. SIAM J. Appl. Math., 71(1):107–127, 2011. [3] Raul Borsche. Numerical schemes for networks of hyperbolic conservation laws. Appl. Numer. Math., 108:157–170, 2016. [4] Raul Borsche and Jochen Kall. ADER schemes and high order coupling on networks of hyperbolic conservation laws. J. Comput. Phys., 273:658–670, 2014. [5] Raul Borsche and Jochen Kall. High order numerical methods for networks of hyperbolic conservation laws coupled with ODEs and lumped parameter models. J. Comput. Phys., 327:678–699, 2016. [6] Walter Boscheri, Rapha¨el Loub`ere, and Michael Dumbser. Direct arbitrarylagrangian–eulerian ader-mood finite volume schemes for multidimensional hyperbolic conservation laws. Journal of Computational Physics, 292:56 – 87, 2015. [7] G. Bretti, R. Natalini, and B. Piccoli. Numerical algorithms for simulations of a traffic model on road networks. J. Comput. Appl. Math., 210(1-2):71–77, 2007. [8] S. Clain, S. Diot, and R. Loub`ere. A high-order finite volume method for systems of conservation laws—multi-dimensional optimal order detection (mood). Journal of Computational Physics, 230(10):4028 – 4050, 2011. [9] R. M. Colombo and M. Garavello. On the Cauchy problem for the p-system at a junction. SIAM J. Math. Anal., 39(5):1456–1471, 2008.

20

RB, ME, AND NS

[10] Pia Domschke, Oliver Kolb, and Jens Lang. Adjoint-based error control for the simulation and optimization of gas and water supply networks. Appl. Math. Comput., 259:1003–1018, 2015. [11] Michael Dumbser, Martin K¨ aser, and Eleuterio F. Toro. An arbitrary high-order discontinuous Galerkin method for elastic waves on unstructured meshes – V. Local time stepping and p-adaptivity. Geophysical Journal International, 171(2):695–717, 2007. [12] S. G¨ ottlich, M. Herty, and A. Klar. Network models for supply chains. Commun. Math. Sci., 3(4):545–559, 2005. [13] Michael Herty and Axel Klar. Modeling, simulation, and optimization of traffic flow networks. SIAM Journal on Scientific Computing, 25(3):1066–1087, 2003. [14] Michael Hinze, Ralf K¨ ocher, and Jens Pfafferott. Zur numerischen simulation von w¨ armenetzen. Forschung im Ingenieurwesen, 62(11):301–314, Nov 1996. [15] Lennart Jansen and Jonas Pade. Global unique solvability for a quasi-stationary water network model. Preprint series: Institut f¨ ur Mathematik, Humboldt-Universit¨ at zu Berlin, 2013-11, 2013. [16] G. Jiang and Chi-wang Shu. Efficient implementation of weighted eno schemes. Journal of Computational Physics, 126(1):202–228, jun 1996. [17] Jochen Kall. ADER Schemes for Systems of Conservation Laws on Networks. PhD thesis, Technische Universit¨ at Kaiserslautern, 2016. Verlag Dr. Hut. [18] Ralf K¨ ocher. Beitrag zur Berechnung und Auslegung von Fernw¨ armenetzen. PhD thesis, Technische Universit¨ at Berlin, 2000. http://dx.doi.org/10.14279/depositonce-180. [19] T. K¨ oppl, B. Wohlmuth, and R. Helmig. Reduced one-dimensional modelling and numerical simulation for mass transport in fluids. Internat. J. Numer. Methods Fluids, 72(2):135–156, 2013. [20] Randall J LeVeque. Finite-Volume Methods for Hyperbolic Problems, volume 31. Cambridge university press, 2002. [21] Andrew J. Majda and Andrea L. Bertozzi. Vorticity and incompressible flow, volume 27 of Cambridge Texts in Applied Mathematics. Cambridge University Press, Cambridge, 2002. [22] Lucas O M¨ uller and Pablo J Blanco. A high order approximation of hyperbolic conservation laws in networks: Application to one-dimensional blood flow. Journal of Computational Physics, 300:423–437, 2015. [23] Sirui Tan and Chi-Wang Shu. Inverse Lax-Wendroff procedure for numerical boundary conditions of conservation laws. Journal of Computational Physics, 229(21):8144– 8166, 2010. [24] E. F. Toro, R. C. Millington, and L. A. M. Nejad. Towards very high order Godunov schemes. In Godunov methods (Oxford, 1999), pages 907–940. Kluwer/Plenum, New York, 2001. [25] Eleuterio F Toro. Riemann Solvers and Numerical Methods for Fluid Dynamics: A Practical Introduction. Springer, 2009.