1 Introduction

The corrosion of metals and alloys is an ubiquitous phenomena with a significant economic effect, impacting many industries [1,2,3,4,5]. The protection of metals from corrosion has an economic advantage, in addition to protecting the environment. Steel and other ferrous alloys have been commonly used as constructive materials in many chemical industries. However, they can be quickly corroded [6,7,8]. In the industrial processes, acid solutions are commonly used to remove rust and scale. In the pickling of steel and various alloys, hydrochloric acid is used extensively. Metal dissolution in these environments is generally controlled by inhibitors. Making it a prime priority, the investigation still raises questions about the ideal solution to protect mild steel from corrosion. Organic inhibitors are commonly used to form a thin protective layer by their absorption on the metal surfaces. Organic compounds that include highly electronic heteroatoms (P, S, N, and O) or heteroatoms containing the aromatic ring are the most effective [9,10,11,12,13,14,15,16]. In addition, pi-electron compounds and functional groups such as -N=N–, –C=N–,–C=O, –S=O, >NH are typically exhibited properties of corrosion inhibition [17,18,19,20]. The N-and S-heterocyclic compounds are among the most active corrosion inhibitors in acidic condition for steel. Because of the history, using of organic compounds is the most knowledgeable and financial tool for this reason among many makers. The rest of them though are toxic and environmentally harmful. Global studies have been carried out to find a cheap and an environmentally non-toxic productive corrosion inhibitor [21,22,23,24]. Indeed, a variety of N-heterocyclic compounds have been identified as potential inhibitors, such as thiourea (TU), thioacetamide (TA), thiosemicarbazide (TSC), and dithiohydrazodicarbonamide. Dithiohydrazodicarbonamides have demonstrated their flexible actions as compounds. The anti-corrosion properties of these ligands are also known due to their performance as corrosion inhibiters for the mild steel in hydrochloric acid or sodium chloride solutions [25, 26].

Some derivatives of 1-aryl-2, 5-dithiohydrazodicarbonamides have indeed been identified as possible corrosion inhibitors in recent years. Singh et al. [27] explored three structurally different compounds, namely thiosemicarbazide, phenyl isothiocyanate, and their reflux substance 1-pheny1-2,5-dithiohydrazodicarbonamide as corrosion inhibitors for Cu in 0.26 M NaCl solution at different temperatures. They utilized gravimetric and corrosion rate techniques to evaluate the efficacy of these inhibitors. Their results showed that the inhibitor efficiency of 1-pheny1-2, 5-dithiohydrazodicarbonamide was higher than that observed in thiosemicarbazide and phenyl isothiocyanate due to the adsorption and functionalization of the inhibitor process. The same researchers investigated other compounds [28], namely p-methoxyphenyl isothiocyanate, p-methyl phenyl isothiocyanate, and p-chlorophyll isothiocyanate and their reflux substances with thiosemicarbazide as corrosion inhibitors for copper in 0.26 M NaCl solution at different temperatures. They used gravimetric and corrosion rate techniques to determine the corrosion inhibitor efficiency. Their findings revealed that both aryl isothiocyanates and their accompanying thiosemicarbazide reflux compounds resulted in an improvement in the corrosion efficacy of p-methoxyphenyl ˃ p-methyl phenyl- ˃ phenyl- ˃ -p-chlorophyll inhibitor. Shukla et al. [29] presented N-phenylhydrazine-1, 2-dicarbothioamide (PDA) as a corrosion inhibitor for the mild steel in 1 M HCl. They used gravimetric, corrosion rate, and impedance spectra (EIS) techniques to evaluate this inhibitor. They found that the efficacy of inhibition improved with increase in the inhibitor concentration in the solution. PDA acted as a mixed type inhibitor according to electrochemistry tests, while the adsorption of PDA on mild steel in 1 M HCl obeyed Langmuir’s adsorption system.

In recent years, researchers have focused more on creating low-toxicity, low-polluting, and environmentally friendly environmental corrosion inhibitors in response to worldwide environmental issues. Dithiohydrazodicarbonamide and its derivatives have attracted the attention of many researchers due to their many benefits. For example, dithiohydrazodicarbonamide and its derivatives have been used as high pressure lubricant additives in extreme temperature and pressure conditions [30]. They have also been documented to have antifungal, antibacterial, antitumor, and antitubercular agents [31]. Dithiohydrazodicarbonamide has been stated to be a possible inhibitor for various metals among various N and S containing compounds [27]. It has also been stated that through derivatives of certain aromatic compounds, its inhibitive efficiency can be significantly enhanced. The behaviour of dithiohydrazodicarbonamide and their derivatives has led to new research into the use of such compounds as corrosion inhibitors for the mild steel in aqueous chloride environments [32]. Based on the information mentioned above, no papers have been published for corrosion systems made from these compounds. In this study, compounds containing heteroatoms such as nitrogen and sulphur atoms as well as phenyl rings were synthesized.

In this research, new dithiohydrazodicarbonamide derivatives were synthesized. The performance of 2-fluorophenyl-2, 5-dithiohydrazodicarbonamide (2FPDC), and 4-fluorophenyl-2, 5-dithiohydrazodicarbonamide (4FPDC) was investigated for the first time as corrosion inhibitors for the mild steel in 1 M HCl solution. Fourier transform infrared spectroscopy (FT-IR) and 1H, 13C NMR identified the chemical structure. A number of electrochemical methods have been used to test corrosion resistance, like open-circuit potential (OCP), impedance spectra (EIS), linear polarization resistance (LPR), and potentiodynamic polarization (PDP). Scanning microscope electron (SEM), energy-dispersive X-ray spectroscopy (EDX), and atomic force microscope (AFM) were used for examining the surface topography of the mild steel in the absence and existence of the corrosion inhibitor. The quantum chemical studies were conducted in neutral and protonated forms in water phases using density function theory (DFT) at B3LYP/6-311 +  + G (2d, 2p) in order to correlate the findings with the electrochemical results. In addition, Monte Carlo (MC) and molecular dynamics (MD) simulations have been used to illustrate the adsorption behaviour of tested corrosion inhibitors.

2 Materials and Experimental Methods

2.1 Materials

A mild steel rod was purchased from a local market with a chemical composition as follows: (Wt.%): 0.18 C, 1.6 Mn, 4.27 Cu, 0.00043 Ni, 0.08 S, 0.0008 Cr, 0.02 Cd, 0.002 Ag, 0.03 Mo, 0.025 Si, 0.075 Zn, 0.001 Ti, and balance Fe. Chemical compounds such as thiosemicarbazide, 2-fluorophenyl isothiocyanate, 4-fluorophenyl isothiocyanate, ethanol (50%), and hydrochloric acid (37%) were purchased from Sigma-Aldrich Company and utilized without purification.

2.2 Preparation of Inhibitors

2.2.1 Preparation of 2-Fluorophenyl-2, 5-Dithiohydrazodicarbonamide (2FPDC)

2FPDC was synthesized according to the method reported in reference [33]. Briefly, thiosemicarbazide (30 mM, 2.73 g) was solved with 30 mL ethanol. After that, 2-fluorophenyl isothiocyanate (30 mM, 0.459 g) was dropped slowly into the mixture with continued stirring. The mixture was then refluxed for four hours. The solid that emerged was filtered, crystallized with ethanol, and then stored for drying in the desiccator (See Fig. 1). The yield was 72% as a white powder having mp.160–162 °C and IR: (ν /cm−1), 3371.01 (N–H), 3221.7 (NH2), 3124.4 (NH) (Ar–NH), 3046 (-NH-NH-), 1501.61 [β(N–H) + (CN)]I thiomide, 1618.37 (NH2), 1204.96 (N–C(=S)– N), 1012.74 (C-F), 933, 863.66 (C=S). 1H NMR δ (ppm) DMSO-d6): 2.49 (t,3H,CH3), 3.33 (s,2H,NH2), 7.14–7.61 (m,4H,ArH), 8.16 (s,1H,Ar–NH), 9.51–9.84 (bs,2H,-NH-NH-). 13C NMR: Solvent (DMSO) displays resonance signal with a range of (39.11–40.37), 115.97, 116.16, 127.32, 127.43, 128.17, 124.41 (Ar–C), and 182.79 (C=S).

Fig. 1
figure 1

Chemical structures of the 2FPDC and 4FPDC synthesized inhibitors

2.2.2 Preparation of 4-Fluorophenyl-2, 5-Dithiohydrazodicarbonamide (4FPDC)

Similar steps were repeated to prepare ligand 4FPDC; thiosemicarbazide (30 mM, 2.73 g) was solved with 30 mL ethanol. After that, 4-fluorophenyl isothiocyanate (30 mM, 0.459 g) was dropped slowly into the mixture with continued stirring. The mixture was then refluxed for four hours. The solid that emerged was filtered, crystallized with ethanol, and then stored for drying in the desiccator. The yield was 88% as a white powder having mp.181–183 °C and IR: (ν /cm−1), 3362 (N–H), 3244 (NH2), 3119.62 (NH) (Ar–NH), 3048 (-NH-NH-), 1507 [β(N–H) + (CN)]I thiomide, 1620.50 (NH2), 1210 (N–C(=S)– N), 1013.96 (C-F), 926,831.47 (C=S/C-S). 1H NMR δ (ppm) DMSO-(d6): 2.50 (t,3H,CH3), 3.35 (s,2H,NH2), 7.14–7.47 (m,4H,ArH), 8.11 (s,1H,Ar–NH), 9.38–9.76 (m,2H,-NH-NH-). 13C NMR: Solvent (DMSO) displays resonance signals in the range of (39.14–40.44), 115.07, 115.30, 135.78, 127.83, 161.12, 158.70 (Ar–C), and 182.13–183.14 (C=S).

The melting points of synthesized compounds were recorded on a Stuart melting point Model SM30. Fourier-transform infrared spectra (FT-IR) were determined with a Bruker model-ALPHA. Nuclear magnetic resonance 1H (400 MHz) and 13C (100 MHz) NMR spectra were measured by a Bruker DPX-400 using dimethyl sulphoxide (DMSO-d6) as the solvent.

2.3 Corrosion Studies

A number of electrochemical techniques were utilized to investigate the corrosion behaviour of mild steel in 1 M HCl with and without the existing of the corrosion inhibitors. All experiments were performed using a potentiostat (CompactStat Electrochemical Interface, Ivium Technologies, Instrument: B08024, Software: 2699 (699). The electrochemical cell was consisted of three electrodes. A mild steel was used as a working electrode with a diameter of 1 cm, length of 3 cm, and an exposed surface area of 0.785 cm2 and prepared with a similar procedure mentioned in our previous work [34]. The reference electrode was from Ag/AgCl (3 M NaCl), while the auxiliary electrode was from a platinum wire. The working electrode was submerged in the test solution for 1 h before beginning the electrochemical impedance spectroscopy (EIS), LPR, and PDP to achieve a relatively steady state and to create open-circuit potential (OCP). A similar procedure has been repeated with a fresh solution and rinsed electrodes, but the immersion time was 5 h. The parameters of the EIS were tested from 100,000 Hz to 10–2 Hz with an amplitude of 5 mV. The linear polarization resistance (LPR) tests were carried out at a scan rate 1 mV/s starting from the cathodic potential to the anodic potential ± 0.01 V as related to OCP, while the potentiodynamic polarization (PDP) measurements were carried out at a scan rate of 1 mV/s with -0.250 V as related to OCP towards cathodic curve and + 0.250 V as related to OCP towards anodic curve. All electrochemical tests were replicated at least three times for each substance in order to guarantee reproducibility. In this work, all curves were set to 1 cm2.

2.4 Surface Analyses

The morphologies of the surface of mild steel determined from the exposure for 72 h in 1 M HCl in the absence and existence of the corrosion inhibitors were evaluated throughout scanning electron microscopy (SEM), using FEG 250 SEM (FEI-Quanta, Hillsboro, OR, USA), and atomic force microscopy (AFM), utilizing AFM-Bruker EDGE 3-SYS. The SEM measurements parameters were: accelerating voltage (HV) = 10 kV, detector = ETD, mode = SE, HIGH VACUME MODE. The AFM measurements parameters were: taping mode of peak force, which is an intermittent contact mode, scan areas were 10 × 10 µm2 and 20 × 20 µm2, 2 D and 3 D images. Energy-dispersive X-ray spectroscopy (EDX) was conducted in order to characterize the surface elemental composition of the mild steel in the absence and presence of the corrosion inhibitors. In environmental atmospheric conditions, all production processes and characterizations were carried out.

2.5 Quantum Chemical Studies

To recognize and describe the roles of organic compounds in molecular terms, quantum chemical approaches were used. Gaussian 09 completely geometrically optimized the 2FPDC and 4FPDC molecular structures in the water phase (neutral and protonated forms), using the operational DFT/B3LYP exchange correlation with the standard 6–311 +  + G (2d, 2p) basis package [35, 36]. Parameters like high-occupied molecular orbital energies (EHOMO) and low-unoccupied molecular orbital energies (ELUMO), energy difference (ΔE) between LUMO and HOMO, chemical potential (μ) and transferred electron number (ΔN), absolute electronegativity (χ), absolute hardness (η), and others have been calculated.

2.5.1 Monte Carlo Simulations (MCS)

The interaction between the adsorbate and substrate compounds was underlined via the use of Monte Carlo (MCS) simulations offered by Material Studio (2017)’s adsorption locator module. The adsorption locator module was used by BIOVIA Company to develop two systems using the Monte Carlo (MC) simulation approach. The first system included a single inhibitor and Fe (111) as vacuum phase, while the second system had a single inhibitor, 300 H2O, 5 H3O+, and 5 Cl and Fe (111) as aqueous phase in order to compare the findings. The model metal surfaces were comprised of a cleaved Fe crystal with a vacuum layer on top. The box cell was constructed in the following way: after selecting the Fe surface (111), the iron surface was cleaved into six layers of iron. The super cell was constructed in the range of (13 × 13). It is essential that the vacuum be large enough that the non-bonded computation for the adsorbate does not interfere with the periodic depiction of the surface's bottom layer of atoms. Thus, using Crystal Builder, a vacuum slab with a thickness of 50 Å and a C-axis was constructed. The Ewald summation methodology was used to determine the electrostatic potential energy, whereas the atom-based methodology was used to determine the van der Waals potential energy. The force field COMPASS (condensed-phase-optimized molecular potentials for atomistic simulation studies) was used to optimize the structures of all components of the system of interest. The resulting box with periodic boundary conditions has a dimension of 52.7 × 52.7 × 59.10 Å3. The geometry optimization stage has been done by the Forcite module.

2.5.2 Molecular Dynamics Simulation (MDS)

In order to examine the interfacial interaction between 2 and 4FPDC molecules with the metallic surface of mild steel, molecular dynamics (MD) utilizing the ONIOM method (B3LYP/6-31G (d): uff) was used. All calculations have been done by the Gaussian 09 W program. The metallic surface of Fe (111) was used for the molecular dynamics (MD) simulation.

3 Results and Discussion

3.1 Characterization of Inhibitor

The molecular structures of the synthesis compounds were approved by FT-IR, 1H NMR, and 13C NMR spectroscopy methods. The 4000–400 cm−1 wavenumber range was observed in the FT-IR spectrum. Figure S1 (A) shows the IR of the ligand 2FPDC bands at 3371.01, 3221.66, 3124.4, 3046, 1501.61, 1301.56, 1618.37, 1204.96, 1103.9, 933 and 863.66 cm−1 which are reserved to ν(N–H), ν(NH2), ν(NH) (Ar–NH), ν(NH) (-NH-NH-), ν[β(N–H) + (CN)]I thiomide, [ν(CN)] + β(N–H)] II, ν(NH2), ν(N–C(=S)-N), ν(C-F), and ν(C=S), respectively. The FT-IR bands exhibited in Fig. S2 (A) for ligand 4FPDC were observed at 3362, 3244, 3119.62, 3048, 1507, 1302, 1620.50, 1210, 1013.96, 926, and 831.47 cm−1, respectively [33, 37]. There is a minor shift in the location of the first two bands in both ligands and seems to be not affected by complexation, suggesting that the (-NH2) nitrogen is not involved in the coordination. During complexation, the third band of the ligands appears wide and the fourth band is absent, indicating that at least one of the > NH groups is involved in the organization and formation of the complexes. The peaks at the 1618–1620 and 933–926 cm−1 levels are related to β (NH2) and (N–N), respectively, showing a small change of 2 and 7 cm−1, respectively, on complexity signalling that one hydrazinic nitrogen atom is active in interaction [31]. The peaks at range 1501.61–1507 cm−1 and 1301.56–1302 cm−1 may relate to thioamide I ν[β(N–H) + (CN)]I and thioamide II [ν(CN)] + β(N–H)] II in both ligands, respectively, due to the reduction of the > C=S bond order from two to one and an increase in the > C-N bond order from one to two as a result of thioenolization with a minor shift upon complexion. However, the peak at range 1204.96–1210 cm−1 in both ligands is related to ν(N–C(=S)-N) bond which is in agreement with reference [33]. The C-F bond was observed at peak with the range 1103.9–1013.96 cm−1 in both ligands with positive shifting, due to change the position of F in the coordination [38]. The position of ν(C=S) bond in the range 863.66–831.47 cm−1 with a lower and a higher shift in the spectra of the complexes, it could be related to change the position of F in the coordination [37].

Figures S1–2 (B)–(C) show that the 1H and 13C NMR spectra for synthesis compounds 2FPDC and 4FPDC, respectively. Briefly, the 1H NMR signals in Fig. S1 (B) for 2FPDC show that the presence of the Ar–H group is located at H (10), H (12), H (13), and H (22) (see Fig. 12 for labelling) which is assigned at peaks with the range of δ (ppm), 7.14–7.61, while the presence of the Ar–NH group is located at H (11) with a peak at δ (ppm), 8.16. In addition, the –NH-NH- group located at H (17), H (24) with peaks at range δ (ppm), 9.51–9.84, and the NH2 group is located at H (20), H (21) with a peak at δ (ppm), 3.33. These features are assigned in Fig. S2 (B) for 4FPDC as follows: the Ar–H group is located at H (5), H (7), H (9), H (10) which is assigned at peaks with the range δ (ppm), 7.14–7.47; the Ar–NH group is located at H (14) with a peak at δ (ppm), 8.11; the –NH-NH- group is located at H (18), H (20) with peaks at range δ (ppm), 9.38–9.76; the NH2 group is located at H (23), H (24) with a peak at δ (ppm), 3.35.

Figure S1 (C) shows the 13C NMR signals for 2FPDC as follows: the Ar–C group is located at C(3)– (8) with the peaks at δ (ppm), 115.97, 116.16, 127.32, 127.43, 128.17, 124.41; the C=S group is located at C(9), C(16) with a peak at δ (ppm), 182.79, while Fig. S2 (C) shows the 13C NMR signals for 4FPDC as follows (see Fig. 12 for labelling): the Ar–C group is located at C(1)–C(4), C(6), C(8) with the peaks at δ (ppm), 115.07, 115.30, 135.78, 127.83, 161.12, 158.70; the C=S group is located at C(13), C(19) with the peaks at δ (ppm), 182.13,183.14. All values of peaks for the 1H and 13C NMR spectra have been compared and confirmed by previous studies [31, 37, 39,40,41,42].

3.2 Corrosion Studies

3.2.1 OCP, PDP, and LPR Studies

The initial prediction of the behaviour of the corrosion inhibitor was conducted by open-circuit potential (OCP). Figure 2a–b shows the OCP versus time curves for uninhibited MS and inhibited with the presence of 2FPDC and 4FPDC, respectively (immersion time of 3600 s). It can be noticed that the OCP for uninhibited mild steel started at -473 mV with nonlinear behaviour; however after a few minutes, the OCP shifted towards more negative, and then, a steady state was arrived with a value of − 471 mV due to the general corrosion that had taken place on the surface of the mild steel. In the case of inhibiting of a mild steel with the presence of inhibitor 2FPDC (Fig. 2a) at concentrations of 1 × 10–5, 1 × 10–4, and 1 × 10–3 M, the OCP was started with − 400, − 420, and − 406 mV, respectively; then, it was steadily decreased to a more negative value. After one hour, it hit a stable state with values of − 471, − 469, and − 461 mV, respectively. However, the OCP curve at high concentration (10–2 M) started at a value of − 427 mV and increased sharply towards more positive with a value of − 417 mV at the beginning of immersion, and then, it steadily decreased to more negative until it gained a steady state at the end of immersion with a value of − 454 mV. This may be due to the initiation of diffusion into the oxide film of aggressive ions like hydrogen and chloride. Moreover, parallel OCP vs. time curves were observed due to removal of the accumulated oxide layer (Fe2O3, Fe3O4) by adsorption of 2FPDC molecules on the surface of mild steel. Similar behaviour was noticed in the case of inhibited of a mild steel by inhibitor 4FPDC (Fig. 2b) at concentrations of 1 × 10–5, 1 × 10–4, 1 × 10–3, and 1 × 10–2 M, the OCP started with − 402, − 392, − 408, and − 375 mV, respectively. After some time, the OCP decreased steadily to more negative until it approaching a stable state with values of − 470, − 466, − 441, and − 441 mV after one hour, respectively. Because of the improved corrosion resistance ability of the surface layer and the adsorption of inhibitor molecules on the surface, the positive change in OCP effectively states the passive status of the underlying metal. The positive shifting of OCP values is attributable to the inhibitor molecules' active function in protecting mild steel surfaces against aggressive ions such as hydrogen and chloride [34, 43, 44].

Fig. 2
figure 2

Open-circuit potential (OCP) for uninhibited mild steel and inhibited at immersion time 1 h, 2FPDC (a), 4FPDC (b)

During the addition of inhibitors, the potentiodynamic polarization allows extracting certain essential parameters of the corrosion process and the type of inhibitors, whether anodic, cathodic, or mixed as well. In this study, the PDP tests were performed after immersion times of one hour and five hours with fresh solution and rinsed electrodes in each case. All parameters such as inhibitor efficiency IE%, surface coverage (θ), corrosion current density \(i_{corr }^{^\circ }\), corrosion potential ECorr, anodic Tafel slopes βa, cathodic Tafel slopes βc, and polarization resistance \(R_{{{\text{LPR}}}}\) were extracted from PDP and LPR techniques and recorded in Tables 1, 2. The inhibition efficiency was determined by utilizing the following equations [22, 45]:

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

where \(i_{{\text{corr }}}^{^\circ }\) and \(i_{{{\text{corr}}\left( {inh} \right)}}\) refer to current densities for uninhibited and inhibited mild steel, respectively.

$${\text{IE}}_{{{\text{LPR}}}} \left( \% \right) = \frac{{R_{{P \left( {inh} \right)}} - R_{P}^{^\circ } }}{{R_{{P \left( {inh} \right)}} }} \times 100$$
(2)

where \(R_{P}^{^\circ }\) and \(R_{{P \left( {inh} \right)}}\) represent to polarization resistance for uninhibited and inhibited mild steel, respectively.

Figure 3a–b illustrates PDP plots for uninhibited mild steel (MS) and inhibited with various concentrations of 2FPDC and 4FPDC, respectively, in 1 M HCl at an immersion time of 1 h. It can be noticed that with an increase in the inhibitor concentration of two studied inhibitors, both anodic and cathodic curves were significantly changed, leading to a decrease in current density, which is proof of the inhibitory action of tested compounds. In addition, it was noticed that the Tafel slope (βc) was slightly deviated with the addition of inhibitors, which relates to the inhibitive activity of the cathodic sites on a steel surface by basic blockade and leads to a decrease in hydrogen evolution as well (Tables 1, 2). The curves of the cathodic Tafel in Fig. 3a–b illustrate that hydrogen evolution is an activation-controlled reaction and the addition of the inhibitor does not affect the reduction reaction [46]. The values of anodic Tafel slopes (βa) (Tables 1, 2) differ significantly with the addition of the inhibitors, indicating that these molecules were first adsorbed to the mild steel surface and hindered by simply blocking the metal surface reaction sites [47]. In other words, Tafel slopes values indicate that inhibitors did not change the mechanism of corrosion. The inhibitory action of tested compounds goes through adsorption of the inhibitor's molecule and blocking the active sites on the electrode surface. Moreover, the current densities were remarkably decreased with the presence of inhibitors compared with uninhibited mild steel. The decrease was from 59.4 µA cm−2 for uninhibited mild steel to 6.39 µA cm−2 and 5.12 µA cm−2 in the presence of 2FPDC (Fig. 3a, Table 1) and 4FPDC (Fig. 3b, Table 2), respectively. This could be due to adsorption of molecules of inhibitors over the metallic surface, leading to prevention or slowdown the activity of aggressive ions such as Cl to attack the surface [43]. Furthermore, there was fluctuating of corrosion potential ECorr values with increase in the concentration of inhibitor 2FPDC (Fig. 3a, Table 1), while the corrosion potential was shifted, except at a concentration of 1 × 10–2 M 4FPDC towards more negative with the presence of inhibitor 4FPDC (Fig. 3b, Table 2). It is proposed that the competition between inhibition of cathodic and anodic reactions influences the potential value of corrosion [45].

Fig. 3
figure 3

Tafel curves (PDP) for uninhibited mild steel and inhibited at immersion time 1 h, 2FPDC (a), 4FPDC (b)

Table 1 Potentiodynamic polarization and linear polarization resistance for mild steel immersion in 1 M HCl without and with the presence of corrosion inhibitor 2FPDC at 1 h, and 5 h
Table 2 Potentiodynamic polarization and linear polarization resistance for mild steel immersion in 1 M HCl without and with the presence of corrosion inhibitor 4FPDC at 1 h and 5 h

Figure 4a–b shows PDP plots for uninhibited MS and inhibited with various concentrations of 2FPDC and 4FPDC, respectively, in 1 M HCl at an immersion time of 5 h. Interesting results have been observed. It can be seen that the current densities were increased more for uninhibited mild steel with increase in the time of immersion due to increasing the dissociation of iron and increasing the rate of hydrogen evolution as well. However, the current densities have decreased sharply in the presence of various concentrations of 2FPDC and 4FPDC (Tables 1, 2). In other words, the maximum inhibitor efficiency was increased for 2FPDC from 89.2% at an immersion time of 1 h to 93.5% at 5 h, while the maximum inhibitor efficiency for 4FPDC was increased from 91.4% at an immersion time of 1 h to 96.8% at an immersion time of 5 h. It was assumed that more area on a mild steel surface had been covered by molecules of inhibitors with increase in immersion time. In addition, the values of corrosion potential ECorr have been shifted more negatively towards the immunity region with the addition of inhibitors. In fact, it was shifted from − 0.422 V for uninhibited mild steel to − 0.497 V and − 0.463 V in the presence of inhibitors 2FPDC and 4FPDC, respectively. Moreover, it was observed that (Fig. 4a–b, Tables 1, 2) the current density was decreased from 198 µA cm−2 with uninhibited mild steel to 12.8 µA cm−2 and 6.17 µA cm−2 with the presence of inhibitors at 1 × 10–2 M 2FPDC and 4FPDC, respectively. It is well known from previous studies that if corrosion potential values of these displacements are greater than − 0.085 V then inhibitors could be defined as cathodic or anodic type, and inhibitors could be given a mixed type if these displacements are less than − 0.085 V [48]. According to results reported in Tables 1, 2, all displacements for corrosion potential values except at 10–5 M 4FPDC with immersion time 5 h are not greater than − 0.085 V. Consequently, both compounds, 2FPDC and 4FPDC, acted as mixed type of corrosion inhibitors. However, according to PDP curves, the process of examined inhibitors has a more pronounced influence on cathodic curves.

Fig. 4
figure 4

Tafel curves (PDP) for uninhibited mild steel and inhibited at immersion time 5 h, 2FPDC (a), 4FPDC (b)

Results suggested that these inhibitors increasingly adsorb mild steel surfaces and cover their active sites with increase in immersion time, thus forming a protective layer which minimizes their dissolution reactivity. Besides that, the formation of protective layers is linked with inhibitor concentration and inhibition efficiency [45, 49].

The findings of the LPR technique in Tables 12 demonstrate that the resistance polarization for inhibitors obeys an order of 4FPDC ˃ 2FPDC, which is contradictory to the current density of corrosion in both immersion times (1 and 5 h). This suggests that 1/RLPR values are purely proportional to the \(i_{{\text{corr }}}^{^\circ }\). To emphasize, the results of OCP, PDP, and LPR techniques remain inadequate to explore corrosion inhibitors. Thus, electrochemical impedance spectroscopy (EIS) was performed.

3.2.2 EIS Tests

The best electrochemical method for evaluating the interface between substrate and electrolyte in the absence and existence of corrosion inhibitors is electrochemical impedance spectroscopy (EIS). Figure 5a–c (left and right) shows Nyquist and Bode curves for uninhibited MS and inhibited with various concentrations of 2FPDC and 4FPDC, respectively in 1 M HCl at an immersion time of 1 h, respectively. From Fig. 5(a, left), it can be noted that the Nyquist plot comprises a depressed semicircle with the centre moved to below the x-axis, which corresponds to the surface's roughness and inhomogeneity, as well as the mechanism of corrosion for the mild steel in acid solution is controlled by a charge transfer [50]. As the concentration of 2FPDC increases, the diameter of the capacitive circle increases, and the shape of the loops stays similar for all concentrations as well. Because the shapes of the impedance curves with inhibitors present differed from the shapes of the curves of uninhibited mild steel, we have two equivalent circuits. In Nyquist plots, the existence of semicircle shapes is clarified to explain not just the resistance to charge transfer, as well as the strength of the double electrical layer between the surface and the interface of the electrolyte [34, 51]. In addition, Fig. 5a shows that the inhibited samples have high universal impedances compared with uninhibited mild steel samples, which indicates an increase in the anti-corrosion barrier property of the inhibited specimens. Figure 5b–c (left and right) shows Bode curves for uninhibited MS and inhibited with various concentrations of 2FPDC and 4FPDC, respectively, in 1 M HCl at an immersion time of 1 h, respectively. This figure’s examination reveals three distinct areas. The log |Z| values tend to reach zero at higher frequencies, and the phase angle values approach 0°. The electrolyte resistance is responsible for these reactions to resistive behaviour. There is a linear correlation between log |Z| and log Freq. for intermediate frequency areas, with a slope of − 0.67, − 0.69 and a phase angle of − 74°, − 74.8° in the presence of 2FPDC and 4FPDC, respectively. While the properties of a pure capacitor would result in a slope of − 1 and a phase angle of—90°, the variations found account for the deviation from a perfect capacitive response that may be attributed to the rate of dissolution slowing down over time. Finally, in the low frequency area, the electrode’s resistive behaviour rises and log |Z| becomes frequency independent [52, 53].

Fig. 5
figure 5

Electrochemical impedance spectra (EIS) for uninhibited mild steel and inhibited at immersion time 1 h for 2FPDC (left), and 4FPDC (right), Nyquist curves (a), Bode curves (b) and (c)

Figure 5 (b, left) and (c, left) shows impedance modulus and phase angle curves, respectively. The impedance |Z| at lower frequencies is well known to be the parameter used for evaluating the inhibitor’s corrosion resistance. The performance of (|Z|) was improved in Fig. 5 (b, left) with an increase in inhibitor concentration relative to uninhibited mild steel, which suggests the strength of inhibitor barriers to corrosive media. In a detailed review of Fig. 5(c, left), the curve of the phase angle becomes considerably greater with 2FPDC existing. Similar behaviour was found in previous references [54, 55]. The reason for this behaviour may be due to the relaxation effect resulting from the adsorption of 2FPDC molecules [56]. Moreover, a similar behaviour was observed in Fig. 5 (a–c, right) in the presence of 4FPDC; however, the results of capacitive loops, impedance modulus, and phase angle were greater than that observed in the presence of 2FPDC.

Figure 6 (a)–(c) (left and right) shows Nyquist and Bode curves for uninhibited MS and inhibited with various concentration of 2FPDC and 4FPDC, respectively, in 1 M HCl at an immersion time of 5 h, respectively. An interesting result can be observed in both compounds (Fig. 6). The findings stated that the immersion time has a substantial effect on the impedance spectrum size as well as the inhibition performance of 2FPDC and 4FPDC. By increasing the time of immersion, the capacitive loop was expanded as more succinct anions are adsorbed electrostatically on the surface of mild steel that has a positive charge lead to cover more area on the surface and protect it from aggressive ions [57].

Fig. 6
figure 6

Electrochemical impedance spectra (EIS) for uninhibited mild steel and inhibited at immersion time 5 h for 2FPDC (left), and 4FPDC (right), Nyquist curves (a), Bode curves (b) and (c)

All impedance spectra values of uninhibited and inhibited mild steel (presence of 2FPDC and 4FPDC at immersion time of 1 and 5 h) parameters were generated by Ivium Technology, Instrument: B08024, Software: 2699 (699), throughout fitting impedance spectra curves summarized in Tables 3, 4. Inhibitor efficiency (IEEIS) was determined by Eq. (3) and listed in Tables 3, 4 [58] as well:

$${\text{IE}}_{{{\text{EIS}}}} \left( \% \right) = \frac{{R_{{P \left( {inh} \right)}} - R_{P}^{^\circ } }}{{R_{{P \left( {inh} \right)}} }} \times 100$$
(3)

where \(R_{P}^{^\circ }\) and \(R_{{P \left( {inh} \right)}}\) refer to the polarization resistance with absence and existence of the inhibitor, respectively.

Table 3 Electrochemical impedance spectroscopy (EIS) for mild steel immersion in 1 M HCl without and with presence corrosion inhibitor 2FPDC at 1 h and 5 h
Table 4 Electrochemical impedance spectroscopy (EIS) for mild steel immersion in 1 M HCl without and with presence corrosion inhibitor 4FPDC at 1 h and 5 h

Figure 7a–b illustrates the equivalent circuit for uninhibited and inhibited mild steel with existence of inhibitors, respectively. In order to overcome the deviation as a result of frequency dispersion, a constant phase element (CPE) was utilized in Fig. 7 instead of the capacitive element, as well as to gain a more precise match between the experimental data sets using a more complicated equivalent circuit. Figure 7a shows the equivalent circuit model for uninhibited mild steel, where RS is the resistance of solution, RP refers to the polarization resistance which is equal to the sum of the resistance charge transfer Rct and the resistance to accumulate materials resistance such as corrosive material, some present molecules or ions (Ra), and diffuse layer resistance (Rd). W is the CPE constant related to Warburg impedance. The existence of Warburg impedance indicates that the propagation reaction of the electron for a semicircle occurs through the surface layer and is limited by mass transport (Warburg) [59]. Moreover, the existence of the Warburg impedance W in the low frequency range indicates a diffusion-controlled corrosion process. The electro-active species, such as corrosive H+ species or dissolved oxygen, diffuse from the solution bulk to the metal surface at the Fe/electrolyte interface, or soluble corrosion products are transported in the opposite direction. When the inhibitor is present, the W progressively decreases in the analysed low frequency region, but the diameter of the capacitive loop significantly rises compared to the blank solution. These findings indicate that the formation of the inhibitor’s protective layer delays the diffusion of the corrosive species considerably [60].

Fig. 7
figure 7

Equivalent circuit model for mild steel in 1 M HCl, blank (a), with presence of inhibitor (b)

Figure 7b shows the equivalent circuit model for inhibited mild steel. The first resistance (R1) refers to layer resistance (RL), while the second resistance (R2) is equal to the sum of layer resistance (RL) and the resistance of unprotected area (RPRO) which is the result of Rct, Rd, and Ra. In addition, RP = R1 + R2. Moreover, CPE1 and CPE2 are the capacitance of the layer and the capacitance of the double layer, respectively, which can be determined from Eqs. (45) as follows [45]:

$$C_{l } = ( Q_{1} \times R_{1}^{1 - n} )^{1/n}$$
(4)
$$C_{dl } = ( Q_{2} \times R_{2}^{1 - n} )^{1/n}$$
(5)

where respectively, Q1, and Q2 are quasi-layer capacitance and quasi-double-layer capacitance, while n corresponds to an exponent of CPE that can be used as a measure of surface heterogeneity or roughness. When the electrode surface is homogenous and flat, the exponential value (n) equals one, and the metal/solution interface behaves like a capacitor with a regular surface. The factor n is a variable that is typically between 0.7 and 1 [61]. The following expression is used to describe CPE [62]:

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

where \(i\) and \(\omega\) refer to imaginary roots and angular frequency, respectively.

From Tables 3, 4, it can be seen that the polarization resistance of a mild steel increases after the addition of inhibitors (2FPDC and 4FPDC) to the corrosive solution. However, as the concentrations of the two inhibitors (2FPDC and 4FPDC) rise, the layer capacity (CPE1) decreases, with n1 value close to 0.83, suggesting that the behaviour is consistent with a capacitor that is rough and porous [59]. Moreover, the double-layer capacitance (CPE2) of this film also decreases, with n2 value close to 0.91, indicating that the reduction of the surface heterogeneity is a consequence of the adsorption of 2FPDC and 4FPDC on the MS surface by creating a uniform protective film [52]. These differences in the double-layer capacity (Cdl) and polarization resistance (Rp) indicate that the two inhibitors (2FPDC and 4FPDC) disrupt the steel’s surface by forming contacts with the active sites on its surface [63].

The following relationship relates the capacitance of the double layer (Cdl) to the thickness of the protective layer.

$$C_{dl} = \frac{{\varepsilon \varepsilon_{o} S}}{e}$$
(7)

where \(\varepsilon\), \(\varepsilon_{o}\), \(S\), and \(e\) refer to dielectric constant of the medium (assumed 12 for both iron oxide film and inhibitors [64, 65]) and vacuum permittivity (8.85 × 10−14 F cm−1 [65], the surface area of the electrode (0.785 cm2), and the thickness of the protective layer, respectively [62, 66].

The Cdl values (CPE2) decrease as the concentration of 2FPDC and 4FPDC increases, suggesting that the thickness of the protective layer (e) increases.

The results in Tables 3, 4 show that the inhibitor efficiency was significantly increased from 88.3% at immersion time of 1 h to 96.5% at immersion time of 5 h with the presence of 2FPDC, while with the presence of 4FPDC, the inhibitor efficiency was increased from 93.7% to 97.3% at an immersion time of 1 h and 5 h, respectively. The EIS results are in agreement with OCP, LPR, and PDP measurements.

To be honest, the electrochemical methods alone remain insufficient to explore of corrosion inhibitors. Thus, SEM, EDX, and AFM were performed.

3.3 Surface Characterization

Figures 8, 9 (A)–(D) represent the images obtained by SEM and EDX of metallic samples. The test has been carried out for only polished MS surface, immersed samples in 1 M HCl for 72 h in absence and existence of inhibitors at 1 × 10–2 M 2FPDC and 1 × 10–2 M 4FPDC, respectively. Figure 8a shows a smooth surface and a few parallel scratch lines from polishing process, which is free from the corrosion products. Figure 8b clearly shows that the unprotected mild steel surface is extremely corrosive and weakened as a consequence of the violent corrosive harassment of the hydrochloric acid solution. The mild steel surface reveals the appearance of mountains with several pits and cracks. By contrast, the existence of the inhibitors reveals a smoother surface (Fig. 8c–d). These findings could be attributed to adsorb inhibitor molecules on the steel surface, which impede mild steel surface dissolution. The higher smooth and uniform surface morphology was observed with the presence of 4FPDC inhibitor, which is in agreement with electrochemical investigations. The adsorbed substances occupy the active sites of mild steel and form a protective layer on the surface. EDX scan measurements are utilized to explore which components are present on the surface of the mild steel before and after exposuring to 1 M HCl, and later with the absence and present of inhibitors. It can be seen clear that from Fig. 9a EDX spectra were a free corrosion surface due to the present a high peak for Fe and an atomic percentage as follows: 96% Fe, 3.96% O. However, Fig. 9b shows that the EDX spectra had a corroded surface due to exposure to 1 M HCl solution and the presence of a chlorine peak in the spectra, while the Fe peaks are decreased and the O peak is increased, atomic percentage as follows: 77.53% Fe, 17.5% O, and 5% Cl. An interesting result has been found in Fig. 9c–d that EDX is related to a relatively non-corroded surface due to the presence of inhibitors 2FPDC and 4FPDC, respectively. It can be seen clear that the chlorine peak is significantly decreased and the oxygen peak as well, while the Fe peak is increased which is attributed to the presence of inhibitor molecules adsorbed on the surface of mild steel, which leads to the prevention of Cl ions attacking the surface and retarding of iron dissolution [47, 55]. The atomic percentages are as follows: 92% Fe, 3.65% O, 0.63% Cl, 3.12% F, 0.31% S, 0.11% N, and 0.18% C in the presence of 2FPDC, and 93.12% Fe, 2.48% O, 0.56% Cl, 2.81% F, 0.15% N, and 0.21% C in the presence of 4FPDC.

Fig. 8
figure 8

SEM images for mild steel, polishing surface (a), immersion mild steel in 1 M HCl for 72 h (B), immersion mild steel in 1 M HCl + 1 × 10–2 M 2FPDC for 72 h (c), immersion mild steel in 1 M HCl + 10–2 M 4FPDC for 72 h (d), mag. 1000x, 5000x,10000x, scale bar 100,20, 10 µm, respectively

Fig. 9
figure 9

EDX spectra for mild steel, polishing surface (a), immersion mild steel in 1 M HCl for 72 h (b), MS in 1 M HCl + 1 × 10–2 M 2FPDC for 72 h (c), MS in 1 M HCl + 10–2 M 4FPDC for 72 h (d)

Figure 10a–d depicts AFM images in 2D and 3D for non-immersed (only polished) samples and immersed samples in 1 M HCl solution for 72 h in the absence and presence of corrosion inhibitors 2FPDC and 4FPDC, respectively. It can be seen that the non-immersed surface (Fig. 10a) is an extremely smooth surface, not corroded, with very little roughness, and the average surface roughness of the surface (Ra) is 7.8 nm. In addition, it can be seen that the 3D images contain a few mountains, which are related to polishing processes or atmospheric oxide. However, it can be seen that the immersed surface in 1 M HCl (Fig. 10b shows clear sign of corrosion, very high roughness, and damage surface due to the presence of an acidic solution, and the Ra value is 224 nm. In addition, 3D images show a large number of mountains on the surface, which are related to the attack of the surface by aggressive ions such as chlorine and hydrogen ions. It can be seen that from Fig. 10c, the surface is relatively much smoother and the Ra value is 28.7 nm when compared with Fig. 10b, which is related to the presence of inhibitor 2FPDC adsorbed on the surface that prevents the aggressive ions from attacking the surface. 3D images show fewer mountains than in 3D image (Fig. 10b. The best result is found in Fig. 10d when compared with Fig. 10b–c due to the presence of the inhibitor 4FPDC. 3D images show a very small number of mountains, and the Ra value is 12.1 nm. Consequently, the lower Ra values for the inhibited sample suggest that there is a smoother surface and thus a lower current density attributable to the creation of a thin film by adsorption of the inhibitor molecules to the MS surface [67].

Fig. 10
figure 10

Atomic force microscopy (AFM) images for mild steel, polishing surface (a), immersion mild steel (MS) in 1 M HCl for 72 h (b), MS in 1 M HCl + 1 × 10–2 M 2FPDC for 72 h (c), MS in 1 M HCl + 10–2 M 4FPDC for 72 h (d)

It can be summarized that the 2FPDC and 4FPDC have a good tendency to adsorb on the MS surface on the basis of SEM, EDX, and AFM measurements, which are compatible with electrochemical measurements.

3.4 Adsorption Isotherm

Adsorption isotherms are an essential part of the examination of the corrosion process because they provide a useful information about metal inhibitor interaction. A number of isotherms of adsorption, like Langmuir (Fig. 11a–b), Temkin (Fig. 11c–d), and Frumkin (Fig. 11e–f), were tested. The suitable findings suggest that the 2FPDC and 4FPDC adsorption on the MS surface fits the Langmuir adsorption system as slope and R square values approach one [68]. Figure 11a–b shows the Langmuir adsorption model for 2FPDC and 4FPDC, respectively, which is drawn by using Eq. (8) as follows [54]:

$$\frac{{C_{inh} }}{\theta } = \frac{1}{{K_{{{\text{ads}}}} }} + C_{inh}$$
(8)

where \(C_{inh}\), \(\theta\), and \(K_{{{\text{ads}}}}\) refer to concentration of inhibitor, surface coverage (determine by using equations \(\frac{{i_{{\text{corr }}}^{^\circ } - i_{{{\text{corr}}\left( {inh} \right)}} }}{{i_{{{\text{corr}}}}^{^\circ } }}\) and \(\frac{{R_{{P \left( {inh} \right)}} - R_{P}^{^\circ } }}{{R_{{P \left( {inh} \right)}} }}\) [47], and equilibrium constant for adsorption–desorption process, respectively.

The fitting line was done by Origin Graph software model OriginPro 2018, while the Kads was determined from the intercept of the Langmuir adsorption line and listed in Table 5.

Fig. 11
figure 11

Adsorption isotherm models for mild steel with presence inhibitors (2FPDC left, 4FPDC right), Langmuir (a, b), Temkin (c, d), and Frumkin (e, f)

Table 5 Langmuir adsorption parameters of 2FPDC and 4FPDC on mild steel surface in 1 M HCl solution

The following equation can be used to calculate the free energy of adsorption ΔGads [67].

$$\Delta G_{{\text{ads }}} = - RT\ln (55.5K_{{{\text{ads}}}} )$$
(9)

where \(R\) and \(T\) refer to gas constant and absolute temperature, while 55.5 number refers to concentration of H2O in solution in mol L−1.

It is well known from previous studies [69,70,71] that if the value of ΔGads is − 20 kJ mol−1 or less negative, the adsorption can be assumed physisorption which mean that charged organic molecules and metal surface taking place electrostatic interaction in aqueous solution. And if the value of ΔGads is − 40 kJ mol−1 or more negative, the adsorption can be assumed to be chemisorption, which means that electronic sharing and/or transfer to form covalent bonds between organic inhibitors and the metal surface. According to results reported in Table 5, the value of ΔGads was − 38.5 and − 37.9 kJ mol−1 for 2FPDC and 4FPDC, respectively, which indicated that the type of adsorption was mix (physisorption and chemisorption) in both compounds (see Fig. 18).

3.5 Quantum Chemical Studies

3.5.1 Neutral Inhibitors

To get more details on the relationship between quantum chemical measurements of the molecular structures of our compounds (2FPDC and 4FPDC) and their inhibition performance were achieved utilizing Gaussian 09 software at B3LYP/6-311 +  + G(2d,2p). In the water phase, optimization of the compounds structure was carried out. It is found that density functional theory provides knowledge through the chemical reactiveness and inhibition in based on global parameters, for instance, EHOMO, ELUMO, energy gap (ΔE), hardness (η), softness (σ) electronegativity(χ), chemical potential (μ), and electrophilicity index (ω), nucleofugality (ΔEn), electrofugality (ΔEe), and fraction of electron transferred (ΔN) [72]. The extracted parameters are determined and recoded in Table 6 by using Eqs. (1015) as follows [73, 74]:

$$I = - E_{{{\text{HOMO}}}}$$
(10)
$$A = - E_{{{\text{LUMO}}}}$$
(11)
$$\chi = \frac{I + A}{2}$$
(12)
$$\eta = \frac{I - A}{2}$$
(13)
$$\mu = - \chi$$
(14)
$$\omega = \frac{{\mu^{2} }}{2\eta }$$
(15)

where I and A refer to ionization potential and electron affinity, respectively.

$${\Delta }E_{n} = \pm \frac{{\left( {\mu + \eta } \right)^{2} }}{2\eta }$$
(16)
$${\Delta }E_{e} = \frac{{\left( {\mu - \eta } \right)^{2} }}{2\eta }$$
(17)

Nucleofugality \(\left( {{\Delta }E_{n} } \right)\) and electrofugality \(\left( {{\Delta }E_{e} } \right)\) parameters defining the quantify nucleophilic and electrophilic capabilities of a leaving group were proposed by Ayers et al. [75].

Table 6 Quantum chemical parameters for 2FPDC and 4FPDC in water phase by using B3LYP-6-311 +  + G (2d, 2p) method

According to the information extracted from the literature, unoccupied Fe atom d-orbitals accept the electrons from the inhibitor molecule in the neutral form and form a co-ordinate connection (Chemisorption). Sequentially, Fe-back anti-bonding orbitals donate the electrons to the protonated inhibitor molecule (physisorption) [76]. This coordination and back-donation mechanism reinforces the adsorption on the mild steel surface of various configurations of 2FPDC or 4FPDC molecules.

The most two important values in the theoretical part are the HOMO and LUMO values. HOMO (highest occupied molecule orbital) value is related to the ability to contribute the electron to the metal surface’s empty d-orbital, i.e. the greater its importance will be its donation capacity. However, LUMO (lowest unoccupied molecule orbital) value is correlated with the electron acceptance ability, which means that the lower its value, the more its electron accepting the tendency from the metal orbital filled [77]. Figure 12 shows the optimized structure, HOMO, LUMO, and molecular electrostatic potential for 2FPDC and 4FPDC. From Fig. 12, it can be seen that the HOMO energy is observed to locate on the heteroatoms (H–N–N–H group, S=C–NH2 group) for both compounds. However, the value of HOMO energy for 4FPDC (− 6.47 eV) is higher than the value of HOMO energy for 2FPDC (− 6.51 eV), which indicates that the inhibitor of 4FPDC is more efficient than 2FPDC. Moreover, it can be seen from Fig. 12 that the ELUMO energy is observed to be located on the phenyl ring and most heteroatoms for both compounds, but the value of LUMO energy for 4FPDC (− 1.57 eV) is lower than the value of ELUMO energy for 2FPDC (− 1.51 eV). This is another factor to be that 4FPDC is more efficient than 2FPDC according to literature [78]. Furthermore, Fig. 12 shows the molecular electrostatic potential map, which is referred to as the electronic density and represented by different colours. The blue areas refer to the positive areas which refer to nucleophilic reactivity, while the yellow areas refer to the negative areas which are referred to electrophilic reactivity. It can be noted clearly that the negative region is focused around S and nitrogen atoms in both compounds; however, the blue area in 4FPDC is less than in 2FPDC. Therefore, the 4FPDC has slightly more negative charges than the 2FPDC, which indicates that there is probably an increase in active adsorptive sites [12].

Fig. 12
figure 12

Optimized structure, HOMO, LUMO, and molecular electrostatic potential for quantum chemical results of 2FPDC and 4FPDC molecules determined by using B3LYP-6-311 +  + G (2d, 2p) basis set

Figure 13 shows the energy level for HOMO, LUMO, and HOMO–LUMO gap energy for 2FPDC and 4FPDC in the water phase. In general, a decrease in the energy gap leads to easier molecular polarization, greater surface adsorption, and better inhibitor performance. In other words, the energy gap for 4FPDC (4.90 eV) is lower than the energy gap for 2FPDC (5.0 eV), which is strongly evident in agreement with the experimental part [74].

Fig. 13
figure 13

Energy level for HOMO, LUMO, and gap energy (ΔE) for 2FPDC and 4FPDC in water phase

The fraction of transferred electrons (ΔN) is an essential parameter to evaluate the inhibition performance. The values of ΔN are calculated according to Eq. (18) and listed in Table 6 [79]:

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

where \(\chi_{{\text{Fe }}}\) (χFe = 7 eV) and ηFe (ηFe = 0) refer to electronegativity and hardness for Fe, respectively, while χinh and ηinh refer to electronegativity and hardness for inhibitor. The literature indicates that the inhibition efficacy with a value of ΔN < 3.6 increases the capacity to sacrifice electrons to the surface of the metal [80].

3.5.2 Protonated Inhibitors

The inhibitor molecule is protonated in an aqueous environment, and these protonated molecules are adsorbed on the surface of the mild steel. Consequently, the comparison of the electronic characteristics of the protonated species with those of the neutral species is necessary to verify which adsorbents are often made on the metal surface (see Fig. 14). Proton Affinity, it can be described as the molecular protonation’s negative reaction enthalpy, and Eqs. (1920) can be used to measure proton affinity (PA) as follows [81]:

$$A + H^{ + } \to AH^{ + } - \Delta H$$
(19)
$$PA_{\left( A \right)} = - \Delta H = (E_{{\left( {{\text{Pro}}} \right)}} - \left( {E_{{\left( {\text{non Pro}} \right)}} + E_{{H^{ + } }} } \right)$$
(20)
Fig. 14
figure 14

The protonated form of the molecule for quantum chemical results of 2FPDC and 4FPDC molecules determined by using B3LYP-6-311 +  + G (2d, 2p) in water phase at 298 K

The proton affinities of the 2FPDC and 4FPDC in the water phase were determined with B3LYP/6-311 +  + G (2d, 2p) at 298 K and listed in Table 7. There are several hetero-atoms in the examined inhibitors, but the most desirable position is that which has the bigger negative value. N14, N15, N2, N19, S1, and S18 in 2FPDC and N16, N17, N12, N22, S15, and S21 in 4FPDC are observed. The results show that the sulphur atoms S18 (in case 2FPDC) and S21 (in case 4FPDC) are more preferential sites for protonation than that of the other S and nitrogen atoms. However, proton affinity values in 2FPDC are smaller than those of 4FPDC. It can be noted clear that from Table 6 the energy gap values (ΔE) in both compounds have lower for protonated form when compared to that of the neutral form of inhibitor molecules except protonated form with N15 in case 2FPDC, and N17 in case 4FPDC. This indicates that the protonated form is more reactivity than neutral form. Consequently, the protonated forms are more likely to adsorb on mild steel surface [82]. The above-mentioned statement further confirms the experimental adsorption. On the other words, quantum chemical determinations are strongly acceptable with experimental tests and inhibitors efficiency for both compound are at the order 4FPDC ˃ 2FPDC.

Table 7 The proton affinities of the 2FPDC and 4FPDC in water phase calculated with B3LYP/6–311 +  + G (2d, 2p) at 298 K

3.5.3 Monte Carlo Simulations (MCS)

Figures 15, 16 show side and top views, energy distribution, and radial distribution function (RDF) curve of the equilibrium configuration for inhibitors 2FPDC and 4FPDC adsorbed on Fe (111) as aqueous and vacuum phases, respectively. The simulation parameters’ outcomes are given in Table 8. As shown in Figs. 15, 16, both inhibitor structures interact well with a flat structure on the Fe (111) surface. The negative value for adsorption energy indicated that the adsorption process between metal surface and inhibitors occurred spontaneously [18]. Additionally, as shown in Table 8, the values of adsorption energy are greater in the presence of aqueous molecules (− 100.5 kcal/mol for 2FPDC and − 110.2 kcal/mol for 4FPDC) than under vacuum environments (− 81.9 kcal/mol for 2FPDC and − 82.6 kcal/mol for 4FPDC). This implies that the presence of inhibitors along with aqueous conditions improves and strengthens the adsorption process. However, the value of adsorption energy for 4FPDC is larger than the value of adsorption energy for 2FPDC in both conditions [47].

Fig. 15
figure 15

Top and side views, energy distribution, and RDF curve of the equilibrium configuration for 2FPDC adsorbed on Fe (111) as aqueous and vacuum phases

Fig. 16
figure 16

Top and side views, energy distribution, and RDF curve of the equilibrium configuration for 4FPDC adsorbed on Fe (111) as aqueous and vacuum phases

Table 8 Adsorption and binding energies of 2FPDC and 4FPDC inhibitors adsorbed on Fe (111) surface

The radial distribution function (RDF), g (r), is a well-known technique for calculating the distance between an inhibitor and a metal surface. In general, a short distance (< 3.5 Å) suggests chemisorption, while a distance higher than (˃ 3.5 Å) indicates physisorption. As shown in Figs. 15, 16, the first two peaks are found around 2.4 and 2.8 Å in case 2FPDC and near 2.3 and 2.7 Å in case 4FPDC, respectively, which may be related to the chemical interactions established between the N or S and iron atoms. Other peaks outside of 3.5 Å may be the result of physical interactions between the inhibitor structure and the iron surface [83, 84].

3.5.4 Molecular Dynamics (MD) Simulations

MD simulation is a common technique for studying the interactions between organic molecules, including corrosion inhibitors, and metal surfaces [49]. The ONIOM method was used to measure the interactions between ligands and Fe atoms reacting with the iron surface (111), and the adsorption energy was determined using the B3LYP/6-31G (d) level of theory and the following equation:

$$E_{{{\text{ads}}}} = E_{{{\text{total}}}} - E_{{{\text{ligand}}}} - E_{{{\text{Fe}}\;{\text{atoms}}}}$$
(21)

where \(E_{{{\text{total}}}}\), \(E_{{{\text{ligand}}}}\), and \(E_{{{\text{Fe}}\;{\text{atoms}}}}\) refer to the total energy of the system, the energy of the ligand, and the energy of the iron atom, respectively [70]. The results are recorded in Table 8.

The binding energy (Ebinding) is understood to be the negative value of the adsorption energy and it is determined using the equation below [85].

$$E_{{{\text{binding}}}} = - E_{{{\text{ads}}}}$$
(22)

Figure 17 shows that both studied inhibitors adsorbed throughout N15, S18 in case 2FPDC and N17, S21 in case 4FPDC on the surface of Fe (111). Bond length of Fe2 and S18 atom is 2.191 Å for Fe (111) + 2FPDC complex and bond length of Fe2 and S21 atom is 2.166 Å for Fe (111) + 4FPDC complex. Furthermore, bond length of Fe1 and N15 atom is 1.942 Å for Fe (111) + 2FPDC complex, while bond length Fe2 and N17 atom is 1.920 Å for Fe (111) + 4FPDC complex (see Fig. 17).

Fig. 17
figure 17

Representative 2FPDC and 4FPDC compounds on Fe (111) surface

This finding evidently justifies why the 4FPDC inhibitor can effectively inhibit the corrosion of mild steel in 1 M HCl in comparison with the 2FPDC inhibitor. This means that the obtained result theoretically is the same as the experimentally observed result.

3.6 Mechanism of Corrosion Inhibition

Based on the results of the present research and information extracted from previous studies, it may be summarized that anodic metallic dissolution and cathodic processes are delayed by 2FPDC and 4FPDC molecules. In the absence and existence of 2FPDC and 4FPDC molecules, the cathodic and anodic reaction mechanisms can be shown as below [68, 74, 86,87,88]:

Anodic reactions:

$${\text{Fe}} + n{\text{H}}_{2} {\text{O}} \to {\text{Fe}}({\text{H}}_{2} {\text{O}})_{n}$$
(23)
$${\text{Fe}}({\text{H}}_{2} {\text{O}})_{n} + 2{\text{Cl}}^{ - } \to [{\text{Fe}}\left( {{\text{H}}_{2} {\text{O}})_{n} 2{\text{Cl}}^{ - } } \right]$$
(24)
$$\left[ {{\text{Fe}}\left( {{\text{H}}_{2} {\text{O}}} \right)_{n} 2{\text{Cl}}^{ - } } \right] \left[ {2{\text{FPDC}}} \right]^{ + } \to \left[ {{\text{Fe}}\left( {{\text{H}}_{2} {\text{O}}} \right)_{n} 2{\text{Cl}}^{ - } } \right]\left[ {2{\text{FPDC}}} \right]^{ + }$$
(25)
$$\left[ {{\text{Fe}}\left( {{\text{H}}_{2} {\text{O}}} \right)_{n} 2{\text{Cl}}^{ - } } \right] + \left[ {2{\text{FPDC}}} \right]^{ + } + e^{ - } \to \left[ {{\text{Fe}}\left( {{\text{H}}_{2} {\text{O}}} \right)_{n} 2{\text{Cl}}^{ - } } \right]\left[ {2{\text{FPDC}}} \right]^{ + }$$
(26)

Equations (23) and (24) refer to the dissolution of mild steel that occurs without the presence of 2FPDC and 4FPDC molecules. While Eq. (25) and Eq. (26) refer to the presence of inhibitor molecules through electrostatic interactions, the inhibitor molecule adsorbs between the positively charged molecular and the negatively charged metal surface. These adsorbed molecules form a monomolecular layer when they interacted with \([Fe\left( {H_{2} O)_{n} 2Cl^{ - } } \right]\). This is the process of physical adsorption. Then, it leads to a slowdown of anodic dissolution due to their adsorption on the surface [87].

Cathodic reactions:

$${\text{H}}^{ + } + e^{ - } \to \frac{1}{2}{\text{H}}_{2}$$
(27)
$${\text{Fe}} + [2{\text{FPDC}}]^{ + } \to \left( {{\text{Fe}}[2{\text{FPDC}}]^{ + } } \right)$$
(28)
$${\text{Fe}}[2{\text{FPDC}}]^{ + } + e^{ - } \to \left( {{\text{Fe}}\left[ {2{\text{FPDC}}} \right]} \right)$$
(29)

As illustrated above, hydrogen evolution was the major cathodic reaction in the absence of 2FPDC and 4FPDC molecules (Eq. 27). However, according to Eqs. 28 and 29 that the presence of positively charged [2FPDC] + moiety of the studied compounds adsorbed on cathodic positions of the MS leads to retard the rate of ↑ H2 evolution. Accelerated surface iron oxidization results in an aggressive acid solution, and/or compounds ([2FPDC] and [4FPDC] molecules) that are negatively charged to the iron-to-surface chargers that bind negative charges against ions. The negatively charged metallic surface attracts positive cationic movement by electrostatic attraction force, leading to [2FPDC] and [4FPDC] molecules being physisorbed. However, adsorbed inhibitor molecules ([2FPDC] and [4FPDC]) can also react with π-electron that is not bound and chemisorbed. It can also therefore be summarized that the [2FPDC] and [4FPDC] molecules are adsorbed by physisorption and then chemisorption at metal–electrolyte interfaces [89, 90]. Adsorbed inhibitor molecules are believed to send their electrons to their empty anti-bonding molecular orbitals to the surface orbitals of iron atoms and recognized electrons, thereby strengthening interactions with the metal surface (see Fig. 18).

Fig. 18
figure 18

Schematic mechanism of corrosion inhibitor, in case presence of 2FPDC (A), in case presence of 4FPDC (B)

3.7 Comparison with Some Other Organic Inhibitors

The use of dithiohydrazodicarbonamide derivatives as corrosion inhibitors for metals in acidic and alkaline media has gained a lot of interest. One of the most common dithiohydrazodicarbonamide derivatives is 1-aryl-2,5-dithiohydrazodicarbonamide. It has gotten a lot of attention in recent years, particularly for copper and carbon steel protection [91,92,93]. Since it contains both nitrogen and sulphur in its molecular form, 1-aryl-2,5-dithiohydrazodicarbonamide is more important in corrosion inhibition studies than compounds that only contain nitrogen. Table 9 compares the corrosion inhibition activities of the two new molecules (2-fluorophrnyl-2,5-dithiohydrazodicarbonamide (2FPDC) and 4-fluorophenyl-2,5-dithiohydrazodicarbonamide (4FPDC)) investigated in this study to those of other inhibitors with heteroatoms in their structure. The results show that the structures contain a large number of heteroatoms such as N, S, and O which have significantly higher inhibition efficiencies compared to structures contain one type or a small number of heteroatoms. Among the identified compounds, 2-(2-(4-chlorophenyl)1H-benzo[d]imidazol-1-yl)-N-(3,5-dimethylphenyl) acetamide (CBIN-2), (2FPDC), and (4FPDC) compounds, all of which contain a number of heteroatoms and a phenyl ring, demonstrated superior inhibition performance when compared to other inhibitors.

Table 9 Comparison of the inhibition efficiency of 2FPDC and 4FPDC with some other organic inhibitors studied in Mild steel /1 M HCl solution

3.8 The Cost Comparison with Other Inhibitors Having Same Efficiency

Both (2FPDC and 4FPDC) inhibitors were synthesized with 2-fluorophenyl isothiocyanate (CAS Number: 38985-64-7) and 4-fluorophenyl isothiocyanate (CAS Number: 1544-68-9) from thiosemicarbazide (CAS Number: 79-19-6), which is a lower-cost commercial compound. In overall, these inhibitors are less expensive than other compounds like 8-hydroxyquinoline derivatives (CAS Number: 148-24-3, CAS Number 106-93-4, CAS Number 109-64-8), benzodiazepine derivatives (CAS Number 28981-97-7), and oxazole derivatives (CAS Number 288-42-6) [62]. Some laboratory synthesized compounds are hard to acquire at the present, but their wide industrial application still has a big challenge. However, we continue to believe that organics can become increasingly cheap, so compounds that currently seem expensive still have great application potential in the field of anticorrosion [94].

4 Conclusion

Herein, 2-fluoro phenyl-2, 5-dithiohydrazodicarbonamide (2FPDC), and 4-fluoro phenyl-2, 5-dithiohydrazodicarbonamide (4FPDC) as new heteroatom compounds were fabricated and their molecular structures were identified by Fourier transform infrared spectroscopy (FT-IR) and 1H, 13C nuclear magnetic resonance (NMR). They were researched and compared to their quantum chemical measurements for inhibition capacity for corrosion of the mild steel in 1 M HCl. The following conclusion can be drawn according to the collected data:

  • Both compounds (2FPDC and 4FPDC) appeared to be excellent corrosion inhibitors. However, 4FPDC was found to be better than 2FPDC (IE = 97.3% in comparison with 96.5% at an immersion time of 5 h, respectively).

  • The Langmuir adsorption isotherm type of adsorption showed that the type of adsorption was physisorption and chemisorption in both compounds.

  • Scanning electron microscope (SEM), energy-dispersive X-ray spectroscopy (EDX), and atomic force microscope (AFM) results confirmed the presence of molecules of inhibitor on the surface of the mild steel with smooth surfaces in the presence of inhibitors.

  • The distributions of the EHOMO and ELUMO revealed that the examined compounds are adsorbed by the active centres sulphur and nitrogen atoms as well as the π electrons of the phenyl ring.

  • The density function theory (DFT) calculations, Monte Carlo simulation (MC), and molecular dynamics (MD) simulations are compatible with experimental results.