1 Introduction

Corrosion is an electrochemical process that returns metals or metal alloys to their oxide state, resulting in the most thermodynamically stable forms. Although corrosion cannot be completely prevented, some methods can be used to control it. These methods include design control, alloy selection, overdesign, cathodic protection, organic coatings, inorganic coatings, or plating [1]. Organic coatings are widely used for their versatility, affordability, and effectiveness in protecting metals and alloys from corrosion. Traditional coating systems offer protection through different techniques such as active, sacrificial, and barrier (corrosion inhibitors). Organic conductive polymers have gained attention as a new approach for anti-corrosion due to their availability and environmental friendliness [1]. These polymers have numerous applications in the field of anti-corrosion for both ferrous and non-ferrous materials and have been used in various fields such as sensors and batteries [2,3,4,5,6,7,8]. The conductive polymers are applied to metal substrates as coatings or inhibitors to prevent corrosion [9]. The relationship between corrosion resistance and polymer structural characteristics has been studied by researchers [10]. Some polymers, such as polyanilines, polythiophene, and polypyrrole, have active electrons or vacant orbitals that can provide or receive electrons, thus reducing the damaging effects of corrosion on the metal surface. Besides the anti-scratch function of the organic coating to satisfy the aesthetic purpose, Organic coatings are widely used for their versatility, affordability, and effectiveness in protecting metals and alloys from corrosion [11,12,13,14,15]. The present study focuses on the use of a synthesized monomer that was electro-polymerized on a carbon steel surface using cyclic voltammetry [16]. The polymerization process and kinetic parameters were estimated and explained. The study also evaluates the anti-corrosion activity of the polymer layer on C.S in a 3.5% NaCl solution at various temperatures. This study provides a brief overview of the use of synthesized and natural organic compounds as corrosion inhibitors and explains the role of polymers in preserving metals from corrosion.

2 Experimental Part

2.1 Synthesis of 4-((1-(4-aminophenyl) ethylidene) amino)-1,5-dimethyl-2-phenyl-1,2-dihydro-3H-pyrazole-3-one (1)

In the first step, the Schiff base was prepared from the reaction of amino antipyrine with amino acetophenone, where 0.01 mol of 4-aminoacenophenone was placed in a 250 mL round bottom flask after dissolving it with absolute ethanol, and three drops of glacial acetic acid were added and heated with stirring after adding 0.01 mol of 4-amino antipyrine dissolved in absolute ethanol in the form of batches with stirring and the mixture was kept in reflux for six hours to produce the corresponding Schiff base.

2.2 Synthesis of 4-((4-(-1-((1,5-dimethyl-3-oxo-2-phenyl-2,3-dihydro-1H-pyrazole-4-yl) imino) ethyl) phenyl) amino)-maleiamic acid (2)

The reaction of the Schiff base (1) with maleic anhydride was carried out using 0.01 mol of each reactant, dissolved in acetone as a solvent. The mixture was stirred at room temperature for 3 h, leading to the formation of a precipitate. The precipitate was then filtered and washed with acetone to obtain the final product, amic acid.

2.3 Synthesis of 1-(4-(1-((1,5-dimethyl-3-oxo-2-phenyl-2,3-dihydro-1H-pyrazole-4-yl) imino) ethyl) phenyl)-maleimide (3)

The synthesis of maleimide (3) involves the dehydration of an amic acid using acetic anhydride and anhydrous sodium acetate. The reaction takes place over a three-hour reflux in a water bath, after which the solution is poured over crushed ice to precipitate the imide. The imide is then filtered and washed with sodium bicarbonate solution, distilled water, and ether, before being dried. Scheme 1 illustrates the steps involved in this process [17].

Scheme 1
scheme 1

Synthesis route of Schiff base monomer (3)

2.4 Electrochemical Polarization Technique

The setup for the potentiostat experiment involves several components including a host computer, a potentiostat, a thermostat, a Matlab program, a magnetic stirrer, and a galvanostat. The electrochemical corrosion cell uses a Pyrex cell with a 1-L capacity and three electrodes–an auxiliary electrode (platinum wire, 10 cm long), a working electrode (carbon steel coated with polymer), and a reference electrode (Ag/AgCl). To obtain the steady-state open circuit potential (Eocp), the working electrode is submerged in a 3.5% NaCl solution for 15 min. Electrochemical measurements are then conducted in a potential range of ± 200 mV over a temperature range of 298–318 K. The chemical composition of the carbon steel used as the working electrode is shown in Table 1.

Table 1 Chemical composition of C.S

3 Results and Discussion

3.1 Electrochemical Polymerization (Cyclic Voltammetry) for Monomer

The cyclic voltammograms of the sweeps were determined through the electrochemical polymerization of monomer (3) on the C.S electrode (working electrode) from an aqueous solution containing (0.2) g of this monomer dissolved in (200) ml of Dimethylsolfoxide (DMSO), with a potential range from (− 2000 to 2000) mV and scan rate (10) mV for five cycles versus silver-silver chloride electrode plotted in Fig.  1. At (− 1500) mV in the initial anodic sweep, monomer oxidation starts. After the nitrogen atom in the monomer has one electron removed, the peak is made up of free cation radicals. To create a polymer, the radicals underwent further interactions with either monomer molecules or other radicals. The reverse scan revealed a cathodic peak at (1000) V, which is attributable to dimer disintegration or film hydrolysis. A pair of redox peaks at (500) mV in the subsequent cycle signify the formation of the polymer film. As the number of cycles increases, the current density corresponding to the free radicals’ redox peak continuously decreases, indicating that the growth of the polymer film inhibits free radicals from being converted [18].

Fig.1
figure 1

Cyclic voltammogram for electrochemical polymerization for monomer (3)

3.2 Fourier Transform Infrared Spectroscopy (FTIR) for Monomer (3) and Polymer

The FTIR spectrum data of compounds and polymers are shown in Table 2, and from these data, it can be observed that there is a difference in bands between the prepared compounds. In compound (1), the main bands are imine and amine bands at (1631) cm−1 and (3269) cm−1, respectively. In compound (2), new bands appear, including carboxylic acid and amide bands at (1669) cm−1 and (1677) cm−1. The change in the FTIR chart when compound (3) is prepared is the disappearance of amide and carboxylic bands and the appearance of new imide absorption bands at (1780, 1720) cm−1. Finally, polymer formation gives new multi-bands for aliphatic (C–H) bands, which appear in the range of (2848–2980) cm−1 [19].

Table 2 FTIR data for monomer (3) and polymer

3.3 Corrosion Measurement

The results of the assessment of the corrosion parameters are shown in Table 3 and Fig. 2. The extrapolation of the cathodic and anodic Tafel in the absence and presence of inhibitor molecules in the HCl solution was used to determine the corrosion current density (icorr) and corrosion potential (Ecorr). From Fig. 2, the anodic (ßa) and cathodic (ßc) Tafel slopes were also calculated. Table 2 provides data on the corrosion potential Ecorr (mV), corrosion current density icorr (A/cm2), cathodic and anodic Tafel slopes c and an (mV/Dec), weight loss WL (g/m2.d), penetration loss PL (mm/y), and inhibition efficiency IE%. The protection efficiency (%PE) was calculated using the following equation [20]:

Table 3 Corrosion parameters for uncoated and coated C.S with polymer in 3.5% NaCl
Fig. 2
figure 2

Tafel plot for uncoated and coated C.S with polymer

$$\mathbf{\%}\mathbf{P}\mathbf{E}=\frac{\left({\varvec{i}}{\varvec{c}}{\varvec{o}}{\varvec{r}}{\varvec{r}}\right){\varvec{o}}-({\varvec{i}}{\varvec{c}}{\varvec{o}}{\varvec{r}}{\varvec{r}})}{({\varvec{i}}{\varvec{c}}{\varvec{o}}{\varvec{r}}{\varvec{r}}){\varvec{o}}}\boldsymbol{*}100$$
(1)

A Tafel plot is a graph that plots the logarithm of the current density (icorr) against the electrode potential (Ecorr). The shift of Ecorr towards a lower position for coated carbon steel with a polymer film compared to uncoated carbon steel indicates that the polymer film acts as cathodic protection, meaning it provides a reduction in the rate of corrosion by suppressing the reaction of the metal with the environment [21]. The increase in icorr with increasing temperature suggests that corrosion protection becomes less effective at higher temperatures. The good protection efficiencies of the polymer film are attributed to its hydroxyl groups, aromatic ring, and oxygen atom, which form a complex with the metal and adsorb on the surface of the alloy, thus protecting it from corrosive media.

3.4 Temperature Effect on the Corrosion of C.S

The Arrhenius equation and the transition state (Eyring) Eq. (2) are used to calculate the activation energy of polymers and the influence of temperature on the corrosion current density [22]. The Arrhenius equation describes the relationship between the rate of a chemical reaction and temperature, while the transition state (Eyring) Eq. (3) takes into account the changes in entropy and enthalpy that occur during the reaction. These equations can be used to calculate the activation energy (Ea), the entropy of activation (∆So), and the enthalpy of activation (∆Ho):

$$Log icorr=LogA-Ea/2.303RT$$
(2)
$$Log\frac{icorr}{T}=Log \left[\frac{R}{Nh}+\frac{\Delta S}{2.303R}\right]-\frac{\Delta H}{2.303RT},$$
(3)

where T is the temperature, R is the ideal gas constant, h is Planck’s constant, and N is Avogadro’s number. The slope of the fitted lines in Fig. 3A provides the values of the activation energy (Ea). The values of Ea are listed in Table 2. A higher value of Ea indicates a greater barrier between the responses of the corrosion system and the substrate, indicating the strong blocking capacity of the polymer film. The table shows that the Ea value of the polymer film is double that of the basic substrate, demonstrating its strong blocking capacity. Additionally, the entropy of activation (∆So) and the enthalpy of activation (∆Ho) can be calculated using the slope and intercept of the transition state diagram in Fig. 3B. A larger absolute value of ∆So during activation indicates that there is less disorder, and it may therefore be assumed that chloride ions (Cl) are tightly confined on the surface of bare steel as in Table 4.

Fig. 3
figure 3

A Arrhenius and B transition state plots for uncoated and coated carbon steel in 3.5% NaCl

Table 4 Transition state thermodynamic parameter at different temperatures for the corrosion of uncoated and coated C.S with a polymer film

4 Modelling Methods

The density functional theory (DFT) is a computational method that can predict the geometric and chemical properties of inhibitors. This method uses quantum mechanics to describe a system’s electronic structure and energy. The chemical structure and name of the inhibitor can be seen in Fig. 4. The calculations were performed at the B3LYP level with the 6-311 G (d, p) basis set [23]. The Gaussian 09 package and GaussSum software were used for the calculations [24]. These tools allow for the prediction of the geometric and chemical properties of inhibitors, providing valuable information for understanding their behaviour and potential efficacy in corrosion protection.

Fig. 4
figure 4

Two–Three-dimension structure of the compound

4.1 The Activity of Molecular

Through the adsorption centers of the inhibitory materials, the focal locations of interactions between metal surfaces and molecules can be predicted using frontier orbital theory [25]. For example, the term “Frontier Molecular Orbital” (FMO) may explain why stabilization energy is inverse to the difference in orbital energy between the highest and the low. The electron transfers ability of an inhibitor (EHOMO) is often connected to the EHOMO of the molecule, with the inhibitors having high EHOMO favouring acceptors with low EHOMO. The lower the LUMO energy (ELUMO) value, the greater the molecule’s capacity to receive the ELUMO energy. The energy gap (Eg) between the Frontier orbitals improves the inhibitor efficiency by decreasing the gap energy of the inhibitor molecules’ quantum chemical parameters, such as the highest occupied molecular orbital (EHOMO), the energy of the lowest unoccupied molecular orbital (ELUMO), the energy gaps between these orbitals, dipole moments, and electron affinity is another critical factor in characterizing the molecular activity. Koopman’s theorem uses the following equations to calculate the inhibitor's ionization potential (IE) and electron affinity (EA) [26, 27].

$$IE=-{E}_{HOMO}$$
(4)
$$EA=-{E}_{LUMO}$$
(5)

Hardness (η) is the second derivative of the E, which assesses the molecule stability and reactivity [28].

$$ \eta \, = \,\left( {\frac{IE\, - \,EA}{2}} \right) $$
(6)
$$X=\left(\frac{IE+EA}{2}\right)$$
(7)

Global softness (S) is the polar opposite of global hardness (η) [29].

$$ S\, = \,\left( {\frac{1}{\eta }} \right) $$
(8)

Parr’s global electrophilicity indices are constructed using Eq. 4 (χ) [30] using the characteristics of electronegativity and chemical hardness. Electrophilicity and nucleophilicity are often equated as a sign of quality in chemistry [31]. This is seen in Table 2 by the high (2.61725 eV) value, which suggests higher corrosion inhibition.

$$ {\upomega }\, = \,\left( {\frac{{\mu^{2} }}{2\eta }} \right) $$
(9)

There are a lot of high and low-performance inhibitors out there; EHOMO, μ, EA, S, ω, ELUMO, ΔE, IE, η, and χ. Table 2 and 3 provide an overview of various parameters.

Based on these results, the inhibitor is good (Table 5). This investigation was performed in a vacuum.

Table 5 DFT is used to figure out some of the molecules’ physical properties at the equilibrium geometries

4.2 Active Sites of Molecules

The optimal structures and active adsorption sites of the compounds were determined through theoretical investigations. The results are shown in Fig. 5, where green and red colours represent the HOMO (donor electron orbital) and LUMO (acceptor electron orbital), respectively. These colours indicate the optimum structures of the compounds and how they interact with metals. The most likely method of interaction between the compound's molecular orbitals and metals is through electron donation from donor orbitals to acceptor orbitals or electron acceptance from occupied donor orbitals. The heteroatoms (O, N) in the compound with high electron density also play a role in this interaction. The density of states (DOS) was calculated based on the presence of a self-consistent density in the working directory [32], as shown in Fig. 5. It presents the HOMO and LUMO orbitals by easy lines to understand the different of energy. This information helps to understand the behaviour of the compounds and their potential effectiveness as corrosion inhibitors.

Fig. 5
figure 5

Molecular orbitals of the studied compound and diagrams of filling states in Gaussian DOS for HOMO and LUMO

4.3 TED Maps

The commonly referred to as “total electron density” (TED). The colour red denotes the most repulsive electronegativity of the O atom in the compound structure, which indicates an electrophilic assault as in Fig. 6. Because of the best positive region in the blue area, electrons from the donor molecule can be received there [33, 34]. The electrostatic surface potential directs the adsorption of molecules onto the metal surfaces.

Fig. 6
figure 6

TED maps of studied inhibitor

5 Conclusion

The density functional theory (DFT) and polarization techniques were applied to study the polymer layer. The results showed that temperature increases both the corrosion potential (Ecorr) and the corrosion current density (icorr). The movement of the corrosion potential (Ecorr) of the coated C.S. to a lower position compared to that of the uncoated C.S. suggests that the polymer layer functions as cathodic protection. Additionally, the activation parameters and the positive value of ∆Ho indicate that the corrosion process is endothermic, which means that it requires energy input. The DFT parameters also indicated that the polymer has the highest inhibitory effect among the studied materials, demonstrating its potential effectiveness in corrosion protection.