Introduction

Hydrochloric acid pickling bath is used to remove the corrosion products from the metal working. Over-pickling can cause serious damage and physical properties of metals’ structure can be easily done [1]. Thus, to control the risk and reduce the problem, several organic compounds are used as corrosion inhibitors [2,3,4,5].

Currently, most of the effective inhibitors used have in their structure:

  1. 1.

    heteroatoms such as oxygen (O), nitrogen (N), phosphorus (P), sulfur (S);

  2. 2.

    aromatic component having multiple bonds leading to easier adsorption on the metal surface;

  3. 3.

    functional groups such as = NH, –CHO, –C≡N, –N = N–…;

  4. 4.

    heterocyclic compounds such as imidazole, quinoline, quinoxaline, phenyltetrazole, etc. [6, 7].

In this case, we have established that triazepine carboxylate compounds can easily be protonated in acidic medium, thus getting adsorbed on the surface metal.

Recently, some workers have reviewed and provided a literature survey of triazepines compounds. The synthesis and characterization of a family of triazepine derivatives are of particular interest to the chemical and biological communities, and hence the chemistry and biochemistry of triazepine derivatives have been intensively investigated. Triazepine derivatives have diverse applications in wide-ranging fields, they have remarkable biological importance and medicinal and pharmaceutic potential. Some known derivatives of imidazotriazepines have shown activity as muscle relaxants, while others have antifungal, antidiabetic, antimicrobial, antiviral, anticancer, and analgesic properties [8,9,10].

Propelled by our interest in the synthesis of new efficient inhibitors, triazepines carboxylate substituted compounds (Cl–Me–CO2Et, Cl–Me–CN and Me–CN) have been developed, representing a promising way to improve the performance of corrosion inhibition in aggressive hydrochloric acid solution, owing to the existence of the cyano group.

The objective of the present paper is to study the inhibition efficiencies of triazepine carboxylate derivatives on mild steel corrosion in 1.0 M HCl and compare using weight loss measurements, electrochemical impedance spectroscopy, and potentiodynamic polarization analysis. Furthermore, quantum chemical calculations of density function theory (DFT) and molecular dynamics (MD) simulations were applied to theoretically determine the relationship between molecular structure and inhibition efficiency.

Surface morphology of the mild steel before and after exposing to 1.0 M HCl medium is also examined and discussed using scanning electron microscopy (SEM) and using 3D-profilometry images.

Experimental details

Materials and weight loss measurements

Mild steel specimens used have a rectangular form of 2.5 cm × 2.0 cm × 0.05 cm and have the following chemical composition (wt%): C, 0.11; Si, 0.24; Mn, 0.47; Cr, 0.12; Mo, 0.02; Ni, 0.1; Al, 0.03; Cu, 0.14; Co, < 0.012; V, < 0.003; W, 0.06; Fe, balance. The samples’ surface was polished with emery paper, rinsed with distilled water, degreased with ethanol, and dried in hot air. The immersion time for mass loss was 6 h at 298 ± 2 K. After immersion period, the samples were cleaned according to ASTM practice standard, and reweighed to 10−4 g for determining corrosion rate [11, 12]. The hydrochloric acid pickling medium (1.0 M HCl) was prepared by dilution of analytical grade 37% of HCl with distilled water.

Electrochemical cell

The electrolysis cell used for potentiodynamic polarization measurement was a borosilicate glass cylinder closed by a cap with five apertures. The mild steel used as working electrode was pressure-fitted into a Polytetrafluoroethylene holder exposing only 1 cm2 of area to the 1.0 M hydrochloric acid medium. Platinum and saturated calomel were used as counter and reference electrode, respectively. All potentials were measured against the previous electrode.

The potentiodynamic polarization curves were recorded by changing the electrode potential automatically from negative values to positive values versus EOCP using a potentiostat/galvanostat type PGZ 100, at a scan rate of 1 mV/s after 30 min of immersion time until reaching steady state. The test solution was thermostatically controlled at 298 ± 2 K in air atmosphere without bubbling. To evaluate corrosion kinetic parameters, a fitting by Stern–Geary equation was used. To do so, the overall current density values, i, were considered as the sum of two contributions, anodic and cathodic current (ia) and (ic), respectively. For the potential domain not too far from the open circuit potential, it may be considered that both processes followed the Tafel law [13]. Thus, it can be derived from Eq. (1):

$$i = i_{\text{a}} + i_{\text{c}} = i_{\text{corr}} \left\{ {\exp \left[ {b_{\text{a}} \times \left( {E - E_{\text{corr}} } \right)} \right] - \exp \left[ {b_{\text{c}} \times \left( {E - E_{\text{corr}} } \right)} \right]} \right\} \,$$
(1)

where icorr is the corrosion current density (A cm−2), ba and bc are the Tafel constants of anodic and cathodic reactions (V−1), respectively. These constants are linked to the Tafel slopes β (V/dec) in usual logarithmic scale given by Eq. (2):

$$\beta = \frac{\ln 10}{b} = \frac{2.303}{b} \,$$
(2)

The corrosion inhibition efficiency is evaluated from the corrosion current densities values using the relationship (3):

$$\eta_{\text{pp}} \left( \% \right) = \left( {\frac{{i_{\text{corr}} - i_{{{\text{corr}}\left( {\text{inh}} \right)}} }}{{i_{\text{corr}} }}} \right) \times 100$$
(3)

The surface coverage values (θ) have been obtained from polarization curves for various concentrations of inhibitor using the following Eq. (4) [14]:

$$\theta_{\text{PP}} = 1 - \left( {i_{{{\text{corr}}\left( {\text{inh}} \right)}} /i_{\text{corr}} } \right)$$
(4)

where (icorr) and (icorr(inh)) are the corrosion current densities values without and with inhibitor, respectively.

The electrochemical impedance spectroscopy (EIS) tests were carried out using potentiostat/galvanostat type PGZ 100 and controlled by software model (Voltamaster 4) under static conditions. The same condition and equipment as above were used. The EIS experiments were conducted in the frequency range with high limit of 100 kHz and different low limit 0.1 Hz at open circuit potential (EOCP), with 10 points per decade, at the rest potential, after 30 min of acid immersion, by applying 10 mV ac voltage peak-to-peak. Nyquist plots were made from these experiments. The impedance data were analyzed and fitted with the simulation ZView 2.80, equivalent circuit software.

To ensure reproducibility, all experiments were repeated three times where the evaluated inaccuracy did not exceed 10%.

The inhibition efficiencies ηEIS % were calculated from Nyquist plots by Eq. (5):

$$\eta_{\text{EIS}} \left( \% \right) = \left( {\frac{{R_{{{\text{ct}}\left( {\text{inh}} \right)}} - R_{\text{ct}} }}{{R_{\text{ct}} }}} \right) \times 100$$
(5)

where Rct and Rct(inh) are the ac transfer resistance of mild steel electrode in the uninhibited and inhibited solutions, respectively.

Computational details

The molecular dynamics (MD) simulations were performed using Material Studio. Fe (110) surface was chosen for the simulation study. COMPASS force field was used to optimize the structures of all components of the system. The most stable plane of crystalline metals is the one with densely packed structure, and it is commonly used in molecular dynamics simulations to represent the corroding substrate metal [15, 16]. The simulations were performed in a simulation box of dimensions (3.44 nm × 4.05 nm × 5.34 nm). The molecular dynamics simulations were carried out with periodic boundary conditions to model a representative part of the interface devoid of any arbitrary boundary effects. First, the surface of pure Fe crystal was cleaved, and relaxed by minimizing its energy by means of molecular mechanics. Next, the surface of cleaved plane Fe (110) was enlarged to a super cell of an appropriate size, and then a vacuum slab with zero thickness was built above these surfaces. Since corrosion inhibition in aqueous solution is an electrochemistry process, the use of water molecules and different ions is essential. The effect of chemical species involved in the adsorption system was taken into consideration, thus the system in the molecular dynamics simulations incorporated 250 H2O, 5 H+, 5 Cl and one inhibitor molecule in each case [17]. Finally, the most stable orientation of inhibitor molecules on metal surface was searched by Monte Carlo search simulations. The molecular dynamics simulations were performed at 298 K (controlled by the Andersen thermostat) using a canonical ensemble (NVT) with a time step of 1.0 fs, and a simulation time of 500 ps. For the whole simulation procedure, the COMPASS (Condensed-phase Optimized Molecular Potentials for Atomistic Simulation Studies) force field [18] was used, because it allows accurate and simultaneous prediction of structural, conformational, vibrational, and thermophysical properties for a broad range of chemical species, including organic molecules, metals, metal oxides, and metal halides [19].

All computations have been carried out with the Gaussian package program. For calculations, the hybrid exchange correlation functional (B3LYP) method was a turning point for DFT methods and polarized basis sets such as 6-311G (d,p), 6-311++G (d,p), 6-311G++ (2d,2p) were preferred. A full optimization was performed up to a higher basis set denoted by 6-31G++ (d,p), because this basis set gives more accurate results in terms of the determination of geometries and electronic properties for a wide range of organic compounds. These calculations were performed in the gas phase, hydrochloric acid solution and for the protonated forms.

So, Parr and al. defined derivatives of the electronic energy (E) with respect to number of electrons (N) at a constant external potential υ(r), chemical reactivity indices such as chemical potential (μ), electronegativity (χ) and chemical hardness (η). According to them, these above-mentioned parameters are given as [20, 21]:

$$\chi = - \mu = - \left( {\frac{\partial E}{\partial N}} \right)_{\upsilon (r)}$$
(6)
$$\eta = \frac{1}{2}\left( {\frac{\partial \mu }{\partial N}} \right)_{\upsilon (r)} = \frac{1}{2}\left( {\frac{{\partial^{2} E}}{{\partial N^{2} }}} \right)_{\upsilon (r)}$$
(7)

In addition, the chemical hardness (η), chemical potential (µ) and electronegativity (χ) were calculated using the following equations [22]:

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

where I and A are the first vertical ionization energy and electron affinity values of any chemical system, respectively.

However, the negative of the highest occupied molecular orbital energy (EHOMO) and the negative of the lowest unoccupied molecular orbital energy (ELUMO) correspond to ionization energy and electron affinity which were calculated using the following equations [23]:

$$\mu = - \chi = \frac{{E_{\text{LUMO}} + E_{\text{HOMO}} }}{2}$$
(10)
$$\eta = \frac{{E_{\text{LUMO}} - E_{\text{HOMO}} }}{2}$$
(11)

Global softness is defined as the inverse of global hardness and is given as [24, 25]:

$$S = \frac{1}{\eta } = 2\left( {\frac{\partial N}{\partial \mu }} \right)_{\upsilon (r)}$$
(12)

Electrophilicity [26] that indicates the tendency of the inhibitor molecule to accept electrons is an important parameter in terms of the comparison of corrosion inhibition efficiencies of molecules. This parameter is defined via the following equation [27]:

$$\omega = \frac{{\mu^{2} }}{2\eta } = \frac{{\chi^{2} }}{2\eta }$$
(13)

Surface morphology analysis

3D optical profiler images and scanning electron microscope (SEM) were used to examine the polished surface of mild steel samples before and after immersion in 1.0 M HCl (blank solution), and the inhibited solution with 10−3 M of inhibitor at 298 K.

Experimental result

Synthesis and characterization of inhibitors

The newly synthesized triazepine carboxylate derivatives studied were synthesized according to the procedure below (Method for the synthesis) and confirmed by spectral studies such as FT-IR, 1H NMR, 13CNHMR and MS. Their characterization data and also, the International Union of Pure and Applied Chemistry (IUPAC) name, molecular structure and molecular formula are recorded in Table 1

Table 1 IUPAC name, molecular structure, molecular formula, molecular weight, melting point, FT-IR, 1H NMR and 13C NMR and MS data

.

Method for the synthesis

A solution of epoxide 2 (1 mmol) in acetonitrile (20 mL) was added to 1,6-diaminopyridone 1 (1,2 mmol). The mixture was then refluxed for 36 h. After that, the solvent was removed under reduced pressure and the crude product was treated with a mixture of ether/petroleum ether. The desired pyrido[1,2b] [1, 2, 4] triazepine-2,7-dione derivatives 3a–l were precipitated and then were recrystallized using the proper solvent (Scheme 1) [10].

Scheme 1
scheme 1

Synthesis reaction of the pyridotriazepines 3a–c

Corrosion of mild steel in 1.0 M HCl and its inhibition

Weight loss measurements

The effect of different concentrations of triazepine carboxylate derivatives on mild steel corrosion in 1.0 M HCl was studied using the gravimetric method. For every concentration, the mean value of the corrosion rate ωcorr (mg cm−2 h−1) was determined and the inhibition efficiency, ηω%, was calculated using Eq. (14):

$$\eta_{\omega } \% = \frac{{\omega_{\text{corr}}^{0} - \omega_{\text{corr}} }}{{\omega_{\text{corr}}^{0} }} \times 100$$
(14)

The surface coverage values (θ) have been obtained from weight loss measurements using the following equation:

$$\theta_{\omega } = 1 - \frac{{\omega_{\text{corr}} }}{{\omega_{\text{corr}}^{0} }}$$
(15)

Inhibition coefficient (\(\gamma\)) was calculated using Eq. (16):

$$\gamma = \frac{{\omega_{\text{corr}}^{0} }}{{\omega_{\text{corr}} }}$$
(16)

where \(\omega_{\text{corr}}^{0}\) and ωcorr are the corrosion rate in uninhibited and inhibited solutions, respectively.

The obtained results are given in Table 2.

Table 2 Weight loss data of mild steel in 1.0 M HCl without and with different concentrations of substituted triazepine carboxylate derivatives at 298 ± 2 K after 6 h of immersion

It is showed that the inhibition efficiencies increase with concentrations and reach a maximum value of 93.2%, 88.9% and 87.4% at 10−3 M of Cl–Me-Et, 2Cl–Me and 2Cl–Et, respectively. However, if the concentration of the inhibitor is increased beyond certain (optimum) value, the inhibitor molecules adsorb perpendicularly onto the metallic surface due to electrostatic repulsion between the molecules at higher concentration. Therefore, after the optimum concentration of the inhibitor, the inhibition performance does not change significantly. On the other hand, the effectiveness of organic compounds mainly depends on their size and their active centers [28]. It is noted also that the inhibition efficiency follows the order: Cl–Me–CN ≈ Me–CN > Cl–Me–CO2Et. It is revealed that the inhibition coefficient reaches a maximum value of 18.82, 16.78 and 8.17 at 10−3 M of Cl–Me–CN, Me–CN and Cl–Me–CO2Et respectively. This order can be explained by the rise of the effective electron density at the functional group of inhibitors [28, 29]. So, the compounds have aromatic or heterocyclic ring, the effective electron density at the functional group can be changed by the introduction of different substituents in the ring causing variations in their molecular structure leading to a change in their corrosion inhibition efficiencies. The high inhibition efficiency of Cl–Me–CN and Me–CN compared to Cl–Me–CO2Et is due to the presence of nitrile (–C≡N) cyano group. In addition, high-efficiency protective film for Cl–Me–CN compared to Me–CN is due to the presence of methyl group –(Cl) group. The nucleophilic (electron releasing) character of –(Cl) is higher than the electrophonic (electron withdrawing).

Potentiodynamic polarization curves

The potentiodynamic polarization behavior of mild steel in 1.0 M HCl without and with different concentrations of all substituted triazepine carboxylate compounds is shown in Fig. 1a–c. Their electrochemical data are given in Table 3. It is known that the electrochemical reactions of the mild steel in acidic medium, in the absence of inhibitors, are the anodic dissolution of iron and cathodic of proton reduction reactions:

Fig. 1
figure 1

Potentiodynamic polarization curves for mild steel in 1.0 M HCl in the absence and presence of various concentrations of a Cl–Me–CO2Et, b Cl–Me–CN and c Me–CN

Table 3 Electrochemical parameters for mild steel in 1.0 M HCl at various concentrations of inhibitors

At the anode electrode:

$${\text{Fe}} \leftrightarrow {\text{Fe}}^{2 + } + 2{\text{e}}^{ - }$$
(17)

And while iron is corroding, the rate of reaction is usually controlled by the cathodic process (hydrogen):

$$2{\text{H}}^{ + } + 2{\text{e}}^{ - } \leftrightarrow {\text{H}}_{2}$$
(18)

It can be shown that the triazepine carboxylate derivatives addition hinders the acid attack on mild steel. It is noted also that the inhibitors’ addition shifts slightly the Ecorr to the anodic directions. According to Riggs [4], if the displacement in:

  1. 1.

    E is > 85 mV/Ecorr, the inhibitor can be classified as a cathodic or anodic type;

  2. 2.

    E is < 85 mV/Ecorr, it can be classified as a mixed type.

In our study, this displacement in the case of all products was more than 85 mV/Ecorr which indicated that all these compounds were classified as the mixed-type inhibitors.

In addition, it is clear that the current density decreases with concentrations indicating that these compounds are adsorbed on the metal surface.

However, it is observed that these inhibitors have an effect on both the cathodic and anodic slopes (βc and βa) signifying a modification of cathodic hydrogen evolution (Eq. (17)) mechanism as well as anodic dissolution of iron (Eq. (18)). In addition, the change in βa may be ascribed to changes in the charge transfer coefficient αa for anodic dissolution of ‘Fe’ by virtue of the presence of an additional energy barrier due to the presence of adsorbed inhibitors [30].

Finally, it is seen also that the ηPP followed the order: Cl–Me–CN > Me–CN > Cl–Me–CO2Et such as found by the weight loss measurements.

Besides, the recorded polarization curves in the presence of triazepine carboxylate compounds (Fig. 1a–c) are characterized by the presence of anodic breakdown potential, Eb. This is the potential at which sudden rise in current density takes place. As a result, the surface film is shifted from a stable to unstable state. As the concentration of inhibitor increased, Eb shifted to a noble direction. The noble shift of Eb with concentrations reflected the increased inhibitors adsorption on the metallic surface. This shift in Eb with the studied triazepine carboxylate concentrations reflected the formation of anodic protective film on the electrode surface [31, 32]. However, for a potential higher than − 300 mVSCE versus Ecorr, the presence of triazepine carboxylate compounds did not change the current/potential characteristics. This potential can be defined as the desorption potential.

The phenomenon may be due to the obvious metal dissolution, which led to desorption of the inhibitor molecule from the electrode surface, in this case the desorption rate of the inhibitors is higher than its adsorption rate, so the corrosion current obviously increased with rising potential [33].

The presence of nitrile (–C≡N) cyano group and –(Cl) group on 4-(4-chlorophenyl)-3-hydroxy-2,7-dioxo-9-(p-tolyl)-1,2,5,7-tetrahydropyrido[1,2-b] [1, 2, 4] triazepine-8,10-dicarbonitrile (Cl–Me–CN) can produce protonated species in HCl by the reaction of the amino group with HCl.

On the other hand, according to Trethewey and Chamberlain [34], at a high concentration, anions present in the solution may either become inhibitive or act in such a way as to plug any pores in a passive film. The mechanism of the anodic dissolution of mild steel in HCl is [35]:

$${\text{Fe}} + {\text{Cl}}^{ - } \leftrightarrow \left[ {{\text{FeCl}}^{ - } } \right]_{\text{ads}}$$
(19)
$$[{\text{FeCl}}^{ - } ]_{\text{ads}} \leftrightarrow [{\text{FeCl}}]_{\text{ads}} + {\text{e}}^{ - }$$
(20)
$$[ {\text{FeCl]}}_{\text{ads}} \leftrightarrow [ {\text{FeCl}}^{ + } ]_{\text{ads}} + {\text{e}}^{ - }$$
(21)
$$[{\text{FeCl}}^{ + } ]_{\text{ads}} \leftrightarrow {\text{Fe}}^{2 + } + {\text{Cl}}^{ - }$$
(22)

The mechanism for cathodic hydrogen evolution is [36]:

$${\text{Fe}} + {\text{H}}^{ + } \leftrightarrow [{\text{FeH}}^{ + } ]_{\text{ads}}$$
(23)
$$[ {\text{FeH}}^{ + } ]_{\text{ads}} + {\text{e}}^{ - } \leftrightarrow [ {\text{FeH]}}_{\text{ads}}$$
(24)
$$[ {\text{FeH]}}_{\text{ads}} + {\text{H}}^{ + } + {\text{e}}^{ - } \leftrightarrow {\text{Fe}} + {\text{H}}_{ 2}$$
(25)

In this case, it would be difficult for the protonated species of the triazepine carboxylate derivatives molecules to approach the positively charged mild steel surface because of electrostatic repulsion. In the presence of Cl ions, the anions are adsorbed onto the mild steel surface which allows the protonated species of the triazepine derivatives molecules to easily approach the surface.

Electrochemical impedance spectroscopy

Figure 2a–c show typical Nyquist plots for mild steel in 1.0 M HCl in the absence and presence of different concentrations of Cl–Et–CN, Me–CN and Cl–Me–CO2Et at the EOCP. It is noted that the impedance response was composed by one capacitive loop where its diameter significantly changed after all inhibitors’ addition and the maximum was obtained at 10−3 M of triazepine carboxylate compounds. This capacitive loop can be attributed to the charge transfer reaction.

Fig. 2
figure 2

Nyquist plots for mild steel in 1.0 M HCl solution in the absence and presence of various concentrations of a Cl–Me–CO2Et, b Cl–Me–CN and c Me–CN at 298 ± 2 K: (scatter) experimental; (red line) fitted data

The used equivalent electric circuit with one time constant was presented in Fig. 3. This circuit contains the parameters which can be named as: Rs is the solution resistance, Rct is the charge transfer resistance and CPEdl is the constant phase element of the double layer such as indicated above.

Fig. 3
figure 3

Electrical equivalent circuits used for modeling the metal/solution interface for the three classes of mild steels

An excellent fit was obtained for all experimental data. For the description of depressed semicircles with their centers below the real axis, a constant phase element (CPE) was used and expressed as [37]:

$$Z_{\text{CPE}} = \frac{1}{{A(i\omega )^{n} }}$$
(26)

where A−1 sn cm−2) is the magnitude of the CPE, ω (rad s−1) is the sine wave modulation angular frequency, i2 = − 1 is the imaginary number and n is an empirical exponent which measures the deviation from the ideal capacitive behavior [38]. Depending on the values of n, CPE can represent resistance (n = 0), capacitance (n = 1), inductance (n = − 1) and Warburg impedance (n = 0.5) [39, 40]. The double-layer capacitance values Cdl derived from the CPE and the relaxation time constant (τ) of charge transfer process can be calculated using Eqs. (27) and (28), respectively [41].

$$C_{\text{dl}} = \sqrt[n]{{A(R_{\text{ct}} )^{1 - n} }}$$
(27)
$$\tau = C_{\text{dl}} R_{\text{ct}}$$
(28)

The impedance parameters, such as Rs, Rct, n, Cdl and inhibition efficiency ηEIS (%), obtained from fitting the EIS data using the equivalent circuit of Fig. 3, are calculated and listed in Table 4.

Table 4 Electrochemical parameters for mild steel in 1.0 M HCl in the absence and presence of different concentrations of triazepine carboxylate compounds at 298 ± 2 K

Inspection of the results in Table 4 indicated that Rct value increased with the concentration of these inhibitors. In addition, the Cdl value varies in the regular manner with triazepine carboxylate compounds concentration. The change in these parameters can be related to the gradual removal of water molecules by Cl–Et–CN, Me–CN and Cl–Me–CO2Et molecules on metallic surface and consequently leads to decrease in the number of active sites necessary for the corrosion reaction.

The increase in Rct value is also attributed to the formation of protective film on the metal/solution interface. The ongoing stability of ‘n’ (in the range of 0.803–0.903) indicates the charge transfer controlled dissolution mechanism of mild steel in the absence and presence of Cl–Et–CN, Me–CN and Cl–Me–CO2Et. Moreover, the double-layer capacitance values, Cdl, decreased with inhibitors’ concentrations which is probably due to a decrease in local dielectric constant and/or an increase in the thickness of ‘e’ electrical double layer at mild steel surface. It is know that the removal of water molecules (with high dielectric constant) with inhibitor molecules (with low dielectric constant) from the surface is accompanied by physical interaction between the metal surface and the adsorbate with increasing inhibitor molecules concentration [42]. The thickness of this protective layer (e) is evaluated from the Helmholtz model, given by the following equation [43]:

$$C_{\text{dl}} = \frac{{\varepsilon_{0} \varepsilon }}{e}S$$
(29)

where ε0 is the permittivity of space, ε is the local dielectric constant, (e) is the film thickness and S is the surface area. Equation (30) suggested that Cdl is inversely proportional to the thickness of protective layer (e). So, the decrease in values of Cdl results in increase in values of (e).

On the other hand, the inhibition efficiency of the organic compounds mainly depends on their size and their active centers [27]. Thus, the best performance of compound Cl–Me–CN as corrosion inhibitor over compound Me–CN and Cl–Me–CO2Et may be attributed to the presence of nitrile (–C≡N) cyano group and –(Cl) group. The nucleophilic (electron releasing) character of –Cl group is highest than the electrophonic (electron with drawing). So, Cl–Me–CN can produce protonated species in HCl by the reaction of the amino group with hydrochloride acid. This ammonium substituent may reduce the electronic density on the substituted triazepine carboxylate compounds.

Modeling and analysis by Zview program

Impedance diagrams were analyzed using Zview program. Bode plots (Figs. 4, 5, 6) exhibit three distinctive segments for mild steel/1.0 M HCl system.

Fig. 4
figure 4

Bode plots for mild steel in 1.0 M HCl solution in the absence and presence of various concentrations of Cl–Me–CO2Et at Ecorr (T = 298 ± 2 K): comparison of experimental (scatter) and fitting (red line) data

Fig. 5
figure 5

Bode plots for mild steel in 1.0 M HCl solution in the absence and presence of various concentrations of Me–CN at Ecorr (T = 298 ± 2 K): comparison of experimental (scatter) and fitting (red line) data

Fig. 6
figure 6

Bode plots for mild steel in 1.0 M HCl solution in the absence and presence of various concentrations of Cl–Me–CN at Ecorr (T = 298 ± 2 K): comparison of experimental (scatter) and fitting (red line) data

In the higher-frequency region with increasing frequency, the log |Z| values tend to become zero and the phase angle values fell rapidly towards 0°. This is a response of resistive behavior and corresponds to the solution resistance.

In the medium-frequency region, a linear relationship between log |Z| against log f, with a slop near − 1 and the phase angle tends to become − 90°, can be observed. This response is a characteristic of capacitive behavior.

In the low-frequency region, the resistive behavior of the electrode increases, but the region where log |Z| does not depend on log f, i.e., dc limit is not completely reached [27].

The fitted data observed by Zview software follow almost the same pattern as the experimental results along the whole diagram with an average error of about 3% in all cases. The constant phase element (CPE) has a non-integer power dependence on the frequency and is used to compensate the non-homogeneity in a system. Its impedance is described by the expression:

$$Z_{\text{CPE}} = \frac{1}{{Y\left( {j\omega } \right)^{n} }}$$
(30)

where “Y” is a proportional factor, j equals \(\sqrt { - 1}\), “ω” is 2πf, “n” is the phase shift [38]. For n = 0, ZCPE represents a resistance with R = Y−1, for n = 1 a capacitance with C = Y, for n = 0.5 a Warburg element and for n = − 1 an inductive with L = Y−1 [43].

Because it was observed that the phase shift was closely near “1”, the CPE obeys the capacitive behavior and therefore “Y” was substituted with double-layer capacitance Cdl. The impedance associated with the circuit is given by:

$$Z_{\text{CPE}} = \frac{1}{{C_{\text{dl}} \left( {j\omega } \right)^{n} }}$$
(31)
$$Z_{\text{T}} = R_{\text{s}} + Z_{ 1}$$
(32)
$$\begin{aligned} {\text{where}}\quad Z_{1} &= \left( {\frac{1}{{Z_{\text{CPE}} }} + \frac{1}{{R_{\text{ct}} }}} \right)^{ - 1}\\& = \left( {C\omega^{n} \cos \frac{n\pi }{2} + jC\omega^{n} \sin \frac{n\pi }{2} + \frac{1}{{R_{\text{ct}} }}} \right)^{ - 1} \end{aligned}$$
(33)
$$\begin{aligned} Z_{\text{T}}& = R_{\text{S}} + \frac{{\left( {\frac{1}{{R_{\text{Ct}} }}} \right) + C_{\text{dl}} \omega^{n} \cos \left( {\frac{n\pi }{2}} \right)}}{{\frac{1}{{R_{\text{Ct}}^{2} }} + C_{\text{dl}}^{2} \omega^{2n} + \left( {2C_{\text{dl}} \omega^{n} \frac{{\cos \left( {\frac{n\pi }{2}} \right)}}{{R_{\text{Ct}} }}} \right)}}\\&\quad - j\frac{{C_{\text{dl}} \omega^{n} \sin \left( {\frac{n\pi }{2}} \right)}}{{\frac{1}{{R_{\text{Ct}}^{2} }} + C_{\text{dl}}^{2} \omega^{2n} + \left( {2C_{\text{dl}} \omega^{n} \frac{{\cos \left( {\frac{n\pi }{2}} \right)}}{{R_{\text{Ct}} }}} \right)}} \end{aligned}$$
(34)

ZT is the total impedance associated with the circuit. When ω → ∞: ZT → RS and when ω → 0: ZT → RS + Rct. These limits of high and low frequencies, respectively, are both compatible with Nyquist diagram.

Initially, the RS values were obtained from the higher limit and Rct values were calculated from the difference in impedance at lower and higher frequencies (these values are written in obtained column of Table 4). ZImax and fmax were directly obtained from the impedance data. The phase shift values “n” were calculated using Eq. (6) expression and double-layer capacitance (Cdl) values were calculated from Eq. (36):

$$Z_{\text{Imax}} = \frac{{R_{\text{ct}} \sin \left( {\frac{n\pi }{2}} \right)}}{{2 + 2\cos \left( {\frac{n\pi }{2}} \right)}}$$
(35)
$$\omega_{{{\rm{max}}}} = \frac{1}{{\sqrt[{{\rm{2n}}}]{{R_{{{\rm{ct}}}}^{{\rm{2}}} C_{{{\rm{dl}}}}^{{\rm{2}}} }}}}\quad {\rm{where}}\quad \omega_{{{\rm{max}}}} = 2\pi f_{{{\rm{max}}}}$$
(36)

Table 4 shows the calculated values and difference between these values and the values that were obtained from Zview software. These results confirmed those obtained by potentiodynamic polarization curves.

However, Qdl is used to replace the double-layer capacitance. Constant phase elements have widely been used to account for deviations brought about by surface roughness such as mentioned above. The use of this parameter, similar to the constant phase element (CPE), allowed the depressed feature of the Nyquist plot to be reproduced readily. Thus, the effective calculated double-layer capacitance (Cdl) derived from the CPE parameters was determined according to the following equation:

$$C_{\text{dl}} = \left( {Q_{\text{dl}} \times R_{\text{ct}}^{ 1- n} } \right)^{{\frac{ 1}{n}}}$$
(37)

In addition, it can be observed that the differences in Zview between the calculated and obtained values are high. As a matter of fact, the maximum value that was obtained from the data is not really the maximum value of Nyquist diagram. On the other hand, interpolating the plot data provides closer different maximum values that the calculated values would be more accurate than them. Furthermore, Zview simulation has its own differences compared to real plots. Obtaining the Nyquist plots with more points per decade (Nyquist plots of this investigation obtained with 30 points per decade) to get a value closer to maximum one would lead the investigator to get better results from the calculation.

Quantum chemical calculations

The calculated quantum chemical parameters of the studied compounds using B3LYP/6-311G (d,p), B3LYP/6-311++G (d,p) and B3LYP/6-311++G (2d,2p) methods in both gas phase (Tables 5) and aqueous phase are presented in Tables 6. In addition, Fig. 7 presents the optimized molecular structure, HOMOs, LUMOs and molecular electrostatic potential maps of neutral forms of triazepine carboxylate. According to the results presented in Tables 5 and 6 in the gaseous and aqueous phases, the Cl–Me–CN molecule can be considered as a better corrosion inhibitor than the other molecules with a low energy gap (ΔE). Consequently, in terms of the energies of the frontier orbitals, the classification of corrosion inhibition efficiency of the studied molecules can be given as: Cl–Me–CN > Me–CN > Cl–Me–CO2Et. This classification is in good agreement with the experimental data.

Table 5 Calculated quantum chemical parameters for neutral forms of inhibitor molecules in gas phase (eV)
Table 6 Calculated quantum chemical parameters for neutral forms of inhibitor molecules in aqueous phase (eV)
Fig. 7
figure 7

The optimized structures, HOMOs, LUMOs and electrostatic potential structures of non-protonated inhibitor molecules using DFT/B3LYP/6-31++G (d,p)

In addition, the principles based on the chemical hardness concept are very useful in terms of estimating the directions of chemical reactions and understanding of the nature of chemical interactions [21, 44,45,46]. According to the principle of maximum hardness, a chemical compound tends to be arranged so as to obtain maximum hardness and the chemical hardness can be considered as a measure of stability. Thus, a good corrosion inhibitor is characterized by a low chemical hardness value [47]. According to the hardness values presented in Tables 5 and 6, the classification of inhibition efficiency of the studied molecules can be given as follows: Cl–Me–CN ≈ Me–CN > Cl–Me–CO2Et in the both gaseous and aqueous phases. This trend is consistent with that of experimental inhibition efficiencies.

On the other hand, the chemical hardness, softness and energy deviation (AE) are closely associated with each other. It is known also that the softness and the hardness are given on the basis of HOMO and LUMO orbital energies following the Koopman theorem. Thus, it is important to note that an effective inhibitor is characterized by a small energy gap. The order in which the values of the energy gap change is also consistent with the experimental data.

However, electronegativity is a parameter that determines the fraction of the transferred electrons (ΔN) from the inhibitory molecules to the metallic surface [48]. It can be seen from the equation given below that the value of the transferred electrons of the metal and the inhibitors decreased when the electronegativity of the inhibitor increases. According to Pearson, the fraction of electrons transferred from a corrosion inhibitor to a metal atom can be calculated by the following Eq. (38):

$$\Delta N = \frac{{\chi_{\text{M}} - \chi_{\text{inh}} }}{{2(\eta_{\text{M}} + \eta_{\text{inh}} )}}$$
(38)

where χM and χinh are electronegativity of metal and the electronegativity of inhibitor, respectively. ηM and ηinh represent the chemical hardness value of metal and chemical hardness value of inhibitor, respectively.

According to the electronegativity and chemical potential values of the inhibitor molecules, the corrosion inhibition efficiencies follow the order: Cl–Me–CN ≈ Me–CN > Cl–Me–CO2Et in gas phase and Cl–Me–CO2Et > Me–CN ≈ Cl–Me–CN aqueous phase (Tables 5 and 6).

On the other hand, electrophilicity is a useful parameter for predicting the tendency of the inhibitor molecules to accept electrons. For this reason, it should be stated that a molecule that has a high electrophilicity value is ineffective against corrosion.

The trend in which the electrophilicity values increase is as follows: Cl–Me–CN ≈ Me–CN > Cl–Me–CO2Et. Within the framework of this information, we can write the corrosion inhibition efficiency ranking of the molecules as: Cl–Me–CN ≈ Me–CN > Cl–Me–CO2Et in gas phase and Cl–Me–CO2Et > Cl–Me–CN > Me–CN aqueous phase (Tables 5 and 6). This ranking is compatible with the experimental inhibition efficiency ranking for gas phase.

On the other hand, the presence of the heteroatoms such as oxygen and nitrogen in the molecules of triazepine carboxylate leads to a high tendency for protonation in acidic medium. Thus, analysis of the protonated forms of triazepine carboxylate compounds is important in terms of the calculation of the proton affinities of neutral inhibitors. Quantum chemical parameters calculated in both gas phase and aqueous phase for protonated inhibitors are given in Tables 7 and 8. To determine the most appropriate heteroatom for protonation, the studied triazepine carboxylate has been protonated from different regions. It should be noted that a chemical compound with high proton affinity acts as a good corrosion inhibitor. If so, according to proton affinity values given in Tables 7 and 8, the corrosion inhibition efficiencies of the studied compounds follow the order: Cl–Me–CN > Me–CN > Cl–Me–CO2Et. Proton affinity values obtained have been calculated considering Eqs. (39) and (40):

$${\text{PA}} = E_{{ ( {\text{pro)}}}} - (E_{{ ( {\text{non-pro)}}}} + E_{{{\text{H}}^{ + } }} )$$
(39)

where Enon-pro and Epro are the energies of the non-protonated and protonated inhibitors, respectively. E +H is the energy of H+ ion and was calculated as:

$$E_{{{\text{H}}^{ + } }} = E_{{({\text{H}}_{3} {\text{O}}^{ + } )}} - E_{{({\text{H}}_{2} {\text{O}})}}$$
(40)
Table 7 Calculated quantum chemical parameters for protonated molecules in gas phase (eV)
Table 8 Calculated quantum chemical parameters for protonated molecules in aqueous phase (eV)

As can be seen from Tables 7 and 8, the classification of the inhibition efficiencies to be interpreted using the electrophilicity values of the protonated molecules is the same as those of the non-protonated forms: Cl–Me–CN > Me–CN > Cl–Me–CO2Et.

To conclude, the results obtained for quantum chemical calculations are generally compatible with experimental results. Considering the results obtained in the theoretical section of this study, it is found that the corrosion inhibition efficiency follows the order: Cl–Me–CN > Me–CN > Cl–Me–CO2Et.

Molecular dynamic study

Molecular dynamic simulations study was employed to provide a significant relationship between molecular structure of triazepine carboxylate inhibitors molecules and their inhibition efficiency [49, 50] adsorption mode and ability [51]. The lowest energy configuration results from Monte Carlo simulation are presented in Fig. 8. Data from MD modeling for adsorption of triazepine carboxylate compounds on Fe (110) are listed in Table 9. Furthermore, outputs and descriptors calculated by the Monte Carlo simulation are given in Table 10.

Fig. 8
figure 8

a Equilibrium configuration adsorption of investigated triazepine carboxylate compounds on Fe (110) surface in HCl solution. b Radial distribution function (RDF) of N and O atoms from investigated compounds and Fe atoms from Fe (110)

Table 9 Data from MD modeling for adsorption of triazepine carboxylate compounds on Fe (110)
Table 10 Outputs and desciptors calculated by the Monte Carlo simulation for adsorption of triazepine carboxylate compounds on Fe(1 1 0)

As can be inferred from the results in Table 9, the adsorption energies of the investigated molecules increased in the following order Cl–Me–CN < Me–CN < Cl–Me–CO2Et, and Cl–Me–CN shows the maximum negative adsorption energy. Therefore, Cl–Me–CN provides the highest inhibition abilities as compared to the other two triazepine carboxylate inhibitors. These findings confirmed the observations from quantum computational and the experimental results.

Mild steel surface is accumulated with negative charge when immersed into HCl media because chloride ions (Cl) adsorb on the metal surface according to Eq. (41) below:

$${\text{Fe}} + {\text{Cl}}^{ - } \leftrightarrow \left[ {{\text{FeCl}}^{ - } } \right]_{\text{ads}}$$
(41)

In acid solutions, triazepine carboxylate compounds could be easily protonated (reaction (42)), due to high electron density on it, leading to positively charged inhibitor species.

$$\left[ {{\text{Cl}} - {\text{Me}} - {\text{CN}}} \right] + {\text{H}}^{ + } \leftrightarrow \left[ {{\text{Cl}} - {\text{Me}} - {\text{CN}}} \right]^{ + }$$
(42)

The physical adsorption could occur via electrostatic interaction between protonated inhibitor molecules and negatively charged mild steel surface. The unshared electron pairs on (O, N) heteroatoms along with π-electrons of aromatic systems and multiple bonds contribute virtually in the adsorption process. Besides, chemical adsorption could occur via interaction of π-electrons of the aromatic rings of inhibitor with vacant d-orbitals of mild steel, resulting in formation of coordinate type of bond. Cl–Me–CN was the most efficient one because it has the highest molecular weight (443 g/mol) and contains 5 N and 3O atom which is less electronegative and more basic than N and O atoms, so it shares more electrons to the molecule than N and O atoms. Me–CN compound comes after Cl–Me–CN in %η because of the molecular size (409 g/mol).

The pair correlation function g(r) was used to characterize the degree of atom disorder in the molecule and can give a measure of the probability of finding a pair of atoms at a given distance (r) in a random distribution. The pair correlation function has been applied in structural investigations of interaction between the liquid and solid materials and in studying specific interactions such as hydrogen bonding. The g(r) of the super molecular system is obtained through analyzing the trajectory output of molecular dynamic simulation [52]. In this part, we will consider the distribution of heteroatoms (N and O) according to their importance on the adsorption process of chemical compounds on the metal surface. The pair correlation function, g(r), of N and O of triazepine carboxylate compounds atoms and iron surface atoms is displayed in Fig. 8. The radial distribution function (RDF) g (r) is a modern tool used as measure of bond length which provides an indication of the type of interaction of inhibitor molecules on metal surface. In literature, when the first peak occurs at 1–3.5 Å, this implies the chemisorption, whereas the physisorption is associated with the peaks longer than 3.5 Å. The radial distribution function of heteroatoms of inhibitors graphically presented in Fig. 9 shows that all the bond lengths are less than 3.5 Å, so chemical interactions might occur between these atoms and the metallic surface.

Fig. 9
figure 9

Scanning electron microscopy (SEM) of mild steel after immersion for 6 h in 1.0 M HCl (a) without inhibitor, (b) with 10−3 M of best inhibitor (Cl–Me–CN)

The adsorption mode of investigated derivatives on Fe (1 1 0) surface was studied by the molecular dynamics simulation method. At the molecular level, the most stable configuration of the molecules on the metal surface and the values of the adsorption (Eadsorption) between organic inhibitor and the metal surface are the results of the simulation process [53]. The most stable (lowest energy) configurations of the tested compounds on Fe (110) surfaces are depicted in Fig. 8. It was observed that the heteroatoms of the compounds adsorbed on the iron at first. Then, the remaining centers of the compounds moved gradually close to the metal surface. Therefore, as seen in Fig. 8, the studied molecules Cl–Me–CN, and Me–CN adsorbed on the Fe surfaces with an almost flat orientation, where compound Cl–Me–CO2Et is not fully oriented in flat position on metal surface. The parallel configuration as in compound Cl–Me–CN and Me–CN supports the maximum surface coverage and the higher binding interaction.

The values of Eads are large and negative which imply that the binding between the investigated inhibitors and the metal surface is spontaneous, and more negative values of the adsorption energy can be attributed to the stable and strong interaction of the inhibitor on the metal surface [54]. It is observed in Table 10 that the binding energy of Cl–Me–CN on the iron surface is higher than the energy determined for H3O+ and Cl. This supports that the inhibitors are stable on the iron surface than other competing species. It has been reported that the organic inhibitors with unoccupied orbitals promote the formation of a chelate on the metal surface by accepting electrons from a d-orbital of the metal during such strong adsorption process [55]. Therefore, the compound Cl–Me–CO2Et and Me–CN can form a stable chelate with iron after strong adsorption, and this leads to good corrosion inhibition efficiency.

Surface morphology analysis

The surface morphology of mild steel due to corrosion process was confirmed by the SEM images of the polished and corroded mild steel surface in the absence (Fig. 9a) and presence of inhibitors (Fig. 9b). Figure 9a represents the SEM image for mild steel surface in 1.0 M HCl without inhibitors. It was found that the surface morphologies served as a good indicator of the severity of corrosion attack. However, SEM images of mild steel surface in the presence of inhibitors (Fig. 9b) were observed to be smoother than that of mild surface in 1.0 M HCl alone (Fig. 9a).

Three-dimensional optical profiler images

The 3D optical profiler images of the steels surface in the absence and the presence of triazepine carboxylate (Cl–Me–CN) in 1.0 M HCl are shown in Fig. 10a, b respectively. The surface morphology revealed the formation of the adsorbed layer on the surface of mild steel in the acidic condition. It is found that the 3D optical profiler images of mild steel findings were in accordance with the scanning electron microscopy (SEM) analysis. Images (10-a) reveal that surface topography of uncorroded metal surface is shown. Addition of inhibitor (Cl–Me–CN) on mild steel has drastically reduced the rate of corrosion as shown in Fig. 10b. Further, steel surface in the presence of the inhibitor was found to be smoother. It was also observed that the metal surface is covered with inhibitor molecules forming a film which is compact on the entire surface. Moreover, it is clear from the 3D optical profiler images that the steel surface is homogeneous compared to uninhibited simple.

Fig. 10
figure 10

Three-dimensional optical profiler images of mild steel immersed for 6 h in 1.0 M HCl (a) without inhibitor, (b) with 10−3 M of Cl–Me–CN

The influence of the inhibitors’ addition on the hydrochloric acid medium is shown in Fig. 10a. The morphology shows a rough surface, characteristic of uniform corrosion of mild steel in acid, that corrosion does not occur in presence of inhibitors and hence corrosion was inhibited strongly when the inhibitors was present in the sulfuric acid solution, and the surface layer is very rough. Also, there is an adsorbed film adsorbed on mild steel surface Fig. 10b. In accordance, it might be concluded that the adsorption film can efficiently inhibit the corrosion of mild steel.

Conclusion

All the examined substituted triazepine carboxylate compounds are effective corrosion inhibitors for mild steel in 1.0 M HCl solution. The potentiodynamic polarization curves indicated that these compounds act as mixed-type inhibitors and their inhibition efficiencies increase with their concentrations to reach a maximum at 10−3 M. It is also found that the mechanism of the hydrogen reduction and the iron dissolution reactions change by the inhibitors’ addition. They act by adsorption mechanism at the metallic surface and their inhibition depended on the nature of the (–C≡N) cyano group presented in their structures and the Cl–Me–CN compound is the best inhibitor. So, it is found also that the order of the inhibition efficiencies of the studied compounds was confirmed by all techniques’ measurements. When the inhibitor was present in the solution, then scanning electron microscopy (SEM) and 3D optical profiler images observation confirmed the existence of an absorbed protective film on the mild steel surface.