Introduction

Steel and its alloys are common and efficient materials used in industrial machinery production1,2. Mild steel corrosion during an acidic wash is convenient damage that perturbs industrial production lines and contains serious outcomes such as technical and financial issues3,4. Corrosion inhibition materials have a considerable share of confronting against steel corrosion5. Organometallic materials are used widely for corrosion inhibition6,7,8. Some organometallic components have privileges for their distinguishable corrosion inhibition behavior, such as ferrocene and its derivatives introduced as corrosion inhibition materials9,10,11,12. The studies show that organic compound offer significant advantages in inhibiting the corrosion of mild steel13,14,15. Their adsorption behavior, film-forming properties, mixed-type inhibition, and compatibility with the adsorption isotherm make them important candidates for corrosion protection strategies. Understanding the structure–property relationships of these compounds through computational approaches further enhances the development of efficient corrosion inhibitors.

Investigations show that ferrocene derivatives such as alkylated ferrocene halides provide considerable corrosion inhibition properties. Halide derivatives of ferrocene may cause electrochemical perturbations in certain conditions, such as unfavorable halide coordination in copper included systems16,17. Ferrocene with other functional groups may be preferable rather than halides. On the other hand, esters are effectively used in corrosion inhibition or steel coating18,19,20. Accordingly, ferrocene-based esters may be used as favorable alternatives for corrosion inhibition of mild steel21,22.

The 4-chlorobutylferrocene has been used as the starting material for the synthesis of 4-ferrocenylbutyl-based esters23,24. Preparation of 4-ferrocenylbutyl-based esters is challenging when ferrocene is used as the initial reagent, and 4-chlorobutylferrocene is the first product for ester preparation. Also, the efficiency of the reaction is negligible. A larger halide would be favorable since it contains a two-step Friedel–Crafts acylation reaction and nucleophilic substitution reaction (SN2)25. Chlorine is not the best leaving functional group for this type of reaction in comparison with the better leaving functional groups such as bromine or iodine for a SN2 substitution reaction that are more expensive and requires harder reaction condition for high yield26,27. In this respect, the 4-ferrocenylbutyl iodide could be used to prepare 4-ferrocenylbutyl-based esters.

In our previous paper, the effect of various functional groups attached to the carbonyl group of the 4-ferrocenylbutyl carboxylate were investigated and results show that the saturated alkyl groups might be more effective in the corrosion inhibition of the mild steel28. However, there is no investigation about the 4-ferrocenylbutyl carboxylate with saturated carboxylic acids and there is no information about the mechanism of the mild steel corrosion inhibition of these compounds. Also, optimized synthesis of these inhibitors with significant yield is not available yet. In the present work, 4-ferrocenylbutyl-based saturated carboxylate esters with different alkyl chains have been investigated. These ferrocene-based esters have been synthesized by nucleophilic substitution reaction (SN2) of appropriate carboxylic acids with 4-ferrocenylbutyl iodide as the initial reagent in the presence of Fe3O4@SiO2@(CH2)3-Im-bisEthylFc[I] nanoparticles as catalyst and K2CO3 as base. The 1H NMR, 13C NMR, FT-IR spectroscopies, elemental analysis, and cyclic voltammetry (CV) have been used to characterize the synthesized ferrocene-based esters. The corrosion inhibition properties of the synthesized ferrocene-based esters have been investigated with electrochemical impedance spectroscopy (EIS), Tafel polarization, and scanning electron microscopy (SEM).

Experimental

Chemicals for synthesis

Synthesis grade reagents and chemicals were purchased from Merck, Sigma Aldrich, Fluka and Scharlau companies. The utilized solid reagents were used without further purification. The used solvents were purified with standard lab instructions. Ultra-pure double distilled water with conductance below 1 μScm−1 is used in the procedures. Argon atmosphere has been applied to provide inert reaction media. All of the glassware has been dried in an oven before use.

Synthesis of Fe3O4@SiO2@(CH2)3-Im-bisEthylFc[I]

The Fe3O4@SiO2@(CH2)3-Im nanoparticles (I) and bis-EthylFc iodide (II) have been prepared according to our previous work29. The Fe3O4@SiO2@(CH2)3-Im nanoparticles has been charged into a flask with dried toluene and dispersed for 30 min until formation of homogeneous mixture. The bis-EthylFc iodide has been added to the solution proportionally and refluxed for 48 h equipped with mechanical stirrer at 95 °C. The general rout for prepared catalyst is given in Fig. S1 in supporting information. Afterward, the Fe3O4@SiO2@(CH2)3-Im-bisEthylFc[I] (III) catalyst have been separated using a magnet, washed with dried toluene, and characterized with FT-IR, SEM, and EDX analysis. Consequently, the prepared catalyst has been used for preparation of 4-butylferrocene carboxylate esters.

Synthesis of 4-ferrocenylbutyl carboxylate esters

Ferrocene is used as starting material to synthesize 4-ferrocenylbutyl saturated carboxylate esters according to our previous experiences (Fig. S2)29,30.

The synthesized 4-ferrocenylbutyl acetate, propionate and butyrate 6a-c have been characterized with FT-IR (Bruker Tensor 270), 1H NMR (Bruker, 400 MHz), 13C NMR (Bruker, 100 MHz), and elemental analysis (Analytik Jena Novaa 400 AAS—Elementor Vario ELIII). The results are available from our previous published work30.

Cyclic voltammetry (CV) has been implemented using Metrohm Autolab (PGASTAT 30) as an extra characterization for the synthesized ferrocene-based esters 6a-c. The setup of the measurement contained a glassy carbon electrode with a 2 mm diameter (working electrode), Ag/AgCl (reference electrode), and platinum wire (counter electrode). Lithium perchlorate was used as a supporting electrolyte with a concentration of 0.1 M in acetonitrile. Also, 1 mM of ferrocene-based ester has been utilized to perform CV measurement with different scan rates31.

Preparation of metallic samples for corrosion studies

The 1 × 1 cm2 mild steel (low carbon steel) sheets were used as subjective material for corrosion study in 1 M HCl aqueous solution as corrosive media32. The working electrode utilized in the experiment was composed of mild steel. Its chemical composition, expressed in weight percentage, included the following elements: 1.25% silicon (Si), 0.221% manganese (Mn), 0.021% chromium (Cr), 0.020% sulfur (S), 0.010% phosphorus (P), 0.050% carbon (C), and the remaining portion was iron (Fe). It should be noted that the pretreatment of the mild steel has been carried out using wet 500, 1500, and 2500 grade SiC papers polishing to obtain a fresh surface of the mild steel samples, and they are washed with distilled water before further processing. The synthesized 4-ferrocenylbutyl carboxylate esters (6a-c) with different alkyl chains (C2-C4) has been used as corrosion inhibition materials with 1, 2, 4, and 8 mM concentrations in the mentioned corrosive media.

EIS and potentiodynamic polarization (PDP) measurements

All electrochemical measurements were carried out in a three-electrode configuration at room temperature; the mild steel sheets, Pt plate, and Ag/AgCl (3 M KCl) electrodes were working, counter, and reference electrodes, respectively. The working electrode was immersed in the corrosive solution for 120 min. Prior to the EIS studies. The EIS measurements were then performed at OCP in a frequency range of 10 kHz to 10 mHz with an AC voltage of ± 10.0 mV. An AUTOLAB PGSTAT30 equipped with a Frequency response analyzer, FRA, module was utilized for this purpose. The Tafel polarization was also performed after EIS measurements in the potential range of − 0.25V to + 0.25V vs OCP and a scan rate of 0.001 V/s33,34.

DFT computations details

To simulate the adsorption behaviour of 4-butylferrcenyl carboxylate esters onto mild steel, spin-polarized DFT calculations were performed utilizing the dispersion-corrected PBE35 functional and a double-numerical basis set augmented with the polarization functions (DNP). The DFT semicore pseudopotentials (DSPPs)36 method was used to handle the relativistic effects caused by the core electrons of the Fe atom. To address the dispersion effects, Grimme’s DFT-D237 technique was utilized. The basis set cut-off was 4.6 Å, and a Fermi smearing value of 0.005 Ha was used in the DFT computations.

A carbon impurity was introduced into the Fe (100) surface to simulate mild steel. To eliminate interactions between periodic pictures, a vacuum space of 15 Å was set in the direction normal to the surface. A 3 × 3 × 1 Monkhorst–Pack grid was used to sample the Brillouin zone integration. Adsorption energies (Eads) were calculated using the following equation to determine the strength of the interaction between the 4-butylferrcenyl carboxylate esters and the mild steel:

$$E_{{{\text{ads}}}} = E_{{{\text{comp}}}} {-}E_{{\text{X}}} {-}E_{{{\text{steel}}}}$$
(1)

where EX and Esteel are the total energies of the isolated 4-butylferrcenyl carboxylate ester and mild steel, respectively, while Ecomp is the total energy of formed complex between them. Hence, exothermic adsorption should result in a negative Eads value. Charge-transfer effects were analysed by the Hirshfeld method. All the calculations were performed using the DMol3,38 electronic structure code.

Morphology changes during corrosion of mild steel samples

The scanning electron microscopy (MIRA3 FEG-SEM) was used to inspect the surface of the mild steel and the effect of the studied corrosive media in the presence of the synthesized 4-ferrocenylbutyl carboxylate esters with different alkyl chains (C2-C4). The mild steel surface has been inspected with SEM before and after 24 h static stable corrosion media immersion33.

Results and discussion

Synthesis of Fe3O4@SiO2@(CH2)3-Im-bisEthylFc[I]

The prepared nanoparticles have been characterized using FT-IR, SEM, and EDX analysis that the results are given in Fig. S3. The results show that the procedure for preparation of the Fe3O4@SiO2@(CH2)3-Im-bisEthylFc[I] (III) was successful. The prepared nanomaterial has been used as catalyst in the synthesis of the 4-ferrocenylbutylcarboxylate as described in the next section.

Synthesis of 4-ferrocenylbutyl-based carboxylate esters

The esterification reaction of 4-iodobutylferrocene in the presence of catalyst (III) has been implemented to prepare 4-ferrocenylbutyl carboxylate esters. The catalyst (III) was prepared similar to the our previous work29. The Friedel–Crafts acylation reaction of the ferrocene was implemented to obtain 4-chlorobutyroylferrocene (2). Subsequently, 4-chlorobutylferrocene (3) was synthesized with insitu reduction of compound 2 with the solution of NaBH4 in diglyme31. Besides, the halogen substitution was conducted according to the literature to achieve 4-iodobutylferrocene (4). The mixture of compound 4, appropriate carboxylic acids (5a-c), and the nanoparticles III as catalyst were used to synthesize the ferrocene-based esters (6a-c) in the presence of potassium carbonate (K2CO3) as base and CH3CN as the solvent30. The modified reaction with the Fe3O4@SiO2@(CH2)3-Im-bisEthylFc[I] as catalyst improved the reaction rate and reduced required time for finalizing the esterification reaction of 4-iodobutylferrocene compared to our previous work30. The obtained results of synthesis of 4-ferrocenylbutyl carboxylate esters with different alkyl chains (C2-C4) were showed in Table S1.

The CV voltammograms of the esters are compared in Fig. S4 for different scan rates. The corresponding obtained parameters such as anodic peak current (Ip,a), cathodic peak current (Ip,c), baseline corrected anodic to cathodic peak current ratio (Ip,a /Ip,c), and absolute difference of anodic peak potential (Ep,a) and cathodic peak potential (Ep,c), |Ep,a-Ep,c| are collected in Table S2. The results show only one electroactive component in the studied system. The observed electroactivity is due to the ferrocene group39.

Potentiodynamic polarization

The polarization curve of the mild steel without and with synthesized 4-ferrocenylbutyl carboxylates inhibitors has been shown in Fig. 1.

Figure 1
figure 1

The polarization curve of the mild steel in 1 M HCl in the presence of different concentration: (a) 6a, (b) 6b, and (c) 6c.

Inhibitor’s oxidation and reduction reactions in the acidic media are controlled by adding inhibitors due to decreasing the dissolution rate of mild steel and restricting the hydrogen evolution reactions. Polarization parameters such as corrosion potentials (Ecorr), corrosion current densities (Icorr), cathodic and anodic tafel slopes (βa and βc), and the polarization resistance (Rp) were obtained by extrapolating the linear parts of the polarization diagrams and the relevant data were given in Table 1.

Table 1 Polarization parameters of mild steel immersed in 1 M HCl in absence and presence of different inhibitors concentrations.

Inhibition efficiency of the inhibitors was calculated using the Eq. (2):

$${\varvec{\eta}}\left(\boldsymbol{\%}\right)=\frac{{{\varvec{R}}}_{{\varvec{p}}\left({\varvec{i}}{\varvec{n}}{\varvec{h}}\right)}-{{\varvec{R}}}_{{\varvec{p}}}}{{{\varvec{R}}}_{{\varvec{p}}\left({\varvec{i}}{\varvec{n}}{\varvec{h}}\right)}}$$
(2)

where Rp(inh) and Rp represent the polarization resistance with and without corrosion inhibitor, respectively. Stern-Geary equation was applied to calculate the polarization resistances, according to Eq. (3):

$${{\varvec{R}}}_{{\varvec{p}}}=\frac{{{\varvec{\beta}}}_{{\varvec{c}}}{{\varvec{\beta}}}_{{\varvec{a}}}}{2.303\boldsymbol{ }{{\varvec{I}}}_{{\varvec{c}}{\varvec{o}}{\varvec{r}}{\varvec{r}}}({{\varvec{\beta}}}_{{\varvec{c}}}+{{\varvec{\beta}}}_{{\varvec{a}}})}$$
(3)

Based on the data listed in Table 1, Icorr decreased in the presence of inhibitors and the most significant effect was observed at 2mM of the inhibitors. It is generally attributed to the adsorption of inhibitors on the surface of the metal. The Ecorr values did not show significant changes with inhibitor concentration in a potential range of less than 85 mV indicating a mixed corrosion control of the used inhibitors40,41,42,43. The βa and βc also did not change significantly that confirms the mixed controlled corrosion of the inhibitors. Forming a protective layer on the surface of metal, inhibitors decrease the Icorr and increase Rp respectively over almost 10 and 20 times in their optimized concentrations. Among inhibitors, 6b inhibitor showed the best performance with 96.53% inhibition efficiency after 2 h immersion in 1 M HCl.

Electrochemical impedance spectrums

The Nyquist plot of mild steel in 1 M HCl at 25 °C is given in Fig. 2a. The presence of only one semicircle in Nyquist plot confirms a simple Randles cell model with a solution resistance, Rs, in series with a parallel-connected charge transfer resistance, Rct, and constant phase element, CPE (Fig. 2b). The Nyquist plots of the mild steel in inhibited HCl solutions have also been presented at Fig. 5. The protective inhibitor film on the surface of mild steel resulted in a deformed semicircle; Refs.44,45 based on the fitting results such a semicircle did not fit properly to the equivalent circuit model shown in Fig. 2a.

Figure 2
figure 2

(a) The Nyquist plot of mild steel in 1 M aqueous HCl at 25 °C with corresponding fitting curve and (b) the equivalent circuit for analysis and fitting.

The behaviour of inhibited samples was best fitted to a two time-constant model shown in Fig. 3d. In this model the film resistance, Rf, and the corresponding CPE (CPEf) are used to simulate the additional inhibitor film related high frequency time constant. CPE is a general element that is used to describe the behaviour of a non-ideal capacitance and the admittance Y serves as the basis for defining the CPE, which is determined using ZCPE = (Y0 ω j)−n, where Y0 and n represent the relevant admittance and power of the CPE, respectively, while ω denotes the angular frequency and j the imaginary number.

Figure 3
figure 3

The Nyquist plot of the mild steel in 1 M aqueous HCl media in the presence different concentration of: (a) 6a, (b) 6b, (c) 6c, and (d) the equivalent circuit used for fitting.

The capacitance values were calculated according to Eq. (4)11:

$${C}_{dl}={(Y}_{0}{R}_{ct}^{1-n}{)}^{1/n}$$
(4)

The resulted parameters obtained from fitting the EIS experimental data are given in Table 2 with the corresponding fitting errors.

Table 2 The corrosion inhibition efficiency of the 4-ferrocenylbutyl carboxylate esters with corresponding fitting parameters for EIS data.

Inhibition efficiency of the inhibitors was calculated with the Eq. (5):

$${\varvec{\eta}}\left(\boldsymbol{\%}\right)=\frac{{{\varvec{R}}}_{{\varvec{c}}{\varvec{t}}\left({\varvec{i}}{\varvec{n}}{\varvec{h}}\right)}-{{\varvec{R}}}_{{\varvec{c}}{\varvec{t}}}}{{{\varvec{R}}}_{{\varvec{c}}{\varvec{t}}\left({\varvec{i}}{\varvec{n}}{\varvec{h}}\right)}}$$
(5)

In this equation, the Rct(inh) and Rct are the charge transfer resistances in the presence of inhibitor and without inhibitor, respectively. The protective layer results in a decrease in the rate of charge transfer (electron exchange) between metallic surface and the electrolyte and causes an increase in inhibition efficiency33,46,47. Thus, a significant increase in Rct and a remarkable decrease in Cdl values in the inhibited solutions compared with the values for samples corroded in blank are observed in Table 2. The reduced Cdl values for inhibited samples is attributed to the increase in the thickness of the double layer capacitor and the replacement of water molecules with the inhibitor molecules, confirming the adsorption of inhibitor molecules on metal11,48. The values of power of CPEf (nf) are very close to 1 and show the near-ideal capacitance behaviour of the adsorbed inhibitor film; it is also due to the homogeneous distribution of activation energies on the surface of the inhibitive film resulting from an almost homogeneous adsorption of the inhibitor molecules on metal surface. The Rf values showed a remarkable increase with concentration up to a maximum and the slight decrease was seen generally due to the changes in inhibitive film thickness and structure. The n values for double layer related CPE decreased for inhibited samples representing an enhancement in the diffusion contribution in the resistance against charge transfer process through the inhibitor adsorbed layer. Generally, as n becomes closer to 0.5 the process is likely to be controlled by diffusion. Maximum η% values were observed for samples inhibited using 2.0 mM of each inhibitor; although their values did not change significantly for 6b and 6c with their concentration as is obvious from data in Table 2. As it is, the inhibitor 6b shows the maximum corrosion inhibition efficiency among the studied 4-ferrocenylbutyl carboxylates inhibitors. Among synthesized 4-ferrocenylbutyl carboxylates with different alkyl chains the best was observed for the samples with propionate alkyl chain (6b). The length of alkyl chain and steric hindrance are two main factors that can affect the inhibition performances. Longer alkyl chains give more effective inhibition properties11,49. Besides, increasing steric hindrance lowers the protective properties of inhibitors. Therefore, in designing these structures and optimized chain length and steric hindrance are expected to have the highest inhibition performance. The compound 6c with the longest chain length has the most remarkable hindrance and inhibitor 6a has the lowest alkyl chain length with the lowest inhibition efficiency among all of them. The compound 6b with an optimized structure can be adsorbed more efficiently showing the highest inhibition efficiencies.

Immersion time and efficiency of corrosion inhibition performance

The inhibitor 6b was the most efficient corrosion inhibitor among the studied ones based on the results. The effect of immersion time on the corrosion inhibition efficiency of the synthesized product inhibitor 6b has been studied after 170 and 340 h immersion of mild steel in the 1 M HCl in the presence of the inhibitors. Accordingly, the Tafel polarization and EIS measurements have been carried out to evaluate the immersion time effect. The corresponding EIS and Tafel polarization results are given in Fig. 4 and the data presented in Table 1 and 42 It is clear that the inhibition efficiency of 6b indicated negligible reduction in inhibition efficiencies at elevated immersion times. After 2 weeks, inhibition efficiency of 6b inhibitor was 95.91%. As is discussed earlier, the created passive layer film prevents corrosion. Cdl after one week negligible increased that is indicate inhibitors molecules slightly replacement by water molecules. The uptake of water and electrolyte ions inside the adsorbed layer can also result in an enhanced conductivity and decreased Rct values at elevated immersion times. Such a significant decrease in Rf and Cf at 340 h can be attributed to the risen conductivity of the inhibitive film and decreased dielectric constant.

Figure 4
figure 4

The effect of different immersion time of mild steel in 1 M HCl media in the presence 2 mM 6b inhibitor: (a) the Nyquist plot and (b) Tafel polarization.

Morphology studies for the metal surface

The SEM images of the mild steel after 24 h immersion in acidic media in the absence of the corrosion inhibitors have been depicted in Fig. S5. Pitting on the surface of the steel is the leading corrosion type. The scale of the created cavity in the surface was about 2 μm at this immersion time. The corrosion inhibition effect of the synthesized 4-ferrocenylbutyl carboxylate esters on the mild steel surface has been inspected with the SEM images in 1 and 10 μm scales and given in Fig. 5. As evident, the 4-ferrocenylbutyl propionate (6b) was more efficient in the corrosion inhibition rather than the other studied 4-ferrocenylbutyl carboxylate esters. Also, the figure shows the formation of a protection layer on the surface of the mild steel in the presence of the inhibitors. The observed images are in good agreement with the EIS and Tafel polarization results. According to SEM images, a multiple layer was formed on the metal substrate, so it is not possible to calculate the thermodynamic parameters.

Figure 5
figure 5

The surface of the mild steel after 24 h immersion in the HCl media with a concentration 1 M at 25 °C in the presence 2 mM of: (a) 6a, (b) 6b and (c) 6c.

The AFM analysis of mild steel in presence and absence of 6b inhibitor are depicted in Fig. 6. The smooth surface of mild steel in presence of inhibitor can be observed. The roughness data including Rp, Ry, Rq, and Ra which are maximum profile peak height, maximum profile valley depth, root mean square (RMS) roughness, and average roughness are represented in Table 3.

Figure 6
figure 6

AFM images of the mild steel after 24 h immersion in the HCl 1 M (a) absence of inhibitor and (b) presence of 2 mM 6b inhibitor.

Table 3 Surface roughness parameters of the mild steel after 24 h immersion in the HCl 1 M in absence and presence of 2 mM 6b inhibitor.

According to AFM data, in presence of 6b inhibitor a smooth surface was obtained and surface of mild steel covered by inhibitor that is indicate formation of protective layer on the surface of metal50,51. The corrosion of mild steel in absence of inhibitor caused to increase surface roughness parameters values1.

DFT results

DFT calculations can offer helpful information about the surface reactivity of mild steel towards 4-butylferrcenyl carboxylate esters. To achieve this goal, dispersion-corrected DFT calculations were used to study how the 4-butylferrcenyl carboxylate esters interact with the active sites on mild steel. First, consider the optimized structure of mild steel discussed here. The top and side views of optimized mild steel, as well as its molecular electrostatic potential (MEP), are shown in Fig. 7. It is seen that the introduction of a carbon impurity causes some structural deformation in the Fe surface (the atomic ratio of iron to carbon is 63:1), but the surface remains planar after full geometry relaxation. The latter is due to the difference in atomic radii between Fe and C atoms (1.40 versus 0.70 Å). Furthermore, the difference in electronegativity between C and Fe atoms produces a nonuniform distribution of atomic charges in the mild steel. Indeed, the MEP analysis indicates that the C atom in mild steel has a negative electrostatic potential, whereas those around it have a positive value (Fig. 7b). These findings clearly show that the addition of a C atom to the Fe surface considerably changes its electronic structure. The C atom in mild steel has a negative charge of − 0.14 |e|, whereas those around it have a positive charge of 0.08 |e|, according to the Hirshfeld analysis. This result, which confirms the MEP analysis discussed above, shows that the Fe atoms around the C atom might be viewed as potential sites for Lewis base interaction.

Figure 7
figure 7

(a) DFT optimized geometry and (b) MEP isosurface (isovalue = 0.20 a.u.) of the mild steel model used in the present study. The most negative and most positive potentials in the MEP map are shown by blue and red regions, respectively.

To compare the adsorption strength of 4-butylferrcenyl derivatives, these systems were allowed to interact with different regions of the mild steel individually. Various initial adsorption configurations were investigated for each system, including those in which the O atoms of adsorbates interact with the surface Fe atoms. After full geometry relaxation, it was observed that 4-butylferrcenyl carboxylate esters prefer to adsorb on the mild surface from their C=O group (Fig. 8).

Figure 8
figure 8

DFT optimized structures (left) and related electron density map (right, isovalue = 0.05 a.u.) of (a) 4-butylferrocene acetate, (b) 4-butylferrocene propionate and (c) 4-butylferrocene butyrate adsorbed onto the mild steel.

Furthermore, the Fe atoms near the C impurity have a greater propensity for interacting with these systems. It should be highlighted that the cyclopentadienyl ring of esters has also a side interaction with the steel surface, as demonstrated by a rather small binding distance (≈ 2.3 Å). Table 4 reveals that the adsorption energies of 4-butylferrcenyl carboxylate esters are − 46.83, − 51.28, and − 50.08 kcal/mol, indicating that the adsorption strength of these systems does not increase with alkyl group length. This may be explained by the fact that, while the alkyl group serves as the electron-donating moiety in 4-butylferrcenyl carboxylate esters, their steric effects should also play a destabilizing role in the formation of these complexes. Thus, among the esters examined here, 4-butylferrocene propionate has the most negative adsorption energy.

Table 4 Calculated Fe–O binding distances (RFe-O, Å), adsorption energies (Eads, kcal/mol) and net charge-transfer (QCT, electrons) values of 4-butylferrcenyl carboxylate esters adsorbed onto the mild steel.

It is worth noting that the adsorption energies are all negative, showing that the adsorption process is exothermic and may occur spontaneously at room temperature. Some electronic charges are also expected to transfer from the 4-butylferrcenyl carboxylate esters into the steel during adsorption. As shown in Table 4, the Hirshfeld analysis demonstrates that about 0.15 electrons are shifted from the 4-butylferrcenyl carboxylate esters into the steel, with the majority of the electrons centered on the Fe atoms surrounding the C. The electron density map depicted in Fig. 8 further supports the chemisorption of the 4-butylferrcenyl carboxylate esters, which shows considerable electron density buildup near the newly formed Fe–O bond.

The frontier molecular orbital (FMO) analysis was performed on the 4-butylferrcenyl carboxylate esters to provide insight on their corrosion inhibition. The highest occupied molecular orbital (HOMO), lowest unoccupied molecular orbital (LUMO) and associated energy gaps of these systems are depicted in Fig. 9. The HOMO of these molecules is found to be mostly centered on the Fe atom of ferrocene moiety and has mostly dz2 character, whereas the LUMO is distributed mainly on the cyclopentadienyl rings. As the length of alkyl group increases, both the HOMO and LUMO are stabilized and their energy becomes more negative. Note that the amount of stabilization in the LUMO is larger than that of HOMO, hence the HOMO–LUMO energy gap varies as –R=–CH3 > –C3H7 > –C2H5. Because a lower energy gap between the HOMO and LUMO corresponds to less kinetics stability52, it is concluded that, in addition to its larger adsorption energy and higher charge-transfer, superior corrosion inhibition of 4-butylferrocene propionate could be related to a lower HOMO–LUMO energy gap.

Figure 9
figure 9

The HOMO, LUMO and energy gap values of the optimized (a) 4-butylferrocene acetate, (b) 4-butylferrocene propionate and (c) 4-butylferrocene butyrate molecules.

Conclusion

In the presented study, three 4-ferrocenylbutyl acetate, propionate, and butyrate esters have been synthesized and used as corrosion inhibitor of the mild steel in HCl media. In this respect, electrochemical analysis, including EIS and Tafel polarization behavior of the mild steel in the presence of the synthesized products, has been carried out. The results show that the 4-ferrocenylbutyl propionate has the best corrosion inhibition behavior among the synthesized esters with 96% corrosion inhibition efficiency. Also, it has been shown that after two-week immersion of mild steel in 1 M HCl, the efficiency of the corrosion inhibition of the 4-ferrocenylbutyl propionate is acceptable. The SEM results show that the inhibition mechanism is based on creating a passive layer on the surface of the steel. Based on the DFT calculations, the 4-butylferrcenyl carboxylate esters are chemisorbed on the Fe atom of steel located around the C impurity. The superior corrosion inhibition of 4-butylferrocene propionate can be related to its larger adsorption energy and charge-transfer as well as lower HOMO–LUMO energy gap.