Introduction

Formation water refers to the naturally occurring water that is present within underground reservoirs of oil and natural gas1. It is often found in the same rock formations as hydrocarbon deposits. When oil and gas are extracted from these reservoirs, formation water is produced alongside them2. Formation water often contains various salts, including chlorides, sulfates, carbonates, and bicarbonates3. These salts are commonly derived from the geological formations in which the water is trapped.

Salts, particularly chloride ions, can increase the corrosiveness of formation water. When in contact with metal surfaces, such as wellbore tubulars or production equipment, high chloride concentrations can accelerate corrosion, leading to equipment degradation and potential safety risks4,5.

Various chemicals can act as corrosion inhibitors to protect metal surfaces from corrosion in formation water systems. Examples include filming amines, organic acid salts, or quaternary ammonium compounds6,7,8. These inhibitors adsorb onto metal surfaces, forming a protective film that prevents direct contact with corrosive agents.

It’s important to note that the selection and effectiveness of corrosion inhibitors for formation water depend on several factors, including the specific system conditions, water chemistry, and the materials involved. Proper dosage, compatibility, and monitoring of inhibitor performance are crucial for successful corrosion control9,10.

Plant extracts have been explored as potential corrosion inhibitors due to their natural composition and environmentally friendly characteristics. Some plant extracts contain organic compounds that can exhibit inhibitory properties against corrosion11,12,13,14,15,16,17. Tobacco, vernonia amygdalina and myrtus communis are examples of plants that contain organic compounds that inhibit corrosion18,19,20,21,22. These plants may contain organic compounds such as phenols, flavonoids, alkaloids, or tannins, which can exhibit corrosion inhibiting properties23.

It’s worth noting that the use of plant extracts as corrosion inhibitors in formation water is an area of ongoing research and development. The effectiveness of plant extracts can vary depending on factors such as the specific plant species, extraction method, composition of the formation water, and the corrosive agents present.

In this study, we employed avocado fruit extract as a potential eco-friendly corrosion inhibitor for carbon steel in salty formation water SFW generated from west Egyptian petroleum fields.

The selection of avocado fruit extract as a corrosion inhibitor over other fruit extracts can be prompted by a variety of variables, such as its chemical composition, availability, efficacy, and compatibility with the system subject to protection. It includes a variety of bioactive components, including phenolic compounds, flavonoids, and fatty acids, which have been shown to be corrosion inhibitors. These chemicals can produce a barrier of protection on the metal surface, slowing the corrosion process. In addition to being widely accessible and coming from a natural source, avocados have been shown to be environmentally beneficial. Avocado fruit extract coincides with the goals of developing sustainable and environmentally friendly corrosion inhibitors.

The current study uses a variety of methods, including weight loss, Tafel polarization, and electrochemical impedance spectroscopy (EIS), as well as surface analysis (SEM, EDAX, UV–Visible), to assess the effectiveness and performance of the avocado extract.

Experimental part

Materials

Carbon steel (CS) samples have the chemical composition (in wt%) of: 0.18 C, 0.23 silicon, 0.03 sulphur, 0.02 aluminum, 0.25 CS, balance iron.

Ethyl alcohol and distilled water solution was used to clean the CS specimen before testing, and emery sheets with grades ranging from 600 to 1200 were used to polish it.

The test solution was the salty formation water SFW from west Egyptian petroleum fields with composition (mg/l): 37,445 Cl, 903 HCO3, 1255 SO42−,1966 Ca2+,20,344 Na+, 1320 K+, and 1004 Mg2+. The ionic chromatograph device was used to analyze SFW. The pH of the SFW is 6.9.

Symrise Company supplied powdered avocado fruit extract. We calculated the concentration of the avocado extract (mg L−1) on the following relation:

$${\text{Concentration }}\left( {{\text{mg }}{{\text{L}}^{ - \,{\text{1}}}}} \right){\text{ }}={\text{ }}({\text{Mass ofavocado fruit extract powder in mg}}){\text{ }}/{\text{ }}({\text{Volume of SFW in L}})$$
(1)

Electrochemical and chemical measurements

The electrochemical experiments were carried out in compliance with ASTM G324. A potentiostat/3000R-Gamry was the device used for the electrochemical investigations. The experiments used a CS disc with an active surface of 0.374 cm2, a Pt ribbon as the counter portion, and a saturated calomel electrode (SCE) as the reference section. The tests were conducted in a double-walled cell. By applying changing voltage range (± 0.250 V/SCE vs. OCP) to the CS anode at a scan rate of 0.125 mV s−1, Tafel polarization plots had been obtained. EIS measured the impedance response of the system over a range of frequencies (105 Hz to 10−2 Hz) with four points per decade. The frequency range was typically chosen to cover both the high-frequency region (related to the charge transfer processes at the metal surface) and the low-frequency region (related to the diffusion processes in the solution). To make sure the electrochemical experiments were accurate, they were conducted several times.

To evaluate the weight loss (WL) tests, CS strips were divided into sections sized 1.0 cm × 1.0 cm × 0.04 cm for evaluation. The WL test was determined using ASTM standard method G1-03–2017-e125. For 168 h, each specimen was immersed in the examination solution. The WL study carried-out in static mode. We used an analytical balance with an accuracy of ± 0.0001 g for all weight measurements. The studies were repeated three times, and the average mass loss was determined. The corrosion rate (in millimeters per year, mpy) from WL tests (CR) was computed using the following equation26:

$${C_R}=\frac{{KW}}{{AtD}}$$
(2)

Where, K = 3.45 × 106,  t =  experimental time, A = area, W = mass loss of CS, and D = density in g/cm3.

A bath of water with thermostats was to be used for several testing at various temperatures.

Surface investigations

Numerous surface characterizations methods were applied to examine the characteristics of the CS surface. Energy dispersive X-ray (EDAX) and scanning electron microscopy (SEM) (ZEISS EVO) were used for analyzing the outermost layer of CS. UV–visible spectra were recorded using spectrophotometer (Shimadzu, Japan).

Results and discussion

Electrochemical studies

The Tafel polarization chart for CS in SFW solution containing varied avocado extract doses at 298 K is displayed in Fig. 1. The polarization tests showed that increasing the quantity of avocado extract alters both the cathodic and the anodic currents. The Tafel polarization data are presented in Table 1. The corrosion potential (Ecorr) data show no discernible trend. The variance in Ecorrvalues from the SFW solution containing the extract and the blank solution, which showed below 85 mV, confirmed the mixed type behavior of the avocado extract27. Since neither the cathodic Tafel slop (βc) nor the anodic Tafel slop (βa) altered significantly, it is demonstrated that the incorporation of avocado extract into the corrosion environment had no effect on the mechanisms controlling the anodic and cathodic reactions28. The addition of avocado extract leads in an enormous reduction in the corrosion current density (jcorr). This implies that avocado extract suppresses CS anode oxidation in SFW solution29. The inhibiting power (ηj%) of the avocado extract was estimated employing the following equation30:

Fig. 1
figure 1

Tafel polarization chart for CS in SFW solution containing varied avocado extract doses at 298 K.

Table 1 Electrochemical parameters and inhibition efficiency of CS in SFW as a function of avocado extract concentrations at 298 K.
$${\eta _\text{j}}\% =\frac{{{j_{\text{c}\text{o}\text{r}\text{r}(0)}} - {j_{\text{c}\text{o}\text{r}\text{r}}}}}{{{j_{\text{c}\text{o}\text{r}\text{r}(0)}}}} \times 100$$
(3)

where jcorr(0) was measured in the absence of avocado extract.

Avocado extract’s inhibitory ability rises with concentration, attaining its maximum peak (92.4%) at 100 mg L−1. These findings demonstrate avocado extract’s substantial inhibitory activity on CS corrosion in SFW solution.

Avocado extract are rich in polysaccharides, proteins, lipids, vitamins, minerals, and other bioactive substances that can form a protective film on metal surfaces31. These films act as a physical barrier between the CS and corrosive agents present in the SFW, preventing direct contact and reducing corrosion rates. The film may also undergo self-healing if damaged, further enhancing its protective properties32. If a film is damaged and the underlying metal exposed, the organic compounds of the avocado extract in the surrounding area will move to cover this newly exposed area, thereby ‘healing’ the film. This process is facilitated by the inhibitor’s chemical affinity for the metal surface. Active compounds in avocado extract can adsorb onto the CS surface, forming a protective layer. These compounds may contain functional groups such as hydroxyl, carboxyl, or amino groups, which can interact with the CS surface through electrostatic or chemical bonding33,34,35. The adsorbed layer inhibits the access of corrosive species to the CS, reducing corrosion rates.

EIS may provide important details on the corrosion process and the performance of the avocado extract. The Nyquist plot for CS in SFW solution at 298 K using various avocado extract concentrations is shown in Fig. 2. There are two capacitance circuits in the Nyquist portion. The corrosion process can involve multiple simultaneous reactions, such as dissolution and passivation, which can lead to non-ideal behavior and result in a more complex impedance response. Appropriate analysis of the given impedance data involves the use of comparable circuit types. The electrode-electrolyte contact is the site of several electrochemical reactions that are represented by the circuit parts in these models. The Nyquist plots were fitted with an electrical equivalent circuit (EC), as shown in Fig. 3. In the EC, the resistance of the solution is denoted by Rs, the resistance during the adsorption film by R2, and the resistance of charge transfer by R1. Furthermore, the two constant phase components that make up the EC are Q1 and Q2, which represent the double layer and the associated high and low-frequency adsorption layer, respectively. It’s also crucial to recognize that two constant phase components (Q1 and Q2) have been employed in place of two real capacitors in order to achieve a more precise EC. Table 2 displays the EIS components that were obtained based on the EC fitting. The goodness of fit (χ2) is kept below 10−3, which is significant. Once avocado extract has been added, an inhibitory adsorption covering creates over the surface of the CS in the SFW solution, which is responsible for the increase in R2 and decrease in Q2. The addition of avocado extract into SFW solution results in a significant drop in Q1 and an increase in R1, indicating a decreased corrosion rate for the avocado extract. Using the following formulas, the inhibitory efficacy of avocado extract is calculated from EIS data (ER%):

Fig. 2
figure 2

Nyquist record for CS in SFW solution with different concentrations of avocado extract at 298 K.

Fig. 3
figure 3

The equivalent circuit for fitting of the impedance data.

Table 2 EIS parameters and inhibition efficiency of CS in SFW as a function of avocado extract concentrations at 298 K.
$${E_\text{R}}\% =\frac{{{R_1} - R_{1}^{0}}}{{{R_1}}} \times 100$$
(4)

where R01 was measured in the absence of avocado extract.

The best inhibition value (ER% ~ 92.4% - see Table 2) obtained at a very modest dosage of 100 mg L−1 avocado extract are able to, in reality, be quite excellent when taking into consideration literature statistics for comparable plant extract inhibitors.

Weight loss studies

Chemical method were used to assess the weight loss rate and degree of resistance for CS corrosion in SFW solution with and without the avocado extract at 298 K, as shown in Table 3. The following formula was adopted to calculate the ηW% inhibitory power of avocado extract against the corrosion24:

Table 3 Weight loss parameters and inhibition efficiency of CS in SFW as a function of avocado extract concentrations at 298 K.
$${\eta _\text{W}}\% =\frac{{{C_{\text{R}0}} - {C_\text{R}}}}{{{C_{\text{R}0}}}} \times 100$$
(5)

where CR0 was measured in the absence of avocado extract.

Table 3 illustrates the CR and ηW% at different doses of avocado extract. When the amount of avocado extract increases, the magnitude of CR goes down. The reduction of CR when Avocado extract content increased implies a higher surface protecting of the CS by means of avocado extract compounds. The highest inhibitory effectiveness (ηW%= 94.7) was detected around a concentration of 100 mg L−1 avocado extract.

Effect of temperature and thermodynamic studies

The stability of a corrosion inhibitor at elevated temperatures is crucial for long-term effectiveness. Some inhibitors, including plant extract-based ones, may undergo thermal degradation or decomposition at higher temperatures36. This degradation can lead to a decrease in inhibitor concentration and a loss of inhibitory properties. It is important to assess the stability of the corrosion inhibitor at the intended operating temperature range to ensure its sustained performance. Table 4 demonstrates the CR and ηW% for CS as a function related to temperature (298 to 333 K) in SFW solution both with and without avocado extract (100 mg L−1). The results demonstrate that as the temperature rises, the CR of CS in SFW solution and SFW solution with avocado extract rises.

Table 4 Corrosion weight loss parameters for CS in SFW free or containing 100 mg L−1 of avocado extract as a function of temperature.

The adsorption of avocado extract onto CS surface and the formation of protective film can be influenced by temperature. Higher temperatures may enhance the adsorption or film formation process, leading to improved corrosion protection. However, excessive temperatures can also weaken the adsorption or destabilize the formed films, compromising their protective ability37. The ηW% declines with increasing temperature (Table 4), indicating a physisorption process38. The finding that increasing temperatures had little effect on ηW% implies that the avocado extract can be regarded as an effective inhibitor, particularly at high temperatures.

Thermodynamic parameters are often considered to assess the effectiveness of an inhibitor and its interaction with the metal surface and corrosive environment. The activation energy (Ea) represents the energy barrier that must be overcome for a chemical reaction to occur39. The standard enthalpy change (∆H*) represents the heat energy exchanged during a chemical reaction. The standard entropy change (∆S*) describes the degree of disorder or randomness of a system40. The parameters of thermodynamics have been derived using Eqs. 6 and 741.

$${C_R}=A{e^{\frac{{ - {E_\text{a}}}}{{RT}}}}$$
(6)
$${C_R}=\frac{{RT}}{{Nh}}\exp (\frac{{\Delta {S^ * }}}{R})\exp (\frac{{ - \Delta {H^*}}}{{RT}})$$
(7)

(A = constant; h = 6.6261 10−34 m2 kg s−1; N = 6.2022 1023 mol−1; R = gas constant).

An Arrhenius diagram (Fig. 4) was used for determining the Ea, either with or without the 100 mg L−1 avocado extract. The addition of avocado extract causes the Ea to increase from 13.8 kJ mol−1 (blank solution) to 51.6 kJ mol−1. A higher Eavalue implies a more significant inhibition effect, as the inhibitor increases the energy barrier required for the corrosion process42. Avocado extract molecules’ superior physical adsorption has been attributed to this43.

Fig. 4
figure 4

Arrhenius chart of CS in SFW solution with and without 100 mg L−1 of avocado extract.

The transition diagram was utilized to determine the parameters of ΔH* and ΔS* (Fig. 5). The addition of avocado extract causes the ΔH* to increase from 11.2 kJ mol−1 (blank solution) to 49.0 kJ mol−1. The endothermic nature of CS oxidation in SFW solution can be detected by the positive value of ΔH*44. The ΔS* varied little, from − 189 J mol−1 K−1 (blank solution) to −96 J mol−1 K−1. Furthermore, the rise in H2O entropy due to H2O de-sorption across the CS surface with the addition of avocado extract may be attributed to the change in ΔS*from a negative value in the blank solution to a minimized negative value in the avocado extract solution42.

Fig. 5
figure 5

Transition chart of CS in SFW solution with and without 100 mg L−1 of avocado extract.

Adsorption isotherm studied

The Langmuir isotherm is a model used to describe the adsorption behavior of avocado extract compounds onto a CS surface. The Langmuir isotherm equation is given by45:

$$\frac{{C_{{{\text{inh}}}} }}{\theta } = \frac{1}{{K_{{{\text{ads}}}} }} + C_{{{\text{inh}}}}$$
(8)

where:

θ is the fractional surface coverage or adsorption density,

Kads is the Langmuir constant or equilibrium constant, and.

Cinh is the concentration of the avocado extract in solution.

Figure 6 shows Langmuir isotherm as derived from weight loss data. The Langmuir constant (Kads) represents the affinity of the adsorbate for the adsorbent surface and is related to the strength of the adsorption. The experimental data follows a linear relationship, where correlation coefficient (R2) is close to one, it suggests that the adsorption process of avocado extract on the CS surface adheres to the assumptions of the Langmuir model. Furthermore, the physical adsorption characteristics of the extract are demonstrated by the low Kads a magnitude of 0.024 L mg−146.

Fig. 6
figure 6

Langmuir isotherm plots for adsorption of avocado extract on CS surface in SFW solution at 298 K.

Surface studies

Figure 7 (a) shows the SEM of CS before exposure to SFW solution. Prior to exposure to SFW solution, the polished CS surface exhibits parallel characteristics, indicating sanding scratches. A SEM image of CS following immersion in SFW without of avocado extract is displayed in Fig. 7(b). After contacted to SFW solution, the upper layer of the CS that has been seriously damaged by CS dissolve, as shown by the image of the CS surface in SFW (Fig. 7b), leaving the CS’s surface covered with several holes and cracks. The chemical interaction between the SFW solution and the surface layer of CS results in the creation of CS-oxide. O, Cl, and Fe are all present in the related EDAX (Fig. 7b), which shows that corrosion on the surface of the CS produces iron chloride and CS oxides. However, adding 100 mg L−1 of avocado extract to the SFW solution (Fig. 7c) greatly lowered its aggressive behavior and prevented the CS surface from corroding. This was demonstrated by the CS surface being noticeably smoother and almost completely covered with SFW extract compounds. The related EDAX (Fig. 7c) revealed the existence of O, N, C, and Fe and the lack of Cl. It implies that the components of the avocado extract attach onto the surface of the CS.

Fig. 7
figure 7

(a) SEM of CS before exposure to SFW solution, (b) SEM/EDAX of CS in SFW solution and (c) SEM/EDAX of CS in SFW solution containing 100 mg L−1 of avocado extract.

Figure 8 shows UV–visible spectra of SFW solution containing 100 mg L−1of avocado extract, before and after immersion of CS for 168 h. Prior to immersion, peak values at 235 and 354 nm corresponded to the π-π* and n-π* electron transitions of C = C and C = O bonds, respectively47. The extent of the peaks declined considerably along with shifting after 168 h of immersion of the CS electrode in SFW solution containing 100 mg L−1 of avocado extract, implying that the extract’s compounds adsorb on the CS surface, lowering the total amount of organic compounds in the solution being tested. These data imply the creation of an adsorption between the components of the avocado extract and the surface of the CS sample.

Fig. 8
figure 8

UV–visible spectra of SFW solution containing 100 mg L−1 of avocado extract, before and after immersion of CS for 168 h.

Conclusions

The study’s findings typically lead to the following conclusions:

  1. 1)

    In this study, we investigated the effects of avocado extract on the corrosion resistance of CS in SFW solution. The results demonstrated that the addition of avocado extract significantly enhances the protective properties of carbon steel, effectively reducing corrosion rates compared to untreated specimens.

  2. 2)

    The phytochemical constituents of the avocado extract, including natural inhibitors, contributed to the formation of a protective layer on the steel surface, which mitigated the corrosive effects of the saline environment.

  3. 3)

    Weight loss examination, SEM/EDAX, UV–visible spectra and electrochemistry tests were used to evaluate the avocado extract’s anti-corrosion properties.

  4. 4)

    The inhibitory potential of avocado extract increases with concentration and is greatest (94.7%) at 100 mg L−1.

  5. 5)

    As the temperature rises, the corrosion inhibition efficacy gradually decreases, suggesting a physisorption mechanism.

  6. 6)

    The electrochemical tests, including potentiodynamic polarization and impedance spectroscopy, confirmed that the extract acts as a corrosion inhibitor, with improved performance observed at higher extract concentrations.

  7. 7)

    Due to the greater activation energy of avocado extract, CS corrosion begins to decline down when it is present.

  8. 8)

    The positive value of ΔH* indicates the endothermic mechanism of CS oxidation in SFW solution.

  9. 9)

    The isotherm of Langmuir adsorption was determined to be the most accurate description of avocado extract adsorption on CS surface.

  10. 10)

    This study highlights the potential of using natural extracts, for enhancing the corrosion resistance of carbon steel in challenging environments like salty formation water. Future research may focus on optimizing the concentration and application methods of the extract to maximize its protective effects and exploring its applicability in other corrosive settings.