Introduction

Even though agricultural and organic wastes, such as bean husks (Vicia faba peel), are categorized as environmental pollutants, these materials may be put to use to solve a variety of issues, such as preventing corrosion in several different kinds of steel. Because plants are rich sources of bioactive metabolites, traditional systems of folk medicine have relied heavily on a variety of plants for the treatment of a wide range of conditions ever since ancient times1. The secondary metabolites of plants and animals are created by metabolic pathways and are present as small components of plant tissues. The types of secondary metabolites and the amounts of those secondary metabolites in various regions of the plant vary greatly2. The Vicia faba bean, often known as the faba bean, is a member of the legume family (Fabaceae) and is considered a vital food and fodder legume crop across the globe3. In the year 2010, it was stated that the Faba bean vegetable, which is cultivated primarily as a spring crop in China, India, South America, Middle-Eastern Europe, and the Mediterranean region, is considered to be the primary source of nutrition for plants, particularly within the River population4,5. The waste of fruit and vegetable peels, which may be found in both commercial and domestic kitchens, is responsible for a significant amount of nutrient and economic loss as well as environmental difficulties6. The indigestible parts of fruit and vegetables that are thrown away contain valuable high amounts of phytochemical constituents and essential nutrients such as carotenoids, enzymes, polyphenols, oils, vitamins, and a wide variety of other compounds. These compounds are present in peels, seeds, and other constituents of vegetables and fruits that are commonly used7. Identification of seventeen compounds (85.97%) by GC/MS analysis of hexane extract of faba bean peels, as well as identification of seventeen phenolics and sixteen flavonoids by the HPLC analysis of the ethyl acetate fraction of the V. faba peels. GC/MS analysis of hexane extract of faba bean peels. Additionally, two flavonoid substances were extracted from the skin of the fruit8. Utilization of these wastes has been shown in numerous studies as a means of reducing environmental pollution and deriving advantages from the components that constitute their waste: they include medical and industrial benefits, in addition to investigations into their chemical make-up. The bioactive compounds of fruit peels are an important applicable source in a variety of industries, including the food industry for the development of edible films, the food industry for the production of probiotics, the cosmetics industry, the textile industry, the pharmaceutical industry, and various other industries for the production of valuable products. The low-cost horticulture wastes might be employed as a unique stage in the process of generating the value-added product as part of its sustainable usage. Corrosion of metals is a significant issue that affects many different businesses and is estimated to cost billions of dollars each year. This issue also has economic repercussions. The use of certain additives that are safe for human health to minimize the corrosive attack of solutions to the contacted metallic materials is one of the most efficient strategies to avoid metal corrosion and reduce the corrosive attack of solutions to the contacted metallic materials9. More attention has been paid to the search for environmentally friendly corrosion inhibitors and to the study of plant extracts as a means of resolving issues that have been brought about as a result of the high cost, high toxicity, and high environmental risk posed by synthetic chemical corrosion inhibitors. Because of their cheap cost, biodegradability, high availability, and non-toxic nature, inexpensive and ecologically friendly plant extracts might be employed as corrosion inhibitors10. In addition, these plant extracts are environmentally beneficial. The purpose of this study was to investigate the phytochemical constituents of various extracts of Vicia faba peel, as well as their inhibiting effect on corrosion using electrochemical techniques, surface characterization using SEM&EDS, and assessment of their biocidal activity. Additionally, the study aimed to evaluate the phytochemical constituents of different extracts of Vicia faba peel.

Corrosion overview

Problems of essential importance, resulting in large economic losses on a global scale, are brought on by corrosion11,12,13,14,15. Pure metals undergo an electrochemical reaction when exposed to a salty media, which results in the formation of chemically more stable compounds such as oxide, hydroxide, or sulfide16,17,18,19. This makes the process thermodynamically plausible and since it is useful in a wide variety of technical applications, mild steel is used in many different industries, including the automotive, aerospace, petroleum production and refining, maritime application, chemical, and military sectors20. In a solution containing 3.5% NaCl, the metal loss is rather considerable in a short amount of time, and we can gravimetrically assess very fast whether or not an inhibitor effect is there21. It is crucial to examine structural materials that are exposed to outside conditions, particularly in saline media, where corrosion is substantially more severe than in other environments. Mild steel is put to widespread use in industrial settings due to the ease with which it can be obtained, as well as its malleability, ductility, and high tensile strength. Because of their low cost, ease of use, and high level of efficacy, the use of inhibitors is one of the most effective and economical strategies to regulate the dissolution of metals22. Several different organic compounds, such as amines and their derivatives, macrocyclic compounds, open-chain aromatic Schiff bases, Mannich bases, and others, have been reported as potential inhibitors of corrosion; however, it is common knowledge that these compounds are extremely harmful to the environment23. Other organic compounds that have been reported as potential inhibitors of corrosion include several toxic compounds which have a bad effect on the environment24. The production of corrosion inhibitors that are less harmful to the environment remained a significant obstacle for current research directions. Several natural compounds have been evaluated as potential green corrosion inhibitors for mild steel in acidic and salty environments. Some of these natural products include tobacco, black pepper, lignin, and castor oil seeds. The natural product extracts were widespread around the globe, and it is safe and non-toxic for usage in saltwater and/or freshwater as a corrosion inhibitor for mild steel25. Additionally, natural product extracts were widely available. The research was conducted on the effectiveness of water and solvent extracts of natural products as corrosion inhibitors for mild steel pipes that were utilized and used in various corrosive conditions26. The temperature dependence of natural product extracts as a corrosion inhibitor as well as theoretical calculations that were supported by taking into consideration major chemical components as active corrosion inhibitors for comparison and correlations with the experimental data was considered to be the most important points of this research article. In this respect, the inhibitory activity of hexane and acetone extracts of (VF) function as anti-corrosion materials for mild steel specimens in 3.5% NaCl. These results were determined after the specimens were immersed in the test solution27. The classic electrochemical methods of OCP, PD, and EIS were used to conduct corrosion experiments, and the kinetic and thermodynamic process parameters were investigated at a range of temperatures. In addition, the findings from the experiment are associated with the analysis of the theoretical calculation, which provides compelling proof of the inhibitive effect28. Vicia faba (VF) extract is the name of the herbal product that was used in the formulation of the (VF) extracts, and the purpose of this work is to evaluate the inhibition performance of the (VF) extracts on the corrosion of mild steel in a 3.5% NaCl solution. This evaluation is based on an environmentally friendly approach. Fatty acids are the phytochemical that represents the most often found components of (VF). In comparison to several other published papers that have a natural origin, the chemical structure of the components of (VF) achieves a high level of success in meeting the requirements of corrosion inhibitors. In addition to this, the plant-based source of (VF) is regarded as a cost-effective source for corrosion inhibition methods, and the phytochemicals it contains are of moderate to complex molecular size and include a large number of potential active adsorption sites. Importantly, in this paper, we investigate the possibility of a dual-function work that would involve both the secure disposal of a cost-effective herbal source and its use in industrial applications as an environmentally friendly corrosion inhibitor. Both of these functions would be performed simultaneously. So, this study aims to identify the chemical constituents of different extracts of Vicia faba peels and evaluation of their activity as corrosion inhibitors on mild steel in a saline medium containing 3.5% sodium chloride29.

Material and methods

Materials

Plant material

In January 2021, the fresh fruit of the Vicia faba plant was procured from the many marketplaces located within the governorate of Sharkia in Egypt. It was then peeled, and the peels were let dry in the shade for ten days, switching positions each day. After the peels were fully dried, they were finely ground up for the extraction process and stored in bags that were sealed30.

Extracts, electrolytes, and inhibitors preparation

The dried powdered peels of (VF) (500 g) were individually defatted with n-hexane in a Soxhlet for two days until the solvent was exhausted. This produced an extract with a greenish tint. A part of this extract was filtered through fuller's earth to remove the colored pigments and produce an extract that was transparent and yellowish in hue. After the powdered peels had been defatted, they were extracted with acetone multiple times (4 × 400 ml). The solvents were evaporated at 35 °C under reduced pressure to afford the hexane and acetone extracts (5 g and 6 g respectively) which were analyzed using GC/MS31. Table 2 provides the GC/MS data of chemical structures of some of the most prevalent classified functional categories of (VF) extract active components. After diluting the extract with 3.5% NaCl, we were able to create test solutions with varying concentrations of (VF) extract. These concentrations were 50, 100, 150, and 200 ppm, respectively. The corrosive solution, which had 3.5% sodium chloride in it, was made by mixing laboratory grade, 98% sodium chloride from Sigma-Aldrich with distilled water. Different amounts of the inhibitor were added to the solutions of 3.5% sodium chloride that were made (50–200 ppm).

Analysis of metallic electrode

The nominal composition of the mild steel rod with a diameter of 1 cm that was employed in this investigation may be found in Table 1. To conduct electrochemical research, the mild steel was incised and sectioned using a Clarke power hacksaw and an ESM 700 excel shaping machine. This produced specimens of mild steel with an average length of one centimeter that was used as test specimens. Following the application of solder to cover copper wires used in electrical connections, the identical steel specimens were mounted over epoxy resin with a lay-open zone of 1 cm2. Emery paper of grades 100, 320, 600, 800, 1000, and 1200 was used to mechanically abrade the surface of the working electrode before any measurements were taken. This was done before any measurements were taken. Following that, the specimens made of mild steel were cleaned with distilled water and acetone, and then they were dried using warm airflow.

Table 1 elemental analysis results of mild steel sample by XRF.

After being cleaned and polished using emery paper numbered 400, 600, 800, and 1000, the electrodes were then degreased with acetone and allowed to air dry.

Methods

GC/MS analysis

The following are the parameters for the gas chromatography–mass spectrometry instrument that was used for the GC–MS analysis of volatile compounds in n-hexane and acetone extracts. This instrument was located in the Department of Medicinal and Aromatic Plants Research at the National Research Center in Dokki, Giza, Egypt. The instrument was a TRACE GC Ultra Gas Chromatograph, which was manufactured by THERMO Scientific Corp. in the United States. It was linked with a THERMO mass spectrometer detector (ISQ Single Quadrupole Mass Spectrometer). The GC–MS system has been built with a TG-5MS column that is 30 m long and has an internal diameter of 0.25 mm. The film thickness is 0.25 µm. The research was carried out using helium as the carrier gas at a flow rate of 1.0 ml/min and a split ratio of 1:10. The following temperature program was used throughout the process. At 60 °C for 1 min, then gradually increasing to 240 °C at a rate of 3.0 °C per min while maintaining that temperature for 1 min. Both the injector and the detector were maintained at 240 °C. In all, 0.2 µl worth of samples diluted in hexane at a ratio of 1:10 were injected. Electron ionization (EI) was used at 70 eV to get the mass spectra, and the spectral range used was 40–450 m/z. The majority of the compounds were identified by comparing their retention indices relative to C7–C44 (the n-alkane series), as well as by comparing their mass spectra fragmentation and retention times with those that were already reported in the Wiley spectral library collection and the NSIT library, in addition to the existing body of literature32. By comparing the mass spectra of the various components, the individual components have been identified33.

Electrochemical study

To carry out the electrochemical studies, a conventional 3-electrode cell assembly was used. This cell assembly is comprised of mild steel with a surface area of 1 cm2 that acts as a working electrode, Ag/AgCl (silver/silver chloride reference electrode), also known as the reference electrode, which is coupled to the cell on the exterior through lugging capillary, the tip of which was placed near the working electrode, and platinum mesh, which is the counter electrode30. The electrochemical study was carried out at room temperature using a corrosive medium consisting of a 100 ml solution of 3.5% sodium chloride that was maintained in a stirred state at a rate of 250 revolutions per min. To generate stable OCP, the cell assembly was agitated for 60 min before the polarization data was collected (open circuit potential). An estimate of EIS was also performed at 298 K at the frequency in the range of (100 kHz–10 MHz) with a magnitude of 4 mV peak to peak using AC signals at stable OCP. This estimation was carried out with the oscilloscope calibrated to OCP. CHI Instruments Electrochemical Workstation was used for carrying out electrochemical experiments, which included sweeping the potential between − 200 and + 200 mV from OCP at a scan rate of 0.001 Vs−1 (Model 660C). The Tafel extrapolation curve was used to get the values for corrosion potential (Ecorr) and corrosion current density (icorr)34. The inhibition efficiency was computed using the following Eq. (1)

$$\upeta \left(\mathrm{\%}\right)=\frac{{\mathrm{i}}_{\mathrm{corr}}^{0}-{\mathrm{i}}_{\mathrm{corr}}}{{\mathrm{i}}_{\mathrm{corr}}^{0}}\times 100$$
(1)

where i0corr & icorr represent corrosion current densities without and with inhibitors, respectively.

Surface characterization

After exposing the metal specimens to a medium containing 3.5% NaCl for 24 h, immersing them in blank circumstances, and having the presence of 200 ppm extract for each solvent, a scanning electron microscopy study was carried out to investigate the shape of the corroded surface. The microstructural pictures were acquired for samples of mild steel that had been submerged in a solution with or without 3.5% NaCl + 200 ppm extracts of hexane and/or acetone35.

Computational study

Density functional theory (DFT) with unrestricted spin using DMol3 as an implemented module in Materials Studio software (Accelrys Inc.) was applied. “GGA” Generalized gradient approximation of the “B3LYP” Becke3–Lee–Yang–parr level using 6-311G** basis set. The chemical reactivity parameters have been computed for AO and HERA, as; “S; softness (measurement of molecules' stability), η; hardness (reverse of softness), µ; molecules' chemical potential, χ; electronegativity (grabbing-electrons-power), μ− & μ+; electronic affinity transfer & accept respectively, ω− & ω+; molecule suitability for providing & gain an electron respectively, ωi; electrophilicity index (evaluating the relative strengths of electron donors and acceptors), ΔNmax = χ/2η (highest amount of electrons that can be exchanged in a chemical reaction), I; ionization-potential, A; electron affinity36.

Molecular dynamic (MD) simulations

MD can be simulated an adsorption behavior of Fatty acid inhibitor into a mild steel surface using the Adsorption-Locator-module (Materials studio). Fe (1 0 0) plane with simulation box (22.90 Å × 57.26 Å × 26.68 Å) was applied in the adsorption process simulation. “Eadsorption” interaction energy between Fe and Fatty acid inhibitors was equatorially represented “Eadsorption = Etotal − (EFe + Einhibitor)”, while “Etotal” total energy of crystal combined with inhibitor and Einh; inhibitor energy, E Fe; iron surface energy. The COMPASS force field was used to optimize the adsorption system37.

Legislation of experimental research

The collection of plant material complies with relevant institutional, national, and international guidelines and legislation. All authors confirm that all methods were carried out following relevant guidelines in the “Methods” section.

Results and discussion

Identification of chemical constituents of different extracts

The GC/MS analysis was used to identify the chemical constituents of the n-hexane and acetone fractions of the (VF) peel. The identification was accomplished through the comparison of their spectral fragmentation patterns with those of the available database libraries Wiley and NIST and/or published data in Adams38. Table 2 contains an inventory of the identified constituents for the extracts of both hexane and acetone and the results revealed that, the presence of fourteen and thirteen distinct chemical constituents, respectively as mentioned in Figs. 1 and 2. The results of hexane extract proved that 14 compounds were identified in which octacosane and tetratetracontane are the main compounds (27.41 and 19.82% respectively). The other identified compounds are mainly fatty acids and their esters as palmitic acid (11.7%) and ethyl palmitate (12.48%). For the acetone extract, thirteen compounds were identified with heptacosane as a major constituent (42.81%). Also, it was found that some fatty acids are present like lauric acid (5.42%), myrestic acid (5.90%), ethyl palmitate (3.64%), and methyl stearate (2.82%). These data were following reported results by Robert and Wynne39.

Table 2 GC/MS data of n-hexane and acetone fractions of Vicia faba peel.
Figure 1
figure 1

GC chromatogram of hexane extract of Vicia faba peel.

Figure 2
figure 2

GC chromatogram of acetone extract of Vicia faba peel.

Electrochemical studies

Studies of open circuit potential

Figure 3A,B illustrate, respectively, the variations in the OCP of the mild steel as a function of time when it was immersed in a 3.5% NaCl solution in the absence and presence of varying amounts of hexane extract Fig. 3a, and acetone extract Fig. 3b, respectively. The equilibrium potential was easily reached, which is equivalent to the free corrosion potential, also known as Ecorr, of the mild steel. The positive charge of the protonated inhibitor and the negative charge of the steel surface both contribute to the process of physical adsorption that takes place in an inhibited solution of 3.5% NaCl. When compared to the unfettered solution, the steady-state Ecorr value tends to drift toward higher positive values. According to Riggs, it is possible to classify a compound as an anodic or cathodic type inhibitor when the OCP displacement is at least 0.085 V concerning that which was measured for the blank corrosive solution40. This criterion must be met before the classification can be considered to be feasible. In contrast, the positive shift in Ecorr is more than 0.085 V when the examined extracts are present in the environment and acting as a corrosion inhibitor. According to the findings of the OCP, this improvement in Ecorr is judged to be a significant change that warrants a more appropriate categorization. According to these results, the examined extracts have the effect of lowering the anodic dissolution of iron as well as the hydrogen evolution reaction, and they also induce considerable changes in the values of OCP. Because of this, the two extracts might be considered to be inhibitors of the mixed type41. This behavior is in great shape, with a decent agreement with the potentiodynamic polarization observations.

Figure 3
figure 3

Representative the plots of open circuit potential versus time for mild steel in 3.5% NaCl solution without and with different concentrations (50, 100, 150, and 200 ppm) of (VF) (a) Hexane extract and (b) Acetone extract at 298 K.

Studies of potentiodynamic polarization

Potentiodynamic polarization is an essential electrochemical instrument for analyzing the many different types of electrochemical corrosion events that may take place on the surfaces of metals. At a temperature of 298 Kelvin, the potentiodynamic polarization measurements were carried out on mild steel in a solution containing 3.5% NaCl as the corrosive medium, both without and with varying concentrations of VF. The corrosion potential (Ecorr), corrosion current densities (icorr), anodic and cathodic Tafel slopes (βa and βc) for mild steel in 3.5% NaCl medium with and without hexane and/or acetone extracts are mentioned in Fig. 4a,b and reported in Table 3. The addition of extract to 3.5% NaCl solution retards both cathodic and anodic current densities in comparison to the blank saline solution, indicating a mixed-type inhibitive performance. Because the difference in the Ecorr in the inhibited solution is much lower than 85 mV, the two extracts are classified as mixed-type inhibitors with variance between each other. Potentiodynamic polarization and impedance techniques both have a small degree of disagreement with one another, which is to be expected given that a difference of (± 5) % is typically observed to exist between the results of various tests because experimentation involves a significant amount of variation42. Indeed, the values of corrosion potential (Ecorr, mV), corrosion current density (Icorr, in mA/cm2), anodic Tafel slope (βa, mV), and cathodic Tafel slope (βc, mV) have been deduced by extrapolating from the fitting of the linear Tafel segments of the polarisation curves see Table 3. The polarization resistance (Rp) could be calculated using the slope of the current density against the potential plot see Eq. (1). According to the findings, it has been concluded that the corrosion potential for mild steel in the absence and the presence of VF extract, is clearly shown that, upon increasing the inhibitor concentration, the corrosion current densities (Icorr) are proportionally decreased, implying that VF acts as an efficient inhibitor for mild steel corrosion under these conditions with a maximum inhibition efficiency of 97.84% and 88.67% at an inhibitor concentration of 200 ppm of hexane and acetone extracts, respectively. The results of this study have been presented in Table 2. The values of βa and bc shifted as a result of the progressive addition of the inhibitor, which caused the molecules of the inhibitor to adsorb on the surface of the metal and create a thin film of a protective layer. This caused the values of βa and βc to alter and in the presence of a VF inhibitor, it was discovered that the corrosion potential moved in the direction of a smaller negative potential. This is evidence that the adsorption of VF inhibitor across the surface of the metal inhibits both the anodic and the cathodic processes. VF may be categorized as a mixed-type inhibitor with predominant control of the anodic reaction in terms of adsorption mode. This is because the displacement of Ecorr values was less than 85 mV, and the resultant shift pointed in a more noble direction. The cathodic hydrogen reduction reaction is activation-controlled, and the addition of VF does not alter the mechanism of this process, as shown by the precise analysis of the data that was obtained, which revealed that the cathodic current potential curves give rise to parallel Tafel lines. This finding suggests that the addition of VF does not affect the mechanism of this process but it is noteworthy to notice that the polarisation resistance, or Rp, increases with an increase in the inhibitor concentration, which suggests that the inhibitor molecules have adsorbed on the active sites of the mild steel surface. Further investigation reveals that this phenomenon has been seen during the building of a covering barrier from the chemical elements of VF between the surface of the metal and the hostile electrolyte may be ascribed to the growing Rp values since this barrier protects the metal from further corrosion.

Figure 4
figure 4

Representative the curves of potentiodynamic polarization for mild steel in 3.5% NaCl solution without and with different concentrations (50, 100, 150, and 200 ppm) of (VF) (a) Hexane extract and (b) Acetone extract included sweeping the potential between -200 and + 200 mV from OCP at a scan rate of 0.001 V/s at 298 K.

Table 3 Potentiodynamic polarization data for mild steel in 3.5% NaCl solution without and with different concentrations (50, 100, 150, and 200 ppm) of (VF) hexane and acetone extracts at 298 K.

Studies of electrochemical impedance spectroscopy

Electrochemical impedance spectroscopy EIS was performed to validate the corrosion inhibition ability of VF on the mild steel surface. This was done to conduct a more in-depth analysis of the inhibition process. The findings were acquired from the electrochemical impedance spectroscopy data for the mild steel recorded at open-circuit potential after 30 min of immersion in 3.5% NaCl at 298 K with and without various concentrations of VF.

To determine the impedance characteristics of the mild steel/electrolyte interface in the presence of the blank solution as well as various concentrations of each extract, EIS was carried out. The Nyquist plots are mentioned in Fig. 5a,b, The Bode plots are mentioned in Fig. 6a,b, as well as Phase plots, are mentioned in Fig. 7a,b. The equivalent circuits for mild steel without extracts and with extracts are mentioned in Fig. 8a,b. According to the Nyquist plots, the impedance spectra exhibit single depressed semicircles with their centers beneath the real axis. This suggests that the corrosion process was regulated by charger transfer.

Figure 5
figure 5

Electrochemical Impedance Spectroscopy (EIS diagrams); Nyquist plots for mild steel in 3.5% NaCl solution without and with different concentrations (50, 100, 150, and 200 ppm) of (a) Hexane extract and (b) Acetone extract at OCP and 298 K.

Figure 6
figure 6

Electrochemical Impedance Spectroscopy (EIS diagrams); Bode plots for mild steel in 3.5% NaCl solution without and with different concentrations (50, 100, 150, and 200 ppm) of (VF) (a) Hexane extract and (b) Acetone extract at OCP and 298 K.

Figure 7
figure 7

Electrochemical Impedance Spectroscopy (EIS diagrams); Phase plots for mild steel in 3.5% NaCl solution without and with different concentrations (50, 100, 150, and 200 ppm) of (a) Hexane extract and (b) Acetone extract at OCP and 298 K.

Figure 8
figure 8

Equivalent circuit of fitting data of mild steel in 3.5% NaCl solution with (VF) (a) Hexane extract and (b) Acetone extract at OCP and 298 K.

These data provide credence to the hypothesis that the electrochemical solid/liquid contact has a non-ideal capacitive tendency in its behavior. In addition, the scale of the impedance diagram becomes larger as the concentration of VF rises, and as a direct consequence of this, the inhibitory effect grows as a result of the adsorption of inhibitor molecules on the surface of the metal It is interesting to note that the depressed semicircles are connected to a distinct departure from ideality at the interface and the consequence of the surface lacking uniformity and roughness, which is a phenomenon that is known as frequency dispersion. The non-ideal capacitive behavior in the experimental data fitting by the electrical equivalent circuit model was depicted by using a constant phase element (CPE). Generally, we were able to produce two capacitive loops, one in the high-frequency region and the other in the low-frequency range, both of which had a single time constant. The creation of a protective barrier layer at the metal/electrolyte interface may be inferred from the Nyquist plot (Fig. 8a,b), which reveals that the charge transfer resistance steadily rises with the addition of a larger concentration of each extract43. The amount of charge transfer resistance may be represented by the width of the semicircle in the Nyquist plot. When there is a higher concentration of the extract, there is a corresponding rise in the film's thickness. Due to a certain increase in the thickness of the protective layer, a decrease in the functional area of the surface of the electrode, and a decrease in the dielectric constant, the value of double-layer capacitance (Cdl) decreases when an inhibitor is added to a blank saline solution. Because of this, it may be deduced that the adsorption of VF molecules on the surface of the metal causes a reduction in the surface's heterogeneity. Concerning the double-layer capacitance (Cdl), the findings show that there is a drop in Cdl values following the addition of the VF inhibitor. This can be shown by comparing the results in an inhibitor-free solution to the results in an inhibitor-containing solution. This substantiates the hypothesis that a covering layer was formed on the surface of the electrode. This results in a lower value for Cdl. The value of Cdl can be calculated from the following Eq. (2).

$${\mathrm{C}}_{\mathrm{dl}}= \frac{{\upvarepsilon }^{0}\mathrm{\varepsilon S}}{\mathrm{d}}$$
(2)

where (ε0) is the permittivity of air, (ε) is defined as the dielectric constant for the solution, (S) is the functional surface area of the electrode, and (d) is the film's thickness. Since the reduction in the double-layer capacitance may be attributed to either a drop in the dielectric constant (e) or an increase in the interfacial layer thickness, particular focus is placed on the findings (d). Because of the adsorption of the inhibitor molecules on the surface of the mild steel, the reactive surface area has been reduced, which means that the corrosion process has been slowed down. This is the hypothesis that is the most probable to account for these findings. The Bode plot as well as the phase angle plot for mild steel in both the VF-free and VF-containing 3.5% NaCl solutions. Only one time constant is shown in the Bode plots, and that time constant's highest point is located at the intermediate frequency. This is evidence that the charge transfer procedures involve no other processes but relaxing. As the value of the variable of interest (VF) grows, the size of the Bode plots also does. These findings are brought about by the adsorption capacitance of the VF molecules, which rises as the concentration of VF in the solution increases. Because of the frequency dispersion of interfacial impedance, the slopes of Bode plots at intermediate frequencies (S) are not equal to − 1 at any point in the frequency spectrum. In the presence of the VF molecules, the slopes (S) values exhibit a behavior that is capacitive at intermediate frequencies, as shown by the fact that they move toward the negative sign. an increase in the phase angle values seen in the presence of VF molecules as compared to those observed in the blank solution is referred to as an extra explanation. As the volume fraction (VF) concentration grew, so did the phase angle values.

Because of the high adsorption capacity of VF molecules on the surface of mild steel, we may get the conclusion that the presence of VF molecules causes the surface of the mild steel to become smoother. This is because of the interaction between the VF molecules and the surface of the mild steel. The impedance behavior has been described via the use of a straightforward equivalent circuit when there is no inhibitor present, as illustrated in Fig. 8a,b, and another model of a straightforward equivalent circuit when each extract is present. Table 4 contains a listing of the electrochemical characteristics that may be found in the fitted equivalent circuit. Some of these parameters are Rs (solution resistance), Rct (charge transfer resistance), and Cdl (double-layer capacitance). The following Eq. (3) will be used to determine the effectiveness of inhibition44.

Table 4 Impedance data for mild steel in 3.5% NaCl solution without and with different concentrations (50, 100, 150, and 200 ppm) of hexane and acetone extracts at 298 K.
$$\upeta \left(\mathrm{\%}\right)= \frac{{\mathrm{R}}_{\mathrm{ct}}-{\mathrm{R}}_{\mathrm{ct}}^{0}}{{\mathrm{R}}_{\mathrm{ct}}}\times 100$$
(3)

Charge transfer resistance is denoted here by Rct and R0ct, respectively, depending on whether or not the selected extract is present. The following Eq. (4) is a possible relationship between the components of constant phase element (CPE) and Cdl

$${\mathrm{C}}_{\mathrm{dl}}= {\mathrm{Y}}_{0}^{1/\mathrm{n}}{\mathrm{R}}_{\mathrm{ct}}^{\left(1-\mathrm{n}\right)/\mathrm{n}}$$
(4)

where (Y0) is the CPE constant and (n) represents the extent of variation from the ideal behavior.

Microstructure and surface characterization

Figure 9a–d show images taken by a scanning electron microscope of the surface of mild steel after it has been subjected to a medium containing 3.5% NaCl in both the absence and presence of the various extracts. When the polished metal surface (Fig. 9a) was subjected to the blank saline solutions for 24 h without the presence of each extract (Fig. 9b), severe damage was discovered. However, after the addition of 200 ppm of hexane extract at an optimum concentration (Fig. 9c), the smoothness of the metal's surface significantly improved, indicating a reduction in the corrosive attack but in the case of 200 ppm acetone extract (Fig. 9d), it is notable that, the surface is moderately protected compared with the hexane extract. The effect that the roughness of the metal sample has on the adsorption process of metal inhibitors is something that may be readily seen via the use of SEM characterization45.

Figure 9
figure 9

SEM micrograph of mild steel surfaces before and after immersion for 24 h in 3.5% NaCl at 298 ± 1 K, (a) Polished mild steel sample, (b) In absence of inhibitor (blank), (c) in presence of 200 ppm from (VF) hexane extract (d) in presence of 200 ppm from (VF) acetone extract.

Effect of temperature on the inhibition efficiency

We investigated how the concentration of the (VF) extracts as well as the temperature influenced the effectiveness of the corrosion-inhibitory properties of the extracts. A variation in the inhibitory efficiency as a function of the concentration of hexane and acetone extracts is shown in Fig. 10a,b and can be seen to occur over a range of temperatures. As can be observed, the inhibitory effectiveness grows with increasing concentrations of both extracts, and this holds across all temperatures. The relationship of the inhibitory efficiency to the temperature of the electrolyte is shown in Fig. 11a,b for a variety of concentrations of (VF) extracts. It has been shown that the temperature harms the corrosion inhibition effectiveness of (VF) extracts, even when the content of the extracts remains the same. When the extracts of hexane and acetone are at greater concentrations, namely 200 ppm, the magnitude of the detrimental effect that temperature has on the effectiveness of the inhibition is reduced46.

Figure 10
figure 10

The effect of temperature on the inhibition efficiency of mild steel in 3.5% NaCl at the highest concentration (200 ppm) of (VF) extracts (a) Hexane extract and (b) Acetone extract.

Figure 11
figure 11

The effect of concentration on the inhibition efficiency of mild steel in 3.5% NaCl at the highest concentration (200 ppm) of (VF) extracts (a) Hexane extract and (b) Acetone extract.

Adsorption isotherms

Adsorption isotherm investigations were carried out so that the nature of the interaction between the species present in the (VF) extracts and the surface of the mild steel could be investigated. There are several adsorption isotherms, such as the Langmuir, Freundlich, and Temkin isotherms that may be used to characterize the connection between the amount of surface coverage and the number of species that have been adsorbed. It was discovered that the adsorptive interaction between two extracts followed the Langmuir isotherm47. The Eq. (5) that may be used to define the Langmuir adsorption isotherm is as follows:

$$\frac{{C}_{inb}}{\theta }=\frac{1}{{k}_{ads}}+{C}_{inb}$$
(5)

where (θ) is the surface covering degree, (Cinb) is the concentration of the utilized extract, and (Kads) is the adsorption equilibrium constant that was derived earlier through PD and EIS measurements.

When the Langmuir connection between Cinb/ and Cinb is plotted, the result is a significant straight line with a correlation coefficient of one and an average slope value of 1.35, as shown in Fig. 12a,b. Therefore, there is proof that the species that make up the extract ingredients are adsorbed without any side interactions occurring. Using the intercept of the Cinb/ against Cinb line in Table 5, we were able to compute the equilibrium constant for extract adsorption, which is denoted by the symbol Kads. As a consequence of this, the value of Kads was used to calculate the adsorption standard free energy (\({G}_{ads}^{o}\)) using the following Eq. (6):

Figure 12
figure 12

Representative the Langmuir isotherms for the adsorption of mild steel in 3.5% sodium chloride in the presence of (200 ppm) from (a) hexane and (b) acetone extracts.

Table 5 Adsorption isotherms parameters of hexane and acetone extracts.
$${ka}_{ads}=\frac{1}{55.5}\mathrm{exp}(-\frac{{\Delta G}_{ads}^{o}}{RT})$$
(6)

According to what is shown in Table 5, the values of \({G}_{ads}^{o}\) were calculated for the two extracts when they were used as a corrosion inhibitors at various temperatures. It can be shown that the high negative values of \({G}_{ads}^{o}\) are associated with the impulsive adsorption performance of extracts on the surface, and these values pertain to the steady state of the adsorbed layer. This phenomenon is indicative of the intense interaction that is taking place between the contents of the two extracts and the electrode surface48. The values of \({G}_{ads}^{o}\) up to 20 kJ mol−1 are linked with the electrostatic interaction of the charged compounds with the charged surface. The adsorption process, in this instance, is just a physical one. This is a common idea. The presence of chemical adsorption will be seen if the values of \({G}_{ads}^{o}\) are increased to be more than − 40 kJ/mol. As a result of the measurements that were taken, the values of \({G}_{ads}^{o}\) were determined to be stable at a value of − 31 kJ/mol in the temperature range of 298–333 K. This provides evidence that the adsorption of species by extracts of hexane and acetone are typical examples of physical adsorption. According to the findings, the interaction between the active cation of the extract ingredients and the charged centers on the electrode surface is what causes the adsorption of the species present in the two extracts, which is typically the cation. This interaction takes place physically and electrostatically49. The fact that the values of \({G}_{ads}^{o}\) are negative is a strong indicator of the spontaneous character of the adsorption of the extract species on the surface. Additionally, the heat of adsorption, denoted by the symbol \({H}_{ads}^{o}\), was calculated using the Van't Hoff Eq. (7):

$$\ln {\text{K}}_{{{\text{ads}}}} = - \frac{{\Delta {\text{H}}_{{{\text{ads}}}}^{{\text{o}}} }}{{{\text{RT}}}} + {\text{A}}$$
(7)

When the relationship between ln Kads and 1/T is plotted against one another, a straight line is formed, as can be seen, shown in Fig. 13. The slope of the resulting line has a value that is comparable to (\({H}_{ads}^{o}\)/R), and the adsorption heat value (\({H}_{ads}^{o}\)) is very close to the standard adsorption heat value following the methods for testing. The equation that must be used to calculate the standard entropy of adsorption, which is denoted by the symbol, \({S}_{ads}^{o}\), can be found in thermodynamics and reads as follows:

$$\Delta {\text{S}}_{{{\text{ads}}}}^{{\text{o}}} = \frac{{\Delta {\text{H}}_{{{\text{ads}}}}^{{\text{o}}} - \Delta {\text{G}}_{{{\text{ads}}}}^{{\text{o}}} }}{{\text{T}}}$$
(8)
Figure 13
figure 13

Representative the Temkin isotherms for the adsorption of mild steel in 3.5% sodium chloride solution in the presence of (200 ppm) from the (a) hexane and (b) acetone extracts.

Table 5 contains a compilation of the thermodynamic parameters that were determined, including, \({G}_{ads}^{o}\), \({H}_{ads}^{o}\), and \({S}_{ads}^{o}\). It can be observed that the '\({H}_{ads}^{o}\) value is negative (− 73 KJ/mole), which indicates that there is an effect caused by the adsorption of extracts on the surface. When one examines the values of (\({S}_{ads}^{o}\)) that are shown in Table 5, it becomes immediately apparent that the value of (\({S}_{ads}^{o}\)) has a negative sign (− 159.6 and − 146.2 J/mole/K)50. The negative signal of \({S}_{ads}^{o}\) may be associated with a medium that is dissolute, which is often shown to be an increase in disorder since the reactants are changing into efficient complexes. Moreover, the observed way may be explained by the replacement mechanism of more water molecules during the process of extracts being adsorbed onto the surface. This takes place throughout the adsorption process51.

Kinetic activation

In addition to the research into thermodynamics, a kinetic activation model is also an important tool that can be used to examine the mechanism of action of corrosion inhibition and explain the characteristics of the protective effect that (VF) extracts have at various temperatures52. To estimate the activation parameters of the corrosion, the Arrhenius equation was used, see Eq. (9):

$$\ln {\text{CR}} = \frac{{{\text{E}}_{{\text{a}}} }}{{{\text{RT}}}} \times \ln {\text{A}}$$
(9)

where (CR) stands for the rate of corrosion, (Ea) for the energy needed to activate, (R) for the constant of the gas, and (A) for the pre-exponential factor.

Figure 14a,b illustrate the Arrhenius plots illustrating the link between the logarithm of the temperature, or 1/T, and the CR. As can be observed, a linear behavior is produced, and the slopes of the straight lines are (− Ea/R); thus, the values of the activation energy (Ea) were measured in both the presence and absence of different concentrations of (VF) extracts. In addition, there is still another formulation for the transition state, which is outlined in Eq. (10) which is shown below53.

$$\ln {\text{CR}} = \frac{{{\text{RT}}}}{{{\text{Nh}}}}\exp \left\{ {\frac{{\Delta {\text{S}}^{*} }}{{\text{R}}}} \right\}\exp \left\{ {\frac{{ - \Delta {\text{H}}^{*} }}{{{\text{RT}}}}} \right\}$$
(10)
Figure 14
figure 14

Arrhenius plots for the corrosion of mild steel in 3.5% NaCl solution with several concentrations of (VF) (a) hexane and (b) acetone extract.

Avogadro's number (N), the activation entropy (S*), and the activation enthalpy (H*) are the terms that make up the equation. Plank's constant (h) is also one of the components. In Fig. 15a,b, the plots of ln CR/T vs 1/T for the (VF) extract as a corrosion inhibitor are shown for the reader's perusal. As a result of the fact that the slope of the produced lines is equal to (− H*/R) and the intercept is (lnR/Nh + S*/R), it is possible to estimate the values of H* and S*. The activation parameters for mild steel in sodium chloride medium have been obtained and displayed in Table 6. These values are determined at certain concentration ranges of the (VF) extracts as a corrosion inhibitor. According to the findings, the presence of (VF) extracts causes an increase in the activation energy while simultaneously causing a modest decrease in the activation enthalpy54. At the same time, the values of the entropy for the corrosion process dramatically increase. At a high concentration of (VF) extract contents, the energy of activation (Ea), which is the minimum amount of energy required to start a chemical reaction, reaches a value of 21 kJ/mol, whereas the value for the blank solution is only 16 kJ/mol. This indicates that the amount of energy required to start a chemical reaction is proportional to the concentration of the reactant. The physical adsorption process may be responsible for the rise in the Ea value that occurred as a result of the action of (VF) extracts as a corrosion inhibitor. According to a further explanation, the rising of the activation energy value can potentially be related to the progressive decrease in the adsorption process of (VF) extracts on the surface under the influence of heat55. This was cited as a possible reason since based on these events, when the adsorption process slows down, an increase in the desorption action of (VF) extract species takes place as the protection and dissolution systems reach a state of equilibrium. It was also discovered that the successive values of Ea and Ho as reported in Table 6 are altered in the same pattern, which is confirmation that the thermodynamic processes in question are shared by both systems56. The value of the activation entropies has been reported to be negative, which indicates that the activated complex is in the rate-determining stage and displaying combination rather than separation and this was discovered by specific monitoring57.

Figure 15
figure 15

Transition-state plots for mild steel corrosion in 3.5% NaCl solution with several concentrations of (VF) (a) hexane and (b) acetone extract.

Table 6 Activation energy parameters at different concentrations of hexane and acetone extract.

Theoretical assay

DFT theory using B3LYP/6-311G** was used for the computational study of the five fatty acids extracted from (VF). Figure 16 showed the optimized HOMO and LUMO and MEPs for the tested compounds. The chemical parameters were calculated using equations as reported and listed in Table 758.

Figure 16
figure 16

Structure optimization and FMOs obtained by distributions of (HOMO) and (LUMO) at the major constituents of (VF) obtained by DFT/B3YLB/6-311G** for AO and HERA.

Table 7 Calculated reactivity parameters for Fatty acid at DFT/B3YLB/6-311G**.

Stability inter and intermolecular interaction against Fe surface

"FMOs" frontier molecular orbitals analysis

HOMO and LUMO are known as "FMOs" and are defined by donating/accepting electrons, respectively, which may determine the path binding of fatty acid with a steel surface59,60,61. The FMO gap is used to measure a molecule's chemical reactivity and kinetic stability. Raising the inhibitor's HOMO energy and reducing the surface's LUMO energy improved (inhibitor-surface) stabilization62,63,64. EHOMO in the aqueous phase is higher than in the gas phase and the component is arranged in decreasing order as follows Palmitic acid > Palmitoleic > Myristic acid > Stearic (Table 7). The greater EHOMO value than ELUMO indicates a greater likelihood of losing valance electrons and a greater tendency to donate electrons toward the surface of iron, and more inhibition potency than the gas phase65,66,67. The HOMOs were localized over all carboxy groups in all tested fatty acids while LUMOs tagged over the aliphatic group (Fig. 16). The negative EHOMOs and ELUMOs indicated that the chargeable migrated from Fatty acid to the Fe surface, which was penetrated by the carboxylic centers.

“ESP” molecular electrostatic potential profile

In the adsorption process; ESP for the fatty acid inhibitors can identify of Fe adsorption site, by finding the balance between scattering and appealing interactions68,69,70,71. The scattering force (nuclei with “+” charge) signifies a blue color and caused electron donation power. The attractive force with (−) charge, is associated with electron-accepting and expressed as (orange, yellow, and red). The green color point to an intermediate potential value. ESP has been graphed for Fatty acid in (Fig. 16). The negative charges were allocated as follows: Myristic acid > Palmitic acid > Stearic acid > Palmitoleic acid. ESP surface's color variation showed the variation for their values. The highest negative region is related to high the efficacy of their penetration effect over the Fe surface.

Global chemical reactivity

The interaction between HOMOinhibitor and LUMOsurface has indirectly stabilized with an energy gap. The stability index for Fatty acid adhering to Fe surfaces was determined by ΔG. Fatty acid exhibited lower ΔG values in the gas phase than liquid phase, respectively. These values showed promising reactivity liquid phase (Table 8). Furthermore, ΔG related linearly with the soft-nucleophile and hard-electrophile. Thus, the molecule which has a little ΔG displayed promising softness properties, which are good inhibitors in acidic media72,73,74. The data obtained from (Table 8), demonstrated greater softness values in the liquid phase than in the gas phase. Also, we examined the number of electrons transferred from the inhibitor (donor) to the Fe (acceptor) by calculating the (μ− & ω−)75,76,77,78. The inhibition action increases by growing value for (μ− & ω−) which refers to the high ability for donating electrons by the inhibitor, respectively, and vice versa for (μ+ & ω+). The liquid phase exhibited a high capacity of the sharing electron than the gas phase. Besides, the highest electron amount transferred (ΔNmax) for the liquid phase (0.055–0.059) is more than the gas phase (− 0.28 to − 0.46), which supported the claimed experimental findings of high efficiency for Fatty acid in the liquid phase. The process of the electron contribution as a (Fe → inhibitor) is recognized as energy back donation. (ΔEBD), which determined the (Inhibitor-Fesurface) interaction. The higher ΔEBD in the liquid phase than in the gas phase displayed a promising penetration ability with higher inhibition efficiency for the liquid phase. The negative values of (ΔEBD, μ+, ω+) proposed that the (Fe → inhibitor) electron follows in the liquid phase are more favorable energy than gas phase (Table 8). These findings were consistent with the experimental data79,80,81,82.

Table 8 The calculated descriptors (kcal/mol) of Fatty acid on Fe (100).

Molecular dynamic (MD) profile

(MD) the simulation was performed to provide a better understanding of the (Inhibitor-Fe) interaction (Fig. 17). (Adsorption Locator Model) was utilized to recognize the ideal adsorption site for mild steel surface against Fatty acid inhibitors. Thus; the lowest inhibition energy was listed in (Table 8); as follows; total energy for the substrate, rigid adsorption energy (unrelaxed tested components which adsorbed on Fe metal), adsorption energy(rigid adsorption & deformation energies), (dEads/dNi) (Fe and Fatty acid inhibitors energy; where one of the inhibitors was removed), binding energy (the negative value of adsorption energy)83,84,85.

Figure 17
figure 17

Representative the side view of molecular simulations for the most favorable modes of adsorption mode for the inhibitors on the Fe (100) surface.

In the stable configuration (Fig. 17), Palmitoleic, and stearic acids were stabilized in parallel to the mild steel surface (100) plane, while Myristic and Palmitic acids were arranged in the plane to mild steel (100). In addition, the adsorption energy is arranged as Stearic > Palmitic > Palmitoleic > Myristic acids for (Table 8). This theoretical vision is in line with experimental findings. The located electron lone pair over O atoms of Fatty acid inhibitors caused high stability for coordination interaction (inhibitor → Fe). From (Fig. 17) we can observe that Fatty acid inhibitors can adsorb into the mild steel by the carboxyl group of Fatty acid inhibitors. Thus, will make a mild steel surface do not interact with the acid solution86,87,88.

Mechanism of corrosion inhibition

The presence of a significant ingredient of (VF) extracts obtained from hexane and acetone delayed the corrosion of mild steel in 3.5% sodium chloride. The mechanism of inhibition is catalyzed by the presence of two heterocyclic rings among the main ingredients. Nitrogen and delocalized pi electrons interact with the surface of the metal to generate a strong and shielding adsorption layer over the metal89,90,91,92. The presence of donor atoms, such as nitrogen, is the primary factor that determines the extent to which adsorption is impacted. Iron (Fe) has some empty d orbitals, which are happy to take the electrons that are being provided by the inhibitor. Because of the adsorption of chloride anions that are present in the NaCl solution, the surface of the metal becomes negatively charged. Because of this, it can draw near itself the protonated form of heterocyclic rings and heteroatoms. To create a chemisorbed layer, the neutral molecules that are present in the primary elements of each extract must first displace the molecules of water that are adsorbed to the surface of the metal. Inhibition of corrosion of mild steel by either extract in a solution containing 3.5% sodium chloride may be rationalized based on molecular adsorption93,94,95. These chemicals prevent corrosion by regulating the processes that occur during both the anodic and cathodic phases. According to what was covered in the section on adsorption isotherms, both extracts were chemically adsorbed on the surface of the mild steel. The extracts exist as protonated species in the saline solution that has been inhibited96,97,98. These protonated species are responsible for the reduction in the evolution of hydrogen as they adsorb on the cathodic sites of the mild steel. The adsorption of electrons on the anodic site occurs due to the presence of lone pairs of electrons on oxygen atoms and -electrons on benzene rings and heterocyclic compounds, all of which are found in both extracts. This results in a reduction in the anodic dissolution of mild steel99,100,101,102.

Conclusions

Different chemical components of Vicia faba peels were extracted using hexane and acetone, and their identities were determined in this research. Anti-corrosion protection for mild steel in 3.5% NaCl was achieved using the two extracts. Various electrochemical techniques, including open circuit potential (OCP), potentiodynamic polarization (PD), and electrochemical impedance spectroscopy (EIS), were used to study the corrosion behavior of mild steel in a salty environment (EIS). Inhibitors of both cathodic and anodic corrosion currents, as shown by the OCP, PD, and EIS curves, the two extracts are classified as mixed-type inhibitors. Based on the electrochemical readings, it was clear that the presence of two extracts improved the efficacy of the inhibition. This was because the electronic density of the inhibitor molecules increased as a result of the presence of benzene rings in the extracts' and molecules' primary components. Adsorption is responsible for the inhibition, and this adsorption has been shown to follow the Langmuir adsorption isotherm. The calculated Gibbs free energy of adsorption further supports a chemical basis for the adsorption. Corrosion of mild steel has been studied in a medium containing 3.5% NaCl, where the inhibitory powers of hexane and acetone extract (VF) have been analyzed. Electrochemical testing and scanning electron microscopy (SEM) analyses have been used in this study. Results from the trials show that 200 ppm of either the hexane or acetone extracts is optimal for maximum efficiency. Physisorption is the mechanism in play, as shown by the fact that G ads 0 equals − 10.71 kJ/mol and the Langmuir adsorption isotherm is respected. When inhibitors are present, Ecorr may move significantly; this variation demonstrates that the studied inhibitors are a composite of several types. If you look at the blank and then at the inclusion of the inhibitor, you'll see what I mean. Moreover, scanning electron micrographs (SEMs) demonstrate the greater activity of the protective layer barrier formed by inhibitors on the surface of the mild steel. The results of the theoretical study provide greater credence to the inhibitory performance seen here.