## 3 Description of the interface through level set  
The _level set method_ (e.g. [21]) is a numerical scheme used to describe implicitly geometrical objects such as surfaces and lines. The basic concept is to represent a surface \(\Gamma\), of co-dimension one, in the domain \(\Omega\) as the isocontour of some function \(\phi\big{(}\mathbf{x}\big{)}\) defined over \(\Omega\). The method can be extended to model objects with higher co-dimensions by considering multiple level set functions (as many as the co-dimension of the object); for instance, a curve in the three-dimensional space can be represented as the intersection of two surfaces, i.e. the isocontours of two functions \(\phi_{\text{i}}\big{(}\mathbf{x}\big{)}\) and \(\phi_{\text{2}}\big{(}\mathbf{x}\big{)}\). In the case of Stefan problem we need to represent the phase-transition interface, i.e. a surface \(\Gamma_{\text{\tiny tran}}\) of co-dimension one, which evolves with the time. Therefore we need one level set function that depends also on the time. Let\[d\left(\mathbf{x},t\right)=\min_{y\in\Gamma_{\text{\tiny{max}}}\left(t\right)} \left\|\mathbf{x}-\mathbf{y}\right\| \tag{8}\]  
be the distance of the point \(\mathbf{x}\) from the transition interface at time \(t\); we define the level set function as the signed distance function from the interface,  
\[\phi\left(\mathbf{x},t\right)=\min_{\mathbf{y}\in\Gamma_{\text{\tiny{max}}} \left(t\right)}\left\|\mathbf{x}-\mathbf{y}\right\|\text{sgn}\left(\left( \mathbf{x}-\mathbf{y}\right)\cdot\mathbf{n}_{\text{\tiny{sol}}}\left(\mathbf{ y}\right)\right)= \begin{cases}d\left(\mathbf{x},t\right)&\text{on }\Omega_{\text{\tiny{liq}}}\\ 0&\text{on }\Gamma_{\text{\tiny{max}}}\\ -d\left(\mathbf{x},t\right)&\text{on }\Omega_{\text{\tiny{sol}}}\end{cases} \,, \tag{9}\]  
where the arbitrary sign convention in which \(\phi\) is positive in the liquid, negative in the solid, and vanishes on the phase interface, is adopted. Eq. (9) allows the construction of \(\phi\), when the position of the interface is known. Vice versa, when \(\phi\) is given, the interface \(\Gamma_{\text{\tiny{max}}}\) is the zero isocontour of \(\phi\),  
\[\Gamma_{\text{\tiny{max}}}\left(t\right)=\left\{\mathbf{x}:\phi\left( \mathbf{x},t\right)=0\right\}. \tag{10}\]  
Take note that, whereas the function \(d\left(\mathbf{x},t\right)\) is not differentiable in space across the interface, the gradient of \(\phi\left(\mathbf{x},t\right)\) is defined everywhere in \(\Omega\) (provided that the interface is sufficiently regular) and on the interface it points in the direction of the outward normal from the solid region. Therefore, although the interface is obviously the zero level set of \(d\), \(d\) itself is not suitable for describing the interface position since it is not sufficiently regular and, in the numerically approximated form used in computational models, would not reach the zero level in certain parts or would cross the zero twice in others. Besides its position, the level set allows one to describe further geometrical properties of the interface. The normal unit vector is given by  
\[\mathbf{n}_{\text{\tiny{sol}}}=\frac{\
abla\phi}{\left\|\
abla\phi\right\|}\,. \tag{11}\]  
Since the level set function has been chosen as the signed distance function, \(\left\|\
abla\phi\right\|=1\), so that Eq. (11) simplifies to \(\mathbf{n}_{\text{\tiny{sol}}}=\
abla\phi\). The interface mean curvature, which may have a physical interest in the case of Gibbs-Thomson diffusion (see Section 2), can be computed as  
\[\kappa=\text{div}\,\mathbf{n}_{\text{\tiny{sol}}}=\text{div}\,\frac{\
abla \phi}{\left\|\
abla\phi\right\|}\,, \tag{12}\]  
which simplifies to \(\kappa=\
abla^{2}\phi\) in the case of signed distance function. In order to track the movement of the interface it is necessary to define suitable evolution equations for the level-set update. An Eulerian approach is followed by letting the level-set field be advected by a suitable velocity field \(\mathbf{v}\).