1 Introduction

Owing to its low cost and good availability, carbon steel (CS) has been extensively used for different purposes in a wide range of industrial applications such as automotive, transportation and several other fields. Furthermore, hydrochloric and sulphuric acids are widely used for pickling and de-scaling of carbon steel, promoting the acceleration of metallic corrosion with potential adverse effects on the ecological balance and in the economic field, namely in term of repair, replacement and products losses [1, 2]. Different organic compounds have been reported to be as effective corrosion inhibitors during acidization in industrial cleaning processes [3,4,5,6]. Various organic compounds containing polar functions in their structures have been reported as being effective corrosion inhibitors for CS in acidic solutions [7,8,9,10,11,12]. Researches concerning corrosion processes and their inhibition by organic compounds have been conducted recently, and a number of interesting papers have been published. Over the last few decades, many new inhibitors were synthesised. In principle, organic inhibitors prevent metal corrosion by interacting with the metal surface via adsorption thru the donor atoms, π-orbital, electron density and the electronic structure of the molecule [13,14,15,16,17,18]. These inhibitors are usually adsorbed on the metal surface via formation of a coordinate covalent bond (chemical adsorption) or electrostatic interaction between the metal and inhibitor (physical adsorption) [19]. The chemical structure of the inhibitors, the type of aggressive electrolyte, the nature and the charge of the surface of the metal has a considerable impact on this phenomenon. The compounds that contain both nitrogen and sulphur exhibit high inhibitory efficacy compared to those containing only nitrogen or sulphur [3, 20,21,22]. It is therefore established that organic compounds having a molecular structure containing nitrogen, oxygen, phosphorus and sulphur and/or π-electron of double or triple bonds, are usually used in the protection against corrosion of metals and their alloys in acidic environments [23]. Therefore, it seemed interesting to us to synthesise a new compound belonging to ketene dithioacetals derivatives, ECDYA, having a structure presenting this advantage, and to study, in its presence and in its absence, the behaviour of carbon steel in 1.0 M HCl and 0.5 M H2SO4 aqueous solutions. Moreover, some compounds of the same family of this compound gave satisfactory results in inhibiting the corrosion of copper in 3 M HNO3 [24]. The study has been carried out using weight loss and potentiodynamic polarisation measurements along with electrochemical impedance spectroscopy (EIS) and scanning electron microscopy (SEM) investigations. In other hand, the local chemical reactivity of this compound was performed using the density functional theory (DFT) via the CAM-B3LYP method [25].

2 Materials and Experimental Methods

2.1 Materials

2.1.1 Inhibitor

Ethyl 2-cyano-2-(1,3-dithian-2-ylidene) acetate (ECDYA) was synthesised by first mixing K2CO3 (42 g, 0.3 mol) and ethyl 2-cyanoacetate, an active methylene compound, (0.1 mol) in 50 mL of DMF and placing the mixture under magnetic stirring. 9 mL (0.15 mol) of carbon disulphide were then added in one go at room temperature. The stirring was maintained for 10 min before starting the dropwise addition of the dielectrophilic reagent, 1,3-dibromopropane, (0.12 mol), an operation that stretches over 20 min. After 7 h stirring at room temperature, 500 mL of ice water were added to the reaction mixture. The solution was filtered thru a paper filter to isolate the precipitate that formed. The latter was recovered, dried, purified by recrystallisation from ethanol and used in the experiments in the concentration range [5 × 10−6; 10−3] mol/L [24]. The details of its crystalline structure are given in a previous publication [26]. Figure 1 shows that the structural formula of ECDYA. It exhibited the following characteristics.

Fig. 1
figure 1

Structure formula of Ethyl 2-cyano-2-(1,3-dithian-2-ylidene) acetate (ECDYA)

This product is recovered in the form of a yellow precipitate. Its molar mass is M = 229 g/mol. Yield: 93%; M.P = 95 °C. FT-IR (FT-IR spectra of ECDYA obtained for its solid state, ʋ (cm−1)): 1700(C=O), 1246–1004(C–O (ester)), 2206(C≡N), 1437(C=C). 1H NMR ((CDCl3), δ(ppm), 250 MHz)): 1.35 (t, 3H, CH3–CH2), 2.35 (p, 2H, CH2), 2.95–3.25 (m, 4H, 2CH2S), 4.30 (q, 2H, CH2O). The mass spectroscopy analysis revels that the inhibitor produced fragment ions m/z 229. 13C NMR (CDCl3, δ(ppm), 250 MHz: 14.22(s,CH3–CH2–O), 23.36(s, S–CH2CH2–CH2–S), 28.99(s, S–CH2–CH2CH2–S), 61.26(s, CH3CH2), 76.69(s,O=C–C=C), 120.55(s, CN), 165.56(s, O–C=O), 180.7(s, C=CS2).

2.1.2 Specimen

Corrosion tests were performed on carbon steel specimens of the following chemical composition (wt%): C 0.09%, Si 0.05%, Mn 0.13%, S 0.24%, P 0.24% and Fe balance. For the gravimetric and electrochemical measurements, pre-treatment of the surface of specimens was carried out by mechanically grinding with 500, 800, 1000 and 1200 grades of emery papers. Then, they were washed with distilled water, degreased with acetone and dried at room temperature before use in the experiments. In the gravimetric measurements, the carbon steel samples were cubic (1 cm × 1 cm × 1 cm); those used in electrochemical measurements (PC and EIS) were protected by the epoxy resin leaving a working surface equal to 0.5 cm2.

2.1.3 Electrolyte Medium

The aggressive solutions were 1 M HCl [prepared by dilution of 37% w/w HCl (Merck)] and 0.5 M H2SO4 [prepared by dilution of 98% w/w H2SO4 (Merck)] with bi-distilled water. All tests were performed in the aerated medium at different temperatures (293 K, 303 K, 313 K, 323 K and 333 K).

2.2 Methods

2.2.1 Weight Loss Measurements

Gravimetric experiments were carried out in a glass vessel. The specimens were prepared as described above and then weighed. The test pieces were immersed in 100 mL of 1 M HCl and 0.5 M H2SO4 with various concentrations of inhibitor. After 5 h, three test pieces were taken out of the test solution, washed, dried and weighed again. The mean value of weight loss for each set of data with the corresponding standard deviation is reported here. The corrosion rate (\(V_{\text{corr}}\)) was calculated from the weight loss data according to Eq. (1) [9]:

$$V_{{{\text{corr}}}} = \Delta W/St$$
(1)

where ∆W is the average weight loss (mg), S is the total surface area of the specimen (cm2) and t is the immersion period (5 h). The inhibitory efficiency (IEw%), as well as the surface coverage (θ), were determined using the following equations.

$$\theta = \frac{{V_{{{\text{corr}} - }} V^{\prime}_{\text{corr}} }}{{V_{\text{corr}} }}$$
(2)
$$IE_{\text{w}} \left( {\text{\% }} \right) = \left( { \frac{{V_{{{\text{corr}} - }} V^{\prime}_{\text{corr}} }}{{V_{\text{corr}} }}} \right) \times 100$$
(3)

where, \(V_{{{\text{corr}} }}\) and \(V^{\prime}_{\text{corr}}\) are the corrosion rates of carbon steel respectively in the absence and in the presence of inhibitor.

2.2.2 Electrochemical Measurements

A Voltalab-PGZ 301 potentiostat controlled by a computer using Voltamaster 4 software was used for electrochemical measurements. The cell used was a three-electrode Pyrex glass cell, with CS as the working electrode (WE), SCE as the reference electrode (RE) and Pt as the counter electrode (CE). Before each measurement, a stationary state of the system was achieved by immersing a freshly polished electrode in the test solution at open circuit potential for 20 min.

Potentiodynamic polarisation curves for different concentrations of the inhibitor were obtained with a scan rate of 0.5 mV s−1, starting from a cathodic potential of − 250 mV to an anodic potential of + 250 mV relative to the Eocp. Measurements by electrochemical impedance spectroscopy are carried out at the open circuit potential, OCP, over a frequency range from 100 kHz to 10 mHz with a perturbation using a signal of equal amplitude at 10 mV. Every potential esteem was estimated in reference to immersed calomel electrode (SCE). Each experiment was repeated at least three times to check the repeatability.

2.2.3 Surface Analysis

The surface morphology of the samples exposed to acid solutions without and with containing 10−3 M of ECDYA was studied by a scanning electron microscope model JEOL JSM-6360 LV. The SEM analysis was done after 3 h immersion of all samples at 298 K.

2.2.4 DFT Computational Details

The DFT quantum chemical calculations were performed with the ORCA 4.0.1.2 computational package [27, 28], using the CAM-B3LYP/def2-TZVPP level of the theory [29]. All calculated compounds were initially prepared and minimised by using Avogadro programme [30], applying MMFF94 s force field.

According to Koopman’s theorem [31], first ionisation energy (I) and electron affinity (A) is approximately equal (with the minus sign) to the highest occupied molecular orbital energy (HOMO) and the lowest unoccupied molecular orbital energy (LUMO), respectively.

$$I = - E_{\text{HOMO}}$$
(4)
$$A = - E_{\text{LUMO}}$$
(5)

The HOMO and LUMO are more closely associated with the ability of a molecule to donate and accept electrons, respectively. Moreover, the difference of EHOMO and ELUMO, termed the band gap (ΔEgap), is important parameters to characterise the reactivity of a chemical species. Lower values of the energy difference ΔEgap will cause higher inhibition efficiency because the energy to remove an electron from the last occupied orbital will be low [32].

$$\Delta E_{\text{Gap}} = E_{\text{LUMO}} - E_{\text{LUMO}}$$
(6)

The electronegativity (χ) and the global hardness (η) [33] are based respectively on the first and second partial derivatives of the energy (E) relative to the number of electrons (N) and the external potential v (r).), using the following equations:

$$\chi = -\uppi = - \left( {\frac{\partial E}{\partial N}} \right)_{{{\text{v}}({\text{r}})}}$$
(7)
$$\eta = - \left( {\frac{{\partial^{2} E}}{{\partial N^{2} }}} \right)_{{{\text{v}}({\text{r}})}}$$
(8)

where the first equality in the Eq. (7) corresponds to the chemical potential (π), identified as negative of the electronegativity. The equations resulting from the finite difference method [34], with which the calculation of μ, η and π can be given as follows:

$$\chi = \frac{I + A}{2}$$
(9)
$$\eta = \frac{I - A}{2}$$
(10)

Global softness (σ) is defined as the inverse of the global hardness [35]:

$$\sigma = \frac{1}{\eta } = \frac{2}{I - A}$$
(11)

Fukui function \(f\left( {\vec{r}} \right)\) is defined as the derivative of the electronic density \(\rho \left( {\vec{r}} \right)\) relative to the number of electrons N at a constant external potential \(v\left( {{\vec{\text{r}}}} \right)\) [36]:

$$f\left( {\vec{r}} \right) = \left( {\frac{{\partial \rho \left( {\vec{r}} \right)}}{\partial N}} \right)_{{{\text{v}}\left( {\vec{r}} \right)}}$$
(12)

Fukui functions [37] were calculated using the following equations.

$$\begin{array}{*{20}c} {f_{k}^{ + } = q_{k} \left( {N + 1} \right) - q_{k} \left( N \right) \left( {\text{nucleophilic attack}} \right) } \\ \end{array}$$
(13)
$$\begin{array}{*{20}c} {f_{k}^{ - } = q_{k} \left( N \right) - q_{k} \left( {N - 1} \right) \left( {\text{electrophilic attack}} \right) } \\ \end{array}$$
(14)

where \(q_{k} \left( {N + 1} \right)\), \(q_{k} \left( N \right)\) and \(q_{k} \left( {N - 1} \right)\) are the charges of the atoms on the systems with \(N + 1\), \(N,\) and \(N - 1\) electrons respectively. Higher \(f_{\text{k}}^{ + }\) values for an atom (k) indicate a preference towards a nucleophilic attack, while higher \(f_{\text{k}}^{ - }\) values indicate a preference for an electrophilic attack on this atom.

In order to facilitate the comparison between the possible sites for nucleophilic and electrophilic attacks on any atom k, we have calculated (\(\Delta f_{k}\)) which corresponds to the difference (\(f_{k}^{ + } - f_{k}^{ - }\)), because if \(\Delta f\) > 0, then the site is favourable for a nucleophilic attack, whereas if \(\Delta f\) < 0, then the site is favourable for an electrophilic attack [32].

3 Results and Discussion

3.1 Weight Loss Measurements

The corrosion rate (Vcorr), the surface coverage (θ) and the inhibition efficiency (IEw%) obtained from weight loss measurements of steel specimens after 5 h exposure to 1 M HCl and 0.5 M H2SO4 solutions with and without the addition of various concentrations of the investigated inhibitor (ECDYA) at different temperatures were calculated. The resulting data are gathered in Table 1. The effect of this inhibitor on the corrosion of carbon steel in these two media was monitored for 24 h by this method. By way of example, the inhibitory efficacy reached a value equal to 80.9% for 5 h of exposure to the aggressive 1 M HCl medium at a concentration of 10−3 mol L−1 at 293 K and at 97.9% in 0.5 M H2SO4 under the same conditions. This efficiency became equal to 77.3% for a 24 h exposure time in 1 M HCl and 89.1% in 0.5 M H2SO4 under the same conditions as previously.

Table 1 Mass loss data for carbon steel immersed in 1 M HCl and 0.5 M H2SO4 solutions with and without various concentrations of ECDYA in the temperature range of 293 K to 323 K

Examination of the data in Table 1 reveals that the addition of ECDYA decreases the corrosion rate of carbon steel, while inhibition efficiency (IEW%) and surface coverage (θ) increase with increasing inhibitor concentration at all temperatures. At 10−3 M, ECDYA exhibits maximum inhibition efficiency (80.9% in 1 M HCl and 97.9% in 0.5 M H2SO4) at 293 K. This concentration represents the efficient inhibitive ability. This can be due to the inhibitor molecules act by adsorption on the metal surface [38]. Generally, the efficiency of an organic substance acting as a metallic corrosion inhibitor depends on the chemical structure and the concentration of the inhibitor, the metal nature and other experimental conditions, such as medium temperature [39]. The plot of \(V_{{{\text{corr}} }}\) versus concentration of ECDYA at 293 K (none showed) clearly indicates that corrosion rate was reduced in the presence of ECDYA in comparison to the blank in both acidic media. The fact that the metal specimen manifests higher corrosion susceptibility in 1 M HCl is evidence that the anions of the acids which influence the corrosion process in different ways. It is evident too from Table 1 that the inhibition efficiency increases with increasing ECDYA concentration but decreases with increasing the temperature (293–323 K), both in 1 M HCl and 0.5 M H2SO4 solutions. This may be explained by a regress of adsorption-induced by the temperature rise [40], a phenomenon that is frequent in physisorption, and an increased rate of dissolution process of carbon steel.

3.2 Potentiodynamic Polarisation Measurements

Potentiodynamic polarisation measurements were carried out to gain insight into the kind of corrosion protection supplied by ECDYA, i.e. to determine whether inhibition is anodic, cathodic or a mixed type, and its effect on the kinetics of the anodic and cathodic reactions [41, 42]. The inhibitory efficiency (IE%) calculated according to Eq. (15) [43].

$$IE_{\text{p}} {\text{\% }} = \left( { \frac{{i_{\text{corr}}^{0} - i_{\text{corr}}^{\text{inh}} }}{{i_{\text{corr}}^{0} }}} \right) \times 100$$
(15)

where \(i_{\text{corr}}^{0}\) and \(i_{\text{corr}}^{\text{inh}}\) are the corrosion current densities in the absence and the presence of a defined concentration of inhibitor, respectively. The kinetic parameters, namely the corrosion current density (Icorr), the corrosion potential (Ecorr), the cathodic Tafel slope (βc) and the anodic Tafel slope (βa) are summarised in Table 2. Figure 2a, b shows the cathodic and anodic Tafel polarisation curves of carbon steel immersed in 0.5 M H2SO4 and 1 M HCl in the absence and presence of different concentrations of ECDYA at 293 K. By extrapolating the Tafel anodic and cathodic linear parts until the straight lines intersect, corrosion current density (icorr), corrosion potential (Ecorr) as well as polarisation resistance (R) can be determined. A first analysis of these curves (Fig. 2a, b) shows that the anodic and cathodic reactions are affected by the addition of the inhibitor. In fact, in addition to the slight displacement of the free potential towards higher values, the addition of the inhibitor in 1 M HCl solution and 0.5 M H2SO4 induces the reduction of the anodic partial current corresponding to the dissolution of the metal and also the decrease of the cathodic current corresponding to the reduction of the proton. The cathodic curves have a linear part (Tafel line) indicating that the hydrogen reduction reaction on the surface of the steel is done according to a pure activation mechanism. This analysis also allows us to see:

Table 2 Results obtained by Tafel extrapolation of carbon steel immersed in 0.5 M H2SO4 and 1 M HCl solutions with and without various concentrations of ECDYA at 293 K
Fig. 2
figure 2

Tafel curves of carbon steel in a 1 M HCl and b 0.5 M H2SO4 solutions containing different concentrations of ECDYA. Scan rate = 0.5 mV s−1, T = 293 K

-In the cathodic domain, the addition of inhibitor decreases the current densities. The slight modification of the cathodic Tafel slopes (Table 2), in the presence of the inhibitor, in the two media shows that the proton reduction reaction on the surface of the steel is not modified by the addition of the inhibitor and that it is done according to a pure activation mechanism. The inhibitor seems to first adsorb on the surface of the steel before acting by simply blocking its active sites. Such behaviour has also been observed in several studies concerning the same alloy and the same media [44, 45].

-In the same way, in the anode domain, the addition of inhibitor results in a decrease in the densities of the anodic current. In addition, we find for all the concentrations studied, the presence of two linear portions in the case of a strong anodic surge (potential applied to the sample up to − 200 mV/ECS) (is not shown). When a desorption potential Ed, [46], also called potential of unpolarizability by Heusler and Cartledge [47] or by Bartos and Hackerman [48], is exceeded, the inhibitor has practically no longer effect on anode curves; the anodic current density then increases rapidly and the steel dissolves in the region of high overvoltages. This behaviour has been widely documented in the case of steel in hydrochloric acid solutions [49, 50]. The rapid growth of the anodic current, after the potential Ed, is attributed to the desorption of the molecules of the inhibitor adsorbed on the surface of the metal. However, even if the inhibitor resorbs from the metal surface, it inhibits corrosion since the anodic current densities remain lower than those of the white. This clearly indicates that the adsorption and desorption of ECDYA depends on the electrode potential. The phenomenon of inhibition observed is generally described as being due to the formation of an inhibitor layer adsorbed on the surface of the electrode [51]. The variation in ECDYA concentrations in 1 M HCl and 0.5 M H2SO4 solutions does not have a significant impact on Ecorr displacement, as illustrated in Table 2. In literature, an inhibitor can be classified as cathodic or anodic type if the shift of corrosion potential brought about by the inhibitor is higher than 85 mV and as mixed type if the displacement of Ecorr is lower than 85 mV [52]. In this study, the maximum displacement of Ecorr values was 51.2 mV versus SCE in H2SO4 solution and 38.6 mV versus SCE in HCl solution which indicates that ECDYA acts as mixed type inhibitor in both media. As shown in Table 1, the corrosion rate determined by the weight loss measurement was 1.856 mg cm−2 h−1 for Hydrochloric acid alone, for example. From Faraday’s law, this rate corresponds to a corrosion current density of 1.77 mA cm−2 in conformity with the value determined by the Tafel extrapolation method, 1.00 mA cm−2 (Table 2). We also note, by examining the inhibitory efficiencies of ECDYA obtained by the EIS (Table 3) and those obtained by the polarisation curves (Table 2), that these efficiencies have been confirmed.

Table 3 The EIS parameters of carbon steel in 0.5 M H2SO4 and 1 M HCl solutions in the presence and absence of various concentrations of ECDYA at 293 K

3.3 EIS Measurements

The study, by EIS at 293 K, of the corrosion of carbon steel in 1 M HCl and 0.5 M H2SO4 solutions in the absence and presence of various concentrations of ECDYA was also carried out. The following equation illustrates the formula used in the calculation of the inhibitor efficiency:

$$IE_{\text{EIS}} {\text{\% }} = \left( {\frac{{R^{\prime}_{\text{ct}} - R_{{{\text{ct}} }} }}{{R^{\prime}_{\text{ct}} }}} \right) \times 100$$
(16)

where \(R_{{{\text{ct}} }}\) and \(R^{\prime}_{\text{ct}}\) represent the resistance of charge transfer in the absence and presence of inhibitor, respectively. The impedance spectra for Nyquist plots (Fig. 3a, b) were analysed by fitting data to equivalent circuit model (Fig. 4), which was used to describe carbon steel/solution interface. A basic electrical equal circuit (EEC) has been proposed to show the test information. In this circuit Rs is the resistance of solution, Rct is the resistance of charge transfer and CPE (Q) represents the constant phase element that replaces the capacitance of the electric double layer (Cdl) [53,54,55]. Excellent fits with this model were obtained for all experimental data. The interfacial capacitance Cdl and the polarisation resistance were calculated from the CPE parameter according to the following equation [56]:

Fig. 3
figure 3

Nyquist diagrams of carbon steel obtained at 293 K in solutions of a 1 M HCl alone and b 0.5 M H2SO4 alone and in these media containing different concentrations of ECDYA

Fig. 4
figure 4

The model used as a circuit equivalent to the metal-solution interface for determining EIS data

$$C_{\text{dl}} = R_{\text{ct}}^{{\frac{1 - n}{n}}} \times Q^{{\frac{1}{n}}}$$
(17)

where n is the deviation parameter of the CPE:\(0 \le n \le 1\). For \(n\) = 1, Eq. (17) agrees with the impedance of an ideal capacitor, where Q is identified as the capacity. The electrochemical parameters including Rct, Q, and n, obtained from the fit, are listed in Table 3. The calculated double-layer capacitance values are also given in Table 3. The results obtained in the form of Nyquist plots (Fig. 3a, b) have been exploited. These diagrams obtained consist of a single capacitive loop which is not a perfect half circle; this is attributed to the dispersion of the frequency of the interfacial impedance due to the heterogeneity of the surface of the electrode [55]. This heterogeneity may result from roughness, impurities and dislocations, adsorption of the inhibitor and formation of the porous layer [57]. This type of diagram is generally interpreted as a mechanism of charge transfer over a heterogeneous and irregular surface [58, 59]. In addition, these diagrams have a similar shape for all tested concentrations, indicating that there is no change in the mechanism of corrosion [60], and the diameter of the capacitive semicircles increases with the increasing the concentration of the inhibitor. The EIS results confirm that ECDYA inhibits the corrosion of carbon steel in 1 M HCl and 0.5 M H2SO4 at 293 K for all investigated concentrations, with a continuous increase of the inhibition efficiency (IE) with the increase in concentration. From Table 4, it is clear that the charge transfer resistance (Rct, Ω cm2) increases, the double-layer capacitance (Cdl, µF cm−2) decreases and the inhibitor efficiency (IE%) increases as the inhibitor concentration increases.

Table 4 Thermodynamic parameters of adsorption of ECDYA on the surface of steel in acidic media at different temperatures

Some ketene dithioacetal derivatives belonging to the same family of ECDYA have been studied by Fiala et al. [24, 61] for copper corrosion in 3 M HNO3 at different concentrations and at 298 K using chemical and electrochemical measurements. The results show that these products inhibit the corrosion of copper in this medium. The corrosion rate depends on the concentration of the inhibitor. Increasing the concentration of each derivative increases the effectiveness of the inhibition up to a maximum value (100% at 10−3 M for compound 1, 96% at 10−3 M for compound 2 and 90% at 10−3 M for compound 3). The inhibitory efficiency of ECDYA reached 81% in HCl 1 M and 98% in H2SO4 0.5 M at the same concentration (10−3 M) for corrosion of carbon steel. This suggests that derivatives belonging to this family of compounds can be used as inhibitors of corrosion of metals and their alloys in acidic environments.

3.4 Adsorption Isotherm and Thermodynamic Consideration

The inhibitory action of inhibitors in acidic media is generally due to the adsorption of their molecules on the metal surface. Therefore, and for a highlight on the mechanism of this process, we have chosen in this work to study the adsorption behaviour of ECDYA on carbon steel, in hydrochloric and sulphuric acid media, in a concentration range from 5 × 10−6 to 10−3 M at 293 K. Several adsorption isotherms were tested. The fraction of the surface covered, θ, by the adsorbed inhibitor is expressed as a function of the inhibitory efficiency, EI%, by the following relation:

$$\theta = EI\% /100$$
(18)

where EI% is evaluated from the gravimetric method. Adsorption of ECDYA on the surface of the steel in HCl and H2SO4 solutions have been found to follow the Langmuir adsorption isotherm, as can be seen clearly (Fig. 5) that the curves representing C/θ versus C (concentration of the inhibitor) in 1 M HCl and 0.5 M H2SO4 are straight lines with slopes close to 1 and values correlation coefficients (R2) ranging from 0.9993 to 0.9997 in the first corrosive medium and from 0.9987 to 0.9998 in the second. However, by analysing the equations of the experimental lines obtained we notice that the slopes are slightly greater than unity. This result shows that ECDYA occupies several active sites. Thus the values of the thermodynamic parameters were calculated from the modified Langmuir model given by the following equation [62]:

Fig. 5
figure 5

Langmuir isotherm of the system: carbon steel and The ECDYA inhibitor in a 1 M HCl and b 0.5 M H2SO4, at different temperatures

$$C/\theta = n/K_{\text{ads}} + n C$$
(19)

where C is the inhibitor concentration (mol L−1), Kads is the adsorption equilibrium constant (L mol−1) and θ is the fraction of surface covered with inhibitor. The values of the equilibrium constants of the adsorption process are related to the standard free energy of adsorption by the relation [63]:

$$K_{\text{ads}} = \left( { \frac{{1_{ } }}{55.5}} \right){ \exp }\left( { \frac{{ - \Delta G_{\text{ads}}^{^\circ } }}{\text{RT}}} \right)$$
(20)

where R is the universal constant of gas and T is the temperature in Kelvin. The value of 55.5 represents the concentration of water in solution (mol L−1). The influence of the temperature on the adsorption equilibrium constant, Kads, can be expressed according to the following relation (the integrated form of the Van ‘t Hoff equation):

$${\text{ln }}K_{\text{ads}} = \left( {\ln \frac{1}{55.5} + \frac{{ \Delta S_{\text{ads}} }}{R }} \right) - \left( { \frac{{ \Delta H_{\text{ads}} }}{\text{RT }}} \right)$$
(21)

where R is the perfect gas constant, T is the absolute temperature and ∆Hads is the adsorption enthalpy and ∆Sads is the adsorption entropy. The ∆Hads and the ∆Sads values were deduced from the plot of ln Kads as a function of 1/T (not shown). This plot gave straight lines with a correlation coefficient close to unity. The intersection of each line is equal to the constant (ln 1/55.5 + ∆Sads/R), allows the determination of ∆Sads and, the slope is equal to − ∆Hads/R. The estimations of these parameters are given in Table 4. The spontaneity of the adsorption process and stability of the adsorbed layer on the surface of the carbon steel are confirmed by the appearance of the negative sign in the values of ∆Gads. These values for all the studied systems lie between −38.1 and −40.9 kJ mol−1 in both acidic medium, indicating that the adsorption of the evaluated inhibitor on the carbon steel surface may include complex connections (both physical and chemical adsorption). On the other hand, the decrease observed for Kads and IE with the temperature rise suggests that ECDYA molecules are physically adsorbed on the metal surface, thus favouring the desorption process. The latter also appeared in the values of \(\Delta H_{\text{ads}}\) indicating the exothermic nature of the adsorption process of the inhibitory molecules [3, 64,65,66]. An exothermic adsorption process can be chemical, physical or a mixture of both [67], whereas the endothermic process is attributed to chemisorption [68]. In an exothermic process, physisorption is distinguished from chemisorption by the absolute value of the adsorption enthalpy: when the latter is less than 40 kJ mol−1, a physisorption mechanism is operating, the enthalpy of chemisorption being closer to 100 kJ mol−1 [69]. In the present study, the enthalpy absolute values indicate that physisorption is the process that took place. Positive values of the entropy were observed in both media relating the substitutional process. This means that an increase in disorder took place probably because when one inhibitor molecule adsorbs onto the metal surface many more water molecules are desorbed. Together with \(\Delta H_{\text{ads}}\), this constitutes the driving force for the adsorption of inhibitor onto steel [70, 71].

3.5 Activation parameters of the inhibition process

The temperature can modify the interaction between the mild steel electrode and the acidic medium in absence and presence of the inhibitor [3]. Some experiments were performed in order to evaluate this interaction, to calculate the activation parameters of the corrosion process of carbon steel in both acidic solutions and to test the anticorrosion property of the inhibitor. Thus, weight loss measurements were made in the range of temperature 293–323 K in the absence and presence of different concentrations of ECDYA, after a 5 h immersion into 1 M HCl and 0.5 M H2SO4 solutions. Corrosion reactions can be regarded as Arrhenius-type processes; therefore, the Arrhenius equation was used in the calculation of activation parameters:

$${\text{ln }}V_{\text{corr}} = {\text{ln }}A + \left( { \frac{{ - E_{\text{a}} }}{RT }} \right)$$
(22)

where \(V_{\text{corr}}\) is the corrosion rate, Ea is the apparent activation energy, R is the universal gas constant, T is the absolute temperature and A is the pre-exponential factor.

Figure 6 shows the Arrhenius plots of ln Vcorr versus 1/T for corrosion of carbon steel in 1 M HCl and 0.5 M H2SO4 solutions without and with the addition of different concentrations of ECDYA. A plot of ln Vcorr versus 1/T obtained from weight loss measurements gave a straight line with a regression coefficient close to unity. The values of apparent activation energy (Ea) obtained from the slope − Ea/R of the lines and the pre-exponential factor (A) obtained from the intercept ln A are displayed in Table 5. The enthalpy of activation (∆Ha) and the entropy of activation (∆Sa) were calculated using the transition equation (Eq. (23)):

Fig. 6
figure 6

ln Vcorr versus 1/T curve of dissolution of carbon steel in a 1.0 M HCl and b 0.5 M H2SO4 solutions with and with various concentrations of ECDYA

Table 5 Thermodynamic activation parameters of carbon steel dissolution in 1 M HCl and 0.5 M H2SO4 solutions with and without various concentrations of ECDYA
$${\text{ln }}(V_{\text{corr}} /T) = \left\{ \right.{ \ln }(R/Nh) + (\Delta S_{\text{a}} /RT)\left. \right\} {-}(\Delta H_{\text{a}} /RT)$$
(23)

where N is Avogadro’s number and h is Plank’s constant.

Figure 7 shows that the plots of ln (Vcorr/T) with respect to 1/T, also gave straight lines, for carbon steel dissolution in 1 M HCl and in 0.5 M H2SO4 in the absence and presence of different concentrations of ECDYA. The slope of each line equals its respective − ∆ Ha/R term while the intercept equals ln (R/Nh) +∆Sa/R. The values of ∆Sa and ∆Ha were subsequently calculated from these terms and presented in Table 5. The obtained results of this study show that the Ea values ranged from 65.16 to 107.75 kJ mol−1 for the inhibited H2SO4 solution and from 69.78 to 80.76 kJ mol−1 for the inhibited HCl solution. It’s clear that the apparent activation energy (Ea) increased with increasing concentration of ECDYA and was higher than that in the absence of inhibitor (Table 5). This indicates that the corrosion reaction of CS is inhibited by ECDYA and supports the phenomenon of physical adsorption [12, 72, 73]. In this case, the continuous increase in activation energy with the concentration of the inhibitor makes the corrosion process more difficult (higher energy barrier) which can be attributed to an increase in thickness of the double layer [74], giving strong anti-corrosive properties to ECDYA and enhancing the electrostatic characteristics of adsorption of the inhibitor on the CS surface (physisorption) [75]. The endothermic nature of the carbon steel dissolution process is revealed by the positive sign of the enthalpy values of activation, thus expressing its difficult course. The negative sign of the activation entropy values either in the absence or in the presence of the inhibitor may be explained by the fact that during the formation of the activated complex and in the determining step of the reaction the reaction is associative rather than dissociative, meaning that a decrease in disorder occurs starting from the reagents to the activated complex [76, 77].

Fig. 7
figure 7

ln Vcorr/T versus 1/T for carbon steel dissolution in a 1 M HCl and b 0.5 M H2SO4 without and with different concentrations of ECDYA

At higher concentration (10−3 M), a positive value of the entropy of activation was observed in both media. This indicates that the system passes from a more ordered state to a more random arrangement [78].

3.6 Surface analysis

The SEM images were recorded (Fig. 8a–e) in order to establish the interaction of inhibitor molecules with the metal surface. Figure 8a shows the polished lines on the surface of steel before its exposure to the testing environments. Figures 8b and c show the SEM images of steel after immersion in 1 M HCl and 0.5 M H2SO4 solutions, respectively. These reveal severe damage on the surface, in both acidic media, due to metal dissolution. Indeed, the metal surface immersed in both blank acid solutions appears rough, with plenty of pits and cavities at certain regions. In contrast, Figures 8d and e show a smooth steel surface after adding 1 mM of ECDYA, indicating a protected surface. These images suggest that the protection comes from the formation of ECDYA layer on the CS surface that prevents the attack of acids.

Fig. 8
figure 8

Images obtained by SEM of the steel surfaces a before corrosion and after immersion for 3 h at 293 K in b 1 M HCl, c 0.5 M H2SO4, d 1 M HCl + 1 mM ECDYA) and e 0.5 M H2SO4 + 1 mM ECDYA

3.7 Properties of Inhibitor and Inhibitive Mechanism

Weight loss results indicate that ECDYA is effectively an inhibitor of carbon steel corrosion in acidic media. The polarisation curves show that metal dissolution and cathodic reduction reactions were inhibited by adding ECDYA to the acidic solution. This inhibition is more pronounced by increasing the concentration of the latter. The curves of the cathodic branch make it possible to obtain parallel Tafel lines with slopes (βc) of very close values indicating that the addition of the inhibitor to the aggressive medium does not modify the mechanism of the proton reduction and that this reaction is under pure activation control. This suggests that the inhibitor is first adsorbed on the metal surface and then acts by blocking the active sites of the carbon surface. In this way, the area exposed to H+ ions is decreased, but the mechanism of the reaction remains intact [79]. This indicates that the mode of action of this inhibitor is due to its adsorption on the surface of the metal. The analysis of impedance spectra obtained by electrochemical impedance spectroscopy also shows that the corrosion rate of steel is decreased in the presence of ECDYA. And because this decrease in the rate of corrosion is related to the decrease of Cdl values and it is well established that the decrease of the values of the capacity of the double layer, Cdl can occur only if there is a decrease the local dielectric constant and/or an increase in the thickness of the double layer [80], it can once again be concluded that the molecules of this inhibitor adsorb on the metal surface thus preventing the strong attack of the aggressive agent. The study of surface morphology of carbon steel samples emerged in 1 M HCl and 0.5 M H2SO4 solutions in the absence and in the presence of 1 mM ECDYA revealed that severe surface damage suffered in the absence of ECDYA was attenuated in his presence. This suggests that the molecules of this inhibitor serve as a shield by adsorbing at the steel/acid interface thus weakening the attacks of the aggressive agent of the medium. The calculation of the ∆Gads values (Table 4) indicates that the value of ∆Gads is between the values of the physical adsorption and those of the chemical adsorption thus showing that the adsorption of the ECDYA on the surface of the steel is serving two types of interaction [81]. It can, therefore, be considered that the inhibitory action of this compound is carried out by the following two routes:

(a) Physisorption

This process occurs after the protonation of the inhibitor molecules in each of the two media studied according to Eq. (24).

$${\text{In}} + {\text{H}}^{ + } \to {\text{InH}}^{ + } \left( {{\text{In}}:{\text{ inhibitor molecule}}} \right)$$
(24)

Likhanova et al. [82], summarised the reactions of the anodic dissolution of metals (M) in acidic aqueous solutions (e.g. H2SO4) as follows:

$${\text{M}} + {\text{nH}}_{2} {\text{O }} \leftrightarrow {\text{M}}({\text{H}}_{2} {\text{O}}){\text{n}}_{\text{ads}}$$
(25)
$${\text{M}}\,({{\text{H}}_2}{\text{O}}){n_{{\text{ads}}}} + {\text{SO}}_4^{2 - } \leftrightarrow {\text{M}}\,{[{({{\text{H}}_2}{\text{O}})_n}{\text{SO}}_4^{2 - }]_{{\text{ads}}}}$$
(26)
$${\text{M}}\,{[{({{\text{H}}_2}{\text{O}})_n}{\text{SO}}_4^{2 - }]_{{\text{ads}}}} \to {\text{M}}\,{({{\text{H}}_2}{\text{O}})_n}{\text{S}}{{\text{O}}_4}{]_{{\text{ads}}}} + 2{e^{-}}$$
(27)
$${[{\text{M}}\,{({{\text{H}}_2}{\text{O}})_n}{\text{S}}{{\text{O}}_4}]_{{\text{ads}}}} \to {{\text{M}}^{2 + }} + {\text{O}}{{\text{H}}^ - } + {\text{SO}}_4^{2 - } + {{\text{H}}^ + }$$
(28)

It can be thought that the charged molecules of the inhibitor which are present in these solutions prevent the progress of step (27) and consequently step (28) by forming a monomolecular layer as a complex on the carbon steel surface (Eq. (29)).

$${\text{M}}\,{[{({{\text{H}}_2}{\text{O}})_n}{\text{SO}}_4^{2 - }]_{{\text{ads}}}} + {\text{In}}{{\text{H}}^ + } \to {([{\text{M}}{({{\text{H}}_2}{\text{O}})_n}{\text{S}}{{\text{O}}_4}]{\text{InH}})_{{\text{ads}}}^{-}}$$
(29)

In addition to the formation of this monomolecular layer, according to this same reference, the formation of inhibitor multilayer of \({\text{InH}}^{ + }\) \({\text{SO}}_{4}^{2 - }\) \({\text{InH}}^{ + }\) (Eq. (30)) is not sidelined. The multilayer is stabilised by Van der Waals cohesion forces between the charged form of the inhibitor molecule and the counter ion of the protic acidic solution [83], which allows the formation of a more closely film on the metal/solution interface.

$$([{\text{M}}{\kern 1pt} {({{\text{H}}_2}{\text{O}})_n}{\text{S}}{{\text{O}}_4}]{\text{InH}})_{{\text{ads}}}^ - + {\text{In}}{{\text{H}}^ + } + {\text{SO}}_4^{2 - } \to {({[{\text{M}}{({{\text{H}}_2}{\text{O}})_n}{\text{S}}{{\text{O}}_4}]_{{\text{ads}}}}{\text{InH}})^ - }{\text{In}}{{\text{H}}^ + }{\text{SO}}_4^{2 - }/{\text{In}}{{\text{H}}^ + }){\kern 1pt} {)_{{\text{ads}}}}$$
(30)

For the inhibition of the cathodic evolution of hydrogen, it can be seen as follows: The presence of the molecule of the inhibitor in the corrosive solution delays the rate of the reaction of Volmer (\({\text{M }} + {\text{H}}^{ + } + {\text{e}}^{ - } \leftrightarrow {\text{MH}}_{\text{ads}}\)) representing the first step in the Volmer–Tafel mechanism describing the evolution of hydrogen or decreases the rate of the Heyrovsky reaction (\({\text{MH}}_{\text{ads}} + {\text{H}}^{ + } + {\text{e}}^{ - } \leftrightarrow {\text{H}}_{2} + {\text{M}}\)) forming the second step of the Volmer–Heyrovsky mechanism leading to the formation of hydrogen gas, and this, thanks to the competition in the consumption of the electrons of this molecule charged with the hydrogen ion according to the following equation:

$${\text{M }} + {\text{InH}}^{ + } + {\text{e}}^{ - } \leftrightarrow {\text{M}}({\text{InH}})_{\text{ads}}$$
(31)

(b) Chemisorption

The molecules of this inhibitor (ECDYA) in their neutral (non-protonated) form transfer their free electrons from the heteroatoms they possess (O, N and S) and the π-electrons from the multiple bonds to the d-orbitals of iron atoms at the surface of the metal leading to the formation of coordination bonds between the metal and these molecules in the same way as several organic inhibitors [84,85,86,87].

3.8 Quantum Chemical Calculations

The computed total energies at the DFT CAM-B3LYP/def2-TZVPP level for optimised structures of the two possible isomers (Fig. 9), confirms that compound 2 is more stable than the isomer 1. We then focus our analysis on the local reactivity of the isomers 2 in order to predict the reactive sites of this compound. The molecular structure of isomers 2 and the atom-numbering structure are shown in Fig. 1. The optimised molecular structures and the frontier molecule orbital density distribution of the title molecule are given in Fig. 10, and the calculated quantum chemical parameters are listed in Table 6. The distribution of the electron density HOMO and LUMO of the molecule is shown in Fig. 10. It is observed that the distribution of the density HOMO (blue regions) is localised on the heteroatoms (N, O and S) indicating the preferred sites for a electrophilic attack of metal cations. On the other hand, the distribution of the electronic density LUMO (brown regions) is localised on the centres –S–, –C– S–, –C=O and –C≡N indicating the sites able to accept electrons, which can also show that the molecule can certainly accept electrons. HOMO energy (EHOMO) indicates the tendency of a molecule to give electrons to a suitable low energy acceptor molecule or an empty electron orbital, whereas the LUMO energy (ELUMO) characterises the sensitivity of the molecule to a nucleophilic attack [88]. In-depth analysis of these orbitals shows that the HOMO and LUMO are localised mainly on the S1, S2, C2, C4 and N1 atoms, with proportions of the 18% (S1), 32% (S2), 30% (C2) and 10% (N1) in HOMO, and 12.7% (S1), 10% (S2), 14% (C2) and 36% (C4) in LUMO orbitals. These results revealed the reactive sites of the inhibitor molecule susceptible to electrophilic and nucleophilic attacks with the steel surface. The dipole moment (μ) value of ECDYA (7.7564 D) was much higher than that of H2O (1.8546 D), demonstrating that the investigated ECDYA inhibitor was tending to adsorb on the metallic surface as a replacement for H2O molecular which leads to good protection.

Fig. 9
figure 9

DFT- optimised structures of the two possible isomers

Fig. 10
figure 10

Optimised structures, HOMO and LUMO of ECDYA at CAM-B3LYP/311 ++G(d,p)

Table 6 Calculated quantum chemical parameters of the title compound at CAM-B3LYP/311 ++G(d,p) level

The natural population analysis (NPA), ChelpG [89] and Mulliken charge analysis (collected in Table 7) have been calculated in order to provide a quantitative description of the electron density redistribution. In view of the above results, the O1 atom has more negative charge followed by O2, C7 and C9, therefore suggests that, a greater electron donor character of the O1 atom than the other sites. It should also be noted, that this inhibitor molecule has a greater tendency to adsorb on the steel surface as it represents several highly negative charged centres (O1, O2, C7 and C9). In addition, analysis of the local reactivity and regioselectivity of our inhibitor structure (Table 7), investigated by Fukui indices under Mulliken populations show that the S2 atom is associated with the maximum values of f+ and f−, and therefore reveals that this atom is likely to be engaged in both nucleophilic and electrophilic attack. However, the positive sign of Δf indicating that the S2 atom is more susceptible to nucleophilic than electrophilic attack. Figure 11 schematically illustrates the agreement of assumptions and conclusions drawn from the experimental results with those contemplated by quantum chemical calculations.

Table 7 Calculated atomic charges on the selected atom of the title compound at CAM-B3LYP/311 ++G(d,p) level
Fig. 11
figure 11

Schematic representation of the adsorption component of ECDYA on the carbon steel surface in corrosive media (HCl or H2SO4 solution)

4 Conclusion

The main conclusions drawn from this examination are:

Ethyl 2-cyano-2-(1,3-dithian-2-ylidene) acetate (ECDYA) effectively inhibits carbon steel corrosion in 0.5 M H2SO4 and 1 M HCl solutions and the inhibition efficiency increases with inhibitor concentration at all temperatures studied. The polarisation curves show that this inhibitor is of the mixed type. The Langmuir adsorption isotherm is best suited for expressing the adsorption process of the inhibitor at the surface of the carbon steel, and the negative value of the Gibbs free energy of adsorption (∆Gads) is indicative of a strong interaction between the inhibitor molecules and the surface of carbon steel. The protection proprieties of ECDYA for carbon steel corrosion are better in 0.5 M H2SO4 than in 1 M HCl. The increasing value of CPE exponent (n) with increasing inhibitor concentration indicated that the surface roughness decreased with increasing inhibitor concentration. The SEM study agrees with this conclusion. The measurements of weight loss, polarisation and electrochemical impedance spectroscopy are in good agreement. The DFT study also confirms the inhibitory action of ECDYA by adsorption.