1 Introduction

The industries are based on a large amount of their manufacture on metals, especially mild steel due to its remarkable importance in nearly every sphere of life and industrial applications like mechanical equipment, ships, marine structures, process industries, power plants and building construction [1,2,3]. The mild steel until today is deteriorated by the corrosion in the aggressive environment, notably the acids [4]. From an economic, there is an urgent need to innovative new solution to control mild steel corrosion. During the past decade, a number of inhibitors have been reported. Most of the effective corrosion inhibitors are organic compounds, which contain electronegative atoms (such as nitrogen, phosphorus, sulfur and oxygen atoms), the unsaturated bonds (such as double bonds or triple bonds) and the plane conjugated systems including all kinds of aromatic cycles in their molecular structures [5,6,7,8,9,10]. In addition, the geometric flatness of a molecule is a very important factor that will help this molecule to adsorb well on the metal surface [11].

The 8-hydroxyquinoline derivatives are proved good corrosion inhibitors for steels, especially in the hydrochloric acid medium [12,13,14,15,16]. In our previous works, we have successfully prepared some 8-hydroxyquinoline derivatives and applied them in the inhibition of steel corrosion and as a powerful antibacterial agent [17]. On the other hand, over the past years, the benzimidazoles derivatives have gained great attention due to their unique properties. This class of organic compounds, in general, contains many advantages, which has increased their application as corrosion inhibitors [18]. Recently, several works have been published on the inhibition of corrosion of certain derivatives of 8-hydroxyquinoline used as corrosion inhibitors in hydrochloric acid medium. It is noted that all substituted quinoline compounds act as good corrosion inhibitors and their inhibition increase with their concentrations [19, 20]. The use of the quinoline derivatives as corrosion inhibitors have been widely reported by several authors [21, 22]. As an example, Table 1 reports the percentage inhibition efficiency for some selected quinoline derivatives used as corrosion inhibitors in 1.0 M HCl medium. The values of inhibition efficiency, given in this table, were obtained using EIS measurement after 1/2 h of immersion in 1.0 M HCl solution containing 10−3 M of quinoline derivative at 298 K. By comparing these data, we can show that our quinoline derivative (QN1) is the best effective inhibitor in 1.0 M HCl. Moreover, we get a high value of efficiency even at a lower concentration of this quinoline derivative (93.5% at 10−6 M of QN1).

Table 1 Percentage inhibition efficiency for different quinoline derivatives in 1.0 M HCl (the concentration used is 10−3 M)

The novelty of this work were the synthesization of two new polyfunctional heterocyclic products based on 8-hydroxyquinoline and the characterization of these compounds using IR, NMR spectroscopy and elemental analysis methods. However, we tested the two new synthesized compounds as a corrosion inhibitor for M-steel in 1.0 M HCl. The corrosion study was carried out by the electrochemical (PDP and EIS study) and theoretical techniques (DFT calculations and Monte Carlo simulation). However, we tested the two new synthesized compounds as a corrosion inhibitor for M-steel in 1.0 M HCl. The corrosion study was carried out by the electrochemical (PDP and EIS study) and theoretical techniques (DFT calculations and Monte Carlo simulation). The metal surface was characterized by SEM coupled with EDS, and the gravimetric solutions were analyzed by UV–visible spectrometry.

2 Materials and Methods

2.1 Synthesis of N-Heterocyclic Compounds Benzimidazole Based on 8-Hydroxyquinoline QN1 and QN2

The synthesis of benzimidazole compounds based on 8-hydroxyquinoline was carried out in three steps:

The first step is the preparation of the benzimidazole derivatives (1 and 2) by the reaction of ortho-phenylenediamine with 4-formylbenzoic acid in dimethylformamide (DMF) at reflux, in the presence of sodium dithionite (Na2S2O4) for activation of the aldehyde function. The second step is the preparation of 5-chloromethyl-8-hydroxyquinoline from 8-hydroxyquinoline (3) by acid bubbling at room temperature for 24 h. The last step consists in condensing the benzimidazole derivatives (1 and 2) with 5-chloromethyl-8-hydroxyquinoline hydrochloride (3) in acetonitrile (CH3CN) in the presence of potassium carbon (K2CO3) at refluxing for 24 h.

2.2 Procedure

0.01 mol of 2-alkylbenzimidazoles (1 et 2) is mixed with 0.02 mol of 5-chloromethyl 8-hydroxyquinoline hydrochloride (3) in 50 mL of dimethylformamide (DMF), in the presence of 0.01 mol of potassium bicarbonate (K2CO3). The reaction mixture is heated at 80 °C. The reaction is monitored by TLC, using a mixture of EtOH-CH2Cl2 (70:30) as eluent, and when the latter indicates the complete consumption of the starting products after 24 h, the reaction mixture is concentrated. To the rotary vacuum evaporator of the water pump, the residue thus obtained is hydrolyzed with 20 mL of water saturated with NaHCO3 and extracted with chloroform. The crude residue obtained is purified by chromatography on a column of silica gel, followed by recrystallization from EtOH-DMF (70:30).

The synthesis and characterization of compound 3 have been already published in another publication [23]. For the synthesis of the benzimidazole derivatives (1 and 2), we have followed a method already described in the literature [23] (Scheme 1).

Scheme 1
scheme 1

Path of synthesis of QN1 and QN2

2.3 Material and Electrolyte

The mild steel samples were used with C, 0.11; Si, 0.24; Mn, 0.47; Cr, 0.12; Mo, 0.02; Ni, 0.1; Al, 0.03; Cu, 0.14; Co, < 0.012; V, < 0.003; W, 0.06; Fe, balance, and the remainder of iron. Before any measurement, they were abraded with a series of emery paper grades 180–1200. The specimens are thoroughly washed with double distilled water, degreased with acetone and then dried [23]. The aggressive solution 1.0 M HCl was prepared by the dilution of concentrated HCl (37%) analytical grade with bi-distilled water. In this work, we tested these two synthesized compounds in corrosion inhibition in a concentration range from 10−3 to 10−6 M.

2.4 Electrochemical Study

Electrochemical study was realized in a three-electrode electrochemical cell, composed of a mild steel plate as a working electrode (with an exposed area of 1 cm2), a platinum counter-electrode and an SCE-saturated reference electrode. An electrochemical measurement has been taken using a potentiostat/Galvanostat/PGZ100 controlled by analysis software VoltaMaster4. Electrochemical experiments were analyzed using electrochemical software ORIGIN PRO 6.1. Electrochemical parameters were, then, extracted owing ZView software.

The potential intensity curves were obtained by using potentiodynamic polarization techniques with a scanning speed of 30 mV min−1. Before polarization scans, the electrode was stabilized at OCP for 30 min. Inhibition efficiency was calculated by Eq. 1.

$$ \eta_{\text{PDP}} (\% ) = \left[ {1 - \frac{i}{{i^{0} }}} \right] \times 100 $$
(1)

where (i) and (i0) are the corrosion current density values with and without compounds.

The electrochemical impedance measurements (EIS) were taken on mild steel samples at constant potential (OCP) in the frequency range from 100 kHz to 100 mHz under potentiostatic conditions using an AC signal with amplitude of 10 mV peak to peak. The Bouckamp program was used to analyze the results in terms of the equivalent electrical circuit.

The inhibition efficiency was calculated from the polarization resistance values by using the following relationship 2.

$$ \eta_{\text{EIS}} (\% ) = \frac{{R_{\text{p}} - R_{\text{p}}^{0} }}{{R_{\text{p}} }} \times 100 \, $$
(2)

where \( R_{\text{p}}^{0} \) and \( R_{\text{p}} \) are the polarization resistance in the absence and presence of the compounds.

2.5 Quantum Chemical Calculations and Monte Carlo Simulation

Quantum chemical calculations play a key role to predict the electronic properties and chemical behavior of organic compounds based on some intrinsic features from their molecular structure. Herein, we used the computational tools to back up the experimental inferences and establish a prediction correlation between the electronic structure properties, quantum chemical states and corrosion inhibition efficiency of the studied compounds. In the present theoretical work, we started with complete geometry optimizations for the two compounds using density functional theory (DFT) with the 6-31G (d, p) basis set of atomic orbitals as implemented in the Gaussian 03 program package [24, 25]. Most of the molecular properties have been predicted from frontier molecular orbital (FMO) calculations that include highest occupied molecular orbital (HOMO), lowest unoccupied molecular orbital (LUMO) and energy gap ((∆E(LUMO–HOMO))

$$ \left( {\Delta E = E_{\text{LUMO}} - E_{\text{HOMO}} } \right) $$
(3)

The fraction of electrons transferred (∆NFET) was calculated as follows:

$$ \Delta N_{\text{FET}} = (\chi_{\text{fe}} - \chi_{\text{inh}} )/2(\eta_{\text{fe}} - \eta_{\text{inh}} ) $$
(4)

where χ and η denote to electronegativity and hardness, respectively.

The Fukui indices on the backbone atoms have been also computed. As part of the computational framework study, the adsorption of compounds on the Fe surface was simulated by applying molecular dynamic approaches. The molecular adsorption was modeled in a simulation box of dimension 24 × 24 × 42 A, constructed from supercell, constructed from supercell of 96 Fe atoms. The spatial coordinates of the Fe atoms at the bulk position were kept frozen, while all other surface atoms were set to relax on the geometry optimization course.

3 Results and Discussion

3.1 Chemical Study

3.1.1 Chemical Data and Value

3.1.1.1 Synthesis of 4-(6-Methyl-1H-benzo[d]imidazol-2-yl)benzoic Acid (QN1)

Yield % 60; Mp 165 °C; Fr 0.63; Aspect Brown solid; IR: 1794 (C=N), 1777 (C=C), 3641 (OH), 1905 (CH2). 1H NMR, δppm 4.64 (s, 2 H, CH2), 2.36–2.48 (DMSO-solvent), 3.25–3.43 (H2O), 4.68 (s, 1 H, OH), 2.05 (s, 3 H, CH3), 12.27 (s, 1 H, OH-carboxylic acid), 7.00–7.26–7.66–8.83–8.84 (m, 5 H, Arquinoline) 7.42–7.44–7.53–8.393–8.42 (m, 7 H, ArH-benzimidazole). 13C NMR δppm 57.56 (CH2), 20.95 (CH3), 153.83 (ArC-OHquinoline), 159.63 (C=O Acid function), 155.39 (C–N), 115.67–122.12–126.88–128.29–129.02 (ArCHbenzimidazole), 132.09–132.33–133.57–148.31–148.23 (ArCbenzimidazole), 111.04–123.49–128.25–15.34 (ArCHquinoline), 127.73–129.74–139.30 (ArC-quinoline). Analysis Elemental % Calculated: C, 73.34; H, 4.68; N, 10.26. Obtained % C, 73.30; H, 4.66; N, 10.24.

3.1.1.2 Synthesis of 4-(1H-benzo[d]imidazol-2-yl)benzoic Acid (QN2)

Yield % 80; Mp 180 °C; Fr 0.61; Aspect Brown solid; IR: 1798 (C=N), 1628 (C=C), 3325 (OH), 1873 (CH2), 2020 (C=O), 1H NMR δppm 5.78 (s, 2 H, CH2), 2.47–2.85 (DMSO-solvent), 3.44 (H2O), 13.25 (s, 1 H, OHcarboxylic acid), 7.00–7.261–7.66–8.83–8.84 (m, 5 H, ArH), 7.42–7.44–7.53–8.39–8.42 (m, 8 H, ArHbenzimidazole). 13C NMR δppm 47.67 (CH2), 148.44 (ArC-OHquinoline), 151.50 (C=OAcid function), 149.45 (C–N), 119.92–123.41–127.81–127.86 (ArCHbenzimidazole), 136.44–136.35–144.71–147.35 (ArCbenzimidazole), 112.27–120.28–126.68–136.50–148.21 (ArCHquinoline), 124.46–130.77–143.10 (ArCquinoline). Analysis Elemental % Calculated C, 72.90; H, 4.33; N, 10.63. Obtained % C, 74.50; H, 4.30; N, 10.66.

The IR spectra of the two compounds QN1 and QN2 show the main bands of elongation vibration characteristics of the functional groups, a very intense band around 2000 cm−1 which corresponds to the asymmetric elongation vibration, a band is observed around 1500 cm−1, it is attributed to the vibration of the CH2 group (the slope between the two functions), and finally an absorption band is observed around 36,009–3900 cm−1 which characterizes the aromatic carboxylic acid function (Ar-COOH).

3.2 Proposal Mechanism

See Scheme 2.

Scheme 2
scheme 2

Mechanism of N-alkylation of 5-chloromethyl-8-hydroxyquinoline hydrochloride by benzimidazole derivatives

3.3 Open Circuit Potential

Figure 1 presents the open circuit potential (OCP) versus time at different concentrations of inhibitors QN1 and QN2 at 298 K.

Fig. 1
figure 1

Evolution of open circuit potential (OCP) versus time for MS in 1.0 M HCl medium with and without the addition of QN1 and QN2 at 298 K

It is noted that the potential for blank solution stays stable with time. This phenomenon characterizes the corrosion of mild steel with a formation of corrosion products. So, in the presence of QN1 and QN2, the potential shift in the anodic direction and speedily declined and touched a steady rate after 200 s. The disbanding of oxide layer [26] and the adsorption particles on the substrate of MS are the foremost explanations for the detected OCP weakening [26].

3.4 Potentiodynamic Polarization Study

The curves of the potentiodynamic polarization of the M-steel in 1.0 M HCl with and without different concentrations of all compounds are shown in Fig. 2. The PDP considerations and the inhibition efficiency of both compounds are given in Table 2.

Fig. 2
figure 2

Potentiodynamic polarization curves of MS in 1.0 M HCl medium with and without the addition of a QN1 and b QN2 at 298 K

Table 2 Potentiodynamic polarization data’s for mild steel in 1.0 M HCl with and without the different concentrations of inhibitors at 298 K

Figure 2 shows that the cathodic and anodic reactions are affected in the presence of QN1 and QN2. This implies that the presence of QN1 and QN2 in 1.0 M HCl solutions impedes the cathodic hydrogen evolution and anodic dissolution reaction of MS; this observation shows that QN1 and QN2 exhibit anodic and cathodic inhibition effects. QN1 and QN2 cause a notable decrease in current density and corrosion rate values. With the presence of QN1 and QN2, the cathodic/anodic polarization plots reveal that the curve shifted toward lower current density. This trend indicates that the steel surface active site was blocked owing to the QN1 and QN2 molecules adsorbed. Anodic and cathodic corrosion reactions of mild steel samples were significantly inhibited by QN1 and QN2 which suggest QN1 and QN2 as a mixed type. The QN1 and QN2 adsorption on the mild steel surface possibly will not appreciably change the cathodic branch slope and shape, signifying that the hydrogen evolution mechanism does not change after inhibitor adsorption. Minor displacement in Ecorr value to negative site (Table 2) was observed. In this way, if the corrosion potential displacement is superior than ± 85 mV compared to that of blank, the inhibitor may be observed as a cathodic or anodic type [27, 28]. Though the change in Ecorr value with the sample without inhibitor is below 85 mV, confirming the mixed-type nature of QN1 and QN2.

It is very clear from the table that the presence of QN1 and QN2 in the 1.0 M HCl solution affects the Tafel slopes values. However, it is noticed that the change in βc values of the inhibited systems with respect to that of the blank is independent of inhibitor concentration, that is, there is no pattern in βc values of the inhibited solution with respect to that of the blank as the concentration of QN1 and QN2 is increased. This means that the kinetics of the cathodic reactions are not affected and the inhibition is by simple geometric blocking mechanism [29, 30]. On the contrary, a steady decrease in βa value with increasing QN1 and QN2 concentration is observed. For instance, the presence of 10−6 M QN1 and QN2 in the corrosive medium decreases the βa value from 150 to 99 mV dec−1 for QN1 and to 77 mV dec−1 for QN2. When the concentration was raised to 10−3 M, the βa value further decreases to 86 mV dec−1 for QN1 and 71 mV dec−1 for QN2. This implies that the kinetics of the iron dissolution in 1.0 M HCl solution is modified during the inhibition process by these two compounds [31].

The icorr was also observed to decrease when the inhibitor concentration increased, denoting more QN1 and QN2 molecules adsorption on the mild steel surface. The \( \eta_{\text{PDP}} (\% ) \) increases with increasing compound concentrations and reaches an optimal value ranging from 97.7 to 91.6% at 10−3 M for QN1 and QN2, respectively. It is also evident that the \( \eta_{\text{PDP}} (\% ) \) followed the order QN1 > QN2. This result can be explained by the presence of the electron donor methyl group on the molecular structure of the compound QN1.

3.5 Electrochemical Impedance Measurements

The corrosion inhibition property of QN1 and QN2 on mild steel was also examined by electrochemical impedance spectroscopy (EIS) in order to confirm the above-obtained results and to study the inhibition mechanism in more details. Figure 3 presents the Nyquist diagrams of mild steel obtained at open circuit potential in 1.0 M HCl solution in the absence and presence of QN1 and QN2 at different concentrations after 30 min of immersion at 298 K. As shown in this figure, we remark that when QN1 and QN2 are added to the 1.0 M HCl solution, the size of the impedance diagram increases as the concentration rises and consequently the inhibitory efficacy increases, due to the adsorption of inhibitor molecules on the metal surface [32].

Fig. 3
figure 3

Nyquist diagrams of steel in 1.0 M HCl with and without different concentrations of a QN1 and b QN2 at 298 K

Examination of Fig. 3 reveals that each impedance diagram in the presence and the absence of QN1 and QN2 at different concentrations consists of a capacitive loop at high frequency (HF). The capacitive loop is usually associated with the single charge transfer process of the metal corrosion and double layer behavior [32]. The depressed semicircles are generally attributed to the frequency dispersion, arising from roughness and inhomogeneity of electrode surface [33]. So, in such cases an constant phase element (CPE) is used instead of a pure capacitor to compensate for non-ideal capacitive response of the interface to get a more fit of experimental data [34] and the impedance is given by Eq. 5:

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

where Q is proportionality coefficient (in Ω−1 sn cm−2), ω is the angular frequency and i is the imaginary number, n is the deviation parameter (−1 ≤ n ≤ + 1), has the meaning of a phase shift. While n = 0, the CPE represents a pure resistor, for n = − 1 and inductor and for n = + 1, a pure capacitor [35]. In this study, the best fit of the extracted experimental data is obtained for the equivalent circuit given in Fig. 4. Figure 4 shows the electrical equivalent circuit diagram to model mild steel/1.0 M HCl interface which consists of a CPE, polarization resistance (Rp) and solution resistance (Rs).

Fig. 4
figure 4

Equivalent circuit corresponding to the impedance spectra

A constant phase element (CPE) is used instead of a pure capacitor to compensate for non-ideal capacitive response of the interface [36]. Rp is corresponding to the corrosion reaction at a mild steel substrate/solution interface, whose value is a measure of electron transfer across the surface and is proportional to corrosion rate. It is clear that the measured impedance plots are in accordance with those calculated by the used equivalent circuit model. All the corresponding fitted parameters are listed in Table 3. The values of double layer capacitance (Cdl) in the absence and presence of QN1 and QN2 were calculated using the following equation [37]:

Table 3 Impedance parameters and corrosion inhibition efficiency of mild steel in 1.0 M HCl at different inhibitor concentrations of QN1 and QN2
$$ C_{\text{dl}} = \left( {QR_{p}^{1 - n} } \right)^{1/n} $$
(6)

The capacitive behavior of mild steel in the presence of QN1 and QN2 could be visualized from Bode’s plot (Fig. 5). A destructive outbreak of HCl acid corroded the mild steel and made the metal surface highly asymmetrical, which could be explained out by the small phase angle. On the contrary, adsorption of the inhibitors on mild steel surface effectively lowered surface irregularities; additionally, we address the evolution of phase angle by measuring their values at arbitrarily chosen frequency (100 Hz) (Fig. 5). Clearly, with increasing concentration of both inhibitors the phase angle values dramatically increase as well. Furthermore, whatever the concentration used, the phase angle values are higher than that of the blank, which also describes the non-ideal capacitor [38]. This indicates an increased capacitance of the interference due to the presence of adsorbed inhibitors molecules at the interface [38]. Indeed, only one time constant is detected on the Bode diagram without and with various concentrations of QN1 and QN2.

Fig. 5
figure 5

Bode’s plots and Phase angle values for mild steel in 1.0 M HCl solution with and without different concentrations of QN1 and QN2 at 298 K

Analysis of the impedance results in Table 3 shows that the polarization resistance value, RP, increases with the concentration of QN1 and QN2 and reaches a maximum value 1 mM. The increase in Rp values demonstrates the improved protective effect of those compounds, and a slow corroding system, due to the gradual replacement of water molecules by QN1 and QN2 molecules on the surface and consequently to a decrease in the number of active sites necessary for the corrosion reaction [39]. In addition, the adsorption of both compounds on the steel surface was confirmed by decreases in double layer (Cdl) capacity values at different concentrations [39]. This decrease of Cdl with concentrations can be explained by a decrease in the local dielectric constant and/or an increase in the protective layer thickness on the electrode surface. This trend is in accordance with Helmholtz model, given by the following equation.

$$ C_{\text{dl}} = \frac{{\varepsilon_{0} \times \varepsilon }}{e} \times S $$
(7)

where ε is the dielectric constant of the protective layer, ε0 is the permittivity of free space (8.854 × 10−14 F cm−1) and S is the effective surface area of the electrode. It is worth pointing that the rise in the deviation parameter (n) values after the inhibitors addition, which can be related to a decrease in surface inhomogeneities caused by adsorption of the QN1 and QN2 molecules on mild steel surface [40].

3.6 Temperature Effect and Kinetic Activation Parameters

The temperature has been instrumental in our understanding and approach to study the corrosion of steel. Also, to calculate the thermodynamic parameters of activations [41], the temperature parameters are given in Table 4 and Fig. 6.

Table 4 Evolution of the temperature and the activation parameters for M-steel in 1.0 M HCl in the presence of 10−3 M of QN1 and QN2
Fig. 6
figure 6

Effect of temperature on the polarization curves of a mild steel in 1.0 M HCl and in the presence of b QN1 and c QN2

The activation parameters we were aiming in our work:

The activation energy (Ea) which is calculated by the Arrhenius equation (Eq. 8, Fig. 7):

$$ i_{\text{corr}} = A\exp \left( {\frac{{ - E_{\text{a}} }}{RT}} \right) $$
(8)

Ea activation energy of the reaction, R constant perfect gas (8.314 J mol−1 K−1), a preexponential factor, T temperature in Kelvin.

Fig. 7
figure 7

Arrhenius lines calculated from the polarization curves of mild steel in 1.0 M HCl with and without the addition of inhibitors at different temperatures

The activation enthalpy (ΔHa) and the entropy activation (ΔSa) that they are calculated by the extrapolation of the Arrhenius equation (Eq. 9, Fig. 8):

$$ i_{\text{corr}} = \frac{RT}{Nh}\exp \left( {\frac{{\Delta S_{\text{a}} }}{R}} \right)\exp \left( {\frac{{ - \Delta H_{\text{a}} }}{{RT^{{}} }}} \right) $$
(9)

where N and h are the Avogadro’s and the Plank’s constants, respectively.

Fig. 8
figure 8

Variation of Ln (icorr/T) versus 1000/T in 1.0 M HCl with and without the addition of inhibitors at different temperatures

From Table 4, we can see that the increase in temperature did not significantly affect the values of the inhibitory efficiencies, so it can be said that our compounds are resistant to the corrosion of high-temperature steel. Therefore, these two compounds are profitable on an industrial scale for example in stripping baths. Always in Table 4, the activation energy value of the blank solution (Ea) reported significantly less than the other two compounds (QN1 and QN2). In light of this result, it can be said that the addition of the two compounds caused the birth of the energy barriers resulting by the interaction of the system; inhibitor/substrate/1.0 M HCl. This says that our compounds are adsorbed on the surface of the steel [42]. In this study, the corrosion reaction is spontaneous that appear by the positive values of the activation enthalpy (ΔHa) in the absence and in the presence of the compounds QN1 and QN2. The spontaneity of reaction has an advantage of minimizing energy [43]. The increase of \( \Delta S_{\text{ac}} \) value in the inhibited media compared to the uninhibited which implies that a rise in the disordering of the inhibited electrolyte [43].

In this work, the temperature parameters show that our N-heterocyclic compounds are profitable at high temperatures. However, the activation parameters also show that our compounds are very absorbed on the surface of the steel in 1.0 M HCl.

3.7 Thermodynamic Parameters of Adsorption

In particular, the thermodynamic parameters of adsorption are a dominant feature in the field of corrosion of steels to understand the mechanism of interaction between inhibitors and the surface of steel [44]. One of the thermodynamic parameters we have been interested in this work is the adsorption energy (\( \Delta G_{\text{ads}}^{{^\circ }} \)). The adsorption energy (\( \Delta G_{\text{ads}}^{{^\circ }} \)) is calculated following Eqs. (10, 11) [44]:

$$ \frac{C}{\theta } = \frac{1}{{K_{\text{ads}} }} + C $$
(10)
$$ \Delta G_{\text{ads}}^{{^\circ }} = - RTLn\left( {K_{\text{ads}} \times C_{\text{ads}} } \right) $$
(11)

In this study, we try several adsorption isotherms and we found that the best isotherm is Langmuir isotherm {(The preexponential factor R2 is close to unity (Fig. 9)}. The obtained isothermal data are shown in Table 5.

Fig. 9
figure 9

Langmuir adsorption isotherm of inhibitors on the surface of mild steel in HCl at 298 K

Table 5 Adsorption parameters calculated for inhibitors from the Langmuir isotherm

According to the literature, based on adsorption energy (\( \Delta G_{\text{ads}}^{{^\circ }} \)) values have concluded the type of adsorption (physisorption or chemisorption) [45]. In our case, the adsorption energy (\( \Delta G_{\text{ads}}^{{^\circ }} \)) values are lower than − 40 kJ mol−1 for two compounds QN1 and QN2. This shows that our compounds have much better adsorbed on the surface of the M-steel (MS) by chemical bonds (chemisorption), which justifies the good resistance to high temperature.

3.8 UV–Visible Spectroscopy

The UV–visible spectrometry is used in several important areas of study, based on the museums of the maximum wavelength [46]. In our case, we used UV–visible (UV–Vis) to confirm the complexing property of our compounds with M-steel in molar HCl. The observation of Fig. 10a, b shows that the maximum wavelengths (λmax) have a displacement in the case of adding the two inhibitors of 285.81 at 254.42 nm for the compound QN1 (Fig. 10a) and 251.91 at 256.37 nm for the compound QN2 (Fig. 10b). These data show that our compounds have a good complexing property with iron ions, which confirms the good inhibitory efficiency (97% for the compound QN1).

Fig. 10
figure 10

UV-visible spectra of 1.0 M HCl solution containing 10−3 M of a QN1 and b QN2 before and after 6 h of mild steel immersion

3.9 SEM/EDAX

The role of electronic scanning microscope in surface characterization of steels has received increased attention across a number of disciplines in recent years [47]. The observation of surface image in HCl alone (Fig. 11c) shows that the surface was destroyed by corrosion. However, after the addition of the N-heterocyclic compounds QN1 and QN2 (Fig. 11a, b) in the corrosive solution, the surface of M-steel was protected by the layers of the organic compounds. The analysis by the scanning electron microscope confirms the inhibitory effect of these two compounds; thus, the SEM shows that both compounds are very adsorbed on the surface of the M-steel. This is in good agreement with the president studies. In addition, the elemental analyses obtained by EDAX analysis show that the heteroatoms such as N and O present in the molecules QN1 and QN2 are in contact with the MS surface and could serve as adsorption sites. This confirms the better adsorption of the two compounds on the surface of the steel [47].

Fig. 11
figure 11

Surface analysis of M-steel before (c) and after (a, b) submersion for 6 h in 1.0 M HCl with 10−3 M of QN1 and QN2, respectively

3.10 Theoretical Calculations (DFT)

It is well established that the EHOMO is connected to the capacity of molecule to donate electrons, which commonly refers to as ionization potential. The higher the EHOMO, the higher the ability of compound electrons to the good electron acceptor [19]. On the other side, the ELUMO is related to the electron-accepting capability of the compound, which commonly refers to as electron affinity [19]. The lower the ELUMO, the greater the ability of compounds to accept electron in chemical interaction [19]. A potential inhibitor is the one with combined electronic properties features, having higher EHOMO to contribute the electrons toward the empty d-orbital of the corroding metal and lower ELUMO value to accept the electrons transferred from the Fe surface, furthermore, when the energy gap ∆E is at minimum, since smaller values of the ∆E coincides with greater inhibition effect of the molecule. The most relevant quantum chemical parameters such as EHOMO, ELUMO, ∆E and ∆N values were calculated and are presented in Table 6. In the present study, we aimed to carry out experimental and modeling studies and explore the effect of molecular surface on the inhibition performance of the inhibitor molecules. The optimized compound structure with HOMO and LUMO maps is shown in Fig. 12.

Table 6 Quantum chemical parameters of compounds QN1 and QN2
Fig. 12
figure 12

Optimized molecular structures, HOMO and LUMO orbitals of molecules obtained by using DFT/B3LYP/6-31 G (d, p). Oxygen O is shown in red color and nitrogen N is in blue color

In this search, the introduction of –CH3 group in the molecular structure moiety as in QN1 has a significant effect to increase the electron donating ability of molecules [48]. This can be indicated from the higher value of EHOMO compared to its counterpart QN2 with hydrogen. It is found that QN1 also has lower ELUMO indicating the higher capacity to accept electron than QN2, and this is always required feature of organic compounds in chemical interaction like in our case adsorption. The gap energy of QN1 is lower than in QN2, which is considered an important structure stability index of compounds. Usually, softer molecules have smaller ∆E signifying greater polarizability of compounds, which is another important feature of promising corrosion inhibitor. Another important parameter is the ∆N value which describes the inhibition due to electron donations [48]. It is accepted that when ∆N < 3.6, the inhibition effectiveness increases with enhancing donation-electron ability to the Fe surface of Fe. The ∆N of QN1 is higher than QN2 which indicated that more electron can transfer from HOMO to d-orbitals of Fe surface. This inference further substantiates the experimental conclusions.

The susceptibility of molecule for polarization in the presence of an external electric field can be described by Fukui indices. Fukui indices (Table 7) provide insightful inference into the reactive atomic sites on inhibitor molecule structure. The f+, denoted to the change in the electronic density when a molecule accept charge indicating the molecular reactivity toward nucleophilic attack. Accordingly, the highest value of f+ represents a preferred site for nucleophilic attack, whereas f corresponds to the reactivity of atoms toward the electrophilic attack when the molecule releases electrons. The highest value of f is associated with electrophilic attack. Table 7 lists the atomic sites that is likely act as nucleophilic sites and other atoms that can serve as electrophilic sites.

Table 7 Fukui indices for the nucleophilic and electrophilic attacks of QN1 and QN2 calculated using the DFT method

3.11 Monte Carlo Simulation

Metropolis Monte Carlo simulation method is a powerful technique used to better characterize the surface–adsorbate interaction identifying the favorable lowest energy adsorption configurations for the adsorbate components on Fe surface [25].

The top and side views of the most stable adsorption configurations of QN1 and QN2 on Fe (110) surface using Monte Carlo simulations are shown in Fig. 13.

Fig. 13
figure 13

Equilibrium configuration of inhibitors in aqueous systems obtained by MC simulations

It appears from Fig. 13 that QN1 and QN2 molecules are adsorbed in a flat parallel orientation so that the heteroatoms of each moiety of the molecule could interact with the iron surface. However, the methyl(–CH3) substituent at position 12 of QN1 molecule is adsorbed in a similar parallel mode which enhances the parallel adsorption orientation on the iron surface, while the benzene ring system adsorbed a perpendicular orientation on the iron surface, this increases the surface coverage and ensures strong interaction, and therefore, a high inhibition effect is observed experimentally [25]. The outputs and descriptors estimated by the Monte Carlo simulation, such as the total adsorption, rigid adsorption and deformation energies, are listed in Table 8.

Table 8 Selected energy parameters obtained from MD simulations for adsorption of inhibitors on Fe (110) surface

The absorption energy is one of the most important parameters for adsorption; it is attributed to the energy released when the adsorbed adsorbate components are relaxed on the metal surface. The adsorption energy is defined as the sum of rigid adsorption and deformation energies of the adsorbate component. More negative adsorption energy value attributes to a big stabilized and strong interaction between adsorbed molecules and metal. Another parameter dEad/dNi has been reported in Table 8, which is corresponding to the energy of substrate–adsorbate configurations where one of the adsorbate components has been removed [49]. As can be seen from the data in table that the negative values of adsorption energies of QN1 and QN2 on the Fe(110) surface are classified in the following order: QN1 < QN2 which is in good agreement with the experimental inhibition efficiency values.

3.12 Corrosion Protection Mechanism

The corrosion inhibitor could be adsorbed on the mild steel surface and form a protective layer to improve the corrosion impedance of mild steel by decreasing the corrosion rate [50]. In general, the inhibitive mechanism is one of three approaches: (1) the chemical approach (chemisorption), where the inhibitor molecules are adsorbed on the metal surface and form a protective film; (2) the inhibitor molecules lead to the formation of a protective layer through oxide protection of the base metal; and (3) the inhibitor molecules react with the potential corrosive components of the environment and form metal complexes [50].

The adsorption of QN1 and QN2 on mild steel can be clearly defined by considering the chemisorption processes (according to Sect. 3.7). The specific mechanism of corrosion inhibition of QN1 or QN2 to the surface of mild steel coupons is detailed in the following equations:

$$ {\text{Fe}} + {\text{QN}}1 \leftrightarrow {\text{Fe}}\left( {{\text{QN}}1} \right)_{\text{ads}} $$
(12)
$$ {\text{Fe}}\left( {{\text{QN}}1} \right)_{\text{ads}} \leftrightarrow {\text{Fe}}^{2 + } + {\text{QN}}1_{\text{aq}} + {\text{ne}}^{ - } $$
(13)
$$ {\text{QN}}1_{\text{aq}} + {\text{H}}_{2} {\text{O}}_{\text{ads}} \leftrightarrow {\text{QN}}1_{\text{ads}} + {\text{H}}_{2} {\text{O}}_{\text{aq}} $$
(14)

The chemisorption of QN1 or QN2 on mild steel is denoted by the donor–acceptor interactions between the lone pair of the electron from the carbonyl and amine groups of QN1 or QN2 with the d-orbitals of Fe. The value of free energy from the QN1 or QN2 adsorption was − 46 kJ mol−1. This confirms that the adsorption mechanism of the QN1 or QN2 on the surface of the mild steel coupon was chemically adsorbed. The inhibition of corrosion begins by the displacement of water molecules by the inhibitor’s capacity toward specific adsorption of the inhibitor on the metal’s surface [51].

4 Conclusion

In this study, the results of experimental and theoretical studies show that N-heterocyclic compounds QN1 and QN2 have good corrosion inhibiting efficiencies of mild steel in the 1.0 M HCl solution. The polarization studies have shown that the studied inhibitors work as a mixed-type inhibitor with anodic predominance. The adsorption of the inhibitors on the mild steel surface obeys the Langmuir adsorption isotherm. The MC simulations and DFT calculations give a better overview on the reactivity of tested N-heterocyclic compounds QN1 and QN2 toward mild steel showing good correlation with the experimental results. The UV–visible spectrometry (UV–Vis) and scanning electron microscopy (SEM) confirm the adsorption effect of both inhibitors on the surface of the M-steel.