Introduction

The damage by corrosion generates high inspection, repair, and replacement costs, constituting a public risk. Many techniques were explored to control this issue. Applying corrosion inhibitors has proven to be the most efficient method for increasing these materials' corrosion resistance and minimizing the harm they cause1. The corroding surfaces immediately become rough after the corrosion assault begins, significantly affecting the diffusion-controlled corrosion rate. Furthermore, when the generated corrosion layer is highly porous, surface roughness greatly increases the mass transfer rate of O2 to the electrodes of the electrochemical corrosion cell, resulting in higher corrosion rates. The most popular approach for controlling corrosion is the creation of novel chemicals that act as corrosion inhibitors, especially in acid media, due to several technical and financial benefits. The efficiency of these chemical compounds is affected by various factors, including temperature, humidity, shear stresses caused by fluid flow, and others. This kind of corrosion inhibitor is an organic chemical substance shielding the metallic substrate by generating an adsorbed layer that prevents water molecules and other corrosive species from reaching the surface2. The inhibition effectiveness depends on the ability of the inhibitor/surface system to form an adhesive and continuous layer and isolate the surface from the corrosive environment, thus decreasing the corrosion rate. The polar functional groups and the intermolecular interactions between the inhibitor molecules play a crucial role3,4,5. Based on the interaction strength between surface and inhibitor, the inhibitor compounds have been described by two kinds of interactions that corrosion inhibitors can use to adsorb at the interface: as being chemisorbed, which occurs when inhibitors and d-orbitals of the iron surface share electrons, and physisorbed, which occurs when charged molecules interact electrostatically with the metal surface.

Carbon steel (CS) is frequently used in various industries as the preferred construction material because it is less expensive than corrosion-resistant alloys. CS must be protected from corrosion because it has a broad scope of applications in industries, including power plants, the petroleum industry, and building materials, as it is cost-effective and imparts high mechanical strength3, 6,7,8. CS is frequently used as a structural component in industrial pipes, buildings, bridges, and kitchen appliances. CS is unstable chemically and reacts chemically or electrochemically with its surrounding environments to produce more stable corrosion products. In contrast, metal corrosion has always been a hot topic for researchers because of the risks to safety and the financial losses it causes to the industry, the way corrosion costs governments a lot of money9.

Acid solutions are generally used to remove undesirable scale and rust in several industrial processes. Because it is less corrosive than other mineral acids, Phosphoric acid (H3PO4) is a significant industrial chemical used as an intermediate in the fertilizer industry for metal surface treatment in the metallurgical industry. It is used for processes like chemical and electrolytic polishing or etching, chemical colouring, removing oxide film, phosphating, passivating, and surface cleaning. Despite its importance, it shows strong corrosiveness on CS. So, adding anti-corrosion materials slowed or inhibited the CS corrosion in phosphoric acid. Inhibitors are used in these processes to control metal dissolution as well as acid consumption10,11,12,13.

Therefore, adding an excellent inhibitor to an acidic environment is one of the best options. Many researchers are interested in the chemistry of ionic liquids (PILs), which have collected extraordinary interest as powerful and have cautiously started on the more difficult challenge of industrial-oriented synthesis because they consider them corrosion inhibitors of green chemistry, thermal stable, have a strong adsorbent defence on the metal surface14,15,16,17,18,19. PILs have several advantageous physiochemical properties, including non-toxic, high conductivity, non-flammability, high thermal and chemical stability19,20,21,22,23,24,25, and environmentally friendly and non-hazardous due to their non-negligible vapor pressure. Additionally, PILs are highly soluble in polar corrosive environments due to their ionic nature. It is understandable that PILs with various cationic and/or anionic counters and show different side chains and cationic headgroups have been the interest of researchers in medicinal chemistry26,27,28,29,30,31,32, catalysis33, preventing certain metals and alloys from corroding34, electrochemistry35, biological activity in drug delivery and synthesis of drugs36, fuel production and processing37, 38, liquid crystal development39, biotechnology40, and other chemical processes. PILs are salts combining organic cations like pyridazinium, imidazolium, and pyrrolidinium with inorganic anions like chloride, bromide, and iodide. Pyridine is a toxic compound, but if it was developed with some additives and attached with different chains to be one of the PILs compounds, it approached pointing truly greener and more secure PILs to the environment.

Owing to rising environmental regulations, developing nontoxic alternatives compared to hazardous inorganic inhibitors is receiving more attention nowadays. Depending on their specific structural characteristics, they can exhibit diverse biological activities, synergistic effects and versatile applications. So, this paper is concerned with evaluating the action of the newly synthesized PILs on the electrochemical corrosion processes as anodic dissolution under mass transport control. Depending on its simplicity, the mass transfer coefficient can be obtained using the limiting current technique, which has gained wide acceptance in recent decades. The inhibitors were added with different concentrations at several temperatures to know their inhibition efficiency. Additionally, global quantum chemical descriptors, Fukui indices, local softness, local electrophilicity, dual Fukui function, dual local softness, and dual local philicity were investigated and discussed in more detail to understand the mechanism, the interactions, and the structural orientation of the two PILs and the metallic surface.

Methodology (experimental)

Synthesis of inhibitors molecules

According to our previous work, the desired (PILs) 1-(2-(4-bromophenyl)-2-oxoethyl)-3-((2-(1-(2-(4-bromophenyl)-2-oxoethyl) pyridine-1-ium-4 carbonyl) hydrazono) methyl) pyridine-1-ium tetrafluoroborate (BPHP) and 1-(2-(4-trifluoromethyl phenyl)-2-oxoethyl)-3-((2-(1-(2-(4-trifluoromethylphenyl)-2-oxoethyl) pyridin-1-ium-4-carbonyl) hydrazono) methyl) pyridin-1-ium tetrafluoroborate (TFPHP) were prepared by quaternation of the pyridinium nitrogen atom of the generated bis-pyridine derivative41, followed by a metathesis event (Fig. 1).

Figure 1
figure 1

Synthetic routes for synthesizing di-cationic pyridinium ionic liquids 4a–4b.

Thus, the corresponding PILs 3(a, b) were produced in good yield by thermally alkylating the initial bis-pyridine hydrazine 1 with two equivalents of 4-substituted-phenacyl bromide 2(a, b) (Fig. 1). The 1H NMR, 13C NMR, and mass spectra analysis confirmed the synthesis of the intended 3a. As a result, the two doublets at δH 6.67 ppm in the 1H NMR spectrum were assigned to the two new methylene protons (2×COCH2). An extra eight aromatic protons were also recorded at their usual chemical shifts belonging to the two aromatic rings of the phenacyl core. All remaining protons resonated in their respective area. The 13C NMR spectrum of 3a supported the quaternization reaction, showing the methylene carbons resonating at δC 66.67 and 66.73 ppm, respectively.

The displacement of the bromide anion (Br) and the furnishing of the desired task-specific PILs 4(a, b) in good yield were accomplished by treating the synthesized dipyridinium bromide 3(a, b) with potassium tetrafluoroborate. The success of the anion exchange was unambiguously evidenced by their spectroscopic results, which divulged that there was no change in their 1H and 13C NMR data compared to their corresponding starting pyridinium bromide 3(a, b). Correspondingly, the resulting PILs 4(a, b) structure was deduced based on their 31P, 11B, 19F NMR, and mass spectra.

The structure of PILs 4 (a, b) showed the presence of a multiple resonating between δB (−1.64) to (−1.78) ppm in its 11B spectrum and two doublets at δF −149.32 and −149.65 ppm in its 19F NMR spectrum respectively, supported the presence of tetrafluoroborate anion (BF4) in the PILs 4 (a, b) as counter anion, more spectral data of synthesis were mentioned in the Supplementary figures 16.

Electrode sample and corrosive medium

The corrosive medium, 8 M H3PO4, was prepared using analytical grade phosphoric acid (85% w/w) supplied by Fisher Chemicals Ltd. The electrode sample used for electrochemical measurements was carbon steel (CS) having a surface area of 10 cm2 and the composition (wt.%) was determined by JEOL apparatus JSM-IT200 model: 0.14% Carbon, 0.02% Silicon, 0.56% Manganese, 0.03% Phosphorus, 0.01% Nickel, 0.01% Chrome, 0.01%Vanadium, 0.03% Aluminum, 0.04% Sulfur, and 99.15% Iron. We must be aware that the selection of 8 M H3PO4 is based on that the H3PO4 concentration effect on the value of limiting current ILim can be interpreted via the mass transform concept10, 11.

All experiments were carried out using 100 ml of the prepared phosphoric acid in various concentrations of the studied PILs inhibitors (1.25, 2.5, 7.5, 12.5, 17.5, 25 and 37.5) 10–5 M by dissolving in water for BPHP and TFPHP. The ILim was recorded for them at different temperatures: 293, 298, 308 and 318 K. Experiments were triple-checked to ensure the measurements were accurate and the results were within 2% error. The reported corrosion data is the average of the three measurements.

Galvano-static polarization measurements

Due to its simplicity and accuracy, the Galvano-static technique may be a common tool to survey inhibitors' inhibition efficiency. Within the present study, standard methods that were described previously were used to perform the polarization experiments10,11,12,13.

Spectroscopic analysis

After corrosion exposure by applying galvanic polarization, several characterizations were applied to CS in 8M H3PO4 without (blank) and with PILs inhibitors.

The quantity of Fe2+ was recorded by atomic absorption spectroscopy (AAS) estimated by ANALYTIK JENA CONTRAA 300 AAS to know the amount of iron ions passed into the solution after corrosion measurements and that for environmental protection.

The roughness of the CS surface was shown by atomic force microscope (AFM) Auto probe cp-research head manufactured by Thermomicrpscope operated in contact mode using Silicon Nitride probe model MLCT manufactured by Bruker. Proscan 1.8 software was used for controlling the scan parameters. Scan parameters: (contact mode, scan area 25 × 25 µm2, scan rate 1 Hz, number of data points 256 × 256 points) and IP 2.1 software for image analysis.

UV–visible reflectance spectroscopy (Jasco V-570) in the 200–700 nm range was used to get the brightness degree and reflection spectra.

Ultraviolet–visible absorption spectrophotometry [Pg instruments t-80 UV–Visible spectrophotometer] was used to recognize the absorption of metal and inhibitors in the solution.

Scanning electron microscope (SEM) shows the shielding layer on the CS surface and its morphological characterization. It coupled with the electron disperses X-ray spectroscopy (EDX) analyzer to determine the elemental constituents of layers formed on the corroded surface using a JEOL apparatus JSM-IT200 model.

X-ray photoelectron spectroscopy (XPS) analyses were performed by K-ALPHA (Themo Fischer Scientific, USA) with monochromatic X-ray AL K-alpha radiation (energy − 10 to 1,350 eV) under a vacuum of 10–9 with full-spectrum pass energy 200 eV at narrow-spectrum 50 eV. The analysis spot size was 400 μm in diameter. All binding energy values were determined concerning the C1s line originating from adventitious carbon.

Theoretical studies

On the other hand, the theoretical calculations achieved the experimental data using Gaussian-09 with DFT results with method B3LYP/6-311G (d, p) showing the structures and electronic properties in the gas and liquid phase.

Results and discussion

Galvanostatic polarization curves

The electrochemical polarization experiments were conducted to understand the kinetics and suppression mechanism the studied PILs inhibitors provided at the CS/H3PO4 interface. This goal was provided by the analysis of current–potential curves obtained from Galvanostatic measurements.

It can be seen from Fig. 2 and Table 1 that adding PILs compounds (BPHP & TFPHP) significantly reduced the corrosion limiting current values by increasing inhibitor concentrations and enhancements by temperatures compared to the blank curve. PILs inhibitors block the active sites of the CS surface, indicating that the corrosion of the iron electrode after the adsorption of PILs was more difficult, and two PILs showed excellent corrosion resistance. The values of inhibition efficiency (%\({I}_{Eff}\)) and the degree of the surface coverage was computed by the following Eq. (1)13, 42:

$$\% = \frac{{(I_{Lim} \left( {{\text{blank}}} \right) - { }I_{Lim} \left( {{\text{ILs}}} \right)}}{{I_{Lim} \left( {{\text{blank}}} \right)}} \times { 1}00$$
(1)

where ILim(blank) and ILim(PILs) are the limiting currents without and with a concentration of inhibitors, respectively. As seen in Table 1, the %\({I}_{Eff}\) were enhanced with increasing inhibitor concentration to reach 76.19–71.43% for 37.5 × 10–5 M of BPHP and TFPHP, respectively. By the way, when adding a higher concentration of the inhibitor than 37.5 × 10–5 M to the solution, the inhibitor would be desorbed from the surface of the metal. Even though, due to the desorption of the inhibitor molecules by increased temperatures, the \({I}_{Eff}\) of PILs decrease from 76.19 to 46.20% in the case of temperature variation. This may be attributed to the high dissolution rates of CS at elevated temperatures due to increased solution agitation resulting from the high rate of H2 gas evolution. This may also reduce the ability of inhibitors to be adsorbed on the CS surface. The results tabulated indicate that the investigated molecules work by adhering to the CS surface and assisting in forming an inhibitory layer that serves as a barrier between the CS surface and the corrosive media's constituent parts. Since BPHP has a bigger \({I}_{Eff}\) than TFPHP and a lower desorption rate than TFPHP; it is a better inhibitor than the other one (Fig. 3).

Figure 2
figure 2

Polarization curves of the tested CS (a, b) at different PILs concentrations at 293 K & (c, d) at different temperatures for PILs concentration 37.5 × 10–5 M.

Table 1 Limiting current (Ilim) values and inhibition efficiency (%\({I}_{Eff}\)) with and without PILs at different temperatures and concentrations.
Figure 3
figure 3

The effect of temperature on the inhibition efficiency (%\({I}_{Eff}\)) at constant concentration (37.5 × 10–5 M) of PILs.

Adsorption isotherm behavior and thermodynamics parameters

It would be precious to make sense of the adsorption processing by a fitting adsorption isotherm, which could give further helpful bits of knowledge into the association of the inhibitor with the metal surface and, subsequently, the system of corrosion restraint. To decide the best adsorption isotherm model, which improves the degree of surface coverage area (θ) upon the CS surface. As could be seen, the formation of a defensive layer over the metallic surface, which reduces the reactive surface area for corrosive ion adhesion and hence mitigates corrosion, was shown as the inhibitor quantity was increased by the increase in the θ across the CS substrate. The direct types of considered adsorption isotherm models are as the following: Langmuir, El-Awady and Flory–Huggins applied for the studied PILs (BPHP &TFPHP), were determined at 298 K for different concentrations. The direct types of considered adsorption isotherms are described in Table 2, where \(\theta\) = surface coverage = \({I}_{Eff}\)%, \({C}_{{P}_{ILs}}\) is the PILs concentration, y is the number of inhibitor molecules involving one dynamic site, x is the number of water atoms supplanted by one particle of the inhibitor, and Kads is the constant of equilibrium of the adsorption interaction, which is temperature dependent. It is related to the free energy of adsorption according to Eq. (2):

$$\Delta G_{ads} = - RTln \, \left( {55.5 \, K_{ads} } \right)$$
(2)
Table 2 Linear isotherm equations and adsorption parameters for PILs at 298 K.

R, T, and 55.5 M are the ideal gas constant, work temperature (293–318 K), and water content, respectively. Figure 4 shows the linear fit according to the curve derived from the Galvanostatic technique. The adsorption parameters deduced from these isotherms and values of the determination coefficient (R2) are regrouped in Table 2.

Figure 4
figure 4

PILs adsorption isotherm models for CS tested electrodes in 8 M H3PO4 with different concentrations for isotherm equations in Table 2 (a) Langmuir model by plotting (b) Flory–Huggin’s model. Elawady model (c) BPHP (d) TFPHP.

Figure 4a represents Langmuir’s adsorption relationship with linear correlation coefficient (R2) values approaching one. The outcomes indicate that the Langmuir model displays the best linear relationship, but the slope deviates markedly from unity for BPHP and TFPHP43, 44. Besides, the Langmuir model did not achieve; it remains hypothetical and often referred to as ideal adsorption, which is not really applicable in concrete complex electrochemical systems. Electrochemical systems are often referred to as either ideal or non–ideal adsorptions because of the different assumptions on which each adsorption isotherm is based. So, we were obliged to test other isotherm models, namely El–Awady and Flory–Huggins.

It should be pointed out that El–Awady and Flory–Huggin’s isotherm can be used to examine the number of water molecules that can be replaced by one inhibitor molecule on the CS surface.

As shown in Fig. 4b, the linear form of Flory Huggins adsorption isotherm as log θ/CPILs vs log (1−θ) at 298 K. The obtained data reported in Table 2 yielded a linear correlation coefficient (R2) with slope (x) and intercept (xK). We found that the calculated values of (x) were higher than unity, implying that one BPHP and TFPHP molecule replaces more than a water molecule at a constant temperature.

On the other hand, the curve fitting of the El-Awady model is shown in Fig. 4c, d at different temperatures, and the calculated values of K, K′ and 1/y are listed in Table 3. The strong correlations confirm the validity of the approach. The values of 1/y ensure that every molecule in the adsorbent mechanism is linked to greater than one active site on the CS outermost layer. It is confirmed that the corrosion inhibitor forms a dense multilayer physisorption of PILs molecules on the CS surface.

Table 3 Thermodynamic parameters data of PILs by ELAwady adsorption model.

Table 2 shows that the values of Kads obtained from the El-Awady model were large compared to Flory Huggins’s adsorption isotherm. In addition, the large value of Kads indicates the high adsorptive power of BPHP. On the other hand, Table 3 shows the high values of Kads observed at low temperatures mean that strong interactions of the PILs molecules with the Fe were favored at this temperature.

The free energy of adsorption (∆Gads) values are assigned from Kads values of the El-Awady adsorption model, which showed the best correlation with the experimental data. The computed values of ∆Gads for the PILs compounds at various temperatures are recorded in Table 3. Negative signs of ∆Gads elucidate the spontaneous adsorption of the studied PILs on the CS surface 45. The ∆Gads values range from −32.13 to –31.78 kJ.mol-1 for BPHP and from −31.37 to −31.09 kJ. mol-1 for TFPHP, clarifying that the PILs adsorption process in 8M H3PO4 involves both physisorption and chemisorption mechanisms (physicochemical), which signifies a complex mode between CS and inhibitor molecules46,47,48,49. In another way, physicochemical meaning involves electrostatic interactions between the charged molecules and the metal (physisorption) and also sharing or transfer of electron pairs or π electrons from organic molecules to the metal surface to form a coordinate bond (chemisorption).

Else important thermodynamic parameters are obtained by Vant’t Hoff equation, which is utilized to assess enthalpy of adsorption (∆Hads) by plotting lnKads vs 1/T. A linear relation is gained with a slope equal to (−∆Hads) /R). The values of (∆Hads) were computed and registered in Table 3. The negative amount of ∆Hads shows that the adsorption of the inhibitor is an exothermic interaction; this outcome might make sense of how the adsorption is consistent, and afterward, the inhibition decreases with expanding temperature. In this work, the values of ∆Hads for the adsorption of the inhibitor are − 35.46 kJ/mol for BPHP and −34.33 kJ/mol for TFPHP. This value is closer to − 40 kJmol−1 and far from − 100 kJmol−1. It implies that the adsorption of PILs follows physicochemical50. The Gibbs–Helmholtz equation is utilized to deduce the standard entropy of the adsorption (∆°Sads) at 298 K according to the following Eqs. (3) and (4):

$$lnK_{ads} = \left( {\frac{{ - \Delta H_{ads} }}{RT}} \right) + Constant$$
(3)
$$\Delta G_{ads}^{\circ} = \Delta H_{ads}^{\circ} - T\Delta S_{ads}^{\circ}$$
(4)

The negativity of adsorption entropy ∆S°ads, obtained in this work, suggests a reduction in the translational degrees of freedom and perturbation, possibly due to the accumulation of water molecules on the surface.

The active thermodynamic model used for driving the heat of adsorption (Qads) for extra increased understanding of the adsorption procedure using Eq. (5)51:

$$\log \left( { \frac{\theta }{1 - \theta }} \right) = \log A + \log C_{P_{ILs} } - \left( {\frac{{Q_{ads} }}{2.303RT}} \right)$$
(5)

where A is a constant and \({C}_{{P}_{ILs}}\) is the concentration of inhibitors, Fig. 5 shows the relation between log \(\left(\frac{\theta }{1-\theta }\right)\) with \(\frac{1000}{T}\), the slope equals \(-(\frac{Q}{2.303R})\). For the BPHP (Qads = \(-\) 28.872 kJ/mol) and TFPHP (Qads = \(-\) 27.349 kJ/mol). The negative value of Qads shows that the surface coverage level diminishes with a temperature rise in the presence of inhibitors and exothermic processes52, 53. The higher absolute value of BPHP means that its molecules were adsorbed more than TFPHP.

Figure 5
figure 5

The active thermodynamic model used for driving the heat of adsorption (Qads).

To recognize physisorption and chemisorption, the isotherm of Dubinin-Radushkevich has been utilized and described as follows54:

$${\text{ln}}\theta = {\text{ ln}}\theta_{{\text{max}}} - {\text{a}}\delta^{2}$$
(6)

where θmax is the maximum surface coverage, and δ is the Polanyi potential described by:

$$\delta = RTln\left( {1 \, + \frac{1}{{C_{P_{ILs} } }}} \right)$$
(7)

By plotting ln θ against δ2 Fig. 6, the constant a was obtained from the slope. The values of a prompt the mean adsorption energy Em for the different temperatures are in Table 4 This energy, which is the exchange energy of 1 mol of adsorbate from the solution bulk to the outer layer of the adsorbent, is characterized as:

$$E_m = \frac{1}{{\sqrt {2a} }}$$
(8)
Figure 6
figure 6

Dubinin-Radushkevich isotherm to recognize physical or chemical adsorption (a) BPHP (b) TFPHP.

Table 4 Data of Dubinin-Radushkevich adsorption energy isotherm to recognize physical or chemical adsorption.

The extent of Em gives data about the kind of adsorption type to be chemisorption or physisorption: Em values under 8 kJmol-1 demonstrate physical adsorption, while those higher than 8 kJmol−1 recommend chemisorption, so the Em values mean physical adsorption for the two inhibitors54,55,56,57.

Kinetic parameters

The kinetic model was another helpful tool for making sense of the erosion resistance and further explaining the inhibitors' features. The activation energy values Ea were evaluated via the linearized form of the Arrhenius equation with a temperature range of (293–318 K) for CS disintegration in the absence and presence of BPHP and TFPHP as follows:

$$lnI_{Lim} = \, lnA E_a /RT$$
(9)

The linear regression plots between ln ILim versus 1000/T are presented in Fig. 7; the values of Ea (energy of activation) are derived from the slopes = ( − Ea/R) where gas constant R = 8.314 JK−1 mol−1 and A is that the factor of frequency. The calculated data at different inhibitor concentrations were collected in Table 5. The change in the values of the apparent activation energies may be explained by the corrosion process's mechanism alterations in the presence of adsorbed PILs inhibitor molecules.

Figure 7
figure 7

Arrhenius graphs for determination energy of activation from the relation between limiting current and temperature with and without PILs (a) BPHP (b) TFPHP.

Table 5 The activation parameters values Ea, ∆H, ∆S and ∆G with and without PILs of different concentrations in 8 M H3PO4.

It was observed that Ea for the uninhibited solution is lower than that of the inhibited solution, supposing that the dissolution of CS is slow within the existence of PILs inhibitors. The inhibitor is adsorbed on the most active adsorption sites (having the lowest energy), and the corrosion process takes place predominantly on the active sites of higher energy. Inspection of the data shows that Ea values increase in the presence of the BPHP or TFPHP 46, 58, 59, and the values of TFPHP were smaller than BPHP. This indicates that the energy barrier between the reactants and the activated complex depends on the chemical composition of the inhibitor. Because of the expanded energy hindrance for metal dissolving, this information demonstrates how the inhibitors can restrict consumption. The creation of a coating layer covering the surface goes about as an energy, furthermore, mass exchange boundary, raising the activation energy.

The enthalpy ∆H and entropy ∆S of activation were frequently determined by utilizing the substitutional recipe of the Arrhenius equation, change state condition as follows:

$$Ln \, \left( {I_{Lim} /T} \right) \, = \, ln\left( {R/Nh} \right) \, + \, (\Delta S^{\ne} /R) (\Delta H^{\ne} /RT)$$
(10)

where h is Planck’s constant, N is Avogadro’s number, and T is the temperature. From Table 5, the Ea and ∆H values shifted similarly, allowing us to confirm the known thermodynamic response between the Ea and ∆H as Eq. (11), which is equivalent to the average value of RT (2. 53 kJ/mol) at the average temperature (308 K) of the domain investigation.

$$E_a - H^{\ne} = \, RT$$
(11)

∆H positive values show that forming the activated complex is an endothermic process. ∆S values can be determined from the intercepts (equal to ln (R/Nh) + (∆S/R)). The negative ∆S values of the inhibitors indicated that the activated complex within the rate-determining step addresses association rather than dissociation. This means that increasing ordering occurs on going from reactants to activate complex, and this may result from the PILs inhibitor molecules’ adsorption from the acidic solution and may be viewed as a quasi-substitution process between the water molecules at the CS electrode and the PILs substance in the aqueous phase. The change in free energy activation (∆G) was determined from the Arrhenius with the Eq. (12):

$$\Delta G^{\ne} = \, \Delta H^{\ne} - TS^{\ne}$$
(12)

∆G values are positive, increasing in the inhibited case more than in the blank case10, 60, 61.

Atomic absorption spectroscopy measurements (AAS)

AAS is a sensitive, relatively affordable, spectrometric element-selective detector, making it ideal for determining a wide range of elements at trace and ultra-trace levels. Additionally, based on the solubility of the corrosion products, it is a powerful analytical approach used to forecast the corrosion rate in various media, including acidic, basic, and neutral media. Based on the amounts of iron (Fe2+) in the protected and unprotected systems, the absorbance percentage inhibition efficiency (%€AAS) of the PILs on the CS surface in 8M H3PO4 solution was obtained using Eq. (13)61. According to the AAS data in Table 6, solutions with BPHP inhibitor have lower concentrations of (Fe2+) as the temperature drops or the concentration rises than solutions without inhibitor. BPHP inhibitor has lower ions of (Fe2+) because it is more effective at inhibiting corrosion than TFPHP62. Therefore, inhibitors have a strong indication for inhibiting the corrosion of CS.

$$\%\, \EUR AAS = \left( {1 - \frac{{C_{inh} }}{{C_{blank} }}} \right) \times { 1}00$$
(13)

where Cblank and Cinh are (Fe2+) ions concentrations in the absence and presence of the PILs inhibitors.

Table 6 Atomic absorption spectroscopy data shows the effect of PILs with different concentrations and temperatures on iron ions and the absorbance percentage inhibition efficiency (%€AAS).

UV–visible analysis

To demonstrate how a complex form, UV–VIS analysis was used with the metal cations (Fe2+) and PILs under study. Without adding any inhibitor, the CS electrode was subjected to the corrosive 8 M H3PO4 electrolyte at 293 K (Blank). The two PILs were also dissolved at a high molar concentration (37.5 × 10–5 M) in the same corrosive electrolyte used for the blank sample (solution A = PIL + 8 M H3PO4). In addition, a different solution (solution B = PIL + CS + 8 M H3PO4) contained a CS electrode and a predetermined molar concentration of PILs (37.5 × 10–5 M) dissolved and submerged once more in the same corrosive electrolyte (8 M H3PO4) at 293 K. For each PILs inhibitor, the UV was measured for the three different solutions 11, and the absorption wavelengths were noted and demonstrated in Fig. 8. The resulting wavelengths for the blank solution were 225, and 300 nm, which could be attributed to π–π*(C = C) and n–π* (C = O) transition, respectively. While in the case of solution A, the observed absorption values for the C=C bond due to (π–π*) were 235 nm, and the C=O bond due to (n–π*) was 310 nm for TFPHP. For BPHP, recorded high absorbance (hypochromic shift) at 240 and 320 nm is employed for C=C (π–π*) and C=O (n–π*), respectively. Additionally, for solution B, the absorption peak values were changed and shifted to 230 nm for C=C (π–π*), 305 nm for C=O (n–π*) in the case of TFPHP, and for BPHP, the absorption values appeared at 235 nm for C=C (π–π*) and for 310 nm C=O (n–π*) (bathochromic shift)63. Moreover, the results mentioned above reveal an important distinction in the absorption peaks in Fig. 8 between BPHP and TFPHP, suggesting that BPHP is the most effective inhibitor. This spectroscopic method provides proof of the complex formation between PILs inhibitors and metallic electrodes64.

Figure 8
figure 8

Spectra of uv–visible comparison at same concentration 37.5 × 10–5 M and temperature 293 K. (a) TFPHP before and after immersing in CS with blank. (b) BPHP before and after immersing in CS with blank. (c) BPHP and TFPHP after corrosion.

SEM and EDX spectroscopy

To support the results mentioned above, films on CS surfaces were examined using an SEM–EDX study after exposure to aggressive acidic media. The distinct elements present on the CS surface of each film can be identified using the EDX technique, as can the elemental changes that resulted during immersion in 8M H3PO4 solution free of and with PILs under various concentrations and temperatures65, 66. The results of the EDX spectra in Fig. 9 demonstrate that the key elements of the existence of the element on the CS surface are shown by the solution-free inhibitor (blank). It is also observed in Table 7 that the percentage atomic content of O and P remarkably reduced by changing inhibitor and temperature due to CS surface coverage by a homogeneous adsorbed film. Additionally, the surface characterization of CS samples (×5000), where the surface was highly destroyed under inhibitor-free conditions, confirmed the adsorption of PILs. After the adsorption of PILs, By the way, the hetero atoms such as C and O indicate that at the active sites of adsorption, the surface becomes smoother when the percent of Fe and C increase, O and P decrease with increasing inhibition of the corrosion. The inhibition and the surface smoothing, as observed from SEM Fig. 9, are directly probational with increasing the concentration; the least smoothing surface is blank (%Fe = 37.32, %C = 1.21, %O = 54.81 and %P = 15.66) and for 1.25 × 10–5 M (%Fe = 47.29, %C = 3.51, %O = 33.13 and %P = 8.93) is less smooth than 3.75 × 10–4 M (%Fe = 62.66, %C = 3.34, %O = 21.55 and %P = 5.29) at same temperature 293 K for BPHP and the same competition for TFPHP. As the temperature increases at 37.5 × 10–5 M, the inhibition decreases at 318 K (%Fe = 52.28), more than 293 K (%Fe = 62.66) for BPHP.

Figure 9
figure 9

(af) SEM and EDX of CS surface with and without PILs at different temperatures and concentrations. (a) CS without PIls. (b, e) CS with 1.25 × 10–5 M PILs at 293 K (c, f) CS with 37.5 × 10–5 M PILs at 293 K (d) CS with 37.5 × 10–5 M BPHP at 318 K.

Table 7 Percentage of elemental analysis content derived from EDX spectra of PILs.

On the other hand, BPHP has more inhibition than TFPHP at the same concentration and temperature because BPHP forms more surface coating than TFPHP. However, it can be noticed from EDX recorded in the presence of PILs in Fig. 9 the appearance of new peaks related to the N atom, which act as active centers of these inhibitors for adsorption and forming a protected film on the CS surface. On the other hand, Br appeared on the EDX diagram for BPHP due to the difference between two structures: the terminal group, Br, for BPHP and CF3 group for TFPHP and the group BF4- the negative ion for both inhibitors where F appeared in the EDX.

Atomic force microscopy (AFM)

Presently, several imaging techniques are now available that can provide accurate three-dimensional topographies and information about the irregularities on the sample surface. One uses an AFM to provide quantitative analysis rather than SEM micrographs' qualitative analysis67. Figure 10a–f illustrates the 2D and 3D morphological characteristics of CS surfaces immersed in 8 M H3PO4 at various temperatures and concentrations with and without PILs inhibitor BPHP or TFPHP. Table 8 lists the values for the average surface roughness (Ra), which reflects the deviation in height, the root means square roughness (Rq), which represents the deviation in surface heights, and the maximum peak to valley depth (Rp-v).

Figure 10
figure 10

(af) AFM graphs of blank and PILs with different concentrations and temperatures. (a) CS without PIls. (b, e) CS with 1.25 × 10–5 M PILs at 293 K. (c, f) CS with 37.5 × 10–5 M PILs at 293 K (d) CS with 37.5 × 10–5 M BPHP at 318 K.

Table 8 Atomic force microscopic parameters for CS in 8 M H3PO4 with and without PILs at different concentrations and temperatures.

The PILs layer on the CS surface in solution-free inhibitors is shown in Fig. 10. Direct contact with 8M H3PO4 media totally damages the corroded CS surface with an average roughness (Ra) of 0.62 μm, Rq of 0.79 μm, and Rp-v of 5.00 μm. On the other hand, as the inhibition increased, the parameters roughness decreased68, resulting in an improvement of the surface quality film and the formation of a more uniform film that was observed by adding the optimum concentration of TFPHP (37.5 × 10–5 M) at 293 K. These parameters roughness magnitude decreased to Ra of 0.18 μm, Rq of 0.25 μm, and Rp-v of 2.31 μm. This coating is a barrier between the metal and the corrosive medium and considerably prevents CS deterioration. However, the surface roughness parameters decreased in the presence of BPHP Fig. 11, owing to the more protective activity of adsorbed inhibitor molecules on the CS surface rather than TFPHP, as evidenced by a decrease in average surface roughness values. Table 8 shows the percent inhibition (%IEff) increased with increasing the concentration and decreasing the temperature for BPHP. By comparing the parameters, the values of BPHP were less than TFPHP values, which proved that BPHP has higher inhibition efficiency and is more adsorbed than TFPHP.

Figure 11
figure 11

Relation between average roughness (Ra) and inhibition efficiency (%\({I}_{Eff}\)) at different concentrations and temperatures for BPHP and blank.

UV spectral reflectance studies (Gloss value)

UV–visible diffuse reflectance spectroscopy of the CS surface was analyzed before and after immersion in 8M H3PO4 in the 200–700 nm range. The reflectance curves examined the function spectra of the coated film on the CS surface with different PILs inhibitor concentrations at different temperatures to identify iron phosphate. The blank sample (before corrosion) showed a low gloss value (G = 18.2, dull), as shown in Fig. 12. Conversely, all samples coated with PILs in different conditions were electrolytically corroded, where they showed higher gloss values 69. In the case of the lower concentrations, the gloss value will be G = 21.7 (BPHP) and G = 19.2 (TFPHP), and optimum concentration G = 38.1 (BPHP) and G = 26 (TFPHP). Under different temperatures for BPHP, surface brightness was observed to increase by decreasing temperature to G = 38.1 at 293 K and G = 24.7 at 318 K. This indicates the reduction of the surface roughness and increasing the reflectance value as BPHP has more efficiency in inhibition rather than TFPHP due to forming a protective film on the metal surface.

Figure 12
figure 12

The gloss reflectance of PILs. (a) comparison between blank and PILs with 37.5 × 10–5 M PILs at 293 K. (b) comparison between blank and PILs at with 1.25 × 10–5 M PILs at 293 K. (c) comparison for BPHP with 37.5 × 10–5 M at different temperatures 293 and 318 K.

XPS analysis

X-ray photoelectron spectroscopy (XPS) was utilized to analyze the elemental composition and chemical bonds which formed on the CS surface before and after the adsorption of PILs. This analytical technique played a crucial role in enhancing our comprehension of the underlying mechanism of adsorption.

XPS of iron, Fig. 13, showed two main peaks corresponding to 2p3/2 appeared at 711.48 (711.00) and 2p1/2 at 724.48(724.48) eV with a difference of 13 (13.48) eV, before and (after)adsorption indicating the presence of iron as various iron substrate Fe3O4 or FeO (Fe2+) and Fe2O3 (Fe3+)70, 71. However, The binding energy values in the 709–714 eV range confirm the presence of Fe (III) and/or Fe (II) and/or the formation of Fe–O–C bond72. Table 9 summarizes all peaks corresponding to Fe-binding energies before and after adsorption, showing that Different environments surround Fe-ions. The peaks at 712.59 and 727.43 eV with ΔE = 14.84 eV may be attributed to the presence of Fe3O4. The appearance of a satellite of 719.32 eV and 715.89 eV (ΔE = 3.43 eV) may correspond to bonding with fluoride ion73.

Figure 13
figure 13

XPS scan of Iron (A) and after (B) adsorption.

Table 9 XPS binding energies and separation (ΔE) for iron before and after adsorption.

Figure 14 shows the XPS spectra for C1s, O1s, P2p, and N1s, before and after adsorption. Three peaks of C1s at 284.99, 286.64, and 288.81 eV in the blank sample showed a slight shift in the B.E. values to 284.78, 286.53, and 288.38eV after treatment by inhibitor (Fig. 141-A, B). These peaks correspond to aromatic C, CN, and CO72, 74. A very large decrease in the peak area of peaks corresponding to CN or CO indicates the change in their media. For O1s spectrum was deconvoluted into two peaks at 531.64 and 533.18 eV corresponding to the Fe–O and O-C bonds, respectively, whereas the peaks were shifted to lower binding energies after adsorption at 531.58 and 529.97 eV, which could be attributed to its bonding to O-C, O-Fe(II)and/or Fe(III) ions (Fig. 142-A, B)72. P2p spectrum showed two deconvoluted peaks at 133.69 and 134.66 eV, which may attributed to PO3 P and PO4P, respectively, showing a small shift after adsorption to 133.25 and 134.16, with a notable change in the peak area, Fig. 14(3-A, B)75. On the other hand, N1s showed a relative decrease in the peak intensity and peak areas that appeared at (400.15, 401.96) eV before adsorption and (399.08, 400.65) eV after adsorption. The binding energies could be attributed to N = C/N+–C and N–H before that could have disappeared after adsorption (Fig. 14(4-A, B)76.

Figure 14
figure 14figure 14

XPS scan of (1) C1s, (2) O1s, (3) P2p, and (4) N1s, before (A) and after (B) adsorption of BPHP and (5) B1s, (6) F1s, and (7) Br 3d after adsorption process.

The XPS scan after adsorption showed the presence of Boron (B), Fluorine (F), and Bromine (Br), which are shown in detail in Fig. 14(5–7). B1s displayed a characteristic boride peak at 189.1 eV, which is a smaller value than that of B-B that could be attributed to metal or carbon center attachment77, 78. This is also can be evidenced by the difference in the N1s and C1s scans before and after adsorption. Fluorine showed F1s peak at 689.2 eV, which may be attributed to F–C bonding confirming its existence79. Bromine displayed two peaks corresponding to Br 3d with binding energies (B.E.) of 72.77 and 70.20 eV (ΔE = 2.57), which may be attributed to Br–C and/ charge transfer from Br to iron in either oxidation state II and/or III. The presence of B, F and Be elements confirms the adsorption of BPHP as a protective inhibitor on the CS surface80.

Computational investigation study

Quantum chemical descriptors, including EHOMO, ELUMO, Energy gap (∆E = ELUMO—EHOMO), chemical hardness, chemical softness, electronegativity, chemical potential, proton affinity, electrophilicity, and nucleophilicity, are well-known for being beneficial and efficient tools in investigations of metal corrosion. Sup.Tables (1–4) provide an overview of the selected PILs atoms of global molecular properties in the gas phase and aqueous solution81, 82. The following will cover the relationships between descriptors and the order of corrosion inhibition efficiencies.

The Figured quantum compound properties for BPHP & TFPHP in the gas and fluid phases are given in Table 10. The geometry optimization is displayed in Fig. 15. The capacity of a particle to adsorb onto the metal surface is related to the hypothesis of frontier molecular orbital (FMO). EHOMO alludes to the capacity of atoms to give electrons to the iron surface with empty "d" orbitals. The higher the energy level of the HOMO (EHOMO), the more susceptible the ligand is to donate the electrons to the iron atoms to form a stronger bond. This could illustrate the compound's effectiveness in inhibiting the atoms' capacity to give electrons.

Table 10 Data of calculated quantum parameters for PILs in gas and aqueous phase.
Figure 15
figure 15

Optimized structures configuration geometry of PILs.

For this reason, BPHP is more effective than TFPHP in electron donation in the two phases. In concurrence with the calculation’s outcomes, the EHOMO of BPHP is the biggest. Subsequently, this compound is viewed as more reasonable for adsorption on the metallic surface through the pyridine ring, which is a rich source of electrons. In contrast, ELUMO demonstrates the acceptance of electrons by the atoms where the lower value of ELUMO, the more prominent the inhibitor effectiveness. The energy gap (∆Egap) plays a vital role in the reactivity of particles toward the metal surface. The lower value of ∆Egap is the more tendency of atoms to adsorb on the metal surface. Table 10 shows that ∆Egap for TFPHP in the gas phase is lower than in water. On the other hand, ∆Egap values for BPHP are lower than those for TFPHP, showing that BPHP has a high reactivity in both phases. The calculations of (FMOs) of (BPHP & TFPHP) were performed by B3LYP/6-311g (d,p) Gaussian-09 program using density functional theory (DFT)83, 84, and the Gaussian View 5.0 was used to show the structural forms in Fig. 16.

Figure 16
figure 16

Frontier molecular orbital for HOMO–LUMO distribution energy and molecular electrostatic potential of PILs.

The other parameters like hardness (\(\eta\)), softness (\(\sigma\)), electron back donation (\({\Delta E}_{b.d}\)), work function (\(\Delta N\)) and electronegativity (\(X\)) are calculated from the relations:

$$I \, = E_{HOMO} \quad A \, = E_{LUMO} \quad P_i = X$$
(14)
$$X = \frac{{\left( {I + A} \right) }}{2}\quad \eta \, = \frac{{\left( {I - A} \right) }}{2}\quad \sigma \, = \frac{1}{\eta }\quad \Delta E_{b.d} = \frac{ - \eta }{4}$$
(15)
$$\omega \, = \frac{P_i^2 }{{2\eta }}\quad \omega^- = \frac{{\left( {3I + A} \right)^2 }}{{16\left( {I - A} \right)}}\quad \omega^+ = \frac{{\left( {I + 3A} \right)^2 }}{{16\left( {I - A} \right)}} \quad \Delta \omega^\pm = \, \left( {\omega^+ - \frac{1}{\omega^- }} \right)$$
(16)
$$\Delta N \, = \frac{{\left( {X_{Fe} -- X} \right)}}{{2\left( {\eta_{Fe} + \eta } \right)}}\quad \Delta E_{steel/P_{ILs} } = \frac{{\left( {X_{Fe} -- X_{inh} } \right)^2 }}{{4\left( {\eta_{Fe} + \eta_{inh} } \right)}}$$
(17)

where (I) ionization potential, (Pi) chemical potential, (A) electron affinity, (XFe) electronegativity of Fe = 7 eV, \({\eta}_{Fe}\) The hardness of Fe = 085, \(\Delta N\) is positive, meaning electrons transfer to the Fe surface from the inhibitors, and ∆Esteel/inh shows the interaction between BPHP or TFPHP and metal surface. The inhibitor BPHP has high work function, high softness, a less negative value of the back donation, high negative total energy (T.E), low hardness, high ∆Esteel/PILs and low electronegativity BPHP is more inhibition efficiency than TFPHP in the two phases.

The descriptors ω+, ω-, and ∆ω± mean electron accepting, electron-donating and net electrophilicity, respectively, where they increased as inhibition efficiency increased with decreasing energy gap86. On the other hand, dipole moment (µd) measures the polarity of the chemical bond in the molecules. In the aqueous phase, µd has a larger value for BPHP than TFPHP, so BPHP is more anticorrosive, which matches experimental data. It is not a condition that all parameters agree with the practical information, but the majority agree with these results.

Molecular electrostatic potential

The inhibitors' absorption on the metal surface is shown by the molecular electrostatic potential (MEP). In Fig. 16, the atoms of O, N and some of the C atoms for BPHP & TFPHP matrices carry negative charges. The highly negatively charged atoms can exchange electrons with the positive sites on the surface of the metal87, Supplementary Tables 14 shows the distribution of the atomic charges of Mulliken on the atoms of BPHP & TFPHP. The best atoms in gas and aqueous phases are (C5, O13, N25, O33, N34, C38, N48, O58) for BPHP and (C5, O12, N24, O32, N33, C37, N47, O57) for TFPHP. So that atoms are responsible for a nucleophilic attack on the surface of the CS. Figure 16 shows the molecular electrostatic potential and electron density (ED) regions. The high ED is shown in red color, and the low ED is a blue color. ED decreases in the following order: red > orange > yellow > green > blue 84. The high ED (yellow to red color) is localized on O and N atoms for BPHP & TFPHP. The low ED (green to blue color), on the other hand, is located on a few carbon atoms.

Fukui indices and local dual descriptors

Fukui indices and Local Dual Descriptors describe the electrophilic and nucleophilic attack in the gas phase. The calculated condensed Fukui functions using Mulliken charges (fk+, fk), local electrophilicity (ωk+, ωk) and local softness (σk+, σk) are reported in Sup.Tables (1,2). To facilitate the comparison between the possible sites for nucleophilic and electrophilic attacks on any atom k, we have calculated (Δfk, ∆σ and ∆ω), which corresponds to the difference between (fk+, fk), (σk+, σk) and (ωk+, ωk), respectively 10, 88. When comparing the atoms to determine the most reactive site consequently, the positive values of ∆f, ∆σ, ∆ω, i.e., > 0, would be most favorable for a nucleophilic attack like (N25, O33, N34, C38, C39, C45, N48) atoms for BPHP & (N24, O32, C37, C38, C44, N47) atoms for TFPHP, on the other hand, if ∆f, ∆σ, ∆ω > 0, it would be favoured for an electrophilic attack like (C5, O13, O58) atoms for BPHP & (O12 and O57) atoms for TFPHP and all are illustrated and described in the following equations and Fig. 17.

$$\begin{aligned} f_k^+ & = \, \rho_k \left( {N + 1} \right) \rho_k \left( N \right) \;\left( {{\text{nucleophilic}}\;{\text{attack}}} \right) \\ f_k^- & = \, \rho_k \left( N \right) \rho_k \left( {N - 1} \right) \; \left( {{\text{electrophilic}}\;{\text{attack}}} \right) \\ \end{aligned}$$
(18)
$$\begin{aligned} \Delta f \, & = \, \left( {f_k^+ } \right)-- (f_k^- ) \\ \Delta \sigma \, & = \, \left( {\sigma_k^+ } \right)-- \left( {\sigma_k^- } \right) \\ \Delta \omega & \, = \, (\omega_{\text{k}}^+ )-- \left( {\omega_k^- } \right) \\ \end{aligned}$$
(19)

where the electronic density site ρ with the number of electrons (N) at site k in a molecule.

Figure 17
figure 17

Fukui indices (a, b) and local dual descriptors (c, d) of different atoms with respect to Mulliken charges of PILs.

Inhibition mechanism

According to the previous discussion, BPHP and TFPHP operate physically, chemically, or through both (physicochemical) adsorption to reduce the effectiveness of the employed solution (8 M H3PO4) on the CS surface. On the CS surface or due to the protonation of the inhibitor's heteroatoms in the bulk solution, charged species are present in the physical model. On the other hand, the chemisorption could be increased by transferring charge from the electron-rich centers (the lone pair of the heteroatom or the π-electrons of the unsaturated centers) of the inhibitor to the CS vacant d-orbitals (Fe2+)89, which reduces surface erosion as shown in Fig. 18. By comparing the N (−0.3014) and O (−0.2952) of TFPHP, the calculated Milliken atomic charges of N (−0.3020) and O (−0.2968) of BPHP are more negative. Because the CF3 polar group is more electron withdrawing than Br, the presence of the CF3 may reduce the amount of charge transfer from the inhibitors to the CS surface. These findings might demonstrate how BPHP inhibits more effectively than TFPHP.

Figure 18
figure 18

Schematic mechanism diagram of adsorption PILs on CS surface in 8M H3PO4.

Conclusion

Finally, we found two new synthetic PILs with high efficiency of inhibition for C-steel surface and nontoxic where at different temperatures and concentrations, especially at 37.5 × 10–5 M with 293 K; BPHP and TFPHP were good inhibitors with inhibition percent 76.19% and 71.43% respectively. The electrochemical study of corrosion used to particular the anticorrosive new compounds where the best model of adsorption isotherm for them is the El-Awady model was applied. Temperature increase leads to decreased inhibition efficiency, resulting in the effective activation energy value variation. Furthermore, surface studies like scanning electron microscopy-energy dispersive spectroscopy (SEM–EDS) revealed the protecting capability of the investigated inhibitors. An ultra-violet visible (UV–vis.) spectroscopy study confirms the formation of the Fe2+–PILs complex. X-ray Photoelectron Spectroscopy (XPS) was conducted to study the formation of corrosion products and protective film over the mild steel surface. The theoretical study of DFT confirmed the experimental data and the mechanism, which showed the adsorption as physicochemical. The different characterizations showed that BPHP is better than TFPHP inhibitor due to the terminal group of BPHP being Br and CF3 for TFPHP, where Br is more electron rich, softer, with positive Fukui parameters than CF3. We hope to use the new PILs in another process, like Electroplating, to transfer layers of different metals to another metal surface.