Rheological Compatibility of a Hardening Spacer Fluid and Oil-Based Drilling Fluid

Summary In the placement process of the cement slurry, treatment fluids such as the spacer are pumped ahead of the cementitious slurry to minimize the contamination of the slurry by drilling fluid and ensure superior bonding to the casing and formation. The spacer discussed in this work can harden with time and act as a settable spacer. This characteristic can be an advantage for well integrity if some spacer pockets are left in the annulus. Rheological compatibility of different mixtures of the spacer with oil-based drilling fluid (OBDF) has been studied using a rheometer, and the resulting R - factor, which indicates the degree of compatibility between fluids, has been calculated. An increase in the flow curve was observed for the mixture of the fluids. However, based on the R - index, these fluids are compatible with displacement in the wellbore. A nonionic surfactant, typically used in conventional spacers acting as an emulsifier and a water-wetting agent, was used in the hardening spacer design. The results show that the addition of OBDF to hardening spacer containing surfactant can increase viscoelasticity. Hardening spacer containing surfactant can successfully reverse the OBDF emulsion. By performing a small-scale mud displacement experiment, we observed that surfactant can improve the wall cleaning efficiency of the spacer while having minimal impact on the bulk displacement.


Introduction
According to the study performed by Davies et al. (2014), a significant number of studied oil and gas wells worldwide experience well integrity issues.The study found that, depending on the data set being investigated, 1.9-75% of the wells were found to have such problems.Signs of inadequate zonal isolation include hydrocarbon migration and subsequent sustained casing pressure.Failing to properly remove mud and spacer from the annulus can endanger the establishment of zonal isolation with cement.Soares et al. (2017) showed that, in the event of mixing the cement with OBDF, the cement slurry thickens, even though the wetting agent used in OBDF plays a positive role in decreasing the plastic viscosity.The wetting agent alters the wettability of cement slurry particles from water-wet to oil-wet, causing retardation in the hydration process.OBDF contamination also changes the microstructure of cured Class G cement by increasing the porosity and permeability of samples (Li et al. 2016).The bond strength of cement to formation and casing is dramatically decreased when there is a film of drilling fluid on the formation and pipe surfaces (Opedal et al. 2014;Oyibo and Radonjic 2014;Santos et al. 2019;Carter and Evans 1964).
Geopolymers are a class of cementitious materials that are being developed for use in primary cementing and plug and well abandonment, with the goal of aligning with carbon reduction strategies.Although still in the developmental stage, it is expected to become an increasingly important material in the future due to its chemical and physical properties.This inorganic polymer is formed by adding the alkaline solution to a solid precursor that has a variety of aluminosilicate sources such as metakaolin, fly ash, red mud, and naturally occurring rocks (Yousefi Oderji et al. 2023).The contamination of geopolymers with drilling fluid has also been studied.According to Eid et al. (2021), water-based drilling fluid has the ability to deteriorate the compressive strength of rock-based geopolymer due to geopolymerization reaction in which water remains in the system, which differs from the hydration of cement.Water-based drilling fluid has a dilution effect and increases flowability.OBDF slightly increases the yield stress of geopolymer upon mixing at elevated temperatures (Khalili et al. 2022).A study with Class F fly ash geopolymer shows that 20% OBDF contamination can reduce the compressive strength of the material to half the initial value after 1 day of curing (Liu et al. 2019).Although the bonding of geopolymer to casing is discussed by Gomado et al. (2023), there is a gap in knowledge regarding the impact of drilling fluid on bonding.The mix design of the geopolymer is a determinant of how severe this contamination will be.
These above-mentioned results highlight the importance of efficient fluid displacement in the wellbore, which finally results in a well barrier that is capable of providing long-lasting well integrity.Important factors for proper mud removal are reducing the eccentricity of the casing inside the wellbore, characterization of fluids inside the well, and optimizing the flow rate.Using preflushes assists mud displacement and minimizes the contamination of cementitious material by drilling fluid.A spacer fluid is a type of preflush pumped ahead of cement slurry with several criteria in design such as friction pressure, density hierarchy, and rheological compatibility with drilling fluids to aid fluid displacement.Selecting a proper surfactant package as part of the spacer design is crucial because it determines the ability of fluid to erode the mudcake, to water-wet the casing and formation, and finally to invert the OBDF emulsion upon contact (Gordon et al. 2008;Nelson and Guillot 2006).Several types of spacers have been investigated in the literature.Brice and Holmes (1964) deployed a lightweight cement slurry, commonly known as scavenger, to displace the mud in turbulent flow.However, this type of slurry is not compatible with drilling fluid, and sedimentation might happen (Nelson and Guillot 2006).Carney (1974) introduced inverted emulsion as a spacer in the wellbore.Micro-and nanoemulsion spacer fluids recently enticed researchers to study them due to their ability to solubilize the oil phase in the OBDF, removing the filter cake, and altering the wettability (Curbelo et al. 2018;Wanderley Neto et al. 2020;da Silva et al. 2020;Maserati et al. 2010;Pietrangeli et al. 2015).Nevertheless, there are drawbacks associated with this type of spacer such as high cost of preparation and concerns associated with environmental impacts.There have also been efforts to turn drilling fluids into hardening material.Cowan et al. (1992) proposed adding blast furnace slag (BFS) to WBDF to convert it to cementitious material.They concluded that conversion could improve zonal isolation with minimal effect on the properties of drilling fluid.Technical and economic aspects of mud conversion using BFS and ordinary Portland cement were evaluated by Schlemmer et al. (1994).It was concluded that the economic viability of converting mud to cement depends largely on the costs associated with disposing of used drilling mud.The application of BFS as a drilling fluid solidifier in the North Sea was discussed by Saasen et al. (1994).According to them, because of logistical difficulties, BFS is more likely to be used as an additive to the drilling fluid serving as an effective means of ensuring that the filter cake solidifies.The possibility of converting the OBDF to cement using alkali-activated fly ash was assessed by Liu et al. (2019) and it was observed that the mixture can develop notable strength.
Previous studies have examined the impact of multiple factors on drilling fluid displacement and cement placement through a combination of experimental and numerical simulation approaches.These factors include flow rate, viscosity, buoyancy, and geometric considerations.The influence of rheological properties of both the displacing and displaced fluids has been investigated in several studies (Nguyen et al. 1992;Allouche et al. 2000;Tehrani et al. 1992;Taghavi et al. 2009).The well-known study of Brice and Holmes (1964) evaluated the cement quality of 26 wells and claimed that turbulent flow improved the displacement [confirmed by the experimental work in Jakobsen et al. (1991)].Maleki and Frigaard (2019) expressed that the degree of eccentricity and density difference between fluids are two major factors in having an efficient displacement in the annulus and a single statement cannot be made about the superiority of a particular flow regime.In addition, there have been investigations into the impact of density differences between the displacing and displaced fluids (Lockyear et al. 1990;Bu et al. 2016).Fluid displacement in the horizontal annulus (Sarmadi et al. 2021;Carrasco-Teja et al. 2008) and displacement involving a casing rotation (Carrasco-Teja andFrigaard 2009, 2010) have also been studied.However, the specific impact of surfactant in spacer design on drilling fluid displacement remains unclear and requires further investigation.
In this work, we used the geopolymerization concept to formulate a treatment fluid with low density and flexible viscosity profile that has the ability to set, leading to solidified spacer pockets that might be left in the annulus and thus contribute to zonal isolation.Additionally, the lower density of slurry yields lower hydrostatic pressure which in turn causes safer mud displacement in weak and depleted formations.The rheological compatibility of OBDF and the designed hardening spacer is evaluated.Moreover, the impact of including a nonionic surfactant in the design of the hardening spacer on rheological compatibility and displacement is also discussed.

Experimental Procedures
Materials.Table 1 shows the mix design of the spacer including the order and duration of mixing.Bentonite is used as a viscosifier and extender.Xanthan gum is used to adjust the viscosity of the spacer slurry and to maintain viscosity hierarchy with drilling fluid, meaning that the viscosity of the spacer is higher than the studied OBDF, which might lower the chance of intermixing of fluids in displacement in deviated wellbores.Granite and ground granulated blast-furnace slag (GGBFS) is used as precursor.The concentration of GGBFS and granite in the mix design can be changed to adjust the density of the slurry and early strength of the hardened spacer.The chemical composition of GGBFS and granite is shown in Table 2. Polyanionic cellulose was used as both fluid-loss control agent and viscosifier.Na 2 CO 3 , KOH (12 M), and potassium silicate solution with a Si/K molar ratio of 0.98 were used as alkaline activators.Fatty alcohol surfactant and 2-butoxyethanol solvent with a 1:1 ratio provided by a service company were used as surfactant package.An OBDF with mix design shown in Table 3 was prepared in the laboratory.The fluids were prepared using an IKA Eurostar mixer at 1,400 1/minute rotational speed.The test program consists of two intervals, which are ramp up interval and ramp down interval.The test profile preset for ramp up interval was 0.01-500 s -1 with 24 measuring points and a 10-second constant measuring point duration.The ramp down interval was 500-0.01s -1 with the same number of measuring points and measuring point duration as in the ramp up interval.An oscillatory test was also performed to characterize the viscoelastic behavior of the samples.The strain amplitude was controlled, and the frequency was kept constant at 10 rad/s in this test.With the help of measured shear stress at different shear rates, R-index of different mixture ratios was calculated.Rindex is a measure that cement engineers use to evaluate the compatibility of different fluids inside the wellbore (Elochukwu et al. 2022).R-index can be calculated at different revolution per minute (RPM) values as follows: where θ m is the highest dial reading among different mixture ratios at a given RPM and θ p is the highest dial reading among pure fluids at that RPM.Next, the rheological compatibility of the fluid at that RPM is evaluated based on the guideline shown in Table 4.The R-index values are based on the R1-B1 rotational viscometer readings, and thus the conversion factor of Pa = dial reading×0.511(API RP 10B-2 2013) was used to modify it according to rheometer readings.The average of ramp up and ramp down shear stress values was used to calculate the R-index.The reason behind checking the friction pressure for certain R-index is to make sure that the mixed fluid in small annuli is not posing a risk to weak formation by increasing bottomhole pressure.Much attention should be paid to the R-index at shear rates of 100-200 s -1 because these shear rates commonly occur during primary cementing operations.
R-Index (for Rheometer) Comment Emulsion Stability Test.The Fann electrical stability tester was used to evaluate the ability of surfactant in the spacer to invert the water/ oil (W/O) emulsion, which is done by measuring the stability of OBDF drilling fluid while adding a spacer to it.An electrical stability tester records the maximum voltage that causes internal water droplets coalescence, thus making fluid conductive.

Displacement of OBDF by Spacer.
To mimic the fluid displacement in the annulus, a setup was designed that consists of a tube with length, inner diameter, and outer diameter of 278 mm, 15 mm, and 23.7 mm, respectively (Fig. 1).Using a progressive cavity pump, fluids were pumped from the storage tanks to the annular tube with a constant rate of 2.33×10 −6 m 3 /s.First, the test section was filled with OBDF after ensuring that there were no air bubbles in the system and then the fluid was isolated.Afterward, the spacer was pumped through a silicone rubber hose connected to the tube's inlet.The beginning of the test was linked to when we opened the inlet valve, starting the displacement of OBDF by the spacer.The tube also had an outlet valve on top that allowed us to collect the outlet fluid at different times (using a stopwatch).The density of the collected fluid was measured with an Anton Paar DSA 5000 M densitometer, which helped us to evaluate mud displacement.An entrance effect is anticipated in the test section, resembling real-field scenarios where the velocity profile is nonconstant.
Pumpability.The pumpability of the spacer slurry is evaluated by using OFITE atmospheric consistometer at a bottomhole circulating temperature of 50°C.

Results and Discussions
Compressive Strength.Fig. 2 shows the compressive strength of the spacer cured for 1 day and 7 days.The spacer can develop over 10 MPa strength after 7 days while having a lower slurry density than conventional cement.Although developing mechanical strength is not among the main functions of the spacer, gradual hardening of the slurry can be of use to wellbore integrity if left in the wellbore.Pumpability.The investigated spacer has the ability of hardening; thus, it is important to evaluate the pumpability of the slurry.The consistency of the spacer slurry over time is shown in Fig. 3.It can be concluded that the slurry is pumpable for at least 8 hours at temperatures up to 50°C and it maintains stable consistency during the period of measurement, meaning that the spacer is safe for primary cementing operation.Slag as a binder improves solidified spacer's compressive strength, but its impact on fluid viscosity can be minimal depending on particle-size distribution (Kashani et al. 2013).
Flow Curve.Flow curves of OBDF, spacer, and spacer containing surfactant are plotted in Fig. 4, showing that all fluids present a yield stress and shear thinning behavior.The spacer fluids also show thixotropic effects.The ramp up and ramp down shear stress measurements are almost equal for OBDF.By looking at the linear scale flow curve, it can be noticed that OBDF has a higher degree of shear-thinning compared with the spacer.A viscosity profile closer to Newtonian is advantageous for the spacer and may result in better mud displacement (Nguyen et al. 1992).Moreover, the spacer has generally a higher viscosity than OBDF and passes criteria of at least 10% higher viscosity at 100-200 s -1 shear rates that may help with fluid displacement.From Fig. 4, it is obvious that there is a higher difference between ramp up and ramp down stress measurements in spacer fluid compared with OBDF, which indicates that OBDF preserves its structure when experiencing shear, despite showing time-dependent behavior as it is exposed to constant shear rate (Fig. 5).At 0.01 s -1 shear rate, it takes approximately 100 seconds for the OBDF to break the structure and reach stress peak; after that, shear stress starts to decrease with a constant slope, meaning the fluid goes through changes.OBDF contains barite as a weighting agent, and these heavy particles gradually settle down and oil moves upward.Thus, it causes lower torque to be recorded after some time.As OBDF is exposed to higher shear rates, the time to reach the stress peak gets faster and the slope of decrease of shear stress over time becomes smaller as the particles experience higher drag force because of the higher flow velocity of the fluid.This means that dynamic sag tendency may become lower as higher shear rates are applied to the sample.
Adding surfactant to the spacer causes a decrease in interfacial tension between water and air.Thus, at enough surfactant concentration, micelles are formed, and consequently small air bubbles start to emerge in the fluid, forming a low-quality foam as shown in Fig. 6a.This resulted in an increased viscosity due to a rise in volume fraction of suspension (Stevenson 2012) and a higher difference between the upward and downward shear stress measurements.The explanation for the second observation might be the fact that air bubbles are being deformed or broken up completely during shearing (Herzhaft 2002), and consequently the stress measured during downward shearing is lower and the structure is more destroyed compared with a spacer without surfactants.It is believed that, due to the nonionic nature of surfactant used in the spacer, electrostatic forces between particles should not be affected.However, the van der Waals forces can be changed because of hydrogen forces between molecules on the surface of particles and the polar head of surfactants.
Strain Amplitude Sweep Test.It is not unreasonable to say that all fluids that are typically being used in the wellbore (e.g., cement, drilling fluid, and spacer) are viscoelastic because they consist of particles, clays, polymers, and deformable particles such as droplets.Therefore, measuring the viscosity of the fluid is not enough to understand the behavior of the fluid, especially when at rest or close to yield stress.Fig. 7b shows the storage and loss modulus of OBDF and spacer fluids.In this test, shear strain amplitude was varied sinusoidally from 0.01% to 100% and the resulting shear stress was recorded.The G′ (storage modulus) is attributed to the elastic behavior of material upon deformation, while the amount of deformation energy dissipated due to internal friction between particles and molecules is represented as the G″ (loss modulus).From Fig. 7b, OBDF has a higher G′ compared with spacer without the surfactant.The higher elasticity of OBDF is due to the structure of W/O emulsion and the forces that arise from interfacial tension, which tend to bring water droplets to equilibrium in a continuous phase (Oldroyd and Wilson 1953) and steric interaction between chains of absorbed surfactants (Tadros 1994).Brownian motion is also another reason to position the water droplets in place, thus leading to higher gel strength (Saasen 2002).The above-listed phenomenon is more pronounced when the volume fraction of water increases and the distance between droplets decreases in the emulsion.Introducing the surfactant to the spacer and resulting air bubbles in the continuous water phase generates a higher G′ modulus.Thus, it is expected that forces more or less the same as those in W/O emulsion will contribute to increase in the elasticity of the spacer.The fluids exhibit a gel-like character in the linear viscoelastic (LVE) range, as the storage modulus is higher than the loss modulus.As long as the materials are inside the LVE range, they preserve their internal structure, and when they exit the LVE range, the particles or droplets (in the case of emulsion) gradually start to leapfrog, and the structure goes through irreversible changes.Finally, at the intersection of G′ and G″, the material shows liquid behavior since the structure is completely broken.The stress at this strain is called flow point and it is reported in Table 5.The addition of surfactant to the spacer causes an increase in  flow point.The OBDF, unlike the other fluids, shows a G″ peak after the LVE range followed by reduction, which is a typical behavior of highly concentrated suspensions that exhibit a network of forces.When passing yield stress, few water droplets in the OBDF crystalline structure are bypassing each other, and thus a local network of forces is broken and they can move freely in those areas, leading to an increase in internal viscous friction (increase in G″).Meanwhile, the OBDF can maintain the integration of the overall network, meaning that G′ is higher than G″ until reaching flow point.Time Sweep Test.Monitoring G′ and G″ over time with constant frequency (10 rad/s) and constant strain (0.06%) selected at the LVE range allows us to investigate the stability of the fluid.Fig. 7a shows that the G′ and G″ of the spacer are more likely to change over an extended period of time because of solvent evaporation.Thus, it is suggested to use a solvent trap for tests with longer times.In the case of OBDF, G″ drops while G′ increases simultaneously at the beginning, which can be attributed to barite settling.The changes are not as severe as those for the spacer.Mixtures of Spacer and OBDF.Spacer and drilling fluids are usually in direct contact inside the annulus during mud displacement.Thus, it is of immense importance to evaluate the rheological behavior of the mixture of fluids.Fig. 8 shows the ramp down flow curve of different ratios by volume of OBDF and spacer (without surfactant) mixed.For instance, 75/25 stands for 75% spacer and 25% OBDF in the mixture and 25/75 stands for 75% OBDF and 25% spacer in the mixture.The fluid that has a lower volume was added to the fluid with a higher volume.In the 75/25 mixture, there are two separate phases due to high interfacial tension between these two fluids, as shown in Fig. 9.These resulted in a modest increase in the viscosity profile (Fig. 8) and flow point (Table 6) of the mixture compared with the neat spacer.When adding spacer to OBDF with the same ratio (25/75), however, there is a shift in viscosity profile compared with neat OBDF.OBDF is W/O emulsion that contains surfactant with a hydrophilic-lipophilic balance value lower than 7 to reduce (Ding et al. 2019) interfacial tension between oil and water and thus keep the water as discrete phase.As the spacer is mixed with OBDF, the emulsion tries to attract the water from the spacer due to an osmotic pressure gradient (Li et al. 2015).Consequently, there will be separate phases of OBDF and spacer that are now thicker than before due to the loss of water, as shown in Fig. 9. Increase in the storage modulus (Fig. 10a) and the flow point shear stress of this mixture confirms the statements mentioned above.This is even more noticeable in the 50% spacer and 50% OBDF mixture, and the resulting G′ and G″ and flow point is the highest.Surfactant is an essential component of the spacer that solubilizes the oil and water-wets the surface of the casing and formation.Depending on the type of surfactant, different rheological behavior of the mixture fluid is expected.Fig. 11 shows the ramp down flow curve of different mixture ratios by volume of OBDF and spacer that contains a nonionic surfactant.When 25% spacer is added to 75% OBDF, there is a reduction in the measured shear stress (Fig. 11) and flow point (Table 7).At this mixture ratio, there is enough concentration of nonionic surfactant to diffuse into the oil layer and absorb on the W/O interface and reduce the interfacial viscoelasticity, thus increasing the chance of coalescence of internal water droplets.The water content of the W/O emulsion is also increased and creates higher internal pressure of water droplets (Al-Sabagh et al. 2013).The combination of these two phenomena in turn results in accelerated demulsification and reduced LVE range of the mixture (Fig. 10b).At the 50/50 mixture, the flow curve shifts over and above the OBDF flow curve, and highly uniform fluid was observed (Fig. 9), meaning that critical concentration of nonionic surfactant to reverse the emulsion and turn it into oil/water or water/oil/water is passed.When we added 25% OBDF to 75% spacer by volume, a significant increase in flow point and viscoelasticity was observed (Fig. 10b).This can be confirmed by an increase in the shear stress in lower shear rates measured with the rotational method.When surfactant is included in the design, 50/50 drilling fluid and spacer mixture had lower flow curve shear stresses compared to the pure spacer.This means that a dispersed oil-in-water emulsion is formed that has fewer solid particles compared with a pure spacer.On the other hand, when there is no surfactant in the spacer, the 50/50 mixture had a higher flow curve compared with pure spacer while containing fewer solid particles.Because there is no surfactant in the spacer to lower the interfacial tension, an immiscible mixture is formed.Also, OBDF tries to attract water from the spacer into the internal phase (Li et al. 2015), leaving a thick layer of the solid phase of spacer on the bottom.Comparing the highest shear stress flow curve of the spacer without surfactant/OBDF (Fig. 8), which was for 50/50, and the spacer with surfactant/OBDF mixtures (Fig. 11), which happened for 75/25, it can be concluded that surfactant in the design mostly impacted the shear stress measured at low shear rates and fewer changes on the stress at higher shear rates were noticed.
Viscosity Models.Calculating rheological parameters gives us insight into the flow behavior of the fluids.Additionally, it can help fluid displacement simulations to produce trusted and worthier results.A common model is the Herschel-Bulkley (H-B), which has three parameters to fairly estimate the viscosity of shear-dependent yield stress fluids.It can be expressed as follows: where k is the consistency index, and n is the H-B flow behavior index.n < 1, n > 1, and n = 1 indicate shear-thinning, shear-thickening, and Bingham behavior, respectively.The yield stress can be obtained using these models to fit the rheological data in the flow curve.The mathematical variable known as the consistency index is solely dependent on the value of n and cannot be used to make comparisons between different fluids, which is a crucial function that viscosity models should perform.The application of curve fitting to diverse shear rate ranges produces entirely distinct values of k.Nelson and Ewoldt (2017) made alterations to the H-B model with the aim of removing its dependence on the value of k: Saasen and Ytrehus (2020) made some modifications to the model to overcome its limitations and make it more suitable for a fluid with lower shear rates.They named this modified model the dimensionless shear rate model, and it was intended for application in a different industry: The surplus stress ( s ) can be obtained by subtracting the yield stress from the shear stress, which is determined at a relevant shear rate based on the condition of flow.Yield stress is obtained from the H-B model.The relevant shear rate ( P c ) is determined based on the flow condition and geometry, and during cement placement, a common shear rate is 195 s -1 (Kamali et al. 2021), which is close to 100 rev/min using a conversion factor of s -1 = RPM×1.703.To improve the accuracy of fitting, two different characteristic shear rates, one at higher shear rates (312 s -1 ) and one at lower shear rates (122 s -1 ) than the surplus shear rate, are chosen to calculate the flow behavior index: Ramp down shear stress measurements from 500 to 1 s -1 were used to perform curve fitting because ramp up measurements could be affected by viscoelasticity or thixotropy in lower shear rates.Table 8 shows the rheological parameters after curve fitting of the flow curve of different mixture ratios of OBDF and spacer.The highest yield stress belongs to the 50% spacer and 50% OBDF mixture.The flow behavior index calculated by the dimensionless shear rate model also slightly increases as one moves toward the 50/50 mixture ratio.The impact of including the surfactant in the spacer design on the rheological parameters of the mixture is shown in Table 9 for different mixture ratios.The 25/75 mixture has the lowest yield stress while having high n ls and n hs , as demulsification in this ratio is expected.A yield stress peak is observed for the 95/5 and 75/25, and we try to explain the reasoning for this in the next sections.R-Index.The compatibility of the two fluids is established when the rheological behavior of the mixture remains relatively unchanged compared with the rheology of the individual fluids, namely, the OBDF and spacer slurry.Any substantial increase in the flow curve values indicates gelation of the mixture, which is considered undesirable and indicative of incompatibility.In the best-case scenario, two fluids can be considered rheologically compatible when any mixtures of the fluids have flow curves laying between the flow curves of the pure fluids.When there is a notable increase in the flow curve of the mixture, it indicates that there will be an undesired rise in the bottomhole pressure required for the spacer to displace the mixing zone.This increased pressure can potentially result in the fracturing of the formation.The increase in the flow curve values of the mixture can also affect mud displacement.According to the effective laminar flow rule system proposed by Couturler et al. (1990), the frictional pressure gradient exerted by the displacing fluid (spacer) should be at least 20% higher than that of the displaced fluid (mixture) for efficient displacement.This implies that displacement in the wellbore becomes harder if the less viscous displacing fluid (spacer) is displacing a mixture with higher viscosity.Thus, cement engineers developed a system to evaluate the compatibility of the fluids in the wellbore.Table 10 shows the R-index of OBDF and spacer without surfactant that was calculated for different shear rates.Based on the R-index guideline shown earlier in Table 4, the fluids are compatible.However, the friction pressure should be checked based on operational parameters and wellbore geometry.Adding surfactant to hardening spacer decreases the R-index at higher shear rates while increasing the R-index at lower shear rates compared with surfactant-free spacer (Table 11).This rises from the formation of strong gel for 75/25 and 95/5 mixture ratios.R-index at a relevant shear rate (195 s -1 ) is 5.01 and 6.32 for the spacer/OBDF and spacer (surfactant)/OBDF mixture, respectively.flow curve of the 25/75 mixture relative to OBDF confirms this (Fig. 11b).This is necessary to obtain a better bonding during cementing and while curing the spacer.
Surfactant Mechanisms in Hardening Spacer.Incorporating nonionic surfactant in the hardening spacer causes an increase in yield stress.The surfactant can act in two ways: First, its polar head can be absorbed into the hydrophilic surface of slag particles, leaving lipophilic tails to attract each other and increase the yield stress (Feneuil et al. 2017).Second, at enough surfactant concentration, air bubbles are formed as a result of mechanical stirring and can be stabilized by the surfactant.These air bubbles increase the volume fraction of the suspension resulting in higher viscosities (Barnes et al. 1989).There is a resemblance between oil droplets and air bubbles present in the spacer that contains surfactant.The addition of OBDF to the hardening spacer (with surfactant) results in a substantial increase in the yield stress and storage modulus.It is believed that oil is positioned between the slag particles with the help of surfactants (Fig. 13).
The hydrophobic tails interact with the mineral oil, while the polar head is absorbed by the hydrophilic slag particles.Consequently, a very stable physical-chemical network of structure in suspension is formed, which is shear-dependent (Reeb et al. 2022).
Displacement of OBDF by Spacer.Two scenarios of immiscible displacement of OBDF by (a) spacer and (b) spacer containing surfactant were tested.This experiment aimed to evaluate the impact of surfactant on the OBDF displacement.Fig. 14 shows the outlet fluid density collected at different times for the above-mentioned scenarios.For better understating, the normalized outlet density, (ρ 1 -ρ)/(ρ 1 -ρ 2 ) is also shown in Fig. 14, where ρ 1 and ρ 2 are the density of spacer and OBDF, respectively, and ρ is the measured density of outlet fluid.At the beginning of displacement, the normalized outlet density is equal to unity because only OBDF leaves the annulus.As the displacement continues, the density of the outlet fluid increases as a mixture of spacer (higher density) and OBDF leaves the test section, and thus the normalized outlet density lies between 0 and 1.At a long enough time, the only fluid that leaves the annulus is the spacer so that the measured outlet density converges to the spacer density and the normalized outlet density to zero.This is an indication that the spacer has displaced the maximum possible amount of OBDF from test section.In Fig. 15, it is evident that, even after displacement, some OBDF is left in the annulus.The volume of OBDF (Fluid 2) that is removed from the annulus by the flow of the displacing fluid (spacer) is equal to the volume of the spacer that fills the annulus when the final steady-state condition is reached, and no further displacement occurs.Thus, the normalized outlet density cannot be used to quantitatively evaluate the volume of removed OBDF.To compare the extent of mud bypassed by the spacer in two cases with an equal pumping rate, one can examine the time it takes for the normalized outlet density to converge to zero.The results show that the surfactant in the spacer design has minimal impact on the OBDF displacement efficiency although resulting in a different flow behavior of the mixture.Surfactant, however, played a key role in cleaning the annulus walls that were covered with OBDF, as shown in Fig. 15.According to Foroushan et al. (2018), reducing the interfacial tension can lower the radial interface instability, and, consequently, a thinner layer of mud is left on the walls.

Conclusion
The rheological compatibility of the hardening spacer and OBDF was discussed here.Surfactant in spacer design is a crucial factor that controls the flow behavior of the spacer/OBDF mixture.A nonionic surfactant resulted in unexpected viscoelasticity for 95/5 and 75/25 mixture of spacer/OBDF.Based on R-index values, however, the hardening spacer and OBDF are rheologically compatible.The hardening spacer with surfactant can break the OBDF emulsion at a 25/75 mixture ratio and reverse the emulsion at a 50/50 mixture ratio.The displacement of OBDF by spacer on a small scale was also tested.The result shows that, although different rheological properties of the mixture were measured, depending on whether there is surfactant in design, there is no significant difference in the displacement of OBDF by the spacer.Nevertheless, the surfactant seems to be more beneficial to cleaning the static mud layer on the walls.ρ = measured density of outlet fluid, g/cm 3 ρ 1 = density of spacer slurry, g/cm 3 ρ 2 = density of OBDF, g/cm 3

Emulsion
Fig. 12-Impact of spacer on the stability of OBDF.

Nomenclature
G′ = storage modulus, Pa G″ = loss modulus, Pa k = consistency index, Pa•s n n = flow behavior index, dimensionless n ls = flow behavior index at shear rates below the surplus shear rate, dimensionless n hs = flow behavior index at shear rates above the surplus shear rate, dimensionless R 2 = coefficient of determination SSE = sum of square of errors, Pa 2 θ p = highest dial reading among pure fluids θ m = highest dial reading among different mixtures P = shear rate, s -1 P c = relevant shear rate, s -1 τ = shear stress, Pa τ y = yield stress, Pa τ s = surplus stress, Pa μ p = Bingham plastic viscosity, Pa•s

Fig. 15 -
Fig. 15-Picture of the annular test section after displacement.OBDF and spacer have brown and gray colors, respectively.(a) Displacement of OBDF by surfactant-free spacer.(b) Displacement of OBDF by spacer containing surfactant.

Table 5 -
Static yield stress of fluids measured by the oscillatory method.

Table 6 -
Viscoelastic properties of OBDF and surfactant-free spacer mixture measured by amplitude sweep test.

Table 8 -
Rheological parameters calculated for mixtures of OBDF and surfactant-free spacer.

Table 9 -
Rheological parameters calculated for mixtures of OBDF and spacer containing surfactant.

Table 11 -
R-index calculated for spacer with surfactant, OBDF, and mixture of them for different shear rates.