1 Introduction

Corrosion problem is one of the major economic concerns in the gas and petrochemical industry. Therefore, protection of metallic structures against corrosion is regarded as a very important subject. Oil well acidizing, industrial acid cleaning, acid pickling, and acid descaling are processes in which iron alloys are subjected to acid solutions like hydrochloric acid and sulphuric acid. In these environments, inhibitors are necessary in order to minimize the acid dissolution of iron alloys via adsorption at the metal/solution interface [1]. Most of the accepted acid inhibitors are organic compounds containing oxygen, nitrogen, and/or sulfur atoms. Organic inhibitors often work by adsorbing themselves on the iron surface, protecting it by forming a film [2]. The strength of the adsorption bond is the main factor for organic inhibitors and its effectiveness depends on the chemical structure, their chemical composition, and their affinity. Unfortunately, some of the organic inhibitors used are quite expensive and potentially harmful to the environment because the use of toxic and hazardous chemicals is responsible for various biological risks [3, 4]. Their toxic properties limit the area of application. Therefore, it remains an important goal to find cost-effective inhibitors of the harmless type to protect metals against corrosion. Pyrazole compounds satisfy these requirements [5]. These compounds have a large number of functional adsorption centers (e.g., –OH group, –CH3 group, –C=O, –N=N– group, O and N heteroatoms, and aromatic rings). They are strongly basic, and hence they can be readily soluble in the acid medium. Recently, a few modern procedures are associated to check corrosion inhibitors [6]. The theoretical approach to the present issue continues to be foremost half standard and unbroken to quantum chemical calculations together with confined inhibitor molecules [7] and to few degree to the interaction of inhibitor particles with surface particles through semi-empirical and ab initio strategies [8]. In this way within the field of theoretical examination of corrosion inhibitors, improvement of more reasonable models based on inhibitor found in electrical double layer at metal/solution interface, looks to be in demand. The models applied here take into consideration the solvent, substrate, and electric fields. They are subjected to quantum chemical treatment with appropriate ab initio strategy at density functional theory (DFT) level [9]. In the present work, the inhibiting action of 4-[5-((4-chlorophenyl) diazenyl)-2-hydroxybenzylideneamino]-1,5-dimethyl-2-phenyl-1H-pyrazole-3-(2H)-one (CDHBAP) on the corrosion of mild steel in 1 M HCl solutions has been investigated. Potentiodynamic polarization, Impedance measurements, and weight loss method are used in this study. In addition, thermodynamic method and adsorption of CDHBAP on mild steel were also carried out.

2 Materials and Methods

2.1 Materials Preparation

The weight percentage composition of mild steel specimens is noted as C = 0.05%, Mn = 0.6%, P = 0.36%, Si = 0.03%, and balance Fe. The steel specimens mechanically cut into size of 2.5 × 2.5 × 0.4 cm are used for weight loss and effect of temperature studies. For electrochemical measurements, mild steel specimens of the same composition with an exposed area of 0.5 cm2 are used in araldite. The electrode is polished upto 4/0 grades with a sequence of different abrasive papers. They are then washed with acetone, dried at room temperature, and stored in moisture-free desiccator prior to the corrosion tests. The acid solutions (1 M HCl) are prepared using triple-distilled water and AR grade HCl. The investigated 4-[5-((4-chlorophenyl) diazenyl)-2-hydroxybenzylideneamino]-1,5-dimethyl-2-phenyl-1H-pyrazole-3-(2H)-one) compound is prepared as mentioned [10]. The optimized molecular structure of CDHBAP is given in Fig. 1.

Fig. 1
figure 1

The optimized molecular structure of CDHBAP

2.2 Gravimetric Measurements

The mass loss method is the simplest way to find corrosion rate and inhibition efficiency. In this study, mild steel specimens are immersed in 1 M HCl solutions (100 ml) without and with different CDHBAP concentrations at various temperatures (308–328 K) for 2 h. After 2 h of immersion, the specimens are removed from solution, rinsed with double distilled water, washed with acetone, thoroughly dried, and weighed. The mass of the mild steel specimens before and after immersion is determined with an analytical balance to an accuracy of 0.1 mg. The experiments are carried out three times and the mass losses are averaged. The mass loss (∆M) is used to calculate the corrosion rate (CR) and the inhibition efficiency (IE %):

$${\text{CR}}\left( {{\text{mpy}}} \right)=534 \times {M_{\text{b}}} - {M_{\text{a}}}/{\text{DST}}$$
(1)
$${\text{IE}}\% =\left( {{M_0} - Mi} \right)/{W_0} \times 100,$$
(2)

where Mb and Ma are the mass of specimen before and after immersion in 1 M HCl solutions. M0 and Mi are the mass loss (g) of mild steel in the absence and presence of CDHBAP, respectively, D is the density of mild steel (7.8 g cm−3), S is the area of the specimen (cm2), and T is the period of immersion in hours.

2.3 Electrochemical Measurements

The Model 604D Electrochemical CH analyzer is used for recording Tafel polarization curve. A three-electrode cell configuration is used. The working electrode (0.5 cm2 of mild steel specimen) is exposed to 1 M HCl solutions in the absence and presence of CDHBAP. Platinum and saturated calomel electrodes (SCE) are used as counter and reference electrode, respectively. All electrochemical measurements are performed at 308 K using 100 ml of electrolyte (1 M HCl) in steady state. Before measuring potentiodynamic polarization (Tafel) and electrochemical impedance spectroscopy (EIS), the electrode is immersed for 30 min in 1 M HCl solution with open circuit potential (OCP) to achieve a stable condition. Tafel polarization curves are recorded from − 300 to + 300 mVSCE, (vs. OCP) with a scan rate of 1 mV s−1. All the potentials reported are with reference to SCE. AC impedance measurements are performed in the frequency range from 0.1 Hz to 100 KHz with an amplitude of 5 mV peak to peak using AC signal. The real and imaginary part of the cell impedance are measured for various frequencies in ohms. The charge transfer resistance (Rct) and double-layer capacitance (Cdl) values are calculated using the relation:

$${R_{{\text{ct}}}}=\left( {{R_{\text{s}}}+{R_{{\text{ct}}}}} \right)-{R_{\text{s}}}$$
(3)
$${C_{{\text{dl}}}}=1/2\pi {R_{{\text{ct}}}}{f_{{\text{max}}}},$$
(4)

where fmax is the frequency at maximum in the Nyquist plot, Rs is the solution resistance. Each experiment is run in triplicate to check the reproducibility of the data.

2.4 Spectral and Surface Morphological Studies

2.4.1 Fourier Transform-Infrared Spectroscopy (FT-IR)

FT-IR spectra are recorded using a SHIMADZU-FTIR-8400S spectrophotometer. The spectra for CDHBAP and the protective film formed on the mild steel surface are recorded by carefully removing the film, mixed it with a small amount of KBr powder, and made into the disk.

2.4.2 UV–Visible Spectroscopy Study

Before and after immersion in 1 M HCl solution with optimum CDHBAP concentration (100 ppm), a spectrophotometric UV–visible absorption process is performed on the prepared mild steel specimens at 308K for 2 h. UV–visible absorption spectra are measured using JASCO V 530 spectrophotometer.

2.4.3 SEM Characterizations

Specimens of mild steel are immersed in 1 M HCl solutions in the absence and presence of optimum concentration of CDHBAP for 2 h. After 2 h, the specimens are taken and dried and the surface film formed on the surface of the mild steel specimen is analyzed using Scanning Electron Microscope (JEOL JSM 6390).

2.4.4 Quantum Chemical Studies

Theoretical calculations are performed using the density functional theory [DFT] with Gaussian 09 W program for basis set of b3lyp/6–31g(d) for all the atoms in CDHBAP molecules. The electronic properties and molecular structure of CDHBAP have been fully optimized for all atoms of molecules using DFT. Quantum chemical parameters such as energy of the highest occupied molecular orbital [EHOMO], energy of the lowest unoccupied molecular orbital [ELUMO], dipole moment [D], and the energy gap [∆E] are determined.

3 Results and Discussion

3.1 Effect of CDHBAP Concentration on Corrosion Rate and Inhibition Efficiency

The inhibition efficiency of CDHBAP in controlling corrosion of mild steel in 1 M HCl media by mass loss methods is studied. Figure 2 displays that inhibition efficiency increases with increase in the concentration of CDHBAP and reaches 99.05% in 1 M HCl with optimum concentration of 100 ppm. A further increase in CDHBAP concentration does not alter the corrosion rate and protection efficiency in 1 M HCl media which is due to the increase in adsorption of CDHBAP on the surface of mild steel. Above 100 ppm, the constant rate can be attributed to the competitive adsorption effect between CDHBAP and the metal surface and/or the removal of the adsorbed CDHBAP from the complete solution. In all the cases, it is observed that CDHBAP very efficiently reduces the corrosion of mild steel in hydrochloric acid and serves as a good inhibitor. The greater inhibitory power of CDHBAP is due to the presence of nitrogen, oxygen atom, delocalized π electrons, and its larger molecular size. This surveillance is in good agreement with the results reported by many researchers [11,12,13].

Fig. 2
figure 2

Effect of concentration of CDHBAP on corrosion rate of mild steel in 1 M HCl solutions at 308–328 K

3.2 Effect of Immersion Time on the IE of CDHBAP

The influence of immersion period on the inhibition efficiency of the CDHBAP (15–100 ppm) is given in Fig. 3. From the figure, it is clear that inhibition efficiency decreases with the increase in the duration of immersion. 1 M HCl environments show the maximum inhibition efficiency of 99.05% with 100 ppm of CDHBAP concentration for 2 h. Further increase in the duration of immersion decreases IE to 89.15% in HCl for 24 h. This may be due to decreased adsorption and increased desorption. This will too be ascribed to the exhaustion of accessible inhibitor molecules within the tested solution due to chelation between Fe and CDHBAP [14].

Fig. 3
figure 3

Variation of inhibition efficiency of BPDO against immersion time at 308 K

3.3 Effect of Temperature

The inhibition performance of CDHBAP for mild steel in 1 M HCl solutions within a temperature range of 308–328 K is given in Fig. 4. From the figure, it is clearly shown that the inhibition rate decreases with the increase in temperature. This shows clearly the increasing desorption of the CDHBAP on the metal surface. Arrhenius plot of log CR versus 1/T for mild steel erosion in 1 M HCl with and without CDHBAP is shown in Fig. 5. The values of apparent activation energy (Ea) acquired from the slope − Ea/2.303R of the lines are given in Table 1. It shows that the values of Ea for tested solutions range from 53.40 kJ mol−1 to 165.33 kJ mol−1. In the present study, the apparent activation energy (Ea) increased with increasing concentration of CDHBAP. This clearly indicates that the decrease in adsorption of CDHBAP on the metal surface corresponds with the increase of temperature [15].

Fig. 4
figure 4

Effect of temperature on corrosion inhibition of mild steel in CDHBAP in 1 M HCl solutions

Fig. 5
figure 5

Arrhenius plots of log CR versus 1/T for mild steel in 1 M HCl

Table 1 Activation parameters of mild steel in 1 M HCl solutions in the absence and presence of different concentrations of CDHBAP
  1. i.

    If IE diminishes with expanding temperature, Ea (inhibited solution) > Ea (uninhibited solution).

  2. ii.

    If IE increments with expanding temperature, Ea (inhibited solution) < Ea (uninhibited solution).

  3. iii.

    If IE does not alter with temperature, Ea (inhibited solution) = Ea (uninhibited solution).

Within the display of examination, the inhibitor falls in begin group (i), for which Ea (inhibited solution) > Ea (uninhibited solution) and Ea increases with expanding inhibitor concentration, which further affirms that IE (%) diminishes with expanding temperature. Figure 6 appears the plot of log CR/T against 1/T. Straight lines are obtained with intercept of [log (R/Nh) + (ΔS*/2.303R)] and a slant of (ΔH*/2.303R), from which the values of ΔS* and ΔH* are calculated and compiled in Table 1. The positive sign of enthalpies reflects the endothermic nature of the steel dissolution process inferring that the dissolution of mild steel is difficult [16, 17]. The move towards the positive values of ΔS* both in the absence and the presence of the CDHBAP imply that the activated complex in the rate deciding step represents dissociation rather than association, meaning that disordering increases from reactants to the activated complex [18, 19]. The results are comparable to those obtained for previously reported organic inhibitors [20].

Fig. 6
figure 6

Transition state plots of log CR/T versus 1/T for mild steel in 1 M HCl

3.4 Potentiodynamic Polarization Measurements

Figure 7 shows the polarization curves for mild steel in 1 M HCl solutions in the absence and presence of various concentrations of CDHBAP. It is observed from the figure that both anodic and cathodic reactions are suppressed with the addition of CDHBAP. This suggests that CDHBAP reduces the anodic metal dissolution as well as retards the hydrogen evolution reactions on the cathodic sites. The corrosion current density (Icorr) decreases with an increase in adsorption of CDHBAP by increasing the concentration of CDHBAP. A reduction in corrosion current density with an increase in CDHBAP concentration can also be observed on the basis of data given in Table 2. The table shows this at different concentrations of CDHBAP in 1 M HCl solutions there is no clear trend in the shift of the Ecorr values. But the Tafel slope values (ba and bc) are altered in 1 M HCl. According to Ferreira et al. [21] and Li et al. [22], if the shift in corrosion potential is more than 85 mV with respect to the corrosion potential of acidic solution, inhibitor can be classified as a cathodic or anodic type. In this study, the maximum displacement is 76 mV, indicating that CDHBAP is a mixed type inhibitor with a predominant anodic effect.

Fig. 7
figure 7

Tafel plots of mild steel immersed in 1 M HCl in the absence and presence of CDHBAP

Table 2 Inhibition efficiency obtained by Tafel Polarization of mild steel in 1 M HCl solutions containing various concentrations of CDHBAP at 308 K

3.5 AC Impedance Measurements

The electrochemical behavior of a mild steel in inhibited and non-inhibited solutions was explored by means of EIS measurements. Nyquist plots of mild steel in 1 M HCl solutions in the absence and presence of various concentrations of CDHBAP are displayed in Fig. 8. The values of charge transfer resistance (Rct) and double-layer capacitance (Cdl) are obtained from the Nyquist plots and the calculated inhibition efficiency values are reported in Table 3. It is clear from table that the charge transfer resistance (Rct) value increases from 4.05 Ωcm2 to 561.88 Ωcm2 in the presence of 100 ppm concentration of CDHBAP in 1 M HCl, respectively. On the other hand, the values of Cdl decrease with the increasing CDHBAP concentrations. The reduction in Cdl is attributed to increase the thickness of electrical bilayer. The increment in Rct values is ascribed to the formation of a defensive film at the metal/solution interface. These perceptions propose that CDHBAP functions by adsorption on the metal surface, diminishing Cdl values and increasing in Rct values [23]. In this way, the alter in Cdl values is caused by the gradual exchange of water molecules through the adsorption of inhibitor molecules at metal/solution interface, which results in the formation of an isolated film on the substrate surface and then inhibits the degree of the dissolution reaction. Inhibition efficiency of CDHBAP is increased by increasing inhibitor concentrations due to increased surface coverage. This layer creates a barrier for mass and charge transfer for metal dissolution [24].

Fig. 8
figure 8

Nyquist plots in the absence and presence of different concentrations of CDHBAP in 1 M HCl

Table 3 Electrochemical impedance parameters for the corrosion of mild steel in 1 M HCl solutions containing different concentrations of CDHBAP

3.6 Adsorption Isotherm

Adsorption isotherms play a vital role in the determination of the mechanism of electrochemical reactions. Adsorption is usually seen as exchange process between water molecules adsorbed at the metal–solution interface and the organic molecules present in the inhibitor. Straight lines are obtained when C/θ is plotted against C (ppm) (Fig. 9). The correlation coefficient (R2) is used to select the type isotherm that best matches the experimental data. These diagrams suggest that adsorption of CDHBAP on the metal surface obeys Langmuir adsorption isotherm. The values of Kads are calculated from the intersection of the straight lines and summarized as in Table 4. It is found that the values of Kads decrease with increasing temperature, which shows that the interactions between the metal surface and the adsorbed molecules are weakened and the CDHBAP molecules become easily removable. Such data explain the decrease of the protective effect as the temperature rises. The negative values of ∆Gads clearly indicate that spontaneous adsorption of CDHBAP on mild steel surface takes place through physical adsorption mechanism. Generally, the values of ∆Gads up to − 20 kJ mol−1 are consistent with the electrostatic interaction between charged molecules and a charged metal, i.e., physical adsorption. The values around − 40 kJ mol−1 or higher are associated with chemisorption, which results in sharing or transfer of unshared electron pair or π-electrons of organic molecules to the metal surface to form a coordinate type of bond [25]. In the present study, the calculated ∆Gads values are between − 20 kJ mol−1 and − 40 kJ mol−1. This indicates that the adsorption of CDHBAP on mild steel in 1 M HCl involves comprehensive adsorption [26].

Fig. 9
figure 9

Langmuir adsorption plots for mild steel immersed in 1 M HCl with and without CDHBAP at 308–328 K

Table 4 Thermodynamic parameters for the adsorption of CDHBAP on the mild steel in 1 M HCl solutions at different temperatures

All calculated adsorption parameters are shown in Table 4. It was found that values of ΔHads are negative, suggesting that the adsorption of CDHBAP is an exothermic process, meaning that a lower inhibition efficiency at high temperature. This indicates gradual desorption of CDHBAP from the surface of mild steel [27]. The values of ΔSads are nearly constant and negative, ranging between − 15.72 and − 15.04 kJ mol−1 at a temperature range of 308–328 K. This behavior is described as follows: prior to adsorption of CDHBAP molecules onto the mild steel surface, inhibitor molecules can move freely in the total solution (inhibitor molecules are chaotic), but with the process of adsorption, inhibitor molecules are adsorbed onto the steel surface in an ordered manner, resulting in a decrease of entropy [28].

3.7 UV–Visible Spectroscopic Investigation

The absorption of monochromatic light is a suitable method for the formation of a metal complex [29]. UV–visible absorption is a more sensitive, direct spectrometric detection method. The electronic absorption spectra of CDHBAP (Fig. 10a) display three bands in UV region as shown in Fig. 10a. The shorter wavelength with λmax at 225 nm, 247 nm, and 297 nm are ascribed to ππ* and nπ* transitions of carbonyl group and the heterocyclic moiety of the compound which is present in the CDHBAP. After 2 h of immersion (Fig. 10b), it can be clearly seen that the band disappears completely at 247 nm and the change in the absorption position is maximum or the change in absorbance values indicates the formation of a complex between two species in solution. However, there is no significant change in the shape of the spectra [30]. The absorption band in Fig. 10b shows that the nπ* transition has undergone a bathochromic shift, indicating that the amine and/or carbonyl groups are strongly held up in the complex with iron.

Fig. 10
figure 10

a UV spectra of pure compounds (CDHBAP). b UV–visible spectra of 1 M HCl solution containing 100 ppm CDHBAP after 2 h of mild steel immersion

3.8 FT-IR Study

The FT-IR spectrum of pure CDHBAP is shown in Fig. 11a. Original absorption at 3419 cm−1 is overlapped by the strong stretching mode of N–H. The strong band at 1647 cm−1 in spectrum of the CDHBAP is assigned to C=O stretching vibrations of the antipyridine. The peaks at 3047 cm−1 are related to C–H stretching vibrations in aromatic ring. The double peaks for C–N stretching of aromatic ring are noticed at 1147 and 1327 cm−1. The band at 1465 cm−1 corresponds to the N–H bending vibrations in the amide group [31]. The band at 748 cm−1 is due to C–H bending vibration in benzene. The FT-IR spectra of adsorbed protective layer formed on mild steel surface after immersion in 1 M HCl containing CDHBAP are shown in Fig. 11b. On comparing Fig. 11a, b, it is observed that all important peaks in pure compounds appear in adsorption layer on the steel surface. The bands around 1620 and 1639 cm−1 are ascribed to C=O stretching vibrations. The occurrence of this peak in the inhibited layer indicates that and carbonyl group the oxygen atom do not contribute in inhibition process. Furthermore, the peak at 2350 cm−1 appeared in Fig. 11b is attributed to NH+ stretching vibration. This means that nitrogen bonded with steel surface or a protonated form of CDHBAP is adsorbed on the surface of steel. The broad bands at 3398 and 3417 cm−1 are attributed to O–H stretching, which indicates that the protective film contains H2O. N–H stretching vibrations disappear in the FT-IR spectra of adsorbed protective layer which reveals that nitrogen and oxygen atoms can act as active centers in adsorption. An overall investigation of the results suggests that CDHBAP is adsorbed on the mild steel surface.

Fig. 11
figure 11

FT-IR spectra of a CDHBAP, b surface film of the mild steel specimen after immersion in 1 M HCl containing 100 ppm CDHBAP

3.9 SEM Studies

SEM micrographs obtained (with appropriate magnification) are depicted in Fig. 12. Figure 12a displays the finely polished surface of mild steel and small scratches arise during abrading treatment. The morphology of the specimen surface in Fig. 12b reveals that the specimen is highly damaged in the presence of 1 M HCl due to the direct attack of aggressive acids. Figure 12c shows the appearance of smooth mild steel surface after the addition of CDHBAP to the 1 M HCl solution. It can be seen from Fig. 12c that the rate of corrosion reduces and the smooth surface appears with the formation of a protective film on the metal surfaces, which is responsible for the inhibition of corrosion.

Fig. 12
figure 12

SEM images of mild steel: a polished mild steel, b after immersion in 1 M HCl without CDHBAP, c after immersion in 1 M HCl with 100 ppm of CDHBAP

3.10 Quantum Chemical Calculations

Computational methods had a probable application towards the design and development of corrosion inhibitors in the field of corrosion [32]. The studies of Vosta and Eliasek [33] and Chakrabarti [34] could be recognized as primary theoretical studies of corrosion inhibitors. Semi-empirical calculations to assess the proficiency of a few imidazole derivatives as acidic corrosion inhibitors for steel had been performed by Bereket et al. [35] using AM1, PM3, MNDO, and MINDO/3 methods. Charges on nitrogen atoms, total energy, ionization potential, EHOMO, ELUMO, Δ(EHOMO − ELUMO), and dipole moment (D) were calculated by analysts and correlated with experimental results. A satisfactory agreement was found between theoretical and experimental data. Comparative studies on these compounds were conducted by Ogretir et al. [36] while the inhibition mechanism of corrosion via metal–ligand interaction was investigated using semi-empirical methods. According to their conclusion, semi-empirical calculations could be used to illustrate the mechanism of inhibition. Table 5 shows that some of the key quantum chemical parameters are computed using AM1 method. These are mainly the energies of the highest occupied (EHOMO) and lowest unoccupied (ELUMO) molecular orbitals (Fig. 13a, b) and the energy of the gap.

Table 5 Quantum chemical parameters of CDHBAP
Fig. 13
figure 13

a The highest occupied molecular orbital (HOMO) of CDHBAP. b The lowest unoccupied molecular orbital (LUMO) of CDHBAP

$$\Delta =\left( {{E_{{\text{HOMO}}}}-{E_{{\text{LUMO}}}}} \right).$$
(5)

These quantum chemical parameters are obtained after geometric optimization with respect to all nuclear coordinates. Frontier orbital theory is useful in predicting adsorption centers of the inhibitor molecules responsible for the interaction with surface metal atoms [37]. Moreover, the gap between the LUMO and HOMO energy levels of the molecules is another important factor that should be considered. It has been reported that excellent corrosion inhibitors are usually those compounds which not only offer electrons to unoccupied orbital of the metal, but also accept free electrons from the metal [38]. It is moreover well reported in literature that the higher the HOMO energy of the inhibitor, the greater its ability of deliver electrons to unoccupied d-orbital of the metal and the higher the corrosion inhibition efficiency. In expansion, the lower the LUMO energy, the easier it is to absorb electrons from metal surface, as the LUMO–HOMO energy gap diminishes and the inhibitors efficiency increases. Quantum chemical parameters recorded in Table 5 show that CDHBAP exhibits a high HOMO and a low LUMO. Similar perceptions were reported by Khaled [32] on the adsorption and anticorrosion behavior of a synthesized guanidine derivative in 0.5 M H2SO4. Obot [39] investigated the adsorption properties and inhibition of mild steel corrosion in 0.1 M H2SO4 solution using ketoconazole.

In the last two decades, quantum chemical calculations have been increasingly employed for the prediction of molecular properties and to provide qualitative explanation for several findings in many areas of chemistry and biology [40]. The success of these calculations relies on its better accuracy achieved at a relatively low computational cost and due to the formulation of reactivity parameters such as Fukui function [41], chemical hardness [42, 43], electronegativity [44], softness [45], etc. The concept of electronegativity (χ) is introduced by Pauling [46] as the power of an atom in a molecule to attract an electron towards it, and the electronegativity equalization principle is introduced by Sanderson [47]. This property is shown by Parr and Pearson [42] is found to be the negative of the Lagrange multiplier known as the chemical potential (µ). The chemical hardness (η) is an important quantity in chemical reactivity theory and it is first put forward by Pearson [48]. It is a measure of the resistance of a chemical species to change its electronic configuration. The practical method used to calculate chemical hardness (η) and electronegativity (χ) is given by Parr and Pearson [42]:

$$\eta =\left( {I-A} \right)/2$$
(6)
$$\chi =\left( {I\;+\;A} \right)/2,$$
(7)

where the ionization potential (I) and the electron affinity (A) are calculated through various techniques in experimental and theoretical methods. Initially, experimental ionization potential and electron affinity values have been used to calculate the absolute chemical hardness and electronegativity [49]. In general, the above total energy-based vertical method provides comparatively better results. But the major drawback is its computation cost and possible errors in total energy values due to the approximations used in the theoretical models. Both ionization potential and electron affinity are known to be largely influenced by the incorporation of electron correlation in the calculation method and require the use of relatively larger basis set [50]. The Koopman’s theorem provides an alternate method to calculate the ionization potential (I) and electron affinity (A) through orbital energies of optimized neutral molecules [51]. According to this theorem, the negative of the highest occupied molecular orbital energy (− EHOMO) and the lowest unoccupied molecular orbital energy (− ELUMO) correspond to ionization potential and electron affinity, respectively (i.e., I = − EHOMO and A = − ELUMO). Using Koopman’s theorem in Eqs. (6, 7), the chemical hardness and electronegativity are defined in terms of orbital energies:

$$\eta =\left( {{E_{{\text{LUMO}}}}-{E_{{\text{HOMO}}}}} \right)/2$$
(8)
$$\chi =-\left( {{E_{{\text{LUMO}}}}+{E_{{\text{HOMO}}}}} \right)/2.$$
(9)

That is, the energy gap between HOMO and LUMO is equal to 2η and − χ is half-way between the HOMO and LUMO. This is also supported by the approach used by Sastri and Perumareddi in explaining corrosion inhibition efficiency in terms of EHOMO, ELUMO, and Δ [52]. The method is based on the calculation of the number of transferred electrons (ΔN):

$$\Delta N=\left( {{\text{ }}\chi {\text{Fe }}-\chi {\text{inh}}} \right)/\left[ {2\left( {\eta {\text{Fe}}+\eta {\text{inh}}} \right)} \right],$$
(10)

where χFe − χinh denote the absolute electronegativity of iron and the inhibitor molecule, respectively. ηFe and ηinh denote the absolute hardness of iron and the inhibitor molecule, respectively. Sastri and Perumareddi [52] set χFe = 7 eV mol−1 (≈ − 5 beta) according to Pearsons electronegativity scale [53] and a global hardness η value of 0 eV mol−1 for Fe [54]. With this set of parameters, the following result is obtained:

$$\Delta N=\left[ {5 - \left( {2{\text{ }}{E_{{\text{HOMO}}}} - \Delta } \right)/2} \right]/\Delta.$$
(11)

The number of transferred electrons depends strongly on the parametrization of the actual semi-empirical quantum chemical method. Therefore, the values of these quantities indicate trends within a set of molecules, but their absolute value might not correspond to reality. Furthermore, more precise than the expression ‘‘number of transferred electrons’’ is the wording ‘‘electron-donating ability’’ that do not imply that the figures of ΔN actually indicate the number of electrons leaving the donor and entering the acceptor molecule. Using Eq. (11), the electron-donating ability of CDHBAP is calculated (Table 5). According to Lukovits [55] and others [39, 52], if ΔN < 3.6, the inhibition efficiency increases with increasing values of the electron-donating ability, but it decreases if ΔN > 3.6. In this study, CDHBAP is the donor of electrons and the mild steel surface is the acceptor. This result supports the claim that the adsorption of inhibitor on the metal surface could occur on the bases of donor–acceptor interactions between CDHBAP and metal surface [56].

3.11 Mechanism of Inhibition

It is well recognized that organic inhibitor molecules carry their inhibition action via the adsorption on the metal surface. The adsorption process is influenced by the chemical structure of the inhibitors, the nature and charged surface of the metal, and the distribution throughout inhibitor molecule. In general, due to the complex nature of adsorption and inhibition effect of inhibitor, it is impossible to achieve a single adsorption between the inhibitor and the metal surface.

Organic inhibitor molecules can be adsorbed on the metal surface in one or several of the following ways:

  1. (a)

    Electrostatic interaction between the charged molecules and the charged metal

  2. (b)

    Interaction of unshared electron pairs in the molecule with the metal

  3. (c)

    Interaction of π-electrons with the metal and/or

  4. (d)

    A combination of types (a–c) [57]

Inhibition efficiency depends on many factors, including molecular size, heat of hydrogenation, type of interaction with metal surface, formation of metallic complexes, and the charge density on the adsorption sites [58]. The inhibition efficiency afforded by CDHBAP may be attributed to the presence of electron rich N, O, and aromatic ring. One phenyl ring, hydroxyl group, amide linkage, and two electron-donating methyl groups are found in the structure of CDHBAP (Fig. 14). Therefore, the possible reaction centers are unshared electron pair of heteroatoms and π-electrons of aromatic ring. From the experimental and theoretical results obtained, the adsorption and inhibition effect of CDHBAP in 1 M HCl solution can be explained as follows. Schiff bases may be protonated in the acid solution as

Fig. 14
figure 14

Schematic representation of the possibility of complex between Fe2+ and CDHBAP in 1 M HCl solutions

$$\left[ {{\text{CDHBAP}}} \right]+x{{\text{H}}^+} \to {\left[ {{\text{CDHBAPH}}x} \right]^{x+}}.$$

In aqueous acidic solutions, CDHBAP exists either as neutral molecule or in the form of protonated CDHBAP (cations). CDHBAP may adsorb on the metal/acid solution interface by one and/or more of the following ways: (i) electrostatic interaction of protonated CDHBAP with already adsorbed chloride ions, (ii) donor–acceptor interactions between the π-electrons of aromatic ring and vacant d-orbital of surface iron atoms, (iii) interaction between unshared electron pairs of heteroatoms and vacant d-orbital of iron surface atoms.

Generally, two modes of adsorption can be considered on the surface of metal. In one mode, the neutral CDHBAP is adsorbed on the surface of mild steel by the chemisorption mechanism, which involves displacing water molecules from the metal surface and sharing electrons between heteroatoms such as nitrogen, oxygen, and the metal surface. The inhibitor molecules can also adsorb on the mild steel surface based on donor–acceptor interactions between p-orbitals of the heterocyclic ring and unoccupied d-orbitals.

In another way, it is known that the steel surface in acidic solution carries positive charge [59], it is difficult for the protonated CDHBAP to approach the positively charged mild steel surface (H3O+/metal interface) because of electrostatic repulsion. As chloride ions have lower hydration charges, they can bring excess negative charges near the interface and promote a stronger adsorption of positively charged molecules. The protonated CDHBAP adsorbs by electrostatic interactions between the positively charged molecules and the negatively charged metal surface. Thus, there is a synergism between adsorbed Cl ions and protonated CDHBAP. It should be noted that the molecular structure of protonated CDHBAP remains unchanged in relation to its neutral form, with the N-atoms remaining strongly blocked on the ring. If protonated CDHBAP is adsorbed on the metal surface, a coordinate bond can be formed by partial transference of electrons from the heteroatoms onto the metal surface.

4 Conclusion

The inhibition efficiency of the inhibitor increases with increase in inhibitor concentration but decreases with the increase in temperature. Polarization curves prove that the CDHBAP is a mixed type of inhibitor. AC impedance plots indicate that charge transfer resistance increases and double-layer capacitance decreases with the addition of an inhibitor. CDHBAP adsorbs on the mild steel surface according to the Langmuir adsorption isotherm and the negative value of the Gibbs free energy of adsorption (ΔGads) indicates a strong interaction between inhibitor molecules and the mild steel surface. FT-IR and SEM results support the protective surface layer over the mild steel surface. The UV–visible studies clearly reveal the formation of a complex that also is responsible for the corrosion inhibition. The weight loss, polarization measurements, and electrochemical impedance spectroscopy measurements are in good agreement.