Introduction

Because of its good mechanical characteristics and inexpensive cost, mild steel is a frequently utilized building material in a variety of sectors [1]. The use of organic compounds to inhibit corrosion of mild steel and iron has gained importance because of their ability to prevent corrosion under various hostile conditions [2]. A wide range of organic compounds have been shown to be useful as corrosion inhibitors during acidification in industrial cleaning procedures [3]. Organic additions inhibit chloride ion adsorption, creating a more resistant oxide layer on the metal surface[4]. The effectiveness of these chemicals is mainly determined by the structure and composition of the adsorbed layer on the metal surface [5,6,7]. Organic molecules containing heteroatoms such as O, N, S, and P which have a higher basic character and electron density than the other compounds function as good corrosion inhibitors. The active centers for the adsorption process on metal surfaces include O, N, S, and P. The order of inhibition efficiency should increase from O, N, S, to P. These organic molecules, containing notably nitrogen, have been used to prevent steel corrosion and have been the subject of extensive research[8].

Electron transfer from the inhibitor to the metal is facilitated by non-bonded (lone pair) and p-electrons from the inhibitor molecules. It is also possible to create a coordinated covalent bond by transferring electrons from the inhibitor to the metal surface. The chemisorption bond strength is determined by the electron density of the donor atom in the functional group and the group’s polarizability[9]. The effectiveness of organic inhibitors is determined by their adsorption rates and ability to cover metal surfaces. According to several sources [10], adsorption is determined by the molecular structure and surface charge of the metal, as well as the kind of electrolyte. Water molecules adsorbed on the surface of a metal immersed in an aqueous phase are replaced by inhibitors adsorbed on the surface. The replacement of one or more water molecules adsorbed at the metal surface is commonly recognized as the initial step in the adsorption of an organic inhibitor onto a metal surface[10]. Efforts to achieve this goal are strongly influenced by the concept of molecular similarity, whereby related molecules act in a similar manner. Many compounds were synthesized from organic acids and tested as corrosion inhibitors, especially formic, acetic, propionic, and butyric acid [11].

As shown in Fig. 1, azelaic acid dihydrazide was synthesized from azelaic acid by refluxing it with methanol in the presence of sulfuric acid, then reacting it with hydrazine hydrate.

Fig. 1
figure 1

Chemical synthesis procedure of azelaic acid dihydrazide from azelaic acid

In this paper, azelaic acid derivatives as green inhibitors were studied against the corrosion phenomenon of mild steel. Various theoretical methods such as density functional theory (DFT) calculations, dynamic molecular simulations (MD), and Monte Carlo (MC) techniques were carried out to study the intrinsic properties of the studied inhibitors to support this theoretical study. DFT calculation, Monte Carlo (MC), MD simulations, and radial distribution function (RDF) simulations provide a more comprehensive understanding of the experiment data obtained with gravimetric, electrochemical methods, scanning electron microscopy (SEM) in investigating the inhibitory effects of azelaic acid dihydrazide on the corrosion of mild steel in 1.0 M HCl to further investigate our compounds.

Computational details

Density functional theory is the most frequently used approach to estimate the chemical reactivity of metal corrosion inhibiting compounds (DFT). Because DFT/B3LYP techniques with the 6–311G(d,p) basis set are highly efficient for geometrical optimizations using the Gaussian 09 program, all quantum chemical investigations were carried out using them in this work [12]. Because corrosion occurs in the aqueous phase, it is computationally suitable to include the impact of the solvent; therefore, all quantum computations were done in the aqueous phase using the self-consistent reaction field (SCRF) theory and polarized continuum model (PCM). As quantum chemical characteristics linked with energies, the highest occupied molecular orbital (EHOMO), the lowest unoccupied molecular orbital (ELUMO), and the energy gap (E = ELUMO − EHOMO) have been measured and evaluated [13, 14]. ELUMO (energy of the lowest unoccupied molecular orbital), EHOMO (energy of the highest occupied molecular orbital), Egap (gap energy), (dipolar moment), and ∆N110 (altitude of transferred electrons) are calculated in an aqueous solution [15, 16]. Equation (1) is used to calculate the fraction of electrons transferred (N) from inhibitor molecules to metal during inhibitor–metal interaction as follows:

$$\Delta N=\frac{\varnothing {\upchi }_{inh}}{2({\upeta }_{Fe}+{\upeta }_{inh})}$$
(1)

where χinh, ηFe, and ηinh are the electronegativity, hardness values of iron, and hardness of inhibitor molecules, respectively. The job function (∅) value is 4.82 eV, and Fe is 0 [17]. When ∆N is greater than zero, the inhibitor of metal electron transfer occurs, i.e., ∆N > 0. Local reactivity may be studied using Fukui indices, which show the reactive centers inside molecules [18].We also used Materials Studio 6.0 to run Monte Carlo and molecular dynamics simulations in a simulation box with periodic boundary conditions [19]. The iron crystal was designed and cleaved along the (110) plane, and a 5 Å slab was used. The energy of the Fe (110) surface was optimized using the smart minimizer system, which relieved it. The Fe(110) surface increased to a (10) supercell to have a wide surface for inhibitor activity. A vacuum slab was built with a thickness of zero. Using the rate of water molecules to chloride in 0.5 M HCl as a reference, a supercell with dimensions of a = 28.66 Å, b = 40.53 Å, c = 33.24 Å, containing 491 H2O, 9 H3O+, 9Cl, and one inhibitor molecule was formed [20]. The simulation was conducted in a simulation box (42.99, 60.80, 43.37Å3) with a time step of 1 fs and a total simulation time of 500 ps at 303 K/333 K, NVT ensemble (constant number of atoms, constant volume, constant temperature), and COMPASS force field [21]. The interaction energy and binding one determined using Eqs. (2) and (3) may be used to estimate the association between the inhibitor and Fe (110) in the simulation framework [22, 23] illustrated as follows:

$${E}_{\mathrm{interaction}} = {E}_{\mathrm{total}} - ({E}_{\mathrm{surface}+\mathrm{solution}}+{E}_{\mathrm{inhibitor}})$$
(2)
$${E}_{\mathrm{Binding}} = -{E}_{\mathrm{interaction}}$$
(3)

where Etotal signifies the total energy of the entire system, Esurface + solution means the total energy of Fe (110) surface and solution without the inhibitor and Einhibitor defines the total energy of the inhibitor.

Result and discussion

As we already mentioned above that our compound was synthesized in three steps from azelaic acid. So, we have investigated all three compounds, including azelaic acid and azelaic acid dihydrazide (AADZ), to deeply explain what we added to our molecule and give it the power to inhibit the corrosion phenomenon.

Protonation state

In acidic media, protons are considered present, making the protonation of organic molecules more likely. Indeed, the most critical site for protonation is depicted in Fig. 2.

Fig. 2
figure 2

The possible forms of the molecule AADZ by varying the pH from 0 to 14

We have assumed that the AADZ molecule is stable at the large pH interval in experiment (acidic pH) determined by The Marvin View software. As its neutral form, the AADZ molecule predominated in a considerable interval of pH (pHexp of 1 M HCl is pH =  − log(1) = 0.001), which indicates that the only neutral form remains in the solution in a higher fraction. This is advantageous because many tests have shown that the protonated form of the molecule is not absorbed.

DFT calculation

Molecular reactivity was investigated by examining quantum chemical parameters; as is well known, the use of quantum chemical computation is an excellent tool to establish a beneficial relationship between molecular structure and adsorption performance.

Global reactivity descriptors

The reactivity of the azelaic acid (AA) derivatives can be determined using DFT-based structure analysis. Egap, EHOMO, ELUMO, chemical potential (µ), and ΔN110 are considered appropriate overall indicators for evaluating our azelaic acid dihydrazide (AADZ) adsorbed on the surface of carbon steel [24]. In order to study the three compounds and their electronic behavior, we showed the 3D structure and the molecular electrostatic potential (MEP), HOMO and LUMO. The optimized configurations and molecular electrostatic potential distribution of the AADZ molecule are shown in Fig. 3.

Fig. 3
figure 3

The optimized structures of AA derivatives (M1, M2, and M3) and MEP distribution

The distribution of electron density in the molecular frontier orbitals (HOMO and LUMO) is described as global reactivity, as illustrated in Fig. 4, in which HOMO electron density is found on all chemical surface except the hydrophobic group connected to the carbonyl function. Moving from molecule 1 to 3, we observe that the HOMO frontier orbital spreads more over the whole of molecule 3. This demonstrates that AADZ has many active electron donor sites throughout the skeleton compared to the starting molecule (M1). The LUMO electron density is represented by the acidic function surface of molecule 1, while in molecule 3, the LUMO extends over a large portion of the compound surface, except for the hydrophobic group, suggesting that adsorption of compound 3 is more favorable on the metal surface.

Fig. 4
figure 4

The compound AA derivatives FMO distributions

The AADZ molecule has a high EHOMO value (− 7.01 eV), indicating that it may efficiently exchange electrons with unoccupied regions on the metal surface. This suggests that the AADZ-metal is chemically very reactive. According to Lukovit, the positive value of N of the AADZ molecule and lower than 3.6 indicates that it can exchange its electron [13].

Local reactivity descriptors

The active centers in the azelaic acid dihydrazide were examined and found to be the oxygen atoms (O24 and O25) responsible for the electron sharing behavior. The polarizability of our chemical substances under research is interpreted by the dipole moment descriptor (µ). A high value of this characteristic indicates high polarizability (reactivity), i.e., significant adsorption of the inhibitor molecule on the metal surface [25].

Local reactivity is a popular approach for determining the local active areas of a chemical inhibitor [26]. The computed Fukui indices (f+ and f) for benzimidazolecarbamate are shown and reported in Fig. 5. The active electrophilic centers are atoms with a higher fk value, whereas the active nucleophilic centers are atoms with a higher f+k value, according to Table 1 and descriptors of the chemical structure of the AA derivatives molecules are given Table 2 [27]. The findings show that the O(24) and O(25) atoms underwent an electrophilic attack, indicating that it tends to donate electrons to form more stable coordination bonds with the metal surface.

Fig. 5
figure 5

Atom-condensed Fukui functions for f+ and f of AADZ estimated at DFT/GGA/DNP using Materials Studio software

Table 1 Descriptors of the chemical structure of the AA derivatives molecules
Table 2 Fukui indices for AADZ f+k and fk measured at DFT/B3LYP-6311G (d,p)

Fe-AADZ complexes’ electronic conduct

The DFT method was employed to analyze the Fe–AADZ complexes to assess the influence of the iron surface on the AADZ electron density distribution and quantum chemical descriptors. We have used chemical quantum computing utilizing the Gaussian 09 software, and the DFT calculation was done on the B3LYP/LanL2DZ level. The frontier–molecular orbitals of Fe–AADZ, as well as its optimized structure (AADZ(C = O—Fe) and AADZ(N—Fe)) and electronic density distribution, are shown in Fig. 6.

Fig. 6
figure 6

AADZ(C = O)–Fe and AADZ(C = O)–Fe complex FMO distributions and Fe–AADZ distance

There is no obvious change in spatial conformation when the optimized structure of AADZ linked to the iron atom is compared to its structure alone. As a result, the iron and oxygen atoms are at the core of the HOMO mass. The high density of HOMO on the iron atom indicates that it has taken electrons from the inhibitor, resulting in a reduction in the electronic density of AADZ. The LUMO electron density, on the other hand, is almost on the complexes’ structures. As a result, the result in the case of AADZ alone is the same. As a result, the electron donor property of AADZ to the iron atom is improved. Table 3 groups the values of the significant quantum chemical descriptors. According to these data in this table, the iron atom has a favorable influence on total chemical reactivity. This is proved by a reduction of the Egap and an increase of the DN and dipole moment values. These results indicate that the surface communicates more efficiently with the AADZ molecules.

Table 3 Descriptors of the chemical structure of the AADZ(C = O)–Fe and AADZ(C = O)–Fe complexes

Monte Carlo and molecular dynamics stimulation

Theoretical modeling approaches based on Monte Carlo and molecular dynamics simulation (MDs) have been utilized to investigate adsorption at the organic molecule interaction while considering the solvent [28]. As it can be observed in Fig. 7, when the azelaic acid dihydrazide adsorbs to the adsorbate, the fluctuation energies, minimum 303 K, and maximum 333 K temperature curves, are in equilibrium.

Fig. 7
figure 7

Molecular dynamics adsorption structures of AADZ over Fe (1 1 0) surface at 303 K

Figure 8 shows the upper and lower views of AADZ adsorption structures on a carbon steel surface in an acidic solution. On the surface of the first iron plate, the AADZ form is smooth, indicating that our molecule is effectively adsorbed. This might be due to the existence of covalent bonds at the AADZ–Fe (1 1 0) contact, which impacts the adsorption property in a positive way. This procedure maximizes the surface coverage characteristics by adsorbing the investigated AADZ. This species is a strong corrosion inhibitor, which supports the inhibitory effectiveness findings. Energy words, explicitly binding (Ebinding) and interaction (Einteraction) energies, express the simulation findings. The values of these variables determine the magnitude of adsorption and interaction of AADZ with the metal surface. Negative touch energy projections confirm the AADZ–metal interaction’s potential [29].

Fig. 8
figure 8

Molecular dynamics adsorption structures of AADZ over Fe (1 1 0) surface at 333 K

Table 4 summarizes the parameters and different types of energy of AADZ adsorbing in mild steel adsorbing in acidic solution calculated using Monte Carlo stimulation.

Table 4 Outputs and descriptors (kcal/mol) for the lowest adsorption configurations for AADZ on Fe (110) surface, calculated byMonte Carlo simulation in acid environment 1 M HCl

The related interaction energies for the AADZ at 303 K and 333 K are − 134.254 kcal/mol and − 131.522 kcal/mol. These findings suggest that increasing the temperature reduces the interaction efficiency of AADZ with the atoms on the touch surface. These findings corroborate the results in the section on the temperature effect. While the adsorption is higher at 303 K, the AADZ binding energy is higher than that measured at 303 K.

Radial distribution function

We have used the radial distribution function (g(r)) to analyze AADZ molecules in acid media [30]. It represents the relationship between the atomic pairs. We have investigated the function g(r) throughout molecular dynamics simulation under the same previous conditions near iron atoms surface with the most active atoms, namely, O25 and N32 of AADZ. The results are shown in Fig. 9. This diagram depicts the RDF (radial distribution function).

Fig. 9
figure 9

Radial distribution functions of Fe (1 1 0) surface relative to O25 and N32 atoms of AADZ at 298 K

The first peak (function) for the test material seemed to be very simple. A more extreme peak indicates significant interactions between the investigated AADZ heteroatoms and surface metal atoms. The result of RDF also suggests the mechanism of interaction between the AADDZ molecule and iron surface; the main center of electrons changing is the oxygen atom of the carbonyl group of AADZ compound.

Conclusions

We have studied the interaction mechanism between three corrosion inhibitors with the metal surface. Indeed, the synergy between the quantum and mechanistic ingredients of molecular modeling allowed us to highlight a protocol for evaluating the inhibitory performance of AA derived from the wheat plant. Furthermore, our findings will enable us to derive the following concluding remarks:

  • The study of optimized structures of the azelaic acid derivatives confirms that the synthesized compound (azelaic acid dihydrazide) highly inhibits corrosion compared to azelaic acid.

  • The adsorption energy of azelaic acid dihydrazide inhibitor on Fe (110) surface in a vacuum and an acidic environment shows a higher adsorption capacity.

  • According to the radial distribution function (RDF), there is a chemical kind of interaction between the azelaic acid dihydrazide inhibitor and the Fe (110) surface (chemisorption) and it proved to us the interaction mechanism of the azelaic acid dihydrazide.