Introduction

Thiadiazoles are a class of organic compounds with the formula (C2H2NH)2CS. They are heterocyclic compounds containing two nitrogen atoms and a sulfur atom in a ring system1. Thiadiazoles have various applications, including as fungicides, herbicides, insecticides, anti-inflammatory agents, and intermediate compounds in drug synthesis and the development of novel materials2. Some well-known thiadiazoles are metconazole and fenbuconazole. Our observations have led us to study the corrosion inhibition properties of 2-(1,3,4-thiadiazole-2-yl)pyrrolidine (2-TP). 2-TP was chosen as a corrosion inhibitor due to its heterocyclic structure, which includes a pyrrolidine functional group, three nitrogen atoms, and one sulfur atom in the ring. Its π electrons allow it to easily bond to mild steel (MS), reducing corrosion. It is commercially available or can be synthesized using green chemistry, resulting in a good yield. The mechanism of action of thiadiazoles as corrosion inhibitors is based on their ability to adsorb onto the metal surface and form a protective film. This film acts as a physical barrier, preventing corrosive species from reaching the metal surface and thus inhibiting the corrosion process. The adsorption process is influenced by factors such as the concentration of the inhibitor, pH, temperature, and the nature of the metal surface3,4. Mild steel is versatile and affordable, making it a popular choice for various industries5,6. It has low carbon content, making it easy to shape and weld, and its durability makes it ideal for construction and machinery7,8,9,10. Mild steel is also relatively cheap compared to other steels. Pickling is a metal surface treatment process that removes impurities, such as rust, scale, and oxidation, from the surface of metal. It is typically done by immersing the metal in a pickling solution, which is usually an acidic solution11,12,13. In industries, hydrochloric acid is commonly used as a pickling solution due to its high reactivity and ability to remove impurities efficiently. The concentration and temperature of the pickling solution are carefully monitored to ensure it does not damage the metal or corrode it14,15. Acid pickling is a process used to remove surface oxides and other impurities from steel by immersing it in an acidic solution. This process can lead to corrosion of the steel if not properly carried out. During the acid pickling process, the acid solution can attack the steel and dissolve some of the metal, leaving it vulnerable to corrosion. Additionally, if the pickling solution is not properly neutralized after the process, residual acid can remain on the steel and cause corrosion over time16. To prevent corrosion from acid pickling, it is important to use the appropriate acid concentration, temperature, and immersion time, and to properly neutralize the steel after the pickling process. Other factors such as the quality of the steel and the environment in which it is used can also affect its susceptibility to corrosion17. After the pickling process, the metal is rinsed with water, dried, and prepared for further processing or fabrication. Corrosion of substrates can be prevented or minimized through various methods, such as coating, galvanizing, electroplating, anodizing, using corrosion inhibitors, selecting corrosion-resistant materials, maintaining a controlled environment, and regular maintenance18,19,20. The molecular interaction between organic molecules and the metal surface is distributed or transmitted through chemical adsorption, resulting in the creation of a coordinated covalent bond. Physical adsorption involves Van der Waals and electrostatic interactions between the loaded organic molecules and the contaminated metal surface21,22,23. Physical adsorption is easily reversible and the organic molecules can be removed by simple washing or heating23. Chemical adsorption, on the other hand, is more permanent and the organic molecules become strongly bonded to the metal surface, making it more difficult to remove them24,25. Both physical and chemical adsorption play important roles in industrial processes such as catalysis, separation, and purification26. Understanding the differences between these two types of adsorption is critical in optimizing these processes6,27,28,29,30. Several types of thiadiazoles have been synthesized and tested as corrosion inhibitors. Some examples include 1,2,4-thiadiazole, 1,3,4-thiadiazole, 1,2,3-thiadiazole, and their derivatives. The inhibitive properties of these compounds depend on their chemical structure, and modifications can be made to enhance their effectiveness31,32. Studies have shown that thiadiazoles can effectively inhibit the corrosion of various metals, including steel, copper, and aluminum, in different environments such as acidic, neutral, and alkaline solutions. The inhibitive efficiency of thiadiazoles can be improved by combining them with other compounds, such as surfactants, and by using them in combination with other corrosion inhibitors33. Thiadiazoles have a wide range of applications in the field of corrosion inhibition, including in the oil and gas industry, the construction industry, and in the protection of cultural heritage sites. They are also used as additives in coatings and paints to improve their anti-corrosive properties31,32,33. Overall, thiadiazoles have shown promise as effective corrosion inhibitors for a variety of metals in different environments. Further research is needed to explore their potential in real-world applications and to optimize their inhibitive properties. The purpose of this paper is to examine the efficacy of 2-TP as a corrosion inhibitor for mild steel in a 1 M HCl solution. The impact of 2-TP (Fig. 1) at different concentrations was analyzed through weight loss, electrochemical impedance spectroscopy, potentiodynamic polarization, and adsorption isotherms. Density functional theory was also used to determine the corrosion inhibition efficiency of 2-TP. This method is cost-effective and efficient, offering a deeper understanding of the corrosion inhibition mechanism compared to traditional methods.

Figure 1
figure 1

The chemical structure of 2-TP.

Materials and methods

The base substrates for weight loss measurements and electrochemical corrosion experiments were mild steel samples purchased from the Company of Metal Samples. Specimens (Table 1) with a cubic area of 1 cm2 were used for PDP and EIS measurements, while specimens of 2.50 × 2.00 × 0.03 cm were employed in weight loss measurements. The specimens were prepared for each test by abrading with silicon carbide sheets (120, 600, and 1200) and washing with distilled water and acetone according to the standard technique, ASTM/G1-0334. The 1 M HCl assay solution was made with 37% analytical grade HCl and double-distilled water. The corrosion measurements were performed in non-stirring openair conditions with varying inhibitor concentrations.

Table 1 Chemical composition of metallic substrate (weight percentage).

Weight loss techniques

The metallic substrate underwent testing with an untreated solution of 1 M HCl and a treated solution of 1 M HCl with a tested inhibitor at concentrations of 0.1, 0.2, 0.3, 0.4, 0.5, and 1.0 mM. The exposure durations were 1, 5, 10, 24, and 48 h at a temperature of 303 K. The effect of temperature was also studied by exposing the un-inhibited and inhibited solution to temperatures of 313, 323, and 333 K for 5 h, as specified by NACE TM0169/G3135. After testing, the coupons were removed and treated according to ASTM standard G1-0334. The mean mass loss was used to calculate the corrosion rate35, and the inhibitory performance (IE%) and surface coverage (θ) were determined using Eqs. (13)

$$C_{R } \left( {{\text{mg}}\,\,{\text{cm}}^{ - 2} \,\,{\text{h}}^{ - 1} } \right) = \frac{W}{at}$$
(1)
$$IE\% = \left[ {1 - \frac{{C_{R(i)} }}{{C_{Ro} }}} \right] \times 100$$
(2)
$$\theta = 1 - \frac{{C_{R\left( i \right)} }}{{C_{Ro} }}$$
(3)

where \(W\) is the weight loss (mg), \(a\) is the area (cm2), and \(t\) is the exposure time (h).

Electrochemical measurements

The electrochemical measurements were performed using a Gamry water-jacketed glass cell to measure the steady-state corrosion rate. The cell setup consisted of MS samples, a graphite rod, and a saturated calomel electrode (SCE) serving as the working, counter, and reference electrodes respectively. The analysis was conducted using a Gamry Device Potentiostat/Galvanostat/ZRA (REF 600) model and the accompanying software. The potentiodynamic polarization (PDP) and electrochemical impedance spectroscopy (EIS) measurements were obtained using the software36. The PDP curves were obtained by adjusting the potential between − 0.2 and + 0.2 V(SCE) over the corrosion potential with a scan rate of \(0.5 \,\,{\text{mV/s}}\)5. The EIS measurements were taken using alternating current signals with a \(5.0 \,\,{\text{mV}}\) peak-to-peak amplitude at the corrosion potential and covering a frequency range of 100 kHz to 0.1 Hz. The impedance data was then fitted and simulated to the appropriate equivalent circuits using the Gamry Echem Analyst software. To ensure that the system reached a steady-state condition, the electrochemical corrosion tests were performed for 30 min after the working electrode was exposed to the environment. The experiments were performed three times, and the average values were recorded to confirm repeatability.

DFT computations

In this study, quantum chemical calculations were performed using Gaussian 03 Revision C.01. The ground-state geometry was calculated with the 6-31G++ (d,p) valence and polarization basis set, and the optimization was done without symmetry constraints to reach a local minimum. The calculations were performed using the B3LYP approach, which combines the Becke three-parameter hybrid exchange functional with the Lee–Yang–Parr correlation functional37. The optimized geometry, HOMO and LUMO energies, and other physical parameters of the molecule were evaluated using this method. According to DFT-Koopman's theorem, the ionization potential is related to the HOMO energy (EHOMO), while the electron affinity is related to the LUMO energy (ELUMO). These values can be calculated using Eqs. 4 and 538.

$$I = - E_{HOMO}$$
(4)
$$A = - E_{LOMO}$$
(5)

The examination of the Natural Bond Orbital (NBO) was performed to assess the distribution of electron densities, as electron density plays a crucial role in determining the parameters of chemical reactivity. The electronegativity (χ), hardness (η), and softness (σ) were calculated using Eqs. 6839.

$$\chi = \frac{I + A}{2}$$
(6)
$$\eta = \frac{I - A}{2}$$
(7)
$$\sigma = \eta^{ - 1}$$
(8)

The number of transferred electrons (ΔN) was calculated using a DFT approach using Eq. 9.

$$\Delta N = \frac{{\chi_{Fe} - \chi_{inh} }}{{2\left( {\eta_{Fe} + \eta_{inh} } \right)}}$$
(9)

This equation considers the absolute electronegativity of iron (\(\chi_{Fe}\)), which was found to be 7.0 eV, and the absolute electronegativity of the inhibitor molecule (\(\chi_{inh}\)). It also takes into account the absolute hardness of iron (\(\eta_{Fe}\)), which was found to be zero, and the absolute hardness of the inhibitor molecule (\(\eta_{inh}\)). So, Eq. 9 can be converted to Eq. 1040.

$$\Delta N = \frac{{7 - \chi_{inh} }}{{2\left( {\eta_{inh} } \right)}}$$
(10)

Results and discussion

Weight loss

Effect of the inhibitor concentration

The protection of mild steel from corrosion was achieved using 2-TP, as shown in Fig. 2. The rate of corrosion (CR) and inhibition efficiency (IE%) were measured through weight loss tests at 303 K. The results showed that with an increase in 2-TP concentration, the CR decreased, resulting in improved inhibition due to the adsorption of more 2-TP molecules onto the mild steel, reducing its interaction with HCl. The highest inhibition efficiency of 94.6% was achieved at a 2-TP concentration of 0.5 mM. This is attributed to the electron-donating properties of the pyrrolidine and thiadiazole heterocyclic rings and the resonance effect of the thiadiazole ring and the inductive effect of the pyrrolidine ring, which improve the inhibitor's ability to transfer electron pairs to the unoccupied d-orbitals of the iron atoms on the mild steel surface, thereby controlling and preventing corrosion41. The duration of immersion also influenced the resistance of 2-TP against HCl (Fig. 2). The corrosion rate decreased over the first 10 h in 1 M HCl, reaching a maximum inhibition efficiency of 94.6%. 2-TP had the highest inhibition efficiency of 65.9% after 1 h, but after 10 h of immersion, the inhibition efficiency declined, reaching 94.8% at 0.5 mM and reducing to 88.1% after 48 h. The duration of immersion is a crucial factor in providing protection. The absorption of 2-TP molecules on the mild steel surface, which covers the area exposed to the HCl solution, is likely responsible for the decrease in corrosion rate and increase in inhibition efficiency as the 2-TP concentration increases.

Figure 2
figure 2

Influence of exposure time and concentration on the corrosion rate and inhibition efficiency of 2-TP on Mild Steel in 1 M HCl.

2-TP has been demonstrated to be an effective corrosion inhibitor for mild steel in HCl solutions. The results showed that the inhibition efficiency increased with increasing 2-TP concentration and reached its maximum at 0.5 mM. The adsorption of 2-TP onto the mild steel surface was found to follow the Langmuir isotherm and was spontaneous and exothermic. The inhibitory effectiveness of 2-TP was compared to other nitrogen-based corrosion inhibitors for mild steel protection (Table 2) and demonstrated the highest inhibitory efficiency. 2-TP could be a promising alternative to current corrosion inhibitors, especially in industrial applications. Furthermore, 2-TP showed a stable and consistent inhibition performance in a wide range of immersion time values, temperatures, and corrosive environments. This indicates that it has a good versatility and adaptability, which is essential for industrial applications. Moreover, 2-TP has a low toxicity and environmental impact, making it a safer and more sustainable option for industrial applications compared to other nitrogen-based inhibitors42. To the best of our knowledge, there have been no reports of corrosion inhibitors suitable for HCl solutions. The inhibition efficiency of 0.5 mM 2-TP was found to be 94.6% at 303 K in a 1 M HCl solution, performing better than previously published inhibitors such as 2, 6, 8–12, 15–18, 20, 25, 26, 30, and 31. In the oil and gas industry, the bottom of the well is subjected to high temperatures, so a corrosion inhibitor must maintain its protective performance in corrosive media under such high temperatures.

Table 2 Comparison of 2-TP with other nitrogen-based corrosion inhibitors for protecting mild steel.

In conclusion, the study showed that 2-TP has the potential to be a highly effective corrosion inhibitor for mild steel protection in industrial applications. Its high inhibitory efficiency, adaptability, and low toxicity make it a promising alternative to current inhibitors. Further studies should be conducted to evaluate the long-term performance and practical application of 2-TP in various industrial settings.

Effect of the temperature

The impact of temperature on the performance of inhibitors is substantial. As the temperature increases from 323 to 333 K, the inhibition efficiency remains relatively constant. However, as shown in Fig. 3, when the temperature rises from 303 to 333 K, the efficiency of the 2-TP inhibitor drops from 94.6 to 84.9% at a concentration of 0.5 mM. This decrease can be attributed to the detachment of 2-TP molecules from the mild steel surface, causing a lack of protection against corrosion. As a result, the inhibition efficiency decreases as temperature increases.

Figure 3
figure 3

Influence of Temperature and concentration on the corrosion rate and inhibition efficiency of 2-TP on Mild Steel in 1 M HCl.

Temperature also has a direct impact on the rate of chemical reactions, including corrosion reactions. At higher temperatures, the rate of reaction increases, leading to a faster rate of corrosion. Inhibitors slow down the rate of corrosion by forming a protective layer on the metal surface. At higher temperatures, this layer becomes less effective as the detachment of inhibitor molecules becomes more likely, causing a decrease in inhibition efficiency72. Moreover, elevated temperatures can lead to thermal degradation of the inhibitor molecules, reducing their ability to protect the metal surface. This results in a decrease in the inhibition efficiency as degraded molecules can no longer provide adequate protection against corrosion76. the decrease in 2-TP performance at elevated temperatures could be attributed to the thermal degradation of the inhibitor molecules, which leads to the loss of the protective film formed on the metal surface. The higher temperatures could also increase the rate of corrosion, leading to a faster breakdown of the protective film formed by the inhibitor. Additionally, the increased kinetic energy of the solution at higher temperatures could facilitate the adsorption of the inhibitor molecules onto other surfaces in the system, reducing the concentration of the inhibitor available to protect the metal surface.

In conclusion, temperature is a crucial factor that affects the effectiveness of inhibitors in controlling corrosion. It is important to consider the temperature conditions in which inhibitors will be used to ensure optimal performance and maximum protection against corrosion.

Adsorption isotherm

Adsorption isotherms are useful for obtaining crucial information about the adsorption of inhibitor molecules on mild steel surfaces. The surface coverage (θ) was calculated through weight loss measurements and was used to identify the most suitable isotherm. To determine if the 2-TP molecules were physically or chemically attached to the mild steel surface, various adsorption isotherms, such as Temkin, Freundlich, and Langmuir, were analyzed. The Langmuir isotherm was considered the most appropriate model as it had a linear regression coefficient close to one. The Langmuir isotherm can be expressed using Eq. 11.

$$\frac{C}{\theta } = \frac{1}{{K_{ads} }} + C$$
(11)

where \(C\) is the inhibitor concentration and \(K_{ads}\), is the Langmuir constant.

The Freundlich adsorption isotherm is commonly used to describe adsorption on surfaces with varying active sites, energies, and surface heterogeneity. It defines the exponential distribution of these factors. Equation 12 represents the Freundlich adsorption isotherm.

$$log\theta = logK_{F} + logC$$
(12)

The Temkin adsorption isotherm takes into account the indirect interactions between adsorbate molecules and the adsorption process. This is particularly important when the heat of adsorption of molecules in the layer is inversely proportional to the surface coverage. However, this model is only valid for a limited range of concentrations. Equation 13 shows the Temkin isotherm.

$$e^{ - 2a\theta } = KC$$
(13)

The isotherm and thermodynamic analyses provided sufficient information to explain the inhibition potential and adsorption mechanism of 2-TP molecules at the interface between hydrochloric acid solution and mild steel. The estimated parameters obtained from the Langmuir (Fig. 4), Freundlich (Fig. 5), and Temkin (Fig. 6) isotherm graphs at different temperatures are presented in Table 3. The results indicate that the Langmuir isotherm model provided the best fit for the adsorption of 2-TP molecules on the surface of mild steel at all studied temperatures and times. This was confirmed by high R2 values and a slope close to unity. The Langmuir isotherm assumes that the adsorption of inhibitor molecules onto the mild steel surface is a monolayer process and that the process is energetically favorable77. The Langmuir constant provides valuable information about the interaction between the inhibitor molecules and the mild steel surface, as well as the mild steel surface's ability to adsorb the inhibitor molecules. Furthermore, the Langmuir isotherm can be utilized to determine the maximum adsorption capacity of the mild steel surface for the inhibitor molecules. The maximum adsorption capacity can then be used to calculate the optimal amount of inhibitor molecules needed to prevent corrosion of the mild steel surface77. Overall, the Langmuir isotherm provides valuable insights into the adsorption behavior of the inhibitor molecules on the mild steel surface and can guide the optimization of the inhibitor treatment process. Based on Table 3, the Langmuir isotherm was the most appropriate fit for all the temperatures tested. At 303 K, the regression coefficient (R2) was calculated to be 0.999 with a computed slope value of 0.99212 ± 0.01206 and an intercept value of 0.04564 ± 0.00613. Figure 4 illustrates the Langmuir isothermal plot between C/θ and C for the temperature range of 303–333 K.

Figure 4
figure 4

2-TP plot of Langmuir adsorption isotherm.

Figure 5
figure 5

2-TP plot of Freundlich adsorption isotherm.

Figure 6
figure 6

2-TP plot of Temkin adsorption isotherm.

Table 3 Adsorption parameters for inhibition of mild steel in treated solution at different temperature.

The relationship between the adsorbent and adsorbate is expressed by the adsorption constant (\(K_{ads}\)). A higher \(K_{ads}\) indicates improved adsorption and thus improved inhibition78. The relationship between the adsorption free Gibbs energy and the adsorption equilibrium constant can be represented by Eq. 14.

$$\Delta G_{ads}^{o} = - RT{ }ln\left( {55.5K_{ads} } \right)$$
(14)

where T is the temperature, R is the gas constant, and 55.5 is the water content measurement. The “\(K_{ads}\)” constant was added to the calculation above to produce the “\(\Delta G_{ads}^{o}\)” value.

Equation (12) demonstrates that the free Gibbs energy of adsorption is proportional to the natural logarithm of the adsorption equilibrium constant, \(K_{ads}\). The higher the \(K_{ads}\), the lower the free Gibbs energy of adsorption and vice versa. In simpler terms, a low free Gibbs energy of adsorption means that the adsorbent and the adsorbate have a strong bond, leading to a high adsorption rate.

Therefore, an increase in \(K_{ads}\) leads to a decrease in the adsorption free Gibbs energy, resulting in better adsorption and improved inhibition. Hence, \(K_{ads}\) plays a critical role in determining the efficiency of the adsorption process and the inhibition of the adsorbate. In conclusion, the adsorption equilibrium constant, \(K_{ads}\), is a crucial parameter that can predict the efficiency of the adsorption process and the inhibition of the adsorbate. The relationship between \(K_{ads}\) and the adsorption free Gibbs energy, as demonstrated by Eq. (12), emphasizes the importance of \(K_{ads}\) in comprehending the adsorption behavior of a system79. A negative value of the adsorption \(\Delta G_{ads}^{o}\) indicates spontaneity, and the inhibitor molecules are absorbed onto mild steel. A \(\Delta G_{ads}^{o}\) value of ≤ − 20kJmol−1 indicates physical adsorption of the inhibitor molecule to the mild steel surface. However, a significantly negative adsorption free energy value of ≥ − 40 kJmol−1 suggests chemical adsorption, with the formation of coordination interactions between the 2-TP molecules and iron atoms on the mild steel surface. The estimated value of \(\Delta G_{ads}^{o}\) being − 31.4 kJmol−1 indicates a mixed-mode interaction, incorporating both physical and chemical adsorption. The calculated \(\Delta G_{ads}^{o}\) value indicates that the adsorption process of inhibitor molecules onto the mild steel surface is spontaneous and energetically favorable. The negative value shows that the system releases energy when the inhibitor molecules are adsorbed, leading to a decrease in the overall energy of the system. The magnitude of \(\Delta G_{ads}^{o}\) also reveals the type of adsorption that takes place. In physical adsorption, the process is driven by van der Waals forces, dipole–dipole interactions, and hydrogen bonding. The inhibitor molecules are attached to the mild steel surface through weak non-covalent interactions and is usually indicated by a \(\Delta G_{ads}^{o}\) value of less than − 20 kJmol−1. In chemical adsorption, the process involves covalent bonding between the inhibitor molecules and the mild steel surface iron atoms. This type of adsorption is usually indicated by a \(\Delta G_{ads}^{o}\) value of less than − 40 kJ/mol, which represents the energy required to break the chemical bonds. The calculated \(\Delta G_{ads}^{o}\) value of ≥ − 31.4 kJmol−1 suggests a mixed-mode interaction between the inhibitor molecules and the mild steel surface. This indicates that both physical and chemical adsorption are taking place simultaneously, with the inhibitor molecules held to the surface through both weak non-covalent interactions and covalent bonding. Overall, the results suggest that the adsorption of inhibitor molecules onto the mild steel surface is energetically favorable and that mixed-mode interactions are occurring between the inhibitor molecules and the surface.

Thermodynamics studies.

Thermodynamics studies

Figure 7 in the study presents an Arrhenius plot used to estimate the activation energy (Ea) after 5 h of mild steel immersion in 1 M HCl, in the presence of various concentrations of 2-TP. The values of Ea were estimated to be within the range of 22.56–26.85 kJ/mol for all 2-TP concentrations. The values of activation energies (Ea) below 80 kJ/mol indicate physical adsorption, while values above 80 kJ/mol indicate chemical adsorption80,81. Therefore, it was concluded that the interaction of 2-TP molecules leading to mild steel surface adsorption followed a chemical-physical mechanism.

Figure 7
figure 7

Arrhenius plot of ln CR against 1/T for mild steel with the addition of various of 2-TP after 5 h of exposure time.

In Fig. 8, the transition state plot for the control and inhibited system after 5 h of the corrosion process is presented. The negative values of the enthalpy changes (ΔHAds) for different concentrations of 2-TP indicated exothermic behavior82, with a range of − 36.83 to − 43.11 kJ/mol across the test temperature (303–333 K), suggesting a chemisorption-physisorption mechanism. Negative values of entropy ΔSa revealed a decrease in disorderliness. The adsorption free energy (ΔGa) ranged between − 31.4 and − 35.72 kJ/mol. The negative ΔGa values indicate the spontaneous and feasible nature of the adsorption process. These values at 303–333 K showed good interaction between the 2-TP molecules and the mild steel surface, suggesting strong adsorption of 2-TP on mild steel83. Therefore, it was concluded that the adsorption of 2-TP molecules on the mild steel surface followed a physical and chemical adsorption mechanism.

Figure 8
figure 8

Transition state plot of In (CR/T) against 1/T for mild steel with the addition of various of 2-TP after 5 h of exposure time.

Electrochemical corrosion measurements

EIS

The frequency range used in the electrochemical impedance spectroscopy (EIS) measurements can provide important information about the system being studied. For example, the high-frequency region can provide information about the surface capacitance and double-layer structure, while the low-frequency region can provide information about charge transfer processes and mass transport limitations. The Gamry Analyst software was used to analyze the EIS experimental data, including the calculation of CPE, Rs, Rct, and Cdl for mild steel in 1.0 M HCl solution84. Table 4 presents a comparison of the CPE of mild steel at different inhibitor concentrations at 303 K. The Rct value increases with an increasing inhibitor concentration, indicating that the corrosion inhibitors adsorb on the mild steel sample surface, forming a protective layer that slows down corrosion. At a concentration of 0.5 mM, the inhibition efficiency reached 89.39% due to the elevated Rct value. The addition of the corrosion inhibitor significantly improves the overall impedance of the mild steel sample, as illustrated in Fig. 9. The inhibition efficiency was calculated from the charge transfer resistance using Eq. (15).

$$IE\% = \frac{{R_{inh} - R_{uinh} }}{{R_{inh} }} \times 100$$
(15)
Table 4 CPE data for mild steel in untreated and treated solutions at 303 K.
Figure 9
figure 9

(a) Nyquist plots for mild steel in untreated and treated solutions at 303 K, (b) Equivalent circuit model utilised to fit impedance data in in untreated and treated solutions.

The Nyquist plots show that the addition of 2-TP increases the diameter of the capacitive loop in mild steel compared to when it is immersed in 1 M HCl without 2-TP. The diameter of the Nyquist plot is a reflection of the polarization resistance (Rp)85. The larger diameter of the Nyquist plot in the presence of 2-TP signifies a higher polarization resistance, which implies a reduced corrosion rate. This is verified by the results in Table 4, which indicate that the polarization resistance (Rp) is significantly higher in the presence of 2-TP compared to 1 M HCl without 2-TP. This indicates that 2-TP has effectively inhibited the corrosion of mild steel in the test solution86. The electrolytic resistance (Rs) values are also higher in the presence of 2-TP, consistent with the increased polarization resistance. This elevated electrolytic resistance is caused by the formation of a protective film on the surface of mild steel, which acts as a barrier to stop the corrosion reaction87,88. In conclusion, the results of the EIS analysis demonstrate that the presence of 2-TP has a significant impact on the corrosion behavior of mild steel in the test solution. The 2-TP has effectively reduced the corrosion rate of mild steel by increasing the polarization resistance and forming a protective film on the surface of the metal. This demonstrates the potential of 2-TP as an effective corrosion inhibitor for mild steel in harsh environments.

Bode plots are a graphical representation of the frequency response of a system. In electrochemistry, Bode plots are commonly used to analyze the impedance behavior of a system as a function of frequency. They consist of two graphs, one showing the magnitude of the impedance (Bode modulus) and the other showing the phase shift between the applied voltage and the resulting current (Bode phase). These plots can provide valuable information about the electrochemical processes occurring at the electrode surface and the overall behavior of the system. The Bode plots illustrate that a rise in 2-TP concentration causes a broad and significant shift in the Bode modulus impedance, suggesting a slowdown in the corrosion process, as demonstrated in Fig. 10.

Figure 10
figure 10

Bode plots of mild steel in 1 M HCl and with different concentrations of 2-TP.

The interfacial interaction between 2-TP and the mild steel surface in the acidic solution plays a critical role in inhibiting the corrosion process. The adsorption of 2-TP molecules onto the mild steel surface forms a protective layer that slows down the corrosion process. The adsorption of 2-TP on the mild steel surface occurs through electrostatic interactions, such as hydrogen bonding and van der Waals forces. The presence of nitrogen and sulfur atoms in the 2-TP structure facilitates adsorption on the metal surface by forming strong coordination bonds with iron ions at the metal surface. Moreover, the two aromatic rings in the 2-TP structure provide an extensive π-conjugated system, which interacts with the surface of mild steel by π-π stacking, leading to the formation of an adsorption layer. It is important to note that the adsorption of 2-TP molecules on the mild steel surface may be influenced by the pH of the solution. At low pH, the 2-TP molecules may exist in a protonated form, which can increase their affinity for the negatively charged metal surface. However, as mentioned earlier, it is difficult for 2-TP to be protonated due to the electron-withdrawing effect of the thiophene ring for the nitrogen pair of electrons and steric hindrances. The interaction between 2-TP and the mild steel surface can be studied using electrochemical impedance spectroscopy (EIS). The EIS analysis provides information on the adsorption process, the properties of the protective layer formed on the metal surface, and the corrosion rate of mild steel in the presence of 2-TP. As discussed earlier, the presence of 2-TP significantly increases the polarization resistance and electrolytic resistance of the mild steel sample, indicating the formation of a protective film on the surface of mild steel that acts as a barrier to stop the corrosion reaction. In conclusion, the interfacial interaction between 2-TP and mild steel in the acidic solution is crucial in inhibiting the corrosion process. The adsorption of 2-TP molecules on the mild steel surface occurs through electrostatic interactions, such as hydrogen bonding and van der Waals forces, as well as through coordination bonds with iron ions at the metal surface. The two aromatic rings in the 2-TP structure provide an extensive π-conjugated system, which interacts with the surface of mild steel by π-π stacking, leading to the formation of an adsorption layer. The EIS analysis provides valuable information on the adsorption process, the properties of the protective layer formed on the metal surface, and the corrosion rate of mild steel in the presence of 2-TP.

The interaction between 2-TP and the steel surface can occur via multiple mechanisms. One potential mechanism is adsorption of the 2-TP molecule onto the steel surface through its aromatic rings. The thiophene ring in 2-TP are known to have π-π interactions with metal surfaces, and this can facilitate the adsorption of the inhibitor onto the steel surface. Another potential mechanism is the formation of a protective film on the steel surface via complexation between the nitrogen atom in the pyridine ring and the steel surface. This can lead to the formation of a stable complex that acts as a barrier layer between the steel and the corrosive environment, reducing the corrosion rate.

OCR

Figure 11 shows how the open-circuit potential (OCP) of mild steel in 1.0 M HCl at 303 K changes with the concentration of the 2-TP inhibitor. Inhibition in acidic media typically involves inhibitor molecules adsorbing onto the metal surface, which is often covered with oxide species. The adsorption can result in a more positive surface charge of the mild steel electrode, which is typically negatively charged, due to the presence of the positively charged 2-TP molecules. This change in the OCP suggests that a protective film is forming on the surface of the mild steel electrode.

Figure 11
figure 11

The open circuit potential of mild steel in 1.0 M HCl at 303 K as a function of inhibitor concentration.

PDP

A potentiodynamic polarization study offers important insights into the kinetics of the reactions at the anodic and cathodic areas, as well as the inhibition action of corrosion inhibitors based on the corrosion potential89. Figure 12 presents polarization plots for mild steel samples in 1 M HCl with and without different concentrations of 2-TP.

Figure 12
figure 12

Potentiodynamic Polarization Curves of Mild Steel in Untreated and Treated HCl Solution at 303 K.

Studies have shown that the presence of corrosion inhibitors can suppress the electrochemical reactions on the metal surface, resulting in a decrease in the corrosion current (icorr). This reduction in icorr indicates that corrosion is being inhibited90.

The results were obtained by determining the intersection of the anodic and cathodic Tafel lines of the polarization curve at ECORR. The inhibition efficiency was calculated using Eq. (16).

$$IE\% = \frac{{i_{corr}^{o} - i_{corr} }}{{i_{corr}^{o} }} \times 100$$
(16)

From the polarization plots, it can be seen that as the concentration of 2-TP increases, the corrosion potential shifts towards more negative values, indicating a higher level of corrosion inhibition91. This is confirmed by the decrease in the corrosion current, which is shown by the decrease in the slope of the anodic polarization curve92. In fact, as can be seen from Fig. 12, both cathodic and anodic polarization curves are displaced due to 2-TP addition. This indicates that the presence of 2-TP affects both the anodic and cathodic reactions, rather than just the cathodic reaction as previously stated. Thank you for bringing this to my attention. The inhibition efficiency of 2-TP can be calculated from the polarization plots using various methods, such as Tafel slope, corrosion potential, and corrosion current density. The Tafel slope method, based on the slope of the anodic and cathodic polarization curves, provides information about the kinetics of the electrochemical reactions. A decrease in Tafel slope in the presence of 2-TP indicates a slower rate of anodic reactions, resulting in higher inhibition efficiency93. Similarly, the corrosion potential can also be used to determine the inhibition efficiency by comparing the corrosion potentials of mild steel samples in 1 M HCl without and with different concentrations of 2-TP. The corrosion current density, which represents the rate of corrosion, can also be used to calculate the inhibition efficiency. A decrease in the corrosion current density in the presence of 2-TP indicates a lower rate of corrosion and higher inhibition efficiency. In conclusion, the potentiodynamic polarization plots provide valuable information about the inhibition efficiency of 2-TP on mild steel in 1 M HCl. The results show that 2-TP is an effective corrosion inhibitor, and its inhibition efficiency increases with the increase in concentration. Table 5 illustrates that the addition of 2-TP resulted in a decrease in the corrosion current density (icorr), indicating that 2-TP has an inhibitory effect on the corrosion of mild steel in the acidic solution at 303 K. This means that the addition of the inhibitor shifts the selected corrosion potentials towards more positive values, suggesting that 2-TP has an inhibitory effect on the corrosion of mild steel at 303 K. The anodic and cathodic processes are altered as different amounts of 2-TP are added, as shown in Fig. 12. If the change in corrosion potential exceeds 85 mV, the inhibitor is categorized as either an anodic or cathodic type inhibitor. However, 2-TP acts as a mixed-type inhibitor, as its highest displacement of 528 mV at 303 K and a significant decrease in icorr for the inhibited system (Table 5) imply that the addition of the tested inhibitor to the acidic solution reduces the anodic solubility of mild steel and slows down the formation of cathodic hydrogen. Furthermore, the results suggest that the addition of 2-TP to the acidic solution at 303 K has a significant impact on the corrosion behavior of mild steel. The inhibitor helps to regulate the balance between the anodic and cathodic reactions, resulting in a decrease in the corrosion rate. The mixed-type inhibitor behavior of 2-TP further highlights its effectiveness in reducing corrosion, as it can target both the anodic and cathodic reactions, resulting in a reduction of both the formation of corrosion products and the hydrogen evolution reaction. This makes 2-TP a valuable tool in controlling corrosion in various applications, particularly in acidic environments.

Table 5 Observed corrosion parameters in potentiodynamic polarization measurements.

The anodic reaction during the corrosion of metals involves the dissolution of the metal, which results in the formation of metal ions and electrons. The metal ions then migrate into the electrolyte solution, leaving behind electrons that form a layer of negative charge on the metal surface. This process is referred to as oxidation. On the other hand, the cathodic reaction involves the reduction of a species from the electrolyte solution at the metal surface. This reduction reaction consumes the electrons that were released during the anodic reaction. The cathodic reaction can involve various species, such as oxygen, hydrogen ions, or water, depending on the environment in which the corrosion is taking place. In summary, the corrosion process involves both anodic and cathodic reactions that occur simultaneously and continuously, leading to the deterioration of the metal surface. 2-TP is believed to mainly inhibit anodic processes and have a lesser effect on cathodic processes. This is supported by the results of the polarization plots, which show that the cathodic polarization curve remains relatively unchanged in the presence of 2-TP, indicating that the inhibition effect is mainly due to the inhibition of anodic reactions. The inhibition efficiency of 2-TP can be calculated from the polarization plots using various methods, such as Tafel slope, corrosion potential, and corrosion current density. The Tafel slope method, based on the slope of the anodic and cathodic polarization curves, provides information about the kinetics of the electrochemical reactions. A decrease in the Tafel slope in the presence of 2-TP indicates a slower rate of anodic reactions, indicating that 2-TP mainly affects the anodic processes. However, it is important to note that 2-TP may also have some effect on cathodic processes, although this effect is likely to be less significant compared to its effect on anodic processes.

The presence of chloride ions in HCl can have an effect on the performance of 2-TP as a corrosion inhibitor. Chloride ions are known to accelerate the corrosion rate of metals, and they can also compete with the inhibitor molecules for adsorption on the metal surface. Therefore, the presence of high concentrations of chloride ions can reduce the efficiency of 2-TP as a corrosion inhibitor. However, the specific effect of chloride ions on 2-TP would depend on various factors, such as the concentration of the inhibitor and the chloride ions, the nature of the metal, and the pH of the solution.

In conclusion, the results of the study demonstrate that 2-TP has a significant inhibitory effect on the corrosion of mild steel in acidic solutions at 303 K. The inhibitor exhibits mixed-type inhibitor behavior, making it an effective solution for controlling corrosion in acidic environments. Further studies are necessary to determine the mechanism of action of 2-TP and to evaluate its performance under different conditions.

Scanning electron microscope (SEM)

The surface morphology of the metallic substrate strip after 5 h of exposure to hydrochloric acid solution with and without 2-TP was analyzed using SEM. The results are presented in Fig. 13a,b. In Fig. 13a, the surface of the metallic substrate exhibited severe corrosion, characterized by sagging and crown features. On the other hand, Fig. 13b shows that the addition of 2-TP to the hydrochloric acid solution resulted in a surface with significantly less corrosion compared to Fig. 13a.

Figure 13
figure 13

SEM images of the metallic substrate surface after 5 h of exposure in 1 M hydrochloric acid solution (a) without and (b) with the addition of 2-TP.

DFT

Calculated parameters

The Inhibition Efficiency Correlation Approach utilizes popular molecular-electronic properties to evaluate the effectiveness of inhibitor molecules. These properties include HOMO and LUMO eigenvalues, HOMO–LUMO gap, electronegativity, chemical hardness, dipole moment, Fukui indices, etc.94,95. The approach is based on the premise that these chemical characteristics serve as indicators for reactivity and can predict the direction of inhibitor adsorption bonding96. A high HOMO eigenvalue indicates high molecular electron donation, while a low LUMO eigenvalue represents high electron back-donation from surface states to the molecule. A narrow HOMO–LUMO gap means that ELUMO is larger than EHOMO97. Theoretical chemistry methods and experimental procedures can be employed to evaluate inhibitor molecules and calculate their efficacy using quantum parameters such as atomic charge, border molecular orbitals, and energy gap. Other factors such as molecular activity, chemical structure, and corrosion inhibitor capacity must also be taken into account98,99. The behavior of inhibitors can be understood through their optimal chemical structures and electrochemical behavior in the presence of orbital energies and differences. Frontier molecular orbitals, softness, and hardness are related to the potential of the inhibitor for interaction100. Computational chemistry research has been used to determine the efficacy of protection and molecular orbital energy levels of organic compounds84. Density Function Theory (DFT), which calculates a molecule's total electron energy based on electron density, has been utilized to study the inhibitory behavior of various sets of corrosion inhibitors. The electronic characteristics were computed and are presented in Table 6.

Table 6 Theoretical parameters computed with DFT (d,p) Basis Set using B3LYP Level of 2-TP.

The 2-TP inhibition efficacy is linked to the electron-donating potential of EHOMO. By increasing the value of HOMO, the 2-TP inhibition efficacy is also increased. This is because the transfer of charge along the metal surface and initiation of the adsorption mechanism rely on this mechanism. As shown in Fig. 14, the assessed 2-TP is considered to have the greatest inhibitory effectiveness, as it has the highest energy value of HOMO. This high value of HOMO results in a high level of inhibitory effectiveness. The efficacy of electron reception is crucial for ELUMO. A low ELUMO value indicates that inhibitor molecules can find another negative charge on the mild steel surface. The 2-TP molecules have a high LUMO and EHOMO value, indicating their reactiveness as a donor. However, 2-TP molecules with a small EHOMO value decrease metal reactivity and inhibit efficiency84.

Figure 14
figure 14

Energy diagram for 2-TP.

The 2-TP molecules with the most effective corrosion inhibition, as determined by the EHOMO-ELUMO value, have high softness, low hardness, and a low energy gap. Electronegativity (χ) is also an important factor in inhibiting potency. The inhibiting effects of 2-TP as an iron-inhibitor were studied, revealing that the iron atoms form chemical bonds by gaining electrons from the inhibitor molecules101. 2-TP is effective with a low electronegativity value, as indicated by the ΔN value, which shows that the 2-TP molecules transfer more electrons to the iron atoms on the metal surface. Dipole moment (μ) is another factor that may indicate inhibitory efficiency, but previous studies have not shown a significant correlation. The inhibitory efficiency of 2-TP, with a low dipole moment value, suggests a strong coating on the metal surface.

In conclusion, the inhibitory efficiency of 2-TP molecules depends on several factors including the EHOMO-ELUMO value, electronegativity, and dipole moment. 2-TP molecules with a high EHOMO value and low energy gap are highly effective inhibitors due to their softness and low hardness values102. Additionally, 2-TP molecules with low electronegativity values provide better performance as they transfer more electrons to the iron atoms on the metal surface. Lastly, 2-TP molecules with a low dipole moment value are believed to provide a stronger coating on the metal surface, contributing to the inhibitory efficiency. These findings provide valuable insights into the development of effective inhibitors for mild steel corrosion protection.

Mulliken charges

The Mulliken atomic charges of the 2-TP are shown in Fig. 15. The Mulliken charges method is a widely used method to predict the connections between adsorption sites. The heteroatoms in the inhibitor molecules enhance the adsorption ability by donating and accepting electrons. The efficacy of the 2-TP is attributed to the sulfur and nitrogen atoms in the inhibitor molecules103,104. As shown in Fig. 15, the 2-TP molecules bond coordinately with the d-orbitals of the iron atoms on the mild steel surface through nitrogen atoms N(3), N(4), and N(6). This leads to the formation of strong coordination bonds between the 2-TP molecules and the mild steel surface, thereby enhancing the corrosion protection provided by the inhibitor. Additionally, the sulfur atom (S(1)) in the 2-TP molecule also contributes to the adsorption process by providing additional electron-donating capacity. The overall charge distribution of the 2-TP molecule also indicates that it is a polar molecule, which enables it to form hydrogen bonds with the mild steel surface, further strengthening the adsorption. In conclusion, the Mulliken atomic charges of the 2-TP molecule offer valuable insights into its adsorption mechanism and effectiveness as a corrosion inhibitor for mild steel surfaces.

Figure 15
figure 15

Mulliken charges of 2-TP atoms.

Suggested mechanism

The efficiency of corrosion protection on mild steel in acidic conditions can be evaluated based on the molecular structure of the inhibitor and its interaction with the iron atoms on the metal surface. The effectiveness of the inhibitor is influenced by the type of bond formed between the inhibitor and the metal surface (chemisorption) and the number of adsorption sites available. In the case of the 2-TP molecule, all nitrogen atoms serve as adsorption sites and can form coordination bonds with the mild steel surface through the use of unpaired electrons. The nitrogen atoms can also be protonated through physisorption with chloride ions105. The presence of unpaired electrons and the inductive effect of the sulfur atom are key factors contributing to the high inhibitive potency of 2-TP. Figure 16 provides a visual representation of the adsorption process of 2-TP molecules on the steel/HCl interface. The free electrons of the nitrogen atoms are transferred to the d-orbitals of the iron atoms, effectively blocking the corrosion process.

Figure 16
figure 16

Suggested inhibition mechanism.

This forms a complex with the inhibitor molecule and the iron atom. The adsorption of 2-TP molecules onto the mild steel surface forms a layer of protection, which prevents further corrosion of the metal. This protective layer also slows down the reaction rate of the mild steel and HCl, as the 2-TP molecules act as a barrier between the two. The 2-TP molecule also has a positive effect on the mild steel surface by reducing the electrochemical potential and lowering the corrosive potential. This happens as the adsorption of 2-TP molecules increases the pH of the surrounding environment and thus reduces the concentration of H+ ions106.

In conclusion, the inhibitor molecule 2-TP exhibits high inhibitive efficiency in protecting mild steel from corrosion in an acidic environment. The molecular structure of the inhibitor and its interaction with the iron atoms of the mild steel surface play a crucial role in the inhibitive efficiency. The 2-TP molecules form a protective layer on the mild steel surface, reducing the reaction rate and lowering the corrosive potential.

Conclusion

In conclusion, the study demonstrated that 2-(1,3,4-thiadiazole-2-yl)pyrrolidine (2-TP) is an effective inhibitor for mild steel corrosion in 1 M HCl solution. The results from weight loss, potentiodynamic polarization, and electrochemical impedance spectroscopy (EIS) showed that 2-TP adsorbed onto the mild steel surface and formed a protective layer, leading to a reduction in the corrosion rate and increased inhibition efficiency. The study also indicated that temperature had a significant impact on the performance of the inhibitor, with higher temperatures leading to a decrease in inhibition efficiency. The EIS results showed that the presence of 2-TP had a significant impact on the corrosion behavior of mild steel by increasing the polarization resistance and forming a protective film on the metal surface. The potentiodynamic polarization plots showed that the concentration of 2-TP had a significant impact on the corrosion potential and corrosion current, resulting in higher inhibition efficiency. The study highlights the potential of 2-TP as an effective corrosion inhibitor for mild steel in harsh environments.