Evaluating the Corrosion Inhibition Efﬁciency of Pyridinium-Based Cationic Surfactants for EN3B Mild Steel in Acidic-Chloride Media

: Two new effective corrosion inhibitors, namely N-(n-octyl)-3-methylpyridinium bromide (Py8) and N-(n-dodecyl)-3-methylpyridinium bromide (Py12), have been presented. The cationic pyridinium-based surfactants were analyzed for the corrosion protection of general purpose steel (EN3B) against a strong corrosive media (3.5% NaCl, pH 1.5). The results of the electrochemical measurements, i.e., Tafel polarization, linear polarization resistance (LPR) and electrochemical impedance spectroscopy (EIS) revealed a mixed-type behavior of both inhibitors, and the maximum inhibition efﬁciency (IE) achieved with Py8 and Py12 was 85% and 82%, respectively. The process of adsorption of synthesized inhibitors followed the Langmuir adsorption isotherm, and a higher value of K ads highlighted the existence of strong interaction between inhibitors and the EN3B mild steel surface. Furthermore, the values of ∆ G ◦ ads were calculated to be − 32 kJ mol − 1 for Py8 and − 33 kJ mol − 1 for Py12, indicating the coexistence of both physisorbed and chemisorbed molecules. The surface morphology of EN3B mild steel samples was observed by scanning electron microscopy (SEM) and atomic force microscopy (AFM), where the reduced surface roughness in the presence of Py8 and Py12 in chloride media further supported the evidence of an efﬁcient inhibition process. Density functional theory (DFT) calculations reveal excellent correlation with the experimental results, with Py8 showing superior corrosion inhibition potential, signifying that the alkyl chain length and intramolecular charge transfer are crucial factors in deciding the inhibition performance of the synthesized cationic surfactants. Furthermore, this study proposes the mechanism for the adsorption of the surfactant-based inhibitors over the EN3B mild steel surface, which leads to the formation of an effective and protective anticorrosive ﬁlm.


Introduction
The corrosion process is a gradual destruction of metal surfaces owing to attack by chemical or electrochemical environments. It is the oxidative degradation of metals in the presence of oxidants such as oxygen or sulphur, dissolution of metals, or oftentimes, the reprecipitation of corrosive products to the surface [1,2]. Corrosion badly affects the characteristic properties of metals, and the economic effects are also well reported. About 3%-4% of the GDP of industrialized countries is spent dealing with the damages and losses of corrosion in industrial, infrastructure and household sectors [3].
Mild steel can be regarded as the most widely used engineering material, having major industrial importance, with particular applications in the fields of construction, petroleum (production and refining), metal-processing equipment, chemical processing, and the marine industry [4]. Mild steel gets badly corroded under the effect of aggressive water, followed by ethanol, in order to remove the organic impurities; and finally. dried in a desiccator under vacuum [12,29].
A solution of 3.5% aqueous NaCl was prepared as corrosive media ('Blank' solution), and the pH was adjusted to 1.5 using 0.5 M HCl. Both inhibitors were soluble in the prepared corrosive media.

Electrochemical Measurements
The electrochemical testing was performed in accordance with the ASTM G3-89 and G5-94 standards [12,14]. A Gamry Interface 1010e potentiostat/galvanostat (Warminster, PA, USA) was used to conduct these experiments. In a three electrodes assembly, cylindrical EN3B mild steel was used as working electrode, while Pt and Ag/AgCl were used as counter and reference electrodes, respectively. All the measurements were recorded at room temperature keeping the pH at 1.5.
The Open Circuit Potential (OCP) was measured for a period of about 2500 s until a steady-state condition was established, prior to each measurement. The potentiodynamic polarization measurements involved the polarization of EN3B steel (working electrode) within a potential range of ±250 mV (versus OCP) in case of Tafel polarization, and ± 15 mV (versus OCP) for the determination of the linear polarization resistance (LPR) over a scan rate of 0.2 mVs −1 . The electrochemical impedance spectroscopy (EIS) was performed at an AC excitation voltage of ± 5 mV relative to OCP, and the frequency was swept over a range of 100 mHz to 100 kHz with ten points per decade. All the measurements were repeated in triplicate to ensure the reproducibility of results. The working electrode used in the electrochemical testing consisted of a cylindrical EN3B mild steel rod mounted with an epoxy coating, leaving a working area of 0.07 cm 2 . The elemental composition of EN3B mild steel is given in Table 1. The electrode surface was polished by using SiC papers of different grits (600 to 1200); washed with ultrapure water, followed by ethanol, in order to remove the organic impurities; and finally. dried in a desiccator under vacuum [12,29]. A solution of 3.5% aqueous NaCl was prepared as corrosive media ('Blank' solution), and the pH was adjusted to 1.5 using 0.5 M HCl. Both inhibitors were soluble in the prepared corrosive media.

Electrochemical Measurements
The electrochemical testing was performed in accordance with the ASTM G3-89 and G5-94 standards [12,14]. A Gamry Interface 1010e potentiostat/galvanostat (Warminster, PA, USA) was used to conduct these experiments. In a three electrodes assembly, cylindrical EN3B mild steel was used as working electrode, while Pt and Ag/AgCl were used as counter and reference electrodes, respectively. All the measurements were recorded at room temperature keeping the pH at 1.5.
The Open Circuit Potential (OCP) was measured for a period of about 2500 s until a steady-state condition was established, prior to each measurement. The potentiodynamic polarization measurements involved the polarization of EN3B steel (working electrode) within a potential range of ±250 mV (versus OCP) in case of Tafel polarization, and ± 15 mV (versus OCP) for the determination of the linear polarization resistance (LPR) over a scan rate of 0.2 mVs −1 . The electrochemical impedance spectroscopy (EIS) was performed at an AC excitation voltage of ± 5 mV relative to OCP, and the frequency was swept over a range of 100 mHz to 100 kHz with ten points per decade. All the measurements were repeated in triplicate to ensure the reproducibility of results.

Surface Monitoring
The effect of acidic/chloride media on the surface morphology of EN3B mild steel samples was visualized by scanning electron microscopy (SEM) (JEOL Model JSM 6360LV, Peabody, MA, USA) and atomic force microscopy-based infrared spectroscopy (AFM-IR) Coatings 2022, 12, 1701 4 of 25 using the Anasys NanoIR2 instrument (Cambridge, UK). For AFM analysis, an additional diamond polishing was undertaken to achieve an ultra-fine surface finish. After cleaning with distilled (ultrapure) water and ethanol, all the steel specimens were placed in a desiccator under vacuum for drying and then submerged in the corrosive media with and without synthesized inhibitors for 6 h at standard temperature and pressure (STP). Afterwards, the steel samples were removed from the solutions, rinsed with ultrapure water, dried and analyzed. The acceleration voltage for SEM analysis was 20 kV, and the images were recorded at 500× magnification. During AFM measurements, the instrument was operated in the tapping mode at a low voltage to avoid any damage to the surface of the sample. The lateral resolution during AFM scanning was 5 µm, recorded at a 0.5 Hz scan rate.

Computational Details
DFT calculations were carried out on Py8 and Py12 to correlate their geometry with corrosion inhibition behavior and to understand the mechanism of inhibition. The DFT analysis was carried out in the gas phase in the TURBOMOLE software package (TUR-BOMOLE version 7.5, COSMOlogic, Leverkusen, Germany) [37]. Geometry optimization was followed by single point energy calculations using the exchange correlation density Perdew-Burke-Ernzerhof (PBE) functional [38]. A highly effective basis set of def2-TZVPP was used in all calculations. In frequency calculations, no imaginary or negative frequency is observed, hence the stationary points are confirmed. The electronic distribution of the frontier molecular orbitals (FMOs) of Py8 and Py12, and the associated global reactivity parameters, were computed at the same level of theory. The Mulliken atomic charge analysis was carried out to understand charge distribution in Py8 and Py12 and to find the mechanism of corrosion inhibition. Binding energy calculations were performed to study interaction of the synthesized inhibitors with mild steel using Hyperchem 5.0 software.

Open Circuit Potential (OCP)
The variations in the OCP for the system containing EN3B mild steel and Ag/AgCl electrodes immersed in blank solution (with different amounts of Py8 and Py12, in comparison with the blank corrosive media without inhibitors) are represented in Figure 2. The property of self-organization of surfactant monomers with the increase in concentration can affect the structure (and hence the stability) of any adsorbed film. Hence, the concentration of both surfactants was varied from 0.5 to 15 mM to observe the changes in OCP as a function of concentration. In most cases, a time period of 2500 s was reasonably sufficient for the stabilization of OCP, as can be seen in Figure 2. The OCP of the blank solution was stabilized near −0.52 V vs. Ag/AgCl. On addition of Py8 and Py12, the potential was shifted towards anodic direction (less negative) relative to the blank, indicating an inhibitory effect [39].
For any corrosion inhibitor to be precisely categorized as cathodic or anodic type, a typical overpotential of ±85 mV is usually required. For OCP displacements smaller than ±85 mV (as compared to the OCP of blank solution), the inhibitors cannot be specified as anodic or cathodic and a mixed type of behavior of inhibitors can be predicted [40][41][42]. In the case of Py8 and Py12, when added to the blank solution the OCP is shifted towards the positive potential for all concentrations, and nobler values are obtained as compared to the blank solution. Interestingly, the OCP displacement at 15 mM concentration is minimum for Py8 and maximum for Py12. All these shifts and variations in the OCP may arise due to the changes on and near the surface of the EN3B mild steel electrode, including the electrochemical reactions taking place in the corrosive media, and the variation of the structure of adsorbed film by self-assembling of surfactants as a function of concentration [43]. arise due to the changes on and near the surface of the EN3B mild steel electrode, including the electrochemical reactions taking place in the corrosive media, and the variation of the structure of adsorbed film by self-assembling of surfactants as a function of concentration [43].

Potentiodynamic Polarization
The potentiodynamic polarization technique was employed in two ways (i.e., the Tafel polarization method and LPR method) to evaluate the corrosion protection potential of Py8 and Py12, as a function of concentration of the inhibitors and the immersion time in corrosive solution. The results are discussed in detail below.

Tafel Polarization
The Tafel polarization behavior of the EN3B mild steel electrode dipped in 3.5% NaCl solution (pH = 1.5), blank (devoid of inhibitors), and in the presence of various concentrations of Py8 and Py12, is depicted in Figure 3. The shape of the anodic and cathodic Tafel slopes gives information about the process (reactions) taking place at the surface of the EN3B mild steel electrode. The anodic currents primarily arise due to the dissolution of Fe atoms to produce Fe 2+ ions, and the electrons produced in this process reduce the H + ions to H2 gas at the cathodic site, thereby producing cathodic currents. After about 160 mV overpotential at the anodic site, the slope of the anodic branch decreases as the current response becomes relatively stable, pointing towards the formation of stable corrosive products (that is, FeCl2, etc.), as shown in Figure 3a.
The inhibiting efficiency (IE) of Py8 and Py12 at each concentration was calculated from the Tafel polarization data, and the results are summarized in Table 2. According to Figure 3b, as the concentration of Py8 increases from 0.5 to 15 mM the cathodic and anodic current densities are reduced accordingly. However, this trend is more pronounced in the cathodic region as compared with the anodic region, where all the concentrations of Py8, except 0.5 mM, have reduced the anodic current by almost the same amount. The presence of 0.5 mM Py8 in the corrosive media does not alter the cathodic corrosion current density, but it significantly slows down the anodic reactions. The highest IE (84.74%) is observed at an optimum concentration of 10 mM Py8, where icorr is reduced to 9.92 µ A/cm 2 . IE is calculated according to the following equation: In Equation (1), represents the corrosion current density obtained in the blank solution devoid of Py8 and Py12, and is the corrosion current density in the presence of inhibitors.

Potentiodynamic Polarization
The potentiodynamic polarization technique was employed in two ways (i.e., the Tafel polarization method and LPR method) to evaluate the corrosion protection potential of Py8 and Py12, as a function of concentration of the inhibitors and the immersion time in corrosive solution. The results are discussed in detail below.

Tafel Polarization
The Tafel polarization behavior of the EN3B mild steel electrode dipped in 3.5% NaCl solution (pH = 1.5), blank (devoid of inhibitors), and in the presence of various concentrations of Py8 and Py12, is depicted in Figure 3. The shape of the anodic and cathodic Tafel slopes gives information about the process (reactions) taking place at the surface of the EN3B mild steel electrode. The anodic currents primarily arise due to the dissolution of Fe atoms to produce Fe 2+ ions, and the electrons produced in this process reduce the H + ions to H 2 gas at the cathodic site, thereby producing cathodic currents. After about 160 mV overpotential at the anodic site, the slope of the anodic branch decreases as the current response becomes relatively stable, pointing towards the formation of stable corrosive products (that is, FeCl 2 , etc.), as shown in Figure 3a.
The inhibiting efficiency (IE) of Py8 and Py12 at each concentration was calculated from the Tafel polarization data, and the results are summarized in Table 2. According to Figure 3b, as the concentration of Py8 increases from 0.5 to 15 mM the cathodic and anodic current densities are reduced accordingly. However, this trend is more pronounced in the cathodic region as compared with the anodic region, where all the concentrations of Py8, except 0.5 mM, have reduced the anodic current by almost the same amount. The presence of 0.5 mM Py8 in the corrosive media does not alter the cathodic corrosion current density, but it significantly slows down the anodic reactions. The highest IE (84.74%) is observed at an optimum concentration of 10 mM Py8, where i corr is reduced to 9.92 µA/cm 2 . IE is calculated according to the following equation: In Equation (1), i b corr represents the corrosion current density obtained in the blank solution devoid of Py8 and Py12, and i i corr is the corrosion current density in the presence of inhibitors.
On the other hand, no regular trend in the current densities (anodic and cathodic) is observed with the variation in the concentration of Py12. The maximum decrease in anodic current and minimum decrease in cathodic current are observed with 15 mM concentration of Py12. All other concentrations have almost the same effect on anodic sites, which suggests that the mechanism of anodic inhibition of Py12 is independent of concentration changes [12]. It can be hypothesized that Br − ions are preferentially adsorbed at anodic sites due to the electrostatic interaction and are sufficient to cover the reactive (anodic) sites even at 0.1 and 0.5 mM concentrations of Py8 and Py12, respectively. This explains why a further increase in concentration did not affect anodic current density appreciably in the presence of both inhibitors. Furthermore, the smaller values of β a (Table 2) indicate that the rate of increase in anodic current density is much lower in the presence of both inhibitors as compared to the blank solution, owing to the slow rate of Fe dissolution.
At the cathodic site, current responses show some irregularities with the increase in concentration as the Py8 and Py12 molecules tend to stabilize themselves in specific geometrical aggregates in the adsorbed layer. Lower concentrations of Py12 (i.e., 0.5 and 1 mM) appear to be more efficient as compared with higher concentrations, giving the maximum IE value of 76.92% at 1 mmol dm −3 . Higher IE values are obtained with Py8 compared to Py12 under similar conditions, which can be ascribed to the structure and stability of the adsorbed layer of surfactants, formed at an optimum concentration over the surface of EN3B mild steel [44]. The value of E corr is shifted towards nobler values in all cases except for with the 15 mM Py8 solution. As all the shifts are smaller than 85 mV, and the values of both Tafel constants β a and β c (given in Table 2) have been changed under the influence of Py8 and Py12, hence the surfactants can be characterized as mixed-type inhibitors [45].  On the other hand, no regular trend in the current densities (anodic and cathodic) is observed with the variation in the concentration of Py12. The maximum decrease in anodic current and minimum decrease in cathodic current are observed with 15 mM concentration of Py12. All other concentrations have almost the same effect on anodic sites, which suggests that the mechanism of anodic inhibition of Py12 is independent of concentration changes [12]. It can be hypothesized that Br − ions are preferentially adsorbed at anodic sites due to the electrostatic interaction and are sufficient to cover the reactive

Linear Polarization
The impact of prolonged exposure of EN3B mild steel to corrosive media, 3.5% NaCl (pH 1.5), was investigated through the LPR method for up to 24 h. The activity of Py8 and Py12 was examined at a fixed concentration (5 mM) as a function of immersion time [46]. The results are graphically demonstrated in Figure 4, and the values of IE, polarization resistance R P and corrosion rate (C R ) are tabulated below ( Table 3).
The presence of Py8 and Py12 considerably decreases the C R over time, compared with the blank solution. The polarization resistance is very small in the absence of inhibitors and further decreases as time progresses, resulting in a high C R . Py8 and Py12 offer high polarization resistance against corroding species like Cl − ions, and hence less deterioration of EN3B mild steel is observed. The IE and C R from the LPR data are calculated according to the following equations: where R i P and R b P symbolize the polarization resistance of the inhibited and blank solution, respectively, in Equation (2). In Equation (3), E.W. and d represent the equivalent weight (27.9225 g/mol) and density (8.08 g/cm 3 ) of EN3B mild steel, respectively. The maximum IE values recorded after 24 h for Py8 and Py12 are 85.10% and 82.60%, respectively. Initially, both surfactants have comparable inhibition efficiency with respect to time; however, Py8 became slightly more efficient in the period of 15 to 24 h, as can be seen in Table 3. These results are in agreement with the data obtained via the Tafel polarization method.

Linear Polarization
The impact of prolonged exposure of EN3B mild steel to corrosive media, 3.5% NaCl (pH 1.5), was investigated through the LPR method for up to 24 h. The activity of Py8 and Py12 was examined at a fixed concentration (5 mM) as a function of immersion time [46]. The results are graphically demonstrated in Figure 4, and the values of IE, polarization resistance RP and corrosion rate (CR) are tabulated below (Table 3). The presence of Py8 and Py12 considerably decreases the CR over time, compared with the blank solution. The polarization resistance is very small in the absence of inhibitors and further decreases as time progresses, resulting in a high CR. Py8 and Py12 offer high polarization resistance against corroding species like Cl ‾ ions, and hence less dete-

Electrochemical Impedance Spectroscopy (EIS)
The EIS, a powerful technique to probe the charge transfer mechanism, was employed to further evaluate the corrosion inhibition potential of Py8 and Py12 for EN3B mild steel in 3.5% NaCl solution (pH = 1.5). The Nyquist plots obtained against various concentrations of Py8 and Py12 are represented in Figure 5. The impedance plots show a capacitive loop for the blank solution (devoid of inhibitors), which can be associated with transport of charge during the corrosion phenomenon [47]. The diameter and shape of the semicircular curve (capacitive loop) is changed upon the introduction of inhibitors, indicating a change in the charge transfer mechanism responsible for corrosion of the steel electrode [48][49][50]. The value of impedance is much higher in the presence of inhibitors as compared to that of blank solution. The higher impedance of the solution is an indication of the reduced C R and higher IE in the presence of Py8 and Py12. The effect of change in concentration is the opposite for Py8 and Py12 in terms of inhibition efficiency. When the concentration of Py8 is increased from 0.5 mM to 15 mM, the IE value and size of the capacitive loop increased correspondingly, except for the 5 mM solution, which showed a little deviation from the Coatings 2022, 12, 1701 9 of 25 observed trend. However, the case is reversed for the Py12, as the maximum IE values are achieved with the lower concentrations, i.e., 0.5 mM and 1 mM (Table 4). Although the OCP is more anodic for higher concentrations of Py12 (Figure 2), due to a greater number of adsorbed molecules, the increase in concentration of Py12 is accompanied by decreases in charge transfer resistance (R ct ) and pore resistance (R p ), indicating higher corrosion currents. This suggests that the system behaves as a porous electrode and that the porosity of the adsorbed layer of Py12 molecules on the surface of EN3B mild steel increases with the increase in corrosion currents at higher concentrations. Consequently, the higher corrosion current increases the pore diameter and also alters the thickness of the adsorbed layer at the surface of the substrate. On the other hand, Py8 molecules tend to organize into more ordered molecular assemblies at higher concentrations and offer higher resistance (R ct and R p ) to the flow of corrosion current. chain being hydrophobic in nature facilitates the self-assembly of amphiphilic molecules, even at lower concentrations [51]. This ease in self-aggregation provides a better surface coverage and improved surface adsorption. As the concentration of surfactants increases, more and more monomers are added to the aggregates, and bigger size micelles are formed. The same is expected for Py12, but being ionic in nature, Py12 also experiences greater repulsions between counter groups as well as hydrophobic tails. This results in the disassembly of bigger-size micelles into monomers at higher concentrations, which negatively affects the process of adsorption of Py12 on the EN3B mild steel surface [52,53]. Thus, a decline in the IE values of Py12 is observed with the increase in concentration. On the other hand, Py8 carrying shorter alkyl chains requires a higher concentration to assemble and then disassemble, as a result of counter ions and hydrophobic tails repulsions. Thus, at each given concentration, the self-assemblies of Py8 are more stable to provide better surface coverage and adsorption, and subsequently higher IE values.
If the charge transfer resistance of the blank and inhibited solution is represented by and respectively, the IE can be calculated as follows:    Another possible explanation for this anti-parallel behavior of Py8 and Py12 comes from the self-assembling property of surfactants [29]. In aqueous media, the longer alkyl chain being hydrophobic in nature facilitates the self-assembly of amphiphilic molecules, even at lower concentrations [51]. This ease in self-aggregation provides a better surface coverage and improved surface adsorption. As the concentration of surfactants increases, more and more monomers are added to the aggregates, and bigger size micelles are formed. The same is expected for Py12, but being ionic in nature, Py12 also experiences greater repulsions between counter groups as well as hydrophobic tails. This results in the disassembly of bigger-size micelles into monomers at higher concentrations, which negatively affects the process of adsorption of Py12 on the EN3B mild steel surface [52,53]. Thus, a decline in the IE values of Py12 is observed with the increase in concentration. On the other hand, Py8 carrying shorter alkyl chains requires a higher concentration to assemble and then disassemble, as a result of counter ions and hydrophobic tails repulsions. Thus, at each given concentration, the self-assemblies of Py8 are more stable to provide better surface coverage and adsorption, and subsequently higher IE values.
If the charge transfer resistance of the blank and inhibited solution is represented by R b ct and R i ct respectively, the IE can be calculated as follows: Figure 6a presents the equivalent circuit model that best fits the experimental EIS data for blank solution; however, the addition of Py8 and Py12 altered the electrical double layer at the EN3B mild steel and electrolyte interface, hence the equivalent circuit model is also modified and displayed in Figure 6b. The corresponding circuit elements are given in  Figure 6a presents the equivalent circuit model that best fits the experimental EIS data for blank solution; however, the addition of Py8 and Py12 altered the electrical double layer at the EN3B mild steel and electrolyte interface, hence the equivalent circuit model is also modified and displayed in Figure 6b. The corresponding circuit elements are given in Table 4    In order to obtain a better fitting of the EIS data, the true capacitance is substituted by the constant phase element (CPE), which is then co-related to Y o and n according to the following equation: where j is the imaginary unit and w represents the angular frequency [48]. When n equals one, CPE acts as an ideal faradaic capacitor (Y o = C), while it behaves like a resistor (Y o = 1/R) when n equals zero. It is important to mention that 0.5 is the limiting value of n, such that 0.5 ≤ n ≤ 1 for depressed semicircles [54][55][56]. At the limiting value, the reactive species in the solution are under the control of the diffusion phenomenon. The minimum n values in the presence of Py8 and Py12 also point towards the full coverage of the EN3B mild steel surface by surfactant molecules, where electrochemical reactions are solely driven by the diffusion process [12,57]. Furthermore, the value of Yo dl (the non-ideal capacitance) is lowered in the presence of inhibitors and doesn't show any prominent change with the concentration of inhibitors. According to previous reports, the value of Y o of a blank solution (devoid of inhibitors) is always higher compared to the inhibited solution [12,58]. The decline in the non-ideal capacitance of the solution is ascribed to the dropping of the local dielectric constant upon the quasi-replacement of H 2 O molecules with the adsorbed Py(n) molecules at the EN3B mild steel surface; hence, the dissolution of steel is retarded. Another possible reason for the decrease in Yo dl values is the increased thickness of the electric double layer after the adsorption of Py(n) molecules [59,60]. On the other hand, the inhibitor molecules offer higher charge transfer resistance (R ct ) to the corroding species, hindering their access to the steel surface [29,61]. The decreased Yo dl and increased R ct in the presence of Py8 and Py12 signify an actively inhibited solution. Moreover, the order of IE values obtained from the EIS findings is Py8 > Py12, which is in accordance with the results of potentiodynamic polarization measurements.
The changes in the EIS spectra of Py8 were examined for up to 24 h at a fixed concentration (10 mM), and the results are demonstrated in Figure 7. The corresponding EIS parameters are also listed in Table 5. Similar to the LPR measurements, the IE of Py8 was found to increase with the passage of time. The diameter of the capacitive loop increased with the increase in exposure time, and no inductive effect was observed. An increase observed in the values of R ct and R p was associated with the formation of a more ordered adsorbed layer of Py8 molecules at the surface of EN3B mild steel, as a function of exposure time.
In order to obtain a better fitting of the EIS data, the true capacitance is substituted by the constant phase element (CPE), which is then co-related to Yo and n according to the following equation: where j is the imaginary unit and w represents the angular frequency [48]. When n equals one, CPE acts as an ideal faradaic capacitor (Yo = C), while it behaves like a resistor (Yo = 1/R) when n equals zero. It is important to mention that 0.5 is the limiting value of n, such that 0.5 ≤ n ≤ 1 for depressed semicircles [54][55][56]. At the limiting value, the reactive species in the solution are under the control of the diffusion phenomenon. The minimum n values in the presence of Py8 and Py12 also point towards the full coverage of the EN3B mild steel surface by surfactant molecules, where electrochemical reactions are solely driven by the diffusion process [12,57]. Furthermore, the value of Yodl (the non-ideal capacitance) is lowered in the presence of inhibitors and doesn't show any prominent change with the concentration of inhibitors. According to previous reports, the value of Yo of a blank solution (devoid of inhibitors) is always higher compared to the inhibited solution [12,58]. The decline in the non-ideal capacitance of the solution is ascribed to the dropping of the local dielectric constant upon the quasi-replacement of H2O molecules with the adsorbed Py(n) molecules at the EN3B mild steel surface; hence, the dissolution of steel is retarded. Another possible reason for the decrease in Yodl values is the increased thickness of the electric double layer after the adsorption of Py(n) molecules [59,60]. On the other hand, the inhibitor molecules offer higher charge transfer resistance (Rct) to the corroding species, hindering their access to the steel surface [29,61]. The decreased Yodl and increased Rct in the presence of Py8 and Py12 signify an actively inhibited solution. Moreover, the order of IE values obtained from the EIS findings is Py8 > Py12, which is in accordance with the results of potentiodynamic polarization measurements.
The changes in the EIS spectra of Py8 were examined for up to 24 h at a fixed concentration (10 mM), and the results are demonstrated in Figure 7. The corresponding EIS parameters are also listed in Table 5. Similar to the LPR measurements, the IE of Py8 was found to increase with the passage of time. The diameter of the capacitive loop increased with the increase in exposure time, and no inductive effect was observed. An increase observed in the values of Rct and Rp was associated with the formation of a more ordered adsorbed layer of Py8 molecules at the surface of EN3B mild steel, as a function of exposure time.

Adsorption Isotherm
Adsorption isotherms can provide the basic insights about the adsorption phenomenon taking place at a surface. Surfactant molecules are widely reported to act as corrosion inhibitors by forming an adsorbed layer on the surface of a given substrate [62,63]. The adsorption process relies on various factors, such as structure and concentration of adsorbed species, temperature, electrochemical potential and interaction with the substrate during experiment. In an aqueous solution, the process involves the quasi-replacement of preadsorbed H 2 O molecules on the surface of mild steel with the inhibitor molecules [62,64], according to Equation (8).
The data obtained through potentiodynamic (Tafel) polarization measurements is used to explain the adsorption behavior of Py8 and Py12. The mechanism of adsorption can be elucidated by the degree of surface coverage (θ) of mild steel (substrate) by the Py(n) inhibitor molecules [62]. If the inhibitor molecules are efficient and the measured C R is far less than the blank solution, the IE in such a system can be directly related to surface coverage (θ) according to the following equation: The experimental data were fitted to different models of adsorption isotherm but the best approximation is obtained through the Langmuir model [14,44]. The adsorption isotherm of Py8 and Py12 on the EN3B mild steel surface in 3.5% NaCl solution at pH 1.5 follows a straight line (Figure 8), which means the Langmuir adsorption pattern is obeyed according to this model: Here, C inh represents the concentration of inhibitors in mol L −1 . K ads is the equilibrium constant for the process of adsorption and can be calculated from the intercept of the plot of C inh /θ versus C inh . The value of ∆G • ads can be calculated as follows: where R and T represent the general gas constant and absolute temperature, respectively, and 55.5 is the concentration of water molecules (in mol dm −3 ) [65,66]. The values of K ads and ∆G • ads are given in Table 6. The higher values of K ads for Py8 and Py12 indicate strong electrostatic interaction of inhibitors with the surface of EN3B mild steel, whereas negative values of ∆G • ads show the spontaneous nature of the adsorption phenomenon. It is commonly reported that the ∆G • ads is around −40 kJ mol −1 if the inhibitors are chemically adsorbed over the metallic surface, and the ∆G • ads values below or around −20 kJ mol −1 signify physisorption of inhibitors [67,68].
In the case of Py8 and Py12, the ∆G • ads is −32 and −33 kJ mol −1 , respectively, which specifies the coexistence of both physisorbed and chemisorbed molecules [54,56,[69][70][71].  The higher values of Kads for Py8 and Py12 indicate strong electrostatic interaction of inhibitors with the surface of EN3B mild steel, whereas negative values of ΔG°ads show the spontaneous nature of the adsorption phenomenon. It is commonly reported that the ΔG°ads is around −40 kJ mol −1 if the inhibitors are chemically adsorbed over the metallic surface, and the ΔG°ads values below or around −20 kJ mol −1 signify physisorption of inhibitors [67,68]. In the case of Py8 and Py12, the ΔG°ads is −32 and −33 kJ mol −1 , respectively, which specifies the coexistence of both physisorbed and chemisorbed molecules [54,56,[69][70][71].

SEM and AFM Analysis
The morphology of EN3B mild steel specimens was studied through SEM analysis before and after corrosion (Figure 9), with and without inhibitors. The polished steel samples displayed a uniform and smooth surface ( Figure 9a); however, the presence of 3.5% NaCl at pH 1.5 adversely affects the surface of EN3B mild steel, and hence it is badly corroded (Figure 9b) within a period of 6 h. In the presence of 10 mM inhibitors (Py8 and Py12), the EN3B mild steel surface is much less corroded as compared to the blank solution, as shown in Figure 9c,d. The inhibitor molecules are supposed to form an adsorbed layer on the surface of steel, which hinders the attack of corroding species in the solution [72][73][74]. The adsorbed layer of Py8 and Py12 acts as a barrier between the corrosive environment and the EN3B mild steel surface, keeping the rate of corrosion very low, which is also supported by electrochemical measurements.

SEM and AFM Analysis
The morphology of EN3B mild steel specimens was studied through SEM analysis before and after corrosion (Figure 9), with and without inhibitors. The polished steel samples displayed a uniform and smooth surface ( Figure 9a); however, the presence of 3.5% NaCl at pH 1.5 adversely affects the surface of EN3B mild steel, and hence it is badly corroded (Figure 9b) within a period of 6 h. In the presence of 10 mM inhibitors (Py8 and Py12), the EN3B mild steel surface is much less corroded as compared to the blank solution, as shown in Figure 9c,d. The inhibitor molecules are supposed to form an adsorbed layer on the surface of steel, which hinders the attack of corroding species in the solution [72][73][74]. The adsorbed layer of Py8 and Py12 acts as a barrier between the corrosive environment and the EN3B mild steel surface, keeping the rate of corrosion very low, which is also supported by electrochemical measurements.
The morphological variations on the EN3B mild steel surface have also been studied through AFM, with and without the effect of inhibitors. The AFM images of polished EN3B mild steel and the steel coupons immersed in uninhibited and inhibited solutions are presented in Figure 10. If we compare Figure 10a,b, the polished steel displays some scratches but still has a uniform and smooth surface as compared to the steel attacked by aggressive chloride media. However, in the presence of inhibitors, the EN3B mild steel surface is much more protected from the attack of Cl − ions, and the surface roughness is considerably reduced (Figure 10c,d), with the number of crest peaks and shallow valleys being significantly lowered. The surface roughness of the steel coupons can also be esti-mated from the height profiles obtained through AFM analysis ( Figure 11). The root mean square (RMS) roughness of polished steel coupons is 9.12 nm, but under the effect of 3.5% NaCl solution (pH 1.5) the surface is badly affected within 6 h, and RMS roughness comes out to be 63.94 nm. In the presence of Py8 and Py12, RMS is decreased to 18.34 nm and 20.49 nm, respectively, which highlights the efficiency of both inhibitors. The morphological variations on the EN3B mild steel surface have also been studied through AFM, with and without the effect of inhibitors. The AFM images of polished EN3B mild steel and the steel coupons immersed in uninhibited and inhibited solutions are presented in Figure 10. If we compare Figure 10a,b, the polished steel displays some scratches but still has a uniform and smooth surface as compared to the steel attacked by aggressive chloride media. However, in the presence of inhibitors, the EN3B mild steel surface is much more protected from the attack of Clions, and the surface roughness is considerably reduced (Figure 10c,d), with the number of crest peaks and shallow valleys being significantly lowered. The surface roughness of the steel coupons can also be estimated from the height profiles obtained through AFM analysis ( Figure 11). The root mean square (RMS) roughness of polished steel coupons is 9.12 nm, but under the effect of 3.5% NaCl solution (pH 1.5) the surface is badly affected within 6 h, and RMS roughness comes out to be 63.94 nm. In the presence of Py8 and Py12, RMS is decreased to 18.34 nm and 20.49 nm, respectively, which highlights the efficiency of both inhibitors.

Quantum Chemical Calculations
Density functional theory is a powerful tool to study the interaction between the metal surface and corrosion inhibitors [75]. To obtain insight into the structure-property relationship, geometry optimization was carried out to obtain energetically stable structures at DFT/PBE/def2-TZVPP level of theory in the TURBOMOLE software. The optimized structures are depicted in Figure 12. It is observed that after optimization, the longer alkyl chain length in Py12 stabilizes the aromatic ring, making it planar compared to Py8. The optimized structures of both inhibitors are further used to compute the electron density distribution on the frontier molecular orbitals (FMOs) as can be seen in Table 7, which are the Highest Occupied Molecular Orbital (HOMO) and the Lowest Unoccupied Molecular Orbital (LUMO). A schematic of this distribution on the FMOs is provided in Table 8. The HOMO is conventionally the region of highest electron density, while the site of the LUMO can host electrons provided by d-orbitals of Fe [35]. It can be seen from the FMO schematics that the HOMO of Py8 and Py12 are mainly centered on the aromatic pyridine rings and the bromide counter ion, which are the active centers with the greatest ability to bond to the steel surface. However, the LUMO orbital in Py8 is spread over the alkyl chain adjacent to the nitrogen atom, indicating greater interaction with the metal, while the effect is subjugated in the case of Py12 with a long alkyl chain. It has been shown earlier that the length of the hydrocarbon chain affects the energy band gap (∆E = E LUMO − E HOMO ), which is in turn related to the corrosion inhibition ability [76,77]. the aromatic pyridine rings and the bromide counter ion, which are the active centers with the greatest ability to bond to the steel surface. However, the LUMO orbital in Py8 is spread over the alkyl chain adjacent to the nitrogen atom, indicating greater interaction with the metal, while the effect is subjugated in the case of Py12 with a long alkyl chain. It has been shown earlier that the length of the hydrocarbon chain affects the energy band gap (∆E = ELUMO − EHOMO), which is in turn related to the corrosion inhibition ability [76,77]. Using Koopman's theorem [78], the energies of the FMOs can be utilized to obtain various global reactivity parameters, such as the ionization potential (I), electron affinity (A), electronegativity (χ), softness (σ), hardness (η) and dipole moment (µ) from the following equations: The energies of the FMOs (EHOMO and ELUMO), the electronic energy band gap (ΔE) and the evaluated global reactivity descriptors are reported in Table 8. As soft molecules are more susceptible to chemical changes according to the Pearson concept, a low value of ΔE of a corrosion inhibitor is typically associated with high corrosion inhibition [79]. Among the two compounds studied in this work, DFT studies reveal a smaller band gap (1.852 eV) for Py8 compared to Py12, which has a ΔE value of 2.138 eV. Moreover, Py8 has a EHOMO = −2.377 eV, which highlights its greater ability to donate an electron to the metal surface, maximizing interaction with steel [80]. These results are further cemented by experimental evaluation, which projects Py8 to be a better corrosion inhibitor compared with Py12.
The energies of the FMOs (EHOMO and ELUMO), the electronic energy band gap (ΔE) and the evaluated global reactivity descriptors are reported in Table 8. As soft molecules are more susceptible to chemical changes according to the Pearson concept, a low value of ΔE of a corrosion inhibitor is typically associated with high corrosion inhibition [79]. Among the two compounds studied in this work, DFT studies reveal a smaller band gap (1.852 eV) for Py8 compared to Py12, which has a ΔE value of 2.138 eV. Moreover, Py8 has a EHOMO = −2.377 eV, which highlights its greater ability to donate an electron to the metal surface, maximizing interaction with steel [80]. These results are further cemented by experimental evaluation, which projects Py8 to be a better corrosion inhibitor compared with Py12.
The energies of the FMOs (EHOMO and ELUMO), the electronic energy band gap (ΔE) and the evaluated global reactivity descriptors are reported in Table 8. As soft molecules are more susceptible to chemical changes according to the Pearson concept, a low value of ΔE of a corrosion inhibitor is typically associated with high corrosion inhibition [79]. Among the two compounds studied in this work, DFT studies reveal a smaller band gap (1.852 eV) for Py8 compared to Py12, which has a ΔE value of 2.138 eV. Moreover, Py8 has a EHOMO = −2.377 eV, which highlights its greater ability to donate an electron to the metal surface, maximizing interaction with steel [80]. These results are further cemented by experimental evaluation, which projects Py8 to be a better corrosion inhibitor compared with Py12.
The energies of the FMOs (EHOMO and ELUMO), the electronic energy band gap (ΔE) and the evaluated global reactivity descriptors are reported in Table 8. As soft molecules are more susceptible to chemical changes according to the Pearson concept, a low value of ΔE of a corrosion inhibitor is typically associated with high corrosion inhibition [79]. Among the two compounds studied in this work, DFT studies reveal a smaller band gap (1.852 eV) for Py8 compared to Py12, which has a ΔE value of 2.138 eV. Moreover, Py8 has a EHOMO = −2.377 eV, which highlights its greater ability to donate an electron to the metal surface, maximizing interaction with steel [80]. These results are further cemented by experimental evaluation, which projects Py8 to be a better corrosion inhibitor compared with Py12. Using Koopman's theorem [78], the energies of the FMOs can be utilized to obtain various global reactivity parameters, such as the ionization potential (I), electron affinity (A), electronegativity (χ), softness (σ), hardness (η) and dipole moment (µ) from the following equations: The energies of the FMOs (E HOMO and E LUMO ), the electronic energy band gap (∆E) and the evaluated global reactivity descriptors are reported in Table 8. As soft molecules are more susceptible to chemical changes according to the Pearson concept, a low value of ∆E of a corrosion inhibitor is typically associated with high corrosion inhibition [79]. Among the two compounds studied in this work, DFT studies reveal a smaller band gap (1.852 eV) for Py8 compared to Py12, which has a ∆E value of 2.138 eV. Moreover, Py8 has a E HOMO = −2.377 eV, which highlights its greater ability to donate an electron to the metal surface, maximizing interaction with steel [80]. These results are further cemented by experimental evaluation, which projects Py8 to be a better corrosion inhibitor compared with Py12.
For a corrosion inhibitor, a small value of vertical ionization potential (I) indicates greater ability of the inhibitor molecule to offer electrons to the metal surface and thus good corrosion protection. In the present study, Py8 has a lower χ value (1.451 eV) compared to Py12, which shows a greater electronegativity (χ) value of 2.56 eV. The inhibition efficiency is reported to decrease with increasing electronegativity of the inhibitor, further highlighting the choice of Py8 as a better corrosion inhibiter. In the literature, the dipole moment of a compound is also correlated with its corrosion inhibition efficiency. Py8 and Py12 both have a significantly high value of dipole moment (5.997-7.79 D), also consistent with earlier work that notes a high inhibition character for compounds with a higher dipole moment [81]. The ability of an inhibitor to donate electrons to the metal surface is measured in terms of ∆N (fraction of transferred electrons), which can be evaluated through the following equation: where ϕ is the work function for the metal under consideration [82,83]. For an estimated value of 4.82 eV for the 110 face of Fe, the calculated value of ∆N is higher (1.81) for Py8 compared to 0.59 for Py12, further confirming the higher electron donation capability for the former. All the theoretical predictions about the superior inhibition character of Py8 are supported by experimental observations. Evidence shows a high corrosion inhibition efficiency (85%) for Py8 compared to 82% for Py12, suggesting a longer alkyl chain is not conducive to improving inhibition.

Mulliken Charge Analysis
The calculation of atomic charges and the accompanying charge density distribution play an important role in the mechanism of corrosion inhibition [84]. Study of the atomic charges through Mulliken charge analysis can reveal the charge transfer taking place between the donor and acceptor pairs, which forms the basis of interaction between the metal surface and the inhibitor.
The charges on each atom of the inhibitors Py8 and Py12 are listed in Table 9, calculated at DFT/PBE/def2-TZVPP level of theory. The complete set of atomic charges with numbered atoms can be found in the supplementary section. It can be seen from Table 9 that the negative charge is concentrated on the pyridine ring, which behaves as the nucleophilic center of the inhibiting compounds. It is noted that the highest negative charge is present on the highly negative bromine counterions (−0.560) and the carbon adjacent to nitrogen in the alkyl chain (−0.241) therefore, facilitates the adsorption of the compounds onto the steel surface [85]. The order of inhibition efficiencies of the synthesized compounds for EN3B mild steel is Py8 > Py12. This is also corroborated by the observation that some carbon atoms in Py8 show higher negative charge than those present in Py12, suggesting that Py8 would interact more with the metal surface. This is in agreement with the previously carried out electron density distribution analysis involving the FMOs.

Interaction Energies
The interaction energies of the two inhibitors (Py8 and Py12) on the surface of iron (emulating steel) has also been studied via molecular mechanics to obtain a simplistic view of the binding of these molecules on the steel surface. To this end, a layer of Fe atoms (110 surface) was constituted in the Hyperchem 5.0 software [86], depicting the surface of steel (which is passive) on which the pyridinium-based surfactants can adsorb. The molecular mechanics program was employed with the MM+ forcefield to evaluate binding energies of synthesized compounds with the iron surface in the aqueous medium. Interaction energies (E int ) of the adsorbed inhibitor (E I ) on the iron surface (E solvated surface ) are calculated by the following equation [87]: (20) where E adsorbed represents the energy of the adsorbed state of the compound on mild steel (for which Fe is typically the interacting component) [88]. The interaction and binding energies (E bind = − E int ) of the two surfactants are listed in Table 10, further confirming the supremacy of Py8 over Py12 in its binding capability with iron atoms on the EN3B mild steel surface. A high value of binding energy represents strong interaction with the metal surface. The schematics of this interaction for Py8 are presented in Figure 13.

Mechanism of Corrosion of EN3B Mild Steel and Its Inhibition by Py8 and Py12
The results of electrochemical and morphological investigations reveal that the presence of Py8 and Py12 surfactants play a very crucial role in inhibiting the corrosion of EN3B mild steel immersed in 3.5% NaCl solution at pH 1.5. Based on these findings, and looking towards the chemical structure of Py8 and Py12, a possible mechanism of inhibition has been proposed. The corrosion of mild steel in 3.5% NaCl solution (pH 1.5) is initiated by chloride (Cl − ) and hydronium (H3O + ) ions. The damaged and rough surface areas are more prone to the attack of corroding species, and the dissolution of iron occurs in the form of soluble Fe 2+ ions, making the surface electron deficient and positively charged, which is referred as the anodic site. The electrons produced in this process moves towards the other site, and is referred as the cathodic site, where complementary reactions occur depending upon the corroding environment. In acidic solutions, the most likely reaction to occur at the cathodic site is the reduction of H + ions into hydrogen gas [1]. The Fe +2 ions may combine with the Cl − ions to form soluble FeCl2 complex, or they can precipitate out in the form of rust (Fe2O3.nH2O + FeO(OH)) [2]. When inhibitors Py8 and Py12 are added to the solution, they adsorb on the surface of EN3B mild steel and hinder the corrosive attack of Cland H3O + ions. On the other hand, the adsorbed Py8 and Py12 molecules also cover the reactive sites on the surface of EN3B mild steel, prone to degradation, and prevent the dissolution of iron atoms. This is schematically represented in Figure 14.

Mechanism of Corrosion of EN3B Mild Steel and Its Inhibition by Py8 and Py12
The results of electrochemical and morphological investigations reveal that the presence of Py8 and Py12 surfactants play a very crucial role in inhibiting the corrosion of EN3B mild steel immersed in 3.5% NaCl solution at pH 1.5. Based on these findings, and looking towards the chemical structure of Py8 and Py12, a possible mechanism of inhibition has been proposed. The corrosion of mild steel in 3.5% NaCl solution (pH 1.5) is initiated by chloride (Cl − ) and hydronium (H 3 O + ) ions. The damaged and rough surface areas are more prone to the attack of corroding species, and the dissolution of iron occurs in the form of soluble Fe 2+ ions, making the surface electron deficient and positively charged, which is referred as the anodic site. The electrons produced in this process moves towards the other site, and is referred as the cathodic site, where complementary reactions occur depending upon the corroding environment. In acidic solutions, the most likely reaction to occur at the cathodic site is the reduction of H + ions into hydrogen gas [1]. The Fe 2+ ions may combine with the Cl − ions to form soluble FeCl 2 complex, or they can precipitate out in the form of rust (Fe 2 O 3 .nH 2 O + FeO(OH)) [2]. When inhibitors Py8 and Py12 are added to the solution, they adsorb on the surface of EN3B mild steel and hinder the corrosive attack of Cl − and H 3 O + ions. On the other hand, the adsorbed Py8 and Py12 molecules also cover the reactive sites on the surface of EN3B mild steel, prone to degradation, and prevent the dissolution of iron atoms. This is schematically represented in Figure 14. According to the adsorption isotherm data, the existence of both chemisorbed and physisorbed molecules is specified for Py8 and Py12. As the Py8 and Py12 molecules have a 3-methylpyridinium group (as the hydrophilic head) and a hydrophobic alkyl chain with 8 and 12 carbons, respectively, these moieties interact with the substrate in different ways. The p-orbitals of the aromatic ring contain π-electrons, which can be transferred to vacant d-orbitals of Fe, particularly at the anodic site. According to DFT results, the HOMO orbitals of Py8 and Py12 are mainly allocated on the pyridine ring and are involved in electron donation. The electron-donating power of the pyridinium ring is enhanced in the presence of methyl substituent, which favors the chemisorption of Py8 and Py12 molecules at the mild steel surface. According to previous reports, such coordination would readily establish at the surface of EN3B mild steel [89]. The excess electrons in the d-orbitals of Fe generate inter-electronic repulsions, and to overcome these repulsions, Fe back-donates the electrons to anti-bonding molecular orbitals of Py8 and Py12. This reverse transfer of electrons is known as retro-donation, which further strengthens the adsorption of inhibitors at the surface of mild steel [89,90]. The LUMO orbitals of Py8 are spread over the alkyl chain, while LUMO of Py12 exist on the pyridine ring and are involved in back donation. DFT calculations suggested a smaller band gap (1.85 eV) for Py8 as compared to Py12, which favors the adsorption phenomenon. It has been reported that the inhibitors tend to polarize the surface of metals [8]; hence, it can be assumed that the donation of electrons would be more favorable at the anodic site, and likewise, retro-donation would be more feasible at the cathodic site. However, it is important to mention that in a real environment, the anodic and cathodic sites are very closely situated and randomly allocated over the surface of substrate (mild steel), depending upon the unequal distribution/presence of electrons. The non-polar alkyl chains may also contribute to physisorption owing to the Van der Waal's interactions with the mild steel surface. This blockage of cathodic sites via adsorption of Py8 and Py12 minimizes the rate of H2 evolution, contributing towards reduced CR.
Furthermore, the role of counter ions is also very important in the inhibition process. The Br − ions are electrostatically attracted towards the anodic sites at the surface of EN3B mild steel, and being larger in size, these Br − ions do not allow the penetration of Clions, and the surface stays protected from chloride attack. The aromatic ring and Br − ions preferentially interact with the anodic sites and inhibit the dissolution of Fe +2 ions. The According to the adsorption isotherm data, the existence of both chemisorbed and physisorbed molecules is specified for Py8 and Py12. As the Py8 and Py12 molecules have a 3-methylpyridinium group (as the hydrophilic head) and a hydrophobic alkyl chain with 8 and 12 carbons, respectively, these moieties interact with the substrate in different ways. The p-orbitals of the aromatic ring contain π-electrons, which can be transferred to vacant d-orbitals of Fe, particularly at the anodic site. According to DFT results, the HOMO orbitals of Py8 and Py12 are mainly allocated on the pyridine ring and are involved in electron donation. The electron-donating power of the pyridinium ring is enhanced in the presence of methyl substituent, which favors the chemisorption of Py8 and Py12 molecules at the mild steel surface. According to previous reports, such coordination would readily establish at the surface of EN3B mild steel [89]. The excess electrons in the d-orbitals of Fe generate inter-electronic repulsions, and to overcome these repulsions, Fe back-donates the electrons to anti-bonding molecular orbitals of Py8 and Py12. This reverse transfer of electrons is known as retro-donation, which further strengthens the adsorption of inhibitors at the surface of mild steel [89,90]. The LUMO orbitals of Py8 are spread over the alkyl chain, while LUMO of Py12 exist on the pyridine ring and are involved in back donation. DFT calculations suggested a smaller band gap (1.85 eV) for Py8 as compared to Py12, which favors the adsorption phenomenon. It has been reported that the inhibitors tend to polarize the surface of metals [8]; hence, it can be assumed that the donation of electrons would be more favorable at the anodic site, and likewise, retro-donation would be more feasible at the cathodic site. However, it is important to mention that in a real environment, the anodic and cathodic sites are very closely situated and randomly allocated over the surface of substrate (mild steel), depending upon the unequal distribution/presence of electrons. The non-polar alkyl chains may also contribute to physisorption owing to the Van der Waal's interactions with the mild steel surface. This blockage of cathodic sites via adsorption of Py8 and Py12 minimizes the rate of H 2 evolution, contributing towards reduced C R .
Furthermore, the role of counter ions is also very important in the inhibition process. The Br − ions are electrostatically attracted towards the anodic sites at the surface of EN3B mild steel, and being larger in size, these Br − ions do not allow the penetration of Cl − ions, and the surface stays protected from chloride attack. The aromatic ring and Br − ions preferentially interact with the anodic sites and inhibit the dissolution of Fe 2+ ions. The electrostatic interactions between the positively charged surface and negatively charged counter-ions are spontaneous in nature and lead to the physisorption of Br − ions [89]. This is in good agreement with the Tafel data, which suggests that the mechanism of anodic inhibition is independent of the concentration of inhibitors. Except for 0.5 milli molar Py8, all other concentrations of Py8 were sufficient to cover the anodic sites with Br − ions; hence, the decrease in anodic current density was almost same at these concentrations. Likewise, the effect of all concentrations of Py12 was nearly identical in the anodic region.
The changes in cathodic current densities were observed to be more pronounced with the change in Py8 and Py12 concentrations. This trend can be explained on the basis of unique molecular assembling of surfactants Py8 and Py12 as a function of concentration. As the concentration of Py8 and Py12 increases, the molecules tend to organize themselves in specific geometries, which alters the structure and stability of the adsorbed layer at the EN3B mild steel surface [89]. As Py8 and Py12 differ in the alkyl chain length, their critical packing parameter is also different, and henceforth, different molecular organizations are expected for both surfactants at the same concentration [91]. This may contribute to different adsorption geometries at the mild steel-electrolyte interface and different stabilities of the adsorbed layer.
The stability of the adsorbed layer is the key criterion for an efficient inhibition phenomenon [92], and this may be the most probable reason for the higher inhibition efficiency of Py12 at lower concentrations, obtained through Tafel and EIS measurements. At higher concentrations of Py12, the longer alkyl chains are expected to produce greater stearic hindrances and may experience greater repulsions in the micellar aggregates, thereby contributing to a less stable configuration of adsorbed layers. Although the adsorption increases with the increase in concentration, following the Langmuir model, some recent reports suggest that in several cases, the partially adsorbed inhibitor layers are more efficient than the closely/well-packed adsorbed layers [8,92]. Above all, in the light of experimental results and the interpretations alongside, it can be proposed that corrosion inhibition is not solely a function of adsorbed concentration of Py8 and Py12, regarded as the organic barrier to the corrosive attacks of Cl − and H 3 O + ions. The inhibition efficiency of Py8 and Py12 is a combined outcome of the specific blocking of reactive sites on the surface of EN3B mild steel and the stability of the adsorbed layer.

Conclusions
In this work, cationic pyridinium surfactants with different alkyl chains, Py(n) [n = 8 and 12], were synthesized and tested for the protection of EN3B mild steel in 3.5% NaCl solution at pH 1.5 ± 0.01. The results of Tafel polarization indicated mixed-type behavior of both inhibitors, with the maximum IE values of 84.74% and 76.92% for Py8 and Py12, respectively. LPR studies revealed IE as a function of time, and an increase in IE and a decrease in CR was noticed as the time progressed; the highest IE achieved for Py8 and Py12 after 24 h was 85.10% and 82.60%, respectively. As established by EIS data, the maximum IE was 84.8% for Py8 and 82.86% for Py12, respectively. Both inhibitors were active in all concentrations and significantly increased the charge transfer resistance as compared to the blank solution, indicating the efficiency of the inhibition process. The adsorption of Py8 and Py12 followed the Langmuir adsorption isotherm, with higher values of K ads . The −∆G • ads values indicated the spontaneous nature of the adsorption process and further pointed towards the subsistence of physisorption and chemisorption at the metal-electrolyte interface at the same time. DFT calculations also validated the experimental findings. Both pyridinium-based cationic surfactant inhibitors are predicted to show strong interaction with the mild steel surface, with iron atoms in particular. Py8 is predicted to show maximum inhibition efficiency in comparison to Py12 owing to its stronger interaction and binding capabilities. SEM analysis revealed less corroded surfaces in the presence of Py8 and Py12 as compared to the blank solution. Furthermore, the AFM analysis exposed a highly rough surface for EN3B mild steel immersed in the corrosive solution, with RMS roughness reaching 63.94 nm, but in the presence of Py8 and Py12, the RMS surface roughness was reduced to 18.34 and 20.49 nm, respectively. Above all, the results of electrochemical investigations, theoretical predictions and the morphological examinations have revealed a high corrosion inhibition potential of the synthesized cationic pyridinium surfactants (Py8 and Py12) under the specified corrosive environment (3.5% NaCl, pH 1.5), at STP. The inhibitory potential of the synthesized Py(n) surfactants is mainly attributed to their ability of being adsorbed over the EN3B mild steel surface. The stronger interactions of Py8 and Py12 with the orbitals of Fe atoms lead towards the formation of a stable anticorrosive barrier film.