# A Backwards-Tracking Lagrangian-Eulerian Method for Viscoelastic Two-Fluid Flows
## 3 Numerical Method
Consequently, if the velocity gradient of the Newtonian phase is allowed to have large influence on the constitutive equation in the interface region; this can result in unphysically large stresses. This is especially the case if not all velocity and length scales in the Newtonian phase are resolved near the interface. Thus, a means of reducing this effect around the free surface is proposed. A threshold volume fraction is used, such that Lagrangian nodes are only created inside the viscoelastic phase, which are defined by the condition \(\alpha\geq\alpha_{\text{lim}}=0.1\). Thus, the constitutive equation is only solved in the viscoelastic part of the computational domain and the stress is assumed to vanish outside the viscoelastic phase. Furthermore, when the velocity gradient is calculated at a Lagrangian node, the corners of the interpolation box at which \(\alpha<0.1\cdot\alpha_{\text{lim}}\) are also considered to be outside the viscoelastic phase. The velocities at such corners are excluded from the gradient calculation and they are replaced by \(0\)th order extrapolation from the corners which are inside the viscoelastic phase. It is remarked that, apart from numerical stability, the described approach is advantageous in terms of computational efficiency, since the constitutive equation only needs to be solved in part of the domain. When the stress field has been calculated, the term \(\
abla\cdot(\alpha\tau)\) is integrated and then added to the right hand side of the discretized momentum equation. At this stage, the product rule is applied, such that  
\[\
abla\cdot(\alpha\tau)=\alpha\
abla\cdot\tau+\tau\cdot\
abla\alpha, \tag{19}\]  
which can be seen as separating the pure interfacial contribution of the viscoelastic stress to the fluid momentum from the remainder part [36]. The formulation of (19) is used, since it was found to enhance numerical stability. The first term of (19) is integrated over the cells with [PERSON] divergence theorem, as  
\[\int_{\text{c.v.}}\
abla\cdot\tau dV=\int_{\text{c.s.}}\mathbf{\hat{n}}\cdot \tau dS=\sum_{f}\int_{\text{f.s.}}\mathbf{\hat{n}}_{f}\cdot\tau dA, \tag{20}\]  
where c.v. denotes the cell volume, c.s. the cell surface, f.s. the surface of cell face \(f\), and the vector \(\mathbf{\hat{n}}\) denotes the surface normal pointing outwards from the cell. In the second step of (20) the surface integral is divided into a sum of the integrals over the respective surface faces of the cell, for which the normal vectors \(\mathbf{\hat{n}}_{f}\) are constant. The integral over each face is approximated with the trapezoidal rule while using the stresses at the Eulerian grid nodes. If a cell has neighbors that have a higher refinement level, e.g. in the case shown in Figure 1, the face to each smaller neighbor cell is individually integrated, such that the stress contribution from each grid node is included correctly. The volume integral of the second term of (19) is approximated with the cell average stress and volume fraction gradient, as  
\[\int_{\text{c.v.}}(\boldsymbol{\tau}\cdot\
abla\alpha)dV\approx(\overline{ \boldsymbol{\tau}}\cdot\overline{\
abla\alpha})\Delta V, \tag{21}\]  
where \(\Delta V\) is the cell volume and \(\overline{(\bullet)}\) denotes volume average. The cells where \(\alpha<0.1\cdot\alpha_{\text{lim}}\) are assumed to be outside the viscoelastic phase and the stress contribution is instead set to zero. The full algorithm for viscoelastic free surface flow can be summarized, as follows,Calculate and add the viscoelastic stress contribution to the discrete momentum equation. Solve velocity and pressure fields \(\mathbf{u}\), \(p\) from the momentum Equation (1) and continuity Equation (2) while using SIMPLEC iterations. Solve the transport of the fluid volume fraction \(\alpha\) from (17)  
Solve the viscoelastic stress from the constitutive Equation (3) to the new time while using the backwards-tracking procedure. When compared to the original version of the Lagrangian-Eulerian framework that was proposed in [PERSON] et al.