Introduction

One of the major issues in the industrial process that contributes to rising manufacturing costs and, consequently, production expenses is corrosion of metals. Metals, especially steel and carbon steel, are frequently exposed to environments that encourage corrosive reactions, such as crude oil, seawater, and freshwater (Lieth et al. 2023). Acid pickling, acid cleaning, acid descaling, and oil refinery equipment cleaning are all common uses for acid solutions, particularly hydrochloric acid (Obot and Obi-Egbedi 2010; Ahamad et al. 2010). One of the most effective ways to prevent corrosion, particularly in acid solutions to stop metal dissolving and acid consumption, is to use inhibitors (Sykes 1990). It has been extensively researched in some depth how to use synthetic organic chemicals including oxygen, sulfur, and nitrogen to lessen corrosion attack on steel (Bentiss et al. 2012; Wang 2001; Lagrenée et al. 2002; Nabah et al. 2018; Tayebi et al. 2014; Benhiba et al. 2020; Saranya et al. 2020; Schmitt and Olbertz 1984). However, these compounds can be costly, hazardous, and difficult to acquire on an industrial scale. The use of inexpensive, powerful substances with little or no environmental damage was the driving force behind the development of eco-friendly technologies in the twenty-first century.

Natural elements like fragrant plants have recently been included as inhibitors in the creation of new environmentally friendly cleaning products (Abdel-Gaber et al. 2008). The majority of naturally occurring products are safe, environmentally benign, easily available, and renewable sources of corrosion inhibitors. Plant extract is an economical and environmentally friendly option as a corrosion inhibitor. As such, its main benefit is both economic and environmental. To date, many plant extracts have been successfully used as corrosion inhibitors for iron and steel in acidic environments, for example, henna (Ostovari et al. 2009), Damsissa), Mentha pulegium (Bouyanzer et al. 2006), olive (El-Etre 2007), Phyllanthus amarus (Okafor et al. 2008), Occimum viridis (Oguzie 2008, 2006), lupine (Abdel-Gaber et al. 2009), Lasianthera africana (Eddy et al. 2009), Strychnos nux-vomica (Raja and Sethuraman 2009), Justicia gendarussa (Satapathy et al. 2009), Oxandra asbeckii (Lebrini et al. 2011a), Ferulaassafoetida (Behpour et al. 2011), and coffee (Torres et al. 2011). The presence of complex organic species, such as tannins, alkaloids, nitrogenous bases, carbohydrates, proteins, and hydrolysis products, which are found in these extracts, is often credited with the efficiency of plant extracts as inhibitors. These organic compounds, which primarily operate as adsorption sites, are typically identified by the presence of polar functionalities comprising elements like oxygen, nitrogen, or sulfur. They could also have aromatic rings, conjugated triple or double bonds, or both in their molecules.

In the present study, we have opted for the use of fruit extract of Citrullus colocynthis for the enhancement resistance corrosion of carbon steel in 1 M HCl environment. Indeed, the Citrullus colocynthis plant also known as bitter apple is largely cultivated in tropical Asia and Africa for its edible seeds and fruits that are not only rich in protein and oil but also have potential pharmacological benefits due to its utility as antidiabetic (Khatri et al. 2021), anti-inflammatory (Bhasin et al. 2020), antioxidant, antiepileptic, analgesic (Kumar et al. 2008), antimicrobial properties (Hussain et al. 2014), and antifungal agent (Eidi et al. 2015). The plant extract is also used to treat diseases like jaundice, mamilities, and urinary disorders (Li et al. 2022). Citrullus colocynthis oil was investigated as a biocide against phytoparasitic nematodes (Tarraf et al. 2019). In addition, Citrullus colocynthis fruit extract has been used as a reducing agent to prepare MgO nanosheet catalyst for the biofuel production from green tea extract (Khan et al. 2022). To the best of our knowledge, there are only few reports on the anticorrosion activity of Citrullus colocynthis, in particular, on the performance of ethanolic seed extract on C38 steel (Al-sharabi et al. 2022), seed oil extract on mild steel (Doumane et al. 2023), and methanolic fruit extract on copper (Al-Dokheily et al. 2014). Indeed, the study of addition of Citrullus colocynthis ethanolic seed extract against corrosion of C38 steel in 1 M HCl has been performed using only the experimental approach (AC impedance and potentiodynamic polarization (PDP)) (Al-sharabi et al. 2022). The inhibition efficiency of this extract was 55.1% at 500 ppm after 6 h of immersion in corrosive solution. The second work concerns the amelioration of corrosion resistance of mild steel using Citrullus colocynthis seed oil extract (essential oil) in 1 M HCl medium (Doumane et al. 2023). The main components of this essential oil are three fatty acids (palmitic, oleic, and linoleic acids). The inhibition performance of this oil is 89.5% at 500 ppm after 0.5 h of immersion in 1 M HCl. The last one investigated the inhibitive effect of extract of Citrullus colocynthis fruits from Northwestern desert at Nasiriyah in Iraq on copper corrosion in H2SO4, NaCl, and NaOH solutions (Al-Dokheily et al. 2014). However, no data is available on fruit methanolic extract of Citrullus colocynthis (CCE) as a corrosion inhibitor of carbon steel (C-S) in acidic medium. Therefore, this study was carried out to investigate the inhibiting action of CCE by gravimetric method and electrochemical techniques such as potentiodynamic polarization and AC impedance. A number of tests, including scanning electron microscopy (SEM), contact angle measurement, Fourier-transform infrared spectroscopy (FTIR), and X-ray photoelectron spectroscopy (XPS), were also performed to clarify the CCE-induced corrosion inhibition mechanism. Finally, density functional theory (DFT) and molecular dynamics (MD) simulation were used to get a crucial understanding of how the major components of the CCE are suppressed at the molecular level.

Experimental

Materials

The substrates used in this study were carbon steel plates (Euronorm: C35E carbon steel and US specification: SAE 1035) provided by Weber Metaux with the following chemical composition (in wt%), C 0.370, Si 0.230, Mn 0.680, S 0.016, Cr 0.077, Ti 0.011, Ni 0.059, Co 0.009, and Cu 0.160, and the rest is composed of Fe (Zarrouk et al. 2015). The C-S sheets were first subjected to a polishing process following the ASTM E3 standard (Lieth et al. 2021) using various silicon carbide (SiC) abrasive papers with grain sizes of 400, 600, and 1200. They were then rinsed twice with distilled water, cleaned with acetone in an ultrasonic bath for 5 min, washed a third time with double-distilled water, and air-dried before being used. The specimen cleaning is based on ASTM E407-07 standard (Lieth et al. 2021).

All the chemicals (37% HCl) and solvents (absolute methanol and acetone) used in the research were of analytical grade, purchased from Sigma-Aldrich, and were used without purification.

Citrullus colocynthis fruit was harvested at Goulmim, Morocco, in March 2018, and deposited in the herbarium of the Faculty of Science Rabat (Morocco). The plant extract was prepared by refluxing 100 g of fruit of Citrullus colocynthis, dried and finely crushed, in absolute methanol for 4 h, then filtered, and the solvent is removed in vacuum to give the Citrullus colocynthis extract (CCE). The analysis of the obtained extract reveals the presence of various acids which are present in more or less important proportions. We note the presence of two majorities of amino acids given in Fig. 1, the first one corresponds to citrulline and the second corresponds to a heterocyclic amino acid nonproteic, specific of the family of curcubitace named β-(pyrazo-1-yl)-L-analine. These two majority free amino acids represent only about 40% of all the measured amino acids. They also noted the presence of alanine (5.9%), glutamic acid (5.3%), and asparagine and serine (about 3% each). Other amino acids are present in less important proportions or in state of tracks.

Fig. 1
figure 1

Chemical structures of the major constituents of Citrullus colocynthis fruit extract (CCE)

For the purpose of creating inhibitor solutions with concentrations ranging from 50 to 500 ppm, the CCE extract was appropriately diluted in 1 M HCl solutions. These 37% HCl grade analytical reagents were diluted with distilled water to create these 1 M HCl solutions.

Corrosion tests

The gravimetric tests were conducted according to the ASTM G1-03 protocol (ASTM 1990). First, the C-S specimens (1.5 × 1.7 × 0.3cm3) were weighed using a digital precision balance (XPR404S) and submerged in a solution of 1 M HCl electrolyte without and with the addition of varying amounts of CCE during the immersion period at 303 ± 1 K, using a thermostatic bath Lauda Proline P12. It is worth noting that each C-S specimen was hung to a glass rod inside an incubator in order to reduce the phenomena of crevice corrosion as explained by Lieth et al. (2021). The immersion time was set only at 6 h, on the one hand because CCE is used as a pickling inhibitor and on the other hand to compare with previous studies, using plant extracts, performed in the same conditions (Ostovari et al. 2009; Satapathy et al. 2009; El Hamdani et al. 2015; El Bribri et al. 2013). The C-S samples were removed following the exposure period, properly rinsed in distilled water, cleaned using an ultrasonic cleaner and acetone, dried at, and then weighed once more. The tests were carried out three times, and the average amount of weight loss was discovered. We computed the corrosion rate (CR) and the inhibition efficiency (ηWL), as was previously mentioned (Olivares et al. 2006).

In a typical Pyrex glass cylinder cell with three electrodes and a Solartron Instruments SI 1287 potentiostat, DC current measurements were made. The counter electrode is made of platinum, and the reference electrode is made of saturated calomel electrode (SCE). The polytetrafluoroethylene (PTFE)-coated disc that serves as the working electrode (WE) has a geometric surface area of 1 cm2 and was cut from the C-S under test. Before each electrochemical experiment, the electrochemical system was given 1 h to attain the stable open circuit potential (OCP). E = Eocp ± 200 mV DC data were scanned at a rate of 0.5 mV s−1 from the cathodic to the anodic direction. The tests were conducted using CorrWarr 2.80 software, which was also utilized to gather experimental data. Using a thermostat and a polymethyl methacrylate (PMMA) cell with a 1000-mL capacity, AC impedance studies were conducted. In order to expose 7.55 cm2 of its surface to the solution, a piece of C-S was cut to the same dimensions as the working electrode. After a 6-h immersion time, electrochemical impedance spectroscopy (EIS) measurements were completed, examining a frequency range of 105 to 0.01 Hz from the open circuit corrosion potential (Eocp), all with an amplitude of 10 mV. It should be noted that detailed discussions of DC and AC electrochemical processes have already been provided in another source.

Surface analyses

We employed scanning electron microscopy (JEOL 5300) to evaluate the surface state of the C-S substrate in the presence and absence of the CCE extract in a corrosive environment. The employed electron beam had a 6 kV acceleration energy.

The hydrophobic properties of the C-S surfaces (1 × 1 × 0.3 cm3) were determined by water contact angle measurements, which were performed using sessile water drop method using a DSA100 drop shape analyzer (Krüss, Germany). The pure deionized water is used as solvent. Contact angles formed by water at the surface of each sample were determined using the “Advance” software provided by Krüss. Data are representative of five different measurements on five droplets deposed randomly on the surfaces.

The attenuated total reflectance Fourier transform infrared spectroscopy (ATR-FTIR) spectroscopy was performed by a Nicolet iS50 FT-IR spectrometer in the 400–4000 cm−1 spectral range (resolution 4 cm−1, 64 scans). For this objective, FTIR spectra were recorded for CCE before and after adsorption of C-S substrate. OMNIC 9 software was used to record and analyze the FTIR spectra.

A Nicolet iS50 FT-IR spectrometer was used to create the reflected absorption FTIR spectra for the surface samples of CCE on C-S (64 scans, 4 cm−1 resolution, attenuated total reflectance, or ATR) mode. The FTIR spectra were gathered and examined using the OMNIC 9 program.

Thermo Scientific K-Alpha XPS system, XPS KRATOS, and AXIS UltraDLD spectrometer were used to register X-ray photoelectron spectroscopy (XPS) spectra. The abovedescribed methods were followed during the XPS tests and data management (Tourabi et al. 2013).

DFT and MD simulation details

Using the aqueous phase DFT approach, we conducted an inquiry to clarify the inhibitory mechanism of Citrullus colocynthis extract (CCE) on the surface of C-S (Abd El-Lateef et al. 2016). Additionally, this theoretical approach sought to correlate the chemical reactivity markers of CCE’s primary constituents, specifically the neutral and protonated forms of citrulline and β-(pyrazol-1-yl)-L-alanine, with the inhibitory efficacy of CCE as evaluated experimentally (EL-Hajjaji et al. 2020). DFT was used to investigate the optimal geometric structure and the electronic configuration of the investigated substances, this was done at the B3LYP/6-31G(d) level using Gaussian 09 and visualized with GaussView 5.0.9. (Kharbach et al. 2017). The ELUMO, EHOMO, ΔE(ELUMO − EHOMO) and electrons transported from occupied orbitals of organic molecule to unoccupied orbitals of metal surface (ΔN110). The Φ work function (Eq. 1) explains the theoretical value of global electronegativity (χ) in Fe (110) with Φ = χ(Fe110) = 4.82 eV, and the global hardness (η) represent the metallic bulk (η(Fe110)) = 0 eV) (Fergachi et al. 2018).

$${\Delta N}_{110}=\frac{{\chi }_{{Fe}_{110}}-{\chi }_{inh}}{2({\eta }_{{Fe}_{110}}+{\eta }_{inh})}=\frac{\Phi -{\chi }_{inh}}{2{\eta }_{inh}}$$
(1)

Using MD simulation, we investigated the interaction between the CCE/Fe (110) and CCE+/Fe (110) systems. Accelrys Materials Studio 8.0 software’s Forcite module was used to execute this simulation (Rouifi et al. 2020a; Materials Studio 2016). The interactions for studied system was carried out from a simulation box (22.34 * 22.34 * 35.13 Å3) with a 6-couche slab model in each layer representing a (9 × 9) unit cell. The constructed simulation box is emptied by 31.13 Å3. 500 water molecules (H2O), 5 hydronium ions (H3O+), 5 chloride ions (Cl), and the CCE in HCl solution filled the vacant area. The Andersen thermostat was used to keep the simulated system at 303 K, with a simulation time of 600 ps and a time interval of 1.0 fs, all while using the COMPASS force field (Andersen 1980).

Results and discussion

Evaluation of corrosion inhibition properties

Weight loss study

The weight loss method was used to determine the inhibitory efficiency (ηWL), reported in percent (%), and the corrosion rate (CR), expressed in mils per year (mg cm−2 h−1), after 6 h of immersion in 1 M HCl at 303 K, as previously described. When CCE was added to the acidic environment, CR steadily decreased as inhibitor concentration grew, but ηWL rose, reaching its peak level of protection at 500 ppm of CCE (shown in Table 1). This behavior might be caused by the C-S forming a protective layer of CCE on its surface, which would prevent direct contact with the electrolyte. In fact, the Cinh augmentation can raise protection levels while sharply reducing CR levels.

Table 1 Corrosion rate and inhibition efficiency values of CCE /C-S system in 1 M HCl at 303 K

Several earlier studies (Singh et al. 2012; Miralrio and Vázquez 2020; Zakeri et al. 2022) investigated the use of plant extracts as inhibitors to stop C-S corrosion in a 1 M HCl solution. On the basis of the literature that was analyzed in relation to our work, pertinent material was discovered; its facts are summarized in Table 2. In a 1 M HCl solution, Citrullus colocynthis extract (CCE) demonstrated to be a particularly potent inhibitor. In comparison to the study’s chosen plant extracts, a significant inhibitory efficiency was seen even at lower doses (93.6% at 500 ppm) and over extended immersion times of 6 h.

Table 2 The ability of several plant extracts to prevent steel corrosion in 1 M HCl medium

Polarization curve study

We assessed the impact of the CCE inhibitor on the anodic and cathodic polarization properties of the C-S substrate in a 1 M HCl solution at 303 K using the Tafel method. Figure 2 displays the polarization curves that were produced. Table 3 lists the relevant kinetic parameters, such as the cathodic Tafel slope (βc), corrosion potential (Ecorr), and corrosion current density (icorr). The inhibition efficiency, ηTafel(%), was calculated using the icorr values, which were obtained by Tafel extrapolating only the cathodic polarization curve, which results in a longer and more clearly defined Tafel region (McCafferty 2005; Nadi et al. 2021).

Fig. 2
figure 2

Plots of C-S polarization in 1 M HCl solution in proportion to CCE concentration at 303 K

Table 3 Data on the polarization of C-S in a 1 M HCl solution in proportion to the CCE concentration at 303 K

From Fig. 2, it is clear that the Tafel curves displaced to the lower potential magnitudes after the introduction of CCE into the corrosive media. Further, with the addition of CCE to a 1 M HCl solution, both the anodic metal dissolution of iron and the cathodic hydrogen evolution reaction were suppressed. The suppression of both reactions became more intense with increasing CCE concentration. The low variations (25–32 mV) related to Ecorr after protection (less than 85 mV), as given in Table 3, pointed to the classification of the CCE as a mixed type inhibitor with predominant cathodic effectiveness (Ferreira et al. 2004). With Cinh enhancement, the icorr value considerably dropped, indicating that there were certainly less corrosion interactions since CCE molecules covered the active C-S spots. The parallel cathodic Tafel lines and modest fluctuations in βc in Fig. 2 indicate that the cathodic process, also known as the hydrogen evolution reaction, displays a sensitivity to controlled activation. At first, CCE molecules attach to the C-S surface and essentially prevent the reactive sites from reacting. As a result, less surface area is accessible for H+ ions, although the reaction's underlying mechanism is unaffected (Khaled 2003). With the addition of CCE concentration, the anodic region’s current densities reduced, which corresponded to a decrease in C-S corrosion rate and the development of an anodic protective coating made up of iron oxides and CCE molecules (Hassan et al. 2007). However, the shape of the anodic curves suggests that inhibition is only effective up to a potential of − 250 mV/SCE, which is equivalent to the desorption potential (Kharbach et al. 2017). This observation can be explained by the fact that at this potential, the rate of metal oxidation is almost equal to the rate of inhibitor adsorption to the surface. Higher potential values therefore favor the desorption of the inhibitor compound. Results showed that the polarization inhibition, ηTafel(%), rises with CCE concentration, peaking at 500 ppm (Table 3). The polariszation findings thus validate the weight loss results and provide more specific information regarding the inhibitory activity of CCE.

AC impedance study

The anticorrosion properties of CCE on C-S was also assessed by AC impedance technique and the obtained diagrams at open-circuit potential after 6 h C-S subjection to HCl solution are presented in Figs. 3 and 4. According to evidence from Nyquist graphs, the plot diameter was clearly increased when the CCE concentration in the HCl solution was increased (Fig. 3), revealing that the extract molecules considerably adsorbed on the C-S surface (Solmaz 2010), and as a result, the protection efficiency increased. One capacitive loop showed up in the Nyquist graphs, indicating that the corrosion process was being controlled by the charge transfer mechanism (Shih and Mansfeld 1989; Raistrick et al. 2005). From the Bode graphs (Fig. 4), similar conclusions can be made. In fact, the values of the global impedance modulus at 0.1 Hz (|Z|0.1 Hz) rose for the samples treated with CCE compared to the untreated sample (Fig. 4a), confirming an improvement in the C-S's protection. After adding 50, 100, 200, 300, 400, or 500 ppm of CCE, the values for |Z|0.1 Hz are, respectively, 73.2, 120.2, 229.9, 258, 2.91, 291.6, and 309 Ω cm2 (Fig. 4a). The Bode-phase plots’ one-time constant existence (Fig. 4b) demonstrated that the charge transfer mechanism contained the corrosion phenomenon (Raistrick et al. 2005). In addition, the maximum phase angle (αmax) decreases with CCE concentration enhancement, − 35° for uninhibited solution, and − 47°, − 54.3°, − 59.2°, − 60.1°, − 60.3°, and − 63.4°, after addition of 50, 100, 200, 300, 400, and 500 ppm of CCE, respectively.

Fig. 3
figure 3

Nyquist graphs illustrating the relationship between the concentration of CCE at 303 K and the amount of C-S in a 1 M HCl solution

Fig. 4
figure 4

Bode (a modulus and b phase) graphs for C-S substrate in 1 M HCl against CCE concentration at 303 K

The deviations from incomplete semicircles, on the other hand, show surface heterogeneities and/or inhibitor adsorption (Belghiti et al. 2016) (Fig. 3). According to Fig. 5, the equivalent electrochemical circuit (EEC) in question consists of a polarization resistor (Rp), an electrolyte resistor (Rs), and a constant phase element (CPE) in parallel. The resistances related to charge transfer (Rct), the resistance of the inhibitor film (Rf), and all other accumulating species (Ra) make up the polarization resistance (Rp) (Rp = Rct + Rf + Ra) (Ramezanzadeh et al. 2014). In order to eliminate the variation brought on by frequency dispersion, CPE was used in the EEC to replace the ideal capacity of the double layer capacitance (Cdl) (Zheludkevich et al. 2005). The following is a description of the impedance of CPE (ZCPE) (Zheludkevich et al. 2005):

$${Z}_{\text{CPE}}={Q}^{-1}+{\left(i\omega \right)}^{-\text{n}}$$
(2)

where n is an exponent related to the phase shift and can be used as a measure of surface irregularity, Q is the proportionality coefficient (in Ω−1 sn cm−2), ω is the angular frequency, and i is the imaginary number.

Fig. 5
figure 5

EEC utilized for modelling the interface C-S /1 M HCl solution/CCE

For all experimental data, this model provided a good fit. Figure 6 depicts Nyquist and Bode graphs of the experimental and simulated data for C-S in a 1 M HCl solution with 400 ppm CCE for clarification. It is obvious that the observed impedance graphs match the calculated impedance plots produced by using an analogous circuit model. Furthermore, the goodness of fit chi-square (χ2) values are quite close to 10–3 (Table 4), suggesting that the proposed circuit is valid.

Fig. 6
figure 6

a Nyquist and b Bode diagrams for C-S/1 M HCl + 400 ppm of CCE interface: (‣‣) experimental curves and (—) fitted data using EEC model

Table 4 EIS data of C-S electrode in 1 M HCl versus CCE concentration at 303 K

EIS parameters (Rs, Rp, Q, and n) derived by fitting the impedance plots are tabulated in Table 4. The ‘‘double layer capacitance” (Cdl) and the relaxation time constant (τ) of charge-transfer process were calculated using the Hsu and Mansfeld formula (Eq. 3) (Popova et al. 2007) and Eq. 4 (Lebrini et al. 2008), respectively:

$${C}_{\text{dl}}={\left({{QR}_{\text{p}}}^{1-\text{n}}\right)}^{1/\text{n}}$$
(3)
$$\tau ={C}_{\text{dl}}{R}_{\text{p}}$$
(4)

In the instance of the AC impedance research, the inhibition efficiency, ηZ(%), was calculated from the Rp values as previously reported (Popova and Christov 2006). Based on Table 4, the results showed that polarization resistance (Rp) rose noticeably as Cinh increased. As a result, ηZ(%) increased and peaked at 93.3% at 500 ppm of CCE after 6 h of metal exposure to the acidic solution. This agrees with the information gathered from measures of polarization and weight reduction. The extracted molecules adhere to the C-S exposed surface and block the active sites that are susceptible to corrosion, increasing Rp values, which are correlated with the efficiency of corrosion inhibition. It should be mentioned that the increase in deflection parameter (n) values after the inhibitor’s introduction may be linked to a decrease in surface imperfections brought on by the components of the algae extract adhering to the surface of C-S (Popova and Christov 2006). The fact that the relaxation time constant (τ) increases as a function of the amount of CCE present further supports a progressive adsorption (Olasunkanmi et al. 2015). However, compared to untreated substrates (Cinh), admittance (Q) for protected substrates was much lower due to the displacement of CCE relative to water at the C-S interface. The substitution of previously adsorbed water molecules, which results in a decrease in the dielectric constant, may account for the significant decrease in Cdl as a function of CCE concentration (Popova et al. 2011). As a result, the extract molecules’ capacity for adsorption rises. This results in higher coverage and preservation of the metal from dissolution, which is supported by Table 4’s rise in inhibition performance with CCE concentration. Additionally, as demonstrated by the line in Fig. 7, the capacity declines linearly with surface coverage (θ = ηZ(%)/100). As previously noted by Martinez and Metikos-Hukovic (2003), this indicates that the capacitance contribution from the inhibitor-covered surface is primarily attributable to the flat-adsorbed molecules at low surface coverage. It is noted that this effect is less when the charge at the electrode surface increases due to the inhibitor’s activity, and the molecules change their orientation to align themselves perpendicular to the electrode surface. Due to the existence of lone pairs from heteroatoms (oxygen and nitrogen), and -orbitals, strong bondings of the CCE ingredients on the metal surface can in fact occur, obstructing the active sites and so slowing the corrosion rate. Additionally, the synergistic intermolecular effects of the several active components included in this organic extract may be responsible for the CCE’s inhibitory properties. Different aliphatic amino acids, such as citrulline, alanine, glutamic acid, asparagine, and serine, can cover large portions of the metal surface, effectively delaying the corrosion of C-S.

Fig. 7
figure 7

The double-layer capacitance as function of the surface coverage of C-S substrate using CCE as corrosion inhibitor

Surface characterizations

Scanning electron microscopy (SEM) was used to analyze how a Citrullus colocynthis extract (CCE) in a 1 M HCl solution affected the surface of C-S. A morphological comparison of the metal surface before and after 500 ppm of CCE addition is shown in Fig. 8. Only polishing scratches can be seen on the SEM micrograph of the naked C-S surface in Fig. 8a. Due to the harsh environment, the surface of unmodified C-S exhibits pits, scratches, and a significant amount of crystal grain erosion after 6 h of immersion in 1 M HCl solution (Fig. 8b). However, a smoother and less damaged surface is shown in the case of the C-S surface that was protected by CCE inhibitor, indicating the creation of an inhibitive layer on the C-S surface (Fig. 8c).

Fig. 8
figure 8

SEM pictures of the C-S surface show a the metal surface before polishing, b the metal surface after immersion in 1 M HCl for 6 h, and c the metal surface after immersion in 1 M HCl solution containing 500 ppm CCE for 6 h

The surface hydrophobicity of C-S electrodes after CCE treatment was assessed using contact angle measurements. Indeed, water contact angle measurements were exploited to evaluate the surface hydrophobicity of C-S surfaces without and with addition of different concentrations of CCE in 1 M HCl medium as shown in Fig. 9.

Fig. 9
figure 9

Images and measurements of the angle of contact were taken on the surface of carbonized (C-S) before treatment (1), after 6 h in an aggressive solution (HCl 1 M) without inhibitor (2), as well as following the addition of CCE at concentrations of 100 ppm (3), 200 ppm (4), 300 ppm (5), 400 ppm (6), and 500 ppm (7)

A typical hydrophilic nature is displayed by the bare sample, with a contact angle of 64°, which is consistent with the literature (Nadi et al. 2021; Saeed et al. 2019). However, after embedding in a strong solution (1 M HCl), the contact angle value drops to a value of 40°. The hydrophilic character of the surface and the development of oxidized polar groups are to blame for this outcome (Fe2O3, Fe3O4,…) upon acid immersion. The hydrogen links that form between the electrolyte and the substrate can be strengthened by the oxidized species, which promotes droplet spreading (Saeed et al. 2019). Contrarily, immersion in the inhibitive solution containing only 100 ppm of CCE results in a contact angle value of 86°, showing the presence of hydrophobic surface characteristics. With the increase of CCE concentration, this behavior is much improved, with a maximum contact angle of 128° at 500 ppm. It is evident that the addition of CCE causes the development of a hydrophobic organic layer, which is absorbed by polar functional groups, particularly N and/or O atoms. This result explains the observed decrease in metal corrosion because the layer serves as a barrier to the adsorption of corrosive species to the C-S surface. The contact angle’s behavior is consistent with the CCE’s ability to effectively suppress corrosion.

FTIR analysis was also performed in order to bring out the adsorption of the CCE molecules on the metallic substrate and the obtained spectra of CCE and C-S-surface after 6 h of immersion in 1 M HCl with 500 ppm of CCE are given in Fig. 10. The FTIR spectrum of CCE showed the presence of the characteristic bands such as O-H/N-H/C-H (3200–3500 cm−1), C-H (2924 cm−1), C = O (1709 cm−1), C = N (1636 cm−1), C = C (1458 and 1510 cm−1), C-N (1222 cm−1), and also C-OH (1052 cm−1) in extract molecules (Fig. 10a). Significant peak intensity reductions are observed for all groups following C-S exposure to corrosive liquid containing CCE molecules (Fig. 10b), demonstrating the importance of these groups in the CCE adsorption on C-S surface (Catauro et al. 2015). Additionally, the CCE/C-S surface spectra showed a minor shift in all of the absorption bands, indicating that interactions between CCE molecules and the C-S-surface (by C = O and/or C = N groups) had taken place and that the organic coating was primarily constituted of CCE molecules. However, the appearance of a new intense absorption band located towards 1596 cm−1can be attributed to Fe(OH)3 (iron hydroxide) particles presence over metallic surface. In low wavenumbers (600–700 cm−1), Fe-O peak was raised after C-S immersion providing that CCE-Fe chelation and/or Fe oxidation was occurred (Maciej Heneczkowski et al. 2001).

Fig. 10
figure 10

Infrared spectra of a) CCE, and b) adsorbed CCE on C-S electrode

The adsorption isotherms Langmuir, Frumkin, Temkin, Freundlich, etc. can all be used to determine the type of CCE adsorption.

$$\begin{array}{cc}\frac{{C}_{\text{inh}}}{\theta }=\frac{1}{{K}_{\text{ads}}}+{C}_{\text{inh}}& (\text{Langmuir})\end{array}$$
(5)
$$\begin{array}{cc}\theta =\frac{1}{f}\text{ln}\left({K}_{\text{ads}}{C}_{\text{inh}}\right)& (\text{Temkin})\end{array}$$
(6)
$$\begin{array}{cc}(\frac{\theta }{1-\theta })\text{exp} (2a\theta )={K}_{\text{ads}}{C}_{\text{inh}}& (\text{Frumkin})\end{array}$$
(7)

Surface coverage is denoted by θ, inhibitor concentrations by Cinh, molecular interaction constant by f, and equilibrium constant by Kads for the adsorption process. The surface coverage (θ) values were computed using the findings from the AC impedance investigation (Table 4). According to Fig. 11, the high linearity and small deviations (R2 ~ 1) show that the adsorption of CCE molecules in acidic solution follows a Langmuir-type model. Additionally, the high value of Kads (57 L g−1) suggests that CCE adsorption occurred spontaneously. According to (Boumhara et al. 2015), Kads is connected to the common Gibbs free energy of adsorption:

$${K}_{\text{ads}}=\frac{1}{{C}_{{\text{H}}_{2}\text{O}}}\text{exp}\left(\frac{-\Delta {G}_{\text{ads}}^{^\circ }}{RT}\right)$$
(8)

when 1000 g/L of water is present in the solution, T is the thermodynamic temperature, and R is the universal gas constant. \(\Delta {G}_{ads}^{^\circ }\) values of around − 20 kJ mol−1 or less often indicate physisorption, while \(\Delta {G}_{ads}^{^\circ }\) values of about − 40 kJ mol−1 or greater typically indicate chemisorption (Qian and Cheng 2019). Calculating the \(\Delta {G}_{ads}^{^\circ }\) value for the CCE inhibitor, however, is impossible because the molecular weight of the CCE extract’s constituent parts is unknown. When examining the use of plant extracts as corrosion inhibitors for C-S in acidic conditions, several publications made note of this restriction (Faustin et al. 2011, 2015; Lebrini et al. 2011b; El Hamdani et al. 2015).

Fig. 11
figure 11

Adsorption isotherm models are used to examine the adsorption of CCE on the surface of C-S in a 1 M HCl solution at 303 K

In general, physical and/or chemical adsorption are the two interfacial mechanisms that can cause C-S-inhibitor interactions. According to the literature, the C-S substrate’s negative charge in an acidic solution causes the pre-adsorption of chloride ions (Fiori-Bimbi et al. 2015). After then, electrostatic interactions between the protonated forms of CCE (Scheme 1) can easily occur, leading to physical adsorption (physisoption) (Kannan et al. 2016). In addition to this interaction, the π orbitals of the aromatic systems and the lone pairs in heteroatoms (nitrogen and oxygen atoms) facilitate the electron donation from CCE molecules, primarily citrulline and β-(pyrazo-1-yl)-L-analine, to iron empty d-orbitals, resulting in chemical interactions (chemisorption) (Berrissoul et al. 2020a).

Scheme 1
scheme 1

Formation of CCE cations in 1 M HCl medium

The Langmuir isotherm really turns out to be the best theory for understanding the adsorption of CCE molecules onto the surface of the C-S. This model assumes there is no interaction between the molecules adsorbed on the C-S surface and predicts the creation of a mono inhibitory layer of CCE on the C-S substrate (Elayyachy et al. 2006). The application of this paradigm to plant extracts is more difficult and uncertain due to the intermolecular interactions, both electronic and steric, between the numerous active components present in the extract under examination. This implies that the Temkin adsorption model, which features multilayer adsorption with interactions amongst the adsorbed species, may also be applicable to the adsorption of CCE on the C-S surface. It is interesting to note that the R2 value of 0.90 for the Temkin isotherm and the Langmuir isotherm are remarkably similar. The contact angle findings are consistent with this theory.

X-ray photoelectron spectroscopy (XPS) was used to investigate the CCE’s adsorption mechanism on the C-S surface. The findings of the XPS scan on the C-S substrate after 6 h of immersion in a 1 M HCl solution containing 500 ppm CCE are shown in Fig. 12. Figure 13 displays the XPS spectra for the C 1 s, N 1 s, O 1 s, Cl 2p, and Fe 2p core levels after deconvoluted fitting with Casa XPS software. Table 5 lists the binding energies (BE, eV) and associated percentages for each peak component, and these spectra demonstrate complicated structures. An elemental XPS study of the C-S surface following CCE treatment is also shown in Table 6.

Fig. 12
figure 12

The C-S sample’s XPS spectrum after being submerged in a 1 M HCl solution and receiving CCE treatment

Fig. 13
figure 13

XPS spectra that are in-depth show the adsorbed CCE layer that develops on C-S when it is submerged in a 1 M HCl solution at 303 K

Table 5 Findings from an XPS examination of the adsorbed CCE layer that develops on C-S after being submerged in a 1 M HCl solution at 303 K
Table 6 % of components on the C-S surface following CCE treatment

There are three unique parts to the C 1 s spectrum (see Fig. 13 and Table 5 for details). Aromatic C-C, C = C, and C-H bonds, as well as contaminating hydrocarbons, are linked to the initial component at 284 eV (Briggs and Seah 1990). Carbon atoms bonded to nitrogen in the C-N, C = N, and C-O bonds are responsible for the second, which has a mass of 285.3 eV (Kelemen et al. 2002). As shown in Scheme 1, the final component, which is situated at about 288.2 eV, can be assigned to the carbon atom of the C = O bond and/or perhaps to C-N+ (Watts and Wolstenholme 2003), as a result of the protonation of the NH2 group present in the molecules citrulline and -(pyrazo-1-yl)-L-analine.

Three different components at binding energies of 396.0, 399.7, and 402.6 eV were found in the N 1 s spectra after it was decomposed (see Fig. 13 and Table 5). In CCE molecules, N–C linkages can be connected to the first component (Lebrini et al. 2007). The N–N bond, the − N = structure, the NH2 group of CCE molecules, and the presence of the β-(pyrazo-1-yl)-L-alanine molecule are all responsible for the second component, which is by far the largest in terms of contribution (Olivares et al. 2006). The nitrogen, which is responsible for the final component, is protonated by the nitrogen in the amino group (-NH3+) and then undergoes oxidation. A positive charge is applied to the nitrogen atom during protonation, which changes the chemical makeup of the nucleus and raises binding energy (Moulder et al. 1992). Given that the C-S substrate under investigation is nitrogen-free (Bouanis et al. 2011), we can draw the conclusion that the N 1 s data point to chemical CCE molecule adsorption to the C-S surface. A nitrogen content of about 1.94% is also revealed by elemental analysis using XPS (see Table 6), which raises the possibility that coordination (N-Fe bonding) via the − N = structure may have contributed to this outcome.

Two peaks at 529.6 and 531.2 eV were found by deconvolution of the O 1 s component, as illustrated in Fig. 13 and noted in Table 5. In Fe2O3 oxides, the O2− ion is coupled to Fe3+ and is responsible for the first peak (Temesghen and Sherwood 2002). The second peak, which makes up the majority of the spectrum (approximately 70%), is due in part to the oxygen found in the O-H, O-C, and O = C bonds found in CCE molecules (Lopez et al. 1991), as well as to the OH groups found in hydrated iron oxides such FeOOH (Temesghen and Sherwood 2002).

Three unique components may be seen in the Fe 2p3/2 deconvoluted XPS spectrum (see Fig. 13 and Table 5). Iron in the form of Fe0 is responsible for the first, which occurs at 706.6 eV, as was previously stated (Bouanis et al. 2016). The second, at 710.1 eV, is connected to Fe3+ (Mourya et al. 2015; Outirite et al. 2010), which denotes the creation of iron compounds such Fe2O3 and FeOOH. These findings are in line with what has been observed for the element oxygen (O 1 s). Due to the parameters of the experiment (use of HCl), the third component, at 713.6 eV, can be related to the Fe(III) satellite (Galtayries et al. 2006) and is also connected to the presence of FeCl3 on the surface of C-S (Sastri et al. 1996). The finding of the chlorine signal in the analytical spectrum (see Fig. 12) supports this theory. In fact, the Cl 2p1/2 and Cl 2p3/2 doublets in the core Cl 2p level’s spectrum exhibit spin–orbit splitting, and the Cl 2p3/2 peak in Fig. 13 has a binding energy of 198.5 eV, which, as previously indicated (Sastri et al. 1996), corresponds to the Cl–Fe bond in FeCl3. Contrarily, elemental XPS surface examination showed a low chlorine level (1.79%) at the exposed surface of the C-S, which may be related to the CCE’s protective effect.

According to the results of the XPS examination, chemical interactions are taking place between the CCE molecules and the surface of the C-S. Indeed, the adsorption of these molecules on the CS surface allows the formation of a barrier that protects the metallic substrate from the acid attack due to its high hydrophobicity and promotes the formation of a stable protective corrosion products layer on the CS surface.

Structure activity anticorrosion correlation

DFT calculations

We used the DFT procedure as a very important supplementary part to explain the reactivity of the studied molecules at the level of electronic behavior (Bouoidina et al. 2019). The optimized structures, FMO density (HOMO and LUMO) of two major constituents such as citrulline and β-(pyrazol-1-yl)-L-alanine of Citrullus colocynthis extract (CCE) under the neutral and ionized states are depicted in Figs. 14 and 15, respectively. The structures represented in 3D are well optimized and are found in the stable state with positive frequencies. The HOMO electron density distribution localizes onto the amide function and its surroundings, while the LUMO density covers the acid function and its surroundings for citrulline molecule. In this case, each part translates a donor motif (-HN-CO-NH2) and the other accepts (-CH2-CO2H) electrons. For the major constituent β-(pyrazol-1-yl)-L-alanine, FMO densities occupy the entire structure of this compound. This characteristic shows the distribution of many donor–acceptor active sites across the β-(pyrazol-1-yl)-L-alanine structure, indicating a significant potential for adsorption on the surface under investigation.

Fig. 14
figure 14

Optimized structures, FMO density (HOMO and LUMO) of two major constituents (citrulline and β-(pyrazol-1-yl)-L-alanine) of CCE under the neutral state

Fig. 15
figure 15

Optimized structures, FMO density (HOMO and LUMO) of two major constituents (citrulline and β-(pyrazol-1-yl)-L-alanine) of CCE under the ionized state

For the cationic versions of citrulline, it is evident that the HOMO (highest occupied molecular orbital) and LUMO (lowest unoccupied molecular orbital) densities are situated on the acid and amide groups, respectively. The combination of FMO (HOMO and LUMO) allows to foresee a total adsorption on the examined C-S surface. In the case of β-(pyrazol-1-yl)-L-alanine, we observe a total distribution of FMO on the molecular structure, which informs a total coverage of the iron surface (C-S).

The essential parameters of the global reactivity of major constituents, neutral and protonated, are compiled in Table 7. The electron donor capacity of these constituents is measured by EHOMO and ΔN110. The high values of these two descriptors imply that there is a more electron donor power (Benhiba et al. 2014). As noted in Table 7, β-(pyrazol-1-yl)-L-alanine neutral possesses a strong decoupling power to donate their electrons to unoccupied orbitals in the iron surface. This neighborhood behavior is supported by the low ΔE value of β-(pyrazol-1-yl)-L-alanine neutral which informs us that this compound is more reactive with the Fe surface (Obot et al. 2019). The electron acceptor capacity is judged by ELUMO, a more negative value reflects a high capacity to accept electrons (Rouifi et al. 2020b).

Table 7 Descriptors of two major constituents of CCE in the neutral and protonated forms

The donor effect by the major constituents had a more noticeable decrease after the protonation. On the other hand, the attracting effect was present with a very important intensity. This profile of donor/attractor enables to increase the chemical activity which is translated by the minimum value of ΔE of major constituent’s protonated.

Utilizing the molecular electrostatic potential (MEP) and Fukui indices (FI), zones of specialized reactivity can be evaluated (Olasunkanmi et al. 2016). For the first method, the regions represented by the red color are electron donors, while the areas represented by the blue color are electron acceptors (Berrissoul et al. 2020b). For the second analysis, the f ( −) and f ( +) functions are represented as the electron donor (electrophilic attacks) and attractor (nucleophilic attacks) centers, respectively (Rahmani et al. 2019). Figure 16 shows the distribution of molecular electrostatic potentials (MEPs) over the structure of the main constituents, which are both neutral and charged. Surface analysis of the unprotonated form reveals that the O (10) atom for citrulline and the N (3) and N (4) atoms for β-(pyrazol-1-yl)-L-alanine are electron donors. These atoms can form coordination bonds with the surface of the metal. The blue colour appeared in the whole structure of the protonated forms, which shows that there is an attractive effect of electrons preventing from the iron atomic surface.

Fig. 16
figure 16

MEP distributions onto the structure of the neutral and protonated of two major constituents of CCE

Fukui indices of major compounds neutral and charged are collected in Tables 8 and 9. The data analysis in Table 8 shows that N (8), C (9), and O (10) atoms are electron rich (f ( −)). These locations make it easier for citrulline to bind to the C-S-surface. However, the C (2), O (3), and O (4) atoms have a tendency to receive electrons. It was found that protonation leads to a decrease of the donor capacity, but it increases in the case of an attractive effect. Concerning the β-(pyrazol-1-yl)-L-alanine and its protonated form (Table 9), we quote the atoms which are electron donors C (2), N (3), and N (4). Then, the atoms C (9), O (10), and O (11) are electron acceptors. In the same way, protonation implies a decrease of electron donating power and increased with the attractor effect.

Table 8 Active centers determined by the Fukui method of neutral forms of citrulline
Table 9 Active centers determined by the Fukui method of protonated forms of β-(pyrazol-1-yl)-L-alanine

MD simulation study

In this part of the simulation, we explored the adsorption behavior of the associative effect of the neutral and protonated major constituents in relation to the simulated iron surface (Fe (1 1 0)) in the acidic medium HCl. Figures 17 and 18 represent the best configurations of associative affect absorption of two major components under the neutral and protonated states on Fe. The observations drawn show that the combinations [citrulline + β-(pyrazol-1-yl)-L-alanine] neutral and [citrulline + β-(Pyrazol-1-yl)-L-alanine]+ adsorb by all their structures on the first simulated iron layer. In this case, there is a better coverage of the surface, which shows that the major constituents of CCE extract effectively protect the C-S surface against the corrosion phenomenon caused by corrosive ions in 1 M HCl medium. The interaction (Einteraction) and binding (Ebinding) energies of simulated systems are calculated as (El yaktini et al. 2018):

Fig. 17
figure 17

Best configurations (side view (left) and top view (right)) of associative affect absorption of CCE under the neutral state onto Fe (1 1 0)

Fig. 18
figure 18

Best configurations (side view (left) and top view (right)) of associative affect absorption of CCE under the protonated state onto Fe (1 1 0)

$${E}_{\text{interaction}}={E}_{\text{total}}-{E}_{\text{surface}+\text{solution}}-{E}_{\text{inhibitor}}$$
(9)
$${E}_{\text{binding}}=-{E}_{\text{interaction}}$$
(10)

The calculated values of Einteraction and Ebinding of CCE/Fe(1 1 0) and CCE+/Fe(1 1 0) are − 1234.34, 1234.34, − 1182.309, and 1182.30 kJ mol−1, respectively. According to the negative and positive values for Einteraction and Ebinding, respectively, CCE and CCE+ spontaneously interact and adsorb vigorously. This demonstrates that the chosen compounds have numerous active sites dispersed across their structures, which strengthens the defense of the treated C-S against corrosive chemicals (Laabaissi et al. 2019; Murmu et al. 2019).

Conclusions

The fruit methanolic extract of Citrullus colocynthis (CCE), based on citrulline and β-(pyrazo-1-yl)-L-analine molecules as active components, presented a good skill to inhibit the corrosion process of CS substrate in 1 M HCl. The gravimetric measurements showed that the inhibition efficiency of CCE increased with inhibitor concentration attenuating a value up to 93.6% at only 500 ppm. The polarization potentiodynamic study revealed that CCE acts as a mixed-type inhibitor, affecting both metal dissolution and hydrogen evolution. The AC impedance results demonstrated a drop in Cdl values and a rise in Rp, when the CCE was added to the corrosive medium, due to the adsorption of CCE on the C-S surface. The adsorption of the CCE molecules on the C-S surface followed the Temkin adsorption model. SEM, contact angle assessment, and FTIR results supported the adsorption hypothesis and the XPS study has highlighted that the adsorption mechanism of CCE inhibitor is mainly due to chemisorption. A good relationship was obtained between the quantum chemical studies (DFT and MD simulation) and the experimental results.