Introduction

In oil and gas fields, solutions of acids like sulfuric, nitric, hydrochloric and phosphoric are extensively used in industrial processes like oil well acidification, acidic cleaning, and pickling, which lead to serious metal corrosion [1]. In oil and gas plants, metal equipment such as vessels, storage tanks, distillation towers, and chillers get fouled by both inorganic and organic substances from different corroding metals, lubricating oils, and deposits from hard water, so periodic cleaning is necessary to prevent damage and maintain normal operation efficiency [2]. The metal chemical cleaning process in the oil and gas industry is advantageous in comparison with mechanical cleaning methods, primarily because there is no need to dismantle or reassemble metal equipment to be cleaned [3].

Carbon steel alloys have been widely used as construction materials in oil and gas production plants in equipment such as flow lines, transmission pipelines, and down-hole tubular components [4].

Organic compounds, such as surfactants and Schiff bases, are used to prevent corrosion in acidic environments [5]. Both ionic and non-ionic surfactants have been reported to inhibit the corrosion of metals such as copper, aluminum, and mild steel [6, 7]. Compounds containing aromatic rings, nitrogen, phosphorus, sulfur, and oxygen are the most efficient inhibitors for carbon steel structures in acidic media [8]. These compounds donate a lone pair of electrons, so they are strongly adsorbed onto the metal surface, and form a compact barrier film by replacing water molecules from the surface [9].

The aim of this work was to investigate the metallic corrosion inhibition of the three synthesized cationic surfactants IV(4N), II(4N) and I(4N) in 1 M HCl solution on carbon steel using weight loss and electrochemical techniques. Surface properties like the critical micelle concentration (CMC), surface area per molecule (A min) and molar surface density (Γ max) were derived from surface tension measurements, and thermodynamic parameters of adsorption were then calculated. The relation between surface properties and inhibition efficiency for the corrosion process of the prepared surfactants are also discussed.

Materials and Experimental Techniques

Synthesis of Cationic Surfactants

Cationic surfactants in this study were synthesized through two steps. The first step is formation of the Schiff base by a condensation reaction between N 1,N 1′-(ethane-1,2-diyl)bis(ethane-1,2-diamine) with isonicotinaldehyde in a 1:2 molar ratio to produce N 1-((Z)-4-(pyridin-4-yl)but-3-en-1-yl)-N 2-(2-((E)-(pyridin-4-ylmethylene)amino)ethyl)ethane-1,2-diamine [10]. The reactants were refluxed in 50 ml ethanol for 4 h. The initial product was left to cool to room temperature.

The second step is the formation of the cationic surfactant by quaternization of the produced Schiff base with dodecyl bromide for 72 h in molar ratios of 1:1, 1:2 and 1:4 to produce I(4N), II(4N) and IV(4N), respectively. The surfactants were recrystallized twice from ethanol. The chemical structures of the Schiff base and prepared cationic surfactants (Fig. 1) were confirmed by IR, 1H-NMR and mass spectroscopy.

Fig. 1
figure 1

The chemical structure of the synthesized cationic surfactants

Carbon Steel

Carbon steel with composition (wt%): 0.19 % C, 0.05 % Si, 0.009 % P, 0.004 % S, 0.014 % Ni, 0.034 % Al, 0.016 % V, 0.003 % Ti, 0.009 % Cr, 0.94 % Mn, 0.022 % Cu, balance of alloy as Fe, were mechanically polished with different emery paper grades (180–1200). They were cleaned with acetone and distilled water and dried.

Surface Tension Measurements

Surface tension measurements (see Supplementary materials) were performed as previously described [11].

Electrochemical and Weight Loss Measurements

Weight loss and electrochemical experiments which involved potentiodynamic polarization and EIS were carried out as described in (Supplementary materials) [11].

Results and Discussion

Chemical Structure Confirmation

Chemical Structure Confirmation of Schiff Base

As shown in (Supplementary material, Fig. 1), the mass spectrum of the Schiff base N 1,N 1′-(ethane-1,2-diyl)bis(N 2-(pyridin-4-ylmethylene)ethane-1,2-diamine), confirms the proposed formula of the compound by showing a peak at m/z 324 (21.06 %) belonging to the molecular ion (parent peak). The series of peaks at 163 (100 % NC5H4CH=N(CH2)2NHCH3) as base peak was observed together with other significant peaks at 106 (55.59 % NC5H4CH=NH), 149 (8.81 % NC5H4CH=N(CH2)2 NH2), 205 (10.46 % NC5H4CH=N(CH2)2NH(CH2)2NHCH2) and 246 (9.14 % NC5H4CH=N(CH2)2NH(CH2)2NH(CH2)2N=CH). FTIR characteristic bands of Schiff base are listed in Table 1. The data obtained from the spectra of FTIR, confirm the expected functional groups in the Schiff base.

Table 1 FTIR bands of the synthesized Schiff base and cationic surfactants

Chemical Structure Confirmation of the Synthesized Cationic Surfactants

The synthesized cationic surfactants’ FTIR characteristic bands are listed in Table 1. The FTIR spectra (Supplementary material, Fig. 2) confirm the expected functional groups in the synthesized surfactant IV(4N).

1H-NMR characteristic peaks of the synthesized surfactants are listed in Table 2. The data of 1H-NMR spectra (Supplementary material, Fig. 3) confirm the expected hydrogen proton distribution in the synthesized surfactant IV(4N).

Table 2 1H-NMR peaks of the synthesized cationic surfactants

Surface Tension Activity

On a plot of surface tension (γ) against logarithm concentration (−logC) of the three cationic surfactants, Fig. 2, surface tension decreased linearly with the increase in logarithm of the concentration of the cationic surfactants, This can be used to provide surface excess concentration, which is then used to determine the effectiveness and area per molecule at air–water interface [12]. The CMC data from the break point in the plots of (γ −logC) are shown in Table 3. The increase in the number of the hydrocarbon chains leads to lowering CMC values; this is an expected result due to the hydrophobic effect [13, 14].

Fig. 2
figure 2

Variations in surface tension with concentration of the synthesized cationic surfactant in bidistilled at 25 °C

Table 3 Critical micelle concentration (CMC), effectiveness (π cmc), maximum surface excess (Γ max) and minimum surface area (A min) of the synthesized cationic surfactants from surface tension measurements at 25 °C

The minimum surface area value per molecule, A min, is listed in Table 3. A min values of these surfactants decreased with increasing carbon chain numbers; this can be attributed to the decrease in surface excess concentration due to the increase in the surfactant molecular size [15]. The surface pressure values (π cmc) for the three synthesized surfactants are listed in Table 3. By increasing the hydrocarbon chain numbers, the effectiveness values (π cmc) increased, and these phenomena could be due to the surfactant hydrophobicity in aqueous media [16].

Electrochemical Impedance Spectroscopy (EIS)

Carbon steel Nyquist plots in 1 M HCl solution without and with various concentrations of cationic surfactant IV(4N) are represented in Fig. 3a and other surfactants II(4N) and I(4N) in Supplementary materials, Fig. 4. All the obtained Nyquist plots have a semicircular shape with diameter changed according to the concentration and type of the synthesized surfactants. The carbon steel impedance response in the blank solution (1 M HCl) has not markedly changed after the addition of the investigated surfactants into the corrosive solutions. These semicircles showed a depression in the Nyquist plot which is caused by the frequency dispersion due to non-homogeneity and/or roughness of the metal surface [17].

Fig. 3
figure 3

a Nyquist plots of carbon steel in 1 M HCl solutions without and with different concentrations of inhibitor IV(4N). b The Bode and phase angle plots of carbon steel in 1 M HCl solutions without and with various concentrations of inhibitor IV(4N)

Fig. 4
figure 4

Anodic and cathodic polarization curves obtained at 25 °C in 1 M HCl in different concentrations of inhibitor IV(4N)

EIS curves were fit using the ZSimpWin program. The proposed equivalent circuit consists of one constant phase element defined by Y o, a coefficient n, solution resistance (R s), and polarization resistance (R p), which corresponds to the diameter of Nyquist’s plot. R p includes charge transfer resistance (R ct), diffuse layer resistance (R d), resistance from adsorption of the accumulated species at the metal/solution interface (R a) and the resistance of the inhibitor film at the steel surface (R f) (R p = R ct + R d + R a + R f) [18]. The coefficient n can characterize physical phenomena such as impurities, inhibitor adsorption, surface inhomogeneous resulting from surface roughness, and porous layer formation [19, 20]. For n = 0, Z CPE represents a resistance with R = Y −1o , for n = 1 a capacitance with C = Y o, for n = 0.5 a Warburg impedance with W = Y o and for n = −1 an inductive with L = Y −1o [20]. The value of n is between 0.74 and 0.84 (0 < n < 1). This deviation from unity (the ideal capacitive behavior) is due to double layer capacitance (C dl) replaced by CPE in order to give a more accurate fit to the experimental results [20].

Figure 3b shows the effect of surfactant concentration on the impedance response of carbon steel in 1 M HCl solution at 20 °C. Figure 3b also shows that the depression of phase angle at relaxation frequency decreases with increasing surfactant concentration, which indicates the increasing of the capacitive response and leads to decreasing corrosion. Simulation of Nyquist and Bode diagrams with (Fig. 3a, b) for mono, di, tetra-cationic surfactants are shown in Supplementary materials, Fig. 6. The impedance parameters obtained by fitting the EIS data to the equivalent circuit and the inhibition efficiency percentage (η, %) are listed in Table 4. Table 4 shows that the CPE values decrease and the R p values increase with increasing inhibitor concentration. This behavior is seen for a system where the inhibition occurred due to the formation of a surface film by adsorption of inhibitor on the metal surface [20]. Decreased CPE values, which can result from an increase in the electrical double layer thickness and/or the decrease of local dielectric constant, suggest that the inhibitor molecules act by adsorption at the metal/solution interface. It was found that the sequence of the inhibitor efficiencies followed the order: IV(4N) > II(4N) > I(4N).

Table 4 EIS parameters for the corrosion of carbon steel in 1 M HCl in absence and presence of different concentrations of the synthesized surfactants at 25 °C

Potentiodynamic Polarization

The polarization behavior of carbon steel in 1 M HCl in the absence and presence of different concentrations of surfactant IV(4N) at 20 °C is represented in Fig. 4 and for surfactants II(4N) and I(4N) in Supplementary materials, Fig. 6. The values of anodic Tafel slope (β a), cathodic Tafel slope (β c), corrosion current density (i corr) and corrosion potential (E corr) were calculated and are listed in Table 5. We can see from Table 5 that, β a and β c values do not show marked changes and these results reveal that the corrosion reaction mechanism does not change for both anodic and cathodic reactions. From Fig. 4, we can see that, the corrosion potential (E corr) curves are slightly shifted to both positive and negative directions in the presence of the prepared surfactants, which reveal that these surfactants act as a mixed type inhibitor [21].

Table 5 Potentiodynamic polarization parameters for the corrosion of carbon steel in 1 M HCl in the absence and presence of different concentrations of the synthesized surfactants at 25 °C

The results of inhibition efficiencies for the tested surfactants (η p) were calculated from the corrosion current density (i corr) in the absence and presence of different concentration of inhibitor and are listed in Table 5. These results show that, by increasing the surfactant concentrations, η p increases whereas i corr decreases. This can be related to the adsorption of the inhibitor over both the anodic and cathodic active corroded surfaces. The increase in efficiency of corrosion inhibition of the studied inhibitors indicates that these surfactants have excellent adsorptive properties for the metal surface.

Weight Loss

Effect of the Concentration and Temperature on the Corrosion Rate

The corrosion rate values of carbon steel with and without addition of the tested surfactants in 1 M HCl at various temperatures are listed in Table 6. The data listed in Table 6 reveal that, by increasing the concentration of the surfactant, the corrosion inhibition efficiency increases (i.e., the corrosion rate values decrease). This behavior is due to the adsorption ability of the surfactant molecules over the metal surface. In Table 6, the data showed that, the steel corrosion rate increases with increasing the temperature for both blank and inhibited solution, and it increases more rapidly in the absence of the inhibitors. These results revealed that the synthesized surfactants are good inhibitors in the studied temperature ranges.

Table 6 Weight loss results for carbon steel in 1 M HCl without and with different concentrations of the synthesized surfactants at various temperatures

Effect of the Inhibitor Concentration and Temperature on Corrosion Inhibition Efficiency

The inhibition efficiency values for carbon steel in 1 M HCl in the presence and absence of different inhibitor concentrations at different temperatures are given in Table 6. By increasing inhibitor concentration, the inhibition efficiency (η w) increases. The maximum inhibition efficiency for corrosion process for all compounds was obtained for 1 × 10−3 M concentration. The inhibition efficiency decreases with increasing temperature. This behavior is due to desorption of inhibitor molecules on the carbon steel surface with increasing temperature. The surfactant inhibition efficiencies for the corrosion process follow the following order:

$$ {\text{IV}}\left( {4{\text{N}}} \right) > {\text{II}}\left( {4{\text{N}}} \right) > {\text{I}}\left( {4{\text{N}}} \right) $$

The conclusions from the weight loss measurements were consistent with those obtained from potentiodynamic polarization and EIS techniques.

Adsorption Isotherm

It is well recognized that the first step in inhibition of metallic corrosion is the adsorption process of organic inhibitor molecules at the metal/solution interface. The adsorption process depends on the electrochemical potential at the metal/solution interface, the molecule’s chemical composition and the temperature. Solvent molecules (e.g., H2O) could also adsorb at the metal/solution interface. So the organic inhibitor adsorption process can be regarded as a quasi-substitution process between water molecules at the electrode surface [H2O(ads)] and the organic compounds in the aqueous phase [Org(sol)] as represented in Eq. (1):

$$ {\text{Org}}_{{ ( {\text{sol)}}}} + x{\text{H}}_{2} {\text{O}}_{{ ( {\text{ads)}}}} \leftrightarrow {\text{Org}}_{{ ( {\text{ads)}}}} + x{\text{H}}_{2} {\text{O}}_{{ ( {\text{sol)}}}} $$
(1)

where x is the size ratio, that is, the number of water molecules replaced by one organic inhibitor molecule.

Plotting of C/θ versus C (Langmuir’s adsorption plots) gave a straight line. Each straight line intercept was equal to the reciprocal of the binding constant (Supplementary materials, Fig. 7). Binding constant values, (K ads), listed in Table 7, demonstrate that binding constants decrease with increasing temperature.

Table 7 Standard thermodynamic parameters of adsorption on carbon steel surface in 1 M HCl containing the synthesized cationic surfactants at various temperatures

Standard Thermodynamic Adsorption Parameters

The calculated \( \Delta G_{\text{ads}}^{^\circ } \) values in Table 7 range between −37.9 and −42.2 kJ mol−1. This revealed that both chemical and physical adsorptions took place [22]. Results listed in Table 7 showed that, \( \Delta G_{\text{ads}}^{^\circ } \) values decreased with increasing temperature, which indicating that the inhibitor adsorption process is more spontaneous with increased temperature. A plot of ln K ads versus 1/T yielded a straight line, according to [Supplementary materials, Eq. (14)], with a slope equal to \( \Delta H_{\text{ads}}^{^\circ } /R \). The negative values of \( \Delta H_{\text{ads}}^{^\circ } \) in Table 7, indicates that adsorption exothermic [2325]. In an exothermic process, chemisorption is distinguished from physisorption by the absolute value of \( \Delta H_{\text{ads}}^{^\circ } \). For the chemisorption process, values approach 100 kJ mol−1; while, for the physisorption process, it is normally <40 kJ mol−1. The \( \Delta H_{\text{ads}}^{^\circ } \) values range between (−11.1 and −23.7) kJ mol−1 indicative that only physical adsorption occurred. The obtained values of \( \Delta S_{\text{ads}}^{^\circ } \) are listed in Table 7. \( \Delta S_{\text{ads}}^{^\circ } \) values are positive which indicated spontaneous adsorptive ability of inhibitor molecules at the metal surface [26].

Mechanism of Inhibition

The adsorption mechanism can be classified into three categories: purely physical, purely chemical or a mixture of physical and chemical adsorption mechanisms. The investigated cationic surfactants contain different adsorption centers on the metal surface such as conjugated benzene rings, hetero atoms (N), unsaturated azomethine bonds (–C=N–) and positively charged centers (N+). In physical adsorption, the electrostatic interaction between the charged inhibitor molecule and the charged metal surface help the inhibitor molecules to be adsorbed on the metal surface. While in the chemical adsorption, the donor acceptor interactions arises from the presence of π-electrons of multiple bonds, free electron pairs of hetero atoms, pyridine group with vacant d-orbitals of iron surface atoms [27]. However, the adsorption free energy values were <−42.2 kJ mol−1 indicating the physical adsorption of the synthesized cationic surfactant took place, concurring with the conclusion from the enthalpy calculations above.

In the strong acid solutions (such as 1 M HCl), the negative charges of the steel surface enable the positively charged inhibitor molecules to approach the surface due to electrostatic attraction. The higher the molecular weight and the larger the size of the cationic surfactant molecules is the greater inhibition efficiency of the studied cationic surfactant.

The investigated inhibition efficiency values of the cationic surfactants were found to follow this order in 1 M HCl solution:

$$ {\text{IV}}\left( {4{\text{N}}} \right) > {\text{II}}\left( {4{\text{N}}} \right) > {\text{I}}\left( {4{\text{N}}} \right) $$

Experimental data revealed that the most efficient cationic surfactant was IV(4N) which can be attributed to the molecular structure effect, because its longer fatty alkyl chain more than the others so, thus its concentration at the interface is larger than other studied cationic surfactants.

By making a comparison of the compounds of this study with other results in the literature [2830], Table 8, we can see that, our compounds have excellent behavior as corrosion inhibitors for carbon steel in 1 M HCl.

Table 8 Some cationic surfactants investigated as corrosion inhibitors by other authors for carbon steel in 1 M HCl and cationic surfactant in this study

Conclusions

  • The cationic surfactants of this study were prepared by Schiff’s and quaternization reactions and were characterized by FTIR, 1H-NMR and mass spectroscopy.

  • The studied cationic surfactants behave as efficient inhibitors for the carbon steel acidic corrosion compared with similar materials published in the literature.

  • The corrosion inhibition efficiency of the prepared cationic surfactants is increased by increasing their concentration and their efficiency order from most to least efficient is: IV(4N) > II(4N) > I(4N). The inhibition efficiency decreased with increasing temperature for all surfactants investigated.

  • The high inhibition efficiency of the synthesized surfactants against corrosion process is mainly due to their physical adsorption on the surface of carbon steel. The adsorption is consistent with Langmuir adsorption behavior.

  • The studied cationic surfactants were found to be mixed-type inhibitors, affecting both cathodic and anodic sites.