## 5 Examples
### Allen-Cahn Equation
We consequently arrive at the same conclusion, being that the governing equation for velocity in this case is parabolic. Thus, we follow the left branch after D2 and continue by classifying the regularity of the domain. The question of whether the grid is strictly regular and Cartesian has already been answered in the previous section; therefore, we arrive at the continuous Galerkin method for the velocity field. For the pressure \(p\), we find that this quantity only appears within the momentum balance in Equation (36) within the expression \(\
abla\cdot p\underline{L}\), which is equal to the gradient \(\
abla p\). That is, we have \(\partial_{x}p\) as a source term in the components in this equation; thus, the evolution of \(p\) is not, per se, given by a separate governing equation. We therefore fall back to the qualitative classification that was described in Section 4.2 and choose an appropriate class based on the continuity requirements of the pressure field. The present problem consists of multiple phases; therefore, we may expect steep jumps in pressure at interfaces. We consequently assume the pressure field to be discontinuous at some points during the simulation and, thus, follow the process in Figure 5 along the path of hyperbolic equations. As there are no additional source terms or nonlinearities in \(p\), we classify this constraint as linear in D4 and therefore also arrive at the discontinuous Galerkin method. For the remaining temperature field \(T\), we again gather the terms containing differential operators on \(T\) from the governing equation, Equation (42)

\[\rho c_{p}\partial_{t}T+\rho c_{p}\underline{u}\cdot\
abla T-\kappa\Delta T= \text{RHS}(T). \tag{49}\]

The remaining terms in Equation (42) that have been gathered in \(\text{RHS}(T)\) are either constant, or depend on \(T\) itself, but not in its derivatives. Therefore, we may omit them for the sake of classification. As such, we have a PDE of second order and proceed analogously to the classification of the velocity \(\underline{u}\). The coefficient matrix \(a_{ij}\) is then

\[a_{ij}^{T}= \begin{bmatrix}0&0&0\\ 0&-\kappa&0\\ 0&0&-\kappa\end{bmatrix} . \tag{50}\]

Similarly to the previous discussion, this resembles a parabolic system and we thus recommend the discretization of the temperature field using the continuous [PERSON] method, as the question of domain regularity (D3) has already been addressed and is the same for all fields. If the coefficient of thermal diffusion \(\kappa\) would be zero in this case, the governing equation would then collapse into a hyperbolic PDE and another classification would apply. We can, however, state that the amount of heat conduction present in the model cannot be neglected, and, thus, we have that \(\kappa>0\) everywhere in the domain. ### Resulting Discretization

With all independent variables of the model addressed in the previous section, we briefly summarize the chosen combination of numerical schemes in Table 5.

One may proceed to implement this mixed discretization using any modern finite element code. In the first two examples, we showed that both creating a custom implementation using modern programming languages and implementing a model using popular finite element libraries are viable options to create a corresponding simulation. In this case, we obtain a coupled, nonlinear problem. This means that instead of solving a discrete linear system of equations, one must solve a global, nonlinear root finding problem of the form \(F(u;v)=0\) in every time step by appropriate means, such as Picard iteration or [PERSON]'s method. Such functionality, however, is readily implemented in finite element libraries such as Firedrake [3], which was used in the previous section. As a final remark, we note that similar models for resolving the melt pool dynamics in laser powder bed fusion have been developed using mixed formulations of the finite element method. For example, [PERSON] et al.