1 Introduction

There are many uses for copper in different industries because it is an ideal conductor of electricity and heat and has other properties that make it a perfect mineral for use in various fields [1]. Copper is usually cleaned with acids to produce its properties as efficiently as possible, which causes corrosion of its surface, resulting in heavy economic losses [2]. Organic compounds are among the most effective ways of protecting from corrosion [3, 4]. These compounds adsorb to the surface of metals, which inhibits anodic and cathodic processes, thereby reducing metal dissolution. Besides deterioration in acidic media and hydrogen gas formation, copper has high positive potential because of its high corrosion resistance [5, 6]. By removing dissolved oxygen from acidic media, copper can be protected. Various researches yielded a good number of organic compounds used as corrosion inhibitors owing to the existence of N, S, and O atoms and double bonds in them. Heterocyclic compounds are the most important of these compounds. Recently, heterogeneous organic compounds containing N, S, and O atoms have occupied the interest of researchers to find copper corrosion inhibitors in various acid solutions. These compounds are of great interest due to their adsorption properties and the creation of an oxide layer on the metal surface [7, 8].

Additionally, we need to consider the presence of benzene radicals, the charge density, the molecular weight of the inhibitors, and the type of adsorption when choosing an inhibitor. Among the many compounds of essential origin [9] containing the 2-pyridone e structure, many possess biological activity, making their derivatives particularly potent as antibacterial and antifungal [10, 11]. There are many applications for 2-pyridone e derivatives, including paints, pigments, fuel and lubricant additives, acid–base indicators, and stabilizers for polymers and coatings [12, 13]. The novelty of our study aimed to develop new and effective copper corrosion inhibitor compounds in HCl. Two pyridone inhibitors (6-amino-1-(4-hydroxyphenyl)-4-(4-methoxyphenyl)-2-oxo-1,2-dihydropyridine-3,5-dicarbonitrile (PYR-2) and 6-amino-1-(4-hydroxyphenyl)-2-oxo-4-phenyl-1,2-dihydropyridine-3,5-dicarbonitrile (PYR-3)) were used in our research. Electrochemical methods such as PP and EIS were employed to confirm their efficiency in blocking adsorption by investigating the kind and mode of adsorption on the copper surface. Density functional theory calculations and Monte Claro simulations were also used to support the experimental findings.

2 Experimental

2.1 Materials

Copper samples were utilized to conduct experiments, which were injected in Teflon, and the gap between the surface of the copper and Teflon was filled with epoxy. Saturated calomel (SCE), platinum (Pt) sheet, and as a counter, reference, and working electrode, copper metal was used. AnalaR grade of HCl (35%) was diluted with bi-distilled water to prepare corrosive solutions.

2.2 Inhibitors preparation

2.2.1 Synthesis of 6-amino-1-(4-hydroxyphenyl)-4-(4-methoxyphenyl)-2-oxo-1,2-dihydropyridine-3,5-dicarbonitrile (PYR-2)

6-amino-1-(4-hydroxyphenyl)-4-(4-methoxyphenyl)-2-oxo-1,2-dihydropyridine-3,5-dicarbonitrile to a solution of the 2-(4-methoxybenzylidene)malononitrile (0.36 g, 2 mmol) in EtOH (20 mL) was added the acetamide 1 (0.35 g, 2 mmol). The heat was applied to the reaction mixture, which included a few drops of piperidine, and it remained in this state, under reflux, for 2 h. A pale yellow powder with a yield of 87% and a melting point (m.p) of 212–215 °C were obtained after collecting the solid product via filtering, washing it with EtOH, and crystallizing it from (3:1) absolute ethanol: DMF mixture.

2.2.2 Synthesis of 6-amino-1-(4-hydroxyphenyl)-2-oxo-4-phenyl-1,2-dihydropyridine-3,5-dicarbonitrile (PYR-3)

The acetamide 1 (0.35 g, 2 mmol) and a few piperidine drops were added to a 2-benzylidene malononitrile solution (0.30 g, 2 mmol) in EtOH (20 mL) as shown in Fig. 1. For 2 h, the reaction mixture was subjected to reflux heating. The solid product was filtered, rinsed with EtOH, and crystallized from an ethanol/DMF solution, (4:1) mixture to obtain a pale yellow powder with 85% purity and an m.p of 212–215 °C.

Fig. 1
figure 1

Synthesis of pyridone derivative compounds (PYR-2 and PYR-3)

2.3 Electrochemical tests

Before the quasi-steady state can be studied, the copper electrode must first be dipped in hydrochloric acid at the open-circuit voltage (OCP). Using frequencies of 105–10−2 Hz and an AC sine wave of 10 mV at (OCP), the (EIS) results were conducted [14, 15]. Next, the following equation was used to determine the efficiency of the two compounds:

$$\mathrm\eta\%=0\times100=\left(\frac{{\mathrm R}_{\mathrm c\mathrm t}-\mathrm R_{\mathrm c\mathrm t}^\circ}{\mathrm R_{\mathrm c\mathrm t}}\right)\times100$$
(1)

Rct,0 and Rct are charge-transfer resistances of uninhibited and inhibited copper, respectively. In addition to EOCP, the PP was conducted at 0.2 mV/s within a ± 250 mV concerning corrosion potential. Our relevant ƞ values were computed by employing the equation:

$$\mathrm\eta\%=0\times100=\left(\frac{\mathrm i_{\mathrm c\mathrm o\mathrm r\mathrm r}^\circ-\mathrm i_{\mathrm c\mathrm o\mathrm r\mathrm r}}{\mathrm i_{\mathrm c\mathrm o\mathrm r\mathrm r}^\circ}\right)\times100$$
(2)

icorr,0 and icorr mean current density values in the lack and the existence of the protection of compounds, respectively. With a computer monitor attached to Potentiostat/Galvanostat/ZRA, a Gamry framework system based on the ESA 400 is included. Gamry applications include the DC105 polarization software and the EIS300 EIS program. For charting, graphing, and fitting data, the Echem Analyst 6.03 program was used. All the tests carried out at R.T. Triplicate experiments were performed under identical conditions to ensure the consistency of the results. Before beginning any measurements, the electrode potential to was waited 30 min to settle.

2.4 Calculation details

Gaussian 09 W software was used to calculate the DFT. Based on a 6–311 +  + G basis set (d, p), the derivatives of pyridone molecules were optimized using the B3LYP method [16]. A detailed analysis of the parameters of quantum chemicals (HOMO and LUMO) was conducted based on the highly and lightly occupied and unoccupied orbitals (HOMO and LUMO) [17]. A Forcite unit from Accelrys Inc. in England was used during the molecular dynamic (MD) simulation. Using a copper box, we simulated and determined its interaction with the adsorbed molecules. This process was carried out in the presence of only one molecule of the inhibitor with 250 molecules of water on the copper surface by adsorption Locator modulus, where the binding energy was calculated through the following equations:

$${E}_{\mathrm{interaction} }={E}_{\mathrm{tot}}-\left({E}_{\mathrm{subs}}+ {E}_{\mathrm{pyridon}}\right)$$
(3)
$${E}_{\mathrm{binding}}= - {E}_{\mathrm{interact}}$$
(4)

Esubs is the total energy of Cu(110) and H2O molecules, Epyridone represents free inhibitor energy, and Etot represents the total energy of the whole system.

2.5 SEM

The surface of the mechanically polished original Cu sample was identified using SEM and the surface of the Cu samples that had been naturally immersed in the solution for 5 h. Three copper pieces were immersed in hydrochloric acid alone (blank 1M HCl) and another in HCl 1M with 18 × 10−5 M of PYR-2 and the last piece in 1M HCl with18 × 105 M of PYR-3 for 5 hours in this experiment.

3 Results and discussion

3.1 Structure elucidation of compounds (PYR-2 and PYR-3)

3.1.1 FTIR of compound (PYR-2)

Figure 2 depicts the IR (KBr): υ/cm−1 = 3384 (OH), 3313 (NH2), 2216 (C≡N), and 1670 (C = O).

Fig. 2
figure 2

FTIR spectroscopy of compound PYR-2

3.1.2 1HNMR of compound (PYR-2)

Figure 3 depicts the 1H NMR (DMSO-d6): δ 3.85 (s, 3H, OCH3), 6.91–7.51 (m, 8H, Ar–H), 7.64 (s, 2H, NH2), and 9.82 (s, 1H, OH).

Fig. 3
figure 3

1H-NMR spectrum of compound PYR-2

3.1.3 Mass spectroscopy of compound (PYR-2)

Figure 4 depicts MS m/z (%): 359 (M + +1, 17.76), 258 (M+, 37.90), 339 (25.40), 331 (13.73), 313 (16.21), 295 (09.32), 264 (15.81), 105 (19.27), 91 (24.41), 85 (34.25), 55 (78.51), and 43 (100.00).

Fig. 4
figure 4

Mass spectroscopy of compound PYR-2

3.1.4 FTIR analysis of compound (PYR-3)

Figure 5 depicts the IR (KBr): υ/cm−1 = 3380 (OH), 3305 (NH2), 2212 (2C≡N), and 1672 (C = O).

Fig. 5
figure 5

FTIR spectroscopy of compound PYR-3

3.1.5 1HNMR of compound (PYR-3)

1H NMR (DMSO-d6): δ 6.92–7.57 (m, 9H, Ar–H), 7.79 (s, 2H, NH2), 9.91 (s, 1H, OH) Fig. 6.

Fig. 6
figure 6

1H-NMR spectrum of compound PYR-3

3.1.6 Mass spectroscopy (PYR-3)

MS m/z (%): 328 (M+, 12.75), 310 (18.00), 296 (22.35), 275 (25.78), 262 (33.96), 199 (18.51), 162 (27.43), 119 (42.04), 105 (40.73), and 91 (100.00) Fig. 7.

Fig. 7
figure 7

Mass spectroscopy of compound PYR-3

3.2 PP tests

Most PP diagrams between voltage and current assume that inhibitors are adsorbed on the metal's surface to prevent corrosion. Various concentrations of pyridone derivatives compounds were used to immerse copper in hydrochloric acid for up to 10 min. In Figs. 8 and 9, Tafel diagrams were recorded [18]. At the same time, OCP was stable. Compound PYR-2 exhibited the highest ƞ%. In Table 1, it was observed that the potential corrosion deviation was less than 85 millivolts, thus proving that the compound is a mixed type [19, 20]. Additionally, the figure showed that the compound worked by preventing hydrogen from spreading on the surface of copper due to the reaction at the cathode. In addition, these results showed that compound PYR-2 has a more significant effect on inhibiting copper corrosion in HCl than compound PYR-3. According to Figs. 8 and 9, increased concentrations of pyridone derivatives inhibit the anodic corrosion of Cu electrodes. Moreover, pyridone derivatives suppress cathodic reactions less than anodic reactions when present. βa values obtained using pyridone derivatives are higher than those obtained using a blank due to reduced anodic dissolution and hydrogen evolution reactions delayed by pyridone derivatives [21]. The anodic reactions on metal surfaces are controlled by pyridone derivatives, which suppress oxidation.

Fig. 8
figure 8

Plots of PP of Cu dissolution with and without different doses of compound PYR-2

Fig. 9
figure 9

Plots of PP of Cu dissolution with and without different doses of compound PYR-3

Table 1 PP parameters of Cu in 1 M HCl in the lack and existence of numerous doses of compounds PYR-2 and PYR-3

3.3 EIS tests

In Figs. 10 and 11, pyridone derivatives inhibit copper corrosion in hydrochloric acid to show the Nyquist plot impedance behavior at room temperature. In Figs. 10 and 11, we see that two circles are incomplete: The first one was related to charging transfer at high frequencies, while the other was due to the formation of the adsorbed layer on copper from pyridone derivatives at low frequencies, appearing as a large ring [22]. A solution of chlorinated ions diffuses towards the positive copper electrode, forming [CuCl, CuCl2], and then the obstruction is gradually dissolved when pyridone derivatives are added. Adding pyridone derivatives gradually increases the loop’s radius, as does add more pyridone derivatives [23]. There was a significant reduction in the migration of negative chloride ions on the copper surface owing to forming of a pyridone derivatives layer on the copper surface. Also, double layer capacitance (Cdl) was computed by employing the equation:

Fig. 10
figure 10

The Nyquist (a) and bode (b) plots for dissolution of Cu in 1.0 M HCl without and with various doses of the compound PYR-2

Fig. 11
figure 11

The Nyquist (a) and bode (b) plots for dissolution of Cu in 1.0 M HCl without and with various doses of the compound PYR-3

$${C}_{dl}= {Y}_{o}{{(2\pi f}_{\mathrm{max}})}^{n-1}$$
(5)

Y0 and fmax are the CPE and frequency magnitude at which the imaginary component of the impedance reaches the maximum value, respectively. In n = α/(π /2), n is an adjustable factor, and α is the phase angle [24, 25]. Cdl equivalents which appear in Tables 2 and 3, decrease with increasing pyridone derivative doses, which can be attributed to either a decrease in the dielectric constant value or to the double layer or to the adsorption layer, which has become, to a large extent, thick.

Table 2 EIS data for the corrosion of Cu in 1.0 M HCl in the lack and existence of numerous doses of compound PYR-2
Table 3 EIS data for the corrosion of Cu in 1 M HCl in the lack and existence of numerous doses of compound PYR-3

3.4 Adsorption isotherm

We need to do adsorption isotherms to understand why copper is affected by the inhibitor on its surface. In testing several isotherms for pyridone compounds adsorbing on copper surfaces, we found that the Freundlich isotherm fitted the best [26]. ACR-2 and ACR-3 molecules adsorb in 1.0 M HCl solutions with correlation coefficients and slopes close to 1, indicating Freundlich adsorption isotherms. The Kads values could be determined from the intersections of the lines on the Ɵ-axis, and Kads was related to the standard free energy of adsorption ∆Goads. The quantity of material adsorbed (Ɵ) is linked to the dose (C) by the equation:

$$\uptheta =k{C}^{n}$$
(6)

The plot of log θ versus log C is a straight line with ‘n’ as the slope which depicts in Fig. 12; the free energy of adsorption ΔGoads for numerous doses of inhibitor at various temperatures was computed by employing the equation:

Fig. 12
figure 12

Freundlich isotherm for the compound A on Cu surface in 1 M HCl at various temperatures

$${\Delta Go}_{ads}= -RTln\left(55.5 \times K\right)$$
(7)

In K = θ/C (1-θ), θ is surface coverage, and Cinh is the dose of inhibitor.

The literature shows that the value of ∆Gads every time it is higher than − 20 kJ/mol or less negative means that the charges are attracted and the inhibitor was adsorbed physically to the surface [27]. The difference between the two, if it is more negative than − 40 kJ/mol, means that the inhibitor is chemically adsorbing onto the surface of Cu [28]. The value of ∆Gads for inhibitor PYR-2 is − 16.3 kJ/mol and inhibitor PYR-3 is − 13.2 kJ/mol, indicating that two inhibitors were physically adsorbed on the copper surface and the reaction is spontaneous. Figure 13 indicates the relation between logkads on y-axis and 1000/T on x-axis which calculated the ∆H from the slope. Also, the reaction is exothermic because the ∆H value is negative [29]. The enthalpy values resulting from electrostatic interactions between charged molecules and charged metal (physisorption) range up to 41.9 kJ mol − 1, whereas those, resulting from chemisorption, range up to about 100 kJ mol − 1. Physisorption produces molecules with small absolute enthalpy values. In the presence of the investigated compounds, ∆S°ads values are large and negative, indicating the increase in the ordering on the copper surface [30, 31].

Fig. 13
figure 13

Plot of variation of Log Kads vs. 1000/T for the adsorption of numerous doses of compounds PYR-2 and PYR-3 on the Cu surface in 1 M HCl at various temperatures

3.5 Molecular modeling

Figure 14 depicted the optimized structure, electrostatic potential (ESP) map, and HOMO and LUMO density distributions of PYR-2 and PYR-3, respectively. In HOMO sites, the red color represents a high electron density; while in LUMO sites, the green color represents a low electron density. Having a high electron density allows the metal surface to donate electrons. Electrons are received by the metal surface in the green area [6]. This means that it is extremely important to consider how these two areas are distributed. For testing the effect of molecular structure on the performance of corrosion inhibitors, DFT was used to obtain optimized molecular geometries. A molecule model was developed using Gauss View 2009, and a DFT calculation was performed using the basis set 6-31G (d). A detailed calculation method is described elsewhere, including quantum chemical parameters [32, 33]. The electron-donating properties of molecules and surfaces play a significant role in understanding how inhibitors interact with metallic surfaces. Dipole moments are used to measure the polarity of molecules. Their polar functional groups interact with metal surfaces, causing inhibitor molecules to adsorb on them [34]. The ESP map shows the electrophilic and nucleophilic activity corresponding to the positive and negative regions. In theory, the metal acts as an electrophilic agent, creating strong covalent bonds between the atoms of the inhibitor, especially those containing heterogeneous atoms and those with electronegative and nucleophilic centers [35]. Compound PYR-2 can easily form covalent bonds to the copper surface, as shown in the (ESP) map, because the positive and negative zones are deeper in compound PYR-2. As we noted in Table 4, we also measured EHOMO and ELUMO values, which tell us whether the compound can give or receive electrons [36]. As we can see from the table, compound 1 has a greater EHOMO value than compound PYR-3, suggesting that compound PYR-2 is better able to give electrons off than compound PYR-3, which implies that it will adsorb more on copper’s surface [37]. A lower energy gap (∆E) value in compound 1 than in compound PYR-3 indicates that compound PYR-2 is more chemically active on copper than compound PYR-3.

Fig. 14
figure 14

Optimized structure, HOMO, LUMO, and ESP map of compounds A and B

Table 4 Quantum parameters of compounds PYR-2 and PYR-3

3.6 MD simulation

To gain a deeper understanding of how inhibition works, we simulated between pyridone compounds and copper surfaces. Figure 15 shows the adsorption of compounds 1 and 2 formed on Cu. Figure 15 shows how compounds adsorb on copper’s surface horizontally, allowing electrons to move easily, forming covalent bonds, and increasing the binding energy between the compounds and copper [38, 39]. The adsorption energy value for compound PYR-2 is − 3050.8 but is − 3041.2 for compound PYR-3, indicating compound 1 inhibits the corrosion of Cu in 1.0 M HCl. Pyridone compounds and negative Eads indicate a strongly adsorbed Cu substrate. A greater amount of adsorption energy is obtained when Cu is diluted with HCl, making pyridone compounds more effective in protecting Cu. According to this theoretical analysis, all available data are accurate and support previous studies. Lastly, pyridone inhibitors offer great protection against corrosion. PYR-2 and PYR-3 Eads negative indicate that strong and spontaneous adsorption occurred on the copper substrate [40]. The results of Table 5 indicate that PYR-2 has greater adsorption energy than PYR-3, indicating it will perform better as an inhibitor for the protection of copper in 1.0 M HCl than PYR-3. This theoretical analysis supports previous studies and is accurate for all available data. Lastly, PYR-2 and PYR-3 inhibitors offer great protection against corrosion.

Fig. 15
figure 15

Adsorption of pyridone compounds on Cu surface

Table 5 Monte Carlo simulation parameters of adsorption of pyridone e compounds on Cu surface

3.7 SEM analysis

The surface characteristics investigation (SEM) for the Cu coupons immersed for 5 h in a solution of 1.0 M HCL solution in the lack and existence of the optimum concentration (18 × 10–5 M) of inhibitor 1 has been postulated in Fig. 16. From the SEM images as in Fig. 16a, it can be seen that the significant damage on the Cu surface was fulfilled with the corrosion product while, in Fig. 16b and c, after adding the optimum concentration of inhibitor 1, the Cu surface became more smooth [41, 42].

Fig. 16
figure 16

SEM images from Cu a before and b after soaking time for 1 h in the blank, and c in the 18 × 10−5 M inhibitor PYR-2 d in the 18 × 10−5 M inhibitor PYR-3 for 5 h

3.8 Mechanism of inhibition

The following reaction illustrates the mechanism of copper degradation at the anode:

$$\begin{array}{c}\mathrm{Cu}\to {\mathrm{Cu}}^{+}+{\mathrm{e}}^{-}\\ {\mathrm{Cu}}^{+}+{\mathrm{Cl}}^{-}\to \mathrm{CuCl}\end{array}$$

Then, Cl reacts with CuCl to form soluble CuCl2.

$$\begin{array}{c}\mathrm{CuCl}+{\mathrm{Cu}}^{-}\to {{\mathrm{CuCl}}_{2}}^{-}\\ {{\mathrm{CuCl}}_{2}}^{-}\to 2{\mathrm{Cl}}^{-}+{\mathrm{Cu}}^{2+}+{\mathrm{e}}^{-}\end{array}$$

The cathodic reaction in HCl occurs by the following reaction:

$${\mathrm{O}}_{2}+{4\mathrm{H}}^{+}+{4\mathrm{e}}^{-}\to 2{\mathrm{H}}_{2}\mathrm{O}$$

Thus, Cu overall corrosion reaction in HCl is:

$$2\mathrm{Cu}+{4\mathrm{Cl}}^{-}+{4\mathrm{H}}^{+}+{\mathrm{O}}_{2}\to 2{\mathrm{H}}_{2}\mathrm{O}+{2\mathrm{Cu}}^{2+}+{4\mathrm{Cl}}^{-}$$

This study suggests that the protonation of the NH2 on the investigated pyridone may have led to its solubility in water. Protonated compounds, however, can interact with metals through electrostatic interaction. It is also possible that pyridone could interact with d orbitals of Cu metal by lone pair e in O and N, or aromatic rings π e of Cu could also donate an electron to the vacant antibonding orbital of inhibitor molecules (reterodonation).

4 Conclusion

Experimental experiments proved the effectiveness of pyridone derivatives in inhibiting copper corrosion in 1.0 M HCl solution as mixed type inhibitors. A Langmuir adsorption isotherm was observed for these compounds upon adsorption onto copper surfaces, which correlated with the inhibition process. The presence of a negative value for ΔG0ads indicates spontaneity in the reaction. PYR-2 and PYR-3 exhibited increased inhibition strength when electrons were donated and gained from high-occupied orbitals (HOMO) to low-occupied orbitals (LUMO). The corrosion process depends on the relative ability of the compounds to donate electrons to the metal. In the end, the results were found to agree with the measurements. This study presents the possibility of using the economically and effectively protect Cu by pyridone inhibitors in HCl solution in the future.