Introduction

Steel is a widely used material in oil and gas transportation, mechanical engineering, etc. (Shamsa et al. 19; Lin et al. 13). During use, the surface of steel is oxidized to produce rust, which is often removed in industry by using acidic solutions to dissolve the rust into soluble salts (Hossain et al. 7). In various pickling processes, the main problem is the low corrosion resistance of steel to acidic solutions, resulting in steel corrosion (Seter et al. 18). Corrosion inhibitors are widely used for steel mitigation in pickling processes due to their low cost, high efficiency, and ease of use (Fateh et al. 4; Messaoudi et al. 14). Most traditional corrosion inhibitors are compounds containing heteroatoms (nitrogen, phosphorus, and sulphur), which have problems such as high toxicity, poor stability, poor biodegradability, and can cause serious pollution to the environment (Joshi et al. 10). Tradition corrosion inhibitors tend to emit a pungent smell during use, which can have a certain negative impact on human psychology and physiology. Therefore, developing human and environmentally friendly corrosion inhibitors has become a hot spot for corrosion inhibitor research.

Ionic liquids (ILs) are a class of substances consisting of organic cations and organic or inorganic anions, which have weak biological toxicity, good thermal stability, low volatility, are generally colorless and odorless, and are not harmful to humans or the environment. ILs have been used in various studies, being employed as supercapacitors, catalysts, and corrosion inhibitors (Palomar-Pardavé et al. 15). The anions of ILs have a great influence on their corrosion-inhibition performance, especially halogen anions, which are usually added to the main inhibitor as synergists to improve its corrosion-inhibition performance.

In this study, the method for research used by a weight loss method, electrochemical method, morphology test, and quantum computing research. The chemical properties of Br, BF4 and PF6 in the anionic pyridinium bromides IL N-butyl-4-methylpyridine (B4MePyBr), N-butyl-4-methylpyridinium tetrafluoroborate (B4MePyBF4), and N-butyl-4-methylpyridinium hexafluorophosphate (B4MePyPF6) have been investigated and their corrosion inhibition of N80 steel in hydrochloric acid has been determined. The corrosion-inhibition behavior of the corrosion inhibitors was further investigated using gravimetric and electrochemical testing techniques. The surface morphology of N80 steel with and without the addition of corrosion inhibitors was observed using scanning electron microscopy (SEM) and atomic force microscopy (AFM). The results showed that the maximum corrosion inhibition efficiency was 87.1% when the concentration of B4MePyBF4 reached 10.0 mmol L−1, and its mechanism was investigated.

Experimental

Preparation of materials

N80 steel was purchased from China Keli Corrosion Test Sheet Company. B4MePyBr, B4MePyBF4, and B4MePyPF6 were purchased from China Shanghai Chengjie Chemical Co, the chemical formulas of which are shown in Fig. 1. Before each test, N80 steel samples with dimensions of 5 cm × 1 cm × 0.3 cm were polished with sandpaper (400, 800, 1200, 2000 grit), washed ultrasonically with distilled water and anhydrous ethanol, and finally dried at 298 K for 1 h. For the electrochemical experiments, the above procedure was also followed, where the working electrode was an N80 steel sample with dimensions of 1 cm × 1 cm × 1 cm which was set in epoxy resin. All tests were carried out using a constant temperature water bath at 298 K ± 1.0 K and were performed three times to obtain good reproducibility.

Fig. 1
figure 1

Chemical structure formulas of the three corrosion inhibitors a B4MePyBr. b B4MePyBF4. c B4MePyPF6

Electrochemical tests

Electrochemical tests were carried out using a Crestec CS2350 electrochemical workstation (China) in a three-electrode-type glass vial with a solution volume of 1 L. A test electrode was used as the working electrode (WE) with a test surface area of 1 cm2. The saturated calomel electrode was the 217–01 model reference electrode from China Shanghai Precision Scientific Instrumant Co., Ltd.. Platinum electrodes were used as counter electrodes (CE) and the electrodes were squares with a surface area of 1 cm2 (1 cm × 1 cm). The temperature was controlled at 298 K ± 1.0 K. The electrodes were tested at open circuit potential (OCP) for 1,800 s to reach a steady state before each test. The electrochemical impedance spectra (EIS) were measured at OCP and perturbed with a 5 mV sine wave in the frequency range 0.1 Hz to 100 kHz. The measurements were then fitted using the ZSimpWin software to obtain the EIS parameters. The corresponding corrosion-inhibition efficiency η was obtained with Eq. (1) (Gómez-Sánchez et al. 6):

$$\eta = \frac{{R{\text{ct}}({\text{inh}}) - R{\text{ct}}}}{{R{\text{ct}}({\text{inh}})}} \times 100\%$$
(1)

where Rct and Rct(inh) are the charge transfer resistance with and without the addition of a corrosion inhibitor (units of Ω cm2), respectively.

Finally, the action potential polarization was tested within the potential range ± 250 mV relative to OCP, and the scanning rate was 0.5 mV s−1. The corresponding inhibition efficiency, η', was calculated by via Eq. (2):

$$\eta ^{\prime} = \frac{{I{\text{corr}} - I{\text{corr}}({\text{inh}})}}{{I{\text{corr}}}} \times 100\%$$
(2)

where Icorr and Icorr(inh) are the self-corrosion current density with and without a corrosion inhibitor, respectively, in units of mA cm−2.

Weight loss test

The prepared N80 steel was weighed and immersed in a solution of 1 mol L−1 HCl with and without different concentrations (1.0, 2.5, 5.0, and 10.0 mmol L−1) of corrosion inhibitor at 298 K ± 1.0 K for 4 h. The corrosion products were then removed and washed with ethanol ultrasonically, and the dried samples were finally weighed. Each set of experiments was repeated three times. The corrosion rate, v, surface coverage, θ, and corrosion-inhibition efficiency, η”, were obtained from the mass change of the samples before and after immersion, respectively calculated by Eqs. (3), (4), and (5) (Qiang et al. 16):

$$v = \frac{w}{St}$$
(3)
$$\theta = \frac{v_0 - v}{{v_0}}$$
(4)
$$\eta^{\prime\prime } = \frac{v_0 - v}{{v_0}} \times 100\%$$
(5)

where w is the weight loss before and after corrosion (units of g), S is the surface area of the sample (units of cm2), t is the soaking time (units of h), and v0 and v and the corrosion rates of samples with and without corrosion inhibitors (units of g m−2 h−1), respectively.

Surface morphology test

Each prepared N80 steel sample was weighed at 298 K ± 1.0 K and soaked in a 1 mol L−1 HCl solution without or with 10 mmol L−1 of corrosion inhibitor for 4 h. After drying, the surface morphology of each sample was observed by SEM and AFM.

Results and discussion

Electrochemical test

Figure 2 shows the AC impedance spectra of the N80 steel with and without a corrosion inhibitor at different concentrations in a 1 mol L−1 HCl solution at 298 K. ZSimpWin was used to fit the data, and Table 1 shows the best-fitting results, where Rs is the solution resistance, CPE and Q are constant phase angle elements, Rct is the charge transfer resistance, Rt is the inductive resistance, and zCPE can be expressed by Eq. (6) (Abdallah et al. 1; Iravani et al. 8):

$$Z_{{{\text{CPE}}}} = \frac{1}{{Y_{0} (jw)^{n} }}$$
(6)

where Y0 is the value of the CPE (units of S sn cm2), n is the dispersion effect index, which ranges from − 1 < n < 1, j is an imaginary unit, and ω (units of Hz) is the angular frequency.

Fig. 2
figure 2

AC impedance spectra of the N80 steel at 298 K in a 1 mol L−1 HCl solution with and without different concentrations of corrosion inhibitors. a B4MePyBr:Nyquist spectrum and equivalent circuit diagram. b B4MePyBr: Bode spectrum. c B4MePyBF4: Nyquist spectrum. d B4MePyBF4: Bode spectrum. e B4MePyPF6: Nyquist spectrum. f B4MePyPF6: Bode spectrum

Table 1 Impedance spectrum: best-fitting parameters of the N80 steel in a 1 mol L−1 HCl solution with and without different concentrations of corrosion inhibitors

A double layer capacitor, Cdl, is usually used to fit an electrochemical impedance spectrum, which has also been adopted in this work. According to the values of Y0 and n, the double layer capacitor, Cdl, can be expressed by Eq. (7) (Galai et al. 5; Afshari et al. 2):

$$C_{{{\text{dl}}}} = Y_{{0(w)}} {{^{{n - 1}} }} = Y_{0} (2\pi f_{{{\text{Zim}} - {\text{Max}}}} )^{{n - 1}}$$
(7)

where fZim-Max is the frequency at the maximum value of the imaginary part of the impedance spectrum.

From the Nyquist spectra in Fig. 2, it can be seen that the radius of the capacitive arc increases significantly with increasing corrosion inhibitor concentration, and the larger the radius, the greater the corrosion resistance of the metals in the system.The impedance characteristics of the three corrosion inhibitors remain essentially the same and show an imperfect semicircle. This may indicate that the corrosion process in this system was controlled by charge transfer, which may be due to the roughness and inhomogeneity of the metal surface. It can be seen from the Bode plots that for all three corrosion inhibitors, the mode value and phase angle increased with an increase of the added corrosion inhibitor concentration.

The results of fitting the equivalent circuit showed that with an increase of corrosion inhibitor concentration, the electrode increased the charge transfer resistance, Rct. With the increasing adsorption of corrosion inhibitor on the electrode surface, the charge transfer resistance gradually increases. This inhibits the corrosion of N80 steel and slows down the corrosion rate.

According to the Helmholtz model, the expression of the double-layer capacitor, Cdl, can be expressed by Eq. (8) (Li et al. 12; Jiang et al. 9):

$$C{\text{dl}} = \frac{{\mathop {\varepsilon \varepsilon }\nolimits^{0} }}{d}S$$
(8)

where ε0 and ε are the air dielectric constant and the local dielectric constant of the electric double layer(units of F m−1), respectively, S is the surface area of the electrode (units of cm2), and d is the double electric layer thickness(units of cm).

Contrary to the change of the charge transfer resistance, Rct, the electric double layer capacitance, Cdl, decreased with an increase of corrosion inhibitor concentration. This was due to the corrosion inhibitor molecules adsorbing on the surface of the electrode, which replaced water molecules. The dielectric constant of the organic molecules was smaller than that of the water molecules, and the volume of the former was larger than that of the latter. These two phenomena led to a decrease of the local dielectric constant of the double layer, ε, and the electric double layer thickness, d, increased. Obviously, the more corrosion inhibitor molecules that were adsorbed, the more the double layer capacitance, Cdl, decreased.

Figure 3 shows polarization curves of the N80 steel at 298 K with and without different concentrations of corrosion inhibitors in a 1 mol L−1 HCl solution. Table 2 shows the self-corrosion potential (Ecorr), self-corrosion current density (icorr), anode Tafel slope (βa), cathode Tafel slope (βc), and corrosion-inhibition efficiency (\({\eta }^{,,}\)) under such conditions. It can be seen that the self-corrosion current density decreased significantly with an increase of the corrosion inhibitor concentration. With an increase of the corrosion inhibitor concentration, the coverage of the adsorption layer that formed on the surface of the N80 steel increased, and more molecules were adsorbed on the surface. This in turn inhibited the amount of reactions in the active zone and slowed-down the corrosion rate. After the addition of the corrosion inhibitors, the corrosion potential underwent different degrees of positive shift that were less than 85 mV. so, these three types of corrosion inhibitors were types of mixed corrosion inhibitors (Wang et al. 21).

Fig. 3
figure 3

Polarization curves of the N80 steel with and without corrosion inhibitors at 298 K in a 1 mol L.−1 HCl solution. a B4MePyBr. b B4MePyBF4. c B4MePyPF6

Table 2 Electrochemical parameters of the N80 steel in a 1 mol L−1 HCl solution with and without different concentrations of corrosion inhibitors fitted by polarization curves

Among the three corrosion inhibitors, B4MePyBF4 shows more significant changes in the weakly polarized region, whereas the remaining two inhibitors do not show significant changes in this region. All three corrosion inhibitors overlapped with the blank curve in the polarized region, indicating that the corrosion inhibitors desorbed in the strongly polarized region. In contrast, the curve in the cathodic region is significantly shifted toward lower current density, which indicates that the inhibition of the cathode by the corrosion inhibitor is greater. Especially B4MePyBF4, which has the greatest inhibitory effect on the cathode. The trend of corrosion inhibition efficiency is B4MePyBF4 > B4MePyBr > B4MePyPF6 when the addition concentration is mmol·L−1, which indicates that BF4 as an anionic pyridinium inert ion has a better corrosion inhibition performance, and the corrosion inhibition performance is better for N80 steel.

Weight loss test

Table 3 shows the weight loss results of the N80 steel soaked for 4 h in a 1 mol L−1 HCl solution with and without different concentrations of corrosion inhibitors (1.0, 2.5, 5.0, and 10.0 mmol·L−1) at 298 K. The results showed that the inhibition efficiency of the three corrosion inhibitors increased with increasing concentration. The corrosion inhibition efficiencies of the three ILs reached more than 80% at a concentration of 10.0 mmol·L−1. At the same concentration, the corrosion inhibition efficiency of B4MePyBF4 was better than that of B4MePyBr and B4MePyPF6. This indicated that the pyridine-based ILs with BF4ˉas an anion had better corrosion-inhibition performance. This is consistent with the results of the previous electrochemical tests. The loss-in-weight method yields a more efficient corrosion inhibition because the results from the loss-in-weight method are averaged over 4 h of testing, whereas the electrochemical testing yields instantaneous values.

Table 3 Weight loss results of the N80 steel in a 1 mol L−1 HCl solution with three corrosion inhibitors in different concentrations

Surface morphology characterization

Figure 4 shows SEM and AFM plots of the N80 steel at 298 K after soaking for 4 h in a 1 mol L−1 HCl solution with and without a 10 mmol L−1 corrosion inhibitor. Table 4 shows the roughness values measured in this case. It can be seen that the surfaces of the samples after 4 h of soaking without corrosion inhibitor were disordered and corroded severely, showing severe corrosion patterns. After the addition of a corrosion inhibitor, the amount of surface corrosion was significantly reduced. There are only a handful of tiny corrosion lines and pits, many of which were visible before immersion, which are likely to be caused by polishing. This indicated that the corrosion inhibitors could effectively adsorb onto the surface of the samples, which provided a certain inhibitory effect on reducing corrosion of the N80 steel.

Fig. 4
figure 4

Surface morphology characterization of the N80 steel at 298 K in a 1 mol L−1 HCl solution with no added corrosion inhibitor, and a 10 mM corrosion inhibitor for 4 h. a SEM image without corrosion inhibitor. b SEM for added B4MePyBr. c SEM image for added B4MePyBF4. d SEM image for added B4MePyPF6. e AFM diagram without a corrosion inhibitor. f AFM diagram for added B4MePyBr. g AFM diagram for added B4MePyBF4. h AFM diagram for added B4MePyPF6

Table 4 Quantum chemistry computed relevant parameters

In order to better observe the adsorption of the corrosion inhibitor on the surface of the carbon steel, the surfaces of carbon steel specimens after corrosion soaking were tested using AFM. It can be seen that the carbon steel surface was severely corroded without the addition of corrosion inhibitor, showing a porous structure with large and deep corrosion holes and a surface roughness of 116 nm. As shown in Fig. 4(f, h), the surface roughness of carbon steel was significantly reduced to 30.6 nm, 38.2 nm, and 23.7 nm with the addition of corrosion inhibitors B4MePyBr, B4MePyBF4, and B4MePyPF6, respectively. These values show that the corrosion inhibitor adsorbed effectively on the carbon steel surface and the adsorption film layer was very tight and covered the entire carbon steel surface. Thus, the corrosion inhibitors effectively inhibited corrosion, so that the corrosion rate was reduced.

Theoretical calculations

To further explore the relationship between the molecular structure of the ILs and their corrosion-inhibition performance, four kinds of ILs were geometrically optimized using the def2-SVP basis group according to the M06-2X functional method in density functional theory (DFT). The lowest unoccupied molecular orbital energy (ELUMO), highest unoccupied molecular orbital energy (EHOMO), energy level difference (ΔE = ELUMO—EHOMO), and dipole moment (μ) of each ILs was obtained (Ramos et al. 17; Wang et al. 22), and their chemical parameters are listed in Table 4. The optimized molecular structure and frontier orbital distribution are shown in Fig. 5.

Fig. 5
figure 5

Optimal models and LUMO and HOMO level distributions of the three IL corrosion inhibitors. a B4MePyBr, b B4MePyBF4, and c B4MePyPF6

For the three kinds of ILs with different anions, ELUMO increased in the order of B4MePyBF4, B4MePyBr, and B4MePyPF6, but EHOMO decreased in this order, indicating that B4MePyBF4 had the strongest inhibition effect on metal corrosion, which is consistent with the results of the previous tests. The values of B4MePyPF6 and B4MePyBr were very small, indicating that they had little effect on the corrosion inhibition of metal in this system.

Figure 5 shows that the LUMO electron clouds of the three kinds of pyridine-based ILs were mainly distributed on the pyridine ring, while the electron orbit distribution diagram of the Fe atom was [Ar]4s23d6 (Claudino et al. 3). The 4 s orbit was filled with electrons, while the 3d orbit was not filled with electrons. This may indicate that the pyridine ring could preferentially accept electrons provided by Fe to form feedback bonds, thus allowing the ILs to adsorb on the iron surface. The distribution of the HOMO electron clouds was mainly concentrated on the pyridine ring and anion, while the distribution of the alkyl chain was less concentrated. This may indicate that in the IL adsorption process, the pyridine ring and anion provided electrons, which combined with the 3d orbital of the Fe atom to form coordination bonds and adsorb on the metal surface (Vassetti et al. 20; Lazrak et al. 11).

Conclusions

The main conclusions of this study are summarized in the following.

  1. (1)

    B4MePyBr, B4MePyBF4, and B4MePyPF6 had corrosion inhibition and protection properties for N80 steel under acidic conditions. The weight loss and electrochemical methods showed that the three corrosion inhibitors were mixed corrosion inhibitors, and their corrosion-inhibition efficiency increased with an increase of additive concentration. When the concentration of B4MePyBF4 reached 10.0 mmol·L−1, the maximum corrosion-inhibition efficiency was 87.1%.

  2. (2)

    Anions had a great effect on the corrosion-inhibition performance of IL corrosion inhibitors, with BF4 > Br > PF6. Quantum calculations showed that B4MePyBF4 had the minimum ΔE value when it was in the optimal molecular configuration, and had a high corrosion inhibition for metals; this result echoes those obtained with the corrosion-inhibition tests. The LUMO electron cloud was mainly concentrated on the pyridine ring, and the HOMO electron cloud was concentrated on the pyridine ring and anion, which formed a feedback bond and coordination bond with Fe, respectively, resulting in the formation of an adsorption film on N80 steel surface. These also explain why the three ILs corrosion inhibitors have good anticorrosion effects.