1 Introduction

Viscoelastic fluids are a class of materials exhibiting an intermediate behaviour between solids and fluids. In contrast to perfectly elastic solids, they do not possess a permanent reference state, but rather a fading memory of the prior deformations [1]. The elastic stresses generated during the flow are thus expected to vanish over a certain time scale referred to as relaxation time \(\lambda \). For these reasons, they behave very differently from their Newtonian counterparts, showing a wide range of peculiar phenomena (rod-climbing, die swell, elastic recoiling, vertex inhibition and others) [2] and instabilities [3]. The study of viscoelastic fluids and their flow is of great interest in various fields, including polymer processing, pharmaceuticals, microfluidics, cosmetics, the oil and gas industry and the food industry. Additionally, many important biological liquids such as blood [4], synovial fluids [5] and mucus are viscoelastic.

The mathematical theory to study arbitrary viscoelastic flows started with the seminal work of the British mathematician James G. Oldroyd in 1950 [6]. Before that date, only linear viscoelastic constitutive models existed, which were limited to flows with small displacement gradients. Oldroyd’s work generalized these models to finite deformations and arbitrary flows establishing their admissible forms, respecting the principle of material’s objectivity [7]. Based on his newly developed theory, Oldroyd was able to derive the nonlinear equivalent of the Jeffreys model, which became known as the Oldroyd-B model [8]. This is regarded as one of the most simple and popular models to describe viscoelastic fluids involving a microstructure embedded in a solvent (e.g., polymer solutions). The Oldroyd-B fluid equations were later re-derived based on a simplified molecular model consisting of a suspension of Hookean dumbbells in a Newtonian solvent [2]. For all these reasons, the Oldroyd-B model became a reference in the field of theoretical [7, 8] and numerical studies of viscoelastic fluids.

Despite its simplicity, when coupled with the equations of motion for the fluid, the Oldroyd-B model gives rise to a complex set of coupled Partial Differential Equations (PDEs). Except for a few very simple flows, it is usually not possible to compute that an analytical solution and numerical techniques must be employed. The topic of numerical simulation of viscoelastic flow has been gaining attention over the past three decades. An extensive description of the application of the Finite Difference Method (FDM), Finite Volume Method (FVM), Finite Element Method (FEM) and spectral methods for the simulation of confined viscoelastic flows can be found in [9, 10]. Concerning free-surface Oldroyd-B flows, several works have been carried out in the Eulerian framework, exploiting the FDM [11,12,13,14,15,16], the FVM [17, 18] or the FEM [19,20,21], to compute solutions for benchmark problems, such as the impacting drop, the jet buckling flow, the die-swell phenomenon and polymer extrusion. Meshless methods have also been thoroughly investigated, because, relying on a Lagrangian framework, they can effortlessly track the free surface and avoid dealing with the nonlinear convective term. In particular, the Smoothed Particle Hydrodynamics (SPH) has been employed to reproduce the aforementioned problems in [22,23,24,25,26]. Also, the Material Point Method (MPM) has been considered a valuable option to reproduce free-surface viscoelastic flows in [27, 28]. Recently, in [29], an innovative approach named Floating Isogeometric Analysis (FLIGA), has been tested on the die-swell problem and applied for the 2D simulation of the extrusion of a polymeric material.

Instead, to the authors’ best knowledge, there are no contributions yet regarding the study of viscoelastic free surface flow with the Particle Finite Element Method (PFEM) [30, 31]. The PFEM relies on an updated Lagrangian formulation integrated with a re-meshing scheme to deal with large distortions in the computational domains. It combines advantages both from meshless methods and standard FEM for continua. Among its strengths, there is the treatment of large displacement problems, the ability to effortlessly keep track of the free surface and the ease in the imposition of boundary conditions (with respect to meshless methods). Non-Newtonian viscous and viscoplastic free-surface flows have been widely simulated with the PFEM, for example, in landslide flows [32], glass forming [33], metal moulding and forging [34, 35], fresh concrete flow tests [36, 37] or recently in 3D concrete printing applications [38,39,40,41]. Therefore, even if it has not been attempted yet, it would appear natural also to apply the PFEM for the simulation of non-Newtonian viscoelastic free-surface fluid flows. The advantages of PFEM to study viscoelastic fluids over other methods could be multiple. First of all, differently from meshless methods, PFEM allows the use of constitutive laws developed in a continuum framework, facilitating the implementation of complex material behaviours. Secondly, as already mentioned above, PFEM is particularly suitable for studying problems with evolving free surfaces or involving fluid–structure interaction, as typically happens in viscoelastic flows. Thus, this article proposes an implementation of the Oldroyd-B model in the PFEM framework, proving its efficiency and accuracy through the simulation of multiple well-established 2D and 3D benchmarks. More in the specific, the article is structured as follows.

In Sect. 2, the theoretical framework is presented, starting with a general discussion of the continuum assumption and then describing the governing equations for the fluid. The standard Newtonian rheological law and the more elaborated Oldroyd-B viscoelastic constitutive equation are also introduced. Subsequently, in Sect. 3 the numerical discretization of the equations is reported, with particular focus on how to integrate in time the constitutive viscoelastic law. In Sect. 4, the PFEM basics are recalled and two specific aspects are detailed: the transfer of the internal variables and the imposition of the unilateral Dirichlet boundary condition. Section 5 presents the impacting drop and the jet buckling flow benchmarks both in 2D and in 3D. They are used to verify the model through comparison with other works from the literature. Finally, in Sect. 6, the conclusions are drawn, addressing potential issues, further developments and future applications.

2 Governing equations

The mathematical idealization of a homogeneous fluid as a continuum is based on the assumption that the representative volume element is small enough with respect to the region of fluid considered, but still larger than the molecular mean free path [42]. This allows the definition of the relevant variables (e.g., velocity, pressure, density) at each point of the fluid domain, ensuring that their space variation remains truly continuous. Under this assumption, the response of the fluid can be studied with a system of PDEs, the Navier–Stokes equations, accounting for the conservation of momentum and mass. In this work, the Navier–Stokes equations are written under the hypothesis of weakly compressible fluid.

2.1 Balance equations

Considering an evolving fluid domain \(\Omega _t\) in a time interval [0, T], let us denote with \(\textbf{x}\) the position vector at time t in the local “or current" configuration. Consequently, the momentum balance and mass continuity equations for a compressible fluid read:

$$\begin{aligned} \rho \frac{\textrm{d} \varvec{u}}{\textrm{dt}} = \nabla _{\varvec{x}} \cdot \varvec{\sigma } + \rho \varvec{b} \quad&\text {in } \Omega _{t} \times [0, T], \end{aligned}$$
(1)
$$\begin{aligned} \frac{\textrm{d} p}{\textrm{dt}} + K \nabla _{\varvec{x}} \cdot \varvec{u} = 0 \quad&\text {in } \Omega _{t} \times [0, T], \end{aligned}$$
(2)

where \(\rho \) is the density of the fluid (assumed to be constant hereafter), \(\varvec{\sigma }= \varvec{\sigma }(\varvec{x},t)\) is the Cauchy stress tensor, \(\varvec{b}\) is the vector of the body forces in the local configuration, \(\varvec{u}=\varvec{u}(\varvec{x},t)\) is the velocity field, \(p=p(\varvec{x},t)\) is the pressure field and K is the bulk modulus of the material. Additionally, \(\frac{d (\bullet )}{dt} = \frac{\partial (\bullet )}{\partial t} + \varvec{c} \cdot \nabla _{\varvec{x}}(\bullet )\) represents the material derivative with respect to time, where \(\varvec{c}\) is the convective velocity. In the following, the Lagrangian description is considered (\(\varvec{c}=0\)); thus, the convective term vanishes and the material and local derivatives coincide \(\frac{d (\bullet )}{dt} = \frac{\partial (\bullet )}{\partial t}\). The governing equations can be solved after a suitable set of initial and boundary conditions is assigned:

$$\begin{aligned}&\varvec{u}(\varvec{x}, t = 0) = \varvec{u_0} \ \quad \text {in } \Omega _0, \end{aligned}$$
(3)
$$\begin{aligned}&\varvec{u}(\varvec{x}, t) = \widetilde{\varvec{u}}(\varvec{x}, t) \quad \text {on } \Gamma _D \times (0,T), \end{aligned}$$
(4)
$$\begin{aligned}&\varvec{\sigma } \cdot \varvec{n} = \varvec{h}(\varvec{x}, t) \qquad \text {on } \Gamma _N \times (0,T), \end{aligned}$$
(5)
$$\begin{aligned}&p(\varvec{x}, t = 0) = p_0 \qquad \text {in } \Omega _0, \end{aligned}$$
(6)

where \(\varvec{u_0}\), \(\widetilde{\varvec{u}}\), \(\varvec{h}\), \(p_0\) are prescribed known functions and \(\varvec{n}\) is the outward normal to the boundary \(\Gamma _t = \partial \Omega _t\), which is subdivided into two non-overlapping subsets \(\Gamma _D\) and \(\Gamma _N\), such that \(\Gamma _D \cup \Gamma _N = \Gamma _t\) and \(\Gamma _D \cap \Gamma _N = \emptyset \).

2.2 Constitutive law

2.2.1 Newtonian rheological law

In fluid mechanics, the Cauchy stress tensor is typically decomposed into a volumetric and a deviatoric part:

$$\begin{aligned} \varvec{\sigma } = -p \varvec{I} + \varvec{\tau }, \end{aligned}$$
(7)

where \(\varvec{I}\) is the identity tensor and \(\varvec{\tau }\) is the deviatoric stress tensor (or extra-stress tensor). The Newtonian fluid is the most simple mathematical model to account for the presence of viscous stresses. It postulates a linear relation between the viscous stresses and the strain rates:

$$\begin{aligned} \varvec{\tau }(\varvec{u})=2\eta \dot{\varvec{\epsilon }}(\varvec{u}), \end{aligned}$$
(8)

where \(\eta \) is the constant Newtonian fluid viscosity and \(\dot{\varvec{\epsilon }}(\varvec{u})\) is the deviatoric strain rate tensor defined as:

$$\begin{aligned} \dot{\varvec{\epsilon }}(\varvec{u})= \frac{1}{2} (\nabla _{\varvec{x}} \varvec{u}+ \nabla _{\varvec{x}} \varvec{u}^T )-\frac{1}{3} (\nabla _{\varvec{x}} \cdot \varvec{u})\varvec{I}. \end{aligned}$$
(9)

The Newtonian approximation proves to be effective for a wide range of fluids in typical conditions, particularly for fluids composed of small molecules like water and air, even when subjected to the high strain rates associated with turbulent flows [42].

2.2.2 Viscoelastic constitutive law

It is not uncommon in nature and in industrial applications to deal with fluids that do not satisfy the Newtonian approximation, exhibiting a more complex nonlinear behaviour. These fluids fall under the generic name of non-Newtonian fluids. Some examples are fluids with shear-dependent viscosity (showing shear-thinning or shear-thickening behaviour), yield stress fluids, thixotropic fluids (with a time-dependent viscosity) and viscoelastic fluids. The last class describes fluids characterized by the presence of a viscous matrix (solvent) embedding an internal microstructure (solution). For viscoelastic fluids, it is possible to further detail the expression of the Cauchy stress tensor by splitting the extra-stress tensor \(\varvec{\tau }\) in the solvent Newtonian contribution \(\varvec{\tau _s}\) and in the solution non-Newtonian viscoelastic (or polymeric) contribution \(\varvec{\tau _p}\):

$$\begin{aligned} \varvec{\sigma } = -p \varvec{I} + \varvec{\tau } = -p \varvec{I} + \varvec{\tau _s} + \varvec{\tau }_p. \end{aligned}$$
(10)

The solvent contribution represents a standard viscous behaviour and can be computed as:

$$\begin{aligned} \varvec{\tau _s} = 2 \eta _s \dot{\varvec{\epsilon }}(\varvec{u}), \end{aligned}$$
(11)

where \(\eta _s\) is the Newtonian solvent viscosity. The viscoelastic contribution to the extra-stress \(\varvec{\tau }_p\) instead originates from the microstructure within the material, as it typically happens in polymer suspensions. For these reasons, it is often referred to as polymeric stress. The viscoelastic contribution is governed by a separate evolution equation, named constitutive equation, which describes the relaxation of stresses over a certain time scale \(\lambda \) [1]. The constitutive equation can either directly express the polymeric stress tensor as a function of the history of the deformation (in differential or integral form) or describe how a state parameter representative of the microstructure (e.g., the conformation tensor) evolves over time. In the following, the first approach is employed and it is discussed how to derive a differential constitutive equation for the polymeric stress for the viscoelastic Oldroyd-B model. This model, which is often adopted for polymer suspensions or emulsions, is popular due to its simplicity and capacity to capture different phenomena typical of viscoelastic flows.

Fig. 1
figure 1

Jeffreys viscoelastic model: a Maxwell element with spring stiffness G and dashpot viscosity \(\eta _p\) in parallel with a purely viscous dashpot of viscosity \(\eta _s\)

First, let us consider the linear 1D equivalent of the Oldroyd-B model, which is also known as the Jeffreys model [43], represented in Fig. 1. The model consists of a dashpot connected in parallel with a Maxwell element (a damped spring). The former represents the viscous response of the solvent, and it is associated with a Newtonian viscosity of \(\eta _s\). The Maxwell element instead is characterized by a spring stiffness G and a dashpot viscosity of \(\eta _p\) and represents the viscoelastic contribution to the stresses due to the presence of the diluted polymer chains. From this model, it appears evident that the extra-stress \(\tau \) is given by the sum of two contributions, as already anticipated in Eq. (10), one is coming from the Newtonian solvent and the other from the viscoelastic diluted polymer chains.

Focusing now on the polymer contribution only, it is possible to write two equations stating the internal equilibrium of the stresses and compatibility of deformations inside the Maxwell element:

$$\begin{aligned}&G \epsilon _G = \eta _p \dot{\epsilon }_p, \end{aligned}$$
(12)
$$\begin{aligned}&\epsilon = \epsilon _p + \epsilon _G. \end{aligned}$$
(13)

Let us proceed by differentiating equation (13) with respect to time to get an expression for the strain rate in the polymer \(\dot{ \epsilon }_p = \dot{\epsilon }- \dot{\epsilon }_G\). Substituting this result in the first equation (12) and operating some rearrangement of the terms (exploiting also \(\tau _p = G \epsilon _G\)), an equation depending only on the elastic strain in the spring or equivalently on the polymeric stress is obtained:

$$\begin{aligned} \lambda \dot{\epsilon }_G + \epsilon _G = \lambda \dot{\epsilon } \quad \xrightarrow {} \quad \lambda \dot{\tau }_p + \tau _p = \eta _p \dot{\epsilon }, \end{aligned}$$
(14)

where \(\lambda = \frac{\eta _p}{G}\) is the polymer relaxation time. The validity of this result is, however, limited to purely shear flows in the assumption of small displacements. As was shown in Oldroyd [6] and later in [44], for a proper generalization to arbitrary flows and finite strains it is not sufficient to simply replace the scalar quantities with tensors, but it is also necessary to add some terms ensuring that objectivity and the principle of frame indifference are respected. In particular, this is achieved by replacing the ordinary time derivative of the polymeric stress tensor with an adequate frame-invariant derivative. The most common choice is to introduce in the tensorial form of Eq. (14) the upper-convected time derivative, obtaining the frame-invariant Oldroyd-B model (or upper-convected Jeffreys model [43]), which reads:

$$\begin{aligned} \lambda \overset{\triangledown }{\varvec{\tau }}_p + \varvec{\tau }_p = 2 \eta _p \dot{\varvec{\epsilon }}, \end{aligned}$$
(15)

where \(\overset{\triangledown }{\varvec{\tau }}_p\) is the upper-convected time derivative, defined for any second-rank tensor embedded in a moving fluid (with velocity \(\varvec{u}\)) as:

$$\begin{aligned} \overset{\triangledown }{\varvec{A}} = \frac{\partial \varvec{A}}{\partial t} + \varvec{u} \cdot \nabla \varvec{A} - \varvec{A} \cdot \nabla \varvec{u} - (\nabla \varvec{u})^T \cdot \varvec{A}, \end{aligned}$$
(16)

where the first term is the intrinsic variation of the tensor field in time, the second term is the convective derivative accounting for Galilean invariance (i.e., invariance with respect to an inertial observer moving with the same velocity of the flow \(\varvec{u}\)), while the last two terms ensure the objectivity with respect to an observer rotating and deforming with the flow [1].

3 Numerical solution

As said above, the Navier–Stokes equations can be solved in closed form only in very few cases. As soon as their most general form is considered or complex geometries are involved, no analytical solution can be determined. Even more, if the Navier–Stokes equations are used in combination with complex nonlinear constitutive laws, as in the case of viscoelastic flows, it becomes mandatory to rely on numerical approaches. Among the many discretization techniques for fluid dynamic problems, there is the well-known finite element method, which will be exploited in the following to compute an approximate numerical solution to the Navier–Stokes equation.

3.1 Discretization and integration of the equations of motion

The first step to compute a FEM solution consists of associating to the boundary value problem an equivalent weak form. Following the standard Galerkin approach, the spaces of the trial functions are introduced on the domain \(\Omega _t\), for the velocity \(S^u\) and for the pressure \(S^p\) [45]. For the velocity, it is also defined the space of the test functions \(S_0^u\), which vanish on the Dirichlet portion of the boundary. On the contrary, \(S^p\) suffices also as a test space, since there are no explicit boundary conditions on the pressure.

The weak form of the momentum balance is obtained by multiplying equation (1) for the generic vector test function \(\varvec{w} \in S_0^u\) and integrating over the computational domain \(\Omega _t\). Analogously, the weak form of the mass conservation is achieved by multiplying equation (2) for the generic scalar test function \(q \in S^p\) and again integrating over \(\Omega _t\). The weak formulation of the problem, therefore, consists of computing \(\varvec{u} \in S^u\) and \(p \in S^p\) that satisfy:

$$\begin{aligned}&\int _{\Omega _t} \varvec{w} \cdot \rho \frac{\partial \varvec{u}}{\partial t} d\Omega _t \nonumber \\&\quad =\int _{\Omega _t} \varvec{w} \cdot (\nabla _{\varvec{x}} \cdot (\varvec{\tau }_s + \varvec{\tau }_p - p\varvec{I}) + \rho \varvec{b}) d\Omega _t \quad \forall \ \varvec{w} \in S_0^u, \end{aligned}$$
(17)
$$\begin{aligned}&\int _{\Omega _t} q \frac{\partial p}{\partial t} d\Omega _t + \int _{\Omega _t} q K \left( \nabla _{\varvec{x}} \cdot \varvec{u} \right) d\Omega _t =0 \quad \forall \ q \in S^p. \end{aligned}$$
(18)

It is worth highlighting that Eq. (17) is written for the general case of a viscoelastic fluid, but the Newtonian fluid is easily retrieved as a subcase when \(\varvec{\tau }_p=0\). From the weak forms, it is possible to obtain a finite-dimensional problem by introducing an isoparametric finite element discretization of the velocity and pressure fields:

$$\begin{aligned} u_{i}(x,t)= & {} \sum _{a=1}^{n_e} N_{a}^{u}(x) U_{i,a}(t), \end{aligned}$$
(19)
$$\begin{aligned} p(x,t)= & {} \sum _{a=1}^{n_e} N_{a}^{p}(x) P_{a}(t), \end{aligned}$$
(20)

where \(n_e\) represents the number of nodes in the element, \(\varvec{U}_i\) is the vector of nodal velocities in the i-th direction, \(\varvec{P}\) is the vector of the nodal pressures and \(N_{a}^{u}\), \(N_{a}^{p}\) are the shape functions for the velocity and the pressure, respectively. The integrals in Eqs. (17) and (18) can then be evaluated separately over each element, leading to the semi-discretized in-space balance equations:

$$\begin{aligned}&\varvec{M}_u \frac{{\partial } \varvec{U}}{{\partial } t} = \varvec{F}_\textrm{ext} - \varvec{K}_{\eta } \varvec{U} + \varvec{D}^T \varvec{P}, \end{aligned}$$
(21)
$$\begin{aligned}&\varvec{M}_{p}\frac{ \partial \varvec{P}}{\partial t} + K \textit{\textbf{D U}}=0, \end{aligned}$$
(22)

where \(\varvec{M}_u\) and \(\varvec{M}_{p}\) are the velocity and the pressure mass matrices, \(\varvec{K}_{\eta }\) is the viscous matrix, \(\varvec{F}_\textrm{ext}\) is the vector of the external forces and \(\varvec{D}\) is the discrete gradient operator (see [46]).

Subsequently, the time history can be subdivided into a finite set of time steps \(\Delta t\) and the equations are enforced only at discrete time instants. A forward Euler scheme is used to approximate time derivatives. The fully discretized counterparts of Eqs. (1) and (2) at the generic discrete time instant \(t_n\) read:

$$\begin{aligned}&{\varvec{M}_u^{n} \frac{\varvec{U}^{n+1}-\varvec{U}^n}{\Delta t^n} = \varvec{F}_\textrm{ext}^n-\varvec{F}_\textrm{int}^n, } \end{aligned}$$
(23)
$$\begin{aligned}&{\varvec{M}_{p}^{n} \frac{\varvec{P}^{n+1}-\varvec{P}^{n}}{\Delta t^{n}} = - K \varvec{D}^{n} \varvec{U}^{n},} \end{aligned}$$
(24)

where the vector of the internal forces has been introduced \(\varvec{F}_\textrm{int} = \varvec{K}_{\eta } \varvec{U} - \varvec{D}^T \varvec{P}\). The forward Euler scheme is explicit; therefore, the stable time step should be chosen to respect stability conditions. In particular, at each time increment, the stable time step is estimated based on:

$$\begin{aligned} \Delta t = \beta \min \limits _{e} \left( \frac{h_e}{c}, \frac{h_e^2}{\nu } \right) , \end{aligned}$$
(25)

where \(\beta \) is a scaling safety factor, \(h_e\) is a characteristic size of the element in the current configuration, c is the speed of propagation of a dilatational pressure wave in the material and \(\nu \) is the kinematic viscosity, defined as \(\nu = \eta / \rho \). In Eq. (25) the first term is the standard Courant–Friedrichs–Lewy (CFL) condition, while the second term is the viscous diffusion stability condition [47]. It can also be rewritten as \(\Delta t = \beta \frac{h_e}{\nu / h_e}= \beta \frac{h_e}{c_\textrm{diff}}\), where \(c_\textrm{diff}=\nu / h_e\) acts as a diffusion propagation velocity, to highlight the similarity with the CFL.

3.2 Integration of the viscoelastic constitutive law

To solve Eqs. (23) and (24), it is necessary to compute at each time step the vector of the internal forces \(\varvec{F}_\textrm{int}=\varvec{K}_{\eta } \varvec{U} - \varvec{D}^T \varvec{P}\), which requires the evaluation of the viscoelastic contribution entering in \(\varvec{K}_{\eta }\). This translates to the task of computing the polymeric stress tensor \(\varvec{\tau }_p\) from Eq. (15). In the specific, let us rewrite Eq. (15) by expanding the upper-convected derivative:

$$\begin{aligned} \lambda (\frac{\partial \varvec{\tau }_p}{\partial t} + \varvec{u} \cdot \nabla \varvec{\tau }_p - \varvec{\tau }_p \cdot \nabla \varvec{u} - (\nabla \varvec{u})^T \cdot \varvec{\tau }_p ) + \varvec{\tau }_p = 2 \eta _p \dot{\varvec{\epsilon }}. \end{aligned}$$
(26)

Equation (26), including also the convective term \(\varvec{u} \cdot \nabla \varvec{\tau }_p\), represents the general form of the Oldroyd-B constitutive law cast in an Eulerian form. Being a PDE, Eulerian solvers will be required to discretize in space the gradient of the polymeric stress tensor to evaluate the convective contribution. A possibility to carry out this operation would be to switch to a mixed three-field \(\varvec{\tau }_p-\varvec{u}-p\) formulation, where a finite element approximation is provided also for the polymeric stress tensor and the constitutive equation is re-written in weak form. In this case, an extension of the LBB-compatibility condition must be respected for the choice of the finite element spaces for the stress, velocity and pressure shape functions. Some works discretizing the weak form of the constitutive law in the Eulerian framework with FEM are [48, 49], while with FVM [18].

On the contrary, when a Lagrangian framework is adopted, the convective term in Eq. (26) disappears. This fact has great relevance for a numerical solution since now the constitutive equation becomes an ordinary differential equation and will only require time integration. Lagrangian-based numerical simulations were performed with FEM in [29, 50] and with SPH, for example, in [51]. Exploiting the Lagrangian point of view and normalizing with respect to the coefficient of the time derivative of the polymeric stress tensor, the constitutive equation reads:

$$\begin{aligned} \frac{\partial \varvec{\tau }_p}{\partial t} - \varvec{\tau }_p \cdot \nabla \varvec{u} - (\nabla \varvec{u})^T \cdot \varvec{\tau }_p + \frac{1}{\lambda }\varvec{\tau }_p = 2 G \dot{\varvec{\epsilon }}. \end{aligned}$$
(27)

Now, it is possible to approximate the time derivative of the polymeric stress tensor with a finite difference approach. In the literature, a common choice is to use second-order accurate integration schemes, such as the leapfrog scheme [24] or the second-order Runge–Kutta method [13, 22, 23, 26]. Since in this work the fluid problem is being integrated explicitly in time with the first-order accurate forward Euler method, it was decided to use it also to integrate the Oldroyd-B constitutive equation. As it will be demonstrated by the applications in Sect. 5, this choice is acceptable due to the good outcome of the results. Therefore, the discretized in time constitutive equation reads:

$$\begin{aligned} \frac{\varvec{\tau }_p^{n+1}-\varvec{\tau }_p^{n}}{\Delta t} - \varvec{\tau }_p^{n} \cdot \nabla \varvec{u}^{n} - (\nabla \varvec{u}^{n})^T \cdot \varvec{\tau }_p^{n} + \frac{\varvec{\tau }_p^{n}}{\lambda } = 2 G \dot{\varvec{\epsilon }}^{n}. \nonumber \\ \end{aligned}$$
(28)

Finally, by solving for the updated polymeric stress tensor \(\varvec{\tau }_p^{n+1}\), it is obtained:

$$\begin{aligned} \varvec{\tau }_p^{n+1}=\varvec{\tau }_p^{n} + \Delta t ( \varvec{\tau }_p^{n} \cdot \nabla \varvec{u}^{n} + (\nabla \varvec{u}^{n})^T \cdot \varvec{\tau }_p^{n} - \frac{\varvec{\tau }_p^{n}}{\lambda } + 2 G \dot{\varvec{\epsilon }}^{n} ). \nonumber \\ \end{aligned}$$
(29)

4 Particle Finite Element Method

In the Lagrangian approach, the observer follows each fluid particle in its motion. In computational fluid dynamics, this concept is translated into meshes having the nodes coincident at any time with the material points. As a result, the computational mesh overlaps the material domain and deforms accordingly. This approach presents several advantages, such as the intrinsic ability to capture free surfaces or the fact that the nonlinear convective terms disappear in the equations of motion. The Lagrangian description is commonly adopted in solid mechanics, and in principle, it could be efficiently applied also to study soft materials and highly viscous fluids. However, these types of materials are generally characterized by large deformations, which could lead to the deterioration of the computational mesh. If a proper strategy is not used to cure the problem, accuracy and stability issues can arise, even preventing the possibility of computing a solution.

A possible remedy is given by the so-called Particle Finite Element Method (PFEM) [30], which is an updated Lagrangian FEM approach equipped with an efficient remeshing technique. The PFEM was originally developed for the simulation of free-surface flows and breaking wave problems [52]. However, it soon became widely applied also to other fields, such as landslide simulations [32, 53], geotechnical problems [54, 55], granular flows [56], fresh concrete flow tests [36, 37], multi-phase flows [57], particle-laden flows [58] and fluid–structure interaction problems [59,60,61].

Also in industrial and manufacturing applications, PFEM turned out to be a valid option, especially for simulating ductile solids [35] or viscous fluids, such as in glass forming [33], metal moulding [34] and recently 3D concrete printing [39,40,41].

Fig. 2
figure 2

Re-meshing scheme in the PFEM: initial domain and related mesh (a); deformed domain with distorted mesh (b); only the nodes of the old mesh are kept (c); convex hull generated with a Delaunay triangulation (d); the \(\alpha \)-shape method is used to discard the elements not respecting the quality criterion (e); new mesh on the physical domain (f)

The main steps for computing a solution with the PFEM are here summarized with reference to Fig. 2.

  1. (1)

    The initial domain is discretized with a finite element mesh (Fig. 2a). As the analysis starts, the equations of motions for the continuum are solved as in the standard FEM and the solution is used to update the nodal variables (e.g., velocity, pressure, position).

  2. (2)

    Step 1 is iterated multiple times in the spirit of the updated Lagrangian formulation, allowing for the advancement of the solution in time. Eventually, the fluid will undergo large displacements, which are generally associated with high distortions in the computational mesh (Fig. 2b).

  3. (3)

    The mesh quality is thus checked runtime during the analysis. As soon as some excessively distorted elements are detected in the computational domain, a remeshing procedure is started. The first operation consists of removing the old mesh, maintaining only the nodes (Fig. 2c).

  4. (4)

    Successively, a reconnection phase is performed, in which a new mesh is generated using an efficient Delaunay triangulation algorithm, such as [62]. The newly generated mesh represents the convex hull of the given set of nodes (Fig. 2d).

  5. (5)

    The subsequent step is the boundary reconstruction: it is necessary to find a criterion to establish which elements of the newly generated mesh truly belong to the fluid domain and which ones should be discarded. The most common approach is to employ the \(\alpha \)-shape technique [31, 63], which relies on the observation that the elements not belonging to the physical domain are generally also the most distorted, as they are connecting nodes which are distant from each other. Therefore, for each element, a geometrical index \(\alpha _e\) is computed to measure its distortion:

    $$\begin{aligned} \alpha _e = \frac{r_{c,e}}{h} \end{aligned}$$
    (30)

    where \(r_{c,e}\) is the radius of the circumcircle (or circumsphere in 3D) of the considered element and h is the characteristic mesh size defined on the initial mesh. Moreover, a proper threshold value for the distortion index \(\overline{\alpha }\) is assigned, so that the overly distorted elements will be those not satisfying \(\alpha _e \le \overline{\alpha }\) (Fig. 2e). Note that the choice of the threshold parameter is a delicate point, as it can lead to different configurations and variations in the total volume [64].

  6. (6)

    Finally, once all the non-physical elements have been identified and removed, the updated computational domain is obtained. As shown in Fig. 2f, the new mesh shows an improved quality and can be used to restart the analysis.

A critical aspect of the PFEM is that during the remeshing procedure the elemental information stored at the Gauss points is inevitably lost and only the nodal variables are conserved. Often in fluid dynamics, only nodal variables are employed and, if linear (triangular in 2D, tetrahedral in 3D) elements are used, there is no need for data interpolation from the old mesh to the new one [31]. This is a standard choice in the PFEM; however, it is important to recall that by using equal-order linear shape functions for both the velocity and the pressure fields the Ladyzhenskaya–Babuška–Brezzi (LBB) condition is violated. As a consequence, even if the weakly compressible fluid assumption tends to mitigate the instability, it is generally necessary to introduce an appropriate stabilization. In the present work, the stabilizing effect is achieved by adding a new term in the mass conservation, based on the local \(L_2\) polynomial projection of the pressure field onto a lower-order interpolation space [65, 66].

4.1 Transfer of internal variables

As already pointed out, the PFEM can also be applied to large displacements problems in solid mechanics and to highly viscous/viscoelastic flow problems in fluid mechanics. Often, these materials present constitutive laws involving historical variables that, if Gaussian integration is used, would be lost because of the remeshing process.

A possible solution could be to use nodal integration schemes [38, 67], where all variables (including internal variables, such as stresses and strains) are computed at the nodes. Despite the perfect transfer of all the data through the remeshing processes, in this approach, the solution is still partially affected by mesh variations due to reconnection and elimination/creation of elements [31].

If a standard Gaussian integration scheme is adopted instead, a possible solution could be the direct projection of the historical variables from the Gauss points of the old mesh to the closest one in the new mesh [34, 54, 68]. This technique is widely used in solid mechanics PFEM applications, where the mesh reconstruction is generally needed only in a limited portion of the domain. In fact, in this way, the elemental information is perfectly preserved in all those elements which did not change their connectivity during the remeshing process. However, when the connectivity does change, an error is introduced proportional to the distance between the old and the new Gauss points.

Finally, in the more traditional approach, the elemental data from the original mesh are transferred to the nodes exploiting the shape functions for interpolation. Subsequently, this datum is reconstructed back onto the elements of the new mesh. Some examples of works relying on this method are [41, 69, 70]. However, this process can introduce an excessive smoothing of the internal variables and consistently alter the solution. To limit this issue in [71], it is proposed to remap only the increments of the historical variables at the nodes. The same idea is used in this work to treat viscoelastic internal variables.

As it is illustrated in Sect. (3.2), the integration of the constitutive law for a viscoelastic fluid needs the value of the viscoelastic (polymeric) extra-stress tensor at the previous time step. Let us rewrite the discretized in time constitutive law (29) in a more concise way:

$$\begin{aligned} \varvec{\tau }_p^{n+1}=\varvec{\tau }_p^{n} + \Delta \varvec{\tau }_p, \end{aligned}$$
(31)

where \(\Delta \tau _p = \Delta t ( \varvec{\tau }_p^{n} \cdot \nabla \varvec{u}^{n} + (\nabla \varvec{u}^{n})^T \cdot \varvec{\tau }_p^{n} - \frac{1}{\lambda }\varvec{\tau }_p^{n}+ 2\,G \dot{\varvec{\epsilon }}^{n})\) is the increment of the polymeric stress tensor in a timestep. To transfer the updated information to the subsequent time step, the following procedure has been implemented:

Fig. 3
figure 3

Recovering the internal variables in the Gauss point from the nodes (a); storing the internal variables computed at the Gauss point at the nodes (b)

Fig. 4
figure 4

Detachment mechanism based on the \(\alpha \)-shape criterion in standard PFEM. Dotted arrows indicate how the body is moving

Fig. 5
figure 5

Unilateral alternative boundary condition: node P is released if the interpolated value of the normal velocity \(u_{n,P}\) is greater than a tolerance. Dotted arrows indicate how the body is moving

  • Assume that at time \(t_{n+1}\), for the generic j-th element, the information regarding the polymeric stress tensor at the previous step is stored at the nodes: \(\varvec{\tau }_{p,i}^n, \ i=1,...,3\). The value of the polymeric stress tensor at the Gauss point of the element j can be reconstructed, as shown in Fig. 3a, by means of:

    $$\begin{aligned} \tau _{p,j}^{n}= \sum _{i=1}^{d} N_i \tau _{p,i}^n, \end{aligned}$$
    (32)

    where \(\tau _{p,j}^{n}\) is the generic component of the polymeric stress tensor \(\varvec{\tau }_{p,j}^{n}\), \(N_i\) are the linear shape functions adopted to describe the velocity and the pressure fields and d is the number of nodes of the finite element (\(d=3\) in 2D and \(d=4\) in 3D).

  • The increment \(\Delta \varvec{\tau }_{p,j}\) of the non-Newtonian extra-stress tensor is then computed at the Gauss points of element j from Eq. (29). Thus, the updated polymeric stress tensor in the Gauss point is given by:

    $$\begin{aligned} \varvec{\tau }_{p,j}^{n+1}=\varvec{\tau }_{p,j}^{n} + \Delta \varvec{\tau }_{p,j}, \end{aligned}$$
    (33)

    and it will be used to compute the vector of the nodal internal forces \(\varvec{F}_\textrm{int}\).

  • Finally, before starting the next time step, the increment of the polymeric stresses in the Gauss points must be stored at the nodes. For each node i in the mesh, the contributions coming from the adjacent elements are averaged (see Fig. 3b), and the obtained value is added to the previously stored contributions:

    $$\begin{aligned} \varvec{\tau }_{p,i}^{n+1}=\varvec{\tau }_{p,i}^{n} + \frac{\sum _{j=1}^m A_j \Delta \varvec{\tau }_{p,j}}{\sum _{j=1}^m A_j} , \end{aligned}$$
    (34)

    where \(A_j\) is the area of element j, and index j cycles over the elements adjacent to the node i (m in total).

4.2 Treatment of boundary conditions

For a general review of the most common techniques employed to impose boundary conditions in the PFEM, the reader is referred to [31, 46]. In this work, the Dirichlet Boundary Conditions (DBCs) are imposed following the scheme introduced in [40]: zero DBCs are assigned during the analysis by “freezing" (imposing a null velocity) those nodes which satisfy a certain prescribed constraint on their position. To clarify this concept with an example, in the application regarding the impact of a 2D drop on a horizontal plane (see Sect. 5), the y-coordinates of the free-surface nodes are monitored. Whenever a node i satisfies the inequality \(y_i <0\), the DBC is imposed in strong form on that node to reproduce the effect of the plane. Differently from how it is done in standard PFEM [31], with this technique, there is no need to define in advance the constraint by positioning fixed nodes on the Dirichlet boundary. Furthermore, mass variations remain limited also in the case of coarse meshes.

Generally, DBCs are interpreted and imposed as bilateral constraints. However, this is not always the case and in some applications (such as in the impacting drop problem), it could be necessary to implement a unilateral constraint to capture bouncing phenomena. A unilateral DBC is a type of constraint that imposes a restriction on a system only in one direction, leaving the opposite direction free. Two different techniques are presented to deal with this type of behaviour in PFEM:

  1. (1)

    The first option is to rely on the \(\alpha \)-shape. Basically, after the impact, as the body tries to contract and detach from the surface, the first elements connecting the body with the fixed nodes will stretch and become distorted, as shown in Fig. 4. By a suitable choice of the \(\alpha \)-shape parameter \(\overline{\alpha }\), these distorted elements will be deleted, gradually “releasing" the body and allowing it to contract and bounce. This is the technique used in PFEM, however, it works well only for very fine meshes. For example, in [72], the detachment of droplets from the free surface of a fluid is treated with ad hoc strategies to mitigate unwanted mass variations and alterations of the free surface.

  2. (2)

    A second option to treat unilaterally the DBC, which allows for smoother results, especially in the case of coarser meshes, is here proposed. At each time step, at every fixed Dirichlet node, the velocity component normal to the wall is interpolated from the adjacent nodes. With reference to Fig. 5, at the fixed point P, the interpolated value of the normal velocity \(u_{n,P}\) is found with:

    $$\begin{aligned} u_{n,P}= \frac{\sum _{i=1}^m u_{n,i}}{m}. \end{aligned}$$
    (35)

    where m is the number of nodes adjacent to node P. If \(u_{n,P}>\textrm{tol}\) (where tol is a threshold value close to zero), this velocity is assigned to the bounded node and it is released from the plane. Otherwise, if \(u_{n,P}<\textrm{tol}\), the node is kept as a boundary node with a zero velocity imposed. This method presents several advantages with respect to the first one: smoother free surfaces are obtained, mass conservation is improved and the dependence of the results from the \(\alpha \)-shape parameters is reduced. These aspects will be illustrated more in depth in Sect. 5.1.3.

On the other side, a nonzero DBC is imposed at the inflow for the application of the jet buckling problem. The technique adopted here discretizes the inflow with a set of Eulerian nodes, and new Lagrangian nodes are added in the surrounding stretching elements during the simulation, to reproduce the continuous material flow. For further details about this method, the reader is referred to [40].

5 Results and discussion

In this section, two benchmark problems are solved both in 2D and in 3D to demonstrate the capability of the particle finite element method for the simulation of viscoelastic free-surface flow problemsFootnote 1. Each case study is solved firstly for a standard Newtonian fluid and successively employing the Oldroyd-B viscoelastic constitutive law.

5.1 Numerical simulation of an impacting drop in 2D

A well-established benchmark in the field of viscoelastic simulations of free-surface flows is the impact of a 2D drop on a rigid plane. The problem requires dealing with large deformations, free-surface tracking and the correct description of the viscoelastic effects. For all these reasons, it has been chosen by different researchers to verify numerical schemes, for example, employing the FDM [11, 13, 16] or the SPH method [22,23,24, 26].

The benchmark was originally introduced in [11]. With reference to Fig. 6, the initial configuration is described through the following data: initial drop diameter \(D=0.02 \ \)m; initial height of the centre of the drop from the plate \(H=0.04\) m; initial velocity \(U=-1 \ \)m/s; gravity acting downward with \(g = -9.81 \ \mathrm{m/s}^2\). No slip boundary conditions are imposed on the rigid plane.

Fig. 6
figure 6

Initial conditions and geometry of the 2D impacting drop benchmark

5.1.1 Simulations and description of the results

Three simulations have been carried out, the first one adopting a Newtonian fluid and the other two a viscoelastic Oldroyd-B model. In all cases, it was chosen a density of \(\rho = 1000 \ \mathrm{kg/m}^3\), a speed of sound in the material of 12.5 m/s and a Newtonian viscosity of \(\eta = 4\) Pa s. The Newtonian fluid flow is completely characterized by the dimensionless Froude (Fr) and Reynolds (Re) numbers. The Froude number (in the context of this work) represents the ratio of inertial to gravitational forces, while the Reynolds number is the ratio of inertial to viscous forces. The Froude and Reynolds number for the Newtonian simulation take values: \(Fr = \frac{U}{\sqrt{g D}} = 2.26\) and Re = \(\frac{\rho D U}{\eta }=5\).

To describe a viscoelastic flow in addition to these two numbers, it is necessary to define the Weissenberg number \(Wi = \frac{\lambda U}{D} = \frac{\eta _p U}{G D}\) and the ratio between the solvent and the total equivalent viscosity \(\beta = \frac{\eta _s}{\eta }\), where for the Oldroyd-B model \(\eta = \eta _s + \eta _p\). In the first viscoelastic simulation, Fr = 2.26 and Re = 5 are assigned as in the Newtonian flow. Additionally, to the Weissenberg number it is given unitary value \(Wi = 1\), while \(\beta = 0.01\). Consistently to these data, the solvent viscosity is set to \(\eta _s = 0.4\) Pa s, the polymer viscosity to \(\eta _p = 3.6\) Pa s and the shear modulus to G = 180 Pa. In the second viscoelastic simulation, Fr = 2.26, but now the Reynolds number is decreased to \(Re = 0.5\). Also, Wi = 1 and \(\beta = 0.01\) are kept the same as for the previous case. Consistently to these data, the solvent viscosity is set to \(\eta _s = 4.0\) Pa s, the polymer viscosity to \(\eta _p = 36\) Pa s and the shear modulus to \(G = 1800\) Pa. For all three simulations, the initial mesh size is of the order of \(h = 0.0002\) m, for a total number of nodes of \(n=6430\). Remeshing is conducted when necessary during the analysis. In particular, it is activated very frequently during and immediately after the impact, due to the severe mesh distortions arising. The time step has been adapted during the simulation according to the stability conditions.

Fig. 7
figure 7

Comparison of the shapes of the 2D impacting drops for the Newtonian, Oldroyd-B with Re = 5 and Oldroyd-B with Re = 0.5 fluids

Figure 7 reports the comparison between the shapes of the Newtonian, Oldroyd-B with Re = 5 and Oldroyd-B with Re = 0.5 fluid drops, respectively, at selected dimensionless times \(t=t^*U/D\), where \(t^*\) is the dimensional time. It can be observed that the three flows present substantial differences. The Newtonian drop after the impact spreads gradually always maintaining its convex shape. On the contrary, the viscoelastic drop with Re = 5 shows a more complex shape evolution. After hitting the rigid plane, the viscoelastic drop is characterized by a downward vertical velocity and while spreading on the surface shifts from a convex shape to a concave one. When all the impact energy has been dissipated or elastically stored through elastic deformations, the drop starts to contract due to elastic effects, until reaching a shape of maximum contraction. Subsequently, the drop undergoes numerous spreading-contraction cycles with decreasing intensity, until all the elastic effects are damped out. In the long term, the flow behaviour will align with the one of the Newtonian drop with an equal Reynolds number (this is also evident by comparing the curves Wi = 0 and Wi = 1 in Fig. 12).

The viscoelastic drop with Re = 0.5 presents a similar trend, but deformations are considerably reduced in the initial phase. Moreover, in the contraction phase, the elastic force stored during the impact is now sufficient to make the drop detach from the plane and bounce. After a few bounces the elastic effects will be damped out and the drop will start to slowly flow and spread on the plane.

For the Oldroyd-B with Re = 5 drop impact, in Fig. 8, the x-component of the velocity field in the drop for selected time instants is reported. The results are in good agreement with similar plots presented in [13, 16, 26].

Fig. 8
figure 8

The x-component of the velocity field in the viscoelastic drop at different times

5.1.2 Verification of the results

A quantitative evaluation of the spreading history of the drops can be done by evaluating at each time instant the drop width \(d^*\), computed as \(d^* = \max |x_i - x_j|\), being \(x_i\) is the horizontal coordinate of the generic node i. Figure 9a shows the evolution in time of the dimensionless width \(d = d^*/D\), of the Newtonian drop and compares it to other relevant results in the literature. An optimal accordance is found. In Fig. 9b, the same quantity is plotted for the viscoelastic drop with Re = 5. The comparison with the results obtained with other methods is also very good, thus allowing us to verify our implementation of the Oldroyd-B model. It can be observed that the descending branch in the plot, associated with the elastic contraction of the drop, is very sensitive to the method adopted to impose the unilateral DBCs on the rigid plane. If the no-slip boundary condition is imposed as in standard PFEM, the values of the \(\alpha \)-shape parameters should be carefully selected to reproduce a unilateral constraint and obtain correct results (continuous line in Fig. 9b). On the contrary, if the unilateral behaviour of the rigid plane is achieved through the procedure described in Sect. 4.2, by freeing those nodes with positive outward velocity, a slightly different result is obtained (dashed line in Fig. 9b). In the following, the two ways of imposing the unilateral DBC are further investigated with a convergence study.

Fig. 9
figure 9

Evolution of the dimensionless width of the 2D drop for the Newtonian fluid (a) and for the Oldroyd-B fluid with Re = 5 (b)

The second technique has been preferred for the simulation of the Oldroyd-B drop with Re = 0.5, as it is found to work particularly well in reproducing bouncing. For this drop, the results are presented both in terms of the dimensionless width in Fig. 10a and in terms of the dimensionless maximum y-coordinate \(y = y_{\max }/H\) in Fig. 10b.

Fig. 10
figure 10

Evolution of the dimensionless width (a) and maximum y-coordinate (b) of the 2D drop for the Oldroyd-B flow with Re = 0.5

5.1.3 Convergence study and unilateral DBCs

Two different ways of representing unilateral DBCs in the PFEM framework are introduced in Sect. 4.2. The first one is intrinsic to the PFEM and simply relies on a suitable choice of the \(\alpha \)-shape parameters (“\(\alpha \)-shape b.c."). The second one involves releasing those nodes which are constrained and for which the interpolated normal velocity to the constraint appears to be positive (“\(u_n>0\) b.c."). To further investigate the performances of the two methods, the results of a convergence study are here reported. The impacting drop problem of the viscoelastic drop with Re = 5 is taken as a reference and simulations have been carried out with four different characteristic mesh sizes: h = 0.0008 m, h = 0.0004 m, h = 0.0002 m, h = 0.0001 m.

Fig. 11
figure 11

Convergence study to assess the performances of the two methods of imposing unilateral DBCs in the Oldroyd-B impacting drop problem with Re = 5

Figure 11a reports the evolution of the dimensionless drop width at the refinement of the mesh for the two different unilateral DBCs. The results obtained with the “\(\alpha \)-shape b.c." are acceptable only for quite refined meshes \(h=0.0002-0.0001 \ \)m. For coarser meshes, the solution is highly dependent on the mesh size and tends to underestimate the deformations during the first contraction phase. Moreover, too high values of the \(\alpha \)-shape for the boundary elements would prevent the drop from contracting or bouncing, while too low values would cause holes in the mesh. The \(\alpha \)-shape value selected for the boundary elements in this example was \(\overline{\alpha }_b = 1.0-1.1\). On the contrary, the results obtained with the “\(u_n>0\) b.c.” exhibit nearly no dependence on the mesh size and the corresponding curves in Fig. 11a are practically overlapping. Additionally, there was no need to calibrate the \(\alpha \)-shape value or any other parameter. It is also observed that the results derived from the use of the standard “\(\alpha \)-shape b.c.” at the refinement of the mesh tend to gradually approach the “\(u_n>0\) b.c.” solution.

Figure 11b displays the mass conservation plots with the two approaches for treating unilateral DBCs at the refinement of the mesh. On the y-axis the dimensionless mass defined as \(m = m^*/m_0\) is reported, where \(m_0= \rho \pi D^2/4\). The “\(\alpha \)-shape b.c.” results show nonnegligible mass variations for coarse meshes due to the elimination of the elements not respecting the \(\alpha \)-shape criterion in the contraction phase. As the mesh is refined mass conservation improves, converging from below to the horizontal line \(m=1\). Using instead the alternative “\(u_n>0\) b.c.” approach, the mass is almost perfectly conserved, even for very coarse meshes. All the curves obtained with this second method are almost straight lines overlapping \(m=1\).

Summarizing, the “\(u_n>0\) b.c.” approach proposed to deal with unilateral DBCs exhibits some appealing features:

  • The results can be seen as independent of the mesh size since there is no need for excessively refined meshes to capture correctly the contraction and bouncing effects.

  • The results are almost independent of the choice of the \(\alpha \)-shape parameters, provided that these are selected high enough to prevent the formation of holes in the mesh.

  • Mass conservation is respected almost perfectly also for coarse meshes.

5.1.4 Parametric study on the Weissenberg number

It is well known that due to the hyperbolic nature of the differential constitutive equation, many numerical solvers can experience instability at moderate or high Wi numbers [73]. This issue is known as the high-Weissenberg number problem and can manifest in different ways and at different Wi numbers depending on the boundary conditions of the problem and on the numerical techniques adopted for the solution. The behaviour of the proposed implementation at increasing Wi numbers has been investigated with reference to the impacting drop problem. The results are reported in Fig. 12 and show how the PFEM simulations remain stable also at very high Wi numbers. Moreover, the computed results are in good agreement with those of other works relying on stabilizations such as the square-root conformation [16] or the log-conformation [51] formulations. However, it must be underlined that the impacting drop problem is not a very stringent benchmark. The stability of the method at high-Weissenberg numbers in general problems will be evaluated in future works.

Fig. 12
figure 12

Influence of the Wi number on the evolution of the dimensionless drop width

5.2 Numerical simulation of an impacting drop in 3D

To further verify this implementation of the viscoelastic Oldroyd-B model and to show how the PFEM can be effectively exploited to obtain results in a three-dimensional context, the previous problem of the impact of the drop is reproduced in 3D. In the literature, there are only a few results of the 3D impacting drop, which were obtained with the SPH [25] or with the FDM [11, 14, 15].

The problem geometry is the 3D equivalent of that represented in Fig. 6, so the drop is now idealized with a sphere. Boundary conditions and material properties are the same as in the 2D impacting drop: density \(\rho = 1000 \ \mathrm{kg/m}^3\); speed of sound in the material \(12.5 \ \mathrm{m/s}\); Newtonian viscosity \(\eta = 4\) Pa s. Additionally, for the Oldroyd-B model the solvent viscosity is \(\eta _s = 0.4\) Pa s, the polymer viscosity is \(\eta _p = 3.6\) Pa s and the shear modulus is \(G = 180\) Pa. For all three simulations, the initial mesh size is of the order of \(h = 0.0004 \ \)m, for a total number of nodes of \(n=40480\). The “\(u_n>0\) b.c." approach was employed to accurately reproduce the unilateral DBC while avoiding the difficulties related to the selection of the \(\alpha \)-shapes and the high computational cost of an extremely refined mesh.

The shapes of the drops at different time instants are reported in Fig. 13. The quantitative evaluation of the spreading history of the two drops can be done again by comparing the dimensionless drop width at different times, as shown in Fig. 14a for the Newtonian fluid and in Fig. 14b for the viscoelastic fluid with \(Re = 5\). A very good agreement is found for both cases.

Fig. 13
figure 13

Comparison of the shapes of the 3D impacting drops for the Newtonian, Oldroyd-B with Re = 5 and Oldroyd-B with Re = 0.5 fluids

Fig. 14
figure 14

Evolution of the dimensionless width of the 3D drop for the Newtonian fluid (a) and for the Oldroyd-B fluid with Re = 5 (b)

5.3 Numerical simulation of jet buckling in 2D

As a second numerical example, the very well-known problem of jet buckling is considered. The jet buckling phenomenon can occur when a highly viscous fluid jet impacts a rigid surface. Due to the high viscosity, the jet can coil and fold instead of spreading along the rigid surface. This problem was first studied numerically with the FDM in [74]. The authors were able to provide a formula to establish whether a fluid jet would buckle after the impact depending on its aspect ratio and Reynolds number. Successively, the problem was also studied with FDM in [11,12,13, 75] and with the SPH in [23]. In this work, reference has been made to the benchmark proposed in [13].

The geometry of the problem is depicted in Fig. 15. The jet is generated by an inlet of opening \(L=0.004 \ \)m and positioned at \(H=0.075 \ \)m above a rigid plane. The jet velocity at the inlet is imposed equal to \(U=0.1\ \)m/s and remains constant during the whole simulation. Gravity is also acting downward with \(g=9.81 \ \mathrm{m/s}^2\).

Fig. 15
figure 15

Geometry and boundary conditions for the 2D jet buckling flow at a generic instant

Fig. 16
figure 16

Time evolution of the dimensionless jet length for the Newtonian and the Oldroyd-B fluids

Fig. 17
figure 17

Comparison of the shapes of the 2D jets for the Newtonian and Oldroyd-B fluids at dimensionless times t = 8, t = 8.8 and t = 13

Fig. 18
figure 18

Comparison of the shapes of the 2D jets for the Newtonian and Oldroyd-B fluids at dimensionless times t = 16, t = 18 and t = 21.3

Fig. 19
figure 19

Comparison of the shapes of the 3D jets for the Newtonian and Oldroyd-B fluids at dimensionless times t = 5.5, t = 8.0 and t = 11.5

Fig. 20
figure 20

Comparison of the shapes of the 3D jets for the Newtonian and Oldroyd-B fluids at dimensionless times t = 12.4, t = 15.1 and t = 17.3

The Newtonian fluid flow is completely characterized by the dimensionless Froude and Reynolds numbers, which here take values: Fr = 0.5 and Re = 0.01. Thus, the density is set to \(\rho = 1000 \ \mathrm{kg/m}^3\) and the Newtonian viscosity to \(\eta = 40\) Pa s. For the viscoelastic flow, it is also prescribed \(Wi = 20\) and the ratio between the solvent viscosity and the total equivalent viscosity \(\beta = 0.1\). Consistently to these data, the solvent viscosity is chosen to be \(\eta _s = 4\) Pa s, the polymer viscosity \(\eta _p = 36\) Pa s, and the shear modulus \(G = 45\) Pa. Furthermore, in the simulations, the speed of sound in the material has been fixed to 250 m/s and the initial mesh size to h = 0.0004 m. Since in this example there are no significant bouncing or contracting phenomena, there is no need to apply the alternative technique presented in Sect. 4.2 to deal with unilateral DBC.

During the analysis, it was monitored the jet length \(d^*\), computed as the distance between the inlet of the jet and the lowest portion of the fluid. The results are represented in a dimensionless form in Fig. 16, by defining the dimensionless time as \(t = t^*U/L\) and the dimensionless length as \(d = d^*/H\). The agreement with the data reported in [13] is very good thus further validating this implementation of the Oldroyd-B model in the PFEM framework.

In Figs. 17 and 18, the shapes of the jets at different dimensionless times are reported. These times have been selected to include the instants at which both the Newtonian and the Oldroyd-B fluids, respectively, touch the ground and start displaying the unstable behaviour. It can be observed that the Newtonian fluid takes more time to reach the base plane, producing a filament which remains thicker and therefore will buckle later. On the contrary, the viscoelastic jet stretches a lot and gets thinner while falling. After having touched the base plane it starts to widen at the base and the instability manifests much earlier than in the Newtonian case, causing the jet to fold over itself multiple times.

5.4 Numerical simulation of jet buckling in 3D

The test of the previous section is here extended to 3D, adopting the same material and properties described in detail for the bidimensional case. The Newtonian fluid flow is completely characterized by the dimensionless numbers Fr = 0.5 and Re = 0.01. The density is \(\rho = 1000 \ \mathrm{kg/m}^3\), and the Newtonian viscosity is \(\eta = 40\) Pa s. For the viscoelastic flow, it is also prescribed Wi = 20 and the ratio between the solvent viscosity and the total equivalent viscosity \(\beta = 0.1\). Consistently to these data, the solvent viscosity is set to \(\eta _s = 4\) Pa s, the polymer viscosity to \(\eta _p = 36\) Pa s and the shear modulus to G = 45 Pa. Furthermore, in the simulations, it has been chosen a speed of sound in the material of 250 m/s and an initial mesh size of \(h = 0.0006\) m.

In Figs. 19 and 20, the shape of the jet at different dimensionless times is reported. It appears evident by comparing these results with those obtained for the 2D case, that the 3D phenomenon is faster. Both the Newtonian and the viscoelastic jets take less time to reach the base plane and therefore also to buckle. The reason is linked to the fact that in three dimensions the jet is less constrained than in 2D, thus it can deform also in the third direction, accelerating the free fall and anticipating buckling. Moreover, as can be seen in Fig. 20, in 3D the buckling of the flow can lead to a proper coiling of the filament as the jet can freely rotate in all three dimensions. The relative behaviour of the Newtonian fluid with respect to that of the Oldroyd-B fluid instead remains similar to before, with the Newtonian jet taking more time to reach the base plane and to buckle.

6 Conclusion

Generally, fixed meshes Eulerian approaches or Lagrangian meshfree methods are employed in the field of viscoelastic media. This paper has proposed instead an innovative fully Lagrangian continuum FEM approach to simulate viscoelastic fluids obeying the Oldroyd-B constitutive equation. The adopted tool is the PFEM, which combines standard FEM technology with a remeshing algorithm to effortlessly treat large deformations of the domain and track the evolution of the free surface. Furthermore, it has been shown how to solve in this framework the additional equation accounting for the Oldroyd-B constitutive law. Special attention has been given to the techniques to transfer the internal variables (such as the viscoelastic non-Newtonian stress tensor) from the old mesh to the new one during a remeshing procedure. Moreover, an innovative way to deal with unilateral DBCs in PFEM, which minimizes mass variations and allows for easily capturing bouncing phenomena has been proposed. The model has been verify both in 2D and 3D on several well-known benchmarks for viscoelastic free-surface flows: the impacting drop and the jet buckling problems. The optimal agreement with the results available in the literature confirms how the PFEM could be used as a valuable tool for the simulation of viscoelastic flows in various applications, ranging from polymer manufacturing to biological fluids. Additionally, this work opens the way to further research regarding the implementation in the PFEM of more elaborate viscoelastic and viscoelasto-plastic constitutive laws.