Introduction

Underbalanced drilling (UBD) intentionally maintains drilling fluid pressure below formation pore pressure, offering advantages like improved productivity, lost circulation preservation, and enhanced performance in various downhole scenarios, including fractured formations, depleted reservoirs, and hard formations (Shadravan et al. 2009). The conventional overbalanced drilling technique usually applies an overbalanced pressure that causes invasion of the drilling fluid into the formation and results in formation damage (Elmgerbi et al. 2021; Bui et al. 2023). On the other hand, UBD prevents the formation damage as it establishes underbalanced condition in the wellbore that prevents the drilling fluid invasion into the formations. Foam, characterized by high viscosity for cuttings transport and low density for underbalanced conditions, is a promising option for UBD (Ramadan et al. 2003; Fattah et al. 2010). Surfactants are added to the foam systems to enhance foam stability by reducing interfacial tension and forming stable films (Obisesan et al. 2021). Adsorbed surfactant particles improve stability by reducing coalescence during drainage (Dong et al. 2008). Foam drilling was found as a viable UBD technique as it prevents formation damage and ensures efficient hole cleaning, making it an appealing drilling medium (Ashraf et al. 2020).

Foam stability is affected by three key factors: liquid drainage, coarsening, and bubble coalescence (Lioumbas et al. 2015). Liquid drainage, driven by gravity and capillary pressure, reduces the liquid content of the foam, affecting lamella film thickness (Saint-Jalmes 2006). Coalescence happens when bubbles collide, creating pressure variations and destabilizing the foam (Govindu et al. 2019). Ostwald ripening (bubble coarsening) occurs when smaller bubbles combine into larger ones, thinning the film and destabilizing the foam (Eren 2004).

Foam stability, a vital characteristic of foaming systems, reflects changes in foam volume or height over time following generation. It is influenced by parameters like pressure, temperature, pH, surfactant concentration, and salts (Ramadan et al. 2003). Stability is typically quantified by the foam half-life (Ho) and the drainage half-life time (t FLS 50%). Ho represents the time it takes for foam volume to decrease to 50% of its initial value due to decay. It can be calculated by determining the foam volume stability (FVS), which compares remaining foam volume to the maximum after foaming has ceased, using Eq. (1) (Wang et al. 2012):

$${\text{FVS}}({\text{t}})= \frac{{{\text{V}}}_{{\text{t}}}({\text{foam}})}{{{\text{V}}}_{{\text{Initial}}}({\text{foam}})}\times 100\mathrm{\%}$$
(1)

where Vt represents the measured foam volume in the cylindrical glass column at a particular time t, and VInitial stands for the initial foam volume immediately after the bubbling has stopped. Afterward, Ho can be estimated by monitoring the FVS values over time and how long it would take the foam volume to be reduced by 50% of its initial value (Obisesan et al. 2021).

Foam liquid stability (FLS) is another crucial aspect that must be considered to assess the stability of foam and its drainage properties. FLS indicates the foam's capability to retain liquid and determines the level of dryness of the foam. The 50% drainage half-life time (t FLS 50%) denotes the point at which FLS reduces to half of its original value. The calculation for FLS can be determined using the following Eq. (2) (Kamal 2019).

$${\text{FLS}}\left({\text{t}}\right)=\frac{{{\text{V}}}_{\mathrm{i }\left({\text{liquid}}\right) -}{{\text{V}}}_{\mathrm{t }\left({\text{liquid}}\right)}}{{{\text{V}}}_{\mathrm{i }\left({\text{liquid}}\right) -}{{\text{V}}}_{\mathrm{f }\left({\text{liquid}}\right)}}\times 100\mathrm{\%}$$
(2)

where Vi (liquid) denotes the initial volume of the liquid before gas bubbling takes place. After bubbling, the volume of the liquid, Vt (liquid), undergoes changes over a specified duration, t. The subscript f refers to the final condition (after foaming stopped or at the end of the bubbling process). The difference between these values signifies the amount of liquid that gets trapped inside the foam structure. The drainage half-life time (t FLS 50%) marks the time it takes 50% of the liquid to drain out of the foam structure. Thus, the foam system has better stability when the t FLS 50% value is higher indicating that the foam can hold more liquid within the lamella film and minimize liquid drainage out of the foam.

Several factors affect aqueous foam stability, including water salinity, surfactant adsorption, and gas type. Conflicting findings exist in the literature regarding the influence of salt on foam. Some studies suggest that increased salt enhances stability through reduced drainage and stronger bubble films due to increased electrostatic forces (Ibrahim and Nasr-El-Din 2019). However, salt’s impact can vary, depending on surfactant concentration (Majeed et al. 2020). For example, adding 1M NaCl to a 0.025 wt% surfactant solution reduced foam sevenfold, but with 0.25 wt% surfactant, the foam's half-life improved sixfold with 1M NaCl. Furthermore, water chemistry significantly affects foam stability (AlYousef et al. 2020). Various water types, including DI water, seawater, and low-salinity water, were studied, with low-salinity water enhancing stability over DI water. The impact of different salt types (NaCl, CaCl2, KCl) and concentrations on foamability and stability was also examined. Salt type notably influenced foam generation, with CaCl2 and KCl causing rapid foam volume reduction due to interactions with surfactants, leading to crystal formation.

The choice of gas in foam formation significantly impacts foam stability. Gases like air, nitrogen, and carbon dioxide are used based on specific needs. For underbalanced drilling (UBD), air and nitrogen are common choices, with air being most prevalent due to its availability and cost-effectiveness (Porter et al. 2018). However, air-based foam stability can be influenced by surfactant and environmental factors. Nitrogen is preferred for inert conditions, especially when avoiding oxygen is crucial, such as drilling through hydrocarbon-containing reservoirs (Al-Darweesh et al. 2023a). Nitrogen-based foams create smaller, more uniformly sized bubbles, enhancing stability, making them ideal for underbalanced drilling operations (Ashraf et al. 2020).

Foam drilling falls into two categories: stable foam (water-based) and stiff foam (polymer-based) (Ismail et al. 2013). Stable foams can include surfactants, salts, and corrosion inhibitors without significantly affecting liquid phase viscosity (Ramadan et al. 2003). Stiff foams contain viscosifiers in addition to these additives, often achieved through polymers. They have structures resembling aqueous foams but are more stable. In underbalanced drilling (UBD) applications, various foam systems have been studied, incorporating stabilizers, polymers, and surfactants, including commercial products like Kasey Colombia, KLEAN-FOAM, Quick Foam, Howco Suds™, and AD300 39. Surfactants tested include anionic (e.g., SDS), cationic (e.g., CTAB), and amphoteric (e.g., n-alkyl betaines) (Martins et al. 2000; Chen et al. 2007, 2005; Liu et al. 2010; Ismail et al. 2013; Saxena et al. 2017; Sinha et al. 2019). Stabilizers and polymers like Xanthan gum, Carboxymethyl Cellulose (CMC), Guar Gum, Dris Pac, and nanoparticles have also been employed 25,33,34.

To be suitable for underbalanced drilling, foam should meet certain standards, including maintaining stability for cuttings transport, maintaining a mildly alkaline pH (9.5–10.5) by treating water, and tolerating salts that may enter the wellbore from the formation due to underbalanced conditions (IADC UBD Committee 2005; API-RP-92U 2008; Sepulveda et al. 2008). The effective minimum foam half-life in oil and gas wells can vary depending on factors like well conditions, objectives, and specific foam formulation, making a universal reference value impractical. Engineers and drilling experts customize foam formulations to individual well conditions for desired performance.

Many studies in the literature have experimentally investigated different drilling-foam systems for UBD applications using different components, i.e., surfactants, polymers, stabilizers, etc. A summary is provided in Table 1 that lists different drilling foam systems that have been tested in the literature including their salt tolerance and the reported information on the pH of the testing environment if any.

Table 1 Summary of the experimentally investigated aqueous-based drilling foam systems in the literature

Based on the literature reviewed, many studies have investigated how the drilling foam stability was affected by many factors (e.g., foam quality, testing conditions of pressure and temperature, and monovalent or divalent salt ions). However, most of the previous investigations did not present findings on the effectiveness of the tested drilling foams when operating under high pH conditions, which is crucial for preventing corrosion during drilling operations. Moreover, little research has been conducted on the stability of drilling foam systems when exposed to salt inclusions under underbalanced conditions, or when using saline water as the liquid base fluid for the foaming solution. This aspect has largely been overlooked in previous studies. Therefore, it is imperative to conduct further research on drilling foam performance under high pH conditions and determine their compatibility with saline water.

Therefore, the main objective of this study is to examine the foaming characteristics of a newly developed eco-friendly foaming agent under high pH environment that mimics a typical drilling environment. Various variables, including surfactant concentration, water salinity, gas type, and the influence of polymers, were systematically evaluated to gage their effects on foam stability, foamability, and foam structure.

Materials and methods

Materials

Foaming agent

A novel Gemini amphiphile was employed in this research which was developed in-house with a chemical structure shown in Fig. 1. The gemini amphiphile is a dicationic (Br-Counter ions) surfactant containing larger linker (C12) along with lipophilic tail (C12), denoted as GS12. The cationic GS12 foaming agent with a flexible large spacer was prepared through a reaction between glycolic acid ethoxylate lauryl ether and 3-(dimethyl amino)-1-propylamine in the presence of NaF to form an intermediate compound. The intermediate compound was then further reacted individually with 1,12-dibromo dodecane to form GS12 (Hussain et al. 2019). The GS12 exhibited excellent solubility in normal and saline water and the aqueous solutions GS12 stayed clear for up to three months at 90 °C without precipitation or phase separation. The spacer in GS12 stimulates micelle formation at the water-micelle interface and creates a more closely packed micelle structure. Moreover, the chemical structure of gemini surfactant was designed by careful selection of each group to obtain eco-friendly features. For example, the amide group [R–C(O)–NH–] in the chemical structure of gemini surfactant is considered as biodegradable linkage and use for the synthesis of eco-friendly surfactants (Taleb et al. 2017) In addition, the repeating units of ethoxy groups [–CH2–CH–O–] between the hydrophilic head and hydrophobic tail group of gemini surfactant enhance the solubility of gemini surfactant through hydrogen bonding. Additional details regarding the characterization of the GS12 Gemini surfactant, including the application of NMR (carbon and proton), FT-IR, and MALDI-TOF MS, can be found in a study authored (Hussain et al. 2019). Moreover, comprehensive insights have been offered into various analyses such as thermal gravimetric analysis, salt resistance, and solubility, contributing to a thorough comprehension of the properties of the foaming agent.

Fig. 1
figure 1

The chemical structure of the foaming agent (dicationic amphiphile, GS12) used in this study (Hussain et al. 2019)

The attachment of ethoxy groups in the GS12 backbone makes it unique in its nature. In other words, without ethoxy groups, the traditional dicationic amphiphile are poorly soluble in high-saline environments. However, this surfactant showed excellent compatibility with a wide range of brine salinity as well as high reservoir temperatures due to the ethoxy units being properly placed among the lipophilic tail and lipophobic headgroup. The GS12 Gemini foaming agent is an environmentally benign surfactant, making it a suitable material for oilfield applications.

Gas phase

Both air and nitrogen were used in this study since these two gases are commonly employed in foam drilling applications in the field. Nitrogen (N2) gas (99.99% purity) and air stored in pressurized cylinders were used as a source of the gas phase for foaming during the experiments.

Liquid phase

Di-ionized water (DW) sourced from Ultrapure Milli-Q (18.2 MΩ cm at room temperature) water system. Sea water (SW) was synthesized using ACS-grade salts with concentrations listed in Table 2. For foam drilling applications, it is recommended for the drilling fluid to be mildly alkaline to reduce the risk of corrosion of the drilling string (API-RP-92U 2008). Therefore, a pH buffer solution of 5M Potassium Hydroxide (KOH) was used to adjust the prepared foaming solutions in the range of 9–10.

Table 2 The mineral composition of the synthesized sea water and formation water used in this study

Polymer

Poly Anionic Cellulose (PAC) is a water-soluble polymer that is widely used in various oilfield applications, i.e., drilling fluids. PAC has a high molecular weight and a high degree of anionic substitution, which makes it a viable stabilizer for foam systems. A sample of commercial white powder under the name of POLYPAC-R was used to generate polymer foams.

Sample preparation

The liquid foaming solutions were prepared by dissolving the surfactant with the desired concentration in water using a volumetric flask and a magnetic stirrer. Droplets of 5M KOH solution were added to increase the pH of the prepared solutions to be in the range of 9–10. The other additives, i.e., polymer, were then added with the decided concentration to the solution. Finally, the solutions were kept for mixing over a few hours to ensure solution homogeneity before commencing foaming testing.

Foaming testing

The Dynamic Foam Analyzer (DFA 100) was used to assess the foaming properties. All measurements were conducted at 25 ºC and atmospheric pressure. A 50 mL of the surfactant solution was introduced via syringe into a glass column, which was equipped with prisms for visualization of foam structure and a calibration grid to measure bubble size. The column was situated between a linear LED panel and a line sensor to measure foam height and volume. Gas (Air or N2), 150 mL, was pumped into the solution from the bottom through a porous filter paper with pore sizes ranging from 16 to 50 μm. The software evaluated the number of bubbles, bubble size, and foam volume decay over time. All experiments were repeated at least three times for measurements reproducibility, and the average values of these readings are reported. Figure 2 shows a schematic of the DFA 100 apparatus used in this study.

Fig. 2
figure 2

A schematic drawing for the foam analyzer DFA 100 used to evaluate the foam properties

Scope of experiments

This study aims to characterize the foaming systems generated using the novel GS12 surfactant to assess its performance at high pH conditions typically similar to the drilling environments. Such analysis would provide guiding insights into the foaming stability and foamability of this surfactant. Foaming experiments investigated the effect of surfactant concentration, liquid phase salinity, gas type, polymer addition on foam stability, foamability, and structure of GS12 foams. Samples of the liquid phase were considered varying the surfactant concentration (0.1: 2.0 wt%). Samples of water with different levels of salinity were tested by mixing deionized water and sea water at different ratios. The ratios tested included 100% deionized water, 25% sea water + 75% deionized water, 50% sea water + 50% deionized water, 75% sea water + 25% deionized water, and 100% sea water. Moreover, the impact of adding PAC polymer on foaming was investigated. Table 3 summarizes the designed matrix for experimentation in this study. The flowchart of the designed experiments conducted in this study is depicted in Fig. 3.

Table 3 Experimental testing matrix for the GS12 foaming agent
Fig. 3
figure 3

Experimentation Design Flowchart

Results and discussion

Foam stability

The DFA 100 tester was used to evaluate the foam stability of the prepared foaming systems and study how it is impacted by different parameters, i.e., surfactant concentration, water salinity, gas type, and adding polymer. The foam stability is inferred from the foam half-life (Ho).

The impact of surfactant concentration

The tested solutions were prepared by dissolving different concentrations of GS12 surfactant (0.1–2.0 wt%) into DW and adding droplets of KOH to establish a mildly alkaline environment (pH ~ 9.5). Figure 4 depicts the foam half-life for different GS12 surfactant concentrations in the presence of air. The study found that increasing the GS12 concentration resulted in more stable foam. The foam was most stable at a concentration of 1.5 wt%, and less stable foam was observed when the concentration exceeded this level. Obviously, surfactant molecules tend to cluster at the air–liquid interface, forming a monolayer that stabilizes the foam bubbles and prevents them from coalescing and collapsing. Therefore, increasing the surfactant concentration in the liquid solution increases the number of surfactant molecules available to adsorb at the air–liquid interface. This leads to a decrease in surface tension and an increase in foam stability because more surfactant molecules can form a denser and more cohesive monolayer at the liquid–air interface (plateau border) as shown in Fig. 5. However, beyond a certain point, adding more surfactant to the solution may lead to a decrease in foam stability. This can be explained as, at very high concentrations, surfactant molecules can start to aggregate and form micelles in the bulk liquid, reducing the availability of surfactant molecules at the air–liquid interface and decreasing the ability of the surfactant to stabilize the foam bubbles. These results agree with the observations of several previous studies (Wang and Mulligan 2004; Wang 2014; Jones et al. 2016; Majeed et al. 2020) who found that the stability of foam decreases at higher concentrations than a certain limit due to the excess molecules of surfactant within the foaming system. The excess of surfactant molecules increases the gravitation impact on foam drainage, which results in more liquid drainage from the film formed between adjacent bubbles. This eventually ruptures the foam film resulting in bubble coalescence. From these results, an optimum concentration of 1.5% was concluded for stable GS12 foam that maximizes foam stability.

Fig. 4
figure 4

Foam half-life for GS12 foaming solutions with different surfactant concentrations in the presence of air and DW in a mildly alkaline environment

Fig. 5
figure 5

Schematic diagram of morphology at air–liquid interface for the proposed GS12 foam system

Furthermore, it is observed that increasing the GS12 concentration from 0.5 to 1.5 wt% (by three times) only improved the foam half-life (i.e., the time it takes for the foam volume to decrease to half of its initial value) by ~ 30%, which may not justify the additional cost of using more surfactant. Therefore, from a field application cost perspective, it was determined that 0.5% of GS12 was sufficient to achieve a stable foam for UBD applications in mildly alkaline environments.

Moreover, measuring the surface tension of the tested foaming solutions with air shows a steep reduction in the surface tension when the surfactant concentration increased from 0.1 to 0.5 wt% as shown in Fig. 6. However, beyond this limit, the reduction in the surface tension was not significant with increasing the surfactant concentration. Exceeding a concentration of 0.5 wt% would likely yield minimal additional benefits in terms of surface tension reduction, potentially unjustifiably elevating the overall cost of the process. Based on the analysis of the data, 0.5 wt% was selected to be the optimal concentration beyond which no significant change in in both the foam half-life and the surface tension was observed. The decision to adopt a 0.5% surfactant concentration as optimal was driven by the surface tension measurements in Fig. 6. This concentration effectively reduces surface tension to values approaching the lowest limits while concurrently mitigating the formation of micelles in the lamella between bubbles. This precautionary measure prevents potential destabilization of the foam structure due to an increased drainage rate, as micelles can disrupt the stability of the lamellar film.

Fig. 6
figure 6

Surface tension measurements of the tested foaming solutions with air at 25 °C in contact with air

The impact of water salinity

The chemistry of water is a crucial factor in foam stability. The impact of salinity on foam stability can vary depending on the type of surfactant utilized (AlYousef et al. 2020). According to Behera et al. (2014), the foam stability decreases with an increase in salt concentration. However, Xu et al. (Xu et al. 2009) observed that the addition of NaCl to a nonionic surfactant solution can elevate foam stability up to a certain level.

To investigate how the salinity of water affects foam stability, a series of experiments were carried out to evaluate foam stability up to the half-life time. During the experiments, the concentration of the GS12 surfactant was kept constant at 0.5 wt%. Different samples of seawater (SW) were used at varying dilution levels, including 25%, 50%, 75%, and 100% SW diluted with deionized water (DW).

Figure 7 illustrates the foam half-life of the GS12 surfactant under different water salinities in the presence of air at pH ~ 9.5. The findings revealed that an increase in the salinity of the liquid phase reduced the foam half-life, with a maximum reduction of twofold observed in the presence of SW. Such interplay between foam stability and water salinity was also observed but with other surfactants (Behera et al. 2014; Hadian Nasr et al. 2020; Majeed et al. 2020).

Fig. 7
figure 7

Foam half-life for GS12 surfactant with different water salinities in the presence of air in a mildly alkaline environment

This can be explained as the presence of dissolved salts in the liquid phase can disrupt the structure of the foam, leading to coalescence and drainage of the foam bubbles. When a solution is mixed with air to form a foam, the surface tension of the liquid phase plays a crucial role in stabilizing the bubbles. Foam stability is determined by a delicate balance between the drainage of liquid from the bubbles, which increases with time, and the resistance of the surface tension to this drainage. In a low salinity environment, the surface tension of the liquid phase is high enough to overcome the weight of the liquid draining from the foam, thus helping to stabilize the bubbles. However, with increasing salinity, the presence of charged particles or ions in the solution can lead to a reduction in surface tension (Behera et al. 2014), thus weakening the structure of the foam bubbles and increasing the drainage rate. This finding was supported by the decreasing trend of the drainage half-life time (t FLS 50%), (which is the time at which 50% of the liquid phase has been drained out of foam. As shown in Fig. 8, the drainage rate became faster (lower t FLS 50%) with increasing salinity, leading to lower foam stability.

Fig. 8
figure 8

Drainage half-life (t FLS 50%) for GS12 foams with different water salinities

The results of this study examined the effect of water type, comprising a group of different salts, on foam stability. However, future publications will investigate the impact of ion type on foam stability. The results obtained in this study clearly demonstrate the importance of water chemistry on foam stability with a specific type of surfactant.

The impact of adding polymer

In this study, polyanionic cellulose (PAC) polymer was selected to evaluate the impact of adding polymer as a foam stabilizer to boost its stability. PAC has recently been used as a viscosifier and foam stabilizer in many studies (Babatola 2014; Sherif et al. 2015; Sinha 2020). PAC is a cost-effective additive to many water-based drilling fluids with salt-resistance ability (Li et al. 2020). It can be used as a thickening agent, rheology controller, suspending agent, and filtrate reducer (Yang et al. 2015). Moreover, it is an environmentally friendly polymer that is effective over a wide range of pH environments (Bui et al. 2022). Therefore, two more experiments were conducted where 3g/L PAC was added to GS12 (0.5 wt%) foaming solution to assess the PAC polymer effect on foam stability. The experiments were conducted in the presence of air using both DW and SW.

The findings of the study indicated that the use of PAC polymer significantly increased foam stability (Fig. 9), specifically by approximately seven and four times, in the case of using DW and SW liquid base fluids, respectively. The positive impact of PAC on foam stability was also observed by previous publications that used PAC as a foam stabilizer but with different surfactants (Davarpanah 2018; Bi et al. 2022). This observation can be explained as increasing the viscosity of the surfactant solutions by adding polymers can impact foam stability as evidenced by previous experimental studies (Bureiko et al. 2015; Gochev 2015; Derikvand and Riazi 2016; Emrani and Nasr-El-Din 2017; Veyskarami et al. 2019). Given that, the polymer molecules can form a network structure on the film, it can effectively boost the viscosity of the solution. Being a dispersed gas in a liquid phase in nature, the thickness of the foam film plays a crucial role in stability. Thicker foam films are less prone to rupture. Weak drainage of the solution leads to a slower thinning of the foam film, and an increase in solution viscosity can mitigate this drainage, resulting in a lower defoaming rate and stronger foam stability. Therefore, higher viscosity can lead to a weaker drainage rate in the foam film and improve foam stability. This claim is supported by the results in shown in Fig. 10 which illustrates that polymer GS12 foams had a lower drainage rate inferred from the higher t FLS 50% values compared to non-polymer GS12 foams.

Fig. 9
figure 9

Foam half-life of GS12 surfactant solutions with/without adding PAC in a mildly alkaline environment

Fig. 10
figure 10

Drainage half-life (t FLS 50%) graph illustrating the impact of adding PAC to GS12 solution with different salinities

While an increase in water salinity has been found to decrease the stability of GS12 foam, this study suggests a solution to the problem by using PAC polymer to enhance its stability and make SW a viable alternative to freshwater in underbalanced drilling. This is particularly beneficial in regions where freshwater is scarce.

The impact of gas type

The type of gas used for foaming plays a prominent role in the foaming stability (Alooghareh et al. 2022). To assess the impact of gas type on foam stability, GS12 foam (0.5 wt%) was tested using both air and nitrogen. Figure 11 shows the foam half-life of GS12 foam using DW and SW (at pH ~ 9.5) in the presence of air and nitrogen. The results show that, regardless of the water salinity, the nitrogen-based foam is more stable by about twofold than the air-based foam. The reason why nitrogen generates a more stable foam than air may be due to its physical properties. Nitrogen is an inert gas which means that it does not react with other chemicals readily. Therefore, it is less likely to form chemical reactions with other components of the foam. Additionally, nitrogen molecules have a larger molecular size than air molecules. As a result, a bubble formed by nitrogen has a thicker shell compared to an air bubble, which makes it more resistant to collapse. In other words, the combination of nitrogen's inertness, and larger molecular size gives it a privilege over using air for producing more stable foam.

Fig. 11
figure 11

Foam half-life of GS12 surfactant using DW and SW in the presence of air and nitrogen

Foamability

The foamability of a surfactant refers to its ability to generate foam regardless of its properties. It can be described by the initial foam volume (VInitial) generated once the gas injection through the porous plate has stopped. Figure 12a, b, and c shows the foamability in terms of the initial foam volume for the GS12 surfactant with varying components of the foaming system; the gas phase or the liquid phase chemistry. It is observed that all the tested systems exhibited almost the same foamability indicated by the slight difference in VInitial values that ranged from 212 to 220 mL when air is utilized as a gas phase. The slight variation in VInitial should not be deemed significantly important, especially when considering potential experimental errors. Therefore, it is concluded that surfactant concentration, water chemistry, and adding polymer have no significant impact on the foamability of the GS12 surfactant at high pH environments. Moreover, it should be stated that foamability does not reflect foam stability. For instance, all the air-foamed systems almost have the same VInitial, yet each system has a different foam half-life.

Fig. 12
figure 12

The foamability of the tested GS12 foaming solutions with varying parameters (a) surfactant concentration (b) water salinity (c) adding PAC polymer (d) gas type

Additionally, it is found that the foamability was affected by the gas type. Foaming using nitrogen resulted in higher foamability than air as shown in Fig. 12d. This observation can be explained as nitrogen has more capability to capture the foam due to being slightly lighter than air (Density Air = 1.29 kg/m3 and Density Nitrogen = 1.25 kg/m3). Foaming requires surpassing the lowest possible superficial velocity (\({U}_{t}^{min}\)), which is dependent upon the gas type; a denser gas necessitates a greater velocity to initiate foam generation (Yu et al. 2018). During the experiments, air and nitrogen were injected through the porous plate into the liquid phase at the same rate of 0.2 mL/min. As a result, the denser air generated less foam than nitrogen by 12%, requiring a higher flow rate to reach the same level of foam.

Foam structure

Table 4 presents the initial bubble count (BCInitial) of all foam systems tested in this study using GS12 surfactant immediately after foaming, which involved injecting 150 mL of gas. The results indicate that all GS12 foams with different foaming components (except for polymer foams) had almost the same BCInitial, spanning from 71 to 93 bubbles per mm2. Thus, it was determined that the initial bubble count of GS12 foams exhibits minimal dependence on surfactant concentration, gas type, or water salinity. In contrast, adding PAC polymer resulted in stiff foam compositions characterized by a lower initial bubble count, which was approximately half the count of other foam systems. Therefore, the assessment of polymer foams constituted a focus for further investigation to gain an improved understanding of how PAC influences the structure and bubble count of GS12 foam.

Table 4 The observed foam bubble count (BCInitial) per mm2 for the GS12 surfactant immediately after the foaming has stooped. The bubbles were counted automatically using the high-resolution cameras of the DFA100 apparatus

Table 5 depicts captured images of the bubble structure of GS12 with and without PAC at different time intervals in the presence of air at pH ~ 9.5. The results illustrate that initially, the stable foam generated fine-textured, uniform spherical bubbles with an average initial bubble radius of around 56–63 μm and large bubble count (73 and 93 mm−2) while using both DW and SW, respectively, for different levels of salinity. As time progressed, the bubble count decreased, and the bubble size increased as the smaller bubbles combined with larger ones. The bubbles progressed from spherical to polyhedron in shape due to bubble coarsening. This happens because of the diffusion of gas through liquid films due to a pressure difference.

Table 5 Captured images of bubble structure at different time intervals in presence of air at pH ~ 9.5 (foam bubbles are in gray while the liquid film are in black)

Contrarily, the behavior of the polymer GS12 foams showed differences in bubble size and shape as they were not uniform. The study observed that the bubble count and bubble size remained constant for a long period, and bubble coarsening was not notable. When polyanionic cellulose polymer was added to the foaming solution, it acted as a stabilizer of the foam structure (Bi et al. 2022). This is because the polymer adsorbs onto the surface of the bubbles and creates a thin layer of stabilization, which can slow the coalescence of bubbles and maintain the overall bubble count and size (Sinha 2020). Additionally, PAC polymer can increase the viscosity of the solution, which can inhibit the drainage of liquid from the film separating the bubbles, further contributing to the stability of the foam.

The polymer GS12 foams were found to have the largest bubble size (77 and 82 μm) and the minimum bubble count (44 and 43 mm−2 for the cases of DW and SW, respectively) among all the tested GS12 foaming systems. This resulted in maximum stability for these foaming systems. Kadafur et al., (2022) claimed that higher stability is achieved with larger bubble counts. However, the relationship between measured bubble count and foam stability is not necessarily correlated, which is consistent with (Majeed et al. 2020; Al-Darweesh et al. 2023b).

Semi-log graphs in Figs. 13a and 14a illustrate the structure analysis of GS12 foaming systems in terms of bubble count per mm2 and mean bubble area in mm2. The experiments were conducted using DW and SW until the half-life of foam was reached and performed in the presence of air at pH ~ 9.5. The results are consistent with the images in Table 5. The results indicated that the bubble count of stable GS12 foams (without PAC) decreased considerably over time due to bubble coarsening and coalescence, whereas polymer GS12 foams (with PAC) showed a more gradual and slow decline in bubble count (Figs. 13a and 14a). The findings were further supported by the significant increase in the mean bubble area (MBA) per mm2 of the foam bubbles for stable GS12 foams (see Figs. 13b and 14b), as evidenced by the steep gradient, compared to polymer foams, regardless of the salinity level of the base fluid.

Fig. 13
figure 13

Semi-log graphs for structure analysis of GS12 foaming system in terms of (a) bubble count per mm2, and (b) mean bubble area in µm2, using DW in the presence of air in a mildly alkaline environment

Fig. 14
figure 14

Semi-log graphs for structure analysis of GS12 foaming system in terms of (a) bubble count per mm2, and (b) mean bubble area in µm2, using SW in the presence of air in a mildly alkaline environment

It should be highlighted that the limitations of this study include a notable sensitivity of the results to the foaming method and apparatus employed. The choice of these two factors can significantly influence the outcomes, posing challenges to data reproducibility. Ensuring result consistency necessitates not only using the same foam analyzer module but also maintaining uniformity in the average pore size of the base porous disk, the foam generation procedure in the foam column (via gas sparging or blender method), and the gas bubbling rate through the disk (applicable to gas sparging foam analyzers). Additionally, it is important to note that the results in this study are reflective of ambient conditions, and ongoing research in our labs aims to explore the performance of this foaming agent under elevated pressures and temperatures to simulate conditions encountered during drilling deeper sections.

Finally, the efficacy of the GS12 + PAC foaming system is evaluated in comparison with a commercial blend, aiming to validate its feasibility in the field of underbalanced drilling. The commercial blend, designed for drilling operations, encompasses a blend of foaming agents, foam stabilizers, and polymers to enhance its foaming characteristics. The experiment involved testing the commercial blend alongside the proposed GS12 + PAC system for foam generation using sea water and nitrogen as the foaming agents. Performance assessment was conducted by analyzing foam stability (expressed as foam half-life, Ho) and initial foam volume. Results obtained from Fig. 15 indicate a significant disparity between the proposed GS12 + PAC foaming system and the commercial blend in terms of foam stability and initial foam volume. Specifically, the GS12 + PAC system exhibited remarkable superiority over the commercial blend. The proposed GS12 + PAC system demonstrated a 78% increase in foam half-life compared to the commercial blend, with the former boasting a 97-min half-life. Additionally, the GS12 + PAC system generated a larger initial foam volume, measuring 245 mL, which represents a notable 21% increase compared to the commercial blend. These findings underscore the exceptional performance of the GS12 + PAC foaming system, positioning it as a highly promising candidate for underbalanced drilling applications. The superior foam stability and increased foam volume not only validate its viability but also highlight its potential to enhance operational efficiency and safety in drilling operations.

Fig. 15
figure 15

Comparison of the GS12 + PAC vs. a commercial blend in terms of foam stability (expressed as foam half-life, Ho) and initial foam volume

Conclusions

This study, utilizing the advanced dynamic foam analyzer (DFA 100), explores the efficacy of the eco-friendly Gemini surfactant (GS12) in underbalanced drilling conditions. Examining factors like surfactant concentration, water salinity, gas type, and the addition of a green polymer polyanionic cellulose (PAC), the study establishes GS12 as a promising foaming agent at high pH (pH 9.5). For a typical GS12 foams under pH of 9.5, the following findings are drawn:

  • The optimal surfactant concentration for maximum foam stability is 1.5 wt%, however a threefold increase to 1.5 wt% only improves stability by 30%. Therefore, an economical 0.5 wt% concentration is sufficient for field underbalanced drilling (UB) applications.

  • The foam stability decreases as water salinity increases, with a maximum reduction of twofold observed in seawater compared to di-ionized water.

  • Adding PAC polymer mitigates the decrease in foam stability due to increased water salinity, making seawater a viable alternative for sustainability in UB foam drilling.

  • Foam volume of GS12 surfactant is minimally affected by concentration, water chemistry, and PAC-polymer addition. Nitrogen produces higher and more stable foam than air.

  • Initial bubble count is minimally affected by surfactant concentration, gas type, or water salinity. However, adding polymer lowers the initial bubble count, and PAC enhances stability for a consistent count and size over time.

  • The GS12 + PAC foaming system demonstrated superior foam stability, with a 78% increase in foam half-life (245 min) compared to the commercial blend, and generated a larger initial foam volume (245 mL, 21% increase), affirming its potential as a viable candidate for underbalanced drilling applications.

This study unveils new insights into using an GS12 surfactant for foam drilling in high pH environments, mirroring real drilling conditions. Prior literature has overlooked these specific conditions, making this research crucial for understanding foam performance in drilling-like environments.