1 Introduction

The cementation process of oil wells is one of the most important processes in the oil industry, and it is directly related to the well lifetime. It is responsible to avoid the collapse of the oil well, and also it has to protect the reservoir from the invasion of undesirable fluids and the casing from corrosion. The design and success of the cementation operation depend on several parameters such as the well geometry, the properties of drilling and spacing fluids, the preparation and properties of the cement slurry, the flow rate and the density ratio. A good displacement process of the drilling fluid by the cement slurry is a critical activity to guarantee the success of the cementing operation. The focus of this work is in the displacement process in situations of variable cross-sectional area, to simulate the cementing operation in eroded wells. The problem is analysed numerically to better understand the role of non-Newtonian fluids properties, flow rate and geometry in the efficiency of the cleaning and removal process of the drilling fluids by the cement. The multiphase flow is modelled using the volume of fluid method, and the solution of the governing conservation equations of mass and momentum is obtained using the finite volume method and the commercial software ANSYS Fluent ®.

Previous studies show that the displacement process through vertical wells are ruled primarily by the viscosity and density ratios of the fluids, the eccentricity of the annulus, and the flow rate (e.g. [1,2,3,4,5,6]). In addition, other variables such as the casing rotation and well geometry can influence the displacement efficiency ([4, 7, 8]). Deawwanich et al. [9] analysed experimentally the displacement of miscible viscoplastic fluids inside an annular space. The flow vizualization results show the effect of rheology on flow displacement. The annular eccentricity and the rotation of the inner cylinder also affect the flow displacement in a significant way, but the rotation of the cylinder results in a significant improvement of the displacement efficiency. The work of Savery et al. [10] shows that in the case of eccentric annular the displacement in the smaller gap tends to be very poor. Chin and Zhuang [11] present numerical solutions of displacement of yield stress fluids through eccentric annuli, considering drillpipe translation and rotation. A parametric analysis of plug cementing process in deepwater wells is presented by Aranha et al. [12], to understand the role of rheology, flow rate and string rotation in plug cementing operations. The authors observed that eccentricity leads to instabilities that impairs the displacement process. Dutra et al. [13] have performed a numerical simulation of the displacement process of three fluids, cement, spacer fluid and drilling fluid, through the annular space between the well and the casing. The results show that as the spacer viscosity increases, the displacement efficiency improves.

There are not many works available in the literature regarding the study of flow displacement of non-Newtonian fluids through ducts of variable cross-sectional area. The flow of Bingham fluids through a narrow channel with one locally uneven wall was analysed in [14]. The computational analysis neglects the inertial effects and focused on the viscous and yield stress effects. The results have shown that the flowing (yielded) region is independent of the geometry’s cavity for fluids with high yield stress and deep cavities. Later on, the authors presented results for the same problem, but with inertia [15]. The authors analysed the effect of Reynolds number keeping the Bingham number constant or keeping the product of Reynolds and Bingham numbers fixed (i.e. varying flow rate for fixed geometry and fluid properties). They observed that in this case the flowing region depends non-monotonically on Reynolds number, but again the yielded region seems to be independent of the geometry for deep cavities. A numerical and experimental study of the displacement of viscoplastic fluids through a tube with an expansion followed by a contraction was done in [16]. The authors analysed the effects of rheology and flow rate on the amount of the remaining fluid at the central tube, between the expansion and the contraction. The results show that as yield stress increases, the amount of remaining liquid at the central tube decreases, since stress levels increase. The effect of geometry and other rheological parameters, such as the power law index, are also discussed. It is observed that increasing the length of the central tube or decreasing the tube radius ratio, the amount of remaining liquid decreases. Dos Santos et al. [17] have performed a parametric numerical study of the flow of an elasto-viscoplastic fluid through a planar expansion followed by a contraction. The role of elasticity, yield stress and inertia on the shape of yielded/unyielded regions are analysed and discussed. The unyielded regions are the ones where the stresses levels are below the yield stress. The unyielded regions close to the walls of the larger cross section channel represent the amount of fluid that remains stagnant in this region. Roustaei and Frigaard [18] analysed numerically the formation of fouling layers in the slow flows of Bingham fluids through wavy-walled channels. The fouling shape is obtained for different geometries and rheology. The authors observed that the onset of fouling is a result of the effect of the geometry on the extensional stresses.

It is noted that there are few works on the literature analysing the flow displacement that occurs in the cementation process of eroded wells. Therefore, this work aims to contribute to understand the phenomena and discuss about the role of governing parameters as a means of improving the displacement efficiency.

2 Modelling

The geometry under analysis is shown in Fig. 1. At the beginning of the simulation, the geometry is filled with fluid 1, and fluid 2 enters the vertical annular duct with inner diameter \(D_\mathrm{i}\) and outer diameter \(D_\mathrm{o}\). Fluid 2 displaces fluid 1 through the entrance duct and the eroded region (outer diameter equal to D), and then flows into the exit annular duct, which has the same geometry as the entrance duct. The following hypothesis is considered: the flow is laminar, transient, and axisymmetric. Then, the simulation is bi-dimensional. The fluids are considered incompressible and immiscible (\(D_{ij}=0\)) and the surface tension was neglected. Initially, the vertical duct and the eroded area are filled with fluid 1. At the beginning of the simulation, \(t=0\), fluid 2 is injected at a constant velocity.

Fig. 1
figure 1

The geometry

The volume of fluid (VoF) method ([19, 20]) is used to model the multiphase flow. This method tracks the interface between two or more phases, calculating the volume fraction of each phase j, \(\alpha _j=\forall _j/\forall\) (\(j=1, 2 ..., n\)), where n is the number of phases, \(\forall _j\) is the volume occupied by phase j in the cell control volume \(\forall\). The volume fraction is obtained solving \(n-1\) mass conservation equations for each phase, plus a restriction equation:

$$\begin{aligned}&\frac{\partial }{\partial t}\alpha _j+\mathbf {v}\cdot \nabla \alpha _j=0 \end{aligned}$$
(1)
$$\begin{aligned}&\sum _{j=1}^n{\alpha _j}=1 \end{aligned}$$
(2)

where v is the velocity vector. In all simulations, only two phases are considered, so \(n=2\). The volume fraction is equal to one or zero when a control volume is entirely filled with one of the phases and is equal to a value between one and zero if the interface is in the control volume. The properties at each control volume are obtained by:

$$\begin{aligned} \phi =\alpha _1\phi _1+(1-\alpha _1)\phi _2 \end{aligned}$$
(3)

The velocity and pressure are equal for both phases, defined for each control volume. Therefore, the mass and momentum conservation equations are given by:

$$\begin{aligned}&\nabla \cdot \mathbf {v}=0 \end{aligned}$$
(4)
$$\begin{aligned}&\rho \left[ \frac{\partial \mathbf {v}}{\partial t}+\left( \mathbf {v}\cdot \nabla \right) \mathbf v \right] =-\nabla p+\nabla \cdot \varvec{\tau }+\rho \mathbf{g} \end{aligned}$$
(5)

where \(\rho\) is the mixture density, p is the pressure, g is the gravity vector, and \(\varvec{\tau }\) is the deviatoric stress tensor. The Generalized Newtonian Fluid constitutive equation is used to model the non-Newtonian fluid behaviour; then, the stress tensor is given by:

$$\begin{aligned} \varvec{\tau }=2\eta (\dot{\gamma })\mathbf{D} \end{aligned}$$
(6)

where \(\mathbf{D}\equiv 1/2\left[ \nabla {\mathbf {v}}+\nabla {\mathbf {v}}^{T}\right]\) is the rate-of-strain tensor, and \(\dot{\gamma }\equiv \sqrt{{2}\hbox { tr } \mathbf{D}^{2}}\) is the intensity of the rate-of-strain tensor. The viscosity function is given by a regularized version of the Herschel–Bulkley equation for viscoplastic fluids, given by the following equation:

$$\begin{aligned} \eta (\dot{\gamma })= & {} {\tau _\mathrm{y}\over \dot{\gamma }}+k\left( {\dot{\gamma }}\right) ^{n-1}\qquad \mathrm{if} \qquad \dot{\gamma }\ge \dot{\gamma }_{\mathrm{cr}}\nonumber \\ \eta (\dot{\gamma })= & {} {\tau _\mathrm{y}\over \dot{\gamma }_{\mathrm{cr}}}\left[ {2-{\dot{\gamma }\over \dot{\gamma }_{\mathrm{cr}}}}\right] +k\gamma _{\mathrm{cr}}^{n-1}\left[ (2-n)+(n-1){\dot{\gamma }\over \dot{\gamma }_{\mathrm{cr}}}\right] \qquad \mathrm{if} \qquad \dot{\gamma }< \dot{\gamma }_{\mathrm{cr}} \end{aligned}$$
(7)

In the equations above, \(\tau _{\mathrm{y}}\) is the yield stress, k is the consistency index, \(\dot{\gamma }_{\mathrm{cr}}\) is the critical rate-of-strain modulus, and n is the power law index.

The initial and boundary conditions are:

  • At \(t=0\), the domain is filled with fluid 1, so \(\alpha _1=1\) and \(\alpha _2=0\); and the velocity is zero, \(\mathbf {v}= 0\).

  • At the entrance, \(x=0\), fluid 2 is injected with constant axial velocity, \(\alpha _2=1\) and \(v_x=v_{\mathrm{in}}\).

  • At the outlet, \(x=L_\mathrm{t}\), the flow is considered fully developed, \(\partial /\partial x=0\).

  • At the walls, \(r=D/2;\ D_\mathrm{{i,o}}/2\), no slip and impermeability conditions are applied, \(\mathbf {v}=0\).

2.1 Dimensionless equations

The governing equations are scaled using the following dimensionless variables:

$$\begin{aligned} r^*={r\over D_\mathrm{h}}\qquad x^*={x\over D_\mathrm{h}} \qquad \mathbf {v}^*={\mathbf {v}\over D_\mathrm{h}\dot{\gamma }_\mathrm{c}} \qquad p^*={p\over \rho _1v_\mathrm{c}^2} \nonumber \\ t^*={t \ \dot{\gamma }_\mathrm{c}}\qquad \rho ^*={\rho \over \rho _2}\qquad \varvec{\tau }^*={\varvec{\tau }\over \tau _\mathrm{y}}\qquad \dot{\gamma }^*={\dot{\gamma }\over \dot{\gamma }_\mathrm{c}} \qquad \eta ^*={\eta \over \eta _\mathrm{c}} \end{aligned}$$
(8)

where the characteristic velocity is equal to the inlet velocity of fluid 2, \(v_\mathrm{c}=v_{\mathrm{in}}\), the characteristic shear rate is \(\dot{\gamma }_\mathrm{c}=8(v_{\mathrm{in}}/D_\mathrm{h})(3n+1)/4n\), \(D_\mathrm{h}=D_\mathrm{o}-D_\mathrm{i}\) is the hydraulic diameter of the annular duct, and the characteristic viscosity is the viscosity of fluid 2 evaluated at \(\dot{\gamma }_\mathrm{c}\), \(\eta _\mathrm{c}=\eta _2(\dot{\gamma }_\mathrm{c})\). It is clear that, if fluid 2 is Newtonian, \(\eta _\mathrm{c}=\mu\), otherwise it is given by eq. 7. The resulting non-dimensional equations are given by:

$$\begin{aligned}&\nabla \cdot \mathbf {v}^*=0 \end{aligned}$$
(9)
$$\begin{aligned}&\rho ^*\left[ \frac{\partial \mathbf {v}^*}{\partial t^*}+\left( \mathbf {v}^*\cdot \nabla ^*\right) \mathbf{v} ^*\right] =-\nabla ^* p^*+{1\over Re}\nabla \cdot \left( \eta ^* \dot{\gamma }^{*}\right) \end{aligned}$$
(10)

The non-dimensional governing parameters are depicted below:

$$\begin{aligned} Re\equiv {\rho _2 v_\mathrm{c} D_\mathrm{h}\over \eta _\mathrm{c}}\qquad \rho _r={\rho _2\over \rho _1}\qquad \eta _\mathrm{r}={\eta _2\over \eta _1} \end{aligned}$$
(11)

where \(\rho _i\), \(i=1,2\) are the densities of fluids 1 and 2, \(\eta _i\), \(i=1,2\) are the viscosities of fluids 1 and 2, and Re is the Reynolds number. Moreover, the non-dimensional geometric parameters are given by the aspect ratio of the eroded region, L / D, and the diameter ratios, \(D/D_\mathrm{i}\) and \(D_\mathrm{i}/D_\mathrm{o}\), where L is the length of the eroded region, D is the outer tube diameter in the eroded region, \(D_\mathrm{o}\) is the outer diameter of the well, and \(D_\mathrm{i}\) is the inner tube diameter.

3 Numerical solution

The governing conservation equations of mass and momentum are solved using the finite volume method, with Fluent ® software (Ansys Inc.). To model the multiphase flow, we use the volume of fluid method. The pressure-based solver is used for the transient axisymmetric model, and the PISO algorithm is employed for the pressure–velocity coupling. The mass conservation equation is discretized with the power law method, and the upwind discretization method is used to solve the momentum equation [19].

The structured meshes used in the numerical solution were generated in ICEM CFD ® software (Ansys Inc.). Mesh tests were performed for the geometry with \(L/D=0.5\). Four different meshes were analysed and the results for a typical case were compared. The meshes are detailed in Table 1, where \(\Delta x\) and \(\Delta r\) are the minimum cell size in axial and radial directions, respectively. The meshes were tested for a laminar flow of a Newtonian fluid. Figure 2 shows the velocity profile at the centre of the eroded region for the four different meshes. The friction factor in the developed flow region of the exit tube and its error with respect to the exact value of 95.15 are shown in Table 1. The friction factor is defined as \(f=(\Delta p/L_\mathrm{d}) 2 D_\mathrm{h} / (\rho U^2)\), where \(\Delta p/L_\mathrm{d}\) is the pressure drop in the developed region. Based on these results, mesh 3 was the mesh chosen for the case of \(L/D=0.5\). The other two geometries analysed are equal to this one, except for the length of the eroded region. Therefore, the meshes used were proportionally increased in the axial direction of the eroded region, so that the element sizes are similar. The mesh used for \(L/D=1\) has 29,250 elements, and for \(L/D=1.5\), 34,750 elements.

Fig. 2
figure 2

Axial velocity profile at \(x^*=L_\mathrm{t}/(2D)\), for meshes 1 (11,546 elements), 2 (15,860 elements), 3 (23,755 elements), and 4 (33,402 elements)

Table 1 Meshes detail and friction factor

4 Results and discussion

The effects of geometry, yield stress, and Reynolds number on the fluids displacement through the eroded region of a model oil well are evaluated for three different combinations of fluids:

  • Case 1 Viscoplastic fluid displacing a Newtonian one.

  • Case 2 Newtonian fluid displacing a viscoplastic one.

  • Case 3 Viscoplastic fluid displacing an other viscoplastic fluid.

For all three geometries analysed, the following quantities are kept constants, according to Fig. 1: entrance and exit tube length \(L_\mathrm{a}=0.110\) m; inner and outer diameters of the entrance and exit tubes, \(D_\mathrm{i}=0.016\) m and \(D_\mathrm{o}=0.024\) m, respectively; diameter of the eroded region, \(D=0.032\) m. The dimensionless geometric parameters are: \(D_\mathrm{o}/D_\mathrm{i}=1.5\), and \(D/D_\mathrm{i}=2\). In addition, the length of the eroded region for the three geometries is equal to 0.016 m (\(L/D=0.5\)), 0.032 m (\(L/D=1\)), and 0.048 m (\(L/D=1.5\)), and the Reynolds number ranges from 0.001 to 50. The properties of the fluids used in the simulations are given in Table 2. In the simulations, the transient process begins with the tube full of the displaced fluid (fluid 1). Then, fluid 2 (displacing fluid) is injected at constant velocity during a certain time, \(t_i\), when the injected volume equals the tube volume. All the results shown below are obtained at this time, except for Fig. 7, that shows the time evolution of the volume fraction for a particular case.

Table 2 Fluids properties

The viscoplastic fluids are modelled by the modified Herschel–Bulkley equation (eq. (7)). The values used for the rheological parameters of fluids V1 and V2 are based on the properties of typical drilling fluids, while the properties used for fluid V3 are based on characteristic values for cement slurries. The rheological parameters are given by:

  • Fluids V1 \(k=0.557\) Pa.s\(^n\), \(n=0.446\), and \(\tau _\mathrm{y}=0.30, 0.91\) and 2.0 Pa.

  • Fluids V2 \(k=1.062\) Pa.s\(^n\), \(n=0.605\), and \(\tau _\mathrm{y}=0.4\) and 0.8 Pa.

  • Fluids V3 \(k=0.365\) Pa.s\(^n\), \(n=0.657\), and \(\tau _\mathrm{y}=12\) and 24 Pa.

The regularization parameter used, namely the critical shear rate \(\dot{\gamma }_{\mathrm{cr}}\), is always equal to \(\dot{\gamma }_\mathrm{c}\times 10^{-3}\), where \(\dot{\gamma }_\mathrm{c}=8(v_{\mathrm{in}}/D_\mathrm{h})(3n+1)/4n\) is the characteristic shear rate. This value was chosen based on tests performed in the flow through a tube, and on discussions in the literature, regarding the range of the regularization parameters of similar regularized versions of the Herschel–Bulkely equation (e.g. [21,22,23,24,25]).

The viscosity ratio is defined as the ratio of the viscosity of fluid 2 by the viscosity of fluid 1, \(\eta _\mathrm{r}=\eta _2/\eta _1\). When the fluid is non-Newtonian, we use a characteristic viscosity, obtained at the characteristic shear rate \(\dot{\gamma }_\mathrm{c}\).

The displacement efficiency at the eroded region is obtained by:

$$\begin{aligned} \beta ={A_2\over A_\mathrm{c}} \end{aligned}$$
(12)

where \(A_2\) is the area occupied by fluid 2 in the eroded region, and \(A_\mathrm{c}\) is the total area of the eroded region, \(A_\mathrm{c}=(D-D_\mathrm{i})L\). Another important parameter to evaluate the displacement process is the symmetry factor \(\alpha\) that quantifies the fore-aft symmetry of the flow inside the eroded region, defined as:

$$\begin{aligned} \alpha ={2A_{\mathrm{r}2}-A_2\over A_\mathrm{c}} \end{aligned}$$
(13)

In the equation above, \(A_{\mathrm{r}2}\) is the area occupied by fluid 2 in the half downstream zone of the eroded region. Therefore, the flow is fore-aft symmetric if \(\alpha =0\), if \(\alpha >0\) there is a larger amount of fluid 2 in the half zone close to the exit of the eroded region, and if \(\alpha <0\) fluid 2 concentrates at the half zone near the entrance of the eroded region.

4.1 Viscoplastic fluid displacing Newtonian fluid

This section presents the results of the viscoplastic fluids V1 (fluid 2) displacing the Newtonian fluid N1 (fluid 1). The density ratio is equal to \(\rho _r=1.002\). Figures 3 and 4 show the volume fraction field and the streamlines for \(L/D=0.5\), \(\tau _\mathrm{y}=0.3\) and 2, and \(Re=0.001\), 1, and 50. In all volume fraction contour plots, fluid 2 is represented by dark grey colour and fluid 1 by light grey. The streamlines are coloured by the velocity magnitude of the flow, from blue (low values of velocity) to red (high values of velocity). However, the velocity scale is different for each case, since the Reynolds numbers vary. The viscosity ratio in this case is equal to \(\eta _\mathrm{r}=\eta _2/\mu\), where \(\mu\) is the viscosity of the Newtonian fluid N1, and \(\eta _2\) is the characteristic viscosity of the viscoplastic fluids V1. The viscosity ratio varies with the Reynolds number and the yield stress, and their values for these cases go from 4347.8 to 31.4. Increasing the Reynolds number, the characteristic shear rate increases, and therefore, the viscoplastic viscosity and the viscosity ratio decrease. On the other side, as yield stress increases, the viscoplastic viscosity and the viscosity ratio increase. In all cases analysed, the viscosity ratio is much larger than unity, which leads to a flatter interface shape during the displacement (not shown). For low Reynolds numbers, it can be observed that the displaced volume of fluid 1 (Newtonian) inside the cavity in the eroded region is negligible. The displacing fluid is not able to enter the eroded region due to the low stress levels (below yield stress). It is also noted a small amount of the displacing fluid that is retained at the exit wall of the cavity. This fluid gets there when it reaches the cavity, and doesn’t move from there because the stress levels are below the yield stress. It is noted that the larger viscosity ratio case (\(Re=0.001, \eta _\mathrm{r}=2222.2\)) has the larger amount of fluid retained. For \(\tau _\mathrm{y}=0.3\), as Re increases to 1 fluid 2 begins to enter the cavity, displacing fluid 1, because the stress level increases to values larger than the yield stress. However, for larger \(\tau _\mathrm{y}\) (Fig. 4), the stress level in the cavity is still below yield stress, and the results are similar to that with \(Re=0.001\). When the Reynolds number increases further (\(Re=50\)), the stress levels increase, but the displacement through the cavity is worse because inertia makes fluid 2 passes through it, without entering. It is also noted that inertia breaks the fore-aft symmetry due to flow advection towards the cavity exit wall. This result is in agreement with the results obtained by [17] and [26] for the flow of one fluid through a expansion followed by a contraction, where it is observed that inertia tends to displace the yield surface to the side of the contraction (exit) wall of the cavity. It is also interesting to note that the Newtonian fluid that remains inside the cavity recirculates inside it, while the viscoplastic fluid close to the cavity exit wall remains stagnant.

Fig. 3
figure 3

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for viscoplastic fluid V1 (dark grey), \(\tau _\mathrm{y}=0.3\) Pa, displacing Newtonian fluid (light grey) for \(L/D=0.5\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=2222.2\), b, e \(Re=1\), \(\eta _\mathrm{r}=134.2\), c, f \(Re=50\), \(\eta _\mathrm{r}=31.4\)

Fig. 4
figure 4

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for viscoplastic fluid V1 (dark grey), \(\tau _\mathrm{y}=2\) Pa, displacing Newtonian fluid (light grey) for \(L/D=0.5\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=4347.8\), b, e \(Re=1\), \(\eta _\mathrm{r}=184.2\), c, f \(Re=50\), \(\eta _\mathrm{r}=36.3\)

Figures 5 and  6 show the results for \(L/D=1.5\), for the same cases as above. It can be noted that for the negligible and low inertia cases (\(Re<1\)) fluid 2 fills almost all the eroded region, meaning that the displacement process is very good. When inertia increases, the displacing fluid is advected throughout the exit cavity wall, resulting in a less efficient displacement process. For the case with low yield stress (\(\tau _\mathrm{y}=0.3\)) the displacement process is much worse and unstable, probably due to lower values of the viscosity ratio. Figure 7 shows the displacement process for this particular case, where it can be observed that fluid 2 forms a jet that travels in the direction of the cavity exit wall due to inertia. When fluid 2 reaches the wall, it spreads all over the cavity, and is not able to remove a large quantity of fluid 1.

Fig. 5
figure 5

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for viscoplastic fluid V1 (dark grey), \(\tau _\mathrm{y}=0.3\) Pa, displacing Newtonian fluid (light grey) for \(L/D=1.5\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=2222.2\), b, e \(Re=1\), \(\eta _\mathrm{r}=134.2\), c, f \(Re=50\), \(\eta _\mathrm{r}*=31.4\)

Fig. 6
figure 6

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for viscoplastic fluid V1 (dark grey), \(\tau _\mathrm{y}=2\) Pa, displacing Newtonian fluid (light grey) for \(L/D=1.5\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=4347.8\), b, e \(Re=1\), \(\eta _\mathrm{r}=184.2\), c, f \(Re=50\), \(\eta _\mathrm{r}=36.3\)

Fig. 7
figure 7

Volume fraction evolution with time for viscoplastic fluid V1 (dark grey), \(\tau _\mathrm{y}=0.3\) Pa, displacing Newtonian fluid (light grey) for \(L/D=1.5\): a \(t=0.25\) s, b \(t=0.75\) s, c \(t=1.25\) s and d \(t=1.50\) s

The results of the displacement efficiency in the eroded region are shown in Fig. 8. It is noted that the efficiency is much higher when the aspect ratio of the eroded region (L / D) is larger. As it was observed in the volume fraction field analysis, the flow dynamics is a competition between yield stress, viscous and inertia effects. In all situations, it is observed that for higher Re, when inertia becomes important, the displacing fluid is advected throughout the tube without entering the eroded region, lowering the efficiency displacement. For low Reynolds numbers, inertia is negligible, and yield stress effects dominate. For low L / D the efficiency is nearly constant with Re variation and is small because the viscoplastic displacing fluid can’t enter the cavity due to the low stress levels. As L / D increases, the displacing fluid begins to enter the eroded region, pushing the Newtonian fluid and “cleaning” the eroded region. However, the results are non-monotonic. The larger L / D presents an efficiency almost equal to 1 when Re is negligible, decays very fast as Re increases to 0.01, and increases again until inertia begins to control the flow. For \(L/D=1\) and low Re, the efficiency increases until intermediate Reynolds numbers and decreases as Re increases further, due to inertia. We can see also that yield stress seems to be important only for low Re and \(L/D=1\) and 1.5, but it doesn’t affect the process for \(L/D=0.5\).

Another important result that can be evaluated in the process is the distribution of the remaining displaced fluid inside the eroded region. This can be done through the analysis of the symmetry factor defined in eq. (13), which is depicted in Fig. 9. It is worth recalling that the flow is fore-aft symmetric if \(\alpha =0\), if \(\alpha >0\) the displacing fluid concentration is higher close to the cavity exit, and if \(\alpha <0\) fluid 2 concentration is higher close to the cavity entrance. It can be seen that the flow is symmetric, with very small deviations for the shortest cavity. In the higher aspect ratios no tendency can be noted for low Re, but as Re increases, \(\alpha\) slightly increases, and the displacing fluid tends to flow to the right side of the eroded region due to inertia effects.

Fig. 8
figure 8

Displacement efficiency as a function of the Reynolds number for the viscoplastic fluid V2 displacing the Newtonian fluid V2 for \(L/D=0.5, 1.0, 1.5\), and \(\tau _\mathrm{y}=0.3, 1.5, 2.0\) Pa

Fig. 9
figure 9

Symmetry factor as a function of the Reynolds number for the viscoplastic fluid V2 displacing the Newtonian fluid for \(L/D=0.5, 1.0, 1.5\), and \(\tau _\mathrm{y}=0.3, 1.5, 2.0\) Pa

4.2 Newtonian fluid displacing viscoplastic fluid

Figure  10 presents the results for the Newtonian fluid N2 displacing the viscoplastic fluids V1, for \(\rho _r=1.26\), and viscosity ratio \(\eta _\mathrm{r}=\mu /\eta _1\), where \(\mu\) is the viscosity of the Newtonian fluid (fluid 2), and \(\eta _1\) is the characteristic viscosity of the viscoplastic fluid (fluid 1). In this case, the viscosity ratio increases when Reynolds number increases, and decreases when yield stress increases. As in the previous cases, some amount of fluid 1 remains inside the cavity. The difference to the previous cases is that fluid 1 remains unyielded because the stress levels are below the yield stress. The viscoplastic fluid only recirculates in the high inertia case (\(Re=25\)), because the stress levels inside the cavity are higher. For the intermediate Re and viscosity ratios of order 1 the displacement is better, and only a small amount of fluid 1 remains in the cavity. Increasing inertia, we see again that the displacement and the fore-aft symmetry get worse, due to fluid advection that pushes the displacing fluid to the exit wall of the eroded region, generating a recirculating flow of the displaced fluid inside the cavity.

Fig. 10
figure 10

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for Newtonian fluid (dark grey) displacing viscoplastic fluid V1 (light grey), \(\tau _\mathrm{y}=2\) Pa, for \(L/D=0.5\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=0.04\), b, e \(Re=0.1\), \(\eta _\mathrm{r}=2.32\), c, f \(Re=25\), \(\eta _\mathrm{r}=100.72\)

Increasing the cavity aspect ratio to \(L/D=1.5\), we again see a better displacement than for lower aspect ratio. Figure 11 shows that the displacing Newtonian fluid almost fills the entire cavity, and only a small volume of the displaced fluid remains close to the corners. We can observe that for negligible and low inertia, the displacement is better close to the entrance of the cavity. As Re increases, the advection increases and deforms the interface to the right (exit) side of the cavity. In addition, the fluid that remains trapped begins to recirculate, due to higher levels of stress, which surpass the yield stress.

Fig. 11
figure 11

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for Newtonian fluid (dark grey) displacing viscoplastic fluid V1 (light grey), \(\tau _\mathrm{y}=2\) Pa, for \(L/D=1.5\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=0.04\), b, e \(Re=0.1\), \(\eta _\mathrm{r}=2.32\), c, f \(Re=25\), \(\eta _\mathrm{r}=100.72\)

The displacement efficiency is presented in Fig. 12. Again it is clear that efficiency increases with L / D. When inertia is negligible, the efficiency increases with Re and decreases with yield stress, because it is directly related to the region where the flow stress level is able to surpass the yield stress. When inertia becomes important, flow advection leads to lower displacement efficiency. The symmetry factor is shown in Fig. 13. It can be seen that the flow is symmetric, with very small deviations, for the shortest cavity. As aspect ratio increases, it monotonically increases with Re, going from negative values, where yield stress dominates the flow, and the amount of displaced fluid is higher close to the cavity exit, to positive ones (inertia dominated flows) where the displacement is less efficient close to the entrance of the eroded region.

Fig. 12
figure 12

Displacement efficiency as a function of the Reynolds number for the Newtonian fluid displacing the viscoplastic fluid V2 for \(L/D=0.5, 1.0, 1.5\), and \(\tau _\mathrm{y}=0.3, 1.5, 2.0\) Pa

Fig. 13
figure 13

Symmetry factor as a function of the Reynolds number for the Newtonian fluid displacing the viscoplastic fluid V2 for \(L/D=0.5, 1.0, 1.5\), and \(\tau _\mathrm{y}=0.3, 1.5, 2.0\) Pa

4.3 Viscoplastic fluid V3 displacing viscoplastic fluid V2

Figure 14 presents the results for the viscoplastic fluid V3 displacing the viscoplastic fluid V2, for \(\tau _\mathrm{y}^*=\tau _{y2}/\tau _{y1}=60\), and the density ratio \(\rho _r=1.57\). The viscosity ratio is \(\eta _\mathrm{r}=\eta _2/\eta _1\), where \(\eta _1\) is the characteristic viscosity of the displaced fluid 1, and \(\eta _2\) is the characteristic viscosity of the displacing fluid 2, both calculated at the characteristic shear rate, \(\dot{\gamma }_\mathrm{c}=(8v_{\mathrm{in}}/D_\mathrm{h})(3n+1)/4n\). As in the previous cases, it can be observed that for \(L/D=0.5\) and negligible inertia, only a small amount of the displacing fluid 2 enters the eroded region, and a small amount of it remains stagnant at the exit wall. The stress levels generated are sufficient to surpass the yield stress of fluid 1, so despite the fact that it remains trapped in the cavity, it recirculates there. As Re increases, but inertia is still low, a large amount of fluid 1 is displaced due to the increase of the stress levels that allows fluid 2 flows more into the cavity, and the interface shape is shifted to the left. Increasing inertia leads the interface to shift to the right due to fluid advection, and the displacement process inside the cavity becomes worse.

Fig. 14
figure 14

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for viscoplastic fluid V3 (dark grey) displacing viscoplastic fluid V2 (light grey) for \(L/D=0.5\), \(\tau _\mathrm{y}^*=60\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=29.30\), b, e \(Re=0.1\), \(\eta _\mathrm{r}=11.46\), c, f \(Re=50\), \(\eta _\mathrm{r}=3.11\)

The results for \(L/D=1.5\) are presented in Fig. 15. It can be observed that they show similar behaviour of the others pairs of fluids, with better displacement processes. For negligible and low inertia, the interface between fluids is shifted to the left, but when inertia becomes important advection shifts the interface to the right and the displacement process gets slightly worse.

Fig. 15
figure 15

Volume fraction (left) and streamlines (right, coloured by the velocity magnitude) for viscoplastic fluid V3 (dark grey) displacing viscoplastic fluid V2 (light grey) for \(L/D=1.5\), \(\tau _\mathrm{y}^*=60\): a, d \(Re=0.001\), \(\eta _\mathrm{r}=29.30\), b, e \(Re=0.1\), \(\eta _\mathrm{r}=11.46\), c, f \(Re=50\), \(\eta _\mathrm{r}=3.11\)

The displacement efficiency is shown in Fig. 16. We can see again that the highest efficiency is obtained for the highest L / D. Since the efficiency is closer to unity for these cases, we can observe only a mild variation of their values for low Re. However, for the lower L / D we can see a large increase in the efficiency due to the increase in the stress levels at this range of Re. As inertia increases, we see again the decrease of the displacement efficiency in all cases.

Figure 17 shows the symmetry factor. In this case, the shortest cavity has the largest fore-aft deviations from symmetry. For higher Re the symmetry factor increases, tending to positive values due to inertia effects, following the same trend of the others pairs of fluids.

Fig. 16
figure 16

Displacement efficiency as a function of the Reynolds number for the viscoplastic fluid V3 displacing the viscoplastic fluid V2 for \(L/D=0.5, 1.0, 1.5\), and \(\tau ^*_\mathrm{y}=15, 20, 30, 60\) Pa

Fig. 17
figure 17

Symmetry factor as a function of the Reynolds number for the viscoplastic fluid V3 displacing the viscoplastic fluid V2 for \(L/D=0.5, 1.0, 1.5\), and \(\tau ^*_\mathrm{y}=15, 20, 30, 60\) Pa

5 Final remarks

In this work, we analyse the displacement process of pairs of fluids through an annular duct with a cavity. This problem is found in the oil industry during cementing operations in oil wells with eroded regions. The governing conservation equations of mass and momentum are solved numerically using the finite volume method, while the volume of fluid method is used to model the multiphase problem. The volume fraction field and flow streamlines are presented for three pairs of fluids, that are representative for the real case scenarios, where the cement paste displaces a spacer fluid (Newtonian or non-Newtonian) that displaces the drilling fluid: a viscoplastic fluid displacing a Newtonian one, a Newtonian fluid displacing a viscoplastic one, and two viscoplastic fluids. We also present the displacement efficiency and the symmetry factor, which quantify the ratio of the amount of fluid left on each side of the eroded region. Flow displacement is a function of the geometry, ratio of fluids viscosities and densities, and yield stress. It is shown that the displacement process is better for larger aspect ratios of the eroded region. At low Reynolds numbers, the process is governed by viscous effects, while inertia dominates when Re increases, shifting the interface towards the exit of the eroded region and decreasing the displacement efficiency. The results obtained can help to define better conditions during completing operations in oil wells. However, some care must be taken regarding the assumptions made in the present work, such as to consider that the fluids are imiscible and that the flow is axisymmetric (e.g. when there is eccentricity, this hypothesis is not valid and the flow is 3D). The next steps of this work would be to analyse new geometries for the eroded region, the influence of tube inclination (non-vertical tubes), and to compare the results obtained with experimental ones from an experimental loop that is being developed.