Novel synthesized triazole derivatives as effective corrosion inhibitors for carbon steel in 1M HCl solution: experimental and computational studies

This article outlines the synthesis of two derivatives of 4-amino-5-hydrazineyl-4H-1,2,4-triazole-3-thiol for the prevention of carbon steel corrosion in 1M HCl solution. These derivatives are (Z)-3-(1-(2-(4-amino-5-mercapto-4H-1,2,4-triazol-3-yl)hydrazono)ethyl)-2H-chromen-2-one (TZ1) and 5-(2-(9H-fluoren-9-ylidene)hydrazineyl)-4-amino-4H-1,2,4-triazole-3-thiol (TZ2). Weight loss, electrochemical experiments, surface examinations, and theoretical computation are used to evaluate the effectiveness of the two compounds to be used as corrosion inhibitors. Weight loss and electrochemical studies demonstrate that these derivatives reduce the corrosion rate of carbon steel. To examine the morphology and constitution of the carbon steel surface submerged in HCl solution as well as after adding inhibitors, surface examination tests are performed. Analysis of the test solution via UV–visible spectroscopy is employed to check the possibility of complex formation between inhibitor molecules and Fe2+ ions released during the corrosion process. In order to explore their biological activity, the antibacterial activity was investigated against (E. coli and Bacillus subtilis). Finally, theoretical confirmation of the experimental findings is provided by quantum chemical (DFT) and Monte Carlo (MC) simulation studies. More adsorption sites are present in the derivatives of 4-amino-5-hydrazineyl-4H-1,2,4-triazole-3-thiol, which offer a novel perspective for developing new classes of corrosion inhibitors with substantial protective efficacy, especially at high temperatures.


Synthesis of inhibitors
TZ1 and TZ2 molecules were synthesized in accordance with Fig. 1.

Aqueous solutions
The corrosive medium, 1 M HCl, was prepared by diluting 37% HCl analytical grade (Acros Organics Brand supplied by Cornell Lab, Egypt) with double-distilled water.This concentration was standardized using a standard solution of sodium carbonate.Stock solutions (10 −3 M) were prepared for each of TZ1 and TZ2 by dissolving the appropriate amount of solid in 10 ml dimethyl-sulfoxide (DMSO) then the volume was completed to 100 ml with absolute ethanol.The resulting stock solutions were diluted using double-distilled water to the needed concentration range (1-9 × 10 −5 M).To negate the influence of solvents on the inhibition, the percentage of solvents in which the inhibitor dissolved was kept constant throughout the prepared solutions in both the presence and absence of the inhibitors.

WL method
Six CS samples with dimensions 2.2 × 1.6 × 0.2 cm (L × W × H) were pretreated and polished by utilizing different grades of emery paper (400, 1000, 1200, and 2000), cleaned with double-distilled water, dehydrated by filter papers, and weighed.Then, samples were dipped into 1M HCl solution using a glass hook without the use of inhibitors (TZ1, TZ2) and after adding different concentrations for 6 h at various temperatures (25-45 °C).The samples were withdrawn, rinsed, dried, and weighed again every hour.The inhibition efficiency (%IE) as well as the surface coverage (θ) of the studied inhibitor molecules were computed using Eq.(1) 23 .
where (W°) and (W) are the average weight loss without as well as with the inhibitor, respectively.

Electrochemical techniques
A Potentiostat/Galvanostat/ZRA analyzer (Gamry 5000E, USA) was utilized to conduct all the electrochemical tests.Three electrodes were employed in the glass cell: a working electrode (CS sample with an exposed surface area of 0.8 cm 2 ), an auxiliary electrode (platinum sheet), and a reference electrode (Ag/AgCl electrode).The samples were pre-treated like the WL method.At 25 °C, these electrodes were immersed in 1M HCl solution both before and after different concentrations of the inhibitors were added.PP curves were acquired using a voltage range of ± 500 mV at E ocp with a scanning rate of 0.5 mV/s.The extrapolation of the cathodic and anodic (β c and β a ) Tafel slopes of the curves yielded the corrosion current (i corr ) value.To obtain %IE and θ, Eq. ( 2) was applied.To carry out the electrochemical impedance spectroscopy (EIS) test, a frequency range of 0.1-100,000 Hz and an amplitude of 10 mV were applied.From Eq. (3), %IE and θ were obtained 24 .
where (i°c orr ) and (i corr ) represent the corrosion current densities without as well as after utilizing the inhibitor, respectively.
where ( R • ct ) and ( R ct ) represent the charge transfer resistance without as well as after utilizing the inhibitor, respectively.

AFM analysis
The CS sheets were polished until the surface appeared like a mirror, rinsed, dried, and then dipped in HCl solution without as well as with the existence of 9 × 10 −5 M of TZ1 and TZ2 at 25 °C for 24 h.Following removal from the solution, the CS samples were rinsed, dried, and subjected to AFM examination (Nanosurf FlexAFM 3, Gräubernstrasse 12, 4410 Liestal, Switzerland).This approach was applied at the Nanotechnology laboratory, Faculty of Engineering, Mansoura University to investigate how the tested inhibitors affected the morphology of the metal surfaces in 1M HCl.

XPS analysis
The CS samples were pre-treated first as AFM analysis.XPS analysis was performed to determine the composition of the adsorbed layers on the surface of CS by using (AXIX Ultra DLD, Kratos, UK).

Solution analysis (UV-visible spectroscopy)
This technique was carried out to examine the complexation between Fe 2+ ions released during the corrosion process and the inhibitors.(T80+ UV/vis spectrometer, UK) was used to record the spectra.

Antibacterial activity test
The agar well diffusion method was used to evaluate the antibacterial activity of TZ1 and TZ2 25,26 .The tested organisms are gram-negative bacteria (Escherichia coli) and gram-positive bacteria (coli).The agar plate surface is inoculated by spreading a volume of the microbial inoculum over the entire agar surface.Then, a hole with a diameter of 9 mm is punched aseptically with a sterile cork borer or a tip, and a volume (50 µL) of the antibacterial agent at the desired concentration is introduced into the well.Then, agar plates are incubated under suitable conditions depending on the test microorganism.After the incubation, inhibition zones for the antibacterial agents were measured in diameter.

DFT and MC simulation studies
The DMol 3 module in Materials Studio 2017 and the GGA technique with a DNP basis set as well as BOP functional incorporates COSMO controls were both used to perform quantum chemical calculations in the aqueous phase 27,28 .While using the Adsorption Locator module, MC simulation was carried out to identify the adsorption configurations of the two tested inhibitors on the interface of Fe (110) 29 .All computations were performed utilizing the force field COMPASS (Condensed-phase Optimized Molecular Potential for Atomistic Simulation Study) 30 .

WL Measurements
Impact of concentrations and temperature Using the WL approach at various temperatures, the corrosion rate of CS in 1M HCl solution as well as inhibited 1M HCl with varying concentrations of the inhibitors was studied.WL at 25°C using various concentrations of inhibitor molecules (TZ1 and TZ2) varies over time as seen in Fig. 2, whereas Table 1 displays how temperature affects %IE and CR.As the concentration of inhibitor in the test solution increased, it was discovered that the CR clearly decreased, causing the %IE to rise.These findings imply that TZ1 and TZ2 are influential inhibitors for CS corrosion in HCl solution.Additionally, as the inhibitor concentrations were increased, the surface coverage on the CS surface would rise 31,32 .A close examination of the data summarized in Table 1 revealed that, for the same inhibitor concentration, the inhibition efficiencies are in the following order: TZ1 > TZ2, consequently TZ1 is the most efficient inhibitor.The influence of temperature on the rate of CS corrosion in 1M HCl as well as with the inclusion of various concentrations of TZ1 and TZ2 was examined between 25 and 45 °C with 5-degree increments.Raising the temperature improves the inhibitory performance of TZ1 and TZ2, as seen in Table 1, suggesting that the kind of adsorption could be chemisorption 33 .

Thermodynamic activation parameters
According to the Arrhenius equation Eq. ( 4), the activation parameters for the corrosion process of CS were computed 34 and listed in Table 2. where (E a * ) represents the apparent activation energy, A denotes the frequency factor, R is the universal gas constant, T represents the absolute temperature and CR denotes the corrosion rate computed via WL measurements.Figure 3 displays Arrhenius plots for TZ1 and TZ2.Straight lines with a slope of (− E a */2.303R) and an intercept (log A) were established.The E a * values in Table 2 decreased as the inhibitor concentration increased, demonstrating chemisorption adsorption 35 .The transition state equation was employed to estimate the enthalpy as well as the entropy of activation (ΔH*and ΔS*) Eq. ( 5) 36 .
where N = Avogadro's number, h refers to Planck's constant, ΔH * and ΔS * are the enthalpy and the entropy of activation, respectively.The transition state plots for TZ1 and TZ2 are shown in Fig. 4. Straight lines were gained with (slopes = − ΔH*/2.303R) and (intercepts = (log(R/Nh) + (ΔS * /2.303R)), which used for the computation of ∆H* and ∆S* as listed in Table 2.The positive values of ∆H* demonstrate that CS dissolves endothermically 37 .The activated complex more frequently existed in the associated form (TZ1 and TZ2 adsorbed on CS surface) than in the dissociated form (TZ1 and TZ2 in solution), as indicated by the negative values of ∆S*, suggesting that the disorder is reduced during the corrosion of CS 38 .

Adsorption isotherms
There are numerous adsorption isotherms that regulate how the two examined inhibitors interact with the CS surface.In order to know which adsorption model is in good agreement with the collected data, the relations of the most popular ones including Langmuir, Frumkin, Freundlich, El-Awady, Temkin, and Flory-Huggins isotherms were plotted, and then calculating the regression coefficient, slope, and intercept (see supplementary file S7 and Table S1) 39 .The values of the regression coefficient (R 2 ) of Langmuir isotherm have least deviated  from unity (R 2 ) > 0.99.As a result, the adsorption of TZ1 and TZ2 molecules follows the Langmuir adsorption isotherm which was expressed by Eq. ( 6) that gave the best linear plots based on the fitted experimental data.
where C and Ө are the inhibitor concentration (M) and the degree of surface coverage, respectively and K ads is the adsorption equilibrium constant (M -1 ) that was calculated from the intercepts of the linear plots of C/θ against C, as shown in Fig. 5.The slopes and correlation coefficients (R 2 ) for these plots were found to be close to unity.The acquired K ads values (Table 3) for TZ1 and TZ2 gradually increase with increasing inhibitor concentration, implying excellent inhibition efficacy 40 .The values of standard free energy of adsorption (ΔG°a ds ) were computed based on K ads values according to Eq. ( 7).
where 55.5 denotes the concentration of water in the solution (M), R is the universal gas constant (8.314J K −1 mol −1 ), as well as T refers to the absolute temperature(kelvin).To comprehend the adsorption type of inhibitors, the value of ΔG°a ds was utilized.The values of ΔG°a ds are higher negative, as can be observed in Table 3, indicating that the adsorption of inhibitor molecules on the surface of CS is spontaneous 41 .According to the published papers, the adsorption of an inhibitor is referred to as physisorption if the ΔG°a ds values are close to − 20 kJ mol −1 or less negative, and chemisorption if they are close to − 40 kJ mol −1 or more negative 42,43 .
The ΔG°a ds values for TZ1 and TZ2 range from − 38.76 to − 43.94 kJ mol −1 , demonstrating that the inhibitors' adsorption mechanism on CS surface in 1M HCl solution appears to be mixed one (chemisorption and physisorption) but mainly chemisorption 44 .Equation (8) (Van't Hoff equation) may be utilized for the computation of the heat of adsorption (ΔH°a ds ) by plotting log K ads versus 1/T as displayed in Fig. 6 45 .
As shown in Table 3, the positive ΔH° ads values imply that TZ1 and TZ2 adhered to the CS surface through an endothermic process.Endothermic adsorption is commonly believed to be caused by chemisorption as reported in previous works 46 .The positive sign of ΔS°a ds is due to the substitution process, which is caused by an increase in entropy at the CS/solution interface during the adsorption process because more water molecules are being desorbed from the metal surface by the inhibitor molecules existing in the solution 41 .4. The extrapolation of the anodic and cathodic curves yields the current density (i corr ) and corrosion potentials (E corr ) at the connecting point 47 .As depicted in Fig. 7a, the gradual addition of TZ1 and TZ2 led to a decrease in the current density of the anodic and cathodic reactions for CS in comparison to the blank solution and an increase in %IE.The fact that neither the cathodic Tafel slopes (β c ) nor the anodic Tafel slopes (β a ) alter noticeably with the addition of TZ1 and TZ2 suggests that the corrosion reaction's mechanism  is unchanged and that it is just impeded by the simple adsorption mode 48 .Also, no discernible change was seen for E corr (roughly 16 mV), which is less than 85 mV, indicating that the two inhibitors behaved as mixed inhibitors that affected the anodic as well as cathodic processes 41 .The OCP values listed in Table 4 are comparable to the E corr and show that the CS electrode potential shifted to a less negative value, significantly in TZ1, with increasing the inhibitor concentration.Indicating that the CS becomes less active toward dissolution reaction in  www.nature.com/scientificreports/inhibitor-containing acid compared to that in free acid.According to PP and OCP tests, TZ1 is more effective to be used as a corrosion inhibitor than TZ2.

EIS measurements
EIS is a useful technique for examining corrosion.EIS curves of CS in 1M HCl and in the existence of different concentrations of TZ1 and TZ2 at 25°C are shown in Fig. 8.These curves demonstrate that all of the produced Nyquist plots (Fig. 8a) are nearly semicircular and that their diameter increases as the inhibitor concentration rises.This shows that as the concentration of an inhibited substrate rises, so does its impedance.This finding demonstrates that the charge transfer process mostly controls CS corrosion in 1M HCl and in the existence of investigated inhibitors 49 .The imperfect circular shape of the capacitive loops deviates from the ideal shape, which is attributable to frequency dispersion brought on by surface roughness, the development of porous layers, dislocations, as well as surface inhomogeneities 50 .However, in Fig. 8a there is a noise observed at a low-frequency region in the EIS arc for all concentrations in both inhibitors.This could be attributed to heterogeneity at the electrode/electrolyte interface that comes from the release of a significant amount of the corrosion product as well as the interaction between the inhibitor active sites and the electrode surface.Figure 8b depicts the Bode plots for the two inhibitors, the impedance value increased with increasing the inhibitors concentration, and the larger impedance indicates that TZ1 offers better protection for CS than TZ2 51 .Table 5 lists impedance parameters developed from fitting the data to the most appropriate electrical circuit (Fig. 9) including charge transfer resistance (R ct ), double layer capacitance (C dl ), and inhibition efficiency (%IE).It is clear that R ct values rise as inhibitor concentrations rise while C dl values fall.Also, it is observed that the diameters of the semi-circles for TZ1 < TZ2 confirm that TZ1 is the most effective inhibitor.Adsorption of TZ1 and TZ2 at the metal/solution contact is responsible for this.The following Eq.( 10) was used to determine the C dl at the frequency f max 52 .
Owing to the growing surface coverage of inhibitors on the surface of CS, the %IE rises when inhibitor concentration is increased.The results of the EIS measurements are in agreement with those attained using PP and WL methods.

AFM analysis
The surface morphology was investigated on the nanoscale by employing AFM for analyzing the major impact of TZ1 and TZ2 on the CS corrosion to establish the efficacy of the synthesized inhibitors as corrosion inhibitors 53,54 .Figure 10 shows three-dimensional AFM images for polished CS surfaces, surfaces immersed in 1M HCl, and surfaces with the existence of optimal inhibitors concentration (9 × 10 −5 M) for 24 h.The average roughness of the polished CS surface was 6.91 nm (Fig. 10a), and caused by 1M HCl was 652.06 nm (Fig. 10b) but the existence of 9 × 10 −5 M of TZ1 and TZ2 in 1M HCl reduced the average roughness of CS surface to 57.92 and 157.05 nm, respectively, as displayed in Fig. 10c and d.This difference in average roughness values provides information about the effective adsorption of TZ1 and TZ2 on the CS surface and creates a shielding layer that reduces the attack caused by the 1M HCl 55 .These roughness values corroborate the results of both chemical and electrochemical procedures.

XPS analysis
The structure of TZ1 and TZ2 molecules and chemical bonds were identified and described using XPS analysis, which was also used to demonstrate that the molecules had adhered to the CS surface.Figures 11 and 12 display the XPS spectra for CS surfaces subjected to 1 M HCl with the inclusion of TZ1 and TZ2 molecules.The obtained (10)         observed in the S 2p spectra (Figs.11, 12), the peaks at 162.60 eV and 163.89, 166.13 eV could be related to the S-C bond from the thiol group (C-SH).The last peaks located at 168.12, 168.64, and 170.01 eV could be related to S-Fe bond 57 .As a result, the adsorption of TZ1 and TZ2 using 1 M HCl on the CS surface was verified by XPS measurements.

Analysis of test solution (UV-Visible spectroscopy)
UV-visible spectroscopy measurements were done for both inhibitors in three different solutions: inhibitor only, inhibitor + HCl, and inhibitor + HCl + CS immersed for 48 h at 25 °C.The concentration of inhibitor and HCl were kept at 9 × 10 −5 M and 1.0 M, respectively in all three mixtures.According to the spectra (Fig. 13), TZ1 and TZ2 showed peaks at (220 nm, 330 nm) and (219nm, 330 nm, 423 nm), respectively, which may be attributed to π-π* and n-π* transitions 64 .The spectra of the inhibitors in 1 M HCl before CS immersion shows a small  www.nature.com/scientificreports/shift(insignificant) in wavelength but after the immersion of CS, the spectra of TZ1 and TZ2 reveal some change in the adsorption bands.The spectrum of TZ1 showed two bands at 245 nm and 521nm, and the spectrum of TZ2 also indicates two well-distinguished bands at 245 nm and 523 nm.According to the literature 65 , the change in the position of the absorption maximum (λ max ) and/or the variation of the absorbance value suggest the formation of a complex between the triazole compounds and the Fe 2+ ions in the solution.Therefore, the obtained results from the UV-visible spectral analysis of the inhibitors before and after CS immersion demonstrate that the thiol, (C=N-N), double bonds of triazole ring, coumarin ring, and fluorene are primarily involved in the adsorption of these inhibitors on CS surface.This suggests that triazole derivatives can form a complex with iron atoms according to a donor-acceptor mechanism, confirming the chemisorption process of TZ1 and TZ2 on CS surface 64 .www.nature.com/scientificreports/

Antibacterial activity
The result of antibacterial activity with zones of inhibition measured in millimeters is as shown in Table 7. TZ1 showed good inhibitory effect against E. coli and B. subtilis with inhibition zones of 15 and 17 mm, respectively while TZ2 exhibited good inhibitory effect against E. coli (17 mm) but no activity against B. subtilis.Finally, the antibiotic sensitivity of Ciprofloxacin (CIP) showed the highest inhibitory effect against the two micro-organisms with inhibition zone of 39 mm for E. coli and 29 mm for B. subtilis.TZ1 and TZ2 have antibacterial activity which demonstrates their environmentally friendly and anti-toxic nature.

DFT studies
To investigate the chemical reactivity and determine the established association with the experimentally achieved inhibitory efficacy, DFT calculations are applied.Figure 14 depicts the optimized structures, HOMO and LUMO distributions, and the linked theoretical parameters for TZ1 and TZ2 are summarized in Table 8.According to the FMO theory, HOMO, as well as LUMO energies, specify the capacity of donor or acceptor interactions carried out at the surface of inhibitor/metal 66 .An inhibitor molecule with high E HOMO and low E LUMO values performs better Table 6.Binding energies (eV), and their assignments observed for CS surface treated with 9 × 10 −5 M of TZ1 and TZ2 in 1M HCl.   8.According to Fig. 14, it is clear that the HOMO level localized on the triazole ring and hydrazone moieties for TZ1 and TZ2, indicating that the sulfur, as well as nitrogen atoms, are the favored sites for electrophilic attacks on the CS surface.Such interpretations promote the capability of the inhibitor to adsorb on the CS surface, causing an improvement in the performance of the protection, which was consistent with the experimental findings.Conversely, the E LUMO value of the TZ1 molecule is − 2.61eV, which is lower than that of the TZ2 molecule (− 2.42 eV).The lower E LUMO value for the TZ1 molecule indicates that it has excellent protective capabilities than TZ2, which agrees with the experimental findings.Likewise, the ∆E (energy gap) is a crucial parameter to enhance the inhibitor's ability to resist corrosion, which improves as the ∆E value decreases 67 .According to Table 8, TZ1 is more likely to be adsorbed on the surface of CS because it has a lower ∆E value (2.02 eV) than TZ2 (2.23 eV).The low values of electronegativity (χ) suggest a high potential reactivity of the TZ1 and TZ2 molecules to provide electrons to the CS surface 68 .Additionally, the hardness (η) as well as softness (σ) of a molecule may be utilized to establish its reactivity and stability.The reactivity of soft molecules is higher than hard molecules because they provide electrons more readily to the CS surface via adsorption, making them effective corrosion inhibitors 69 .Table 8 shows that TZ1 has higher σ value and lower η value than TZ2, indicating easy electron donation to CS surface and excellent inhibitory proficiency for TZ1  70,71 .The ∆N values of TZ1 and TZ2 are more than zero as reported in Table 8, showing that the inhibitors are able to transfer electrons to the iron surface.Additionally, when η is greater than 0, the ∆E back-donation will be less than 0. This is because an electron that is transferred to an inhibitor molecule is followed by a back donation from the inhibitor molecule, which is dynamically desired 72 .The ∆E back-donation values for TZ1 and TZ2 molecules in Table 8 are negative, revealing that back-donation is favored for the inhibitor molecules and creates a strong bond 73 .Furthermore, the dipole moment is a crucial marker that aids in predicting the pathway of corrosion inhibition 74 .The improvement in deformation energy and augmentation of molecule adsorption on the steel contact are both made possible by the increase in dipole moment.As a result, an increase in dipole moment leads to an improvement in corrosion prevention effectiveness 75 .TZ1 molecule has a higher dipole moment value (12.60 Debye) than TZ2 molecule (10.06 Debye), as shown in Table 8, which supports its stronger propensity to adsorb onto the CS surface.Furthermore, there is a clear link among the propensity of TZ1 and TZ2 molecules to shield the CS surface from acidic media and their molecular surface area.The increased protective capability is correlated with larger size of molecular structure as the contact area among TZ1 and TZ2 molecules and CS surface increases 76 .Table 8 indicates that TZ1 has the highest molecular surface area (321.19Å 2 ) and therefore greater inhibitory efficacy when compared to TZ2 (314.47Å 2 ).Additionally, the Dmol 3 module's ability to estimate molecular electrostatic potential (MEP) mapping to look into the active sites of the inhibitors under investigation.MEP mapping is a 3D visual representation that aims to identify a molecule's net electrostatic impact based on its general charge distribution 67 .The highest electron density area is represented by the red colors in the MEP maps shown in Fig. 15, in which the MEP is highly negative (nucleophilic reaction).However, the strongest positive area (electrophilic reaction) is represented by the blue colors 60 .The greatest negative regions (red colors) in Fig. 15 are mostly over free nitrogen, sulphur, and oxygen atoms for TZ1 but over free nitrogen, sulphur, and aromatic rings for TZ2, whereas the most positive regions (i.e., blue colors) over allocated nitrogenous atom of triazole ring as hybridization of lone pairs allocated on the nitrogenous atoms of triazole at positions (1,2) is sp 2 orbital which allocate in the same plane of the ring and does not overlap with other p orbitals of the ring.The highest potential places for interactions with the CS surface could be those with high electron densities in TZ molecules.

MC simulations
The interactions between TZ1 and TZ2 molecules and the CS surface as well as the adsorption mechanism were visualized using MC simulations.The most probable adsorption configurations for TZ1 and TZ2 molecules on the CS are depicted in Fig. 16.This was made possible via the adsorption locator module, which displays smooth disposition as well as offers an enhancement in the adsorption with the most surface coverage 77 .Table 9 lists the data that was determined via MC simulations.The Table summarizes the adsorption energies of TZ1 and TZ2 (both unrelaxed and relaxed) before and after the geometry optimization process.It is found that TZ1 (− 3061.79 kcal mol −1 ) has a higher negative value of adsorption energy than TZ2 (− 3034.04 kcal mol −1 ), implying robust adsorption of TZ1 on the CS surface creating a fixed adsorbed film, which is consistent with the experimental data 77 .The dE ads /dN i values describe the metal-adsorbate configuration's energy if one of the adsorbates is eliminated 78 .TZ1 molecules have superior adsorption than TZ2 molecules, as evidenced by the fact that their dE ads /dN i value is higher (− 194.09 kcal mol −1 ) than that of TZ2 molecules (− 187.14 kcal mol −1 ).Furthermore, the dE ads /dN i value for water is about − 7.36 kcal mol −1 , which is low when linked to the TZ1 and TZ2 values, indicating that these two investigated inhibitors were adsorbed more strongly than water molecules on the CS surface, supporting the replacement of water molecules with TZ1 and TZ2 molecules.Thus, it can be summarized that these MC results correspond well with the quantum chemical calculations as well as the experimental data.www.nature.com/scientificreports/

Corrosion inhibition mechanism
It is possible to propose a schematic mechanism for the interaction of tested triazole derivatives with CS surface based on the data we obtained in this work, as displayed in Fig. 17.TZ1 and TZ2 molecules can be chemically adsorbed through acceptor-donor interactions 79 .The presence of many functional groups and heteroatoms in addition to electronic pairs as well as pi bonds can ensure the donation of the electron to the vacant d-orbitals of iron and thus form strong bonds (chemisorption) with the CS surface.However, inter-electronic repulsions result from the transfer of electrons from the inhibitor to vacant d-orbitals of metal.The filled d-orbitals of the metal atoms will transfer electrons in the reverse order to the vacant antibonding molecular orbitals of TZ1 and TZ2 by retro-donation to avoid these repulsions, therefore enhancing the adsorption on the metal surface as it is reported that more electron donation causes an increase in retro-donation, and therefore donation and retro-donation reinforce each other via synergism 80 .In the HCl solution, TZ1 and TZ2 can also be protonated due to the presence of an NH 2 group with higher electron density, which promotes the electrostatic interaction with the negatively charged metal surface created by Cl-ions (physisorption) 81 .
According to the collected theoretical data, TZ1 was more efficient than TZ2 because TZ1 has the highest molecular surface area so it covers a larger area from the CS surface, highest dipole moment, has the highest adsorption energy, the highest softness value (more reactive) and lowest energy gap.As a result, TZ1 can donate more electron pairs to the d-orbital of iron than TZ2.These electrons will be accumulated on the CS surface and followed by a retro-donation from the filled d-orbital of iron to Π* (C=C, C=O), resulting in the stronger adsorption of TZ1 on the CS surface than TZ2 (retro-donation from d-orbital to Π* (C=C)).

Comparative studies with previous reports
In this study, two novel 1,2,4-triazole derivatives were synthesized, and their effectiveness as corrosion inhibitors for carbon steel (CS) in a 1.0 M HCl solution was evaluated using various techniques.Table 10 illustrates the inhibitory effect of (TZ1 and TZ2) and other 1,2,4-triazole compounds for CS corrosion in an acidic medium.As represented in Table 10, TZ1 and TZ2 inhibitors exhibited comparable corrosion inhibition efficiencies when compared to other 1,2,4-triazole derivatives.Notably, the used concentrations of TZ1 and TZ2 were more than tenfold lower than those of other derivatives listed in Table 10, which makes these current inhibitors cost-effective and favorable for use.Furthermore, the effectiveness of TZ1 and TZ2 in inhibiting CS corrosion increases with rising temperatures.8) From AFM and XPS data for surface analysis, it was confirmed that the tested inhibitors were well linked to the CS surface.The complex formation between ferrous ions and the investigated inhibitors was proved by UV-visible spectroscopy.TZ1 showed good antibacterial activity against E. coli and B. subtilis.while TZ2 showed higher antibacterial activity against E. coli and has no effect on B. subtilis.Therefore, the TZ1 and TZ2 can be used as inhibitors for CS corrosion in industrial applications.( 9) The E Homo (eV) and negative adsorption energies (Kcal mol −1 ) values have been demonstrated to be higher for TZ1 than TZ2, indicating that TZ1 is the most potent inhibitor based on DFT and MC simulations, respectively, which supports the findings of the experimental techniques.

Figure 2 .
Figure 2. WL-Time curves for CS in 1 M HCl without and with the existence of different concentrations of TZ1 and TZ2 at 25 °C.

Figure 3 .Figure 4 .
Figure 3. Arrhenius plots for the corrosion of CS in 1M HCl without as well as after utilizing different concentrations of TZ1 and TZ2.

Figure 7
displays PP (a) and open circuit potential (OCP) (b) curves for CS in 1M HCl without as well as after the inclusion of different concentrations of TZ1 and TZ2 at 25 °C, as well as the evaluated parameters were summarized in Table

Figure 5 .
Figure 5. Langmuir adsorption isotherm of TZ1 and TZ2 for the corrosion of CS utilizing 1M HCl at 25 °C.

Figure 7 .
Figure 7. PP (a) and OCP (b) curves for the corrosion of CS in 1M HCl without as well as after utilizing different concentrations of TZ1 and TZ2 at 25°C.

Figure 8 .
Figure 8. Nyquist (a) and Bode (b) plots for CS in 1M HCl and in the existence of various concentrations of TZ1 and TZ2 at 25°C.
www.nature.com/scientificreports/spectra were composed of C 1s, Cl 2p, Fe 2p, O 1s, N 1s, and S 2p.The appearance of N 1s and S 2p peaks supports the adsorption of TZ1 and TZ2 molecules on the CS surface.Table6displays the binding energies (BE, eV) and the corresponding assignment of each peak component.In the C 1s involved spectra, three peaks for TZ1 and TZ2 were seen (Figs.11, 12).The first peak, which occurs at 285.34, 285.23 eV, could be due to C-H, C-C, and C=C bonds56 .The second peak, which occurs at 286.99, 286.97 eV, could be related to C-N and C-S bonds57 .The final peak, which occurs at 289.02 eV, could be related to O-C=O and C=N for TZ158,59 and C=N for TZ2, which are likely found in the structure of TZ1 and TZ2 molecules, verifying their adsorption.Cl 2p spectra (Figs.11, 12) display two peaks for Cl 2p 3/2 at 199.80, 196.47 eV and Cl 2p 1/2 at 200.11, 199.47 eV, respectively60 .The spectra of O 1s contain two peaks (Figs.11, 12).The first peak, which is assigned to O 2− and has a binding energy of 530.15, 530.14 eV, could be related to the connection between an oxygen atom and (Fe 3+ in the Fe 2 O 3 and/or Fe 3 O 4 oxide), while the last located at 531.69, 531.71 eV could be attributed to OH -, due to the existence of hydrous iron oxides, such as FeOOH57 .The XPS spectra of Fe 2p display seven peaks (Figs.11, 12) at 707.29, 711.24 eV for metallic iron, 711.06, 713.71 eV for Fe 3+ , 713.67, 720.16 eV for Fe 2p 3/2 of Fe 2+ , 724.56, 724.77 eV for satellite of Fe 3+ , 727.91, 727.62 eV for Fe 2p 1/2 of Fe 2+ , 729.61, 731.59 eV for Fe 2p 1/2 of Fe 3+ and 733.32, 734.24 eV for Fe 2p 1/2 of Fe 2+61 .N 1 s spectra(Figs.11, 12) depict two peaks at 400.02, 400.05 eV and 401.33, 400.95 eV which may be caused by N-Fe, N-N, and C=N-N bond in the triazole ring, respectively62,63 .Three peaks were

Figure 9 .
Figure 9. Electrical equivalent circuit to fit EIS data.

Figure 13 .
Figure 13.UV-Visible spectra for TZ1 and TZ2 (black color), 1M HCl solution containing TZ1 and TZ2 before (red color) and after (blue color) dipping CS for 48 h at room temperature.

Figure 15 .
Figure 15.Graphical presentation of the MEP of TZ1 and TZ2 utilizing DMol 3 module.

Figure 16 .
Figure 16.The appropriate configuration for adsorption of TZ1 and TZ2 on Fe (11 0) utilizing adsorption locator module.

Figure 17 .
Figure 17.Possible adsorption mechanism of TZ1 and TZ2 on CS surface in HCl solution.

Table 1 .
Values of CR and % IE of TZ1 and TZ2 for CS corrosion in 1M HCl estimated from WL measurements using different concentrations at 25-45 °C.

Table 2 .
The activation parameters for the corrosion of CS in 1M HCl without as well as after utilizing different concentrations of TZ1 and TZ2.

Table 3 .
Adsorption isotherm parameters for TZ1 and TZ2 on the surface of CS utilizing 1M HCl at various temperatures.

Table 4 .
Corrosion parameters of CS computed from PP method utilizing 1M HCl without and after addition of different concentrations of TZ1 and TZ2 at 25 °C.

Table 5 .
EIS data of CS in 1 M HCl and in the existence of various concentrations of TZ1 and TZ2 at °C.

Table 7 .
The results of antibacterial activity with zones of inhibition.www.nature.com/scientificreports/molecule.Also, the ∆N and ∆E back-donation are key factors in determining the inhibitor's capacity for either donating or receiving electrons.As a result, if the ∆N values are greater than zero, the inhibitor can transfer electrons to iron surface, and if they are less than zero, metal atoms can donate electrons to the inhibitor molecule (i.e., back-donation) Figure 14.The optimized molecular structures, HOMO and LUMO of TZ1 and TZ2 utilizing DMol 3 module.Vol:.(1234567890)Scientific Reports | (2023) 13:22180 | https://doi.org/10.1038/s41598-023-49468-5

Table 8 .
The computed quantum chemical parameters for TZ1 and TZ2 molecules.