## 4 Review of XFEM for Stefan problem
### Semi-discrete equations  
In order to produce a discrete model, besides introducing an approximation as discussed in the previous Section, it is necessary to weaken the continuum problem. Here, the integral version of the energy balance is used. The weak form of Eq. (1), with the boundary conditions of Eq. (3) and the substitution of the isotropic version of the constitutive model in Eq. (2), reads  
Figure 3: Scheme of enrichments. Figure 2: Support of a standard FE shape function and its isocontours in a 2D bilinear case. \[\int_{\Omega}\delta T\rho\frac{\partial}{\partial t}\big{(}cT\big{)}+\int_{\Omega} \
abla\delta T\cdot k\
abla T+\int_{\Gamma_{q}}\delta T\hat{q}-\int_{\Omega} \delta Ts=0\,. \tag{34}\]  
Eq. (34) must be discretised in space, through Eq. (33), and time. Since the shape function matrix \(\mathbf{\overline{N}}\) depends on time through the position of the interface, the time derivation of Eq. (33) would require deriving the extended shape functions and, in turn, the level set. It is therefore more convenient to discretise first in time and then to substitute the spatial discretisation. By using backward Euler scheme (e.g. [53]), the semi-discrete version of Eq. (34) is obtained,  
\[\int_{\Omega}\delta T^{(p)}\rho\frac{c^{(p)}T^{(p)}-c^{(p-1)}T^{(p-1)}}{\Delta t }+\int_{\Omega}\
abla\delta T^{(p)}\cdot k\
abla T^{(p)}+\int_{\Gamma_{q}} \delta T^{(p)}\hat{q}^{(p)}-\int_{\Omega}\delta T^{(p)}s^{(p)}=0, \tag{35}\]  
in which the superscript notation in parentheses denotes the discrete time steps, i.e. \(T^{(p)}=T\big{(}\mathbf{x},t=p\Delta t\big{)}\), \(p\in\mathbb{N}\), and \(\Delta t\) is the selected time step (the symbol \(\Delta\) is used here to denote a finite difference, as usual in Computational Mechanics). Finally, the discrete form of the problem is obtained by substituting Eq. (33) into Eq. (35),  
\[\frac{1}{\Delta t}\Big{(}\mathbf{M}^{(p)}\mathbf{\overline{T}}^{(p)}-\mathbf{ M}^{(p)}\mathbf{\overline{T}}^{(p-1)}\Big{)}+\mathbf{K}^{(p)}\mathbf{ \overline{T}}^{(p)}-\mathbf{q}^{(p)}=0\,, \tag{36}\]  
where  
\[\mathbf{M}^{(p)}= \int_{\Omega}\Big{(}\mathbf{\overline{N}}^{(p)}\Big{)}^{T}\, \rho c^{(p)}\mathbf{\overline{N}}^{(p)}, \tag{37}\] \[\mathbf{M}^{(p)}= \int_{\Omega}\Big{(}\mathbf{\overline{N}}^{(p)}\Big{)}^{T}\, \rho c^{(p-1)}\mathbf{\overline{N}}^{(p-1)},\] \[\mathbf{K}^{(p)}= \int_{\Omega}\Big{(}\
abla\mathbf{\overline{N}}^{(p)}\Big{)}^{T} \,k^{(p)}\
abla\mathbf{\overline{N}}^{(p)},\] \[\mathbf{q}^{(p)}= \int_{\Omega}\Big{(}\mathbf{\overline{N}}^{(p)}\Big{)}^{T}\,s^{( p)}-\int_{\Gamma_{q}}\Big{(}\mathbf{\overline{N}}^{(p)}\Big{)}^{T}\,\hat{q}^{(p)}.\]  
For the sake of brevity, we rewrite Eq. (36) as  
\[\mathbf{\overline{K}}^{(p)}\mathbf{\overline{T}}^{(p)}=\mathbf{\tilde{q}}^{( p)}, \tag{38}\]  
with  
Figure 2:0 Figure 2:1  
By solving the linear system of algebraic equations in Eq. (38), it is possible to obtain the discrete temperature configuration \(\mathbf{\overline{T}}^{(p)}\) at the current time step, given the one \(\mathbf{\overline{T}}^{(p-1)}\) at the previous time step. In order to evaluate \(\mathbf{M}^{\ast(p)}\) it is necessary to know also the level set at both the current and the previous time step. The overall procedure can be explicit, if the level set update is also explicit, i.e. if the level set at current time step can be obtained from the temperature field and level set at the previous time step (see Section 3 and References [16, 17]). On the other hand, if an implicit time stepping is used, an iterative procedure is required for the simultaneous solution of Eq. (38) and the update of the level set. This technique is used by [PERSON] and [PERSON] [15], who use a generalised one-step trapezoidal integration algorithm with \(T^{(p)}-T^{(p-1)}=\Delta t\left(\alpha\dot{T}^{(p)}+\left(\alpha-1\right)\dot{T}^ {(p-1)}\right)\) in the case of constant \(c\). They perform an error study by testing different values of the parameter \(\alpha\in\left[0,1\right]\) and conclude that the highest accuracy is obtained for \(\alpha=1\), i.e.