Experimental and computational chemical studies on the corrosion inhibitive properties of carbonitrile compounds for carbon steel in aqueous solutions

The present work aims to study 6-amino-4-aryl-2-oxo-1-phenyl-1,2-dihydropyridine-3,5-dicarbonitrile derivatives namely: 6-Amino-2-oxo-1,4-diphenyl-1,2-dihydropyridine-3,5-dicarbonitrile (PdC-H), 6-Amino-2-oxo-1-phenyl-4-(p-tolyl)-1,2-dihydropyridine-3,5-dicarbonitrile (PdC-Me) and 6-Amino-4-(4-hydroxyphenyl)-2-oxo-1-phenyl-1,2-dihydropyridine-3,5-dicarbonitrile (PdC-OH) as corrosion inhibitors to provide protection for carbon steel in a molar hydrochloric acid medium. Chemical measurements such as (weight loss) and electrochemical techniques such as (Potentiodynamic polarization, electrochemical impedance spectroscopy, and Electron frequency modulation) were applied to characterize the inhibitory properties of the synthesized derivatives. The adsorption of these derivatives on the carbon steel surface was confirmed by Attenuated Total Refraction Infrared (ATR-IR), Atomic Force Microscope (AFM), and X-ray Photoelectron Spectroscopy (XPS). Our findings revealed that the tested derivatives have corrosion inhibition power, which increased significantly from 75.7 to 91.67% on the addition of KI (PdC-OH:KI = 1:1) to inhibited test solution with PdC-OH derivative at 25 °C. The adsorption process on the metal surface follows the Langmuir adsorption model. XPS analysis showed that the inhibitor layer consists of an iron oxide/hydroxide mixture in which the inhibitor molecules are incorporated. Computational chemical theories such as DFT calculations and Mont Carlo simulation have been performed to correlate the molecular properties of the investigated inhibitors with experimental efficiency. The theoretical speculation by Dmol3 corroborates with the results from the experimental findings.

Chemical treatment procedure. The experimental material is carbon steel with a chemical composition (weight%): Si 0.25%, C 0.2%, Mn 0.5%, S 0.05%, and balance Fe. Carbon steel specimens were mechanically cut into dimensions of 2.0 × 2.0 × 0.2 cm for weight loss and surface analysis experiments. Prior to all measurements, specimens were pretreated by abrading and polishing the surface to a mirror finish using successive grades of emery papers from 400 to 2000 grit size, degreased with acetone, washed with bi-distilled water, and dried at ambient temperature before weighing. A small carbon steel specimen was embedded in epoxy resin with an exposed surface area of 1 cm 2 and used as a working electrode in the electrochemical experiments. Corrosion solution (1 M HCl) was prepared by diluting the analytical reagent grade 37% HCl with ultrapure distilled water. Finally, stock solutions of the investigated inhibitors (10 -3 M) were prepared by using ethanol as a solvent. Inhibitor concentrations ranged ((2-10) × 10 -5 M) by diluting the stock solutions with deionized water.
Electrochemical measurements. Further corrosion tests were investigated electrochemically in a threecompartment glass cell comprising a working electrode (carbon steel electrode) with an uncovered area of 1 cm 2 , reference electrode (saturated calomel electrode), and counter electrode (platinum foil). Electrochemical measurements were performed under static conditions in a naturally aerated solution of 1 M HCl in the absence and presence of varying concentrations of three studied derivatives at 25 ± 1 °C. Before each electrochemical experiment, the system was maintained in an unperturbed state for 1800s to reach a stable value of the open circuit potential (OCP) . The polarization curves started from the cathodic direction to the anodic direction and (1) Table 2. Chemical structures of the tested compounds. www.nature.com/scientificreports/ were carried out by automatically sweeping the electrode potential from − 0.5 to + 0.5 V segment to OCP at a scan rate of 0.5 mV s −1 . Polarization parameters were obtained by extrapolation the anodic and cathodic regions of the Tafel plots. EIS measurements were performed after the attainment of steady-state OCP by analyzing the frequency response of the electrochemical system with a range-extending from 0.01 Hz at low frequency to 100,000 Hz at high frequency and the excitation signal is a 5-mV sine wave. In the EFM technique a single, lowfrequency, and low-distortion, sinusoidal voltage is applied to the corrosion interface (amplitude 10 mV with 2 and 5 Hz sine waves). Gamry PCI4-G750 Potentiostat/Galvanostat/ZRA. Echem Analyst V6.30 Software has been applied for fitting the electrochemical data.
Surface analysis by ATR-IR, AFM and XPS. Morphological analyses methods were performed to evaluate the impact of corrosion and other characteristics of films on the surface of carbon steel. The mechanically prepared steel specimens were polished by emery paper in sequence to 2000 grade, degreased with absolute ethyl alcohol and acetone, washed with distilled water, and dried in a vacuum system. The pre-treated carbon steel surface is engrossed in 1 M HCl solution in the absence and presence of the optimal concentration of each studied derivative (10 −4 M) at 25 °C for 24 h. The chemical composition of the investigated compounds can be determined using ATR-IR (Thermo Fisher Scientific, NicoletiS10 model) analysis; Infrared spectra were recorded using ATR (Attenuated Total Reflection) in the wavenumber range 400-4000 cm −1 . The morphological changes of the corroded carbon steel surface before and after treatment with the studied carbonitrile derivatives were assessed using non-contact mode atomic force microscopy (AFM) (Model: Thermo Fisher Nicolet IS10 (Scanning probe microscope)). The elemental composition and chemical states of the inhibitive film formed on the surface of carbon steel were examined by XPS (Model: Thermo Fisher Scientific) via Al Kα X-ray source (− 10 to 1350 eV) spot size 400 micro m at pressure 10-9 bar with full-spectrum pass energy 200 eV and at narrow-spectrum 50 eV (produced in USA K-ALPHA).

Quantum chemical calculations.
To inspect the correlation between the molecular structure and the reactivity of 6-amino-4-aryl-2-oxo-1-phenyl-1,2-dihydropyridine-3,5-dicarbonitrile derivatives, theoretical calculations were performed using the DMol3 module adopted in Materials Studio version 7.0. Within the DMol3 module, a basis set of double number polarization (DNP) plus the exchange-correlation functions of Becke One Parameter (BOP) with generalized gradient approximation (GGA) and solvent effects were treated using COSMO controls 26 . Quantum calculations are also performed using Orca 4.1, and the calculation inputs are set at the DFT level with DEF2-SVP as basis Set and B3LYP as functional. The aim of using two different methods and software is to verify the consistency between the experimental and theoretical results in anticipation of the ranking of inhibition efficiency of studied compounds 6 .
Monte Carlo simulations. MC simulations were performed to explore the interaction between the inhibitor molecules and the iron surface. The adsorption simulation of the compound on the carbon steel surface in HCl medium was performed using the module of adsorption locator applied in Materials Studio 2107. Carbon steel is significantly made of iron atoms, so the surface was obtained by the cleaved plane of iron identified as the stable crystal plane for iron. The optimized structures of the inhibitor molecules from the DFT study were used in Monte Carlo Simulations. The simulation proved to be related to the experimental study, in which the adsorption of each inhibitor molecule on Fe (1 1 0) was simulated in the presence of hydrochloric acid solution characterized by H 3 O + and Cl − ions in the abundance of water molecules. The simulation was carried out by Monte Carlo method [27][28][29] .

Results and discussion
Weight loss method. Effect of concentrations. To assess the effect of varying concentrations of carbonitrile derivatives ((2-10) × 10 -5 M) on the effectiveness of corrosion inhibition, weight loss measurements were performed in 1 M HCl solution. Figure 2 presents the weight loss-time curve for carbon steel in 1 M HCl in the absence and presence of different concentrations of PdC -OH at 25 °C. The weight loss-time curves for PdC-Me, PdC-H are found in the supplementary material (Fig. S1). It is evident that the weight loss of carbon steel in the inhibitor-containing solutions decreases over time with increasing the concentration of inhibitors 30 . The corrosion rate (C.R) , the degree of the surface coverage (θ) , and the inhibition efficiency (%η) are summarized in Table 3. These results indicate that the addition of the studied derivatives in the acidic medium reduced the corrosion rate, which led to an increase in the degree of surface coverage of the inhibitor on the steel surface. In addition, the inhibition efficiency %η increases as the inhibitor concentration increases indicating the formation of an adsorbed barrier layer upon the steel surface, wherein the inhibitor acts as an adsorbate and the metal surface behaves as an adsorbent. Interestingly, the PdC -OH compound shows higher values of %η than PdC-Me and PdC-H, signifying that the molecular structure of the inhibitors affected the adsorption properties of organic molecules on the steel surface. The strong conjugation between benzene and the pyridine ring and the specific hetero-aromatic ring (-OH) promotes the adsorption of the derivative on the steel surface, thus increasing %η 31 .
The effect of KI added to PdC-OH compound. Adding KI can increase the inhibition efficiency as cited 32 . The addition of KI to PdC-OH results in higher inhibition efficiency. As indicated from Table 4, the inhibition efficiency of individual PdC-OH at 10 -4 M is 75.7% (from weight loss results), while the inhibition efficiency of PdC-OH in combination with KI is 91.67%. In the presence of the auxiliary inhibitor and KI, the inhibition efficiencies increase with increasing the concentration, which can be shown from the curves in Fig. 3. The combination of PdC-OH and KI shows a synergistic effect. The synergism parameter S θ is calculated as follows 33    where θ 1+2 = (θ 1 + θ 2 ) − (θ 1 * θ 2 ) θ 1 is the surface coverage by the main inhibitor; θ 2 is the surface coverage by the auxiliary inhibitor; θ′ 1+2 is the measured surface coverage by both the main inhibitor and the auxiliary inhibitor (the concentration of the main inhibitor 1 (PdC-OH in this case) and the auxiliary inhibitor 2 (KI in this case) in the mixture should be the same as used responding to separate situations). If S θ approaches 1, it indicates that there are no interactions between the two inhibitors, while if S θ > 1, the synergistic effect exists; in the case of S θ < 1, the antagonistic interaction might prevail. The value of the synergism parameter for PdC-OH and KI at 6 × 10 −5 M studied from weight loss measurement is 1.2 and the value of the synergism parameter for PdC-OH and KI at 8 × 10 -5 is 1.21 both are larger than 1. This synergistic process occurs through the oxidation of Iions in the solution by the dissolved oxygen, resulting in the generation of I 2 . Then I 2 combine with I − to form soluble yellowish 33 which acts as a bridge and connects between the inhibitor and the steel surface. The protection of the steel surface and thereby greater inhibition ability is mainly contributed to the presence of the main inhibitor (PdC-OH) and the existence of the adsorbed iodide ions.
Adsorption isotherm. The performance of the inhibitor molecules in the aqueous medium results from their adsorption propensity on the corroded surface of the metal and interfering with the electrochemical reactions over the area covered by the inhibitor molecule. Several isotherms equations such as Frumkin, Langmuir, Temkin, and Freundlich were deduced by fit of the surface coverage ( θ ) from experimental data as a function of concentration ( c ) to determine the nature of interactions between the investigated organic molecules and the corroding metal surface during the corrosion inhibition process. The Langmuir isotherm equation is the best-fit equation to the results where the values of the regression coefficient R 2 approaches from unity. Langmuir Isotherm Plots is provided in Fig. 4. This behavior indicates that a monolayer of the adsorbed inhibitor was formed on the surface of the metal substrate according to the Langmuir equation (4) 34-37 : As shown in Fig. 4, C/θ is the ordinate (Y-axis), C is the abscissa (X-axis), 1/K ads is the intercept where the equilibrium constant (k ads ) values can be determined from this interception. Furthermore, the standard adsorption Gibbs free energy ( G o ads ), enthalpy ( H o ads ) and entropy ( S o ads ) of adsorption can be assessed using the following Eqs. (5), (6) and (7), respectively 38-40 : All the above-calculated adsorption parameters are mentioned in Table 4. The negative values of G o ads approves the spontaneous of the adsorption process and strong interactions between the inhibitor molecules and the metal surface. Besides, the high values of k ads revealed an effective adsorption process with high efficiency of the inhibitor molecules 41 . From Table 4, the absolute values of G o ads of the three inhibitors were − 35.7 and Commonly, the values of G o ads are less negative than − 20 kJ mol −1 which belongs to physisorption (electrostatic interaction) between the inhibitor molecules and the metal surface. Conversely, negative values than − 40 kJ mol −1 indicate chemical adsorption, which is owed to adsorption of organic molecules on the metal surface accompanied by charge transfer to form chemical bonds. As above mentioned, the free energy of all studied inhibitors was in the range of − 20 kJ mol −1 to − 40 kJ mol −1 , indicating that the type of adsorption process belongs to the mixed adsorption type (including physisorption and chemisorption) 42,43 . Also as shown in Table 5, the values of G o ads were very close to − 40 kJ mol −1 and increased with temperature from (25 to 40) ºC which was attributed to the adsorption of carbonitrile derivatives on the steel surface dependent mainly on chemical absorption 44 . In the literature, the enthalpy of adsorption ( H 0 ads > 0) and close to (100 kJ mol −1 ) reflects the endothermic behavior of the adsorption. While it is exothermic at ( H 0 ads < 0), the enthalpy less (40 kJ mol −1 ) may involve either physisorption, or chemisorption, or a combination of both 45 . As seen in the current study, the calculated enthalpy H 0 ads values have positive signs and less (40 kJ mol −1 ), indicating that the endothermic nature of the adsorption process and two types of adsorption interactions are present on the steel surface. The values of S o ads are increased in a positive direction which is mainly typical of the endothermic adsorption process that is equivocally related to chemical adsorption. This increase can be attributed to the increased randomness due to the formation of the adsorbed layer of the inhibitors and the desorption of a high number of water molecules at the carbon steel/solution interface 46 . Effect of temperature. Temperature is a predominant factor in the corrosion inhibition process, in which corrosion is accelerated at elevating the solution temperature and affects the action of corrosion inhibitors. To investigate the effect of temperature on the dissolution of carbon steel in the presence and absence of different concentrations of carbonitrile derivatives, weight loss measurements were performed at varying temperatures ranged (25-40 °C). The variation of %η is plotted vs. the above-mentioned temperatures for PdC-OH derivative in Fig 43 . This action indicated that the investigated inhibitor molecules adsorbed on the steel/solution interface 30 . Moreover, the slight increase or constancy in the inhibition efficiency with increasing temperatures is attributed to the chemical adsorption of the inhibitor species only or is owed to a combination of chemical and physical adsorptions 47 .

Thermodynamic kinetic parameters.
To get more insights on the mechanism of the adsorption process of inhibitor molecules on the surface of the metallic material, the value of apparent activation energy E * a is frequently utilized to determine the type of adsorption mechanism. It can be calculated from the plot of the Arrhenius equation shown in Fig. 6, The Arrhenius plots of PdC-Me and PdC-H are found in the supplementary material (Fig. S3). Various parameters of the corrosion process based on Arrhenius equation (8) and the transition state theory equation (9) presented in the following equations 48 : where A is the pre-exponential factor (Arrhenius constant), H * is the activation enthalpy, S * is the activation entropy, T is the absolute temperature in Kelvin, h is the Plank constant, N is the Avogadro number and R  www.nature.com/scientificreports/ is the molar gas constant. As depicted in Table 6, the value of E * a in the blank solution is relatively higher than that in the presence of three inhibitors; this is ascribed to the phenomenon of chemical adsorption, whereas the opposite is true for physical adsorption 49 . The positive values of activation enthalpy ( H * ) indicate that the activation process is an endothermic corrosion process 41 . This phenomenon indicates that high temperature accelerates the corrosion process of carbon steel, and thus is attributed to chemical adsorption. The change in activation entropy S * increases in a positive direction inferring that the activated complex in the transition state is formed by association rather than dissociation process. In other words, more ordering will occur when the reactants convert to the active complex 50 .
Potentiodynamic polarization technique. Polarization measurements were performed to understand the nature of electrochemical kinetics reactions. Figure 7 shows the polarization behavior of the carbon steel electrode in 1 M HCl in the absence and presence of various concentrations of the PdC-OH compound. The current potential plots of PdC-Me and PdC-H are found in the supplementary material (Fig. S4). Relevant electro-  www.nature.com/scientificreports/ chemical kinetic parameters such as corrosion current density ( I corr ) and cathodic (β c ) anodic (β a ) Tafel slopes were obtained from the polarization curves by extrapolating Tafel lines with respect to the corrosion potential E corr 51 . Equation (10) represents the correlation between inhibition efficiency and corrosion current density is represented as follows: where I o corr and I i corr represent the corrosion current densities of the uninhibited and inhibited solutions, respectively. All these parameters are tabulated in Table 7.
As can be seen in Fig. 7, the cathodic and anodic Tafel lines are parallel upon adding these derivatives into acidic solution relative to the blank sample and have no substantial changes with each other. Thus, the adsorbed inhibitor merely hinders the active site of the anodic and cathodic reactions on the metal surface without affecting the actual corrosion mechanism, and only causes inactivation of part of the surface with respect to the corrosive medium 52 . Inspection the data in Table 7, the slopes of the anodic (β a ) and cathodic (β c ) Tafel lines slightly changed upon addition of these derivatives. It could be argued that these organic derivatives have the function of controlling the activation of hydrogen evolution and the anodic dissolution of the metal without any variation in the dissolution technique 53 . Another finding from Table 6 is that the E corr values for the inhibitory systems shifted to positive potential with the change in inhibitor concentrations less than 85 mV. This observation indicated that the studied derivatives behaved as mixed-type inhibitors and affect both the cathodic and anodic polarization curves 54 . As well, the maximum shift in the corrosion potential E corr with respect to E corr (blank) is more than 85 mV (observed for PdC-OH at 8 × 10 -5 M, PdC-Me at 6 × 10 -5 M, and PdC-H at 1 × 10 -4 M). This attributed to that the three derivatives can be classified as cathodic or anodic inhibitors according to the previous literature 55 . The decrease in the corrosion current density (i corr ) with the incremental concentrations of the investigated inhibitors leads to an increase in the inhibition efficiency. This phenomenon pronounced that the investigated inhibitors adsorbed on the active sites and formed a more stable layer on the surface of carbon steel 56 . As summarized in Table 7, the %η order is followed as PdC-OH > PdC-Me > PdC-H. However, the difference in %η between the three compounds was small which can be attributed to the similar structures of the three derivatives.
Electrochemical impedance spectroscopy (EIS). The EIS or AC impedance technique provides important mechanical and kinetic information for the electrochemical system under study. Impedance measurements were utilized to evaluate the corrosion resistance of the carbon steel electrode in 1 M HCl solution in the absence and presence of different concentrations of the investigated derivatives at 25 °C. The impedance spectra include (Nyquist and Bode) plots for PdC-OH are shown in Fig. 8a,b, Nyquist and Bode plots of PdC-Me, and PdC-H are found in the supplementary material (Figs. S5 and S6). Obviously, In the Nyquist plot, the appearance of an individual capacitive loop is represented as a slightly depressed semi-circle. This capacitive loop indicates a nonideal capacitor performance at the metal/solution boundary phase 57,58 . Besides, the diameters of these capacitive loops increase significantly when the concentration of inhibitors in the test solution is increased without affecting their characteristic features. This is an indication that the adsorption of the studied inhibitors retards the corrosion of carbon steel in 1 M HCl without altering the electrochemistry of the corrosion process 59 . Moreover, for all tested inhibitors, the Bode-Phase plots showed a single peak within the studied frequency range, revealing that the impedance measurements were fitted in a one-time constant equivalent model with CPE . Furthermore,  This may be attributed to the charge transfer process that occurs at the metal-electrolyte interface. The increase of the impedance modulus and the gradual increase of the phase angle maxima at the intermediate frequency with increasing concentration of the inhibitor were also shown 60 . This is due to more molecules being adsorbed on the surface of the electrode with increasing concentration and forming a protective layer as a barrier to the dissolution of the metal in acidic solutions. Besides, the phase angle values around 80, this deviation from the ideal corrosive system (phase angle = 90) is ascribed to the surface roughness as a result of both structural and interfacial origin 61 For a more in-depth understanding of the impedance spectra; A simple electrical equivalent circuit in Fig. 9 was employed to fit these experimental spectra 62 . The circuit consists of constant phase element (CPE) , charge transfer resistor (R ct ), and solution resistance (R s ) . Inhibition efficiency (η%) is calculated from R ct values using the following formula Eq. (11) 58 :  www.nature.com/scientificreports/ where R 0 ct , R ct is the charge transfer resistance without and with inhibitor, respectively. However, R ct is a measure of electron transfer at electrode/electrolyte interface, which is inversely proportional to the corrosion rate 59 . Since the metal solution interface behaves as a double layer but without ideal capacitive behavior. Thus, the constant phase element (CPE) was used to improve the capacitance of the electrical double layer instead of utilizing the absolute capacitance double layer ( C dl ) . The impedance of the CPE (Z CPE ) can be calculated using Eq. (12) 58 : where Y O is the magnitude of the CPE , ̟ signifies the angular frequency (̟ = 2πf) , n is the CPE exponent which depends on the nature of the metallic surface representing the deviation from the perfect capacitive performance that value is between 0 and 1. j = (−1) 1/2 represents an imaginary number. The capacitance double layer ( C dl ) values of Y O and n are calculated as follows Eq. (13) 58 : where ̟ is the angular frequency when the imaginary component of the impedance is at its maximum value. The preceding impedance spectroscopy parameters were listed in Table 8, and it is worth mentioning that the values of R ct increased with increasing the concentration of the inhibitor and consequently the inhibition efficiency increased η%. This is an evidence of the effective corrosion protection of steel in the presence of the studied compounds. The dramatic drop in C dl values upon addition of the inhibitor is owed to the replacement of the water molecules by the inhibitor molecules adsorbed at the interface. Hence, the formation of an adherent film on the metal surface leads to the increase in the thickness of the electric double layer and /or the reduction in the local dielectric constant at the metal/solution interface 50 . These outcomes approve that carbonitrile derivatives exhibit good carbon steel inhibitory properties in acidic solutions. Furthermore, the corrosion inhibition efficiencies calculated from electrochemical impedance spectroscopy measurements presented in Table 8 shows an agreement trend with the calculated data from weight loss experiments and potentiodynamic polarization measurements.

Electrochemical frequency modulation. Electrochemical frequency modulation technique is a power-
ful tool for monitoring metal corrosion in aqueous solutions. The foremost advantages of EFM are its rabid and non-destructive properties when applied to the corroded electrode. EFM has a substantial feature since the corrosion current can be determined from small polarization and AC signals without prior knowledge of the Tafel constants 63 . Intermodulation spectra acquired from the EFM technique for evaluating different concentrations of the studied derivative (PdC-OH) versus corrosive media 1 M HCl on the steel electrode are characterized in Fig. 10, EFM spectra for PdC-Me and PdC-H are found in the supplementary material (Figs. S7 and S8). Each depicted spectrum represents two current response peaks appearing at 2 and 5 Hz intermodulation frequencies which were analyzed to obtain the relevant corrosion kinetic parameters 64 . Electrochemical parameters such as corrosion current density (i corr ) , Tafel constants ( β a and β c ), and the causality factors CF-2 and CF-3 were measured and listed in Table 9. It is found that the magnitude of i corr is suppressed by adding the investigated organic compounds in acidic solution and accordingly the inhibition efficiency is increased. This behavior indicates the effectiveness of the tested inhibitors due to the stability of the protective barrier layer on the steel surface 65 . The values of ( β a and β c ) were found to change with increasing concentration, therefore carbonitrile derivatives are   Quantum chemical parameters. Quantum chemical calculations were performed to inspect the effect of the structural and the electronic properties of the material on the corrosion inhibition performance. Besides, to gain insights into the donor-acceptor interactions between inhibitor molecules and metal atoms. According to the frontier molecular orbital theory FMO, analysis of the density distributions of HOMO and LUMO can determine the donation-acceptance ability and molecular reactivity of the investigated inhibitors. E HOMO denotes the ability of a molecule to donate electrons, whereas E LUMO represents the ability of a molecule to accept electrons. Figure 11 shows the optimized molecular structures, HOMO and LUMO electronic density distributions, respectively. All the calculated quantum chemical parameters are listed in Table 10 including the energy values for the molecular orbitals (HOMO and LUMO), the energy gap (ΔE), and the dipole moment (μ). Examination of Fig. 11, the electron density of the HOMO orbitals of the carbonitrile derivatives is concentrated over the entire pyridine ring, and the high distribution on the phenolic ring in the PdC-OH compound. The contribution of the whole molecules in electron transfer is attributed to the presence of high electron density throughout the π-electrons of the aromatic and pyridine moieties, which are the sites most susceptible to electrophilic attacks in the molecules. However, it can also be seen that the presence of groups (-NH 2 -C= O and -CN) in the pyri- www.nature.com/scientificreports/ dine ring is a relatively softer part of the molecules, mainly involved in electron transfer. Moreover, the LUMO electron density of the three derivatives is mainly spread over the pyridine ring and the aromatic rings. Thus, the tendency to accept charges accumulated on the metal surface increases to form a feedback bond between the donor iron atoms and the acceptor anti-bonding orbital of the inhibitor 63,67 . Therefore, the determination of the electronic density of the HOMO and LUMO orbitals revealed that the studied inhibitors could adsorb on the steel surface by donating π-electrons from pyridine and aromatic moieties (Nucleophilic attack) to the vacant d-orbital of the metal and another possibility is that these derivatives may adsorb by acquiring electrons from the metal surface (Electrophilic attack) 68 . In Table 9, the calculated values for E HOMO and E LUMO show that PdC-OH has a relatively higher value for E HOMO and a relatively lower value for E LUMO compared to PdC-H and PdC-Me. This finding indicates that PdC-OH has the highest propensity to adsorb on the carbon steel surface. It is generally believed that molecules with low E LUMO values and high E HOMO values tend to present better inhibition efficiency 69 . The energy band gap ΔE (ΔE = E HOMO − E LUMO ) 70 is the reactivity coefficient in theoretical studies. Murulana et al. postulated that the molecules which have a small energy gap value are considered highly reactive molecules and have good corrosion performance on the metal surface 71 . PdC-OH has the smallest value of ΔE as reported in Table 9. The dipole moment μ is a descriptor of the polarity in the covalent bond of molecules 71 . Abdallah et al. 72 alluded that the dipole moment is an indication of the electronic distribution in the molecule. The efficiency of corrosion inhibition increases with increasing value of μ, due to stronger dipole-dipole interactions with the metal surface resulting in strong adsorption and effective corrosion inhibition 73 . The µ values follow the order: PdC-OH > PdC-Me > PdC-H which may be attributed to the largest value of the adsorption preference for the inhibitor molecule on the metal surface. The DFT results by DMol3 in Table 9 showed that the compound with the OH Phenolic group was the most reactive compound of the tested group. This observation is consistent with previous experimental methods. Classification of these inhibitors according to their inhibition efficiency is PdC-OH > PdC-Me > PdC-H.

Monte Carlo simulation. Monte Carlo simulations are performed to describe how inhibitor molecules
behave and interact at a metal interface. This method can effectively help reduce the cost of experiment, and can also help in the experimental design of inhibitor molecules that effectively inhibit metal corrosion 74 . Figure 12 shows a side view and a top view of the optimized equilibrium configurations of the three carbonitrile derivatives adsorbed on a carbon steel substrate. Considering this output in Fig. 12, the geometrically optimized molecules under study being loaded on Fe surfaces indicated that these molecules tended to adsorb almost planar orientation on the surface. This flat orientation provides close contact with the active sites to impede the corrosion reaction 75 . The results in Table 11 give the output of energies computed by MC simulation such as total adsorption, adsorption energy, rigid absorption, and deformation energies. The outlined adsorption energy (E ads ) was calculated mathematically by the summation of the rigid adsorption energy and the deformation energy of the adsorbate molecules 76,77 . In general, E ads is used to express the strength of the adsorption process of inhibitors on the surface of iron. The rigid adsorption energy was described as the energy released when the inhibitor molecules are adsorbed on the metal surface and the deformation energy recognized as the energy released when the adsorbed-adsorbate components undergo relaxation on the surface 65 . As depicted in Table 11 the order of the calculated E ads values is PdC-OH (− 4073.86) > PdC-Me (− 4024.09) > PdC-H (− 4006.85), indicating the inhibition performance follows: PdC-OH > PdC-Me > PdC-H. Negative magnitudes of E ads for all three studied inhibitors denote the spontaneous and strong adsorption process that occurred on the iron substrate. As shown in Table 11, PdC-OH reached a maximum value of dE ads /dNi (− 208.85) in the simulation method indicating its highest contribution to the total adsorption energy 78 . This theoretical study supports previous experiments and proves coincident well with all acquired data. It can be concluded that all the three studied inhibitors can adsorb on the steel surface through the π-charge of pyridine and the moieties of the aromatic ring providing strong bonding to the metal surface. Finally, the use of carbonitrile derivatives as a corrosion inhibitor has a great potential for corrosion prevention, and consequently better inhibition efficiency.  79 . AFM characterizes the morphology of the corroded metal in 3D images. Figure 13a shows a micrograph from AFM analysis of a carbon steel surface after immersion in 1 M HCl for 24 h in the absence of an optimal concentration of inhibitors 72 . The surface was severely damaged and corroded by acid attack, which was estimated by the average roughness (Ra) that recorded a height of 272.8 nm. Figure 13b shows the smooth and uniform surface of the free sample with Ra 49.8 nm 72 . However, the average roughness value was reduced to 152.11, 76.06, 64.55 nm after the treatment of the test solution with carbonitrile derivatives PdC-H, PdC-Me, and PdC-OH, respectively as shown in Fig. 13c compared to the absence of these inhibitors. The improvement shown in the surface topography is due to the adsorption of the investigated carbonitrile molecules onto the steel surface and the formation of a protective layer. In view of the above findings, the inhibition action tendency of inhibitors acquired from surface analysis is related to those acquired from experimental results.    Figure 14 signifies the ATR-IR spectrum of the PdC-OH compound and the construction of a protective film on the carbon steel surface after soaking for 24 h in 1 M HCl with the optimum concentration 10 -4 M of this compound. ATR-IR spectra for PdC-Me and PdC-H are shown in are found in the supplementary material (Figs. S9 and S10). It can be seen in Fig. 13 that the ATR-IR spectra of the protective film formed on the steel surface showed all the characteristic peaks of the pure inhibitor, indicating that the inhibitor adsorbed on the steel surface. The characteristic peaks of the active function groups of the free organic compound before (pure inhibitors) and the other peaks in the presence of this compound are discussed and summarized in Table 12. From the obvious peaks, function groups such as (Nitrile C≡N, -C = O and -NH-) appear on the carbon steel surface. Besides, there were small changes, and some frequencies of weak function groups were shifted significantly such as the peak of (C-O) Phenolic and stretching (C=C) aromatic as shown in Table 12. The above findings clearly illustrate that the specific hetero-aromatic ring (-OH) and the π electrons of the aromatic rings were involved in the adsorption process of the PdC-OH compound.
X-ray photoelectron spectroscopy analysis. X-ray photoelectron spectroscopy (XPS) was performed to confirm the adsorption of the studied organic compounds on the carbon steel surface and to determine the chemical nature of the inhibitors/carbon steel interface. Figure 15 shows the high-resolution XPS spectrum survey obtained for the surface of corroded carbon steel in 1 M HCl solution in the presence of the PdC-OH derivative. The XPS spectrum shows complex forms, which were assigned to the corresponding species through a deconvolution fitting procedure. High-resolution XPS spectra obtained for carbon steel surface corroded in 1 M HCl composed of (Fe 2p, O 1s, Cl 2p, C 1s) are illustrated in Fig. 16. While in the presence of the studied carbonitrile compounds, the XPS spectra consisted of the same elements (Fe 2p, O 1s, Cl 2p, C 1s) in addition to N 1s core level as shown in Fig. 17. The XPS spectrum of Fe 2p shows six peaks, the higher peak at low binding energy (711.2 eV) corresponding to metallic iron 80 . The peak at 714.6 eV is attributed to Fe 2p3/2, and the small peak at 719.40 eV is ascribed to the Fe 3+ satellite 81 . In addition, the peaks at 724.3 eV ,and 727.9 eV can be attrib-   . The second has a binding energy of 531.8 eV, related to hydroxide bonds chemisorbed on the surface 87,88 . The third peak, at 532.4 eV, can be assigned to the oxygen of the adsorbed water and OH − in FeOOH 89 . In the case of the inhibited samples, the oxygen spectrum shows three peaks at binding energies of 530.8 assigned to iron oxide, the peak at 532.8 for OH − in FeOOH, and the last peak at 534.2 corresponding to C-OH and surface adsorbed-water molecules. Moreover, in the presence of the investigated inhibitors, the O1s core level signal decreases significantly which is consistent with the adsorption of the inhibitors on the steel surface. Also, the XPS spectrum for Cl 2p shows the best fit in two components locate at around 198.9 eV for Cl 2p3/2 and 200.6 eV for Cl 2p1/2 as reported by Gu et al. 90 .The same peaks are obtained in the absence and presence of the studied inhibitors due to the arrival of some chloride ions to the surface and are responsible for the corrosion of the alloy. Finally, the XPS spectrum of N 1s appears with a single peak at 399.9 eV, and this peak can be attributed to the neutral imine (-N=) and amine (-N-H) nitrogen atoms as previously reported 91 . The appearance of N peak in the spectra of the protected sample surface confirms the adsorption of the studied inhibitors on the sample surface. According to the XPS results, we can conclude that the composite film formed on the surface contains iron oxide/hydroxide and carbonitrile compounds. These components provide a protective film that can effectively isolate the corrosion medium and reduce the corrosion of carbon steel.
Possible corrosion inhibition mechanism. The adsorption process of organic inhibitor molecules depends on many physical and chemical properties such as; Electron density, chemical structure, metal nature, charges at the metal/solution interface, and type of aggressive medium (pH and/or electrode potential) 92,93 . www.nature.com/scientificreports/ These properties affect the mode the molecules interact on the metal surface. Adsorption of organic molecules on solid surfaces cannot be considered purely physical or chemical; A combination of both processes can occur in adsorption 83,84 . Physical interactions are accepted as the first step for adsorption of molecules on the metal surface and then chemical adsorption may occur via different charge sharing processes 94 . In a solution of hydrochloric acid, the inhibitor molecules are adsorbed on the metal surface through the following interactions: (i) the electrostatic interaction between the positively protonated inhibitor and the chloride ions adsorbed on the metal surface (physisorption process); (ii) the chemical interaction between the lone-pair electrons on the heteroatoms (N, S, O, P) and the unoccupied d-orbital on the metal surface (chemical adsorption process); (iii) the donoracceptor interaction between π-electrons of the aromatic ring and the vacant d-orbitals on the metal surface www.nature.com/scientificreports/ (chemical adsorption process); and (iv) Retro-donation interaction between the excess negatively charged metal surface and the π*anti-bonding of the inhibitor molecule. To elucidate the corrosion inhibition mechanism of the investigated carbonitrile derivatives, the inhibition action is due to adsorption of these compounds at the metal/solution interface. Adsorption may occur through a donor-acceptor interaction between conjugated π-charge of (two aromatic and pyridine rings moieties) and an unoccupied d-orbital of iron atoms to form coordination bonds (chemical adsorption process) 95 . The electron density of the donor atom in the carbonitrile functional group depends on the substituents present in these compounds. The direction of the inhibition potentials of three derivatives is determined by the value of Hammett sigma constant (σ) for the substituent groups (OH, CH 3 and H). This is because; in this type of derivatives the adsorption center is conjugated with the ring. The presence of electron donation (OH, CH 3 ) (σ = − 0.17 for p-CH 3 and σ = − 0.37 for p-OH) increases the electron density of the neighboring aromatic ring and makes the π-electrons more available for interaction with the C-steel surface thus strengthens the adsorption of PdC-OH and PdC-Me on the steel surface. PdC-OH has the highest inhibition efficiency, which is due to the presence of the OH group which added an extra adsorption center to the molecule compared to the CH 3 group in PdC-Me compound. PdC-H ranked below the two inhibitors in the inhibition order due to the presence of a hydrogen atom (H-atom with σ = 0.0) which is considered an electron-withdrawing atom 87 . Meanwhile, the carbonitrile derivatives can accept electrons from the d-orbital of iron atoms through their π* anti-bonding orbital to form a feedback bond (retro-donation process), thus promoting the adsorption of the inhibitor molecules on the steel surface. In addition, the carbonitrile molecules may be adsorbed on the metal surface through the van der Waals force by interacting neutral inhibitor molecules with iron ions to form [Fe-PdC] complexes (physical adsorption process).
It can be concluded that the good inhibition efficiency of the studied derivatives is due to the presence of two aromatic and pyridine rings, the polar functional groups such as (-CN, -NH 2 ) that act as adsorption centers, and the specific hetero-aromatic ring (-OH) that present in PdC-OH compound. Hence, the type of adsorption of carbonitrile derivatives on the C-steel surface is more than just physical adsorption but not purely chemical [88][89][90] .

Conclusion
According to the present study, the synthesized carbonitrile compounds can be used as effective corrosion inhibitors for C-steel in 1 M HCl. The corrosion inhibition efficiency increases with increasing concentrations of the studied inhibitors, and ranked as PdC-OH > PdC-Me > PdC-H. The adsorption of the inhibitors on the surface of C-steel in 1 M HCl follows the Langmuir isotherm and the calculated thermodynamic parameters propose that the adsorption is predominantly chemisorption. Addition of KI to the PdC-OH shows a synergistic effect that significantly improves its inhibition efficiency. The magnitudes of the synergism parameter (Sө) showed that the corrosion inhibition produced by PdC-OH and iodide mixture is synergistic in nature. Tafel polarization data showed that the corrosion current density decreases and the corrosion potential changes slightly with the addition of carbonitrile compounds, therefore these compounds are mixed type of inhibitors. The surface examined by ATR-IR, AFM, and XPS showed the formation of adsorbed film on C-steel surface. There is a good correlation between theoretical and experimental data.