1 Introduction

Recently, scientist have given a great interest in the study of the anticorrosive activity of MS in acidic medium owing to its mechanical properties, cheaply priced, elevated accessibility, and strength etc., it is widely applied in different sectors especially industries [1]. The hydrochloric acid is the most used solution in a number of industrial processes, including cleaning, pickling, and acid descaling [2]. However iron and its allows can be easily corroded in these environments, which lead to a great safety and economic damages [3]. With the environmental policies, several methods have been considered to protect MS against corrosion, the use of safe, effective and environmental friendly inhibitors is among the most effective methods for preventing rust even at low concentrations [4], they act by adsorption into the substrate surface and establish a barrier toward corrosive substances [5], according to the literature an effective organic inhibitor should be chemisorbed on the substrate surface with a high adsorption energy and form a compact barrier layer with an inner thickness very high [6]. Heteroatoms, namely oxygen, nitrogen, phosphorus, or sulfur, and the unsaturated bonding provide the non-bonded electrons which are necessary for the adhesion process of the organic compound on the substrate surface [7,8,9]. However, few of the synthetic inhibitors are safe, although most of them are extremely toxic, expensive [10], and non-biodegradable that is why recently researchers are focused on eco-friendly environment inhibitors [11]. Natural plants, extracts, oil or pure compounds, that presents better anticorrosive features, prevents pollution, keeps the environment secure, and healthy [12]. Because they are safe for the environment, renewable and affordable [13, 14], oils derived from various plants are employed as inhibitors of corrosion and have been stated by numerous authors. Jojoba oil has been examined on iron in 1 M HCl by Chetouani et al. [15], at a concentration of around 0.51 g/l, it exhibits good inhibitory efficacy of almost 100% and follows Frumkin adsorption Rosemary oil has been investigated by Chaieb et al. [16] on H2PO4, at an amount of 16 g/l, the inhibitor attained an inhibiting potency of about 73%. El Aatiaoui et al. [17] studied the anti-corrosive properties of Calamintha plant leaf oil in 1 M HCl for MS, they reported that the maximum efficiency attaint was 87.57% observed for 1.5 g/l of EOC. Bouyanzer et al. [18] studied the oil of Pennyroyal obtained from Mentha pulegium for steel in 1 M HCl they found out that this oil exhibited good anticorrosion properties and attained maximum value of inhibition efficiency at 2.76 g/l, the oil affected the cathodic hydrogen reduction and acted as cathodic inhibitor. Kurniawan et al. [19], studied capsicol oil of red pepper seed on stainless steel in acidic electrolyte, the oil is potent in the inhibition of corrosion process, its inhibition efficacy reached 92.32% and decreased with temperature. Loto [20] investigated Low carbon steel’s corrosion-inhibiting characteristics (LCS) in 0.5 M H2SO4 and HCl of two inhibitors, extracts of basil CLB and atlas cedar CLA oils admixed separately with clove essential oil extracts the results showed high inhibitory efficiency 95.48% and 95.32% in H2SO4 and 92.7% and 97.98% for CLB and CLA, respectively.

This research aims to assess the anticorrosive effect of Artemisia absinthium essential oil (RAO) on metals in a 1 M HCl environment. A. absinthium, also known as absinthe, originally belongs to the Asteraceae family [21]. Harvested from a semi-arid region in Morocco, it finds widespread use in the pharmaceutical sector and for therapeutic applications. The novelty of this study lies in defining the chemical composition of this plant, cultivated in the Driouch region in eastern Morocco, and presenting the current state of knowledge regarding the potent capability of this oil in inhibiting mild steel (MS) corrosion. Furthermore, the essential oil was extracted using a simple hydrodistillation method with water as the solvent. For this purpose, GC-MS and FTIR methods were used to identify the main components of the extracted oil. Also, we have used specifically, electrochemical approaches PDP and EIS as well as the gravimetric method to understand the process of the inhibitor’s interaction with the metal surface, also to identify active spots in the adsorption procedure. The MS’s surface has been analyzed using SEM analysis, the UV has been utilized in order to confirm the complex formation. finally, a quantum study has been carried out for the purpose of extending the experimental investigations and to elaborate the relationship between this latter and quantum calculations, for this purpose, several quantum techniques have been performed to relate the molecular features of the organic inhibitor with the inhibitory efficiency IE (%).

2 Experimental

2.1 Extraction of Essential Oil

Artemisia absinthium’s essential oil RAO was extracted from the leaves part collected from the east of Morocco with a 3.3 average yield. We have utilized the hydro-distillation method, in a 1 l round bottom container with around 500 ml of water, we have added 5 g of A. absinthium plant leaves and brought to a boil, the steam was directed to a condenser column. Finally, the oil RAO was removed due to the difference in density. The obtained volatile oil was purple having aromatic scents and agreeable fragrance.

2.2 GC-MS and FT-IR Investigation

In order to recognize different functional groups existing in the RAO oil, GC-MS technique has been utilized, also FTIR method was used to furnish further qualitative data needed to identify elements.

2.3 Mild Steel and Electrolyte

The steel electrodes are composed of the following chemical elements 99.25% iron, 0.21% carbon, 0.1% manganese, 0.35% phosphorus, 0.05% sulfur, and 0.04% aluminum were handily abraded using silicon carbide papers it goes from 200 and ended 2000 grit size, after that the MS went through distilled water washing, acetone degreasing, and air drying, just after it has been embedded into the cell and leaving a 1 cm2 surface exposed, the electrical contact for the electrochemical investigation was assured by copper wires. The corrosive medium (1 M HCl) was prepared from the analytic content consisting of pure water and 37% HCl.

2.4 Weight Loss Study

Right after been washed, MS specimens were plunged into 1 M HCl medium for 6 h at temperature of 303 K with and without different concentration of inhibitors. After that, using distilled water, the samples were thoroughly cleaned, and dried then weighed with high precision. The rate of corrosion ωcorr was calculated using the mean of triplicate experiences using the Eq. (1) and the inhibition efficacy ηw(%) is determined basing to the formulas (2) [22]:

$$W_{{{\text{corr}}}} = \frac{{m_{{\text{i}}} - m_{{\text{f}}} }}{S \times t}$$
(1)
$$\eta_{{\text{w}}} = \left( {1 - \frac{{W_{{\text{corr/inh}}} }}{{W_{{{\text{corr}}}} }}} \right) \times {100}$$
(2)

2.5 Electrochemical Study

The electrochemical tests have been evaluated in a solution containing several amounts of RAO oil (2 g/l–0.5 g/l). For the tests, we have used a cell with three electrodes consisting of working electrode (WE) which is MS, a saturated calomel electrode (SCE) was employed as the reference electrode (RE), with a Pt electrode serving as the counter electrode (CE), these latter are associated to PGZ 402 potentiostat/galvanostat. The polarization data were registered after 30 min to reach the stable potential OCP and using 0.5 mV/s of scan speed in the range (− 800 to 0 mV). The inhibitory effectiveness ηPDP (%) is generated from the relation bellow [23]:

$$\eta_{{{\text{PDP}}}} = \left( {1 - \frac{{i_{{{\text{corr}}}}^{0} }}{{i_{{{\text{corr}}}} }}} \right) \times 100,$$
(3)

where i0corr is the blank current density while icorr stands for the studied inhibitors current density. While, the EIS measurements were obtained in the frequency range between 100 kHz and 10 mHz that has a perturbation of 10 mV, the outcome is then affined with Z-View Software. The inhibition efficiencies (ηEIS(%)) have been calculated using the following expression [24]:

$$\eta_{{{\text{EIS}}}} = \left( {1 - \frac{{R_{{\text{p}}}^{0} }}{{R_{{\text{p}}} }}} \right) \times 100,$$
(4)

where Rp and Rp0 symbolize the polarization resistance with and without inhibitors, respectively.

2.6 SEM and UV–Vis Investigation

With the objective to observe the surface morphological changes of the carbon steel, this latter has been dipped in the inhibited solution and then has been examined by SEM analysis. To further analyzed the MS surface, UV–Vis analysis has demonstrated that a complex has formed between ferrous and the MS surface, utilizing a Jasco V-730 spectrophotometer after a 24-h immersion of the MS in the inhibited and uninhibited electrolyte.

2.7 Theoretical Investigations

The geometry optimisation was performed with the Gaussian 16 program package, based on the DFT method, using the functions 6-311+g(d,p)/apfd/smd (water) model [25].

To study and understand interactions between the β-pinene, camphor, eucalyptol, terpene-4-ol, and pulegone molecules with the MS interface, this latter was conducted using MC and MD simulations. These simulations are widely used to determine the different adsorption configurations and the interaction system between the molecular structure of the β-pinene, camphor, eucalyptol, terpene-4-ol, and pulegone molecules and the MS surface. Materials Studio 8.0 software was used to perform the MC and MD simulations [26,27,28,29,30,31].

3 Findings and Discussion

3.1 Artemisia absinthium Oil Composition

The GC-MS chromatographic spectrum of RAO essential oil allows the determination of different present elements. The examined oil reveals the presence of a combination of compounds involving about twenty various species, the main constitutes are eucalyptol, camphor, pulegone, β-pinene, terpene-4-ol, as illustrated in Fig. 1.

Fig. 1
figure 1

Main constituents of A. absinthium

The east Morocco RAO oil compositions are considerably different from those retrieved in Tajikistan, Middle East, Europe, Asia, each regions represents new phytochemicals [32]. Table 1 regroups the compounds constituting the oil.

Table 1 Various compounds constituting RAO oil

In addition, the RAO oil was evaluated by FT-IR techniques to know the existent functional groups the RAO bioactive. Figure 2 represents the spectrogram of the RAO oil.

Fig. 2
figure 2

FT-IR spectrogram of RAO oil

According to the spectrogram of RAO, a broad band is present at 3400 cm−1, which was a result of the vibration of the OH group, that confirms the presence of Eucalyptol in RAO. In addition, bands were recorded at 2922 cm−1 and 2852 cm−1 indicating C–H vibrations which are symmetric and asymmetric, respectively. Also, the aromatic C=O vibration is responsible for a band at 1723 cm−1, therefore the presence of pulegone in RAO. On the other hand, at 1455 cm−1, a CH bending vibration was detected, moreover, the bands associated with wave numbers 1272 cm−1, 1100 cm−1 are attributed to CC and CO vibrations, respectively.

3.2 Open Circuit Potential Analysis

It can be noticed from Fig. 3 that the open circuit potential (OCP) of steel in 1 M HCl preceding and following the addition of several amounts of oil. It is clear from the OCP curve that the Ecorr values in the blank solution are anodically shifted until they reach the equilibrium state. This can be considered as the initial layer of the oxide coating generated by air on MS. In addition, it could be noticed that the carbon steel Ecorr value was observed in the more positive zone at the highest concentration of 2 g/l, indicating that the oil adheres to the steel surface and has a significantly higher inhibitory influence on the anodic reaction than its impact on the cathodic reaction. Furthermore, with the addition of different amounts of RAO, the Ecorr shifted toward negative potentials with respect to the blank, which can be interpreted as the resultant effect on the cathodic corrosion reaction.

Fig. 3
figure 3

Open circuit potential curves

3.3 Potentiodynamic Polarization (PDP)

Data resulting from PDP experiment for the MS in the 1 M HCl at varying inhibitor doses are observed in Fig. 4.

Fig. 4
figure 4

Tafel’s curves for different concentrations of the RAO oil

According to the plot we can clearly see that after addition of the inhibitor the curves have minor changes in comparison with the blank solution. In another term, both the anodic and cathodic reactions are impacted by the introduction of inhibitors to the solution [33]. The PDP parameters are summarized in Table 2.

Table 2 PDP parameters for different RAO concentrations

From Table 2, we can notice that the deviation between the Ecorr in the inhibited solution and the Ecorr for the uninhibited one remains inferior to 85 mV, according to the literature this inhibitor belongs to the class of mixed-type inhibitor [34]. It can also be noted that the icorr is decreasing with the addition of the oil, it goes from 1104.3 to 81.7 µA/cm2 at 2 g/l, possibly caused by the adsorption of phytochemicals present in A. absinthium [35], indicating the inhibitors efficiency which attained 92.60% at the optimum concentration. We can also notice a large linearity in the cathodic part proving that Tafel law is validated and the discharge of the H+ proton is accomplished in accordance with pure activation kinetics [36], it is also noted a variation in the value of both cathodic and anodic slopes of Tafel indicating that the hydrogen evolution affects the cathodic reaction and the anodic reaction is impacted by the MS dissolving [37].

3.4 EIS Measurements

EIS has proved to be an effective method to comprehend the inhibitor adsorption occurring at the substrate interface in an acidic medium and to evaluate the electrochemical behavior while including different amounts of the oil [38]. Figures 5 and 6 display the Bode and phase representations as well as the Nyquist graphs for the steel in 1 M HCl.

Fig. 5
figure 5

Nyquist diagrams for the MS at different concentrations of RAO oil in 1 M HCl

Fig. 6
figure 6

Plots of Bode and phase for MS at various RAO oil concentrations in the 1 M HCl

According to Nyquist plots capacitive loops are observed, indicating the presence of double layer capacitance and that charge-transfer controls the corrosion process [39], the size of these depressed semi-circles, rises with the inclusion of A. absinthium which might be related to the effectiveness of the oil in mitigating the steel corrosion [40], and the non-ideal comportment is probably caused by the frequency dispersion brought on by the inhomogeneity of the MS surface [41]. Figure 6 shows that at low frequencies the absolute modulus impedance |Z| is steadily increasing by addition of essential oil RAO indicating that MS is covered by organic molecules after being adsorbed [42]. The lone peak noted in the plots of Bode reveals the existence of a single time constant [43]. Phase angles values increase with the addition of inhibitor indicating better coverage of the MS surface [44], however their values remind inferior to 90° confirming the non-ideal behavior of the system [45]. The EIS parameters were evaluated using the slightest square adjustment of the equivalent circuit; the results are displayed in Table 3.

Table 3 EIS data at various concentrations of RAO oil for MS in 1 M HCl

From the table, we can notice an increase in Rp values and a diminishing in capacitance with the increase of the organic molecule concentration explained by a thickening of the double layer and/or a decreasing in the dielectric constant [46], this is interpretable by the impede of transfer of charges and development of a barrier resulting from oil adsorption on the steel surface [47]. Additionally, the n values provide details concerning the state of the surface heterogeneity. When n is close to 1, the CPE can be considered as a perfect, polished-surface capacitor; however, when n is zero, the CPE can act like a resistor. If n is between 0 and 1, it represents intermediate behavior between a capacitor and a resistor [48], In our case n values are between 0 and 1, which indicate a typical ideal CPE constant, these values are inferior than that of the blank (0.841) indicating the existence of a thin layer that was generated on the surface of the steel [49]. Moreover, Rs values are more pronounced in all concentrations of the inhibited solution compared to that in the hydrochloric acid medium it goes from 0.84135 Ω cm2 at 2 g/l to 1.553 Ω cm2 for the blank indicating that between the steel surface and the electrolyte, the transfer of charge is more activated. The inhibitory effectiveness of the oil RAO to protect MS reached 91.85%, this could be related to the synergic effect of the RAO oil phytochemicals [50]. Additionally, the chi-squared values χ2 are used to determine the appropriateness of fit, the great fitting quality of the data is accomplished by using appropriately low chi-square values. As it is reported from Table 3 the obtained chi-square values are of the order of 10–3 indicating that the fitting error is relatively low and that the model utilized is very accurate proving high agreement between the experimental data and the fitted values. The impedance findings were adjusted using the following equivalent electrical circuit (EEC) (Fig. 7).

Fig. 7
figure 7

EEC describing the studied system

3.5 Gravimetric Measurements

Weight loss tests were evaluated for the steel substrate in HCl 1 M in presence and without different amounts of the A. absinthium oil RAO ranging from 2 to 0.5 g/l, the resulting is grouped in Table 4.

Table 4 Gravimetric data for the studied system

According to Table 4 It is evident that adding oil to an acidic solution lowers the rate of corrosion from 0.4325 mg/cm2/h for the uninhibited medium to 0.0357 mg/cm2/h for the inhibited one, in deed the ηw (%) rises with the increase of the oil amounts added to the aggressive solution, it reached 91.63% at the optimum concentration 2 g/l of A. absinthium oil. This outcome is explicable by the increase of the surface covered by a thin protective barrier of the phytochemicals of the essential oil formed at the MS interface [51]. The findings are closely correlated with the ones obtained by the PDP and EIS techniques. Figure 8 compares the inhibition efficacy attained by the three methods.

Fig. 8
figure 8

Inhibitory efficiencies obtained from different techniques

3.6 Immersion Time Effect

The Immersion time effect was examined by the loss weight method for MS in HCl medium at a temperature equal to 303K for different concentration of the oil within the range of 3 to 7 h. Table 5 summarizes the results obtained, also plots of the ηw(%) of the natural oil versus various concentration are represented in Fig. 9.

Table 5 Inhibitory efficiency at different immersion time of the RAO oil
Fig. 9
figure 9

Inhibition efficiencies for various concentrations of RAO oil at different immersion time

From Table 5, We can easily observe that as concentration and time rise, the η(%) increases, for the optimal amount of 2 g/l the inhibiting power varies between 38.24% for 3 h and 91.63% for 6 h, this indicates a progressive creation of a barrier layer over the substrate’s surface [12]. However, above the six hours of the study period, the inhibitory effectiveness begins to diminish, according to the literature some authors have explained this decrease after a long immersion period by the exhaustion of the available inhibitor molecules in solution [52], this can be attributed to a formation of chelate between iron and organic phytochemicals [53]. These findings allow us to assess the effectiveness and the anticorrosion performance of A. absinthium essential oil RAO.

3.7 Temperature Effect

Generally, temperature effect investigates the impact of temperature on the rate of corrosion and dissolution of the metal [54]. The temperature effect on the ηPDP (%) of the MS in existence and absence of different amount of the RAO oil was investigated by employing PDP technique in the temperature range of 303-333K. The polarization curves are shown in Fig. 10, and the PDP data are regrouped in Table 6.

Fig. 10
figure 10

PDP polarization curves of MS at different uninhibited (a) and RAO-inhibited (b) solution temperatures

Table 6 PDP parameters for MS with and without RAO oil

In the absence of A. absinthium oil, it is obvious that a rise in temperature causes an increase in icorr indicating the impact of corrosive agents on the substrate [55]. However, the addition of the oil RAO to the acidic medium results in a diminishing of icorr values this is due to the inhibitory proprieties of the oil at the temperature range [56]. It is also noticed that the ηPDP (%) decreases steadily with augmenting temperature, it goes from 92.60% to 89.40% suggesting that the organic molecules have been desorbed from the MS surface. However, the ηPDP (%) remains higher than 89% indicating the oil effectiveness is potent even in high temperature.

3.8 Thermodynamic Activation Parameters

In the aim to calculate kinetic parameters for the corroding procedure namely the energy of activation (Ea), the enthalpy and the entropy ΔHa and ΔSa, respectively, results obtained from the temperature effect investigation enabled us to represent ln(icorr/T) as well as ln(icorr) as a function of 103/T (Fig. 11).

Fig. 11
figure 11

Arrhenius lines (a) and Arrhenius transition lines (b) of the studied system

We have obtained quiet Straight lines, from which we have applied Arrhenius equation and Arrhenius transition state for calculating the activation parameters:

$$\ln \left( {i_{{{\text{corr}}}} } \right) = \ln (A) - \frac{{E_{{\text{a}}} }}{RT}$$
(5)
$$\ln \left( {\frac{{i_{{corr}} }}{T}} \right) = \left[ {\ln \left( {\frac{R}{{Nh}}} \right) + \left( {\frac{{\Delta S_{a} }}{R}} \right)} \right] - \frac{{\Delta H_{a} }}{{RT}}$$
(6)

Ea/R represents the line slope derived from ln(icorr) vs 103/T, ΔHa/R and (ΔSa/R + lnR/Nh) are the slope and the intersection of ln(icorr/T) vs 103/T, respectively. The calculated thermodynamic parameters are presented in Table 7.

Table 7 Thermodynamic data for the evaluated system

It is obvious that in presence of the A. absinthium oil, Ea of the solution including oil is greater than that of the blank, that is generally attributed to energy barrier growth and active site blockage leading to MS corrosion [57]. The endothermic aspect of the rust process is explained by the positive value of the ΔHa, while the negative value of the ΔSa indicates the electrolyte’s disorder diminishing [58], this is interpreted by the exhaustion of the organic molecules existing in the solution by their association with iron atoms on the MS surface through adsorption process [59].

3.9 SEM Investigation

To closely visualize MS’s morphology and surface, SEM technique have been used. Figure 12a shows the abraded steel surface with few scratches, Fig. 12b demonstrates an extensively damaged surface for the steel emerged in HCl medium without essential oil, however after the inclusion of the RAO oil we can see in Fig. 12c a neat and uniform surface, this finding confirms the fact of existence of a thin layer covering the metal surface and shielding it from damaging ions [60].

Fig. 12
figure 12

SEM pictures of MS (a) in the absence (b) and presence (c) of RAO in 1 M HCl

3.10 UV–Vis Analysis

To further analyze the carbon steel surface and to confirm the development of a complex between ferrous and the MS surface, the UV–Vis analysis has been performed. In this context, we have registered the UV–Vis spectrum of the molar hydrochloric medium including 2 g/l of RAO before and after immersion of the substrate for 24 h, the results are plotted in Fig. 13.

Fig. 13
figure 13

UV–Vis spectrograph of RAO-inhibited acid solution before and after metal immersion

In general, the change in absorbance value and/or shifting of the wavelength suggest that a complex has formed between the two chemicals in solution. According to the plots, we can clearly notice two wavelength bands at 286 nm and 241 nm before immersion. However, after 24 h of dipping, the intensity levels of these wavelength bands decreased from the previous ones, as depicted in Fig. 13. The observed shift in the spectra of the solution ahead of immersion and after submerged of steel is explained by metal–inhibitor interactions and development of complexes involving iron and inhibitors molecules in 1 M HCl.

3.11 Theoretical Conception

3.11.1 DFT Results

The reactivity of the inhibitor is strongly correlated with its adhesion on the MS interface via donor–acceptor interactions [61, 62]. Based on Fukui’s hypothesis, it is possible to predict the manner that the inhibitor will react with the metallic surface using the molecular orbital frontiers HOMO and LUMO. HOMO is the orbital which might act like an electron donor, and the electron donor capacity increases as its EHOMO energy increases [63]. Conversely, LUMO is the orbital capable of accepting electrons, and the inhibitor ability to accept electrons from metal atoms is increased by a lower ELUMO value [64].

The electron density distributions of the frontier orbitals are of great significance in fully explaining the inhibitors adsorption preference [65]. HOMO and LUMO orbital electron density distributions of the five chosen inhibitors are illustrated in Fig. 14.

Fig. 14
figure 14

Optimized structure, HOMO, LUMO, and ESP pictures of β-pinene, camphor, eucalyptol, terpene-4-ol, and pulegone molecules (Color figure online)

For understanding electrophilic engraving spots and nucleophilic reactions, molecular electrostatic potential (ESP) is connected to electrical density and is an extremely valuable descriptor [66]. The primary compounds found in RAO oil are shown in Fig. 14 by their ESPs. Positive (blue) and negative (red) sections of the ESP are correlated with nucleophilic and electrophilic reactivity, respectively [67]. It is apparent that the areas richer in electrons are primarily around oxygen atoms and conjugated double bonds. As a consequence, MS functions as an electrophile which is able to attract nucleophilic centers (heteroatoms with free electron pairs) from inhibitory molecules.

As shown in Table 8, the EHOMO values of the inhibitors studied decrease in order: β-pinene < terpene-4-ol < pulegone < eucalyptol < camphor, indicating that their capacity to transfer electrons to the MS interface increases by: β-pinene > terpene-4-ol > pulegone > eucalyptol > camphor. The capacity of an inhibitory molecule in interacting with the steel’s surface can also be evaluated by exploring the energy gap (ΔE); the difference between ELUMO and EHOMO. The inhibitor’s reactivity toward metallic surface increases with the ΔE decreases [68]. The ΔE values summarized in the table are as follows: eucalyptol > terpene-4-ol > β-pinene > camphor > pulegone, demonstrating an increase in the examined compounds’ reactivity toward the metallic surface in the order: eucalyptol < terpene-4-ol < β-pinene < camphor < pulegone.

Table 8 Quantum functions for the essential molecules of RAO molecules

Electronegativity (χ) is an important concept which demonstrates the molecule’s ability to gather electrons from its electronic surrounding. This chemical parameter may also provide details on the inhibitor’s reaction with the metallic surface. The table shows that the χ of the investigated chemicals increases in the sequence: eucalyptol < β-pinene < terpene-4-ol < camphor < pulegone. Global hardness (η) and its reciprocal global softness (σ) are two chemical concepts that are extremely useful for understanding the reactivity between inhibitor and the surface of the bulk metal. η is considered as the electron cloud’s resistivity to polarization or chemical species deformity during the chemical reaction. It is anticipated that inhibition performance will increase at higher molecular σ and lower molecular η. Based on the outcomes reported in the table, η values increase in the following order: pulegone < camphor < β-pinene < terpene-4-ol < eucalyptol, which means that the σ values increase in the opposite direction: eucalyptol < terpene-4-ol < β-pinene < camphor < pulegone.

3.11.2 MC Simulation

MC simulations make it feasible to forecast the actions of inhibitor compounds on metal surfaces. The found adsorption configuration and positions of selected organic compounds were indicated in Fig. 15.

Fig. 15
figure 15

MC simulation results: setups and adsorption positions of β-pinene, camphor, eucalyptol, terpene-4-ol, and pulegone molecules on the Fe(110) surface

Figure 15 shows the adsorption energies for the compounds. The Eads result from the energy produced during the adhesion of the relaxed components to the substrate. Eads is the result of adding the rigid distortion and adsorption energies of the adsorbent component. The evidence of elevated negative adsorption energy values reveals an increased interaction between Fe(110) and an inhibiting molecule. According to these results, the order of inhibitory potency of selected compounds is as follows: terpene-4-ol > pulegone > camphor > eucalyptol > β-pinene (Fig. 15).

3.11.3 MD Simulation

Molecular dynamics simulations were performed to examine sorption comportment of inhibitors β-pinene, camphor, eucalyptol, terpene-4-ol, and pulegone on the Fe(110). Interaction of the inhibitory compounds with the iron surface Fig. 16 exhibits the best adsorption patterns for various substances from Fig. 17, it is clear that the five molecules under investigation (β-pinene, camphor, eucalyptol, terpene-4-ol, and pulegone) are almost plane-oriented adsorbed to the surface of the steel. According to the quantum chemical study, the oxygen atoms in the examined compounds can transfer electrons to the vacant “d” iron orbital to form coordinating bonds, whereas orbitals π can accept electrons from the iron orbit “d” to form coordinating bonds.

Fig. 16
figure 16

Results of MD simulations: adsorption configurations and locations of β-pinene, camphor, eucalyptol, terpene-4-ol, and pulegone molecules on the Fe(110) surface

Fig. 17
figure 17

Distribution of the Eads for the major molecules of RAO oil onto the Fe(110) surface via MC simulations

The binding length of the Fe to the α-pinene, β-pinene, camphor, eucalyptol, and pulegone molecules was calculated using the RDF analysis. The various types of formed links were identified through the calculation of the bond length values. It is also revealed that the values of metal–oxygen bonds describe the type of adsorptive activity that takes place over the metal [1]. Chemisorption is considered to be occurring when the RDF peak is observed between 1 and 3.5 Å, while over this value, bond length shows the physisorption behavior.

As indicated, the closeness of the phytochemicals atoms on the metal surface (Fig. 18) confirms the presence of a relatively significant interaction between the inhibitors and the metallic substrate. This sustains the inhibitor’s reflective inhibitory performance [2, 3].

Fig. 18
figure 18

RDF of the C and O atoms for the major molecules present in RAO oil, obtained via MD

3.12 Adsorption Process

The inhibitor under investigation adheres to the metal surface by displacing H2O molecule that has initially been adsorbed; this process can be described by the expression bellow:

$${\text{In}}h_{{\text{(sol)}}} + n{\text{H}}_{{2}} {\text{O}}_{{({\text{ads}})}} \to {\text{In}}h_{{({\text{ads}})}} + n{\text{H}}_{2} {\text{O}}_{{({\text{sol}})}}$$

Inhibitor in solution is referred to Inh(sol), Inh(ads) is the inhibitor adhered to the MS surface, while H2O(sol) is water molecules existing in solution and H2O(ads) is the atoms that were initially engraved on the steel’s surface, whereas n is the number of molecules of water (H2O). that have been replaced by the inhibitor. The protonated form of A. absinthium oil molecules can interact electrostatically (physisorption) and via a synergistic interaction involving the pre-adhered Cl, also interactions can occur between heteroatoms and aromatic rings lone pair electron and those in d-orbital of Fe atoms (chemisorption) [69] (Fig. 19). Additional negative charges that accumulate on the surface of iron might be donated to essential oil molecular π* anti-bonding (retro-donation) [70]. Based on the analysis and assumptions provided above, we can conclude that our oil adsorbs physically and chemically on the iron and blocks the engaged sites thus mitigating corrosion in the aggressive medium [71].

Fig. 19
figure 19

The proposed mechanism of inhibition by RAO

3.13 Comparison of Inhibitive Power with Ozther Essential Oils

Literature study shows that essential oils exhibit great anticorrosive properties, Table 9 shows the inhibitive power of some essential oils.

Table 9 Comparative table of the performance of various essential oils

Due to their non-toxic effect, green plants exhibit biological and anti-corrosive proprieties, in this regard, plant extracts prove more interest than commercial inhibitors, it is crucial to recognize that all parts of plant (roots, stem, fruit, peel, seed) contribute to the inhibition of corrosion, however leaves have shown great richness in phytochemicals [75]. It is evident that the protection of the metal or allow in the acidic medium provided by these active chemicals results from their adsorption and development of a barrier that blocks the active sites For all plants extracted oil, the inhibitive power occurs by a synergic effect that includes constituents present in the oil [76]. By comparing table results we can notice that the A. absinthium oil is a powerful inhibitor against corrosion in HCl medium, even at low concentration 2 g/l the RAO oil showed the best inhibitory efficiency.

4 Conclusion

As a result of this investigation, we can conclude that A. absinthium oil can be employed for MS in HCl media as a powerful corrosion inhibitor. This oil has an exceptionally potent inhibitory power. PDP results reveal that the essential oil is described as an inhibitor of mixed type, it has an impact on both the cathodic and anodic reactions, and Tafel law is validated. Also, EIS findings show that the increase of the organic molecule concentration decreases the capacitance of the double layer and the oil’s sorption to the surface of the steel impedes the charge transfer. On the other hand, WS reveals that adding oil to the acidic solution lowers the rate of corrosion in deed the ηw(%) reached 91.63% at the optimum concentration 2 g/l which is closely correlated with the outcomes obtained by the PDP (92.60%) and the EIS (91.85%) techniques. Thus, excellent agreement is seen between the potentiodynamic polarization, gravimetric, and EIS measurements. The immersion time study indicates that a progressive creation of a protective layer on the substrate’s surface, while the impact of temperature demonstrates that the IE (%) decreases steadily with augmenting temperature, and its adsorption conforms to the isotherm model of Langmuir. The surface analysis techniques confirm the existence of a barrier protecting the metal. Finally, the quantum investigation proves the validity of the experimental study.