1 Introduction

Mild steel (MS) is being used extensively in both construction and engineering industries due to its low cost and workability. However, this is not without a disadvantage that it is easily corroded; particularly it suffers extensive damage in aggressive acid media. Several industrial processes like the removal of rust in the metal finishing industries, ore processing, cleaning of boilers, steel pickling, oil well acidizing, acid descaling, recovery of ion exchangers, and petroleum processing involve hydrochloric acid. The use of hydrochloric acid causes extensive damage to components of the metal. Use of corrosion inhibitor is one of the most important ways of prevention of corrosion [1,2,3].

An inhibitor is a substance which, when added to a corrosive environment reduces the attack on metal and brings down the metal loss. A large number of synthetic organic compounds are being used as inhibitors for a variety of purposes. Nevertheless, the use of synthetic organic compounds as inhibitor is being restricted because of the high cost and environmental issues like toxicity and their ill effects on human and animal life.

Plant extracts as natural organic inhibitors have received much more attention in recent years due to their high inhibitory efficacy which is due to the presence of alkaloids, flavonoids, tannins, and phenolic compounds [4]. A variety of plant extracts have been tried as a corrosion inhibitor for metal and metal-based alloys [5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]. We report here for the first time the use of Ruellia tuberosa Linn as an acid corrosion inhibitor for mild steel surface in the hydrochloric acid medium.

Ruellia tuberosa Linn (RT) is a botanical species belonging to the family Acanthaceae and its origin is Central America but has spread to several tropical countries including India. It grows often as a weed in the rainy season [23]. Previous phytochemical studies of this plant divulge the presence of steroids, terpenoids, long-chain aliphatic compounds, and flavonoids. In pharmacological studies, the aerial part extracts showed antioxidant, antinociceptive, and anti-inflammatory activities [24,25,26].

2 Experimental Details

2.1 Materials

The procedure for the preparation of the leaf extracts is similar to that our previous work [27]. Fresh RT leaves were collected in and around Gobichettipalayam area, Erode, Tamil Nadu, India. The leaves were cleaned with tap water, dried in shade, and ground to powder form. About 20 g of the powder was taken in a soxhlet and extracted with 300 mL of ethanol in 500 mL RB flask for about 10 h. The refluxed solution was filtered and the filtered liquor was evaporated to 50 mL on a water bath. The solution was evaporated and the dark green solid residue obtained (about 1.75 g) after complete drying was preserved in a desiccator. A stock solution of the ethanol extract of R. tuberosa Linn (ERT) was prepared by dissolving the required weight of the residue in ethanol. HCl (37%) and distilled water were used for preparing the aggressive solution (1 M) for all experiments in the absence and presence of 0.3–0.21 g/L of ERT. All the chemicals used in the present study were of analar grade.

2.2 Mass Loss Measurement

The mild steel sheets (composition (wt%): C 0.054%, Ni 0.006%, Mo 0.067%, P 0.015%, Si 0.010%, S 0.11%, Cr 0.031%, Mn 0.173%, Cu 0.006%, and the rest is Fe) of 1 cm × 5 cm × 0.24 cm with an area of 12.99 cm2 were used for the mass loss study. The surface of the specimens was abraded using different grades of emery papers (600, 800, 1000, and 1200 grades), degreased with acetone, dried, and kept in a desiccator. After weighing accurately (sensitivity of ± 0.1 mg), the specimens were immersed in 100 mL corrosive solution for specified periods of time. Then, the specimens were taken out, cleaned, dried, and reweighed. Each experiment was performed in triplicate to ensure reproducibility, and the mean values of mass loss were recorded. The following equations were employed to calculate the corrosion rate (CR) in mils per year (mpy), the percentage inhibition efficiency (%IE), and surface coverage (θ) [28]:

$${\text{CR}}\,{\text{(mpy)}}=(K\Delta W){\text{/}}\rho At$$
(1)
$${\text{IE}}=\left( {\left( {{W_{({\text{b}})}} - {W_{({\text{i}})}}} \right){\text{/}}{W_{({\text{b}})}}} \right) \times 100$$
(2)
$$\theta =\left( {\left( {{W_{({\text{b}})}} - {W_{({\text{i}})}}} \right)/{W_{({\text{b}})}}} \right),$$
(3)

where W(b) and W(i) are the values of weight loss without and with inhibitor, respectively, ΔW is the weight loss in gram, ρ is the density of coupon in g/cm3, A is the area of coupon in cm2, and t is the exposure period in hours.

2.3 Electrochemical Measurements

Electrochemical workstation, model CHI 608D of CH instruments, was used to carry out electrochemical studies. Electrochemical impedance spectroscopy (EIS) and potentiodynamic polarization (PDP) experiments were carried out in the three-electrode cell containing platinum mesh auxiliary electrode, saturated calomel reference electrode, and polished mild steel specimen with an exposed area of 0.9785 cm2 as working electrode. Surface preparation of the mild steel samples before electrochemical studies was made following the procedure described elsewhere [27]. Electrochemical studies were made in the 100 mL of the test solution in naturally aerated unstirred condition.

EIS measurements were performed at the open circuit potentials with the ac voltage amplitude of 0.005 V in the frequency range from 1 Hz to 10 kHz. The inhibition efficiency (%IE) was calculated from EIS data employing the following equation:

$$(\% {\text{IE}})=\frac{{{R_{{\text{ct(i)}}}} - {R_{{\text{ct(b)}}}}}}{{{R_{{\text{ct(i)}}}}}} \times 100,$$
(4)

where Rct(b) and Rct(i) are the charge transfer resistance values for the blank and inhibited solutions, respectively.

The polarization curves were generated potentiometrically in the range of − 0.250 to − 0.750 V using a scan rate of 0.01 V/s. Equation (5) was employed to obtain inhibition efficiency (%IE) from polarization data.

$$(\% {\text{IE}})=\frac{{{I_{{\text{corr(b)}}}} - {I_{{\text{corr(i)}}}}}}{{{I_{{\text{corr(b)}}}}}} \times 100,$$
(5)

where Icorr(b) and Icorr(i) represent the corrosion current densities of the uninhibited and inhibited solutions, respectively.

2.4 Fourier Transform Infrared Spectroscopy

Pure solid ERT and the products formed on the surface of the MS specimens after immersion in 1 M HCl with ERT for 3 h were analyzed by Fourier transform infrared (FTIR) spectroscopy (JASCO FTIR SPECTROMETER model—FT/IR-4600). The samples were pelleted using KBr.

2.5 Surface Analysis

The specimens used for surface morphology examination were polished, immersed in 1 M HCl in the absence and presence of ERT at 29 °C for 3 h, removed from the test solution, rinsed with distilled water, dried, and then subjected to the surface examination.

The analysis was performed using the field emission scanning electron microscope (FESEM) coupled with energy dispersive X-ray spectroscopy (EDXS) model ZEISS Sigma 5th version.

2.6 Gas Chromatography–Mass Spectrometry (GC–MS) Analysis

Gas chromatography–mass spectrometry (GC–MS) analysis was carried out using a THERMO GC—TRACE ULTRA VER: 5.0, THERMO MS DSQ II equipped with DB-35MS capillary standard non-polar column (30 m × 0.25 mm i.d.; film thickness 0.25 µm). The oven temperature was programmed from 75 °C (isothermal for 2 min), with an increase of 10 °C/min to 150 °C, 5 °C/min to 220 °C, 10 °C/min to 260 °C ending with a 10-min isothermal at 260 °C. Helium was used as a carrier gas at a flow rate of 1 mL/min in split mode 1:50 with an injection volume of 1 µL. Injector and detector temperatures were 250 and 280 °C, respectively. The ion source temperature was 220 °C.

Mass spectra were taken at 70 eV at a scan interval of 0.5 s over the m/z range 50–650 amu. Interpretation of the mass spectra of GC–MS was done using the database of National Institute Standards and Technology (NIST) having more than 62,000 patterns. The spectrum of the unknown component was compared with the spectrum of the known components stored in the NIST library to confirm the name, molecular weight, and structure of the components of the test materials.

2.7 Quantum Chemical Calculations

Complete geometrical optimizations of the selective ERT molecules were performed using density functional theory with the Becke’s three-parameter exchange functional along with the Lee–Yang–Parr non-local correlation functional (B3LYP) with 6–311G(d,p) basis set implemented in Gaussian 09 program package [29,30,31].

The quantum chemical parameters like energy of the highest occupied molecular orbital (EHOMO), energy of the lowest unoccupied molecular orbital (ELUMO), energy gap (ΔE = ELUMO − EHOMO), electron affinity (A), hardness (η), softness (σ), fraction of electron transferred (ΔN), and molecular electrostatic potential were calculated.

3 Results and Discussion

3.1 GC–MS Analysis of ERT

The GC–MS of ERT is shown in Fig. 1. Analysis of chromatogram shows that there are 30 individual components. The five prominent noticeable components are listed in Table 1. From the results obtained, it is evident that the separated compounds can be classified into hydrocarbons (Cetene), alcohols (Stigmasterol, Lupeol, Campesterol), and ester (hexadecanoic acid–ethyl ester).

Fig. 1
figure 1

Chromatogram of ERT

Table 1 Major chemical components in ERT from GC–MS analysis

3.2 Analysis of the FTIR Spectra

In order to characterize the adsorbed layer formed on the MS surface in the presence of ERT, an FTIR study was carried out. The FTIR spectra of crude, as well as scrapings from the inhibitor films on the surface of mild steel specimens immersed for 3 h in 1 M HCl containing 0.18 g/L of ERT, are presented in Fig. 2a, b. Analysis of Fig. 2a illustrates that there is a broad peak at 3373 cm−1 which is attributed to the O–H stretching. The appearance of bands at 2921 and 2852 cm−1 is due to asymmetrical –CH2 stretching vibrations. The band at 1633 cm−1 corresponds to C=O stretching. The bands at 1451 and 1377 cm−1 indicate the presence of C=C. The band at 1057 cm−1 is attributed to C–O–C asymmetric stretching vibration. The band around 669 cm−1 corresponds to C=O deformation [32]. The various peaks observed were related to different functional groups which indicated that the ERT extract contains a mixture of different groups of organic molecules. Figure 2b shows the FTIR spectrum of the scraped material. Comparison of Fig. 2a with Fig. 2b shows that the O–H stretching frequency is downshifted from 3373 to 3325 cm−1. The C=O group frequency is also changed from 1633 to 1648 cm−1. The C–O–C asymmetric stretching vibration has shifted from 1057 to 841 cm−1. The change in the vibrational frequencies of –C=O, C=C, and C–O–C suggests that the π electrons and the lone pair of electrons on oxygen are also involved in the adsorption phenomenon. Hence, it has been concluded that the inhibition of mild steel corrosion in HCl medium is due to the adsorption of ERT molecules on the mild steel surface.

Fig. 2
figure 2

FTIR spectra of samples a crude ERT and b the scrapped material from MS surface after immersion in HCl containing 0.18 g/L of ERT

3.3 Mass Loss Measurements

The mass loss method of monitoring corrosion rates (CR) and inhibition efficiency (IE) is beneficial because of its simple application and high reliability. Table 2 shows the CR and %IE for ERT in 1 M HCl at room temperature [(29 ± 1) °C]. The table also gives the data corresponding to the studies on the change in immersion time from 1 to 5 h. These data clearly signify that the %IE increases with increasing concentration of inhibitor from 0.03 to 0.18 g/L. At the inhibitor concentration of 0.21 g/L, the inhibition efficiency started decreasing and from this, the optimum concentration of the inhibitor was fixed. Further, at all the concentrations of the inhibitor, the %IE increases with increase in immersion time from 1 to 3 h. At the fifth hour, the %IE starts to decline. The increase of %IE with increasing the inhibitor concentration indicates more inhibitor molecules are adsorbed onto the surface of MS in 1 M HCl medium by the blocking of more corrosion active sites. At higher immersion period, desorption of pre-adsorbed inhibitor molecules occurs from MS surface resulting in the decrease in inhibition efficiency.

Table 2 Effect of concentration of ERT on the corrosion of MS in 1 M HCl from mass loss method

The effect of hydrochloric acid concentration (1–4 M) on MS corrosion was also studied. Figure 3 shows the effect of varying hydrochloric acid concentration on the %IE of ERT at room temperature. At all the dosages of inhibitor, increasing acid concentration resulted in increasing corrosion rate and decreasing %IE. This is due to the aggressiveness of the acid. The minimum %IE of 18.70% was obtained in 4 M HCl with 0.03 g/L of ERT.

Fig. 3
figure 3

Effect of acid strength on the corrosion of MS in 1 M HCl with ERT

3.4 Electrochemical Measurements

3.4.1 EIS Measurements

The corrosion behavior of MS in 1 M HCl solution in the absence and presence of different concentrations of ERT was investigated using EIS measurements. The Nyquist plot for MS in 1 M HCl without and with various concentrations of ERT is shown in Fig. 4. The depressed semicircles of the Nyquist plots are probably due to the heterogeneity of the metal sample which might be due to the increase in surface roughness, dislocations, distribution of the active sites, or the adsorption of inhibitor molecules [33]. The diameter of the semicircle is observed to increase as the ERT concentration increased. This is an indication of the fact that the inhibitor molecules are adsorbed on the surface leading to the formation of a protective film. This protective film reduces the corrosion active sites on the metal surface enhancing the corrosion resistance [34].

Fig. 4
figure 4

Nyquist plots for the corrosion of MS in 1 M HCl with various concentrations of ERT

The impedance data were analyzed using Randles equivalent circuit shown in Fig. 4, consisting of the solution resistance (Rs), in series connection with a parallel combination of charge transfer resistance (Rct) and double-layer capacitance (Cdl). The calculated EIS parameters Rct, Cdl with and without ERT in 1 M HCl, and %IE are summarized in Table 3. It is apparent from the data that Rct values increase and the Cdl values decrease with increasing the inhibitor concentration. The adsorption of ERT molecules on the mild steel surface decreases its electrical capacity because they displace the water molecules and other ions originally adsorbed on the surface leading to the formation of an insulated adsorption layer on the electrode surface which increases the thickness of the electrical double layer. This insulating layer formed by ERT molecules increases the charge transfer resistance. The adsorption of the inhibitor on the metal surface occurs due to the interaction between the lone pair of electrons and π electrons of inhibitor molecules and the vacant d-orbitals of iron atoms [35].

Table 3 Polarization and impedance data for the corrosion of MS in 1 M HCl in the presence of various concentrations of ERT

The effect of the acid concentration on the inhibition potential of ERT was studied by the EIS method using an optimum concentration of ERT in 1–4 M HCl (data not shown). The results clearly indicate that the %IE decreases with increasing acid concentration and the lowest %IE was observed with 4 M HCl.

3.4.2 PDP Measurements

The current potential relationships for MS corrosion in 1 M HCl solution with different concentrations of ERT were investigated through the polarization measurements, and the corresponding corrosion parameters such as corrosion current density (Icorr), corrosion potential (Ecorr), Tafel slopes ba (anodic) and bc (cathodic), and %IE are tabulated in Table 3. Tafel slopes were calculated by linear extrapolation of the cathodic and anodic branch of the polarization curves. Corrosion current was calculated from the slope of the polarization curve (ba and bc) and linear polarization resistance Rp using the Stern–Geary equation which is given below:

$${I_{{\text{corr}}}}=\frac{{{b_{\text{a}}}~{b_{\text{c}}}}}{{2.303\,({b_{\text{a}}}+{b_{\text{c}}})}} \times \frac{1}{{{R_{\text{p}}}}}.$$
(6)

The potentiodynamic polarization curves for mild steel in 1 M HCl in the absence and presence of different concentrations of ERT are shown in Fig. 5. It is apparent from the polarization curves that the values of anodic and cathodic Tafel slopes decreased with the addition of the inhibitor. This result suggests that the addition of the inhibitor reduces anodic dissolution and also retards the hydrogen evolution reaction. The polarization results in Table 3 clearly indicate that corrosion current density decreases and %IE increases with increase in the concentration of the inhibitor. This is due to the geometric blocking of the active sites on the metal surface. The data in Table 3 also show that the slopes of the anodic (ba) and cathodic (bc) Tafel lines decrease notably upon the addition of ERT. Thus, the process of inhibition occurs due to the adsorption of inhibitor which blocks the active sites for both anodic and cathodic processes [36].

Fig. 5
figure 5

Tafel plots for the corrosion of MS in 1 M HCl with various concentrations of ERT

Further, according to Riggs [37], if the displacement in corrosion potential is more than ± 85 mV with respect to the corrosion potential of the blank, the inhibitor can be considered as distinctive cathodic or anodic inhibitor. If the shift is < 85 mV, then it is called as a mixed type inhibitor. By inspecting the results in Table 3, it is obvious that the corrosion potential of MS is shifted 4–19 mV in the negative direction compared to that of blank indicating that ERT act as a mixed type inhibitor predominantly controlling the cathodic reaction.

PDP experiments were carried out by varying the strength of acid from 1 to 4 M with and without the optimum concentration of ERT (data not shown). An increase in the concentration of acid leads to a decrease in %IE due to the aggressiveness of the acid. The results obtained from the EIS and PDP are in good agreement with those obtained from mass loss measurement.

3.5 Temperature Studies and Thermodynamic Parameters

To evaluate the nature of adsorption of ERT and activation parameters of the corrosion process of MS in 1 M HCl medium, weight loss measurements were carried out in the temperature range of 303–343 K, and in the absence and presence of different concentrations of ERT for 1 h immersion time, and the data obtained are shown in Table 4. It is clear from the table that the increase in temperature increases the mass loss of the metal in the corrosion medium. Higher temperature favors higher reactivity of the active constituents of the corrosion medium which increases the rate of chemical reactions and hence decreases the %IE.

Table 4 Effect of temperature on the corrosion of MS in 1 M HCl from mass loss method

The correlation between the corrosion rate and the temperature is given by the Arrhenius equation:

$$\log {\text{CR}}=\log A-\left( {{E_{\text{a}}}{\text{/}}2.303{\text{ }}RT} \right),$$
(7)

where CR is the corrosion rate, Ea is the apparent activation energy, R is the molar gas constant (8.314 J/mol/K), T is the temperature in K, and A is the frequency factor. The Ea values can be determined from the slopes of Arrhenius plots (log CR vs. 1/T) (Fig. 6).

Fig. 6
figure 6

Arrhenius plots for the corrosion of MS 1 M HCl with ERT

$${E_{\text{a}}}{\text{/(}}2.303{\text{ }}RT{\text{)}}={\text{slope}}.$$
(8)

The activation energy (Ea) values are enumerated in Table 5. Ea values are higher for an inhibited solution than those for the uninhibited one, indicating a strong inhibitory action of ERT by increasing energy barrier for the corrosion process. This is an indication of spontaneous adsorption of inhibitor molecules on MS surface and is attributed to physisorption.

Table 5 Values of Ea, ΔGads, ΔHads, and ΔSads for corrosion of MS in 1 M HCl with ERT

The values of free energy of adsorption (ΔGads) were obtained from Eq. (9) and are given in Table 5.

$$\log C=[\ln \theta {\text{/}}(1 - \theta )]-\log B,$$
(9)

where log B = − 1.74 − [−ΔGads/(2.303 RT)], C is the concentration of the inhibitor, θ is the surface coverage, and ΔGads is the free energy of adsorption (kJ/mol). It is described in the literature that a value of ΔGads around − 20 kJ/mol or less negative implies that the adsorption is due to electrostatic interaction, i.e., physisorption, while the values of ΔGads around − 40 kJ/mol or more negative suggests that the adsorption is chemisorption. Analysis of results presented in Table 5 shows that the values of ΔGads are less negative than − 20 kJ/mol indicating that the process of inhibition is through physisorption. The negative values of ΔGads reflect the spontaneous adsorption of inhibitor molecules on the metal surface.

In order to have a better understating about the adsorption process, the enthalpy of adsorption (ΔHads) and entropy of adsorption (ΔSads) were obtained from the ΔGads versus T plot which is from the basic thermodynamic relation [38]:

$$\Delta {G_{{\text{ads}}}}=\Delta {H_{{\text{ads}}}}-T\;\Delta {S_{{\text{ads}}}}.$$
(10)

The intercept of the plot gives the values of ΔHads and the slope gives the values of ΔSads. From Table 5, it is also clear that the ΔHads values are negative. The negative values of ΔHads indicate that the adsorption of inhibitor molecules on the metal surface is an exothermic process. Further, the values of ΔH increase in the presence of ERT compared to those in the free acid solution, which portrays physical adsorption. It is also observed that ΔSads values in the presence of the inhibitor are positive which is an indication of an increase in solvent entropy, which means that an increase of disorderliness is due to the displacement of more water molecules from the MS surface by inhibitor molecules [39].

3.6 Adsorption Isotherm

Basic information on the interaction between the inhibitor molecule and the mild steel surface can be obtained from the adsorption isotherm. For this purpose, the values of surface coverage (θ) at different concentrations (C) of ERT in HCl medium in the temperature range (303–343 K) have been used to construct a suitable isotherm. Attempts were made to fit the experimental data to various isotherms including Langmuir, Freundlich, Temkin, Frumkin, El-Awady, and Flory–Huggins. It has been found that the data fit well with the Freundlich adsorption isotherm (Fig. 7) with a correlation coefficient nearing almost unity.

Fig. 7
figure 7

Freundlich isotherm for the corrosion of MS in 1 M HCl with ERT

The Freundlich adsorption isotherm can be modeled by the following equation [40]:

$$\log \theta =\log {K_{{\text{ads}}}}+(1{\text{/}}n)\log C,$$
(11)

where K (adsorption equilibrium constant) and n (linearity parameter) are constants for a given adsorbate and adsorbent at a particular temperature. Deviation from the Langmuir arises because of the fact that either the surface may not be uniform or there could have been interactions between the adsorbed molecules. Further, there may be adsorption in more than one layer, i.e., multilayer adsorption.

3.7 Surface Analysis

3.7.1 SEM Analysis

Figure 8 shows the SEM images recorded for (a) polished MS samples (b) MS samples exposed for 3 h in 1 M HCl and (c) MS samples exposed for 3 h in 1 M HCl with 0.18 g/L of ERT. The images clearly indicate that in the presence of ERT, the damage to the MS surface is considerably reduced advocating the adsorption of inhibitor molecules on the metal surface.

Fig. 8
figure 8

FESEM images a Fresh MS b MS in 1 M HCl c MS in 1 M HCl with ERT

3.7.2 EDXS Analysis

EDXS technique was employed to get knowledge about the nature of the protective film formed on the metal surface. The EDXS image of the uninhibited MS sample (Fig. 9a) shows the presence of the elements, namely iron, oxygen, chlorine, copper, and carbon. It shows the characteristics peak of iron (86.31%) which is the main element constituting the MS sample. Also, small peaks characterizing chloride (1.36%) and oxygen (6.22%) were detected; these peaks represent the corrosion products formed on the MS surface (chloride and oxide). The EDXS image of the inhibited MS sample (Fig. 9b) is also found to contain the elements iron, oxygen, chlorine, and carbon. However, the percentages of iron, oxygen, and chloride were, respectively, 70.29, 26.82, and 0.39. It is apparent from data that the percentage of iron in the inhibited sample has decreased by about 15% indicating that the MS sample is covered by the inhibitor molecules. Furthermore, an increase in the % of oxygen indicates that the inhibitor molecules containing oxygen are adsorbed on the MS surface.

Fig. 9
figure 9

EDXS images of a MS in 1 M HCl b MS in 1 M HCl with ERT

3.8 Quantum Chemical Calculations

The effectiveness of an inhibitor is related to its spatial and electronic molecular structures [41]. To assess the inhibitive nature of ERT, quantum chemical calculation (DFT) were performed on five major components identified from the GC–MS analysis (Table 1) [42,43,44]. The anticorrosive behavior of the plant extract is a cumulative result of both synergistic and antagonistic effects of various molecular interactions between the phytochemical constituents present in it. The quantum chemical computations are not necessarily intended to provide a detailed description of the adsorption of the extract. Instead, the idea is to recognize the relative contributions of the different extract components through their individual adsorption strength and mechanisms.

Figure 10 shows the optimized structure, HOMO, and LUMO of components 1–5. Table 6 lists some quantum chemical parameters, which are thought important due to their direct influence on electronic interactions between the inhibitor molecules and MS surfaces.

Fig. 10
figure 10

Optimized structure, HOMO, LUMO distribution of studied compounds

Table 6 Quantum chemical parameters for the studied constituents of ERT

The ionization potential (I) and electron affinity (A) were calculated according to the Koopmans theorem [45].

$$A= - {E_{{\text{LUMO}}}}$$
(12)
$$I= - {E_{{\text{HOMO}}}}.$$
(13)

The absolute electronegativity (χ) and the absolute hardness (η) were calculated from the following equations.

$$\chi =(I+A){\text{/}}2$$
(14)
$$\eta =(I-A){\text{/}}2.$$
(15)

The fraction of electrons transferred (ΔN) was calculated using the equation

$$\Delta N=\frac{{({\chi _{{\text{Fe}}}} - {\chi _{{\text{inh}}}})}}{{2({\eta _{{\text{Fe}}}}+{\eta _{{\text{inh}}}})}}.$$
(16)

The theoretical values of χFe and ηFe are (7 eV/mol) and (0 eV/mol), respectively [46, 47].

The higher EHOMO suggests the greater tendency of electron donation by the molecule to the vacant orbital of the metal surface with low energy and higher the corrosion inhibitory efficacy. Likewise, the lowest values of ELUMO indicates the easier acceptance of electrons from the metal surface, as the energy gap (ΔE = ELUMO − EHOMO) decreased and the efficiency of inhibitor improved [48]. From Table 6, it is obvious that compound 1 (Stigmasterol) has comparatively low ΔE value and %IE values of different compounds follow the order 2 < 3 < 5 < 4 < 1.

Global hardness (η) measures the resistance of a molecule or ion against the charge transfer and global softness (σ) describes the capacity of an atom or group of atoms to receive electrons. The inhibitor with the least value of global hardness (η) (hence the highest value of global softness (σ)) is expected to have the highest inhibition efficiency. For the simplest transfer of an electron, adsorption could occur at the part of the molecule where softness (σ), which is a local property, has the highest value [5]. Based on this averment, %IE values of five major components follow the order 2 < 3 < 5 < 4 < 1.

The fraction of electrons transferred from inhibitor molecules to the metal surface (∆N) is recorded in Table 6. The positive values indicate the electron transfer is from the ERT to metal surface [47]. All the values of ∆N in the present study are < 3.6, which according to Lukovits’s study [49] suggest that the inhibition efficiency of components 1–5 will increase with increasing electron-donating ability to the metal surface. The ΔN values clearly put the %IE values of the five compounds in the order 2 < 3 < 5 < 1 < 4. HOMO, LUMO, global hardness, global softness, and the values of the fraction of electrons transferred give individual adsorption strength of studied components 1–5.

The molecular electrostatic potentials of components 1–5 are shown in Fig. 11. The electronegative centers such as hydroxyl group in compounds 1, 4, and 5, carbonyl group in compound 2, and double bond present in compound 3 are shown by color variation in this figure. Electrostatic potentials of different regions in a molecule are identified by color code. Electrostatic potential increases in the order red > orange > green > blue suggesting that the areas with red and blue colors signify strong negative and positive potentials, respectively. The major effective components of ERT (components 1–5) are big molecules, but the electronegative centers are small compared to the size of the molecules. During corrosion (metal in acidic solution), metal loses electrons and tends to have electropositive character. At the experimental conditions used, the electronegative center of inhibitor molecules approaches the electropositive metal surface leading to the adsorption of inhibitor molecules over the metal surface forming a protective film. As the concentration of the inhibitor is increased, more number of inhibitor molecules approach the metal and more adsorption takes place. However, the increase in inhibitor concentration beyond a certain dosage leads to a decrease in inhibition efficiency. This could be due to the fact that, at higher concentration more number of inhibitor molecules approach the metal surface, and since the electronegative centers are too small when compared with the molecule, there is a dislocation of molecules from metal surfaces. Further increase in immersion time leads to the dislocation which is again due to the small size of electronegative centers. From the experimental results, it is obvious that an inhibitor concentration more than 0.18 g/L or an immersion time more than 3 h leads to a decrease in inhibition efficiency. The results of quantum chemical calculations are interpreted as a vindication of the experimental results.

Fig. 11
figure 11

Electrostatic potential of studied compounds

4 Conclusions

GC–MS analysis of ERT shows that there are five major components in the extract, namely alcohols, ester, and hydrocarbon. FTIR, FESEM, and EDXS analyses confirm the adsorption of inhibitor molecules on metal surface. Increase in inhibitor concentration increases the inhibition efficiency, and increases in immersion time, acid concentration, and temperature decrease the inhibition efficiency. A maximum efficiency of 87.01% was obtained at an inhibitor concentration of 0.18 g/L for an immersion time of 3 h at 303 K. PDP studies indicate the mixed nature of the inhibitor protecting predominantly the cathodic reaction. The thermodynamic parameters suggest that there is a strong inhibiting action of ERT through physical adsorption process. The process of adsorption follows the Freundlich isotherm. Quantum chemical calculations show the possible active sites of the components of inhibitor molecules on metal surface.