1 Introduction

Carbon steel is being used extensively under different conditions in industries. Acids are widely used in various technological processes in industry, e.g., in pickling baths, in the extraction and processing oil and gas and in other chemical and petrochemical industries. Also, in the technical cracking of petroleum, acids appear as a result of hydrolysis of salts and may have destructive effect on the equipment. Corrosion due to acids is vital and costly problem in the petroleum refining units and it represents a significant portion of loss because of inefficient operation, lost production, the cost of corrosion control, and high maintenance. To decrease the corrosion of metal, many techniques have been applied; among them, being used are the organic compounds and more specifically cationic surfactants which are increasingly used as corrosion inhibitors. Surfactants are extremely advantageous reagents and they are found at very low quantity in any medium and provide desirable properties to processes in all industries such as paint, coating, food, and petrochemical industry [1]. Surfactants collect in special request at the interfaces and modify the interfaces and in this way control, deceases, or prevent reaction between a substrate and its surroundings, when present in small amount in solution. Different surfactant groups have been accounted for present corrosion inhibitory potential which relies upon the type of surfactants, inhibitor concentration, kind of substrate [220], time of immersion in inhibitor solution [6], the presence of salts [2134], co-surfactant [35, 36], temperature [3743], structure of inhibitor [44], and the kind of corrosive [8]. In the previous studies, SDBS [45], dithizone and thiosemicarbazide [46], benzyl triethanol ammonium chloride [47], cetyltrimethylammonium bromide, etc., have been studied as corrosion inhibitors for steel in acidic medium. The existing data show that the most organic inhibitors act by adsorption on the metal surface. Surfactant inhibitors have many advantages, for example, high inhibition efficiency, low price, low toxicity, and easy production [48, 49]. In this study, the corrosion inhibition of carbon steel in 1 M HCl solution in the absence and presence of investigated Cetylpyridinium bromide (CPB) and Cetyltrimethylammonium bromide (CTAB) has been studied using chemical and electrochemical techniques. The effects of temperature and dose have been studied. The surface morphology of the carbon steel surface after exposing to corrosive medium and at optimum concentration is also utilized by SEM.

2 Experimental

2.1 Chemicals and Materials

Cetyltrimethylammonium bromide (CTAB) and Cetylpyridinium bromide (CPB) were obtained from Sigma-Aldrich. The structures of these surfactants are shown in Table 1. HCl (37.5 %), C2H5OH, and (CH3)2CO were bought from El-Gomhouria Company, Egypt. Bidistilled water was utilized for all preparations. Composition of carbon steel (weight%) used is as follows: C 0.200, Mn 0.350, P 0.024, Si 0.003, and the remainder Fe.

Table 1 Molecular structures, molecular weights, and molecular formulae of investigated surfactants

2.2 Methods

2.2.1 Mass Reduction Technique

For weight reduction estimations, square coins of steel of size (21 × 22 × 1.5 mm) were utilized. The test coins were rubbed with various grades of emery papers up to 1200 grit size, degreased with (CH3)2CO, then washed several times with bidistilled water, and lastly dried between filter papers. The mass reduction tests were performed in a 150-ml beaker placed in bath of water thermostat. The samples were quickly placed in the test solution with 1 M HCl in the presence and absence of various surfactants. After diverse submersion times (30–180 min), the coins were taken out, washed with bidistilled water, dried, and accurately weighed. Triplicate coins were exposed for every condition and the mean weight loss had been accounted. The mass reduction qualities were utilized to measure the rate of corrosion and the protection efficiency from the following equations:

$${\text{C}} . {\text{R}} .= \rho \times W/T \times A \times D,$$
(1)

where C.R. is the rate of corrosion, ρ is the constant; W is the mass loss (mg), T is the corrosion period (h), A is the specimen area cm2, and D is the density (g/cm3). The protection efficiency (%η) and degree of metal surface coverage (θ) were measured using the following Eq. (1):

$$\% \eta = 100 \times \theta = \left[ {\left( {{\text{C}} . {\text{R}} .^{*} {-}{\text{C}} . {\text{R}}.} \right)/{\text{C}} . {\text{R}} .} \right] \times 100,$$
(2)

where η is the protection efficiency and C.R.* and C.R. are the rates of corrosion without and with investigated surfactants, respectively.

2.2.2 Electrochemical Methods

Electrochemical techniques were performed in three electrodes thermostatic cell conventional assembly that utilized a Gamry Galvanostat/ZRA/Potentiostat (model PCI 300/4); a sheet of platinum and saturated calomel electrode (SCE) were used as counter and reference electrodes, respectively The working electrode was in the form of a square cut from CS sheet of equal composition embedded in epoxy resin of polytetrafluoroethylene so that the flat surface area was 1 cm2. Prior to each measurement, the electrode surface was pretreated in the same manner as the weight loss experiments. Before measurements, the electrode was immersed in solution at natural potential for 30 min until a steady state was reached. The potential was started from −1.2 to +0.2 V versus open circuit potential (E ocp) at a scan rate of 0.5 mVs−1. All experiments were carried out in freshly prepared solutions at 30 °C, and the results were repeated at least three times to check the reproducibility. %η and (θ) were measured from Eq. (3):

$$\% \eta = 100 \times \theta = \left[ {1 - \left( {i^\circ_{\text{corr}} /i_{\text{corr}} } \right)} \right] \times 100,$$
(3)

where i corr and i°corr are the current of corrosion in surfactant solution and in HCl, respectively.

2.2.3 EIS Technique

Impedance measurements were carried out using AC signals of 5 mV peak-to-peak amplitude at the open circuit potential in the frequency range from 105 to 0.1 Hz. The equivalent electrical circuit model utilized for this system is shown in Fig. 1 which consists of a parallel combination of the charge transfer resistance (R ct) and the constant phase element (CPE), both in series with the solution resistance (R s). CPE is introduced instead of pure double layer capacitance to provide more accurate fit as the double layer at interface does not behave as an ideal capacitor.

Fig. 1
figure 1

Electrical equivalent circuit model used to fit the impedance spectra data

Gamry applications used software EIS300 for EIS measurement; computer was utilized for summation of data. Echem Analyst 5.5 software was utilized for fitting, plotting, and graphing data. The protection efficiency (%η) and surface coverage (θ) of the surfactant were obtained from the resistance of charge transfer data from the following equation [50]:

$$\% \eta_{\text{EIS}} = \theta \times 100 = \left[ {\left( {R_{\text{ct}} {-}R^{*}_{\text{ct}} } \right)/R^{*}_{\text{ct}} } \right] \times 100,$$
(4)

where \(R^{*}_{\text{ct}}\) and R ct are the charge transfer resistances in the HCl and surfactants, respectively. The interfacial double layer capacitance (C dl) values were computed from the impedance value [51] by the following equation:

$$C_{\text{dl}} = 1/2\pi R_{\text{ct}} f_{\hbox{max} ,}$$
(5)

where f max is the maximum frequency (Hz).

2.2.4 EFM Technique

EFM is a fast and nondestructive experiment technique utilized for the rate of corrosion without prior knowledge of Tafel constants. EFM technique was performed using two frequencies (2.0–5.0 Hz). The choice of the two frequencies was based on three arguments [52]. The larger peaks were used to calculate the corrosion parameters. The steady-state potential was reached after 30 min. The %η EFM was calculated using the Eq. 3.

2.2.5 Surface Analysis

The steel surface was first abraded with different grades of emery papers (grades from 800 to 1200) and washed off using bidistilled water before dipping the specimens for 72 h in 1 M HCl with and without 150 ppm of investigated surfactants. Then, after this immersion time, the specimens were rinsed gently with bidistilled water, carefully dried, and subjected to the surface examination. The surface morphology measurements of the steel surface were carried out using scanning electron microscopy (SEM), the Philips spectrometer (pw-1390) with Cu tube (Cu kal, 1 = 1.54051A°), a scanning electron microscope (SEM, JOEL, JSM-T20, Japan), and energy-dispersive X-ray analysis (EDX) Model HITACHI S-3000H.

2.2.6 Theoretical Study

Quantum chemical measurements were calculated by using Materials Studio software [53]. The following quantum chemical parameters were calculated: dipole moment (µ), highest occupied molecular orbital (HOMO), energy lowest unoccupied molecular orbital (LUMO), energy gap: ΔEE = E LUMO − E HOMO), and Mulliken charge of the investigated inhibitor.

3 Results and Discussion

3.1 Mass Reduction Tests

The mass reduction–time curves of C-steel with CPB in 1 M HCl at varying doses are shown in Fig. 2. Diagrams for CTAB were given and are shown. This diagram shows that the mass reduction data of C-steel in acid solution in the presence of CPB decreases as its concentration increases. The variations of the corrosion protection with the surfactant dose are tabulated in Table 2. This trend may result from the fact that the adsorption of inhibitor on the steel increases with the surfactant concentration, and the steel surface is separated from the corrosive medium by the formation of a film on its surface [54]. The lowest protection efficiency (%η) is obtained in the presence of CTAB; therefore %η tends to decrease as follows: CPB > CTAB.

Fig. 2
figure 2

Weight loss curves for carbon steel dissolution in 1 M HCl in the absence and presence of different doses of CPB at 30 °C

Table 2 Data of weight loss measurements for C-steel in 1 M HCl solution in the absence and presence of different doses of surfactants at 180-min immersion and 30 °C

3.2 Electrochemical Measurements

3.2.1 Tafel Polarization Tests

The cathodic hydrogen reduction reactions and anodic metal dissolution were hindered and both Tafel slopes are moved to more positive and more negative potentials compared to the blank plotted (Fig. 3). This behavior is due to the fact that the surfactants act as mixed-type inhibitors [55]. From data obtained, the rise dose of inhibitors leads to a lower in the corrosion current density (i corr), yet the Tafel slopes (β a, β c) are consistent showing that the retardation of the two reactions (anodic metal dissolution and cathodic hydrogen reduction) was influenced without changing the dissolution mechanism [18]. The order of protection efficiency was calculated to be CPB > CTAB (Table 3). The %η obtained from potentiodynamic polarization method is close to those obtained from mass reduction calculation. The high %η may due to the adsorption of the surfactants on C-steel surface by horizontal binding to the hydrophobic hydrocarbon chains.

Fig. 3
figure 3

Potentiodynamic polarization curves for the dissolution of C-steel in 1 M HCl in the absence and presence of different doses of CPB at 30 °C

Table 3 Potentiodynamic data of C-steel in 1 M HCl and in the absence and presence of different doses of surfactants at 30 °C

3.2.2 EIS Tests

The EIS was utilized to decide and provide us the kinetic information and important mechanistic for the examined electrochemical system. Nyquist (Fig. 4) and Bode (Fig. 5) impedance curves given from the steel electrode in acid at 25 °C in vicinity and nonappearance of different doses of CPB (the CTAB curves are not appeared). The diagrams show a similar kind of Nyquist drawn for the C-steel with various doses of the surfactants. The presence of single semi-circle leads to the single charge transfer process during dissolution which is unaffected with the presence of surfactant. The difference of the Nyquist curves of the surfactant from perfect semicircles as expected from the theory of EIS is due to dispersion of frequency [56] and impurities, electrode surface heterogeneity resulting from surface roughness, adsorption of inhibitor, dislocations, formation of porous layers, and grain boundaries [57]. Impedance values were calculated by using the circuit as shown in Fig. 1. The information acquired from fitted spectra is shown in Table 4. The information in Table 4 demonstrates that the estimations of R ct increase and the estimations of C dl lowered with the increase in the surfactant doses. Diminish in C dl and increase in R ct data, due to the lower the local dielectric constant (because of the continuous replacement of water molecules by the surfactant molecules on the steel surface) and/or the increase of thickness of the electrical double layer proposed that the inhibitor molecules function by adsorption at the metal/solution surface [58]. The %η given from EIS estimations is in great agreement with that obtained from potentiostatic polarization tests. The difference of inhibition efficiency from the two techniques may be related to various surface status of the electrode in two methods.

Fig. 4
figure 4

Nyquist plots for the corrosion of C-steel in 1 M HCl in the absence and presence of different doses of CPB at 30 °C

Fig. 5
figure 5

Bode plots for the corrosion of C-steel in 1 M HCl in the absence and presence of different doses of CPB at 30 °C

Table 4 EIS data of C-steel in the presence and absence of different doses of surfactants at 30 °C

3.3 EFM Tests

EFM is a linear and nondestructive corrosion test technique that can directly determine the corrosion current value without earlier knowledge of Tafel slopes, and with only a small polarizing signal, these advantages of EFM technique make it an ideal technique for online corrosion monitoring [59]. The great strength of the EFM is the causality factors which serve as an internal check on the validity of the EFM tests. Figure 6 shows the EFM spectra for metal with and without various doses of CPB in one molar acid. Spectra for CTAB curves are not appeared). The kinetic parameters such as the causality factors (CF-2 and CF-3), Tafel slopes (β a and β c), and the corrosion current density (i corr) are shown in Table 5. The protection efficiency %η increases by expanding the investigated surfactant doses. The causality factors CF-2 and CF-3 are near to their theoretical data showing that the calculated values are of good quality. The measured protection efficiency given from mass reduction, EIS, and potentiostatic polarization methods are of great concurrence with that acquired from EFM technique.

Fig. 6
figure 6

EFM spectra for carbon steel in the absence and presence of different doses of CPB in 1 M HCl

Table 5 Electrochemical kinetic parameters obtained by EFM technique for C-steel in the absence and presence of various doses of surfactants in 1 M HCl at 30 °C

3.3.1 Adsorption Isotherms

Adsorption isotherms were utilized to quantitatively express the adsorption of inhibitors on the metal surfaces. Corrosion protection of metal in acidic media by surfactant is commonly attributed to the adsorption of surfactant on metal surface, and the protection efficiency is directly proportional to the surfactant coverage. The mechanism of the corrosion protection may be explained on the basis of adsorption behavior of the inhibitor. The degree of surface coverage (θ) for different surfactant doses was evaluated from mass loss tests. It is observed that the plot of C/θ versus obeys Langmuir adsorption isotherm through surface coverage of the adsorption of surfactant on C-steel surface. Langmuir isotherm is given by

$$C_{\text{inh}} /\theta = 1/K + C_{\text{inh}} .$$
(6)

The plots of C inh/θ versus C inh yielded a straight line with near unit slope for the surfactants (Fig. 7) showing that the adsorption model of the surfactants follows the Langmuir isotherm with good correlation. The higher inhibitive property for the two surfactants is attributed to the presence of quaternary nitrogen atom and the alkyl chain length, which covers greater coverage of the metallic surface [60]. The standard adsorption free energy (ΔG°ads) can be computed using [61]:

$$K_{\text{ads}} = 1/55.5\exp [ -\Delta G_{\text{ads}} /RT].$$
(7)
Fig. 7
figure 7

Langmuir adsorption isotherms for different surfactants from weight loss for C-steel dissolution in 1 M HCl at 30 °C

The ΔG°ads and K ads values are tabulated in Table 6. These results show that the surfactants are adsorbed on the metal surface physically. The negative ΔG°ads values and the higher values of K ads lead to the spontaneity of the adsorption process and the stability of adsorbed layer on the steel.

Table 6 Thermodynamic parameters for the adsorption of the investigated CPB in 1 M HCl on the C-steel at different temperatures

3.3.2 Kinetic Parameters

The temperature effect on the corrosion rate of steel in acid with various doses from surfactant was measured by mass reduction tests over a temperature of 30–50 °C. The effect of increase in temperature on the corrosion rate and %η was calculated using mass loss tests. The results showed that by increasing the temperature, the rate of corrosion increases. Plots of log k (corrosion rate) versus 1/T (temperature absolute) for steel in HCl gave straight lines (Fig. 8). The value of the Arrhenius activation energy (\(E_{\text{a}}^{*}\)) can be obtained using the Arrhenius equation as follows:

$$k = A\exp ( - E_{\text{a}}^{*} /RT),$$
(8)

where T represents the absolute temperature, k is the rate of corrosion, A is the Arrhenius constant, and R is the universal gas constant. The (ΔS*) entropy and (ΔH*) enthalpy of activation can be obtained from the transition state-type equation:

$$k = RT/Nhe^{{(\Delta S^{*} /R)}} e^{{( -\Delta H^{*} /RT)}} .$$
(9)
Fig. 8
figure 8

Arrhenius plots (log k vs. 1/T) for corrosion of carbon steel in 1 M HCl in the absence and presence of different doses of CPB

The plots between log k/T against 1/T lead to straight lines; from its slope and intercept, ΔH* and ΔS* can be computed, respectively (Fig. 9). Table 7 displays the values of activation parameters for steel dissolution in 1 M HCl solution. It is clear that the value of \(E_{\text{a}}^{*}\) in the presence of CPB and CTAB is higher than that in its absence. These results are in accordance with the studies reported before. The increase of \(E_{\text{a}}^{*}\) in the presence of the surfactants indicates physical adsorption or weak chemical bonding between the surfactant molecules and the C-steel surface. Accordingly, the higher \(E_{\text{a}}^{*}\) values lead to the lower corrosion rate; therefore, the decrease in corrosion rate is mostly decided by the apparent activation energy. This is due to the formation of a film on the carbon steel surface serving as an energy barrier for the carbon steel corrosion; enthalpy and entropy of activation (ΔH*, ΔS*) of the corrosion process were measured from the transition state theory [62]. The positive signs of ΔH* reflect the endothermic nature of the dissolution of metal process. Large and negative ΔS* imply that the activated complex in the rate-determining step represents an association rather than dissociation step, given that lower disordering takes place from reactants to the activated complex [63].

Fig. 9
figure 9

Plots of (log k/T) versus 1/T for corrosion of carbon steel in 1 M HCl in the absence and presence of different doses of CPB

Table 7 Thermodynamic activation parameters of carbon steel dissolution in 1 M HCl in the absence and presence of different doses of surfactants

3.3.3 Surface Analysis

The micrographs for C-steel specimen with and without addition of 150 ppm surfactants after 72-h immersion are shown in Fig. 10. This figure shows that in HCl, the steel surface suffers from severe corrosion attack; but in the presence of the surfactants, the steel surface became smoother and the morphology of metal surface is quite different from the previous one. Also, the presence of a film which is distributed in a random way on all surface of steel was noted. Because the adsorption of the surfactants on the metal surface in order to obstruct the active sites which present on surface.

Fig. 10
figure 10

SEM micrographs for carbon steel in the absence and presence of 150 ppm for CPB and CTAB

3.3.4 Quantum Parameters of Surfactants

The lower the data obtained from the lowest unoccupied molecular orbital (E LUMO), the higher the capacity of the atom to accept electrons [64]. While the higher data of the highest occupied molecular orbital (E HOMO) of the inhibitor given the easier offering electrons to the empty d-orbital of metal surface lead to the higher in its inhibition efficiency, Fig. 11. Table 8 shows the quantum chemical analyses obtained by VAMP method. The analyses data showed that the CPB has the highest E HOMO, which is expected to have the higher corrosion protection than CTAB. The lower the value of energy gap (ΔE) leads to the increase in the probable protection efficiency of the compound [4]. As shown from Table 8, CPB atom has the smaller energy gap contrast to CTAB. Appropriately, it could be observed that CPB has more inclination to adsorb on the steel surface than CTAB. The higher value of μ leads to the more probable protection efficiency than the other compounds. The calculation shows that the largest data of μ are assigned for CPB, which has the largest protection efficiency, absolute hardness, and softness σ that are the important properties to calculate the molecule stability and reactivity. A hard molecule has a higher energy gap and a soft molecule has a lower energy gap; in a corrosion system, the metal plays as a Lewis acid and the inhibitor plays as a Lewis base, whereas bulk metals are soft acids and thus soft base inhibitors are most effective for acidic corrosion of those metals. It is reported that inhibitor with the largest σ data has the increasing inhibition efficiency (Table 8) which is in great concurrence with the experimental information. The measure listed in Table 8 showed that CPB exhibits some data of global hardness. It means that this one has increased reactivity and the biggest corrosion inhibition than CTAB. This expectation is in good agreement with the experimental information. The position of the surfactant (lying vertically) could be the purpose behind the increased inhibitor efficiency.

Fig. 11
figure 11

The frontier molecular orbital density distribution for CPB and CTAB (HOMO and LUMO)

Table 8 Calculated quantum chemical properties for investigated surfactants

3.3.5 Mechanism of Inhibition

The feasible adsorption of organic cations in the presence of the halide ions is due to the formation of intermediate bridge and the negative ends of the halide metal dipoles being oriented toward the solution, whereby setting up an additional potential difference between the metal and the solution. This will shift the zero charge potential positively. This shift will make the charge on the metal surface more negative and facilitates the adsorption of positively charged surfactant compound by the formation of ionic bonds. High hardness of Br ions (counter ion effect) and cationic part of CPB and CTAB suggested higher tendency of an electrostatic adsorption of CPB and CTAB to occur (Cooperative effect) and this leads to a high protection. The adsorption of these two molecules can be described by two main types of interaction: physical and chemical adsorption. Physical adsorption requires the presence of charged metal surface and the charged species in solution, while chemical adsorption involves charge transfer from the species and the metal surface to form coordinate bond. C-steel surface bears positive charge, Br- can be adsorbed on C-steel surface making it negatively charged, so the inhibitive action of the two surfactants can result from physical (electrostatic) adsorption of the positively charge of nitrogen to the negatively charged C-steel (Br ions act as an adsorption mediator for bonding the two positive partners, the metal surface and the positively charged surfactant compound). This gives rise to the formation of an adsorption composite film in which the Br- anions are sandwiched between the metal and positively charged part of the inhibitor [65], see Fig. 12. Besides, the two surfactants may chemisorbed at metal/solution interface by a coordinate bond which may be formed between the lone electrons pairs of nitrogen atom and the vacant d-orbital of iron atom. Also, pyridinium ring in case of CPB has more π-electrons owing to aromatic ring; it can be also adsorbed on C-steel surface on the basis of donor–acceptor interactions between π-electrons of the pyridinium ring and vacant d-orbital of iron atoms. Inhibition efficiency of CPB is higher than CTAB, this may be due to the fact that the two surfactants are changed in ionic quality, and hence it is found that CPB has ionic quality higher than CTAB in acidic arrangement and lower CMC [66]. Also, CPB has a higher molecular size and one heteroatom than CTAB.

Fig. 12
figure 12

The expected scheme of adsorption of CPB and CTAB inhibitor on C-steel surface

4 Conclusions

CPB and CTAB act as good corrosion inhibitors for C-steel in 1 M HCl medium. The %η increases with increasing doses and decreases with increasing the temperature. The inhibition mechanism is explained by adsorption. The adsorption of CPB and CTAB obeys Langmuir adsorption isotherm. CPB and CTAB act as mixed-type inhibitors for C-steel in 1 M HCl medium. The thermodynamic parameters calculated from adsorption isotherm showed that physisorption is involved in the inhibition process. The theoretical information of molecules is in great concurrence with the experimental information. Results obtained from different techniques are in reasonably good agreement.