Introduction

Recently, mild steel corrosion has turned the interest of corrosion scientists for discovering new materials which have the capability to protect it from corrosion [1, 2]. In other words, to eliminate the undesirable scales and corrosion which occur on the mild steel surface; the two acids hydrochloric and sulfuric are frequently used for this topic [3] . Nevertheless, due to the thermodynamic instability of mild steel, especially in contact with the aggressive solution medium, it becomes very disposed to corrosion [4]. Hence, the reduced corrosion resistance of mild steel in acidic solutions requires corrosion inhibitors which act by chemical and/or physical adsorption to limit its attack [4]. Organic compounds act as good corrosion prevention due to the existence of unsaturated bonds and/or hetero atoms such as oxygen, nitrogen and sulfur as well as the reactive functional groups, for example, –NH, –N=N–, –C=C–, C=O, –CN, –OH, =S, aromatic collection, etc., in their structures [5, 6].

Many corrosion inhibitors are obtained from the synthesis chemical process [7,8,9], but these compounds are often considered as highly toxic species and not friendly with the environment. At this time, using non-hazardous (e.g., non-toxic synthetic compounds as dyes, drugs, etc.) and natural (e.g., extracts of some plants) inhibitors has become important because of their environmentally friendly nature [10, 11]. In our laboratory, a great deal of research has been carried out to study the inhibitive effects of several plant extracts on the corrosion of steel in 1 M HCl [12,13,14,15]. In this work, our focus is chiefly put on the essential oil of Aaronsohnia pubescens (Fig. 1).

Fig. 1
figure 1

Aaronsohnia pubescens in its native habitat in southeastern Morocco

Aaronsohnia pubescens (Desf.) K. Bremer & Humphries is botanically a synonym of Matricaria pubescens (Desf.) Schultz (Asteraceae). It is a pleasant-scented annual plant endemic to North Africa [16] and the Canary Islands [17]. It is primarily found in non-saline wadis on preferably sandy-loamy soils. Parts of the plant are used in local folk medicine: In Morocco, this species is known locally as “Taraght,” and decoctions of the aerial flowering parts of the plant are used as mouthwash against toothache [18]. The plant is also used as a food additive for flavoring and preservation purposes [16, 18]. In both Algeria and Morocco, infusions of the aerial parts are used against gastric ulcers and flatulence, respiratory disorders, dysmenorrhea, skin inflammation, fever and rheumatic diseases [19]; to our knowledge, no study has been published to study the inhibitive action of AP oil on corrosion of MS in 1 M HCl solution. Computational approaches have been widely used to gain a deep understanding of the adsorption mechanism between the metal surface and inhibitor, elucidating the chemical and physical properties of structures and sometimes proving the adsorption behavior of inhibitor compounds toward the metal surface [20, 21]. Therefore, the goals of this study are (1) a determination of the chemical composition of AP oil using gas chromatography (GC) and GC-mass spectrometry (GCMS), (2) an investigation on the inhibitory action of AP oil using the monitory techniques such as weight loss measurements and electrochemical methods and (3) the modeling approaches such as DFT, ESP and MC were used to evaluate the corrosion inhibition and adsorption (CIA) behavior of the major compounds of AP oil on the surface (110) of iron metal Fe (the main constituent of MS) in 1 M HCl as corrosive solution medium. This computational finding provides supportive highlights to choosing one of the most major constituents of AP oil which will be considered as a good inhibitor to prevent mild steel corrosion in 1 M HCl. The corrosion inhibition process was carried out in acidic solution, and consequently the protonation of inhibitors with both lone pair of electrons and the more nucleophilic sites of carbon atoms will be possible; for this, the calculations of non-protonated forms will be discussed and then compared to those of the protonated forms.

Experimental Procedure

AP Oil Isolation

The aerial parts of Aaronsohnia pubescens were collected in May and June 2018 (full bloom) from Errachidia, Morocco. Coupon specimens were deposited in the herbarium of the Faculty of Sciences and Technology of Errachidia . After that, 100 g of fresh plant material (100 g) was subjected to hydrodistillation (3 h) using a Clevenger-type apparatus according to the method recommended in the European Pharmacopoeia [22], and the essential oil yield was 0.9%.

AP Oil Characterization

The analysis of AP oil was carried out by GC and GC-MS according to the described methodologies in our previous work [12], using a Perkin-Elmer Autosystem XL GC apparatus. Fused-silica capillary columns (60 m × 0.22 mm, i.e., film thickness 0.25 µm), Rtx-1 (polydimethylsiloxane) and Rtx-wax (polyethyleneglycol). Temperature program: from 60 to 230 °C at 2 °C/min and then held isothermally at 230 °C for 35 min. Injector and detector temperatures were held at 280 °C. Samples were injected in the split mode (1/50), the carrier gas was H2 (1 ml/min); the volume injected was 0.2 µl of pure oil. MS conditions: Turbo mass detector quadrupole, EI+ = 70 eV, acquisitions scan mass range of 35–350 Da, split: 1/80, injection volume: 0.2 µl of pure oil.

Preparation of MS Segments, Corrosive Solutions and Inhibitors

Corrosion tests were conducted on the MS segments with dimension of 2 cm × 2 cm × 0.05 cm; the MS metal presents the subsequent composition with mass percentage (%): P 0.09, Si 0.38, Al 0.01, Mn 0.05, C 0.21, S 0.05 and Fe 99.21. Before each corrosion test, the MS segments were mechanically ground with sequential grades of emery papers (400, 600 and 1200 grit) and as a result rinsed and degreased with distilled water and acetone, then dried and weighed. The corrosive acid solution was a molar hydrochloric acid (1 M of HCl) prepared from concentrated commercial acid of HCl (37%) by dilution with distilled water.

Corrosion Monitoring Techniques

Weight Loss (WL) Measurements

The prepared MS samples were weighed; then, they were immersed in 1 M HCl with and without different concentrations from 0.25 to 1.5 g L−1 of AP oil under different temperatures of 308–343 K for an exposure time of six hours [23]. Inhibitory efficiency (IE%) was determined basing on the MS corrosion rates W (mg cm−2 h−1) according to the subsequent relationship [24] (Eq 1 and 2):

$$ W = \frac{{m_{\text{f}} - m_{\text{i}} }}{S \cdot t} $$
(1)

where mi and mf (mg) is the MS sample weight before and after immersion in the tested solution. S is the area of the MS sample (cm2), and t is the exposure time (h).

$$ {\text{IE}}\% = \frac{{W - W ^{\prime } }}{W } \times 100 $$
(2)

where W and W′ are the MS corrosion rates in both uninhibited and inhibited solution, respectively. The extent of the surface coverage (θ) is defined as follows [25] (Eq 3):

$$ \theta = \frac{{{\text{IE\% }}}}{100} . $$
(3)

Electrochemical (PDP and EIS) Measurements

Before conducting each electrochemical corrosion test, the sample was immersed in the test solution during 30 min at the open circuit potential (EOCP) to find a steady state. Both PDP and EIS tests were performed from utilizing an assembly of electrochemical cell containing three electrodes: a disk cut form of MS as working electrode (1 cm2), a saturated calomel electrode as a reference electrode and a platinum electrode as counter electrode. All electrochemical measurements were carried out using a potentiostat/galvanostat (Model 263A), and the electrochemical parameter values were determined using the Volta Master 4 software. We note that all potentials measurement in this study were obtained with respect to the potential value of the reference electrode.

The PDP tests were conducted in 1 M HCl (without AP oil) and in different concentrations of AP oil (0.25–1.5 g L−1) in the temperature range of 308–343 K, simultaneously. Furthermore, the cathodic and anodic curves were plotted by varying the electrode potential between − 800 to + 800 mV versus reference electrode at open circuit potential with a scan rate of 0.5 mV/s. Inhibitory efficiency (IE %) was calculated based on the current corrosion i of MS at the above conditions according to the ensuing relationship: (Eq 4).

$$ {\text{IE}}\% = \frac{{i - i^{\prime } }}{i } \times 100 $$
(4)

where i and i′ are the corrosion current densities in the absence and the presence of inhibitor, respectively. Total charge transfer resistances Rt (without inhibitor) and Rt′ (with inhibitor) were calculated from Nyquist plots by measuring the impedance difference at low and high frequencies. We maintained the above experiment conditions, and then, we conducted the EIS tests in the frequency range of 100 KHz to 10 mHz at open circuit potential with signal amplitude of 10 mV. The inhibitory efficiency (IE%) was calculated according to (Eq 5).

$$ {\text{IE}}\% = \frac{{R_{\text{t}}^{\prime } - R_{\text{t}} }}{{R_{\text{t}}^{\prime } }} \times 100 $$
(5)

According to constant phase element (CPE) that accounts for the heterogeneities surface via the n coefficient [26], ZCPE impedance is calculated according to the following equations (Eq 68):

$$ Z_{\text{CPE}} = Q^{ - 1} (i\omega )^{ - n} $$
(6)

where Q is the constant of the CPE, ω is the angular frequency, and n is the phase shift

$$ C_{\text{dl}} = (Q \times R_{ct}^{1 - n} )^{{\frac{1}{n}}} $$
(7)
$$ \omega = 2\pi f_{\hbox{max} } $$
(8)

fmax is the frequency for which the imaginary part of the impedance is maximum.

The Cdl (capacity of the double layer) is determined from the CPE as following (Eq 9):

$$ C_{\text{dl}} = \frac{1}{{2 \cdot \pi \cdot f_{\hbox{max} } \cdot R_{\text{t}} }}. $$
(9)

Computational Methodology

DFT and ESP Calculations

Gaussian 09 program, Revision-D.01 [27]was employed to obtain the optimized geometries of the main components of AP oil such as E-anethole, (E)-heptadeca-10,16-dien-7one and Z-β-Ocimene using DFT method [20] combined to the basis 6-311G++(d,p) [28] and the functional B3LYP [29]. For these inhibitors, the distribution densities of HOMO (occupied molecular orbital) and LUMO (low unoccupied molecular orbital) were produced. Then, we have calculated quantum parameters (QPs) such as the energy of HOMO (EHOMO), the energy of LUMO (ELUMO), the energy gap ΔEinh between EHOMO and ELUMO energies (ΔEinh = ELUMO − EHOMO) [30, 31], the global chemical potential μinh (μinh = 0.5(EHOMO − ELUMO) [32, 33], the hardness ηinh (ηinh = ΔEinh) [32, 33], and the fraction of electrons transferred ΔN from each compound as inhibitor to bulk iron surface (110) is calculated according to the Pearson relationship as follows: 0.5(φFe(110) + μinh)(ηFe(110) + ηinh)−1 [34], where φFe(110) and ηFe(110) are known as the working function and the absolute hardness of bulk iron surface (110), and then, ηinh and μinh are the global chemical potential and the global hardness of the inhibitor. The values of φFe(110) and ηFe(110) are 4.82 and 0 eV, respectively [35,36,37]. Furthermore, electron back donating character of the inhibitor (ΔEbd-inh) is another descriptor which is used to describe reactivity between metal surface and adsorbent; this parameter is expressed as − ηinh/4 [38]. Additionally, the reactive centers of the compounds were estimated from three approaches as the analysis of spreading of HOMO and LUMO densities (FMO) and then from the analysis electrostatic potential surface (ESP) on which the red color signifies a strong negative electrostatic potential distribution (EP), yellow moderately negative EP, blue strong positive EP and green moderately positive EP [39].

Metropolis Monte Carlo (MC) Simulations

Adsorption simulation of each inhibitor onto iron surface (110) with corrosive solution medium (200 of H2O, 5H3O+ and 5Cl) was explored using an adsorption locator module and the COMPASS II force field integrated to the Materials Studio version 8 program package [40, 41]. The single-crystal Fe (110) surface is built using sketching tools and optimized with the smart minimizer using DMol^3 at the DNP+ basis and B3LYP functional. Then, the single crystal plane (110) was extended to the multi-surface area of Fe (110) using the super cell containing 10 layers with a vacuum layer of 30 Å along the C-axis. The system inhibitor/solution/Fe (110) was simulated in a simulation box of 17.89 × 17.89 × 38.34 Å with periodic boundary conditions. The crystallographic Fe (110) plane was chosen because is a densely packed surface [42].

Results and Discussion

Chemical Composition of AP Oil

The chemical composition of AP oil was obtained from GC and GC-MS techniques. Fifty components were characterized, which accounted to 83.2 % of the total oil (Table 1). Hence, the dominant components of AP oil were established with mass percentage as follows: nine hydrocarbon monoterpenes (14 %), eighteen oxygenated monoterpenes (29.4%), seven hydrocarbon sesquiterpenes (7.3%), eight oxygenated sesquiterpenes (18%), three nonterpenic oxygenated compounds (12.4%) and five other compounds (2.1%). Among them, E-anethole (15.4%), (E)-heptadeca-10,16-dien-7-one (11.1 %) and Z-β-Ocimene (8.6%) were identified as major constituents of AP oil (Table 1). The structures of the main compounds are shown in Fig. 2.

Table 1 Chemical composition of the AP oil from southeastern of Morocco
Fig. 2
figure 2

The main compound structures of AP oil

Corrosion and Adsorption Behavior of AP Oil on Mild Steel Surface in 1 M HCl

Weight Loss Analysis, Kinetic and Thermodynamic Parameters

Effect of AP Oil Concentration and Media Temperature

This part aimed to study the influence of inhibitor concentration and media temperature on the progress of corrosion rate of mild steel (MS) and the inhibitory efficiency related to the AP oil in corrosive media (1 M HCl) in temperature range of 308 to 343 K without and with different concentrations of inhibitor (AP oil). The results are portrayed in Table 2. From this table, it appears that the AP oil has an inhibitive behavior to limit corrosion on MS surface. We notice that the corrosion rate of MS decreases when the concentration of inhibitor increases and consequently the inhibitory efficiency of AP oil increases up to the concentration of 1.5 g L−1; reaching a high value of IE% varies from 82.11% at 308 K to 83.22% at 343 K. This is due probably to the increase of the surface coverage θ for the studied adsorption. In other words, we observed that the inhibitory efficiency of AP oil is slightly increased when the media temperature increases, which probably affects the chemisorption behavior of AP oil onto MS surface.

Table 2 Weight loss results from different concentrations of AP oil in 1 M HCl at different temperatures

Kinetic and Thermodynamic Parameters

Based on the famous rule of Arrhenius, we calculated the standard activation energy Ea in the temperature range of 308–343 K, with and without of AP oil using relationship (Eq 10) [43]. Then, we calculated the standard activation energies of enthalpy ΔHa and ΔSa using the relationship (Eq 11) and (Eq 12), respectively [44].

$$ \ln W = \ln A^{\prime } + \left[ { - \frac{{E_{\text{a}} }}{R T} } \right] $$
(10)
$$ W = \frac{R \cdot T}{{N_{\text{a}} h}}\exp \left[ {\frac{{\Delta S_{\text{a}}^{^\circ } }}{R}} \right].\exp \left[ { - \frac{{\Delta H_{\text{a}}^{^\circ } }}{R T}} \right] $$
(11)
$$ \ln \left[ {\frac{W}{T}} \right] = \ln \left[ {\left( {\frac{R}{{N_{\text{a}} h}}} \right) + \frac{{\Delta S_{\text{a}}^{^\circ } }}{R}} \right] + \left[ { - \frac{{\Delta H_{\text{a}}^{^\circ } }}{R T}} \right] $$
(12)

where W, R, T, h, Na and A′ signify the corrosion rate, the universal constant of the ideal gas, the absolute temperature, the Plank constant, Avogadro is number and the Arrhenius pre-exponential factor, respectively.

The plot displayed in Fig. 3 corresponds to the variation of ln(W) versus (1000/T) for mild steel corrosion in 1 M HCl with and without various concentrations of AP oil. The variation of ln(W/T) as function 1000/T for mild steel corrosion in 1 M HCl with and without various inhibitor concentrations is shown in Fig. 4. Based on Fig. 3, we have calculated the standard activation energy Ea, and then,

Fig. 3
figure 3

Arrhenius plots for MS corrosion rates (W) in 1 M HCl with and without of different concentrations of AP oil

Fig. 4
figure 4

Transition-state plot for MS corrosion rates (W) in 1 M HCl with and without of different concentrations of AP oil

Table 3 Kinetics thermodynamic for mild steel in corrosive media (1 M HCl) in the absence and the presence of different concentrations of AP oil

according to Fig. 4, we have calculated standard activation enthalpy ΔHa°, entropy ΔSa° energies and the difference Ea − ΔHa° (Table 3).

Accordingly, we observed that the activation energy attained in HCl (corrosive media) in the presence of AP oil inhibitor is lower than that when the HCl is added alone, indicating clearly the chemisorption behavior of adsorption between mild steel surface and inhibitors species of AP oil [45]. In other words, we found that the average difference Ea − ΔHa° (2.7 kJ mol−1) is almost equal to the average value of RT at the average temperature of 324°K calculated in the studied domain which indicates that the corrosion process is a unimolecular reaction by the known of a perfect gas [46].

Additionally, the positive values of standard activation enthalpy indicate the endothermic dissolution phenomenon of mild steel [47]. The negative values of the standard activation entropy exhibited a low disorder of the species well-thought-out in the studied adsorption [48]. Moreover, the addition of AP oil to the solution has caused a noticeable decrease of the standard activation entropy, revealing clearly the important role of AP oil inhibitor to reduce the disorder property related to the species which enter in adsorption system.

Adsorption Isotherm

The adsorption behavior of the inhibitor onto the metal surface is mainly due to its electronic and physical structures, type of the metal and the conditions within the media on which the adsorption occurred. In this respect, two types of adsorption could be considered: chemisorption reflects a stronger bonding of metal surface-inhibitor (e.g., covalent bonds), whereas physisorption involves weak bonding interactions between metal surface and inhibitor (e.g., van der Walls). To get information about the adsorption mechanism of the AP oil on the MS surface, adsorption isotherm models were used such as Langmuir, Temkin, Frumkin and Freundlich (Eq 13, 14 and 15).

$$ {\text{Langmuir}}:\frac{C}{\theta } = \frac{1}{{K_{\text{ads}} }} + C $$
(13)
$$ {\text{Temkin}}:\ln \left[ {\frac{C}{\theta }} \right] = \ln K_{\text{ads}} - g \cdot \theta $$
(14)
$$ {\text{Frumkin}} :\ln \left[ {C \cdot \left( {\frac{\theta }{1 - \theta }} \right)} \right] = \ln K_{\text{ads}} + g \cdot \theta $$
(15)

where Kads and g are the adsorption/desorption equilibrium constant and the adsorbate parameter, respectively. Accordingly, we observed that the adsorption of AP oil on the MS surface follows a Langmuir adsorption isotherm (Fig. 5).

Fig. 5
figure 5

Langmuir adsorption isotherm of AP oil on the MS surface in 1 M HCl at 308 K

Figure 5 shows the straight lines of C/θ with respect to AP oil concentration, C, at different temperatures (308–348 K). The linear regression factor R2 values are shown in Fig. 5. The values of R2 are almost equal to 1, indicating that the adsorption on the MS surface follows the Langmuir adsorption isotherm [49]. This result suggests that the adsorbed molecules of AP oil occupy only one protective layer and that there are no interactions between the adsorbed species [25].

Electrochemical Measurements (EIS and PDP)

EIS Study

The evaluation of inhibition of AP oil to protect against corrosion of MS surface was carried by using EIS analysis. Figure 6 displays the Nyquist plots of MS after 30 min of immersion in 1 M HCl in both the absence and presence of various concentrations of AP oil at 308 K. As shown in Fig. 6, we perceived that the addition of the AP oil (0.25–1.5 g L−1) to the corrosive medium causes the increase of the size of the capacitive loops, highlighting the good inhibitory action of AP oil. This inhibitory action of AP oil increases with the increase in its concentration, the same trends as those obtained from the weight loss measurements. Moreover, the presence of a unique capacitive loop indicated that the studied adsorption is governed through a charge transfer process [50].

Fig. 6
figure 6

Nyquist plots of MS in 1 M HCl without and with different concentrations of AP oil at 308 K

In addition, we noticed that the outputted impedance loops are not ideal semicircles, which mainly results from to the surface irregularity, presence of corrosion products, formation of spongy lattices, etc.

An analysis of EIS leads us to calculate several parameters as solution resistance (Rs), charge transfer resistance (Rct), double layer capacitance (Cdl) and inhibitory efficiency (IEEIS%); these parameters are listed in Table 4.

Table 4 Parameters of EIS of MS in 1 M HCl without and with various concentrations of AP oil at 308 K

According to the results reported in Table 4, we noted that the values of the transfer resistance, Rt, increase with the increase of the inhibitor concentration. However, the values of the capacitance of the double layer Cdl have decreased in comparison with that of uninhibited solution. This can be attributed to an adsorption of the inhibitor molecules of AP oil on the MS surface forming a layer between the metal and the corrosives solution [51]. This result suggests that the increase in the inhibitor concentration increases the number of molecules adsorbed onto steel surface and reduces the surface area that is available for the direct acid attack on the metal surface. The highest inhibition efficiency 87.51 % was attained at 1.5 g L−1 of AP oil. Figure 7 shows the Bode plots of MS in 1 M HCl in both uninhibited and inhibited solutions. Referring to Fig. 7a, either at low, intermediate or high frequencies, we observed that the impedance plot increases with the increasing of inhibitor concentration of AP oil and thus the above trends of inhibitory efficiency of AP oil are again confirmed. Figure 7b confirms the existence of a single time constant and thus reconfirms the appearance of a single capacitive loop which was observed in the Nyquist diagrams [52].

Fig. 7
figure 7

Bode plots of MS in 1 M HCl with and without different concentrations of AP oil at 308 K

Figure 8 illustrates reveal an equivalent electrical circuit (EEC) of the MS/HCl/AP oil interface in wholly frequencies studied using the Ec-Lab software. EEC incorporates a constant phase element (CPE), the solution resistance (RS) and the charge transfer resistor (Rct).

Fig. 8
figure 8

EEC building of the interface: MS/HCl/AP oil

PDP Study

Both anodic and cathodic potentiodynamic polarization curves of MS in 1 M HCl out carried without and with different concentrations of AP oil are shown in Fig. 9.

Fig. 9
figure 9

Polarization curves of MS in 1 M HCl with and without AP oil at various concentrations at 308 K

From Fig. 9, we remarked that both anodic and cathodic parts of the polarization curves shift to lower currents densities as the AP oil concentration increased. This result can be attributed to an inhibition power of AP oil to stop oxidative and reductive reactions which cause the corrosion phenomenon on the MS surface.

The calculated PDP parameters such as corrosion potential (Ecorr), cathodic Tafel slope (βc), anodic Tafel slope (βa), corrosion current density (Icorr) and inhibitory efficiency IEPDP (%) are reported in Table 5.

Table 5 PDP parameters of MS in 1 M HCl without and with different concentrations of AP oil at 308 K

According to the Table 5, the corrosion current density decreases with increasing of AP oil concentration. Similarly, the inhibition efficiency IEPDP (%) increases with increasing of inhibitor concentration to reach its maximum value of 82.58% at 1.5 g/L. These results suggest that AP oil is toughly adhered to the MS surface, forming a protective layer, which retards electrochemical reactions on metal surface. Therefore, the maximum displacement for potential corrosion is 11 mV which indicates that the AP oil acts as mixed-type inhibitor [53]; in this study, we have noticed that the applied techniques for corrosion tests of mild steel in 1 M HCl as corrosive medium with AP oil concentration of 1.5 g L−1 and media temperature of 308 K were significantly conducted to the high inhibitory efficiencies of AP oil, with all techniques approximately equal one to another. This indicates that these techniques are all suitable to evaluate the inhibition action of AP oil on the corrosion of mild steel at the above conditions.

Computational Study of CIA Behavior for the MAJOR Components of AP Oil

Concerning the computational calculations, corrosion scientists have turned their interest to describe corrosion inhibition and adsorption (CIA) behavior of organic compounds on metal surfaces using several theoretical approaches; among them we find DFT and Monte Carlo (MC) methods [6, 20]. The importance of these methods focus on good correlation between molecular structure and inhibition efficiency of organic molecules. In this respect, the modeling approaches such as DFT and Monte Carlo were used to evaluate the CIA behavior of the major components of AP oil toward the iron surface (110) in 1 M HCl as aggressive solution; in this current work, we showed that there are no interactions between molecules of AP oil, and the adsorbed molecules occupy only one protective layer during adsorption (Langmuir adsorption isotherm). The adsorption behavior is governed by a charge transfer process (evidenced from EIS and Bode diagrams). Hence, the computational study aimed to acquire supportive evidence for the major components of AP oil and to choose one among them which will be considered as a better inhibitor. The major components of AP oil such as (E)-heptadeca-10,16-dien-7one (EHD), E-anethole (EA) and Z-β-ocimene (ZO) and their protonated forms EHD…H+, EA…H+ and ZO…H+ were optimized and are displayed in Fig. 10. The optimization calculations were confirmed by the presence of zero negative frequency in the outputted z-matrix.

Fig. 10
figure 10

Optimized structures of the major components of AP oil

Density Functional Theory Calculations

QPs Parameters of Structures

The HOMO and LUMO orbitals are very important tools to describe global reactivity for the systems which contain unsaturated bonds and/or hetero atoms such as oxygen, nitrogen and sulfur as well as reactive functional groups, for example, –NH, –N=N–, –C=C–, C=O, –CN, –OH, =S, aromatic moiety, etc. In this respect, a molecule having a higher value of EHOMO, the lower value of ELUMO, and the lower value of ΔEinh is more polarizable and is generally associated with a high chemical reactivity and low kinetic stability. It is noted that when ΔN is positive and lower than 3.6 this implies that the compound has a tendency to donate electrons (π and/or lone pair electrons) to the unoccupied orbitals (3d) of the iron surface to form coordinate covalent bonds. A negative value of ΔEbd-inh indicates that the compound is ready to accept free electrons (3d) from the metal to form retro-donating bonds.

Therefore, high value of ΔN and μinh and lower value of ΔEinh reflect that the compound has a strong capacity to share their electrons with the iron surface and consequently more adsorption between inhibitor and iron surface. Furthermore, a lower negative value of ΔEbd-inh means that the compound has a stronger ability to receive electrons from the metal. In this study, the calculated QPs aimed to evaluate global reactivity of EHD, EA and ZO, and also their protonated forms (EHDH+, EAH+ and ZOH+); the QP parameters are listed in Table 6 accordingly; the protonation of the studied compounds leads to increasing of ΔN and μinh and to decreasing of ΔEinh. This result suggests that the transfer of electrons from the studied compounds to the iron surface is very easy when these compounds are in their protonated forms, indicating the prominent role of the protonation to ensure the formation of adsorptive bonds. It is also worth noting that the retro-donating character of these compounds becomes very important in their protonated forms. All these results point to the fact that the E-anethole is considered to be more effective adsorbent onto the iron surface because of its high value of ΔN (1.021 e), lower value of ΔEinh (1.896 eV) and lower negative value of ΔEbd-inh (− 0.474 eV). Considering all the QPs for the studied protonated compounds, we conclude that the strength of adsorption can be ordered as follows: EA…H+ > ZO…H+ > EHD…H+. These results can be attributed to the fact that EA…H+ contains the sp3 oxygen atom of alkoxy group (–OCH3) and aromatic ring which have a high affinity toward accepting and donating electrons to the iron surface atoms.

Table 6 Calculated QPs for the major components and their protonated forms of AP oil

Local Reactivity Study

To define active regions of the studied compounds, the distribution of HOMO and LUMO densities (FMO) as well the depiction of the electrostatic potential surfaces (ESP) has been calculated. The ESP analysis has been broadly used to provide valuable information about the overall molecular charge distribution as well as predicting reactive positions of nucleophilic and/or electrophilic attacks. Figure 11 shows the depictions of FMO and ESP surfaces associated to the protonated compounds. From Fig. 11, for EA…H+, we observed a high density of HOMO is shaped on the benzene ring, while the LUMO is highly fashioned around H+ proton directly linked to the oxygen atom of EA. In other words, strong negative charge (red color) is mainly located around the benzene ring and oxygen atom of EA…H+, while the strong positive charge is located only at the benzene ring; further, we perceived that the EA…H+ presents a moderate positive charge (green color) on the H+ proton and as well throughout all atoms of the benzene ring. This result indicates clearly that EAH+ has strong nucleophilc and electrophilic sites on which the EAH+ can interact with the iron surface through a donor–acceptor interaction process to form chemical coordination bonds. Similarly, the ESP pictures of EHD…H+ and ZO…H+, given in Fig. 11, exhibited a predominance of moderate positive charge for both EHD…H+ and ZO…H+, a little positive charge for EHD…H+ and a little negative charge for ZO…H+, suggesting a low reactivity of these compounds toward the iron surface. It must be noted that this observation cannot be produced from the plots of HOMO and LUMO densities.

Fig. 11
figure 11

Analysis of HOMO, LUMO and ESP for EHD…H+, EA…H+ and ZO…H+

Combining with the above results, we concluded that the strong interaction between AP oil and the iron surface will be related to the protonated form of E-anethole (EA…H+), which results from its high tendency to donate electrons (π and/or lone pair electrons) to the unoccupied orbital (3d) of the iron atoms to form coordinate covalent bonds and at the same time to accept free electrons (3d) from the iron surface to form retro-donating bonds. Consequently, the E-anethole can be considered as the best inhibitor among the compounds under study to protect corrosion of mild steel surface.

Monte Carlo Simulations of EHD…H+, EA…H+ and ZO…H+

For the adsorption phenomenon, both surface coverage and adsorption energy are competing factors that should be considered to understand the strength of the adsorbed molecules onto the metal surface. In this study, the adsorption behavior of protonated compounds (PC) toward an iron surface (110) was studied by the Monte Carlo method. This technique was performed to predict the both strength and nature of adsorption for each compound. Side and top views of stable adsorption configurations of the studied interfaces (PC/200 water/10H3O+/10Cl/Fe (110)) using adsorption Locator modules are given in Fig. 12. From this figure, we suggest that the adsorption regions of all compound on Fe (110) are unsaturated double bonds C=C, polarized bonds O−_H+ and/ or oxygen atom (_O_). Furthermore, we found that all dihedral angles of EA…H+ are close to ± 0° or ± 180°, whereas for EHD…H+ and ZO…H+ the majority of their dihedral angles are not near to ± 0° or ± 180°, signifying high planarity of EA…H+ which maximizes its surface coverage and contact with the iron surface.

Fig. 12
figure 12

Side and top views of stable adsorption configurations of inhibitors in their protonated form on the Fe (110) surface in solution (200 molecules of H2O, 10H3O+ and 10 Cl) at temperature of 308 Kelvin

To estimate the most adsorption between each compound and iron surface (110), such energies are calculated: the total energy (ET) reports the global energy for the systems under study (inhibitor/solution/Fe(110)); this parameter is calculated by optimizing the whole system; therefore, the adsorption energy (Eads) displays the energy required when the relaxed inhibitor compounds are adsorbed on the Fe surface (110). This parameter is commonly used to evaluate the strength and mechanism of adsorption. The rigid adsorption energy (ERads) reflects the energy released when the unrelaxed inhibitor molecule before its optimization step are adsorbed on the Fe surface (110). The deformation energy (EDef) is the energy released when the adsorbed inhibitor molecule is relaxed on the Fe (110) surface . Another term of energy, namely the desorption energy dEads/dNi, reports the necessary energy where one of the inhibitor molecules is removed to the system of inhibitor/solution/Fe (110) surface [54].

Table 7 Total energy ET, adsorption energy Eads, rigid adsorption ERads, deformation energy EDef and necessary energy to exclude inhibitor from the iron surface dEads/dNi, in kcal/mol, are given in solution (200 of H2O, 10 H3O+, and 10 Cl)

Table 7 shows that the system of (EA…H+/solution/Fe (110)) is the most stable (lowest value of ET) among the three systems under study. Further, the negative values of Eads mean that the studied adsorption is spontaneous [54]. Moreover, we observed that the system of EA…H+/solution/Fe(110) has a maximum negative value of Eads (− 72.569 kcal/mol) comparing to the other systems under study, indicating a stronger interaction between the EA…H+ and the iron surface (110) in the acidic solution (200 H2O, 10H3O+, 10Cl). This is mainly due to the presence of oxygen atom –O–, polarized bond –O–H+ and benzene ring as well as the extraordinary planarity of this compound. In addition, it appears that the EHD…H+ is more poorly adhered with the metal surface (inferior value of Eads), outstanding to the presence enormously of the steric effect caused by the presence of the methyl group as well to the non-planarity of this compound and thus certainly provides a weakened interaction between the EHD…H+ and the iron surface. Consequently, we can conclude that the E-anethole compound will be considered as the best corrosion inhibitor among the three compounds under study.

Conclusion

In this current work, we conclude that essential oil extracted from aerial parts of Aaronsohnia pubescens is a worthy inhibitor to prevent mild steel corrosion in 1 M HCl. This essential oil attained its average high inhibitory efficiency of 82.11% at essential dose of 1.5 g L−1 and temperature of 308 K. The essential oil adsorption obeys a Langmuir adsorption isotherm, which shows that the inhibition of corrosion can be attributed to the adsorption of essential oil main compounds such as E-anethole (15.4%), (E)-heptadeca-10,16-dien-7-one (11.1 %) and Z-β-Ocimene (8.6%). The Nyquist and Bode diagrams showed that the adsorption mechanism of AP oil is governed by a charge transfer process. Furthermore, the PDP measurements revealed that essential oil acts as mixed type inhibitor with both anodic and cathodic tendencies. According to these results and high availability and climatic resistance of Aaronsohnia pubescens plant as well as its ecological properties, we conclude that this plant can be used as a high eco-friendly-corrosion inhibitor to prevent against corrosion of mild steel. Computational studies indicated that the E-anethole acts as the best corrosion inhibitor with respect to other main compounds of AP essential oil under study.