• Keine Ergebnisse gefunden

3.3 An Extended Discontinuous Galerkin Method

3.3.2 Cell-Agglomeration

Arbitrarily shaped cut scenarios can arise depending on the position and on the shape of the interfaceIin Figure 3.4. Small and ill-shaped cut-cells are challenging issues for numerical

I K1,B

K2,B Edg3

Edg4

Edg2

Edg1

K1,A K2,A

(a) Cut-cell gridKXh.

I K1,B

K2,B K1,AK2,A

(b) Agglomeration gridAgg(KXh, Aa˜). Figure 3.7:Cell-agglomeration by means of an undirected graph Gr(KXh). The undirected

graph Gr(KXh) = (KXh,Edg(KXh)) consists of the set of edges {Edg1({K1,A, K1,B}), Edg2({K1,A, K2,A}),Edg3({K1,B, K2,B}),Edg4({K2,A, K2,B})} on the cut-cell grid KXh. The corresponding agglomeration grid Agg(KXh, Aa˜) contains the agglomeration map Aa˜ = {Edg2({K1,A, K2,A})}. Note that only agglomeration across the same species is allowed (adapted from Smuda, 2020, Figure 3.4).

integration schemes and in particular for explicit time-integration schemes, due to the increasing condition numbers of the cell-local mass matrices, or due to the prohibitive CFL-condition, see Section 4.1.3. A remedy for these issues are cell-agglomeration techniques, where undesired cut-cellsKj,sare removed from the cut-cell gridKXh. Then, all operations are carried out on an agglomerated gridKX,aggh , see Definition 3.8, before the solution is projected back onto the cut-cell gridKXh. We follow the work by Kummer et al. (2020) and introduce the cell-agglomeration technique by means of graph theory.

Definition 3.7(Graph of a numerical grid). We consider a numerical gridK, which can be the background gridKh (Definition 3.1) or the cut-cell gridKXh(Definition 3.4), for example.

When considering two cellsKj, Kl∈ K, we define alogical edgeEdg({Kj, Kl})by using the set{Kj, Kl}, if and only if, both cells share a common edge (∮︁

Kj∩Kl1dS >0). We denote the set of all logical edges with Edg(K). In terms of graph theory, we define anundirected graphas Gr(Kh) := (Kh,Edg(Kh)).

Definition 3.8(Agglomeration maps and grids). We consider a subset of edgesA˜ ⊂Edg(Kh) of the computational gridKh. Next, we define a cluster of cellsa˜ :={K1, . . . , KL} ∈ Kh. The cluster of cellsa˜represents the maximum number of cells, which are connected by the subset of edgesA˜ ⊂Edg(Kh). In particular, we introduce a so-calledagglomeration maplinked with the clustera˜by the notationAa˜ ⊂Edg(Kh)with the subscripta˜. We define the agglomeration of all cellsKl∈a˜asKa˜ :=∪K

l∈a˜Kl. Here, we use a modified unionX∪Y := (X∪Y)\∂(X∪Y) in order to guarantee that the agglomeration of the cellsKa˜ is still a simply connected, open set by taking the closure of each cell and then by subtracting its boundary. The clustera˜can consist of a single cell which is then called a non-agglomerated cell with respect toa˜.

All agglomerated and non-agglomerated cells with their corresponding agglomeration map Aa˜ ⊂ Edg(Kh) define the agglomeration grid Agg(Kh, Aa˜) := KX,aggh . Figure 3.7 shows the agglomeration procedure on an exemplary cut-cell grid. This motivates the definition of the agglomerated cut-cell XDG space in Definition 3.9.

46

Definition 3.9(Agglomerated extended discontinuous Galerkin (XDG) space). On a given agglomeration grid Agg(KXh, Aa˜)of the cut-cell gridKXh with the corresponding agglomeration mapAa˜ ⊂Edg(KXh), we define the broken polynomial agglomerated cut-cell XDG space as

PX,AP a˜ :=PP(Agg(KXh, Aa˜)), (3.71) which is a sub-space of the original XDG spacePP(KXh). The reader is referred to Equations (3.1) and (3.69) for the definition of the standard DG space and the cut-cell XDG space, respectively.

Subsequently, we introduce the volume fraction|Kj,s|/|Kj|of a cut-cellKj,s with respect to the corresponding background cellKjas a measure for the size of cut-cells. As previously men-tioned, the cell-agglomeration technique removes undesired cut-cells fromKXh. Consequently, a valid agglomeration mapAa˜ ⊂Edg(KXh)must fulfill the following two properties:

(1) All cut-cells with a volume fraction smaller than an agglomeration thresholdδagg, 0≤ |Kj,s|

|Kj| ≤δagg, (3.72)

are agglomerated to a neighboring target cell (see (2)). Typically, the agglomeration threshold is chosen in the range of 0.1 ≤ δagg ≤ 0.3. On the one hand, this leads to reasonable condition numbers of the mass matrices and additionally allows for larger time-step sizes when using explicit time-integration schemes. On the other hand, the discretization errors near the interface are still sufficiently small (Kummer, 2016; Müller et al., 2017).

(2) The agglomeration target cell is the neighboring cell with the largest volume fraction of the same speciess. Consequently, no agglomeration across different species is allowed so that in the case of two speciesAandBthere is no edge{Kj,A, Kj,B}in the agglomeration mapAa˜.

Algorithm 3.1 describes the procedure of how to find the cut-cells which will be agglomerated (source cells) and how to find the corresponding neighboring cells (target cells) which will

‘receive’ the source cells. In particular, Algorithm 3.1 presents the construction of an agglomera-tion mapAa˜ =F indAgg(KXh, δagg)depending on an agglomeration thresholdδagg. Target cells may become source cells themselves depending on the form of the interface leading to so-called agglomeration chains. In general, the presented Algorithm 3.1 can handle such scenarios, but we did not encounter any relevant configuration in the test cases of this work.

Implementation Notes about the implementation and the computational effort of the agglom-eration procedures in the context of compressible flows are given in the work by Müller et al.

(2017). Here, we want to introduce the concept briefly.

In the following, we denote a cut-cellKj,s which will be agglomerated to a cell of the same species as thesource cellKsrc, and the corresponding neighboring cellKk,s with the largest volume fraction of the same species as thetarget cellKtar. Figure 3.8 shows an exemplary cut configuration on the background gridKhand on the agglomerated gridKX,aggh , respectively.

We denote the row vectors of basis functions, which are only non-zero in the corresponding cell, asφsrc= (φsrc1 , . . . , φsrcN )andφtar= (φtar1 , . . . , φtarN). We skip the cell indexjin this paragraph

Algorithm 3.1: Pseudocode of the presented cell-agglomeration technique. We construct an ag-glomeration mapAa˜=FindAgg(KXh, δagg)on a given cut-cell gridKXhfor an agglomeration threshold δagg[0,1)(adapted from Kummer et al., 2020, Algorithm 7).

1: functionFindAgg(KXh, δagg) 2: InitiateAa˜ ← {}

3: for allKj∈ KXhdo Loop over all cells

4: for alls∈ {A,B}do Loop over all species

5: if|Kj,s|/|Kj| ≤δaggthen Find small cut-cells

6: Kk,s arg max

Kl,sneighb. ofKj,s

(|Kl,s|/|Kl|) Find largest neighbor 7: ifKk,sexiststhen

8: Aa˜Aa˜∪ {{Kj,s, Kk,s}} Add edge to agglomeration map

9: end if

10: end if

11: end for 12: end for 13: returnAa˜

14: end function

K1,B

K3,B

K2,A=K2

K4,B I K4,A

K1,A

K3,A

(a) Initial configuration on the non-agglomerated gridKXh.

K2,A=K2

K4,B I K4,A

source cell Ksrc=K3,A

target cell Ktar=K1,A

K1,B

K3,B

(b) Agglomerated gridKX,aggh .

Figure 3.8:Illustration of the cell-agglomeration technique. (a) Small cut-cells will be agglomerated to their direct neighbor with the largest fluid volume fraction. (b) For small values of the agglomeration thresholdδagg, the source cellKsrc=K3,Ais agglomerated to the target cellKtar=K1,A(adapted from Geisenhofer et al., 2019, Figure 2).

48

for better readability. Next, we introduce a coupling matrixQ⊂RN,N, withφsrcQbeing the smooth extension ofφtarinto the source cellKsrc. Consequently, we can write the row vector of basis functions in an agglomerated cellKaggas

φaggtarsrcQ. (3.73)

For fixed level-set positions, the coupling matrix Q has to be calculated only once in the beginning of every simulation. This is done by projecting the smooth extension of the basis of the target cell denoted byφˆtar= (φˆtar

1 , . . . , φˆtar

N )onto the source cellKsrcby calculating Q=

∫︁

Ksrcφˆtar

1 φsrc1 dV . . . ∫︁

Ksrcφˆtar

Nφsrc1 dV

... ... ...

∫︁

Ksrcφˆtar

1 φsrcN dV . . . ∫︁

Ksrcφˆtar

NφsrcN dV

, (3.74)

which directly yields the expression

φˆtarsrcQ. (3.75)

There are two main advantages of the presented formulation of the agglomerated basis func-tions (3.73): First, the existing implementation, including all operators and data structures, can be reused; second, the coupling matrix Q, defined in Equation (3.74), simplifies the (de-)agglomeration in unsteady calculations with moving interfaces. In the case of a fixed interface position, the following quantities have to be calculated before and during a steady simulation run with a fixed interface position:

Before the simulation run (set-up phase): We calculate the constant agglomerated cell-local mass matrix via

Magg=Mtar+QMsrcQ (3.76)

in order to project the initial condition onto an agglomerated cellKaggby calculating the agglomerated coefficientsψ˜aggvia

ψ˜agg= (Magg)−1

(︂Mtarψ˜tar+QMsrcψ˜src)︂

. (3.77)

After the initial projection, the solution in an agglomerated cellKaggstays continuous for the entire simulation run. Thus, the problem formulation is not altered by injecting the solutionψ˜aggfrom the agglomerated gridKX,aggh onto the original non-agglomerated gridKXh via

ψ˜tar=ψ˜agg, ψ˜src=˜agg. (3.78)

During the simulation run: On the agglomerated gridKX,aggh , we use the cell-local spatial operator vectors in the notationOpsrc=Opsrcj andOptar=Optarj , see Equation (3.20), for the calculation of the agglomerated cell-local operator

Opagg=Optar+QOpsrc. (3.79) We update the solution on the non-agglomerated gridKXh via an explicit time-integration scheme, see Chapter 4, with

ψ˜tar←ψ˜tar−∆t(Magg)−1Opagg, (3.80)

ψ˜src˜tar. (3.81)

In summary, this version of the presented cell-agglomeration technique exploits the locality of the outlined operations and allows to reuse the existing operators and data structures. It requires only two additional, cell-local matrix-vector products, see Equations (3.79) and (3.81), in each time-step for fixed interface positions.