1 Introduction

Aluminum is a non-ferrous metal widely used in food and packaging industry (Ref 1) and its protection in the HCl acid solution is critical due to the electrochemical behavior of aluminum in this solution, particularly regarding either the role played by the oxide layer or pitting corrosion due to the presence of chloride ions (Ref 2). Various mechanisms have been proposed to explain the breakdown of the passive film. When chlorides reach the metal–film interface, they degrade. It has recently been demonstrated that chloride does not enter the oxide film, but rather is chemisorbed onto the oxide surface and acts as a reaction partner, assisting dissolution via the formation of oxide–chloride complexes (Ref 3).

Inhibitors are one of several methods for protecting metals from corrosion. Some studies have shown that many compounds, including organic substances like Ocimum gratissimum (Ref 4), Sida acuta (Ref 5), Sarang extract (Ref 6), Ginkgo biloba extract (Ref 7), and inorganic compounds like epoxy/modified graphene oxide/glass fiber composite (Ref 8), polyaniline encapsulated α-zirconium phosphate (Ref 9), and polyaniline-titanium nitride composite (Ref 10) can be used as corrosion inhibitors for metals. Despite having a good inhibitory effect, some of the most commonly used inhibitors in the industry, such as chromates, are avoided due to the environmental consequences of their use. Because inhibitors are not compensable, their use is limited, and the use of environmentally friendly inhibitors is developing and expanding (Ref 11, 12). Green inhibitors are increasingly used for their biodegradability, biocompatibility, and safety (Ref 1). Because of their availability and lack of environmental hazards, plant extracts have been studied and used as green inhibitors to protect against the corrosion of many metals (Ref 13, 14). Organic inhibitors' corrosion protection of metals is commonly attributed to the formation of a protective film on the metal surface in contact with the corrosive environment. The inhibitor film formed on the metal surface inactivates the active metal sites that are prone to corrosion, protecting the metal from the corrosive environment. The adsorption of this film on the metal surface is affected by several factors, including the presence of elements such as N, S, O, and P, as well as the presence of aromatic rings. Raghavendra (Ref 15), and Desai et al. (Ref 1) in review papers studied various green compounds which have been investigated to control the corrosion of aluminum in HCl. Mendez et al. (Ref 16) studied corrosion behavior of aluminum in 0.1 M HCl under the effect of Ilex paraguariensis. Inhibition is enhanced with increasing the Illex paraguariensis concentration, while it is maintained with rising temperature. Thermodynamic studies revealed both physical and chemical adsorption which follows Langmuir isotherm. Yusef et al. (Ref 17) explored the inhibitory effect of honey and mint for aluminum corrosion in HCl using both theoretical and empirical methods. Both honey and mind acted as effective inhibitors. Honey performance was better than mint due to higher dipole moment. Hu et al. (Ref 18) used bio-macromolecule DNA for protection of X80 steel in 1 M HCl. Maximum inhibition effect of 91.9% was achieved at 308 K. Their findings show that DNA molecules behaved as a mixed inhibitor, which influenced both anodic and cathodic reactions. Deyab (Ref 19) reported a remarkable reduction in corrosion rate of copper in 0.1 M HCl using licorice extract. They found out licorice extract content, temperature, and extraction solvent solution as influential parameters to control the corrosion rate. The effect of rice straw extract on corrosion behavior of mild steel in acid was investigated by Mahross et al. (Ref 20). They proved rice straw extract is a mixed-type inhibitor, and adsorption follows Langmuir isotherm. Liu et al. (Ref 21) studied ZnO-doped-chitosan effect on corrosion of Q235. The results showed that ZnO doping increased inhibition efficiency from 67.7 to 99.6%. The observed reduction in the roughness of the surface was also indicative of the enhanced protection in the presence of ZnO. Lai et al. (Ref 22) synthesized chitosan-TiO2 nanocomposites as inhibitor for aluminum alloy in NaCl solution. Maximum inhibition efficiency of 94.5% was achieved and contact angle reached 120° due to hydrophobicity nature of the surface. Organic compounds have been found in the structure of plants with inhibitory properties, according to studies. It is obvious that not every organic compound is effective at inhibiting, but substances with aromatic rings are. The inhibitory mechanism of aromatic rings is that they form a film on the anodic and cathodic surfaces, slowing down cathodic reactions and metal dissolution (Ref 23).

Many inhibitors are proposed for Steel, Fe, Cu, or Al in HCl, H2SO4, or other acids (Ref 24) but there is a lack of studies about using Sumac extract as an inhibitor, despite its antioxidant activity. Sumac was utilized in medieval medicine to cure a variety of illnesses, particularly in Middle Eastern nations (where sumac was more readily available than in Europe). Archaeologists discovered commercial amounts of sumac drupes in an 11th-century shipwreck off the coast of Rhodes in the 1970 s. These might have been made to be used as medication, a culinary spice, or a coloring. Staghorn sumac is an excellent antioxidant (Ref 25).

Sumac has been used in cuisine for millennia as a spice. R. coriaria leaves, fruits, and seeds have been shown to contain a variety of Phyto-constituents. The presence of gallotannins (primarily hydrolysable tannins) is a distinguishing feature of the Rhus genus, particularly R. coriaria species, which is a rich source of tannins of various isomers and conjugations; additionally, it contains other metabolites or phytochemicals that have been described in various parts of the plant (Ref 26, 27). Ardalani et al. studied the chemical properties of sumac fruit using the HPLC-MS method in Iran (Ref 28). They identified 191 compounds in sumac and classified them as 78 hydrolysable tannins, 59 flavonoids, 9 anthocyanins, 2 isoflavonoids, 2 terpenoids, 1 diterpene, and 38 other unidentified compounds. Anaee et al. (Ref 29) studied the inhibitory effect of sumac extract against steel corrosion in seawater. Their results proved sumac extract as an anodic inhibitor type, shifting corrosion potential to more noble values, and following Langmuir isotherm. Thermodynamic investigations revealed physiosorption nature of the interactions between the inhibitor molecules and the steel surface. Hijazi et al. (Ref 30) found sumac and its chemical constituent, Quercetin, behave as mixed type inhibitors for mild steel corrosion, with sumac being superior over Quercetin in protection behavior.

Sumac extract was chosen for this study to explore the inhibitory role of aluminum in the HCl medium. This work is an attempt to use sumac extract to inhibit aluminum in HCl medium at different temperatures on the surface of samples that were immersed in electrolytes with and without inhibitor (200 mg/L) for 24 hours at different temperatures. As a result, electrochemical methods (EIS, polarization) were employed in this study to investigate the inhibitory behavior of sumac extract on aluminum corrosion in a 1 M HCl acid medium. The enticing advantages of sumac extract are its cost-effectiveness, availability, inherent stability, and eco-friendliness.

2 Experimental Procedure

2.1 Preparation of the Metal Surface

The 6xxx series aluminum metal was used in this study. The chemical composition of aluminum used in this research includes 0.55 wt.% Mg, 0.35 wt.% Si, 0.14 wt.% Fe, 0.02 wt.% Ti, 0.1 wt.% Cr, and the balance is Al. Aluminum sheets were cut into 10 × 10 × 1 mm3 and then sandblasted to perform electrochemical tests and evaluate the inhibitory properties of sumac plant extract. Finally, the samples were polished for 10 min with alumina powder with an average diameter of 0.3 micrometers using a felt. After surface preparation, the samples were degreased with acetone and dried in the air after rinsing.

2.2 Preparation of Electrolyte and Inhibitory Extract

Merck Company's 37% hydrochloric acid was used as the corrosive electrolyte in this study. After preparing sumac extract, the desired acid was mixed with 1 molar hydrochloric acid in the concentrations of 0, 25, 50, 100, and, 200 mg/L, marked as S1, S2, S3, S4, and S5, respectively, and at three temperatures of 298, 308, and 318 K to evaluate the inhibitory effect of sumac extract.

After drying, the sumac plant was prepared and milled in an oven at 70 °C for three days. The powder obtained from dried sumac was mixed in a 10:1 ratio with 96% ethanol (10 units of alcohol, 1 unit of powder). The prepared mixture was stirred for three days at 55 degrees Celsius. Finally, the solution was twice filtered and the excess ethanol was evaporated. Because of the presence of alcohol in the powder, the remaining compound was viscous and contained moisture. To completely remove the alcohol from the powder, it was placed in an oven at 85 °C for three days, resulting in a dried powder. The sumac plant powder was mixed with various amounts of 1 M HCl solution. The flowchart showing the stages of sumac extract preparation is presented in Fig. 1.

Fig. 1
figure 1

Flowchart of sumac extract preparation

2.3 Electrochemical Test

Electrochemical studies have been conducted using flat cells manufactured by the EG & G company. The corrosive solution was applied to a 1 cm2 area of the cell surface. To stabilize the open circuit potential of the samples, they were immersed in the tested electrolyte for 24 h. The potentiodynamic polarization test and electrochemical impedance test (EIS) were carried out with the help of the Origa Flex OGF500 potentiostat. SCE was used as the reference electrode in this study, and platinum was used as the auxiliary electrode. The applied potential of ± 300 mV relative to the OCP potential was changed at a scavenging rate of 1 mV/S during the polarization test. To calculate the corrosion current density, the TOEFL line extrapolation method was used. In the EIS test, the frequency was changed from 10 mHz to 100 kHz with a range of 10 mv relative to the OCP potential. In order to reduce the error and increase the measurement accuracy, each electrochemical test has been repeated 5 times.

To calculate the inhibitory efficiency of the compound introduced in this study using the data of the potentiodynamic polarization test, Eq 1 has been used (Ref 31):

$$ \% {\text{IEEIS}} = \frac{{i_{0} - i_{{{\text{inh}}{.}}} }}{{i_{0} }} \times 100 $$
(1)

In this connection, i0 is the corrosion current without the inhibitor and iinh. is the corrosion current w in the presence of the inhibitor. The following equation is used to calculate the inhibitory efficiency using polarization resistance (EIS test data) (Ref 32]:

$$ \% {\text{IEPDP}} = \frac{{R_{{{\text{ct}}\left( {{\text{inh}}{.}} \right)}} - R_{{{\text{ct}}{.}}} }}{{R_{{{\text{ct}}\left( {{\text{inh}}{.}} \right)}} }} \times 100 $$
(2)

In this regard, Rct, is the polarization resistance without an inhibitor, and Rct(inh) is the polarization resistance in the presence of an inhibitor.

2.4 Characterization

To identify the bonds in the extract of the melon plant, FTIR analysis was performed using a device manufactured by Thermo company using the Avatar model.

To investigate the surface of the samples, they were immersed in electrolytes with and without inhibitor (200 mg/L) for 8 hours at different temperatures. The samples' surfaces were cleaned with a special brush, rinsed, and dried in the air twice with distilled water before the FE-SEM test (TESCAN-Mira 3) was performed. After immersing the samples in the test solution, the AFM test (Vecco-TT) was used to study the surface morphology of the samples.

In order to study the phases formed on the surface of the samples, XRD analysis was used. This analysis was conducted for the 200 mg/L sample and the blank sample after 1 h of immersion.

3 Results and Discussion

3.1 FTIR Analysis

Figure 2 depicts the FTIR spectroscopy results. The main adsorption occurred at 3425.26 cm−1 in the presence of the N-H bond, as shown in this figure. A peak at 2923.34 cm−1 indicates the presence of aliphatic C-H bonds (Ref 33). The carbonyl groups in esters (R-CO-O-R) and aldehydes are responsible for the peak of 1730.64 cm−1 (R-CO-H). N-H bonds are assigned the ultimate in 1623.04 cm−1. The presence of bonds related to C=O (Ref 16) is indicated by a maximum of 1693 cm−1. The peak of 1504.08 cm−1 is associated with C=N bonds or C=C aromatic rings. The presence of C-C group bonds is indicated by the peak at 1453.05 cm−1. The presence of (-OH)-related bonds is indicated by the peaks at 1373.65 cm−1 and 1240.04 cm−1. The presence of 1044 cm−1 groups indicates the presence of C-N compound bonds (Ref 34). According to these findings, sumac extract contains a combination of alkaloids and flavonoids (Ref 35). Furthermore, the presence of adsorption bonds less than 1000 cm−1 indicates that this plant extract contains aromatic (Aromatic) and aliphatic (C-H) groups. The presence of nitrogen and oxygen atoms, as well as aromatic rings, is revealed by FTIR analysis in the structure of sumac extract. One of the primary symptoms of common inhibitors is the presence of these bonds (Ref 25).

Fig. 2
figure 2

FTIR results for sumac extract

3.2 Impedance Measurements

The EIS test was performed in 1 M HCl electrolyte without inhibitor and with different concentrations of inhibitor at three temperatures of 298, 308, and 318 K to study the electrochemical properties, characteristics of the aluminum electrode surface, and kinetic studies of the processes. Figures 3 and 4 show the Nyquist and Bode diagrams, respectively.

Fig. 3
figure 3

Nyquist diagrams were recorded for aluminum in 1 M HCl solution at different temperatures involving different concentrations of inhibitor. S1: Blank S2:25(mg/L) S3:50(mg/L) S4:100(mg/L) S5:200(mg/L)

Fig. 4
figure 4

Bode diagrams were recorded for aluminum in 1 M HCl solution at different temperatures involving different concentrations of inhibitor. S1: Blank S2:25(mg/L) S3:50(mg/L) S4:100(mg/L) S5:200(mg/L)

Figure 3 indicates the Nyquist diagrams, which show that the depressed semicircles have maintained their general state at all temperatures and concentrations. In Nyquist diagrams, the presence of such semicircles indicates charge and electron transfer during electrode dissolution (Ref 36). In Nyquist diagrams, the center of the resulting semicircles is clearly under the horizontal axis. This demonstrates the electrode surface's roughness, which can indicate inhibitory adsorption (Ref 37). Increasing the concentration of the inhibitor in the electrolyte increased the diameter of the formed semicircles, indicating the formation of a protective film on the electrode surface, which protects the metal from corrosion.

The diameter of the formed capacitive ring grows with increasing inhibitor concentration, which can be attributed to the adsorption of more inhibitory molecules on the electrode surface (Ref 38). Furthermore, based on the Blank mode diagrams, it is clear that the diameter of the capacitive rings has decreased with increasing temperature, indicating an increase in corrosion intensity at high temperatures. Furthermore, the diameter of the capacitive rings formed has increased with increasing temperature when compared to 298 K in the presence of an inhibitor. This indicates that this inhibitor is better absorbed at temperatures above 298 K (Ref 25). As a result, the resulting compound has better inhibitory properties at temperatures higher than 298 K.

Figure 4 shows that the only time constant observed in Bode diagrams is the elapsed time. It is well known that as the inhibitory concentration in the electrolyte increases, the impedance modulus increases in all frequency ranges at any temperature, indicating the inhibitory performance of the compound added to the electrolyte [125).

Figure 5 depicts the EIS data equivalent circuit. The equivalent circuit of the system includes electrolyte resistance (Rs), charge resistance and charge transfer (Rct), and a CPE fixed phase element, which is placed in the double layer instead of the capacitor. Table 1 summarizes the fitted values of the aforementioned electrical elements.

Fig. 5
figure 5

Equivalent circuit derived from EIS data fit

Table 1 Impedance parameters for aluminum in HCl 1 m solution in the absence and presence of different inhibitor concentrations at different temperatures

A constant phase element (CPE) is used instead of a capacitor (C) to describe the capacitor created by the inhibitor at the electrode surface (Ref 37, 39). The fixed phase element was used in this study due to the heterogeneity and roughness of the electrode surface. Equation 3 is used to calculate the impedance of the fixed phase element (Ref 40):

$$ Z_{CPE} = \frac{1}{{Y_{0} \left( {jw} \right)^{n} }} $$
(3)

Z is the fixed phase frequency, Y0 is the admittance, w is the angular frequency, j is the complex number, and n is a number between 1 and − 1 in this relationship. The value n describes the state of the system. In this case, the system is classified as a capacitor if this value is 1, a resistance if it is zero, and an inductor if it is − 1.

The electrochemical values extracted from the impedance spectroscopy test are presented in Table 1. According to the equivalent circuit model presented in Fig. 5, it can be seen that at the interface between the electrolyte and the electrode, a CPE is paralleled with an Rct and finally these two elements are connected in series with Rs. The Rs is the electrical resistance of the electrolyte, and generally adsorption inhibitors have no effect on the value of this parameter. The amount and type of ions in the electrolyte have a significant effect on this value. The Rct is a resistance that is strongly enhanced due to the presence of the inhibitor and prevents the transfer of charge (electron) between the electrode (metal) and the electrolyte. According to the electrochemical corrosion process shown in Fig. 6, it can be seen that the flow of electrons from the metal to the electrolyte is the first step in the corrosion process. Therefore, by increasing the electrical resistance of charge transfer, the flow of electrons from metal decreases, and as a result, the rate of metal cation formation and ultimately corrosion decreases.

Fig. 6
figure 6

Schematic of the flow of electrons from the aluminum side and the formation of a protective film by the inhibitor in order to prevent the flow of electrons

The presence of the inhibitor and the formation of a protective film by the inhibitor causes the resistance Rct to increase at the interface between the electrode and the electrolyte, and as a result, the charge flow slows down, which results in the reduction of the metal corrosion rate. The schematic of the electron flow and the formation of the protective layer by the inhibitor is shown in Fig. 6. According to Table 1, it can be seen that by increasing the inhibitor concentration from 0 to 200 mg/L at the temperature of 298 K, the value of Rct increases from 8 to 277.3 ohm cm−2. These changes in Rct resistance value also happened at all investigated temperatures.

In the adsorption of the inhibitor to the metal surface in the double layer, a capacitive phenomenon is formed, which can be simulated using the equivalent circuit of Fig. 5 and the schematic of Fig. 6. Considering the fact that the layer formed at the interface between the metal and the electrolyte is not smooth and is generally accompanied by uneven protuberances. (The uneven protuberances are on a microscopic scale and can be due to corrosion or any other factor.) Therefore, the formed double layer does not have parallel plates exactly like a capacitor. In order to evaluate the behavior of this distorted layer, instead of using the capacitor element, another element equivalent to the capacitor called constant phase element (CPE) is used. In other words, this element is equivalent to a capacitor which its plates are not parallel and contain some distortions.

According to the schematic image presented in Fig. 6 and the corrosion process, it can be seen that when the passage of electrons from the metal side to the electrolyte side becomes more difficult, the corrosion rate decrease. In the equivalent circuit presented in Fig. 5 and 6, next to the resistance Rct, a second path including a capacitor is also observed for the flow of electrons. According to the behavior of the capacitor, it is known that the smaller the capacity of the capacitor, the shorter the time it takes to fill the capacitor and cut the circuit. Therefore, the capacitor formed in the double layer by the inhibitor must have a small capacity so that the paths of electron flow from the metal side is inhibited in the shortest time. Therefore, it is expected that the capacity of the formed capacitor decreases when the inhibitor concentration in the electrolyte increases.

As shown in Table 1, the value of ndl varies from 0 to 1, and these values depend on the deviation from the behavior of the ideal capacitor. The presence of SE causes the Rct to increase and this effect increases with increasing inhibitory concentration. This phenomenon indicates that as the concentration of SE in the electrolyte increases, the film formed on the test surface becomes denser, making charge transfer more difficult and ultimately leading to inhibition (Ref 41).

According to Eq 4, which is related to the capacitance of the capacitor formed in the double layer, as the capacitance decreases, the thickness of the formed film increases, and the surface area of the electrode, associated with the corrosive electrolyte, decreases. Equation 4 is as follows (Ref 26):

$$ C_{{{\text{dl}}}} = \frac{{\varepsilon^{0} \varepsilon }}{d}S $$
(4)

In this regard, Cdl is the capacity of the capacitor formed in the double layer, ε0 is the air density, ε is the dielectric constant of the film, d is the thickness of the layer formed in the double layer, and S is the area of the electrode exposed to the electrolyte locally. According to the above relation, decreasing the capacity of the double-layer capacitor increases the thickness of the SE-formed film and decreases the local area of the electrode exposed to the corrosive electrolyte. According to the values presented for the Cdl in Table 1, it can be seen that at the temperature of 298 K, with the increase in the SE value from 25 to 200 mg/L, the Cdl value decreases from 18.32 to 2.69 µF/ cm2. The observed decrease in Cdl at the temperature of 308 K was from 17.56 to 1.94 µF/ cm2, and at the temperature of 318 K, with the increase in SE value from 25 to 200 mg/L, the value of Cdl has decreases from 18.9 to 2.71 µF/cm2.

As a result, the decrease in capacitor capacity caused by the addition of SE to the electrolyte indicates that this compound has a corrosion inhibitory effect on aluminum in 1 M HCl electrolyte (Ref 42). As a result, increasing the concentration of SE at any temperature increased the percentage of inhibition. The highest percentage of inhibition for SE is shown in Table 1 at a temperature of 308 K and a concentration of 200 mg/L. These findings demonstrated that SE reduced electron transfer by forming a protective layer, lowering the corrosion rate of aluminum in 1 M HCl solution.

3.3 Polarization Measurements

Figure 7 depicts the polarization curves of 6xxx aluminum in 1 M HCl electrolyte with varying SE concentrations at various temperatures. Table 2 displays the polarization test parameters as well as the percentage of inhibition calculated from the data obtained from the polarization test at various temperatures.

Fig. 7
figure 7

Shows the polarization diagrams recorded for aluminum in 1 M HCl solution at different temperatures involving different concentrations of inhibitor. S1: Blank S2:25(mg/L) S3:50(mg/L) S4:100(mg/L) S5:200(mg/L)

Table 2 Parameters derived from polarization curves for aluminum in HCl 1 m solution in the absence and presence of different inhibitor concentrations at different temperatures

According to Fig. 7, the addition of different concentrations of SE into the electrolyte has caused the cathodic and anodic branches to shift to lower values of current density. The corrosion current density was calculated using the TOEFL extrapolation method and it was found that the addition of SE significantly reduced Icorr at all temperatures tested. This indicates a reduction in corrosion rate due to the addition of SE. This figure shows that the addition of SE has changed both the anodic and cathodic branches, indicating that the addition of SE causes a change in both cathodic reactions (such as hydrogen reduction) and anodized reactions (such as metal dissolution). Depending on Table 2, the changes in the corrosion potential of the Ecorr electrode due to the addition of SE are not significant. According to research, if the potential change of the electrode caused by the addition of an inhibitor is less than 85 mV, the added inhibitor is a type of mixed inhibitor that affects both anodic and cathodic reactions (Ref 43, 44). According to Table 2, no significant changes were observed in a and c, indicating that the presence of this inhibitor did not cause a change in the mechanism of corrosion and anodic and cathodic reactions (Ref 45, 46). However, rather slowed these reactions (Ref 47).

Temperature is a critical variable in corrosion-related reactions because it has a large impact on the kinetics of the reaction. Temperature changes can affect metal corrosion and the inhibitory adsorption mechanisms on the electrode surface. Therefore, as shown in Table 2, increasing the temperature increases the Icorr values and indicates that the temperature increases the corrosion of aluminum. Regarding the results shown in Table 2 about the addition of different amounts of inhibitor at different temperatures, it was discovered that the inhibitory efficiency of SE is more favorable at temperatures above 298 K, indicating better performance. It is a more effective inhibitor and stabilizer of the SE film formed at high temperatures. Table 2 shows that the highest SE inhibitions at 298, 308, and 318 K are 97, 99, and 98%, respectively, which agrees with the EIS results. Based on the foregoing, it is discovered that the stability of the film formed by SE at temperatures higher than 298 K is improved, as is the inhibitory action (Fig. 8).

Fig. 8
figure 8

Freundlich adsorption isotherms related to SE at 6xxx aluminum surface in 1 M HCl solution at different temperatures

3.4 Adsorption Isotherm Study

Adsorption isotherms are useful models for studying the mechanism of inhibitory adsorption on metal surfaces. In order to evaluate the adsorption isotherm of this inhibitor on the surface, Langmuir, Freundlich, Temkin and El-Awady isotherms were investigated. The results of Freundlich, Temkin and El-Awady isotherms are shown in Fig. 9, 10, 11. According to the results presented in these images, it can be seen that the used inhibitor does not have a proper compliance with these isotherms. Therefore, the Langmuir isotherm was studied, and the results of this isotherm showed a favorable fit. According to the results of the EIS, the Langmuir isotherm is the most appropriate model related to this isothm (Ref 48):

$$ \frac{C}{\theta } = \frac{1}{{K_{{{\text{ads}}}} }} + C $$
(5)
Fig. 9
figure 9

Temkin adsorption isotherms related to SE at 6xxx aluminum surface in 1 M HCl solution at different temperatures

Fig. 10
figure 10

El-Awady adsorption isotherms related to SE at 6xxx aluminum surface in 1 M HCl solution at different temperatures

Fig. 11
figure 11

Langmuir adsorption isotherms and thermodynamic parameters related to SE at 6xxx aluminum surface in 1 M HCl solution at different temperatures

In this regard, θ is the level of surface coagulation (100% inhibition/100), Kads is the adsorption constant, and C is the inhibitory concentration. It depends on Fig. 8, it is clear that the C/θ diagrams according to C, are related to each other linearly, which is a feature of the Langmuir isotherm. The linear changes of C/θ according to C indicate the simple adsorption of this inhibitor on the electrode surface (Ref 49).

Van’t Hoff relation is used to study the thermodynamics of inhibitory adsorption on the surface of the aluminum electrode (Ref 50):

$$ K_{{{\text{ads}}}} = \frac{1}{55/5}\exp \left( { - \frac{{\Delta G_{{{\text{ads}}}}^{0} }}{RT}} \right) $$
(6)

In this relation, R is the gas constant, T is the reaction temperature and \({\Delta G}_{\mathrm{ads}}^{0}\) is the Gibbs free energy for adsorption of the inhibitor.

From thermodynamic values shown in Fig. 8, it is clear that there are negative values for this inhibitor's adsorption on the surface of aluminum, indicating that this inhibitor adsorbs spontaneously on the surface. It is also clear that as temperatures increased from 298 to 308 and 318 K, the values became more negative, indicating that this inhibitor adsorbs more at temperatures higher than 298 K. It is known that it has a higher positive value of 318 K than 308 K. This indicates that the ideal temperature for this inhibitor's adsorption is 308 K, because the absorption is more negative at this temperature than at other temperatures. It is obvious that as inhibitory adsorption improves, so must the inhibitory property, as evidenced by the EIS test and polarization results. According to studies, if the Gibbs free energy changes for an inhibitor's absorption are more positive than − 20 kJ, it means that the inhibition is physical, and if it is more negative than − 40 kJ, it means that the adsorption is chemical (Ref 51), so based on the values, it is determined that the adsorption of this inhibitor is physical.

3.5 Surface Microscopic Observation

Figure 12 shows FE-SEM images of test specimens after 28 hours of no electrolyte immersion and containing 200 mg/L SE at various temperatures. According to the images, the electrolyte severely attacked the samples without inhibitors (Fig. 7a-c), and the surface of the samples was corroded. Furthermore, it is clear that as the electrolyte temperature rises, so does the surface roughness of the samples, indicating an intensification of corrosion with increasing temperature. It is well known that after adding SE to the electrolyte, the surface of the samples (Fig. 7d-f) has a smoother surface than without the inhibitor. These findings indicate that SE forms a film on the electrode surface, resulting in corrosion protection against the electrode surface.

Fig. 12
figure 12

FE-SEM images of 6xxx aluminum immersed for 28 hours in 1 M HCl at different temperatures. (a-c) samples without inhibitors and (d-f) samples containing 200 mg/L SE.

When images at different temperatures are compared, it is discovered that the surfaces protected by the SE film are more resistant to the penetration of attacking ions such as Cl-. SE backs up this claim, and the results have been confirmed in electrochemical tests.

AFM is a powerful surface study method that can provide surface details such as roughness at the nanoscale and microscale, and it is one of the best methods for studying surface corrosion (Ref 52). Figure 13 depicts 3D AFM images of the surface of an aluminum sample that has been corroded and protected by 200 mg/L SE inside a 1 M HCl electrolyte at various temperatures. All samples without SE corroded and had a significant roughness (Fig. 8a-c), as shown in the FE-SEM images. The presence of 200 mg/L SE results in low surface roughness. The corrosion rate of the aluminum sample decreased significantly at all temperatures tested, as shown in Fig. 13(d-f).

Fig. 13
figure 13

3D AFM images of 6xxx aluminum immersed for 30 minutes in 1 M HCl at different temperatures. (a-c) samples without inhibitors and (d-f) samples containing 200 mg/L SE.

Figure 14 depicts the roughness (Ra) values of the specimens graphically. It is clear that as temperature rises, the value of Ra rises as well, eventually reaching 130 nm at 318 K in the unobstructed state. Furthermore, it is discovered that adding 200 mg/L SE significantly reduces Ra at all temperatures tested. This shows that the aluminum sample in 1 M HCl solution can be kept safe within the temperature range specified by SE.

Fig. 14
figure 14

Average Ra for aluminum sample immersed in 1 M HCl for 30 minutes in unobstructed state and 200 mg/L SE at different temperatures

3.6 The Amount of Hydrogen Released

Dissolution of the electrode in the 1 M HCl electrolyte produces hydrogen gas. Hydrogen gas production varies in the presence or absence of inhibitors. This suggests that the presence of an inhibitor has slowed the reduction of hydrogen by electrons produced in the dissolution of aluminum. The anodic and cathodic reactions resulting from the reaction between aluminum and the electrolyte are as follows:

  • Anodic reaction of aluminum dissolution: \({\text{Al}} \to {\text{Al}}^{{{3} + }} + {\text{3e}}^{ - }\)

  • Cathodic reaction of hydrogen reduction: \({\text{H}}^{ + } + {\text{e}}^{ - } \to \frac{1}{2}{\text{H}}_{{2}}\)

According to the above reactions, it is clear that hydrogen production indicates corrosion of the electrode. In other words, the corrosion rate can be determined by measuring the amount of hydrogen released. Figure 15 shows the volume of hydrogen produced in the presence and absence of different concentrations of inhibitors. According to these results, it is clear that in the presence of an inhibitor, the amount of hydrogen released reduces. This indicates that the inhibitor reduces the thermodynamic affinity and rate of this reaction by increasing the activation energy desired for the cathodic hydrogen reduction. As the percentage of hydrogen reduction reaction decreases, the negative charge density around the electrode increases. As the negative charge density increases around the electrode, the electrode charge first becomes negative and creates a repulsive force to negatively charged ions (such as Cl). On the other hand, with the increase of electrons in the cathodic reaction, according to the Le Shatelie principle, if one of the reaction products increases, the progress of the reaction slows down and the production of electrons, i.e., the anodic dissolution of aluminum, decreases. Figure 15 shows a further reduction in the volume of oxygen produced in the presence of higher inhibitory concentrations.

Fig. 15
figure 15

Changes in the volume of hydrogen released in the presence of inhibitors

3.7 XRD Studies

For phase analysis of the samples, two samples have been used in this research. One sample is immersed in the electrolyte without inhibitor and the other is immersed in the electrolyte containing the inhibitor. After immersion, these samples were removed from the electrolyte and then studied by XRD analysis. Figure 16 shows the results of XRD analysis for these two samples. According to the results, it is clear that phases related to the inhibitor were observed in the sample immersed in the electrolyte containing the inhibitor. This result shows the adsorption of sumac extract on the surface of samples immersed in electrolytes containing inhibitors. On the other hand, in the results of the sample immersed in electrolyte without inhibitor, there are no corrosion products resulting from the reaction of aluminum with HCl. It is possible that the amount of these products is less than 5%, which XRD analysis was not able to identify. According to the results of the phase detection software, there are undetected peaks (peaks at 35°, 40°, 59° and 70°), which may be related to aluminum corrosion products, aluminum hydroxide, or other aluminum corrosion products.

Fig. 16
figure 16

XRD analysis results for the sample (a) without inhibitor, (b) containing 200 mg/L inhibitor

3.8 Protection Mechanism

Most of the used green inhibitors prevent the occurrence of electrochemical reactions and corrosion by the protective film formation mechanism. This type of inhibitors, having tannin compounds in their structure, after entering the corrosive fluid, are absorbed by transferring to the electrode/electrolyte interface on the metal surface. After the absorption of these compounds on the surface of the metal, a coherent and continuous protective film is formed on the surface of the metal, which belongs to the category of polymers. Due to the fact that this protective film generally includes tannin compounds, these compounds continuously and coherently establish a protective barrier against the attack of ions and the exchange of electrons between the electrode and the electrolyte. The result of this process is the reduction of the contact surfaces of the electrode with the electrolyte, the reduction of the charge exchange between the metal and the electrolyte, and the reduction of the corrosion rate. Due to the fact that this group of inhibitors is one of the film former inhibitors, it is necessary to make sure that the concentration of the added inhibitor is acceptable and can create the required protective film for the entire surface of the metal. If a part of the metal surface is not protected (due to the low inhibitor concentration in the fluid), those bare areas will act as an anode against the huge surface covered by the film. In other words, bare surfaces (with smaller area) will act as anodes for covered surfaces (with larger area, which is the cathode). In this case, the bare areas will be corroded at a very high rate and will eventually lead to localize corrosion. Types of localize corrosion such as pitting may occur in such cases. Therefore, it is better to use sufficient amounts of inhibitors when using film former inhibitors so that they do not lead to localize Corrosion.

4 Conclusions

Based on the studies and systematic tests performed in this study, the following results can be presented:

  1. 1.

    Electrochemical tests showed that SE could be used as a mixed inhibitor for 6xxx series aluminum corrosion in 1 M HCl electrolyte. Based on EIS data, it has been determined that the maximum inhibition for 200 mg/L SE at 308 K is 99%. The results of the electrochemical tests (polarization and EIS) are in agreement with each other.

  2. 2.

    The results of AFM and FE-SEM show that aluminum has a SE inhibitory property inside 1 M HCl electrolyte, which has been confirmed in electrochemical tests. This indicates that the SE has formed a protective film on the electrode surface.

  3. 3.

    The presence of nitrogen and oxygen atoms and aromatic rings in the structure of sumac extract is one of the main symptoms of common inhibitors.

  4. 4.

    When different concentrations of SE are added to the electrolyte, the cathodic and anodic branches shift to lower density values.

  5. 5.

    The Langmuir isotherm is followed by the SE adsorption model on the aluminum electrode, and the adsorption of this compound on aluminum is physical.

  6. 6.

    Increasing the temperature to 308 K improves SE absorption, which increases this compound's inhibitory property at high temperatures.