1 Introduction

Iron and its alloys currently play a crucial role in daily life due to their good physical and chemical properties, such as their high structural and mechanical strength. They are also increasingly used in various industrial and engineering applications due to their low production price and normal large quantity [1,2,3,4].

Corrosion is a spontaneous phenomenon and is unanimously labeled as the worsening of a metal or its physical and chemical characteristics because of interactions with its surroundings [5]. As a result, corrosion can cause very dangerous and costly damage to the petrochemical industry, bridges, and public buildings, which is a very costly phenomenon [6].

Acid cleaning and oil well acidizing are, moreover, exceptionally common forms for cleaning metal’s surface. So, corrosive arrangements are promptly utilized for these applications to evacuate erosion items from metals. Hydrochloric and sulfuric acids are commonly used for this reason. Unhappily, these acids may assault the metal and start the erosion handle. This reality can harm genuinely the metal, causing debasement of its properties, and so constraining its utilize [7, 8].Employing inhibitors is the foremost interesting and ready for use way for securing metals from erosion [1, 9].

Erosion inhibitors and corrosion inhibiting compounds have been widely used in the oil and gas industry for several years. As a result, numerous research studies have investigated the inhibitory efficacy of organic materials in harsh acid mediums. These studies have explored a range of organic compounds, including hydroxyquinoline derivatives [10,11,12], benzimidazole derivatives [13,14,15,16], amino acids [17,18,19], Schiff bases [20,21,22,23], triazepines [24, 25], and thiosemicarbazones [26, 27]. Recently, natural plant extracts and oils have also been studied for their eco-friendliness [28,29,30,31]. Other research in this area has focused on alkaloids and ionic liquids as promising efficient inhibitors against metal corrosion [31, 32]. New innovative inhibitive compounds are constantly being discovered and synthesized, with recent research efforts focusing on developing green, more efficient, and cost-effective inhibitors.

Despite the fact that the precise manner these components act in retarding metals corrosion, adsorption on their surface remains the most commonly way to accomplish inhibiting action. They act as an adsorbed protective layer on the metal surface and protect it from acid attack [33,34,35]. Hence, it has been found that inhibitors interact more easily with metal’s surface by the means of rich electron density sites, such as the donor heteroatom groups and π electron bonds. Particularly –NH2 and –SH groups with high electron density often act as reaction centers in the inhibiting molecules during the adsorption step.

More research works focused on hydroxyquinoline derivatives as efficient and less toxic corrosion inhibitors. They are also enough soluble in an aqueous medium and easy to synthesize at a good yield [36,37,38,39]. The inhibitive performance of these compounds for MS corrosion inhibition in an acid medium was well confirmed.

In recent years, there has been a growing interest in testing various electrolytes to better understand the mechanisms of corrosion and to develop effective methods for preventing it. Corrosion is a complex phenomenon that can occur in a wide range of materials, including metals, alloys, and polymers, and it is particularly prevalent in harsh environments, such as those with high temperatures, humidity, or acidity. In industries such as aerospace, automotive, and energy, corrosion can cause significant damage to equipment and infrastructure, resulting in safety hazards, costly repairs, and even catastrophic failures.

To address these challenges, researchers have been developing new methods for corrosion protection, including coatings, inhibitors, and electrochemical treatments. These advancements have led to significant improvements in the durability and reliability of materials, but there is still much work to be done to develop more efficient and cost-effective corrosion protection strategies.

The novelty of the present study aims to contribute to this effort by testing the effectiveness of synthesized aromatic aldehydes-based xanthene diones as corrosion inhibitors for mild steel in 1 M hydrochloric acid. By incorporating aromatic aldehydes into the synthesis process, this study introduces a novel approach that has the potential to enhance the inhibitory properties of xanthene diones and improve their efficacy as corrosion inhibitors. The use of mild steel as the substrate material is particularly relevant, as it is a widely used material in various industries. The results of this study could have significant implications for industries that rely on mild steel components, potentially leading to the development of more effective corrosion inhibitors that could reduce maintenance costs and increase the lifespan of the equipment. Also, in the context of this work, the corrosion inhibition tests have been realized for MS specimens in molar HCl by the means of two newly synthesized inhibitors based on aromatic aldehydes. MS surface has also been analyzed with SEM–EDX, AFM, Contact angle, and XRD, activation and thermodynamic factors, and reactivity theoretical parameters of the inhibitors were also determined and discussed to approach the MS-inhibitor interaction mode leading to its protection.

2 Experimental Details

2.1 Materials

All chemical reagents were provided from Sigma-Aldrich (France) and utilized as conventional without supplementary purification. The compounds were prepared according to the protocol as illustrated in Fig. 1. HCl solutions were prepared by diluting commercial analytical grade 37% HCl in doubly distilled water. Corrosion experiments were performed in a 1 M HCl solution in the absence and the presence of various concentrations of the inhibitors ranging from 10−6 M to10−3 M, and the tested compounds were dissolved in 2 ml of dimethylsulfoxide (DMSO). The electrochemical examinations have been realized without stirring and under air atmosphere conditions.

Fig. 1
figure 1

Synthesis of two organic compounds ZM-1 = 3a and ZM-2 = 3b

2.2 Synthesis of Two Organic Compounds

A mixture of aromatic aldehydes (Benzaldehyde (1a), 4-Bromobenzaldedehyde (1b)) (1 mmol), dimedone (2) (2 mmol), and 3 mg CaCO3 dissolved in 2 ml of ethanol was heated to 80 °C. The progress of the reaction is controlled by thin-layer chromatography (eluent: n-Hexane:Ethyl acetate (4: 2)). After completion of the reaction, the resulting solid is dissolved in 3 ml of ethanol and then our catalyst is recovered by simple filtration and the filter is cooled. The precipitating solids are filtered, dried, and then weighed in Et-OH Hot (Fig. 1).

2.2.1 Chemical data

The spectroscopic characterization data (1H and 13C NMR), IUPAC name, and molecular structures of the products 3a and 3b are gathered in Table 1.

Table 1 Spectral data, molecular structures, and abbreviations of ZM-1 and ZM-2

2.2.2 Preparation of Electrodes

The working electrode consisted of a metal bar with 2.5 cm × 1.0 cm × 0.05 cm, from an MS specimen. The elemental composition is described in previous work [41]. It was manually abraded using different grades of sand papers (500, 1200, 1500), ending with the 2000 grade, before use. Afterward, the electrode surface was washed with distilled water, acetone, and distilled water, respectively, and endly dried using filter paper and quickly immersed into the test solution. For each test, a freshly abraded electrode was used. The appropriate surface of the metal bar was 1 cm2.

A conventional three-electrode cell, consisting of a steel working electrode (WE), a platinum wire as a counter electrode (CE), and then a silver/silver chloride (Ag/AgCl) serving as a reference, is utilized.

2.3 Weight Loss Testings

WL experimentations have been carried out by submerging the entire aforementioned MS coupons in 50 mL of the acid solution in the presence and absence of inhibitors for 6 h at 298 K. Then, samples have been cleaned following ASTM G-81 standard [42]. Furthermore, MS specimens were dried and weighed to the nearest 10–4 g to calculate the corrosion rate.

Weight loss is used to compute the corrosion rate expressed in (mg·cm−2·h−1) as follows:

$$CR = \frac{W}{{S._{{}} t}},$$
(1)

where W represents M.S weight loss, S is the specimen’s total surface, and t is the immersion time.

The WL inhibition efficiency, ηCR%, can be computed by following equation [43]:

$$\eta_{CR} \left( \% \right) = \frac{{CR - CR_{{\left( {inhib} \right)}} }}{CR} \times 100,$$
(2)

where CR and CR(inh) respectively mean the corrosion rate before and after the inhibitors are added to a harsh solution.

2.4 Electrochemical Measurements

Electrochemical measurements (EIS and PP) were carried out using a PGZ100 potentiostat workstation using Voltamaster 4 software. The corrosion conduct of the mild steel was investigated in molar HCl solution using EIS and potentiodynamic plots in the absence and presence of inhibitor solutions.

The working electrode was submerged in the test solution for 30 min to establish stable open-circuit potential (EOCP). After having measured the EOCP, the electrochemical measurements were accomplished.

Polarization curves have been plotted in the potential range from −  0.9 V to − 0.1 V at a scanning rate of 1 mV/s. Linear polarization resistance measurements were carried out by recording the electrode potential ± 0.01 V versus open-circuit potential starting from more negative potential.

The inhibition efficiency η (%) was calculated using the formula:

A volume of 80 ml of diluted hydrochloric acid solution was used to ensure the entire immersion of the electrodes in the cylindrical Pyrex glass cell. Except for the effect of the temperature study, all experiments were carried out under normal air conditions. The MS specimen’s entirely immersed surface is 1 cm2

The inhibition efficiency η (%) was calculated using the equation as follows:

$$\eta \left( \% \right) = \frac{{i_{corr} - i_{{corr\left( {inhib} \right)}} }}{{i_{corr} }} \times 100,$$
(3)

where icorr and icorr(inhib) are the corrosion current densities, respectively, in the absence and the presence of the inhibitive compounds.

For the temperature effect study, operating temperatures ranged between 298 and 328 K.

The EIS measurements were carried out using the same workstation already cited aforementioned workstation, at open-circuit potential, by applying a 10 mV amplitude AC signal and a frequency domain varying from 105 to 10−1 Hz. The EIS plots have been drawn in the Nyquist and Bode representations. Then, plots had to be fitted and data analyzed in terms of an equivalent electrical circuit using the Ec-Lab ver 10.01 program.

The inhibiting efficiency derived from EIS, \({\varvec{\eta}}\) EIS is calculated using the following equation:

$$\eta_{EIS} \left( \% \right) = \frac{{R_{{CT\left( {inhib} \right)}} - R_{CT} }}{{R_{{CT\left( {inhib} \right)}} }} \times 100$$
(4)

\(R_{{CT\left( {inhib} \right)}}\) and \(R_{CT}\) are respectively the charge-transfer resistance terms in the presence and absence of the inhibitors.

2.5 Surface Analysis (Scanning Electron Microscopy/AFM)

2.5.1 SEM–EDX

To get ready the MS surface morphology analysis in the studied hostile solution before and after ZM-1 and ZM-2 addition to the solution, scanning electron micrographs had been taken under experimental conditions mentioned in previous work [44].

2.5.2 Atomic Force Microscopy

In order to carry out morphological analysis of the deposited films, a Veeco Dimension ICON fabricated by Bruker Atomic Force Microscope had been used. The aforementioned film morphology was examined at normal pressure and temperature conditions. AFM micrographs had been collected according to already cited conditions [44].

2.5.3 Contact Angles

An OCA 40 micro-associated with an Up HSC 2000 High-Speed camera system and an ES-NANO-Drop automatic dosing system had been used to carry out the wettability tests. One water drop was brought in contact with the inhibited and uninhibited MS surface. After equilibrium was established, the contact angle had been measured.

2.5.3.1 XRD

After 6 h of immersion in the blank and inhibited solution, the steel electrode was analyzed by XRD. The examination of the M-steel samples surface was carried out using the model: XRD X’ PERT PRO MPD.

2.6 Computational Details

2.6.1 DFT Calculations

In the calculation of Conceptual Density Functional Theoretical parameters [45] in this study, the pbepbe/6-31 g calculation level was used. CDFT presents the following useful formulae for the calculation of important quantum chemical descriptors like chemical potential (µ), electronegativity (χ), hardness (η), and softness (σ) [46].

$$\mu = - \chi = - \left( {\frac{I + A}{2}} \right),$$
(5)
$$\eta = \frac{I - A}{2},$$
(6)
$$\sigma = 1/\eta.$$
(7)

In the given equations, I and A stand for the ground state ionization energy and ground state electron affinity, respectively. To predict the ionization energy and electron affinity of the studied chemical systems, we used the following equations based on the finite differences approach and the energies of the systems with different numbers of electrons.

$$I = E(N - 1) - E(N),$$
(8)
$$A = E(N) - E(N + 1).$$
(9)

To analyze the electrophilic or nucleophilic behaviors of the chemical systems, Parr, Szentpaly, and Liu [47] introduced the electrophilicity index (ω) considering the results obtained in the paper penned by Maynard and co-workers. This electrophilicity index is given via the following equation:

$$\omega = \chi^{2} /2\eta = \mu^{2} /2\eta.$$
(10)

According to Gazquez and co-workers [48], electrodonating (ω) and electroaccepting (ω+) power of molecules can be computed as follows:

$$\omega^{ + } = (I + 3A)^{2} /(16(I - A)),$$
(11)
$$\omega^{ - } = (3I + A)^{2} /(16(I - A)).$$
(12)

Another useful parameter of corrosion inhibition studies is back-donation energy. Gomez et al. [49] derived the following formula based on the chemical hardness to calculate this quantity.

$$\Delta E_{back - donation} = - \eta /4.$$
(13)

The fraction of the electrons transferred between the inhibitor molecule and metal surface (ΔN) and metal–inhibitor interaction energy (Δψ) are among the widely used parameters to predict the corrosion inhibition performances of molecules. The following equations introduced to compute these parameters have been derived with the help of Sanderson’s Electronegativity Equalization Principle [50, 51]:

$$\Delta N = \frac{{\phi_{Fe} - \chi_{inh} }}{{2(\eta_{Fe} + \eta_{inh} )}},$$
(14)
$$\Delta \psi = - \frac{{(\phi_{Fe} - \chi_{inh} )^{2} }}{{4(\eta_{Fe} + \eta_{inh} )}}.$$
(15)

The theoretically determined ϕ value for Fe (110) surface is 4.82 eV. The chemical hardness of the Fe surface is taken as ηFe = 0 because I = A for a bulk. The equations χinhand ηinh represent the electronegativity and chemical hardness of the inhibitor molecule, respectively.

2.6.2 Molecular Dynamics Simulation Approach

The molecular dynamics (MD) simulation approach is a better method to explain the adsorption modes of inhibitor molecules studied on the metal surfaces in light of metal/inhibitor interatomic interactions. In this study, MDS calculations were made at 303 K temperature using the Andersen thermostat. To calculate the adsorption and binding energies for the studied chemical systems, we used the following equations [52]:

$$E_{{{\text{interaction}}}} = E_{total} - (E_{surface + solution} + E_{inhibitor} ),$$
(16)
$$E_{binding} = - E_{{{\text{interaction}}}}.$$
(17)

In the given equations, Etotalis the total energy of all systems. Esurface+solution represents the total energy of Fe (110) surface with HCl molecules. Einhibitor is the total energy of the inhibitor alone.

3 Results and Analysis

3.1 Gravimetric Measurements

It is noticeable from Table 2 that the inhibition efficiency increased with an increase in the inhibitors concentration from 10−6 to 10–3 M. Corrosion degree decreased with an increase in the inhibitor concentration due to the high number of ZM-1 and ZM-2 molecules being adsorbed on the MS surface. Maximum inhibition efficiency has been obtained for the inhibitor ZM-2 (87.4%) at a concentration of 10−3 M. A concentration increase beyond this value does not make any significant change in the protective result. This can be credited to the extreme adsorption of the inhibitors on the MS surface. Multifarious parameters, such as the molecular structure, adsorption mode, charge densities, quantity of dynamic sites in the inhibiting molecules, the probable area of the inhibiting molecules on the MS surface, and most likely metal-inhibitor complex formation, may be at the origin of the inhibiting performance of the inhibitors [53].

Table 2 Weight loss corrosion inhibition data of MS in acid medium with and without various concentrations ZM-1 and ZM-2

3.2 Open-Circuit Potential (OCP) Measurements

Open-circuit potential (OCP) and its evolution with time in the investigated acidic medium before and after adding various concentrations of both compounds (ZM-1 and ZM-2) after immersion for ½ h at 298 K are displayed in Fig. 2. It can be seen that the existence of both investigated species leads to a slight displacement of the Ecorr to wards to more negative potentials compared to the blank solution.

Fig. 2
figure 2

Open-circuit potential (OCP) and its evolution with time in molar HCl medium before and after adding various concentrations of both compounds at 298 K

3.3 Potentiodynamic Polarization Study

The potentiodynamic polarization curves of MS electrode at different concentrations of ZM-1 and ZM-2 are presented in Figs. 3 and 4. The extrapolation parameters such as current density (icorr), corrosion potential (Ecorr), and the cathodic and anodic slopes (βc) and (βa), respectively, and inhibition efficiency (η%) are reported in Table 3.

Fig. 3
figure 3

Potentiodynamic polarization curves of MS in the acid medium in the absence and presence of different concentrations of ZM-1

Fig. 4
figure 4

Potentiodynamic polarization curves of MS in the acid medium in the absence and presence of different concentrations of ZM-2

Table 3 Potentiodynamic Polarization Parameters of mild steel in the acid medium in the presence and absence of different concentrations of ZM-1 and ZM-2

It can be perceived that the cathodic and anodic current densities decreased effectively with the inhibitors, and concentration increased in the acid solution from 10–6 to 10−3 M. It is well known that in the acidic media without inhibitors present in solution, Tafel plots show oxidization of MS taking place in the anodic area, and hydrogen release is perceived in the cathodic side according to Eqs. 18 and 19 as follows [54]:

$$Fe \leftrightarrow Fe^{2 + } + 2e^{ - },$$
(18)
$$2H^{ + } + 2e^{ - } \leftrightarrow H_{2}.$$
(19)

Figures 3 and 4 show the effect of adding inhibitors to the solution on the polarization curve. Specifically, it says that the addition of inhibitors reduces anodic metal dissolution and slows down the cathodic hydrogen advancement reaction. Anodic metal dissolution is the process by which metal ions are released from the anodic site of the metal and dissolved into the solution, while cathodic hydrogen advancement reaction is the process by which hydrogen ions are reduced to hydrogen gas at the cathodic site. In addition, we can conclude that the reduction in anodic metal dissolution and cathodic hydrogen advancement reaction is evidence of the adsorption of inhibiting molecules on the MS active sites. This means that the inhibitors are attaching themselves to the active sites on the mild steel surface and preventing further corrosion by blocking the access of the corrosive solution to these sites. Table 3 are resumed as the fitted parameters, e.g., corrosion current density (icorr), corrosion potential (Ecorr), anodic a) and cathodic c) slopes, respectively, and inhibiting performance (η%). It can be depicted that icorr shifts from 983 µA/cm2 (blank) to 167 and 124 µA/cm2 for a 10−3 M concentration of ZM-1 and ZM-2, respectively. It is also well illustrated that for the ZM-2 molecule, the increase of the inhibiting efficiency with inhibitor’s concentration is more pronounced than for the ZM-1 molecule. The same tendency is perceived in the corrosion current decline with the inhibitor concentration rise. Hereafter,

The inhibition efficiency increases with an increase in the concentration of our inhibitors ZM-1 and ZM-2 due to three reasons. First, the adsorption of inhibitor molecules onto the metal surface forms a protective layer that prevents the corrosive medium from reacting with the metal. Second, some inhibitors react with the metal surface to form a more stable protective layer, resulting in more effective corrosion protection. Third, the inhibitor molecules form a physical barrier on the metal surface, which reduces the contact between the metal and the corrosive medium. An increase in inhibitor concentration increases the thickness of the barrier layer, providing greater protection against corrosion.[55, 56].

On the other hand, the corrosion potential (Ecorr) on the MS electrode in acid solution in the absence of an inhibitor is about − 425 mV/ECS. It was revealed in the literature [57, 58] that if the difference in Ecorr between inhibited systems against uninhibited is larger than 85 mV, the inhibitor could be considered cathodic or anodic type. However, if the difference in Ecorr is less than 85 mV, the inhibitor could be qualified as a mixed type. In the present case, the achieved displacement range was less than 85 mV, which confirms that the studied molecules can be categorized as mixed-type inhibitors.

More, it can be resumed that the ZM-2 inhibitor is relatively more efficient in MS corrosion inhibition than ZM-1 in an acid medium.

So, it can be established that adsorption of the studied inhibitors in their neutral form could most probably occur due to the formation of associations with MS free “d” orbitals. This involves water molecules displacement from the MS surface. Furthermore, the lone pairs existing on the O and N atoms and phenyl rings act by the means of electronic exchange with the MS positively charged surface, thus, blocking the active sites from acid attack [59]. This leads to a corrosion level shift.

3.4 Electrochemical Impedance Spectroscopy Measurements

The electrochemical impedance (EIS) measurements were carried out in the range of frequency between 10–1 Hz and 105 kHz with an amplitude of ± 10 mV peak to peak at the OCP (Open-Circuit Potential). Impedance diagrams were analyzed using the EC-Lab software program.

Figures 5 and 6 show the Nyquist plots obtained for MS in an acid medium without and with diverse concentrations of the inhibitors at EOCP. Nyquist plot shape does not change with inhibitors addition, which means that the corrosion mechanism is not affected by the presence of the inhibitors [21]. It can be appreciated that Nyquist plots display only one capacitive semi-circle without any trace of the inductive loop or diffusion impedance at a low-frequency range corresponding to one time constant in the Bode plots. This is a sign of a non-ideal capacitive conduct of the electrochemical solid/liquid interface. Such phenomenon is recognized as the “dispersing effect.” It is usually credited to surface irregularity, the chemical in-homogeneities, and the adsorption of inhibitor molecules [57]. This statement also indicates that the electrochemical kinetics of the system is regulated by a charge-transfer control process.

Fig. 5
figure 5

Nyquist plots for MS in acid medium in the absence and in the presence of diverse concentrations of ZM-1 at 298 K

Fig. 6
figure 6

Nyquist plots for MS in the acid medium in the absence and the presence of diverse concentrations of ZM-2 at 298 K

The capacitive semi-circle diameter is increasing with the inhibitor's concentration increase indicating a protective film growth on the MS surface resulting in an increased value of the charge-transfer resistance with the inhibitor's presence. Thus, a worthy fit was obtained for all experimental data. For the depiction of the capacitive depressed loops centered below the real Z axis, a Constant Phase Element (CPE) has been used, which expression is written as follows:

$$Z_{CPE} = \frac{1}{{Q(i\omega )^{n} }},$$
(20)

Q (Ω−1sn cm−2) is the magnitude of the CPE, considered a proportional factor; ω (rad s−1) = 2.π.f signifies the sine wave modulation angular frequency;

CPEdl is the double-layer CPE;

The double-layer capacitance CPEdl is was obtained using the following equation with RCT being the charge-transfer resistance of the double layer:

$$CPE_{dl} = \sqrt[n]{{Q(R_{CT} )^{1 - n} }},$$
(21)

i2 =  − 1 is the imagined number;

The phase shift is equally an exponential factor that presents the change against the ideal capacitive comportment and measures surface irregularity. The CPE can signify an inductance (n =  − 1), a Warburg impedance (n = 0,5), a capacitance (n = 1), or a resistance (n = 0)[60].

The corresponding parameters that have been extracted following the best fitting equivalent circuit are recapitulated in Table 4.Thus, it can be observed that the presence of the inhibitors in the solution increases RP values and takes down Cdl versus the blank solution. This may be explained by the fact that MS corrosion in an acid solution is controlled by a charge-transfer process and the inhibiting process happens by the means of inhibiting molecules adsorption on the MS surface. Such observation may correspond to the microscopic roughness of the electrode surface, and the inhibitor molecules adsorbed on it. Given that, the aforementioned facts allowed to fit the interfacial system to an appropriate corresponding electric circuit to calculate impedance data (Fig. 7). The fitting circuit containing a parallel combination of polarization resistance RP and the CPE that are joined in series with the electrolyte resistance Rs (Rs + (RP//CPE)). It has been specified that in the absence of inhibitors, the MS resistance RP in acid solution is equivalent to the charge-transfer resistance (RCt) [61].

Table 4 EIS data of MS in the acid medium in the presence and absence of different concentrations of ZM-1 and ZM-2
Fig. 7
figure 7

Electric equivalent circuit model representing the interface MS/solution

The two inhibitors exhibited notable inhibition power with efficiency above 87% at 10−3 M concentration of ZM-2 versus 83% for ZM-1 for the same concentration.

Otherwise, the growth observed in the double-layer capacity (CPEdl) values with increasing inhibitor concentration could probably be attributed to the decrease of the local dielectric constant, or to the fact that inhibiting molecules could very likely be adsorbed on the MS surface, generating a protecting film on its surface. This statement leads to a reduced contact area MS/solution. On the other hand, except for a 10−4 M inhibitor’s concentration, it has been observed that CPEdl values unexpectedly increased versus blank, leading to the affirmation that greater rearrangements or interactions between the inhibiting molecules at the MS surface may stop their adsorption and hinder the formation of an idealistic coverage on the MS surface.

Bode plots log ǀZǀ versus log(f) and phase angle drawings phase angle (α) versus log (f) of MS in the acid medium in the absence and presence of diverse inhibitor amounts are illustrated in Figs. 8 and 9. In addition, the Bode images (Figs. 8 and 9) reveal that the presence of inhibitors ZM-1 and ZM-2 leads to a significant increase in phase angle values and impedance modulus at low frequencies, indicating that these inhibitors can form highly effective adsorption layer at the steel/solution interface, which impedes steel corrosion. Moreover, the increase in impedance modulus at low frequencies suggests that the inhibitors layer becomes denser and more efficient with increasing ZM-1 and ZM-2 concentration, The data illustrated in Table 4 analysis allow us to observe that at higher frequencies zone, log ǀZǀ values have a tendency to zero value, and the phase angle is also tending to smaller values (10–20 degree) due to the electrolytic resistance[62]. At the intermediate frequencies zone, the slopes of Bode plots, n, (in Table 4) increase with inhibitor presence in solution. Hence, ZM-2 shows a greater n value for a concentration of 10−3 M, meaning that this inhibitor is close to acting as a pure capacitor. Such observation can very likely be due to the rate of MS dissolution reduction. Besides, the rise in n value with inhibitors presence in solution versus the blank could be correlated to an increase of the surface homogeneity owing to inhibiting molecules adsorption on the MS surface [18]. In the low-frequency area, the electrode’s resistive comportment increases, and the impedance modulus no longer depends on frequency.

Fig. 8
figure 8

Bode diagram for MS in the acid medium in the absence and the presence of diverse concentrations of ZM-1 at 298 K

Fig. 9
figure 9

Bode diagram for MS in the acid medium in the absence and in the presence of diverse concentrations of ZM-2 at 298 K

For the two investigated inhibitors, it can be declared that the single pairs of electrons on oxygen atoms and very likely the π-electron concentration on the phenyl rings are estimated to be at the origin of the inhibitor’s adsorption. The contribution of phenyl rings is added to that of Br atoms, in the case, of ZM-2, confirmed as frequently electron donating groups, increases slightly the inhibitive performance of the aforementioned inhibitor versus ZM-1.

Table 5 reports the percentage inhibition efficiency for some selected heterocyclic compounds used as corrosion inhibitors in a 1.0 M HCl medium. Analysis of the results depicted in Table 5 revealed that the xanthene derivatives (ZM-1, ZM-2) investigated in the present study showed a reasonably good corrosion inhibition effect and should replace the previously used relatively less effective heterocyclic compounds.

Table 5 Percentage inhibition efficiency for different heterocyclic compounds in 1.0 M HCl

3.5 Temperature Influence and Process Activation Factors

Temperature can impact MS electrode reaction in the acidic media without and with the used inhibitors [69]. It was found to have an important influence on the corrosion rate and its effect on the interaction between the metal and the organic molecules is not simple to explain, due to several alterations occurring on the metal surface.

The effect of temperature study on the corrosion rate and inhibition efficiency is useful for calculating inhibition kinetic and thermodynamic parameters and the adsorption processes. These parameters are of good help in interpreting the occurring type of adsorption [70].

To study the temperature on the inhibitor’s efficiency, stationary electrochemical measurements using Tafel plots were carried out in a temperature range between 298 ± 2 K and 328 ± 2 K. So, potentiodynamic curves of MS in the acid medium in the presence and absence of optimal concentration of the inhibitor’s molecule that is 10–3 M, have been plotted, as exhibited in Fig. 10, 11, and 12. The corresponding data are resumed in Table 6.

Fig. 10
figure 10

Tafel plots for different temperatures (Blank HCl 1 M)

Fig. 11
figure 11

Temperature effect on Tafel plots (ZM-1 at 10−3 M)

Fig. 12
figure 12

Tafel plots for different temperatures (ZM-2at 10−3 M)

Table 6 MS potentiodynamic polarization data in the acid medium for different temperatures for ZM-1 and ZM-2 at 10−3 M

As long as the process adsorption/desorption is in equilibrium, desorption of the inhibitors takes place with increasing temperature. This fact is due to the inhibitor/MS surface interactions becoming weakened, leading to the inhibitor’s desorption. Consequently, an additional MS surface is available to contact the corrosive medium, which increases the corrosion rate with temperature elevation.

The Tafel plots showed that as the temperature increased, the corrosion current (icorr) also increased slightly, regardless of the presence or absence of the inhibitor molecule. This effect was particularly noticeable at a temperature of 328 K. The increase in corrosion current suggests that the rate of corrosion also increased with temperature, which can lead to material degradation and reduced lifespan of the metal.

Interestingly, the Tafel plots also revealed that there were some differences between the cathodic and anodic branches of the corrosion curve. This means that the corrosion behavior of the metal was not the same in the two branches of the curve. This difference in behavior could be due to the different electrochemical reactions that occur in the cathodic and anodic branches.

Relative data in Table 6 exhibit clearly that corrosion rates increased with temperature rise in acid solutions in the absence and presence of inhibitors. Thus, the inhibition efficiency decreased with temperature. This statement could very likely be attributed to a decline in the adsorption aptitude of the organic inhibiting molecules at the raised temperature.

Corrosion process activation parameters have been calculated by the means of the Arrhenius plots according to the following equations [71]:

$$i_{corr} = A\exp^{{(\frac{{ - E_{a} }}{RT})}},$$
(22)
$$Ln\left( {\frac{{i_{corr} }}{T}} \right) = \left[ {Ln\left( \frac{R}{nh} \right) + \left( {\frac{{\Delta S_{a} }}{R}} \right)} \right] - \frac{{\Delta H_{a} }}{RT},$$
(23)

icorr is the corrosion current density, A is the Arrhenius pre-exponential factor, Ea is the activation energy of the corrosion process,h is Planck’s constant, N is Avogadro’s number, R the universal gas constant, T represents the absolute temperature, ΔHa and ΔSa are the activation enthalpy and entropy, respectively.

At an optimal concentration of 10−3 M of the investigated inhibitors, activation energy (Ea) has been calculated by linear regression after plotting (Log icorr) evolution with(1/T) according to Eq. 22, which consisted in a straight line with appreciable regression coefficient (Fig. 13), the slope being (–Ea/R).

Fig. 13
figure 13

Plots Ln (icorr) vs 1000/T in the range of temperature 298–328 K with and without ZM-1 and ZM-2 inhibitors presence(10−3 M)

Table 7 analysis shows that the Ea value determined in 1.0 M HCl containing the inhibiting molecules is higher than for the uninhibited solution (21 kJ/mol). Ea values are 41.46 and 33.88 kJ/mol, respectively, for ZM-1 and ZM-2. An increase in the activation energy observed in the presence of the inhibiting molecules may be interpreted as a real fact that made the MS corrosion (steel oxidization) harder to reach. This fact is very probably linked to inhibit molecules being adsorbed at the MS interface making the charge transfer more difficult. This observation could also be explained by the fact that physisorption is the predominant process happening in the presence of the inhibitors on the MS surface [57].

Table 7 MS dissolution activation parameters’ acid medium in the absence and the presence of optimum concentrations of ZM-1 and ZM-2

In Fig. 14, plotting Log icorr/ T versus 1/T exhibits a right line with a good linear regression coefficient. According to Eq. 23, thermodynamic parameters such as enthalpy ΔHa and entropy energy ΔSa at the optimum concentration of the inhibitor could be calculated by the means of the slope and the intercept with the ordinates axis [71]. Results are exposed in Table 6. The positive values of the activation enthalpy ΔHa in the absence and the presence of inhibitors indicate the endothermic nature of the MS dissolution process and signify that the presence of inhibitors makes the dissolution of MS slower. Furthermore, the activation entropy ΔSa value was higher for the inhibited solutions (-72,979 JK−1 mol−1 for ZM-1& 100.32 JK−1 mol−1 for ZM-2) compared to the uninhibited one (− 126 JK−1 mol−1). This fact suggested an increase in the disorder taking place at the MS/solution interface. That occurs during the transition from solution to the activated complex during the corrosion process. Thus, the activation entropy increase could be attributed to the solvent entropy increase [10, 24].

Fig. 14
figure 14

Plots Ln (icorr/T) vs 1000/T in the range of temperature 298–328 K with and without ZM-1 and ZM-2 inhibitors (10.−3 M)

This conduct could very likely be designated as the consequence of the organic inhibiting molecule’s adsorption from the hydrochloric solution. Such an event could be considered a quasi-substitution process between the organic compounds in the aqueous phase and water molecules at the MS interface. Thus, inhibiting molecule adsorption is very likely accompanied by water molecules desorption from the MS surface.

In general, temperature impact on the inhibited acid–metal reaction is decidedly complex because of multiple alterations that could occur on the MS surface, such as rapid engraving and desorption of inhibitors and the inhibitor itself that may endure decomposition or reordering [72].

3.6 The Potential of Zero Charges (EPZC)

The potential of zero charges (EPZC) of mild steel in a 1.0 M HCl solution in the presence of inhibitors was determined using the electrochemical impedance spectroscopy method. The study of the variation of the double-layer capacity (Cdl) as a function of the potential (E) (Fig. 15), makes it possible to determine the electrode charge zone for which there is a maximum of adsorption which corresponds to the potential of zero charges (PCN).

Fig. 15
figure 15

Variation of double-layer capacitance versus the applied potential for mild steel in 1.0 M HCl in the presence of the two xanthene diones derivatives 10−3 M at 298 K

When the mild steel plate is immersed in the hydrochloric solution containing aromatic aldehydes-based xanthene dione compounds, three cases may occur [73]:

  • If the electrode charge is negative compared to the potential of zero charges, the protonated water molecules and the xanthene diones molecules in the cationic form are directly adsorbed on the surface of the steel. The more negatively charged the surface of the steel, the more the xanthene diones adsorption is increased.

  • when the electrode charge becomes positive, the chloride ions Cl are the first to adsorb on the surface of the steel, this facilitates the adsorption of xanthene diones in cationic form and protonated water molecules. An increase in the positive surface charge leads to an increase in the adsorption of the xanthene diones compound via Cl ions.

  • At the potential of zero charges (PCN), which is the potential at which the electrode charge is zero: There is no ionic excess, and we have a balance between the adsorption of anions and cations on the surface. A fraction of xanthene diones are adsorbed by forming “donor–acceptor” bonds between the unsaturated “d” orbitals of the metal and the π electrons of xanthene diones [74]. This decreases the concentration of xanthene diones in solution but less than before, because the molecules are absorbed parallel to the surface.

The potential of zero charges is defined as follows:

$$C_{dc} = {\raise0.7ex\hbox{${\delta q}$} \!\mathord{\left/ {\vphantom {{\delta q} {\delta E}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\delta E}$}}.$$

At the potential of zero charges, the capacity goes through a minimum

$$E = E_{PCN} \frac{\delta q}{{\delta E}} = 0.$$

The load on the steel surface can be determined from the potential of zero charges (PCN) by the following equation [75]:

$$\varphi = E_{corr} - E_{PCN}.$$

Table 8 shows the values of Ecorr, EPCN, and φ for mild steel in 1.0 M HCl in the presence of ZM-1 and ZM-2 at a concentration of 10−3 M at 298 K.

Table 8 Values of Ecorr, EPCN, and φ for mild steel in 1.0 M HCl in the presence of two xanthene diones derivatives at a concentration of 10-3 M at 298 K

The analysis of this table allows us to suggest that the Cl anions of the hydrochloric solution will be the first to adsorb on the surface of mild steel. This first adsorption makes the surface negative, resulting in the adsorption of the studied xanthene diones compounds in cationic form by forming bonds with ions already adsorbed on the surface [76]. This phenomenon has been observed for all products.

The interest of this study is to show that the adsorption of an organic molecule depends both on its chemical nature and the charge of the electrode. A corrosion inhibitor must, therefore, not only adsorb easily but also do so in a potential range including the corrosion potential.

3.7 Adsorption and Thermodynamic Investigations

Adsorption isotherms may be determined supposing that the inhibition effect is mainly due to the inhibitor’s adsorption at the interface MS/solution. Information about how inhibiting molecules are adsorbed on the MS surface can be found by the means of adsorption isotherm. Hence, a linear correlation between the partial surface covering values (θ) and the inhibitor’s concentration has to be established. θ values used are issued from EIS inhibiting efficiency calculated according to Eq. 4.

$$\theta = \frac{{\eta_{EIS} \left( \% \right)}}{100}.$$
(24)

It is needed to define empirically the isotherm that fits well the inhibitors’ adsorption process on the MS surface. The use of multiple isotherms (Freundlich, Langmuir, Frumkin, Temkin, Flory–Huggins et El Awady) allowed for a more comprehensive understanding of the adsorption process and provided insights into the nature of the surface interactions between the adsorbent and the mild steel. The obtained isotherm plots, which are reported in Fig. 16, provided a graphical representation of the adsorption data, allowing for the visualization of the relationship between the amount of inhibitor adsorbed onto the metal surface and its concentration in the solution.

Fig. 16
figure 16

Tested adsorption isotherms plots for ZM-1 and ZM-2(10−3 M) on MS substrate in 1 M HCl

It is well illustrated that the Langmuir adsorption isotherm is the one that provides the top description of the adsorption conduct of the studied inhibitors.

Langmuir isotherm is empirically represented following the equation[33]:

$$\frac{{C_{inh} }}{\theta } = \frac{1}{{K_{ads} }} + C_{inh},$$
(25)

Cinhib is the inhibiting molecule concentration (mol/l); Kads is the equilibrium adsorption constant.

As shown in Fig. 16 and Table 9, the Langmuir isotherms for the two inhibitors exhibit a linear shape fit coefficient (R2) that is almost equal to the unit.

Table 9 Adsorption data for MS in the presence of ZM-1 and ZM-2 in 1 M HCl at 298 K for diverse tested isotherms

Given Eq. (24), plotting (Cinhib/θ) versus Cinhib, allows Kads to be calculated from the intercept with the (Cinhib/θ)axis.

Hence, the free energy of adsorption (ΔG°ads) could be calculated by the means of the adsorption constant (Kads) according to Eq. (25) below, where the value 55,5 represents water concentration in solution expressed in mol/l [23, 33]:

$$K_{ads} = \frac{1}{55.5}\exp \left( {\frac{{ - \Delta G_{ads}^{^\circ } }}{RT}} \right),$$
(26)

Or

$$\Delta G_{ads}^{^\circ } = \, - RT\,Ln\left( {55.5 \times K_{ads} } \right).$$
(27)

Table 8 analysis illustrates that the best fit (Langmuir) large negative determined ΔG°ads values for the two inhibitors incites to confirm the spontaneity of the adsorption process and the steadiness of the adsorbed inhibitor film on the MS surface.

Noteworthy ads found that values found for the studied inhibitors indicate actual adsorption, and a valuable efficiency in corrosion inhibiting [77]. It is generally evidenced that ΔG°ads values higher than − 20 kJmol−1 are well matched with electrostatic interactions between the inhibiting molecules and the polarized metal surface (physisorption). On the contrary, ΔG°ads values are more negative than − 40 KJmol−1 that indicate charge partaking or charge relocation from the inhibiting molecules to the MS surface (chemisorption) [78]. The determined values of ΔG°ads for the two inhibitors ZM-1 and ZM-2 are, respectively, − 42.2 kJ mol−1 and − 41.83 kJ mol−1. This fact signifies chemical connections establishment between the inhibitors and the MS surface at room temperature (298 K). Hence, MS protection is ensured by the means of organic molecules’ thin layer adsorbed on the MS surface.

3.8 MS Surface Examinations

3.8.1 Scanning Electron Microscopy and EDX Analysis

SEM micrographs had been taken to explore MS superficial state after being exposed to harsh solutions in the presence and absence of ZM-1 and ZM-2. Also, electron X-diffraction analysis has been carried out to diagnose iron surface elemental analysis.

Thus, SEM micrographs and EDX spectra are grouped in Fig. 17, and EDX data are gathered in Table 10. It can be observed that the raw MS specimen exposed to acid solution exhibits pronounced irregularity and roughness due to external surface direct acid attack. This fact corroborates the existence of CPE in the electrical modeling circuit as expected in EIS investigations. On the other hand, the EDX diagram shows a well-pronounced oxygen peak versus iron one. Consequently, it can be deduced that Oxygen superficial abundance is probably due to iron oxides FeO2H, Fe2O3, and Fe3O4formation on the MS surface [32].

Fig. 17
figure 17

SEM micrographs and EDX diagrams for MS substrate with and without the presence of ZM-1 and ZM-2 (10−3 M) in molar HCl

Table 10 EDX data for MS in the absence and presence of ZM-1 and ZM-2 in 1 M HCl at 298 K

Paradoxically, for the MS specimen exposed to inhibited acid solutions, the SEM micrographs show less damage at the iron surface. It became smoother and seems to be covered with a thin spread-out organic layer, probably due to the inhibitor’s adsorption on the MS surface. EDX analysis shows that oxygen abundance is reduced with the inhibitor’s presence in acid solution, and iron presence is augmented with a light advantage for ZM-2 inhibited solution. Such observation signifies minor iron oxides release at the MS surface. Also, that statement can be attributed to the fact that the inhibitor’s presence in the solution prevented MS acid attack by the means of a thin protective layer formed on the MS surface.

3.8.2 Contact Angle Measurements

The steel surface wettability test shows that the contact angle of the raw MS sample in contact with the blank acid solution is only 76° (Fig. 18), which traduces the hydrophilicity behavior of the sample causing hereafter its surface roughness. But, for MS in contact with the inhibited solutions, the wettability manifests larger angles than the blank (92.5° and 101.7° for ZM-1 and ZM-2, respectively). Such statements illustrate the hydrophobicity of the MS surface after being in contact with the inhibited acid solutions. This approves the protective thin-layer formation due to inhibitors adsorption on the MS surface [79].

Fig. 18
figure 18

Water contact angles measures on MS substrate with and without the presence of ZM-1 and ZM-2 (at 10−3 M) in 1 M HCl

3.8.3 AFM Analysis

Surface examination of the MS before and after contact with the acid solution with and without the presence of the have realized by the means of Atomic Force Microscopy for the approval of previous electrochemical weight loss findings [80]. Hence, surface roughness can be explored and discussed. Thus, Average Roughness (Ra) is defined as multiple measures average of a surface’s summits and wells.

Figures 19 and 20 are reported the AFM profiling and 3D imaging that allowed MS surface investigations. After a 6 h immersion period in a harsh solution without inhibitors, the raw MS surface has been severely damaged and presents increased ruggedness and multiple pits and scrapes.

Fig. 19
figure 19

MS substrate profiling with and without the presence of ZM-1 and ZM-2 (at 10−3 M) in 1 M HCl

Fig. 20
figure 20

AFM images of MS substrate with and without the presence of ZM-1 and ZM-2 (at 10−3 M) in 1 M HCl

Paradoxically, when the inhibiting molecules ZM-1 and ZM-2 are present in the acid solution, MS surface morphology looks relatively more regular and smoother. Such finding traduces the fact that ZM-1 and ZM-2 molecules create a wrapping surface that protects the metal surface from harsh solution degradation.

Experimental surface Ra derived from AFM investigations was 226 nm in the case inhibitors that are not present in the solution. However, for ZM-1 and ZM-2 being present in solution, surface Ra values are, respectively, 41.9 nm and 18.2 nm. Accordingly, Ra values for the inhibited solutions are significantly lower than for the uninhibited ones. Such a statement proposed ZM-1 and ZM-2 inhibiting molecules adsorption and protecting film formation over the MS surface. These findings confirm the already made conclusion suggesting that ZM-2 is more efficient than ZM-1 in MS corrosion inhibition in the investigated acid medium.

3.8.4 XRD Study

According to the electrochemical results obtained, the use of inhibitor ZM-2 showed a better corrosion inhibition efficiency of MS in an HCl (1 M) medium. To better understand the protection mechanism, the MS surface was characterized by XRD after 6 h of immersion without (Blank) and with inhibitors ZM-1 and ZM-2. The superposition of the three XRD spectra (Fig. 21) denotes the disappearance of the peak at 2θ corresponding to 28.6° for inhibitor 1 and an intensity decrease of the same peak for inhibitor 2. It corresponds to the presence of Fe3O4oxide on the MS surface. Furthermore, there was no change in the other phases.

Fig. 21
figure 21

XRD spectra of MS substrate without the presence (blank) and in the presence of ZM-1 and ZM-2 (at 10−3 M) in 1 M HCl

The inhibiting molecules can protect MS against corrosion in an aggressive environment. These molecules adsorb spontaneously on the metallic surface by the means of their polar groups, forming a monolayer on the electrode surface. This induces the formation of a barrier that blocks the contact between the corrosive species (oxidizing and pitting agents) and the metal, thus, reducing their attack [81, 82].

3.9 Quantum Chemical Study

3.9.1 DFT Reactivity Descriptors Calculations

The contribution of calculations in theoretical chemistry consists of the information provided by the calculated structural parameters allowing the analysis and the interpretation of the experimental corrosion inhibition mechanism process [83].

Table 11 are illustrated the computed quantum chemical parameters linked to the most stable configuration of the studied inhibiting molecular electronic structure. In Fig. 22, the HOMO, and LUMO of the inhibitors’ neutral forms optimized structures are exhibited.

Table 11 Calculated quantum chemical descriptors for studied molecules
Fig. 22
figure 22

HOMO and LUMO images of the studied molecules ZM-1 and ZM-2

Through the Conceptual Density Functional parameter, corrosion inhibition performances of molecules can be easily predicted. Ionization energy is the energy required to remove an electron from a chemical species. The most prominent feature of an effective corrosion inhibitor is that it can easily donate electrons to the metal surface. If so, a good corrosion inhibitor should have a low ionization energy value. In the light of calculated ionization energy values for ZM-1 and ZM-2 values, one can write the corrosion inhibition efficiency order of the mentioned compounds as ZM-2 > ZM-1. This order is in good agreement with experimental observations. An effective inhibitor system should have lower values of electron affinity because electron affinity represents the desire to gain the electrons of the chemical systems. Calculated electron affinity values for ZM-1 and ZM-2 are 0.73 and 0.64 eV, respectively. Calculated electron affinity values imply the inhibition efficiency order as: ZM-2 > ZM-1.

It is apparent from the given equations that chemical hardness, softness, and back-donation energy are closely related parameters to each other. Chemical hardness [84, 85] introduced by Pearson[86] in the 1960s as a result of a classification regarding Lewis acid bases, is reported as the resistance against the polarization of their electron clouds of atoms, ions, and molecules. With the help of two electronic structure principles, namely the Hard and Soft Acid Base Principle and the Maximum Hardness Principle [87], the chemical hardness concept gained many applications in science. The maximum Hardness Principle presents the relation with the chemical stability of the chemical hardness. This principle states that “there seems to be a rule of nature that molecules arrange themselves to be as hard as possible.” It can be understood from this explanation that hard molecules are not effective against the corrosion of metal surfaces because they do not exhibit high electron donating ability. Electronegativity is one of the old and most useful reactivity descriptors. Originally, Pauling defined electronegativity as follows: “the power of an atom in a molecule to attract electrons to itself”. Shortly this concept represents the electron withdrawal powers of atomic, ionic, and molecular chemical systems. For that reason, chemical systems with low electronegativity values are effective corrosion inhibitors. The corrosion inhibition efficiency ranking obtained considering calculated electronegativity values is ZM-2 > ZM-1. There is a remarkable correlation between hardness and polarizability. This powerful relation has been highlighted by Ghosh[88] and Chattaraj[89]. Ghosh reported that softness is proportional to the cube root of the polarizability. Then, Chattaraj introduced Minimum Polarizability Principle. According to Minimum Polarizability Principle, “the natural evolution of any system is toward a state of minimum polarizability.” In many papers, it is noted that the molecules with high polarizability act as effective corrosion inhibitors. On the other hand, the molecules having more negative back-donation energy values are not effective against the corrosion of the metal surfaces. Recently, some researchers reported that dipole moment can be also considered a useful tool to compare the corrosion inhibition efficiencies of molecules because there is a remarkable linkage between dipole moment and polarizability. Recently, corrosion scientists started to use the back-donation energy as a measure of the corrosion inhibition performances of molecules because this parameter is closely related to the chemical hardness of the molecules. The molecules with more negative values of the back-donation energy act as effective corrosion inhibitors. Considering the calculated hardness, polarizability, softness, dipole moment, and back-donation energy values, corrosion inhibition efficiency ranking of the studied molecules can be given as follows: ZM-2 > ZM-1 in agreement with the experiments made. Electro-accepting power of ZM-2 molecule is lower than that of ZM-1. This result also supports the idea of which ZM-2 molecule is more effective corrosion inhibitor than ZM-1. More positive ΔN and more negative Δψ values belong to effective corrosion inhibitors. As the amount of the electrons transferred from inhibitor molecule to metal surfaces increases, corrosion inhibition efficiency increases. In addition, in this situation, it can be said that the power of the metal–inhibitor interaction will increase. Calculated ΔN and Δψ values also imply the high corrosion inhibition efficiency of ZM-2 molecule. Electrophilicity[90] is one of the important parameters used in the prediction of corrosion inhibition performances of molecules. The molecules having higher electrophilicity index values cannot give easily the electrons to metal surfaces. It is clear that the comment made in the light of the calculated electrophilicity index values for ZM-1 and ZM-2 molecules will support the experimental data.

3.9.2 Fukui Indexes Calculations

It is well known that Fukui Functions (Figs. 23, 24, 25, 26, 27, 28, 29, and 30) are widely used for local reactivity analysis of the inhibitor molecules. Fukui functions can be calculated via the following formulae. In the given equations, qk is the charge on atom k.

$$f_{{_{k} }}^{ + } = q_{k} (N + 1) - q_{k} (N){\text{ (for nucleophilic attack)}},$$
(27)
$$f_{{_{k} }}^{ - } = q_{k} (N) - q_{k} (N - 1){\text{ (for electrophilic attack)}},$$
(28)
$$f_{{_{k} }}^{0} = \left[ {q_{k} (N + 1) - q_{k} (N - 1)} \right]{\text{ /2 (for radical attack)}}.$$
(29)

Calculated Fukui functions for the studied molecules are given in Tables 12 and 13.

Fig. 23
figure 23

ZM-1 Dual descriptor

Fig. 24
figure 24

ZM-1 electrophilic attack sites scheme (f. indexes)

Fig. 25
figure 25

ZM-1 nucleophilic attack sites (f.+ indexes)

Fig. 26
figure 26

ZM-1 radical attack sites (f.0 indexes)

Fig. 27
figure 27

ZM-2 Dual descriptor

Fig. 28
figure 28

ZM-2electrophilic sites attack scheme (f. indexes)

Fig. 29
figure 29

ZM-2 nucleophilic sites attack(f.+ indexes)

Fig. 30
figure 30

ZM-1 radical sites attack (f.0 indexes)

Table 12 Calculated Fukui indexes for ZM-1
Table 13 Calculated Fukui indexes for ZM-2
  1. a)

    ZM-1 Fukui indexes

  2. b)

    ZM-2 Fukui indexes

3.9.2.1 MDS

The molecular dynamic simulation approach was used to find low energy configuration of studied inhibitor molecules on the Fe (110) surface in an acidic medium. The approach provides deep proof regarding adsorption on the metal surface of studied molecules in solution. Therefore, the balance adsorption configuration from the side and top views of studied inhibitors on the Fe (110) surface is presented in Fig. 31. It is apparent from Table 14 that calculated interaction energy values for ZM-1 and ZM-2 molecules are quite close to each other. Calculated adsorption energy and binding energy values are the proofs of the efficiencies of the studied molecules against the corrosion of Fe (110) surface in an acidic medium.

Fig. 31
figure 31

Side and top views of ZM-1 and ZM-2-optimized adsorption conformation on Fe(110) in HCl 1 M

Table 14 Einteraction and Ebinding of ZM-1 AND ZM-2 molecules on Fe (110) surfaces in HCl medium at 303 K, all in kJ/mol

3.10 Inhibition Mechanism

As we have previously reported, in an acidic medium, ZM-1 and ZM-2 inhibitors exist very probably under protonated forms, and the most suggested sites for protonation in these compounds are oxygen atoms. Previous studies focused on the fact that the chloride ions present in the harsh solution are equally adsorbed onto the positively charged MS—substrate surface [91]. This fact leads to a negatively charged superficial area, and cationic forms of ZM-1 and ZM-2 are allowed to be adsorbed on the MS surface through chemical connections (chemisorption). Furthermore, the aromatic rings and heteroatoms in the molecular structure are the most electron-rich regions, and the π-electrons and lone pairs of electrons contained in these positions can be shared toward the empty d-orbitals of the iron atom to form coordination bonds, and this donor–acceptor interaction leads to chemisorptions [92]. Also, the excess electrons on the surface of carbon steel can reverse donate to the anti-bonding molecular orbitals of dopamine derivatives, forming a retrodonation (back-donation interactions). In addition, the substitution of the hydrogen atom in ZM-1 with a larger atom (bromine atom) in ZM-2 allows it to create a larger surface area to protect the MS against corrosion attack, which could be the main reason for the higher inhibition properties of this compound compared to ZM-1 [93].

4 Conclusions

  • The investigated compounds showed appreciable inhibiting performances for MS corrosion inhibition in the acid medium;

  • Gravimetric analysis and electrochemical investigations are in good agreement;

  • Inhibiting efficiency decreases slightly with temperature indicating the inhibitor’s desorption process occurs with temperature rise;

  • Calculated adsorption energy and binding energy values are the proofs of the efficiencies of the studied molecules against the corrosion of Fe (110) surface in an acidic medium;

  • MS surface investigations using SEM–EDX, AFM spectroscopy, and wettability tests confirmed a protective organic inhibiting film on the MS surface, and in accordance with electrochemical and gravimetric measurements, ZM-2 exhibited better efficacy versus ZM-1 against MS oxidization in HCl harsh medium;

  • Calculated ΔN, Δψ, electronegativity, dipolar moment, electrophilicity, and electron back-donation values also imply the high corrosion inhibition efficiency of ZM-2;

  • Theoretical assumptions are experimentally confirmed.