Introduction

Carbon steel (CS) is the primary material used in construction and structural applications for producing various industrial tools, including those for oil and water pipelines, power plants, etc1. It is valued for its high strength, widespread availability, affordability, and ease of welding. However, despite these benefits, CS is prone to corrosion when subjected to aggressive solutions, causing significant financial losses2. Sulfuric acid is a strong oxidizer and a dehydrator. It interacts violently with water and can ignite other materials. It is, therefore, categorized as a hazardous material, requiring safe transportation and storage to avoid any mishaps3. It is the most used acidic solution in industrial applications to eliminate oxides produced by chemical processes in steel and oil refineries. These acid solutions can harm metals used to build storage tanks and pipelines as time passes4. One of the most popular and extensively used corrosion control strategies in a wide range of industries is the implementation of corrosion inhibitors, which are a flexible and effective method of reducing corrosion5,6,7,8,9,10,11,12. Corrosion inhibitors are organic or inorganic compounds introduced in trace amounts to a corrosive medium and impede the anodic and/or cathodic metal corrosion reactions13,14. Due to their high adsorption efficiency, environmental friendliness, and adjustable chemical structures, organic corrosion inhibitors have garnered increasing interest in recent years. Thanks to developments in molecular design, inhibitors with heteroatoms (N, O, and S) and numerous adsorption sites may now be synthesized, improving their capacity to create durable protective films on metal surfaces. Adsorption can occur chemically (chemisorption), physically (physisorption), or a combination of both15. Recent research has confirmed the adaptability of organic inhibitors in practical applications by demonstrating their efficiency under various corrosive conditions16,17,18,19,20,21,22,23,24,25,26,27,28. These results are consistent with the current study’s approach and encourage further investigation of novel hybrid inhibitors with enhanced adsorption capacities and sustainability profiles. Significantly, nitrogen-containing heterocyclic compounds, like triazole derivatives, have been widely researched for their chemical and biological characteristics and are commonly utilized in medicinal chemistry. Apart from their biological roles, they are acknowledged for their potency in impeding corrosion in acidic conditions29,30,31,32,33,34. Triazoles are five-membered heterocyclic compounds containing three nitrogen atoms with lone pairs and π-electrons, which are strongly adsorbed on metal surfaces. Nearby heteroatoms (N–N) improve adsorption on the metal surfaces35. Additionally, their application in the pharmaceutical sector demonstrated their non-hazardous qualities36. Based on previous studies, compounds containing pyridine and quinoline have strong corrosion-inhibiting properties37,38,39,40,41,42. The significance of choosing the tested inhibitors as corrosion inhibitors lies in their economic feasibility and the presence of an electron-rich system, such as an aromatic ring and heteroatoms43,44. By establishing coordination bonds with the metal surface, these atoms can produce a protective layer that lessens corrosion. Moreover, they can be used in practical applications because their synthesis is economical and environmentally friendly. Consequently, the innovation of selecting these inhibitors is the cost-effective molecular design that combines three extremely potent moieties into one inhibitor molecule: hydrazinyl triazole, clubbed pyridine/ quinoline. These moieties are well-known for their potent electron-donating capabilities and potential to create coordination bonds with metal surfaces. Combining them results in a structure with more adsorption sites, higher electron density, and better surface contact, all boosting corrosion inhibition performance. Moreover, the compounds were synthesized via an environmentally friendly ultrasound-assisted method. Since corrosion inhibition literature has not yet documented this design in conjunction with an ultrasound-assisted green synthesis method, it provides a novel and sustainable approach. As a result, we assessed the ability of (Z)-4-amino-5-(2-(pyridin-4-ylmethylene)hydrazinyl)-4H-1,2,4-triazole-3-thiol (KB1) and (Z)-4-amino-5-(2-((2-azidoquinolin-3-yl)methylene)hydrazinyl)-4H-1,2,4-triazole-3-thiol (KB2) to impede the dissolution of CS in 0.5 M H2SO4 utilizing electrochemical techniques. The CS’s surface morphology, composition, and structure were determined using various characterization techniques: AFM, XPS, and FT-IR. The test solutions were analyzed via UV-Visible spectroscopy to check the complex formed among ferrous ions and the investigated inhibitors. Additionally, computational studies via quantum calculations (DFT) and Monte Carlo (MC) simulations are conducted to reinforce the experimental outcomes.

Experimental techniques

Working electrode preparation

The utilized CS sheet has the following compositions (weight%): C 0.2%, Si 0.25%, S 0.05%, Mn 0.5%, and Fe 99%. It was sliced into 1 cm x 1 cm pieces and firmly cemented in an epoxy/hardener mixture. This guaranteed that the coupon used in the electrochemical measurements would have an exposed area of 1 cm². Before testing, the working electrode was polished using a series of emery paper grades (320, 400, 1000, and 2000) to achieve a mirror surface, cleaned with double-distilled water, and dehydrated with filter papers.

General procedure for the synthesis of inhibitors

As indicated in Fig. 1, a mixture of 4-amino-5-hydrazineyl-4H-1,2,4-triazole-3-thiol (1) (0.146 g,1 mmol) and pyridine-4-carboxaldehyde (2) (0.094 mL, 1 mmol) or 2-azidoquinoline-3-carbaldehyde (3) (0.198 g, 1 mmol) was mixed and irradiated under ultrasound for 3 min at ambient temperature in MeOH (20 mL) containing 3 drops of conc. H2SO4 as a catalyst. The formed precipitates (KB1 and KB2) were filtered off and washed with hot MeOH. Figures S1–S6 in the supplementary file display the 1HNMR, 13CNMR, and mass spectra, while Table S1 presents further details of the synthesis process of the inhibitors.

Fig. 1
figure 1

Synthesis of inhibitors.

(Z)-4-amino-5-(2-(pyridin-4-ylmethylene)hydrazinyl)-4H-1,2,4-triazole-3-thiol (KB1). Yield, 92%; orange powder; m.p 244–245 °C. IR (νmax, cm− 1): 3439 (NH2), 3266 (NH), 3084 (sp2 CH), 1622, 1618, 1577, 1557 (C = N & C = C). 1HNMR (DMSO-d6, 500 MHz): δ (ppm) 5.57 (s, 2 H, NH2), 7.84 (d, J = 6.5 Hz, 2 H), 8.34 (s, 1 H, CH), 8.69 (d, J = 6 Hz, 2 H), 11.51 (s, 1 H, NH), 13.15 (s, 1 H, SH). 13CNMR (DMSO-d6, 125 MHz): δ (ppm) 121.62 (2 C), 139.38, 146.08 (2 C), 146.43, 149.00, 164.99. )EMIS) m/z (%): 235.71 (M+, 44.25%), 191.80 (90.74%), 145.14 (100%, base peak), 114.83 (63.39%), 104.17 (63.56%), 95.92 (55. 72%), 94.70 (89.00%), 62.30 (58.22%).

(Z)-4-amino-5-(2-((2-azidoquinolin-3-yl)methylene)hydrazinyl)-4H-1,2,4-triazole-3-thiol (KB2). Yield, 91%; brown powder; m.p 238–239 °C. IR (νmax, cm− 1): 3415 (NH2), 3292 (NH), 3035) sp2 CH), 1674, 1641, 1614, 1547 (C = N & C = C). 1HNMR (DMSO-d6, 400 MHz): δ (ppm) 3.55–3.67 (br, 2 H, NH2), 7.82 (t, J = 7.4 Hz, 1 H), 7.97 (t, J = 7.8 Hz, 1 H), 8.36 (d, J = 8 Hz, 1 H), 8.57 (s, 1 H, CH), 8.61 (d, J = 8.4 Hz, 1 H), 8.93 (s, 1 H, CH), 11.48 (s, 1 H, NH), 13.16 (s, 1 H, SH). 13CNMR (DMSO-d6, 100 MHz): δ (ppm) 116.65, 120.51, 124.47, 127.84, 128.84, 130.16, 130.55, 131.92, 136.67, 146.76, 149.62, 165.11. )EMIS) m/z (%): 326.69 (M+, 23.26%), 242.34 (100%, base peak), 211.52 (67.21%), 206.05 (63.55%), 127.03 (96.45%), 121.16 (81.45%), 109.90 (68.40%), 76.99 (92.30%).

Solutions

The corrosive medium, 0.5 M H2SO4, was prepared by diluting the AR-grade sulfuric acid solution with double-distilled water. Economic and practical considerations were the key factors in selecting the tested inhibitors’ concentrations. It would be ineffective to use concentration over the saturation point, and doing so might result in needless expenses and possible environmental issues. To ensure efficient corrosion prevention while maintaining cost-effectiveness and minimizing excessive chemical use, the tested concentrations were selected. Therefore, stock solutions of the tested inhibitors (10− 3 M) were prepared. Dimethyl sulfoxide (10 mL) was used to dissolve the calculated amount of inhibitor, and it was then brought to 100 mL with absolute ethanol. Different concentrations of the investigated inhibitors (1–9 × 10− 5 M) were employed by dilution from the stock solution. The percentage of solvents in which the inhibitor dissolved was maintained throughout the prepared solutions, both with and without the inhibitors, to prevent the effect of solvents on the inhibition. No precipitation or turbidity was observed throughout the experiments, indicating good solubility and stability of the inhibitors in the test solutions.

Electrochemical measurements

Electrochemical tests were carried out in a corrosion cell using three electrodes: a CS working electrode, a platinum wire as the counter electrode, and a saturated calomel electrode (SCE) as the reference electrode. The three electrodes were immersed in the test solutions for 35 min before each experiment to achieve a stabilized OCP. EIS measurements were performed using AC signals of 10 mV amplitude at OCP and the frequency range from 100 kHz to 0.1 Hz. The PP measurements were achieved by sweeping the potential from − 500 mV to 500 mV against OCP using a scan rate of 0.5 mV/s. All experiments were performed with newly prepared solutions at 298 K via a Potentiostat/Galvanostatic/ZRA analyzer (Gamry 5000E, USA). At each inhibitor concentration, the experiments were repeated three times to ensure reproducibility and accuracy of the corrosion inhibition results.

Zero charge potential

EIS was implemented to estimate the potential of zero charge (PZC). It was carried out at various potentials with an AC amplitude of 10 mV in 0.5 M H2SO4 solutions with 5 × 10− 5 M of KB1 and KB2. A plot has been created to show how the applied voltage affects the variation of Cdl. EPZC represents the lowest Cdl value.

Surface characterization

CS specimens were polished with different grades of emery papers, washed, dried, and exposed to 0.5 M H2SO4 solution without and with adding 9 × 10− 5 M of KB1 and KB2 for 24 h, after that the specimens were brought out and dried to analyze the morphology via Nanosurf FlexAFM 3, Gräubernstrasse 12, 4410 Liestal, Switzerland for AFM analysis and the components of the film that developed on the CS was investigated via AXIX Ultra DLD, Kratos, UK for XPS analysis. FTIR analysis detects the functional groups present in the inhibitor and provides qualitative insight into the inhibitor’s adsorption onto the CS surface.

UV–Visible spectra

Corrosion protection was examined by UV-Visible spectrophotometry both before and after the CS coupons were submerged for 48 h to gather additional information on the complex formed between Fe2+ ions and the tested inhibitors. The spectra were recorded via a T80 + UV/vis spectrometer (UK).

Theoretical computations

The energy minimization of KB1 and KB2 in an aqueous medium was investigated through DFT calculations using the GGA method with BOP functional and the DNP basis set in the Dmol3 module of BIOVIA Materials Studio 2017 software45,46. Based on DFT calculations, several quantum indices were calculated47. The Adsorption Locator module was also applied for the MC simulation48. Following the use of the COMPASS force field to optimize the geometry of both the tested molecules and Fe (1 1 0), the Adsorption Locator module uses Monte Carlo searches to determine the feasible adsorption configurations of the inhibitors on the surface and their influence on the inhibitory performance49.

Results and discussion

Open circuit potential (OCP)

The steady-state potential was measured by recording the change in OCP values after 35 min of exposure to 0.5 M H2SO4, both without and with inhibitors at various concentrations (Fig. 2). After 10 min, the OCP curves become nearly linear. The presence of KB1 and KB2 caused the OCP curves to stabilize at more positive values, indicating the formation of a protective layer on the CS surface, primarily on the anodic sites50,51.

Fig. 2
figure 2

OCP-time curves for CS submerged in 0.5 M H2SO4 before and after varying doses of KB1 and KB2 at 298 K.

PP analysis

Tafel polarization graphs for CS in 0.5 M H2SO4 at 298 K without and with different concentrations of KB1 and KB2 are displayed in Fig. 3. Table 1 provides the electrochemical parameters obtained from Tafel plots. Equation (1) was applied to find the inhibition effectiveness based on the icorr values52.

$$\:\% \:{\text{IE = }}\:\theta \times \:\:{\text{100}}\:{\text{ = }}\:\left( {{\text{1 - }}\frac{{\:{i_{corr}}}}{{{i^\circ }{\:_{corr}}}}} \right) \times \:{\text{100}}$$
(1)

.

i\(\:^\circ\:\)corr and icorr correspond to the corrosion current densities before and after the addition of the inhibitor. It is evident from Table 1 that icorr declines as the inhibitor’s concentration rises, reaching the lowest corrosion rate value at 9 × 10− 5 M. This phenomenon can be explained by the inhibitors adhering to the CS surface and establishing a protecting layer that shields the surface from the harsh environment, enhancing inhibition capacity values, which reached 87.5% and 91.4% for KB1 and KB2, respectively53. The Tafel slopes (βa, βc) do not alter with varying doses of KB1 and KB2, suggesting that their addition has no effect on the corrosion mechanism and that the principal mechanism of inhibition is the adsorption of inhibitors onto the CS surface, which blocks its active sites54. As seen from the Ecorr values in Table 1, there is a shift (< 85 mV) from the Ecorr of the blank when inhibitor molecules are present. This implies that the substances being studied have mixed-type inhibitory effects55. Additionally, using Eq. (2), the polarization resistances (Rp) for the CS/H2SO4 system at various concentrations of KB1 and KB2 were determined:

$$\:{R}_{p}\:=\:\frac{\beta\:a\beta\:c}{{2.303(\beta\:a+\beta\:c)i}_{\text{c}\text{o}\text{r}\text{r}}}$$
(2)

.

As the concentration rose, the Rp dramatically increased, indicating the formation of a protective film of KB1 and KB2 on the CS surface56.

Fig. 3
figure 3

Tafel diagrams for CS in 0.5 M H2SO4, both without and with KB1 and KB2 at 298 K.

Table 1 Corrosion parameters based on extrapolation of CS Tafel curves at 298 K.

EIS measurements

EIS, a non-destructive technique, was used to investigate the interface of CS substrates with and without inhibitors. It provides valuable insights into the corrosion inhibition mechanisms by revealing the electro-resistive and capacitive properties of the substrates under investigation57. The Nyquist and Bode diagrams of CS, produced in 0.5 M H2SO4 solution with and without different doses of KB1 and KB2 at 298 K, are displayed in Fig. 4a and b, respectively. As observed in Fig. 5, the acquired impedance values were fitted to a standard electrochemical circuit. Table 2 provides a summary of the evaluated corrosion parameters. Equation (3) can be utilized to get % IE based on the charge-transfer resistance (Rct) values58:

$$\:\% \:{\text{IE = }}\:\theta \times \:\:{\text{100}}\:{\text{ = }}\:\left( {{\text{1 - }}\frac{{{R^\circ }{\:_{ct}}}}{{{R_{ct}}}}} \right) \times \:{\text{100}}$$
(3)

.

where “Roct” represents the charge-transfer resistance in blank solution and “Rct” represents the charge-transfer resistance using different doses of KB1 and KB2. Nyquist plots (Fig. 4a) clearly show that the spectra consist of a single capacitive semicircle, indicating that the charge transfer process primarily controls the dissolution of CS, and the adsorption of KB1 and KB2 is achieved by simple surface coverage. As opposed to the uninhibited solution, the capacitive semicircle size of CS significantly increased upon the addition of the different concentrations of KB1 and KB2, implying a decrease in the rate of CS corrosion and an increase in % IE59. This means that the surface in the aggressive solution is protected via the developed adsorbed layer. The Bode graphs for KB1 and KB2 are displayed in Fig. 4b. Upon elevation of the inhibitor concentration, the impedance value rose; the higher impedance for KB2 suggests that it provides more safeguards for CS than KB134. Additionally, Nyquist plots deviate from idealized semicircles. This depression of the semicircles is attributed to many factors, including frequency dispersion effects, electrode surface irregularities, grain boundary impedance, and impurities60. The values of Rct (Table 2) increase from 39.50 Ω.cm2 for uninhibited CS to 300.7 Ω.cm2 and 517.4 Ω.cm2 at 9 × 10− 5 M of KB1 and KB2, respectively. The formation of thin layers of inhibitors at the CS-corrosive solution interface caused this observation61. As the concentrations of KB1 and KB2 rise, the double-layer capacitance (Cdl) values decrease, signifying that KB1 and KB2 molecules, which have lower dielectric constants, displace water molecules on the CS62. Analyzing Cdl data via the constant phase element (CPE) data parameters (\(\:{\text{Y}}_{0}\) and n) was achieved, whereas the CPE parameters for the circuit displayed in Fig. 5 were utilized to calculate Cdl via the following formula63:

$$\:\:{\text{C}}_{\text{dl}}\:={\left({\text{Y}}_{0}\:{R}_{ct}^{\left(1-\text{n}\right)}\right)}^{\raisebox{1ex}{$1$}\!\left/\:\!\raisebox{-1ex}{$\text{n}$}\right.}$$
(4)

.

where the CPE exponent n, depends on the character of the CS surface, while Y0 is the CPE magnitude64. The data collected using the PP approach is supported by the EIS findings.

Fig. 4
figure 4

Nyquist (a) and Bode (b) plots for CS in 0.5 M H2SO4 without and with various doses of KB1 and KB2 at 298 K.

Fig. 5
figure 5

The applied equivalent electrical circuit for fitting EIS data.

Table 2 The parameters obtained from EIS for KB1 and KB2 at 298 K.

Effect of temperature

The inhibition potency of KB1 and KB2 for the dissolution of CS in 0.5 M H2SO4 in the absence and presence of the maximum concentration was evaluated at various temperature ranges (298–328 K) via EIS and PP measurements. Increased system temperature enhances the kinetic mobility of corrosive species. By decreasing the deposited corrosion products and even the adsorbed film covering the CS surface, this behavior exposes a larger area of the CS to the corrosive solution, which in turn enhances iron oxidation and H2 evolution65. As revealed in Fig. 6a, the Nyquist spectra of CS in 0.5 M H2SO4 without and with the addition of 9 × 10− 5 M of KB1 and KB2 showed a semicircular shape that shrank in diameter as the temperature rose, suggesting that the mechanism underlying the CS corrosion process is independent of temperature. As the temperature rose, the data of % IE in Table 3 increased marginally, reaching 88.6% and 93.2% for KB1 and KB2, respectively. This demonstrated their capacity to inhibit and adsorb onto the surface of CS as a stable film over a range of temperatures, protecting it from the damaging effects of 0.5 M H2SO4 solution via chemical bonds (chemical adsorption)66. At 328 K, the % IE values decreased, which indicates that higher temperatures (328 K) may have led to the desorption of KB1 and KB2 from the surface. The temperature effect caused a slight increase in corrosion. The Bode diagrams in Fig. 6b show a one-time constant at all temperatures, confirming the presence of a single capacitive loop. Increasing temperature decreases the impedance modulus values at lower frequencies for the systems under study (Fig. 6b)64. PP measurements revealed similar findings, which are shown in Fig. 7 and Table 4. As temperature rises, so does the icorr and the rate at which CS dissolves. Since the icorr values obtained in the existence of KB1 and KB2 were lower than those achieved in their absence, it is evident that the investigated inhibitors significantly hindered the corrosion response of CS. The activation energy (\(\:{\text{E}}_{\text{a}}^{\text{*}}\)), change in enthalpy, and entropy (ΔH, ΔS) presented in Table 5 are thermodynamic activation parameters of the CS corrosion computed based on PP utilizing the Arrhenius and transition state equations as follows67.

$$\:\text{log}{\text{i}}_{\text{c}\text{o}\text{r}\text{r}}=\:-\frac{{\text{E}}_{\text{a}}^{\text{*}}}{2.303\text{R}\text{T}}+\text{l}\text{o}\text{g}\left(\text{A}\right)$$
(5)
$$\:\text{l}\text{o}\text{g}\left(\frac{{\text{i}}_{\text{c}\text{o}\text{r}\text{r}}}{\text{T}}\right)=\text{log}\left(\frac{\text{R}}{\text{N}\text{h}}\right)+\left(\frac{{\triangle\text{S}}^{\text{*}}}{2.303\text{R}}\right)-\left(\frac{{\triangle\text{H}}^{\text{*}}}{2.303\text{R}\text{T}}\right),$$
(6)

.

where the Arrhenius pre-exponential factor is denoted by A, T denotes the absolute temperature(K), the universal gas constant corresponds to R (J K− 1 mol− 1), h stands for Planck’s constant, and N for the Avogadro number. The \(\:{\text{E}}_{\text{a}}^{\text{*}}\) values were computed via the slope value of the Arrhenius plot in Fig. 8, as appeared in Table 5. ΔH and ΔS were computed via plotting log(i/T) against 1/T (Fig. 8), as indicated in Table 5. It was found that the values of \(\:{\text{E}}_{\text{a}}^{\text{*}}\) are higher when the inhibitors are present than when they are not. When compared to the KB1 molecule, KB2 has a lower value of \(\:{\text{E}}_{\text{a}}^{\text{*}}\), which indicates that its adsorption on the CS is chemical. However, the rise in the \(\:{\text{E}}_{\text{a}}^{\text{*}}\) could not be considered significant because of competitive adsorption with water, whose desorption from the surface also requires some activation energy, as documented in literature68. The data gathered showed that the energy barrier for the dissolution reaction rises when inhibitors are present, and the dissolution becomes more difficult to happen with the existence of tested inhibitors, as implied by the positive values of ΔH*, which suggests that the dissolution reaction is an endothermic process69. The negative values of ΔS* in the existence of KB1 and KB2 suggest that the activated complex favors association over dissociation, indicating the establishment of a stable inhibitor layer on the CS surface70.

Fig. 6
figure 6

Nyquist (a) and Bode (b) curves for CS in 0.5 M H2SO4 without and with adding 9 × 10− 5 M of KB1 and KB2 at different temperatures.

Table 3 The parameters obtained from EIS in 0.5 M H2SO4 before and after adding 9 × 10− 5 M of KB1 and KB2 at various temperatures.
Fig. 7
figure 7

PP curves for CS in 0.5 M H2SO4 without and with adding 9 × 10− 5 M of KB1 and KB2 at different temperatures.

Table 4 The parameters obtained from PP in 0.5 M H2SO4 before and after adding 9 × 10− 5 M of KB1 and KB2 at various temperatures.
Fig. 8
figure 8

Arrhenius (left) and transition state (right) plots for CS in 0.5 M H2SO4 without and with 9 × 10− 5 M of KB1 and KB2.

Table 5 Activation thermodynamic parameters for CS in the absence and presence of KB1 and KB2 at different temperatures.

Adsorption process study

Studying adsorption isotherms is a potent tool for understanding the physicochemical interactions between corrosion inhibitors and metallic surfaces. Organic molecules inhibit corrosion by adsorbing onto the metal surface, displacing water molecules, and forming a protective barrier that blocks corrosive agents. In the H2SO4 solution, numerous models were studied to examine the connection regime at the inhibitors/CS interface and identify the best isotherm among the many adsorption isotherms52,71. The Langmuir model (Eq. (7)) demonstrated optimal fitting, as confirmed by linear C/θ versus C plots (Fig. 9) with slopes and regression coefficients (R²) approaching unity via EIS and PP approaches. This alignment validates the isotherm’s applicability for adsorption analysis72.

$$\:\frac{\text{C}}{{\uptheta\:}}=\frac{1}{{\text{K}}_{\text{a}\text{d}\text{s}}}+\text{C},$$
(7)

.

where C represents the concentrations of KB1 and KB2, Kads is the adsorptive equilibrium constant, and θ denotes the fractional surface covered by the employed inhibitors. Kads can be computed from the intercept of Eq. (7). Equation (8) was utilized to obtain the standard free energy of adsorption (\(\:{\triangle\text{G}}_{\text{a}\text{d}\text{s}}^{^\circ\:}\)).

$$\:{\triangle\text{G}}_{\text{a}\text{d}\text{s}}^{^\circ\:}=-2.303\text{R}\text{T}\text{l}\text{o}\text{g}\left({\text{K}}_{\text{a}\text{d}\text{s}}\text{x}55.5\right),$$
(8)

.

where 55.55 designates the concentration of water in solution (M). The values of Langmuir isotherm parameters are provided in Table 6. The tested inhibitor molecules have a substantial adsorption ability as implied by the high Kads values, resulting in improved corrosion resistance73. According to Table 6’s data, \(\:{\triangle\text{G}}_{\text{a}\text{d}\text{s}}^{^\circ\:}\) values are negative, demonstrating that the inhibitors under study are adsorbing spontaneously on the CS surface. Based on literature74, \(\:{\triangle\text{G}}_{\text{a}\text{d}\text{s}}^{^\circ\:}\)values below − 20 kJ mol−1 suggest physisorption, which happens when the inhibitor and the surface interact electrostatically. On the other hand, values close to or higher than − 40 kJ mol−1 indicate chemisorption, which denotes the creation of coordination bonds through electron sharing or transfer. The adsorption of KB1 and KB2 onto the CS surface primarily happens via the chemisorption mechanism, which is started by physical interactions, according to the computed \(\:{\triangle\text{G}}_{\text{a}\text{d}\text{s}}^{^\circ\:}\)values.

Fig. 9
figure 9

Langmuir isotherms for the synthesized KB1 and KB2 utilizing data obtained via EIS and PP methods at 298 K.

Table 6 Langmuir isotherm parameters for KB1 and KB2 at 298 K.

Effect of immersion time

EIS is a practical method for evaluating the inhibition process after extended immersion75. The CS surface was subjected to 0.5 M H2SO4 solution at different immersion times, without and with 9 × 10− 5 M of KB1 and KB2 at 298 K. The effects of KB1 and KB2 on CS corrosion in 0.5 M H2SO4 at various intervals are represented in Fig. 10. Table 7 provides the %IE values for different immersion times. The tested inhibitors demonstrated good stability and consistent inhibition performance, as indicated by the minimal change in %IE values over an extended immersion period of 6 h. All Rct values were noticeably higher in the presence of KB1 and KB2 than in H2SO4 solution-free, suggesting that the adsorbed layer shields the CS from the harsh effects of the acidic medium66,76. The disintegration of the inhibitor film may have caused a decrease in inhibitory action after 6 h. This investigation further demonstrates the high stability and effectiveness of the tested inhibitors.

Fig. 10
figure 10

The impact of lengthy immersion periods on the effectiveness of KB1 and KB2 inhibition for CS dissolution in 0.5 M H2SO4 with 9 × 10− 5 M at 298 K.

Table 7 EIS parameters for CS in 0.5 M H2SO4 without and with 9 × 10− 5 M of KB1 and KB2 at various immersion times.

Zero charge potential

The tested inhibitors are adsorbed from H2SO4 solution onto the CS surface via chemical and physical interactions. The adsorption of inhibitors begins with physical interactions. After protonated molecules adsorb, charge sharing or transfer takes place between the metal’s d orbitals and the molecules. Numerous factors, including the charge or dipole moment of the inhibitor molecules, the inhibitor’s chemical structure, and the charge of the CS surface, can potentially influence the adsorption process77. The PZC of the CS in the inhibited solution was defined via the EIS technique to obtain additional information regarding the surface charge of the CS. Figure 11 shows the dependence of double-layer capacitance (Cdl) on the applied potential. The value of the CS’s EPZC corresponds to the minimum value of Cdl. The surface charge is determined by the position of Eocp relative to the EPZC, and Eq. (9) was used to calculate the net surface charge of the CS78.

$$\:{\text{E}}_{\text{r}}={\text{E}}_{\text{o}\text{c}\text{p}}-{\text{E}}_{\text{p}\text{z}\text{c}}$$
(9)

.

where Er stands for Antropov’s ‘‘rational’’ corrosion potential. Er> 0 denotes a positive net charge of the CS surface at open circuit potential, while Er <0 suggests a negative one. The CS surface was positively charged at the OCP when using KB1 and KB2, as implied by the positive Er values for both inhibitors (Table 8). Due to electrostatic repulsion, protonated inhibitors find it challenging to approach the positively charged CS surface. On the other hand, adsorption of the SO42− anion in aqueous H2SO4 solution is preferable since it generates an excess of negative charges. Nevertheless, because the SO42− anion is more hydrated than Cl anion, it adsorbs poorly on the positively charged CS surface, leaving more active sites available for the inhibitors to adsorb directly onto the charged metal surface. Also, it is crucial to remember that protonated species of KB1 and KB2 may be discharged on the CS surface, so neutral molecules that result may be able to adsorb on the surface of CS following chemisorption mechanisms via the unshared pair of electrons on the heteroatoms (N and S) to reduce metal disintegration by providing a protective chemisorbed layer52.

Fig. 11
figure 11

The plot of Cdl vs. E for CS in 0.5 M H2SO4 solution with 5 × 10− 5 M of KB1 and KB2 at 298 K.

Table 8 Values of Eocp, EPZC, and Er recorded for CS in 0.5 M H2SO4 solution with 5 × 10− 5 M of KB1 and KB2 at 298 K.

Surface characterization

AFM analysis

Metal surface roughness can be evaluated using AFM analysis79. To test the compounds’ ability to impede corrosion, the CS coupons were submerged in the blank solution for 24 h at 298 K without and with 9 × 10− 5 M of KB1 and KB2. Figure 12a–d depicts three-dimensional AFM images of the CS surfaces. Before the CS immersion in 0.5 M H2SO4, the CS’s surface appeared smooth with a roughness value of 34.16 nm (Fig. 12a), following immersion in 0.5 M H2SO4 (Fig. 12b), the surface was damaged and became rougher and the roughness value increased to 853.81 nm, adding KB1 and KB2 made the surface smoother and the roughness values diminished to 153.88 nm and 114.65 nm, respectively when related to the blank sample (Fig. 12c and d). The lower roughness value for KB2 indicates that it protects the CS more effectively than KB1 in 0.5 M H2SO4 by adhering to the CS surface and forming a protective film80,81.

Fig. 12
figure 12

3D AFM images of the surface of polished CS (a), following immersion in 0.5 M H2SO4 solution before (b) and after the addition of KB1(c), and KB2 (d) for one day at 298 K.

XPS analysis

The surface phenomena were examined using XPS to fully comprehend the elements of the adsorbed layer that developed on the exposed portion of CS submerged in 0.5 M H2SO4 solution with 9 × 10− 5 M of KB1 and KB2 after immersion for 24 h, as indicated in the acquired XPS spectra in Figs. 13 and 1482. The binding energies (BE, eV) with the assignment for each peak component are indicated in Table 9. As depicted in Figs. 13 and 14, the spectra comprise C 1s, N 1s, O 1s, Fe 2p, and S 2p, supporting the adsorption of KB1 and KB2 on the CS surface. Three peaks were visible in the C1s XPS spectra for KB1 and KB2. The C–H, C–C, and C = C bonds may cause the first peak, which is located at 284.88 and 285.08 eV83. The C–N bonds may be connected to the second peak, which is located at 286.28 and 286.68 eV, while the last peaks, at 288.38 and 288.58 eV, may be associated with C = N bonds, which are included in the structures of KB1 and KB2 and confirm their adsorption84. The XPS spectra of O 1s exhibited three peaks (Figs. 13 and 14). The first and second peaks, observed at 530.18 and 531.68 eV respectively, correspond to Fe2O3 / Fe3O4 and FeOOH. The third peak, at 532.58 and 532.78 eV, is associated with adsorbed water molecules85. XPS spectra of Fe 2p exhibit seven distinct peaks (Figs. 13 and 14). Metallic iron is characterized by peaks at 707.29 eV and 711.24 eV. The Fe3+ state is identified at 710.88 and 711.18 eV, while Fe3+ is at 712.88 and 713.98 eV. The 716.28 and 716.98 eV peaks may be related to Fe 2p3/2 of Fe2+. Additionally, satellite peaks of Fe³+ are observed at 719.88 and 720.18 eV. The Fe 2p1/2 component of Fe2+ appears at 724.48 eV, whereas Fe 2p1/2 of Fe3+ exhibits peaks at 726.98 and 727.18 eV. Finally, the Fe 2p1/2 component of Fe2+ is detected at 730.18, 729.98, 733.58, and 733.18 eV58. Nitrogen’s XPS spectra (Figs. 13 and 14) showed two peaks, the first at 399.18, 398.78 eV, and the second at 400.88, 400.78 eV, which stand for N-H/N-H2, N-Fe, N–N86and C = N–N bonds87respectively. Four peaks for S2p appeared in the XPS spectra (Figs. 13 and 14). The first at 161.58, 162.58, and 163.88 eV stand for sulphide and S-C bonds, while the second at 166.78, 166.68, 168.48, and 170.08 eV ascribed to S-Fe bonds87. Based on the XPS data, the adsorption of KB1 and KB2 on CS was proved.

Fig. 13
figure 13

XPS spectra of the adsorbed layer of KB1 developed on the CS surface following immersion in 0.5 M H2SO4.

Fig. 14
figure 14

XPS spectra of the adsorbed layer of KB2 developed on the CS surface after immersion in 0.5 M H2SO4.

Table 9 The binding energies (eV) with their assignments for the CS after being immersed in 0.5 M H2SO4 containing 9 × 10− 5 M of KB1 and KB2.

FT-IR analysis

Figure 15 presents the utilization of infrared spectroscopy to confirm the interaction among the inhibitors and the CS surface in 0.5 M H2SO4. The comparison of spectra for pure inhibitors and the layers that developed on CS samples show that the inhibited CS coupons resemble that of the free inhibitors, with shifts observed in the spectra, likely due to the interaction among inhibitor molecules and the CS surface, offering definitive evidence of inhibitor adsorption on the metal surface, thereby facilitating corrosion protection88. The shifting and removal of some peaks in the spectra after immersion indicated that the inhibitors effectively adsorbed onto the surface of CS via functional groups, resulting in inhibition89,90.

Fig. 15
figure 15

FT-IR spectra of the pure inhibitor and the layers that developed on CS samples after one day of immersion in 0.5 M H2SO4 with 9 × 10− 5 M of inhibitors at 298 K.

UV–Visible spectra

To verify the potential for developing the inhibitor-Fe complex, Fig. 16 displays the UV-Visible absorption spectra recorded for the test solutions of 9 × 10− 5 M of KB1 and KB2 before and after 48 h of CS immersion at 298 K. Before CS immersion, absorption bands for KB1 and KB2 are visible in the spectra at (248 nm, 456 nm) and (247 nm, 429 nm), respectively, which are ascribed to π‒π*and n‒π* possessing a significant charge transfer characteristic91,92. However, after CS immersion, the spectra exhibited changes in the location of absorption bands. The KB1 spectrum displayed two distinct bands at 247 nm and 431 nm, while the observed bands for KB2 appeared at 249 nm and 482 nm. The alteration in the absorption maximum (λmax) and/or the shift in absorbance values indicate the development of a complex between the tested inhibitor molecules and the Fe2+ ions in solution, as reported in literature93. These experimental results provide strong evidence for the formation of a protective metal/inhibitor complex film on the CS, confirming the complexation between Fe2+ and KB1/KB2 in H2SO4 solution94.

Fig. 16
figure 16

UV–visible spectra for test solutions of KB1 and KB2 before (black color) and after (red color) dipping CS for 48 h at 298 K.

Theoretical calculations

DFT

Figure 17 presents the optimized structures alongside the spatial distributions of the highest occupied molecular orbital (HOMO), the lowest unoccupied molecular orbital (LUMO), and molecular electrostatic potential (MEP) mapping for the KB1 and KB2 molecules in an aqueous environment. The corresponding theoretical parameters are provided in Table 10. Based on Frontier Molecular Orbital (FMO) theory, the interaction between a molecule and a metallic surface can be elucidated through the analysis of HOMO and LUMO energy levels, which offer valuable insight into the molecule’s electron-donating and -accepting capabilities. These energy levels determine whether a molecule exhibits anticorrosive properties95. Higher HOMO energy and lower LUMO energy generally correlate with enhanced anticorrosive performance. KB2 molecules exhibit a higher EHOMO (− 4.98 eV) than KB1 molecules (− 5.11 eV), according to the findings in Table 10, indicating that KB2 possesses superior corrosion inhibition capabilities. It is evident from Fig. 17 that the HOMO orbital for KB1 and KB2 concentrated on the triazole, hydrazone, pyridine, and quinoline moieties, rendering these areas more vulnerable to electrophilic assaults on the CS. The findings of the experiments support the idea that the tested inhibitor molecules can efficiently adhere to the CS, strengthening their protective impact against corrosion. Compared to the KB1 molecules, which have an ELUMO value of − 2.26 eV, the KB2 molecules exhibit a lower ELUMO (− 2.48 eV), suggesting that KB2 has a greater propensity for adsorption than KB1. Because it is desirable for enabling the transport of an electron from the inhibitor to the metallic surface, reducing the energy gap (ΔE) is essential for increasing the effectiveness of corrosion inhibitors96. In Table 10, KB2 has ΔE of 2.50 eV, significantly lower than the ΔE of KB1 (2.85 eV), demonstrating the increased susceptibility for the adsorption of KB2 onto CS. Corrosion inhibitors often possess low electronegativity (χ) values, reflecting their ability to donate electrons to the metal, thereby enhancing their protective performance97. However, the inhibitor molecule can receive the electron from the metal surface if its χ value is high. It occurs through back-donation, which enhances the bond at the steel interface98. The molecules of KB1 and KB2 have relatively high χ values, which facilitate the back-donation of electrons and promote the formation of more stable interactions with the CS, as detailed in Table 10. Furthermore, the reactivity and stability of inhibitor molecules can be evaluated through their global softness (σ) and hardness (η) parameters. The smooth passage of electrons to the CS via adsorption gives the soft molecules greater protective capacity than the hard molecules, rendering them effective corrosion inhibitors99. Table 10 illustrates that the KB2 molecule has better inhibitory properties than the KB1 molecule because of its greater σ and lower η values. Additionally, the number of electrons transferred (∆N) and ∆Eback−donation are pivotal factors in assessing the inhibitor’s capacity to give or accept electrons. It is suggested that electron transfer from the inhibitor to the metal occurs if ∆N values are higher than 0. Conversely, electron transfer from the metal to the inhibitor molecule is feasible if ∆N values (< 0)100. The molecules of KB1 and KB2 have positive ∆N values, which indicate their ability to supply electrons to the CS, as recorded in Table 10. Moreover, the ∆Eback−donation becomes less than zero when η > 0, indicating that electrons are moved from the metal to the inhibitor and then donated back to the metal. This dynamic process is desirable101. Table 10 presents negative ∆Eback−donation values for KB1 and KB2, suggesting their strong tendency for back-donation and the development of robust bonds47. The dipole moment (µ) indicates how polarizable the tested inhibitors are. A high value of µ suggests strong polarizability, which in turn shows high reactivity, prompting inhibitors to adhere to the surface firmly102. As mentioned in Table 10, KB2 has a higher dipole moment value (13.29 Debye) than KB1 (6.93 Debye), emphasizing its higher tendency to be adsorbed onto the CS, as well as strengthening its inhibitory impact. A noticeable correlation was observed among the molecular surface area of the tested inhibitors and their ability to safeguard the CS from dissolution. A larger molecular surface area enhances the inhibition efficiency and increases the contact area on the CS103. As presented in Table 10, KB2 exhibited a larger molecular surface area (329.54 Ų), resulting in greater inhibition efficiency when compared to KB1(252.02 Ų). The inhibitors’ active sites may be investigated via MEP mapping, a three-dimensional visual depiction that uses a molecule’s general charge distribution to determine its net electrostatic effect104. The red areas in Fig. 17 indicate the highest electron density, where the MEP is highly negative (nucleophilic reaction). In the meantime, the blue areas indicate the highly positive areas (electrophilic reaction)103. The highly negative regions in Fig. 17 are centered over free nitrogen, sulphur, pyridine, and quinoline moieties. In contrast, the highly positive areas over the triazole ring’s allocated nitrogenous atoms are due to the hybridization of lone pairs allocated on the nitrogenous atoms at positions (1,2) is the sp2 orbital, which is allocated in the same plane of the ring and does not overlap with other p orbitals of the ring. The areas with higher electron densities (shown by the red area) for KB1 and KB2 molecules are probably the most desirable for interactions with the CS, resulting in the configuration of sustainable protective layers.

Fig. 17
figure 17

The optimized structures, HOMO, LUMO, and MEP of the KB1 and KB2 using DMol3 module.

Table 10 Quantum chemical parameters for KB1 and KB2.

MC simulation

The best adsorption configurations and interactions between the tested inhibitors and the CS surface were investigated via MC simulations105. The most desirable adsorption configurations of KB1/KB2 are displayed in Fig. 18. KB1 and KB2 molecules are nearly parallel to the Fe (110) surface as a result, CS in the corrosive solution can be kept from corroding as much as possible via parallel adsorption which optimizes the surface-coverage characteristics of the inhibitors106. The adsorption energies computed via MC in Table 11 demonstrate significantly stronger adsorption for KB2, evidenced by its more negative adsorption energy (− 3083.62 kcal/mol) compared to KB1 (− 3030.47 kcal/mol). These results support the idea that KB2 could form a firmer adsorptive layer on the CS, enhancing corrosion resistance107. Furthermore, Table 11 asserts a higher inhibition proficiency for KB2 than KB1 by demonstrating that the adsorption energies values of KB2 for the pre-geometry optimization step, or unrelaxed (− 3240.13 kcal mol− 1), are more negative than KB1 (− 3181.06 kcal mol− 1) and for the post-geometry optimization step, or relaxed (156.51 kcal mol− 1, respectively), are higher than KB1 (150.59 kcal mol− 1). If water molecules or adsorbed inhibitors have been removed, the dEads/dNi values provide insight into the metal-adsorbates configuration energy108. In Table 11, the dEads/dNi value for KB2 is much higher (− 172.48 kcal mol− 1) than the KB1 molecule (− 142.41 kcal mol− 1). Accordingly, the KB2 molecule has a higher propensity for adsorption than the KB1 molecule. Furthermore, the dEads/dNi values for water are low (about − 7.65 kcal mol− 1) when compared to KB1 and KB2 values, indicating that inhibitor molecules adsorbed more robustly than water molecules, reinforcing the replacement of water molecules via tested inhibitor molecules109. Due to this replacement, a coherent protective layer developed onto the CS in the corroding medium. These computational findings are consistent with the observed experimental data on corrosion resistance.

Fig. 18
figure 18

The most suitable configuration for the adsorption of KB1 and KB2 on Fe (11 0).

Table 11 The MC simulation data for the adsorption of the KB1 and KB2 on Fe (110).

Corrosion Inhibition mechanism

Considering the theoretical and experimental results, Fig. 19 depicts the possible mechanism of corrosion inhibition for CS in 0.5 M H2SO4. According to the literature110, the adsorption between the inhibitor and the CS surface can occur physically, chemically, or both. Physical, which results from electrostatic interactions between the charged CS surface and the protonated groups of organic molecules111. In this context, the protonated inhibitors in H2SO4 can be adsorbed on CS surfaces through interaction with the negatively charged surface (caused by the adsorbed SO42− ions on it), resulting in physical adsorption. On the other hand, there are two strategies to achieve the chemical adsorption of the tested inhibitors on the CS surface through donor-acceptor interaction90. The first involves the interaction of π-electrons on the nitrogen atoms and π-electrons of the aromatic moieties and the vacant d-orbital of the CS, inhibiting it from dissolving in the corrosive medium. The second is accomplished by the formation of the Fe-inhibitor complex, which results from the chemical coordination of iron atoms as electron acceptors and the inhibitor’s heteroatoms as electron donors. Retro-donation, in which orbital electrons are transferred from the metal atoms to the inhibitor molecules’ antibonding molecular orbitals, is another way that inhibitor molecules might attach to metal surfaces112. The %IE of these derivatives is in the order KB2 > KB1, which is explained by the presence of quinoline moiety and azido group in the structure of KB2. Also, it has a lower energy gap and a higher softness value, which increases the availability of donation and retro-donation, thus improving and strengthening its adsorption on the CS surface.

Fig. 19
figure 19

A schematic representation of the corrosion inhibition mechanism for CS in 0.5 M H2SO4.

Comparative studies with previous reports

Notably, our compounds exhibited high inhibition efficiencies even at relatively low concentrations, whereas many literature-reported inhibitors required significantly higher concentrations to achieve comparable efficiency values, as indicated in Table 12. This demonstrates both the cost-effectiveness of KB1 and KB2 as well as their improved corrosion inhibition capabilities, as lower amounts are needed to protect the surface of CS. We think that this comparison gives an improved overview of the economic and practical benefits of our eco-friendly inhibitors.

Table 12 Comparison of studied inhibitors with some reported Triazole derivatives.

Conclusion

  1. 1.

    In this study, we synthesized and characterized two triazole compounds, KB1 and KB2. These compounds were then tested for their ability to impede dissolution in 0.5 M H2SO4 via different electrochemical techniques (OCP, PP, and EIS), surface characterizations, UV-Visible spectroscopy, and theoretical investigations.

  2. 2.

    The results showed that both KB1 and KB2 inhibitors effectively impeded the corrosion of CS in the acidic medium, with KB2 exhibiting the highest protection efficiency of 92.4% at a dose of 9 × 10-5 M.

  3. 3.

    The tested compounds were identified as mixed-type inhibitors via the PP measurement.

  4. 4.

    The addition of KB1 and KB2 results in a decrease in double-layer capacitances relative to the blank solution. This validates their adsorption on the CS.

  5. 5.

    Analysis of the inhibitors’ adsorption behavior revealed that they aligned with the Langmuir adsorption isotherm. According to thermal studies (298–328 K), strong adsorptive interactions with the CS are indicated by the inhibitors’ improved inhibition at 318 K (88.9% for KB1 and 93.6% for KB2), then decreased at 328 K, which implies that higher temperatures (328 K) may cause the desorption of KB1 and KB2 from the CS.

  6. 6.

    The slight change in %IE value during a long immersion period extended to 6 h implies the stability of the protective film developed by KB1 and KB2 onto the CS. To investigate the inhibitory mechanism, ZCP measurements were employed, which demonstrate that the inhibitors first engaged in electrostatic interaction with the positively charged CS surface. After this, robust chemical bonds are formed.

  7. 7.

    Surface characterization techniques (AFM, XPS, and FT-IR) verified that the CS surface had a protective film that successfully protected it from the H2SO4 environment. The potential for complex establishment between ferrous ions and the tested inhibitors was validated via UV-visible spectroscopy.

  8. 8.

    DFT and MC simulations have explored the molecular structure, reactivity, and adsorption configuration of KB1 and KB2. They validated the placement of their multi-active sites and supported the experimental findings. The data acquired in this report highlights the potential application of synthesized triazoles as potent inhibitors against dissolution in metal treatment processes.