Introduction

The research on corrosion inhibition is considered as a challenging problem because corrosion is spontaneous and continuous degradation of metallic structures using electrochemical and chemical reactions with the surrounding, which cause severe safety and economic loss in various sectors1. The mild steel (MS) is considered as core structural element in many industries due to its effective potency in flexibility and cheaper cost. Many industries use solution of HCl and H2SO4 for acid pickling of steel and iron, production of ore, oil well acidization and removal of rust as well as scale. During these operations, due to the corrosive properties of acid solution, severe corrosion of metal happens which creates environmental as well as economic issues2,3. To minimize this loss, various corrosion prevention techniques like coating, selection of alloy, galvanization, cathodic and anodic protections, and selection of inhibitors are used. From these methods, addition of corrosion inhibitors in the solution phase is the most useful techniques for prevention of corrosion4. The adsorption of corrosion inhibitors on MS surface depends on the structure of corrosion inhibitor and played a significant role in the formation of corrosion protecting film on the surface of MS. The addition of small amount of the corrosion inhibitor provides rise in efficiency by instantly decreasing the corrosion rate5. In application of corrosion inhibitors, industries are facing challenge because most of the corrosion inhibitor molecules are toxic and harmful for both human and environment. The compounds containing functional groups such as NH2, OH, OCH3, C=N, C=O, SH, and hetero atoms like O, N, P, S as well as unsaturated aromatic system work as efficient inhibitors6,7,8,9,10,11,12. Schiff bases showed excellent inhibition efficiency for different metals and alloys such as copper, brass, aluminum, MS, and stainless steel in different corrosive mediums. Presently Schiff bases are used as inhibitor because of their simple synthetic procedure, low-cost, high-yield and less toxic properties. Apart from these, Schiff base compounds are also used in catalysis, photochromic field, and medicine13. Because of easy synthesis, high efficiency and low toxicity, Schiff base compounds are good choice in selection of inhibitors and various researchers have used Schiff base compounds as corrosion inhibitor14,15. The Schiff base compound reported as corrosion inhibitor in literature for MS in HCl medium16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 are represented in Table 1.

Table 1 Summary of already reported Schiff bases as corrosion inhibitors for MS in HCl solution.

Inspired with the use of Schiff base compounds as efficient and low toxic corrosion inhibitors and with expectation of higher inhibition efficiency as compared to reported inhibitors, in the present investigation carbohydrazide Schiff base compounds, (Z)-N′-(3,4-dichlorobenzylidene)-6-methyl-2-oxo-4-phenyl-1,2,3,4-tetrahydropyrimidine-5-carbohydrazide(CBTC)and (Z)-N′-(4-hydroxy-3-methoxybenzylidene)-6-methyl-2-oxo-4-phenyl-1,2,3,4-tetrahydropyrimidine-5-carbohydrazideon (MBTC) were prepared for corrosion inhibition study of MS in 15% HCl. The selection of Schiff bases was done according to their planar structure and good molecular framework which promotes better inhibition efficiency. Two Schiff bases were taken with the same moiety, but different substitution groups to study the effect of substituent’s on corrosion inhibition behavior of the inhibitors.

Experimental procedure

Synthesis of carbohydrazide Schiff base inhibitors

Both the inhibitors were prepared in the laboratory as per reported procedure31 as shown in Fig. 1. The mixture of urea (0.15 mol), ethyl acetoacetate (0.1 mol), benzaldehyde, ethanol (25–30 mL) and conc. HCl in 3-drops was refluxed for 1:30 h. After completion of the reaction, reaction mixture was put into ice cold water with continuous stirring, then it was kept for 18 h, mixture was filtered and dried. The compound formed was called biginelli, it was recrystallized through ethanol and tested by thin layer chromatography. After recrystallization, mixture of biginelli (0.01 mol), hydrazine hydrate, ethanol (approx. 20–22 mL) and 4-drops of conc. H2SO4 was refluxed for 3 h. After completion of reaction, the mixture was recrystallized through ethanol and the product formed was called carbohyrazido compound. The mixture of carbohyrazido (0.01 mol), substituted aromatic aldehyde, ethanol (20 mL) and 5 mL of glacial acetic acid was refluxed for 2 h. Upon the accomplishment of reaction, it was placed into cold water, the product was filtered and dried. TLC was used to test the purity of the compound, the precipitate was recrystallized using ethanol and the obtained compounds are MBTC and CBTC. Both compounds were characterized and obtained data are as follows:

Figure 1
figure 1

Reaction scheme of MBTC and CBTC synthesis.

MBTC

Mol. Formulae: C20H20N4O4, Mol. Weight: 380.40, Yield: 78%, Elemental analysis: calculated %weight- C: 63.15, N: 14.73, H: 5.30, O: 16.82.

FTIR, (cm−1) 3551.75(NH), 3484.26(OH), 3244.16(NH in amide), 3124.6 (AR–CH), 2931.75 (Aliphatic CH), 1700.91(C=O in amide), 1648.36 (C=O), 1091.99 (C–O–C).

CBTC

Mol. Formulae: C19H16Cl2N4O2, Mol. Weight: 403.26, Yield: 80%, Elemental analysis: calculated %weight- C: 56.59, N: 13.89, O: 7.93, Cl: 17.58, H: 4.00.

FTIR (cm−1) 3421.58(NH), 3244.16 (NH in amide), 3114.47 (Ar–CH), 2937.06 (Aliphatic CH), 1700.91 (C=O in amide), 781.99 (C–Cl).

Material

All investigations were conducted using MS with elemental percentage composition, as; Sn: 0.03, Ni: 0.02, Mn: 0.13, Cu: 0.01, P: 0.02, C: 0.13 along with Fe (iron: rest elemental percentage). MS was cut into the dimension of 3.5 cm × 3.0 cm × 0.1 cm for gravimetric method and for electrochemical analysis 1.0 cm × 1.0 cm × 0.1 cm individually. Several grades (i.e., 80 to 2000) of emery paper were used to clean the MS surface before each experiment successively so that homogeneous surface was obtained. These samples were then thoroughly cleaned in an ultrasonic cleaner for 15 min, cleaned with acetone, and dried. The solution of inhibitor concentrations ranging from 0 to 150 ppm was made in 15% HCl by dilution of analytical grade 37% HCl with distilled water.

Gravimetric Analysis

Gravimetric analysis was used to investigate how temperature and concentration affected the examined Schiff base ability to prevent corrosion. MS specimens were submerged in 500 mL 15% HCl solution for 6 h at different temperatures ranging from 303 to 333 K, without and with several concentration of synthesized carbohydrazide Schiff base inhibitors. The specimens were weighed before and after submersion and weight loss was calculated. Each experimental value was calculated from the average data of triplicate value of weight loss32.The corrosion rate (CR), efficiency (\(\eta \%)\) and surface coverage (\(\theta )\) were calculated as follows:

$${CR (mm year)}^{-1}=\frac{W*8.76*{10}^{4}}{T*D*A}$$
(1)

where average weight loss is represented by W, sample area by A, immersion time by T (in hours), and sample density by D (in gm cm−3). The efficiency (η %) along with surface coverage (θ) of the investigated inhibitor are calculated by utilizing the Eqs. (2) and (3), as below:

$$\eta \%=\frac{{CR}_{0}-{CR}_{I}}{{CR}_{0}}*100$$
(2)
$$\theta =\frac{\eta \%}{100}$$
(3)

where \({CR}_{0}\) and \({CR}_{I}\), stands for corrosion rates without and with synthesized carbohydrazide Schiff base inhibitors.

Electrochemical analysis

Electrochemical analysis was executed in conventional 3-electrode system cell by the electrochemical corrosion analyzer (CS-350) monitoring through CS Studio. Saturated calomel electrode act as the reference electrode, platinum electrode serves as the counter electrode and MS with surface area of 1cm2 serve as working electrode. Before starting the experiment, the cells’ working electrode is maintained in contact with 200 mL of acidic solution for 1800s for attaining steady state condition. Later potentials were examined in the range of ± 2.5V with a scan rate of at 0.5 mV s−1 from OCP which provides the polarization curves. Subsequently, at an open circuit voltage and frequency range of 100 kHz to 1Hz, electrochemical impedance spectroscopy (EIS) was evaluated33.

Surface analysis

For surface analysis the MS specimen was prepared by pervious procedure as described from weight loss analysis. Before and after adding 150 ppm of inhibitor at 303 K, the MS surface was submerged for 6 h in 15% HCl medium. The specimen was removed after 6 h and washed with distilled water and then dried and further sampled for FESEM, EDX, AFM and XPS analysis34.

Computational studies

Quantum chemical calculations

All quantum chemistry calculations have been implemented with full geometric optimizations utilizing the Dmol3 module integrated into the Biovia Materials studio software. The geometric structures of the studied molecules were attained through global optimizations characterized by a calculation of the vibration frequencies using the DFT method by utilizing Dmol3, including the B3LYP/DND/COSMO (water) model34,35,36,37,38,39,40.

MC and MD simulations

Materials Studio 8.0, programmed created by Accelrys Inc, was used to run MC and MD41,42,43,44. A three-dimensional geometry simulation box whose dimensions are (24.823752 × 24.823752 × 18.241658) was used for simulations of the interaction between the MBTC along with CBTC molecules and the surface of Fe (110). The MDS were worked at a temperature of 298 K and the motion equations were integrated under the NVT canonical ensemble utilizing the COMPASS force field, with a time step of 1 fs and a simulation time of 800 ps. This model included Fe layer, 15 hydronium, 15 chloride, 700 H2O molecules and 1 inhibitor molecule and a 35 vacuum layer were involved in the simulation box.

Results and discussion

Gravimetric analysis

The gravimetric analysis is a first step in the investigation of corrosion inhibition. The effect of concentration on the inhibition efficiency (η %) and corrosion rate (CR) for the MS in 15% HCl at various temperatures (303 K–333 K) was done and obtained corrosion parameters are specified in Table 2. According to Table 2 and Fig. 2, it is found that, as the surface coverage of MS grew, the CR gradually dropped and corrosion inhibition (η %) gradually increased with rising inhibitor concentration. This indicated that sample surface is protected through the molecule of inhibitors during the increase in concentration as they are absorbed on the MS surface. Thus, the highest inhibitory efficiency obtained was at 150 ppm of MBTC as 96.78%, and it was 95.09% for CBTC. The higher efficiency of MBTC is because of the presence of electron donor group –OCH3, imine, carbonyl groups and heterocyclic rings (Fig. 1) which improved the efficiency level in the transfers of unpaired electrons from inhibitor molecules to the vacant d-orbital of Fe, which develops a coordinate-bond and thus slows the rate of corrosion (CR)45. The decrease in the inhibition potency on increase in temperature was observed due to removal of adsorbed inhibitory layer from MS surface. As per literature review, corrosion inhibition studies of MBTC and CBTC is not reported and both inhibitors offered better efficiency than most of the similar type of inhibitors reported in literature16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 as shown in Table 1. Therefore the work reported in the present investigation is novel and has potential industrial application.

Table 2 Gravimetric parameters of carbohydrazide Schiff base inhibitor.
Figure 2
figure 2

Plot of η % and (CR) at different temperatures for carbohydrazide Schiff base (MBTC and CBTC) inhibitor.

Kinetic and thermodynamic activation parameters

The kinetic and thermodynamic parameters were obtained from Arrhenius and Transition Eqs. 4 and 5 and plots Figs. 3 and 4 as follows:

$$\mathrm{log}\left(CR\right)= \frac{{-E}_{a}}{2.303 RT}+\mathrm{log}A$$
(4)
$$CR=\left(\frac{RT}{NH}\right)expo\frac{{\Delta S}^{*}}{R}expo \frac{{-\Delta H}^{*}}{RT}$$
(5)

where activation enthalpy and entropy are represented by ∆H and ∆S while A is the pre-exponential component called Arrhenius constant respectively. T refers to the absolute temp., and H, N, R, refers to Planck constant, Avogadro number and gas constant respectively. By fitting the Arrhenius and transition plots shown in Figs. 3 and 4 respectively, the values for the activation parameters (\({E}_{a}\)) and ∆H and ∆S were determined and provided in Table 3.

Figure 3
figure 3

MBTC and CBTC Arrhenius plot for carbohydrazide Schiff base.

Figure 4
figure 4

MBTC and CBTC Transition plot for carbohydrazide Schiff base.

Table 3 Thermodynamic and kinetic parameters of carbohydrazide Schiff base inhibitor.

The \({E}_{a}\) value of inhibitors MBTC and CBTC for all concentrations are greater than uninhibited value. These demonstrate that a shielding layer was created on the MS surface and makes more resistant to corrosive process. From Table 3, the negative values of ∆S* reflect that the rate-determining step is the association rather than dissociation of activated complex, and the positive data of ∆S* denotes an increment in disorder because desorption of more number of water molecules from the surface of MS by adsorption of one molecule of inhibitor while the positive values of ∆H indicate the difficulty in MS dissolution46.

Adsorption isotherm

Adsorption isotherm studies provide information on the interactions between the inhibitor and the MS surface. The following equation is representation of the Langmuir isotherm,

$$\frac{{C}_{inh}}{\theta }=\frac{1}{{K}_{ads}}+{C}_{inh}$$
(6)

Different adsorption models were tried with the experimental data, Langmuir isotherm gave a linear plot between \(\frac{{C}_{inh}}{\theta } vs\) Concentrations which are shown in Fig. 5, through which \({K}_{ads}\) value was calculated. Using \({K}_{ads}\) value, \({\Delta G}_{ads}^{0}\) value was derived from the following Eq. 7.

Figure 5
figure 5

Langmuir plot for MBTC and CBTC inhibitors.

$${\Delta G}_{ads}^{0}=-RTln\left({55.5K}_{ads}\right)$$
(7)

R, T and 55.5 denote the gas constant, absolute temp., and the conc. (mol l−1) for water.

Since the R2 as well as slope values for the Langmuir isotherm are very close to one, it has been verified to be a superior fit for the examined value displayed in Table 4.

Table 4 Adsorption data of carbohydrazide Schiff base inhibitors.

Experimental data from Table 4, has larger value of \({K}_{ads}\) indicating superior inhibition efficiency and good interaction between carbohyrazide Schiff base and MS surface whereas lower value of \({K}_{ads}\) indicates weaker interaction so that adsorbed molecules can be easily removed from MS surface.

The negative \({\Delta G}_{ads}^{0}\) values suggests that the adsorption of carbohydrazide Schiff base MBTC and CBTC on the surface of MS was proceeding spontaneously and the value of \({\Delta G}_{ads}^{0}\) obtained for both inhibitors verified physisorption as well as chemisorption adsorption at MS surface. According to the review of literature, \({\Delta G}_{ads}^{0}\) value less negative than − 20 kJ mol−1 results physisorption whereas more negative than − 40 kJ mol−1 results chemisorptions. Table 4 shows that the values of \({\Delta G}_{ads}^{0}\) for synthesized carbohydrazide Schiff base in 15% HCl at various temperatures attain the range showing the spontaneous chemisorption and physisorption, which is a mixed nature of adsorption47.

Electrochemical analysis

Open circuit potential

Figure 6 reveals the variation of OCP w.r.t. time in the absence and presence of different dosages of carbohydrazide Schiff base inhibitors at 303 K. Figure 6, displays that the addition of MBTC and CBTC inhibitors shifted the potential to the negative side when compared with pure 15% hydrochloric acid corrosive medium, indicating that both inhibitors are predominantly cathodic. Whereas the obtained data of OCP for the working electrode with various dosages of both inhibitors alter OCP to an extent of less than \(\pm\) 85 mV vs. OCP data as compared to without inhibitor, indicating that the studied inhibitors are mixed type and dominant towards cathodic nature48.

Figure 6
figure 6

OCP plot for MBTC and CBTC carbohydrazide Schiff base inhibitors.

Potentiodynamic polarization (PDP)

PDP is a significant electrochemical method to know about inhibition efficiency of inhibitor. PDP gives value of corrosion current and corrosion potential of the electrode immersed in corrosive solution. Here. PDP curves were plotted to know the impact of various dosages of carbohydrazide Schiff base inhibitor at MS/15% HCl interface as shown in Fig. 7. PDP variables such as, corrosion potential (\({E}_{corr})\), anodic and cathodic slopes \(({\beta }_{\mathrm{a}}\) & \({\beta }_{\mathrm{c}}\)), and corrosion current density were observed from PDP curves and arranged in Table 5. The efficiency of corrosion prevention was obtained from Eq. (8) below.

Figure 7
figure 7

Tafel plot for MBTC and CBTC carbohydrazide Schiff base inhibitors.

Table 5 Polarization data of carbohydrazideschiff base inhibitors.
$${\%I.E}_{(T)}=\frac{{i}_{corr}^{(inhi)}}{{i}_{corr}}*100$$
(8)

It is noticed that by increase of the conc. of MBTC and CBTC, there is a gradual decrease of \({i}_{corr}\) value. This observation shows the improvement of a protection film on the MS surface by the adsorption of inhibitor molecules that decreases the dissolution of MS surface. This process is more effective with the increment in the conc. of MBTC and CBTC and reaches maximum at 150 ppm 97.46% and 95.65%, individually. Furthermore, PDP shows very less shift in \({E}_{corr}\) data (\(less than\) 85 mV) towards more negative side compared to the uninhibited MS, indicating that both inhibitor molecules control anodic as well as cathodic reactions and act as mixed inhibitor. In addition the shift in \({E}_{corr}\) values and the variation of \({\upbeta }_{\mathrm{a}}\) and \({\upbeta }_{\mathrm{c}}\) values with inhibitor concentration w.r.t. without inhibitor also suggested that studied inhibitors are mixed type inhibitors. From Table 5, the data of \({\upbeta }_{\mathrm{a}}\) and \({\upbeta }_{\mathrm{c}}\) do’nt show regular trend which indicate that both physisorption and chemisorption plays an important role in the corrosion inhibition49.

EIS analysis

EIS is used to correctly measure the inhibition efficiency of an inhibitor. The Nyquist and Bode plots were obtained without and with MBTC and CBTC inhibitors as depicted in Figs. 8 and 9, respectively. Nyquist semicircles were fitted against electrical circuit, shown in Fig. 10. This circuit consist of solution resistance \(({R}_{S})\), a double layer capacitance (\({C}_{dl})\) and a charge transfer resistance \({(R}_{ct})\). The obtained data are shown in Table 6. The obtained Nyquist plots have depressed semi-circles with a single loop, suggesting single time constant participation in the EIS spectra50. The depression in semi-circle is because of inhomogeneity of electrode surface. The rise in diameter of capacitive loops with an increment in carbohydrazide Schiff base inhibitor concentration suggests an increase in the charge transfer resistance as a result of inhibitor adsorption on MS surface. The impedance efficiency was obtained by utilizing the accompanying equation:

$${\%I.E}_{NY}=\frac{{R}_{ct}^{\left(inhi\right)}-{R}_{ct}^{\left(acid\right)}}{{R}_{ct}^{inhi}}*100$$
(9)

where,\({R}_{ct}^{\left(inhi\right)}\) and \({R}_{ct}^{\left(acid\right)}\) are the polarization resistance data in the inclusion along with exclusion of an inhibitor individually.

Figure 8
figure 8

Nyquist plots for MBTC and CBTC carbohydrazide Schiff base inhibitors.

Figure 9
figure 9

Bode plot for MBTC and CBTCcarbohydrazide Schiff base inhibitors.

Figure 10
figure 10

Equivalent circuit used for fitting EIS graphs.

Table 6 EIS data for carbohydrazideschiff base inhibitors.

As the inhibitor concentration increases, \({C}_{dl}\) reduces and \({R}_{ct}\) increases as represented in Table 6, the results confirmed the high degree of adsorption of carbohydrazide Schiff base at MS/HCl interface by sharing of non-bonding heteroatoms electrons of inhibitor molecules to the vacant d-orbital of Fe. MBTC shows maximum 96.75% inhibition efficiency at 150 ppm against 320.67 Ωcm2 \({R}_{ct}\) value, Whereas CBTC shows maximum 95.14% against 214.48 Ω cm2 \({R}_{ct}\) value with \({R}_{ct}\) value. It confirms that MBTC has better inhibition performance against the 15% HCl corrosive medium. The value of \({C}_{dl}\) was obtained by equation

$${C}_{dl}={\left({Y}_{0}{R}_{ct}^{inhi)1-n}\right)}^{1/n}$$
(10)

where (Y0) for proportional factor and (n) for phase shift and it is measured for the surface inhomogeneity.

In Bode plots continuing increment in the phase angle with concentration up to 150 ppm is related to the development of surface coverage by the inhibitors MBTC and CBTC molecules. The maximum height in the phase angle towards − 90°, the existence of single maxima demonstrates presence of one time constant related to electrical double layer at the surface solution interface52.

The inhibition efficiency calculated by gravimetric, PDP, & EIS methods for MS in presence and absence of inhibitors in 15% HCl solution are in good agreement to each other. The high corrosion inhibition proficiency value of both studied MBTC and CBTC even at lower concentration suggested that MBTC and CBTC are good corrosion inhibitors for MS in acidic solution.

Surface morphology study

FESEM analysis

The surface morphology of polished MS, after 6 h of immersion in 15%HCl solution in the absence and presence of 150 ppm for MBTC and CBTC inhibitors are depicted in Fig. 11. From Fig. 11B, it is observed that the metallic surface is extremely corroded in HCl solution without inhibitor whereas polished sample (Fig. 11A) is smooth due to minor corrosion. However, Fig. 11C and D containing inhibitors show very smooth MS surface and it contain less cracks and pits due to adsorption of MBTC and CBTC inhibitors, respectively, at MS surface. Consequently, these inhibitors demonstrated that MS is protected against corrosion by forming protective layer of inhibitor at the surface of mild steel53.

Figure 11
figure 11

FESEM pictures of polished, blank, MBTC and CBTC inhibitor treated surface (AD) respectively.

EDX analysis

The EDX images of MS surface containing MBTC and CBTC are shown in Fig. 12A,B, respectively. The presence of C, N, O, and Cl, confirms the presence of adsorbed inhibitor layer on MS surface54.

Figure 12
figure 12

EDX spectra for (A) with MBTC (B) with CBTC inhibitors.

AFM analysis

AFM analysis is an important technique for 3-D representation of surface with appropriate height profile of inhibitors. It consists of the important parameter of average roughness (Rmax), average of maximum height (Ra), and the greatest separation among the maximum point and minimum points on the profile roughness (Rq). The AFM of samples are shown in Fig. 13. The result for the height profile for polished surface (Fig. 13A) are Rmax = 57.3 nm, Rq = 6.07 nm, Ra = 4.92 nm. For blank sample (Fig. 13B) Rmax = 567 nm, Rq = 77.9 nm, Ra = 62.6 nm. From Fig. 13C the surface with MBTC containing Rmax = 107 nm, Rq = 10.3 nm, Ra = 8.14 nm and Fig. 13D, in presence of CBTC, Rmax = 156 nm, Rq = 20.0 nm, Ra = 15.4 nm. The lower value of roughness in presence of inhibitors is because of the adsorption of inhibitor molecules on the MS surface55.

Figure 13
figure 13

AFM images for polished (A), blank (B), with inhibitors MBTC (C), and CBTC (D).

XPS analysis

XPS is used to know the composition of adsorbed inhibitor layer on MS surface. Result of XPS analysis of MBTC and CBTC inhibitor are shown in Figs. 14 and 15 respectively.

Figure 14
figure 14

XPS spectra for deposited layer for MBTC inhibitors.

Figure 15
figure 15

XPS spectra for deposited layer for CBTC inhibitors.

In Fig. 14, three peaks of C1s spectrum with binding energies of 283.76, 285.05, and 285.80 eV are assigned to the C–C or C–H, C=O and C–N bonds respectively56,57. The O1s peaks at 531.16 eV, 532.30 eV along with 533.09 eV, respectively, connected to O=C or C–O, C–OH, and Fe2O357,58. Three peaks in the N1s spectrum, at 398.21, 398.76, and 400.30 eV are associated to N–H, N=C, and N=N, respectively54,58. The Fe 2P1/2 spectrum contains three peaks at 708.93, 710.20, 711.48 eV that are linked to metallic iron, Fe2+, and Fe3+ whereas the spectrum Fe 2P3/2 only one peak at 723.72eV33,58,59.

Four peaks of CBTC inhibitor adsorbed on the MS surface were observed in the C1s spectrum in Fig. 15.The peak at 284.07 eV corresponds to C–C or C-H aromatic bond. The peak for the C-atom in the C=O and C=N bonds are at 286.07 eV59. The C–Cl bond and the C–N bond at 285.29 and 287.0354. The peak for the Fe2O3 bond can be seen in the O1s spectrum at 532.77 eV, whereas the peak for C=O is at 531.19 eV60. The N1s spectrum represents three peaks at binding energy 398.74, 399.18, and 400.64 eV attributed for NH or NC bond, N–N bond and N=C bond of the inhibitor CBTC3,61. There are three peaks in the Cl 2P peak, with the peak at 196.41 eV for chlorine ion of the HCl solution, the peak at 198.21 eV representing the Fe-Cl bond, and the peak at 200.08 eV describing the C–Cl bond of the organic inhibitor33,56. The Fe 2P1/2 spectrum comprises four peaks for metallic iron, Fe2+, FeCl3, and Fe3+ at 708.70, 710.36, 713.28, and 714.56 eV, but Fe 2P3/2 has two peaks at 723.05 and 728.75 eV62,63.

Theoretical analysis

DFT results

The optimized structures, HOMO/LUMO frontier orbitals as well as the molecular electrostatic potential (ESP) are represented in Fig. 16. Table 7 represents the main orbital parameters calculated for the MBTC and CBTC inhibitors.

Figure 16
figure 16

Molecular images of the MBTC and CBTC with optimized structures in HOMO, LUMO, and ESP.

Table 7 Calculated theoretical parameters for MBTC and CBTC molecules.

The least amount of energy needed to excite an electron in a molecule is known as the energy gap (∆E = EHOMO − ELUMO). The complex produced on the metallic surface is very stable if the value of ∆E is low, indicating that the molecule's inhibitory effectiveness is strong. Hence, decreasing the value of ∆E enhances the molecule's reactivity, which makes adsorption easier and boosts the inhibitor's effectiveness64. In this work, the difference between the energy levels ∆E of MBTC (2.948 eV) and CBTC (2.951 eV) shows that MBTC has better corrosion-inhibiting properties than CBTC. Often the dipole moment (μ) because of the polarity of an inhibitor and is associated with the inhibitory capacity65. A high value of the μ results in significant inhibitory efficacy and increases the interaction (adsorption) of inhibitor compounds with a metal surface42.Table 7 shows that the μ of the MBTC (9.562 Debye) is greater than μ of the CBTC (4.126 Debye). As well as, both inhibitors are greater than that of the H2O molecule (1.88 Debye), which explains the significant inhibitory efficacy of the MBTC inhibitor. According to Table 7, the data of ∆N for both inhibitor is positive and greater than 3.6 (N > 3.6), which shows that electrons are transferred from both inhibitors studied to iron, promoting the development of coordination bond and thereby helping the formation of an adsorbed layer against corrosion.

To determine the active sites accountable for nucleophilic and electrophilic attacks, decided to use ESP surfaces as a useful descriptor. Figure 16 shows the ESP of the MBTC and CBTC molecules inhibitors study, the blue color shows the positive zones with nucleophilic reactivity, whereas yellow and red colors represent the negative zones with electrophilic reactivity.

As displayed in Fig. 16, the two inhibitors studied have 4 oxygen atoms possible electrophilic attack sites for the MBTC molecule and 2 possible electrophilic attack sites for the CBTC molecule. On the other hand, the two aromatic rings for the two compounds studied have a negative region. There are also on the two molecular structures of our inhibitors the 4 nitrogen atoms which are 4 other possible sites for the electrophilic attack. From the calculated zones of ESP, we notice that the potential negative zones possible are located on the electronegative atoms (N and O) and the unsaturated double bonds along with potential positive zones possible were located around the hydrogen atoms.

MC and MD simulations

The study of the adsorption behavior of the MBTC and CBTC molecules were examined on the surface of MS using MC and MD simulations66,67,68.

Figure 17shows the adsorption equilibrium configurations for the two MBTC and CBTC molecules on the Fe (110) surface, thus two inhibitory molecules are adsorbed on the Fe (110) surface in almost parallel mode position (almost horizontal), indicating that the adsorbed inhibitor molecules cover the Fe surface well by developing a horizontal protective layer on the steel surface, which confirms the strong interactions among the heteroatoms (O, N) and the conjugated system of these inhibitors and atoms of iron.

Figure 17
figure 17

Results of MC (a) and MD (b) simulations: The equilibrium configurations of MBTC and CBTC molecules adhering to the surface of iron (110).

Figure 18 displays the adsorption energy (Eads) that was calculated by MC simulations of the MBTC and CBTC molecules with the surface of Fe (110). The compounds investigated are listed in the following order according to their effectiveness at inhibiting growth: MBTC > CBTC.

Figure 18
figure 18

Distribution of the Eads of MBTC and CBTC:MC simulations of the molecules on Fe (110) plane.

The most energetic stable positions of inhibitors are found by studying the temperature variations in MD simulation analyses. The little temperature drift in Fig. 19 indicates that the MD of our system was successful69,70.

Figure 19
figure 19

Temperature fluctuation at 298 K during the MD run of MBTC and CBTC molecules on the Fe(110) plane.

The bond length among the iron and the atoms of the MBTC and CBTC was determined by utilizing the radial distribution function (RDF) analysis of the MD trajectory in Fig. 20.Through estimating bond length data, different types of bonds formed was determined39,71.The type of adsorption activity occurring on the metal is shown as peaks in the RDF plot at specific locations relative to the metal surface41,72,73.The mechanism of chemisorption is reflected, when the peak is present between 1 and 3.5, but the RDF peaks are expected for physisorption at distances larger than 3.574,75,76.

Figure 20
figure 20

RDF of O, N and Cl atoms of MBTC and CBTC in the simulated corrosion media on the Fe plane via MD.

The inhibition mechanism

The hypothesized corrosion mechanism of MBTC for MS in 15% HCl solutionis presented in Fig. 21, as determined by the experimental and theoretical investigations. Inhibitor molecules, by virtue of their adsorptive affinity, reject the pre-adsorbed H2O molecules and corrosive species, finally adsorb on the surface of MS, therefore sheltering cathodic along with the anodic site77,78. This protects the surface against corrosion. In particular, because the compound possesses both a heterocyclic ring and other heteroatoms, as shown by the Mulliken charges, there is an increased predisposition toward surface adsorption79. These heteroatoms (O, N) and the conjugated system are able to donate lone pair electrons to the empty d-orbit of the iron atom80.

Figure 21
figure 21

Diagram of the mechanisms of MBTC adsorption on mild steel.

Adsorption has an important role in corrosion prevention because the organic molecules are effectively and efficiently adsorbed on the surface, thus stop further deterioration on the surface of MS. All of the information mentioned in carbohydrazide Schiff bases supports this process. The thermodynamic properties of adsorption and theoretical calculations imply that the adsorption mechanism involves physical as well as chemical adsorption. Hence, carbohydrazide Schiff base adsorption on MS surface is explained by the donor–acceptor interactions, which link the electrons of nitrogen, oxygen, and the aromatic rings of inhibitors to the unoccupied d-orbitals of Fe surface atom. The ability of the inhibitor to specifically bind to the metal's surface and displace water molecules is responsible the corrosion-inhibiting process.

Conclusion

Both the studied Schiff base carbohydrazide compounds MBTC and CBTC contain pyrimidine as well as aromatic rings, heteroatoms (oxygen and nitrogen) and planar structures through which adsorb on the MS surface and act as efficient corrosion inhibitor. The inhibitors MBTC and CBTC offered efficiency of 97.45% and 95.89%, respectively, at 150 ppm concentration. The efficiency offered by both inhibitors increased on increasing concentration and decreased on increasing temperature. The potentiodynamic polarization measurements concluded that MBTC and CBTC behave as mixed inhibitors. The inhibitors MBTC and CBTC adsorbed as per Langmuir isotherm and mixed adsorption process. The adsorption of inhibitors on MS surface was confirmed by the FESEM, EDX and XPS analysis. The analysis of the DFT-derived descriptors revealed that the molecules' heteroatoms are involved in the adsorption of these inhibitors onto the MS surface. As per MCS and MDS analysis, both inhibitors have a strong interaction, resulting in their adsorption onto the Fe (100) surface plane. This adsorption prevents corrosion activity from the MS surface.