## 5 Examples
### Allen-Cahn Equation
Details about model parametrization are given in Table 1.

We benchmark both models using the BenchmarkTools.jl library. The physical size of both models was measured using the Julia Base function summarysize. For timing purposes, each run was repeated 100 times to create reliable empirical data. Both models were run on the same machine in consecutive runs. ### Advection Equation

Derivation of the Weak Form

Equation (32) can be obtained by the strong form of the PDE as described in the article, by applying partial integration after multiplying with a test function and integrating over the domain \(\Omega\). To arrive at a formulation that can be implemented, there are a few additional steps which are described below. In most DG codes, the weak form given by Equation (32), more specifically the surface integral, cannot be entered directly but needs to be reformulated using jump and average operators. This is also performed in the advection equation example described in Section 5.2. Such a modified weak form can be derived as follows. The most straightforward consists of summarizing the convective term of the PDE as the divergence of some flux \(\
abla\cdot f(\alpha)\). In this case, the flux is simply \(f(\alpha)=\underline{u}\,\alpha\). Then, the surface integral of Equation (32) can be formulated as

\[\int_{\Gamma}v\,\alpha(\underline{u}\cdot\underline{u})\,dS=\int_{\Gamma}v \underline{f}(\alpha)\cdot\underline{u}\,dS. \tag{33}\]

We now write down the terms of the surface integral of Equation (32) that contribute to an arbitrary internal facet, that is, we always encounter two integrals from the cells that the facet is owned by. We distinguish between the two cells by introducing the notation \"\(+\)\" and \"\(-\)\"

\[\int_{\Gamma}v_{h}^{+}\alpha_{h}^{+}(\underline{u}^{+}\cdot\underline{u}^{+}) \,dS+\int_{\Gamma}v_{h}^{-}\alpha_{h}^{-}(\underline{u}^{-}\cdot\underline{u} ^{-})\,dS, \tag{34}\]

where we encounter the yet-to-be-determined values for \(\alpha^{+}\) and \(\alpha^{-}\). By introducing the common, yet unknown numerical flux \(\underline{f}(\alpha)^{*}\) and utilizing the fact that the facet normal vectors \(\underline{u}\) point opposite to each other, Equation (34) becomes

\[\int_{\Gamma}\left(\underline{f}(\alpha)^{*}\cdot\underline{u}\right)(v^{+}- v^{-})\,dS=\int_{\Gamma}\left(\underline{f}(\alpha)^{*}\cdot\underline{u} \right)\llbracket v\rrbracket\,dS. \tag{35}\]

The only issue that is left to deal with is now the choice of an appropriate expression for the numerical flux \(\underline{f}(\alpha)^{*}\cdot\underline{u}\). Both DG and FV implementations of the advection equation use the Lax-Friedrichs flux function

\[f(\alpha)^{*}=\{\alpha(\underline{u}\cdot\underline{u}^{+})\}+\frac{1}{2}C \llbracket\alpha\rrbracket, \tag{36}\]

where \(\{\cdot\}\) and \(\llbracket\cdot\rrbracket\) denote the average and jump operators as defined above. In this case, \(C\) is the maximum velocity in the domain and takes the role of the maximum signal velocity, which must be computed separately for more complex problems. It is defined as the Jacobian of the PDE flux \(\partial f(\alpha)/\partial\alpha\). Since we have that \(f(\alpha)=\underline{u}\alpha\), the Jacobian simply becomes the prescribed advection velocity \(\underline{u}\). #### a.2.2 Simulation Parameters

We solve the resulting semidiscrete ODE systems using a three-stage implicit Runge-Kutta formulation using a matrix-free solver. We time the entire simulation runs from the command line and execute each run six times. Wall times per time step were recorded during the run using the PETSc distributed interface and logged to a text file. ## References

* [PERSON] et al. (2007) [PERSON]; [PERSON]; [PERSON] [PERSON] Deal.II--A General-Purpose Object-Oriented Finite Element Library. _Acm Trans. Math. Softw._**2007**, 33, 24-es. [CrossRef]
* [PERSON] et al. (2015) [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] The FEniCS Project Version 1.5. _Arch. Numer. Softw._**2015**, 3.