1 Introduction

Hydrochloric acid (HCl) solutions are widely used for acid cleaning, industry acid pickling, oil well acidizing and acid descaling [1,2,3,4], but hydrochloric acid medium has aggressive effect on substances. Plant extracts are considered cheap, safety, on-hand and renewable sources of inhibitors. The plant extracts include different organic compounds containing heteroatoms, and some [5,6,7,8] have been to act as metal dissolution inhibitors in various corrosive mediums. “So, we need the using of substances that have inhibiting effect to protect the metals which used in different fields of applications. The formation of thin layer resulting from interaction of organic compounds on the metal (mixed inhibitors) while in case of inorganic inhibitors may block anodic or/and cathodic sites [9,10,11].” Due to the currently imposed environmental requirements for eco-friendly corrosion inhibitors, there is a growing interest in the use of natural products such as leaves or seeds extracts. The term “eco-friendly corrosion inhibitor” or “green inhibitor” refers to the substances that are biocompatible such as plant extracts since they are of biological origin. Thus, the natural products are being studied by several authors, for their corrosion inhibition potential as they are more environmentally friendly, showing good inhibition efficiency with the low risk of environmental pollution [12]. “Using of extracts of plant as inhibitors in acidic solutions, as Nigella sativa L.[13], Apium graveolens L. [14], Glycyrrhiza glabra [15], pomelo peel extract [16], Dryopteris cochleata leaf extracts [17], Myrmecodia pendans extract [18], Morinda citrifolia [19], Thymus vulgaris plant extract [20], Mentha spicata L. extract [21], phytoconstituent of Ervatamia coronaria [22], myrrh extract [23], Cucurbita maxima [24], Adhatoda vasica, Eclipta alba and Centella asiatica [25] have been investigated.” Prosopis juliflora plays an important role in the ecological setup and economy of arid and semiarid environments as they play a vital role in sustainable development of the areas. It is known of reversal of desertification and has been suggested as a miracle plant. Besides its use as a fuel plant, it has varied properties which are useful to the human kind. Every part of P. juliflora is abundantly being used in various fields. Extracts of P. juliflora seeds and leaves have several in vitro pharmacological effects such as antibacterial, antifungal and anti-inflammatory properties. It is also known for its ethno-medicinal properties, mainly used for boils, rheumatic pain, digestive disturbances. “Chemical studies have demonstrated that the PJF extract contains flavonoids such as apigenin, luteolin, apigenin 6,8-di-C-glycosides, chrysoeriol 7-O-glucoside, luteolin 7-O-glucoside, kaempferol 3-O-methyl ether, quercetin 3-O-methyl ether, isorhamnetin 3-O-glucoside, isorhamnetin 3-O-rutinoside, quercetin 3-O-rutinoside and quercetin 3-O-diglycoside (glucose, arabinose), alkaloids such as juliflorine, julifloricine and julifloridine, tannins and mineral elements such as Na, K, Ca, Cu, Fe, Zn and Mn” [26]. This study tests the PJF extract role on the dissolution mechanism of LCS in 1 M HCl acid medium. The PJF extract role is measured using gasometric method, mass loss method, polarization diagrams, EIS technique, SEM technique and AFM technique.

2 Experimental Techniques

2.1 Materials and Solutions

Corrosion tests have been worked on specimens of low-carbon steel with the chemical composition: 0.046% C, 0.900% Mn, 0.007% P, 0.002% Si and the remainder iron. The aggressive solution used was prepared by dilution of analytical reagent grade 34% HCl with bi-distilled water. The stock solution (1000 ppm) of PJF was used to prepare the desired concentrations by dilution with bi-distilled water.

3 Methods

3.1 Gasometric (GM) Method

The hydrogen evolution method is a useful technique that calculates the amount of hydrogen producing during a corrosion process. The used bottle must contact through a plastic tube to a burette. Initially, the air volume in the burette was measured. Finally, medium–low-carbon steel specimen was immersed in the test solution and the reaction bottle was enclosed. The amount of H2 gas was measured by decreasing the aqueous solution level in the burette at fixed time intervals. Experiments were always repeated at least three times to check the reproducibility.

3.2 Mass Loss (ML) Method

Preweighed LCS sheets were suspended in 100 ml of 1 M HCl without and with the different contents of PJF extract ranging from 50 to 300 ppm. After different dipping time, the samples were outputted, washed with bi-distilled water, dried and weighted accurately. The inhibition efficiency (%IE) and the degree of surface coverage (θ) of the investigated inhibitors on the corrosion of LCS were calculated as follows [27]:

$${\text{IE}}\% = \theta \times 100 = \left[ {\left( {W_{\text{o}} -W} \right)/W_{\text{o}} } \right] \times 100$$
(1)

where W o and W are the values of the average ML in the absence and presence of the inhibitor, respectively. Experiments were always performed at least three times to check the reproducibility.

3.3 Electrochemical Measurements

Electrochemical techniques were done using a typical three-compartment glass cell consisting of saturated calomel electrode (SCE) as a reference electrode and a platinum foil (> 1 cm2) as a counter electrode. The steel specimen as working electrode was in the form of a square cut from steel sheet of equal composition embedded in epoxy resin of polytetrafluoroethylene so that the flat surface area was 1 cm2. Prior to each measurement, the electrode surface was pretreated in the same manner as in the ML experiments. Before measurements, the electrode was immersed in solution at natural potential for 30 min until a steady state was reached.

3.3.1 Potentiodynamic Polarization (PP) Method

The potential was started from − 1000 to 0 mV vs open-circuit potential. All experiments were carried out in freshly prepared solutions at 25 °C.

3.3.2 Electrochemical Impedance Spectroscopy (EIS) Method

Impedance measurements were taken using AC signals of 5-mV peak-to-peak amplitude at the open-circuit potential in the frequency range of 100 kHz to 0.1 Hz. All impedance data were fitted to appropriate equivalent circuit using the Gamry Echem Analyst software. The experimental impedance was analyzed and interpreted on the basis of the equivalent circuit.

3.3.3 Electrochemical Frequency Modulation (EFM) Method

EFM experiments were performed with applying potential perturbation signal with amplitude 10 mV with two sine waves of 2 and 5 Hz. The choice for the frequencies of 2 and 5 Hz was based on three arguments [28]. The larger peaks were used to calculate the corrosion current density (i corr), the Tafel slopes (β a and β c) and the causality factors CF-2 and CF-3 [29]. Experiments were always carried out at least three times to check the reproducibility in all test methods.

All electrochemical measurements were taken using Gamry Instrument (PCI4/75 Potentiostat/Galvanostat/ZRA).

3.4 Scanning Electron Microscopy (SEM) Analysis

The surface morphology of the specimens was examined by SEM images recorded using the instrument VEGA3 TESCAN model.

3.5 Atomic Force Microscopy (AFM) analysis

The AFM images of polished, uninhibited and inhibited low-carbon steel samples were obtained using NanoSurf Easyscan 2 Flex AFM instruments (Nanotechnology Center, Mansoura University).

4 Results and Discussion

4.1 Hydrogen Evolution (HE) Method

The produced H2 gas volume resulting from the corrosion reaction can be calculated. Results obtained by the HE method (in Fig. 1) are matching with other methods including MR and electrochemical methods. The hydrogen volume is dependent on the time of reaction according to Eq. (2):

$$V = Kt$$
(2)

where V is the H2 gas volume, t is time, and K is the corrosion rate. From Table 1, the results indicate that the extract decreased the H2 gas volume and increased the protective percent [30]. From the volume of hydrogen evolved during the corrosion reaction, the corrosion rate (k corr) was determined from Eq. (3)

$$k_{\text{corr}} = \left( {Vt-Vi} \right)/t_{t} - t_{i}$$
(3)

where Vt and Vi are the volumes of hydrogen evolved at time t t and t i , respectively. The results in Table 2 show that the corrosion rate decreased with the increase in PJF concentration. The %IE was determined using Eq. (4)

$$\% {\text{IE}} = [1 - \left( {V_{\text{Ht}} /V^{0}_{\text{Ht}} } \right) \times 100$$
(4)
Fig. 1
figure 1

Hydrogen evolution from LCS dissolution in 1 M HCl in the absence and presence of PJF extract at 25 °C

Table 1 %IE and k corr of LCS obtained from gasometric method after 120 min in 1 M Hydrochloric acid for different PJF extract concentrations at 25 °C
Table 2 %IE and θ of PJF extract for the LCS dissolution in hydrochloric acid from ML data at various concentrations of PJF extract at 25 °C

4.2 Mass Loss (ML) Measurements

The loss of mass of LCS is measured, at different time periods, without and with various extent of PJF extract. The relationship between mass reduction and time is shown in Fig. 2 for PJF extract. The corrosion inhibition efficiency is affected by the concentration of extract. The curves for different extract concentrations fell below the corrosive media. The increase in the concentration of the extract gives a decrease in the mass reduction and an increase in the metal corrosion protection. Experimental data show that the PJF extract is considered as inhibitory substance for LCS corrosion in 1 M HCl medium. Also, the (Ө) and  %IE due to the thin layer, founded by Eq. (1), rise with rising the extract extents. The data are given in Table 2.

Fig. 2
figure 2

Curves of ML versus time for the corroded LCS in 1 M hydrochloric acid without and with the various PJF solution concentrations at 25 °C

4.3 Adsorption Isotherms

Temkin equation which is represented in Fig. 3 is used to calculate θ for PJF extract. The covered surface area (θ) was calculated at several extract contents in 1 M hydrochloric acid media. The best fitting obeys the Temkin adsorption isotherm [31].

$$\varTheta_{\text{coverage}} = \, \left( {2.303/a} \right){\text{ Log }}C + \left( {2.303/a} \right){\text{ Log }}K_{\text{ads}}$$
(5)

where K ads is the adsorption constant, C is the concentration (mol l−1) of the extract, and “a” is heterogeneous factor of metal surface. The values of “a,” K ads and \(\Delta G^{\text{o}}_{\text{ads}}\) obtained are given in Table 3.

Fig. 3
figure 3

Diagram of Temkin adsorption of PJF plant extract on the surface of LCS in 1 M HCl at different temperatures

Table 3 Some parameters from Temkin isotherm for LCS in 1 M hydrochloric acid for PJF plant extract at 25 °C

The K ads is utilized to calculate the adsorption energy of \(\Delta G^{\text{o}}_{\text{ads}}\) as follows:

$$K_{\text{ads}} = \frac{1}{55.5}{ \exp }\left[ {\frac{{ - \Delta G^\circ_{\text{ads}} }}{RT}} \right]$$
(6)

From Table 3, \(\Delta G^{\text{o}}_{\text{ads}}\) depends on temperature. The positive values of \(\Delta G^{\text{o}}_{\text{ads}}\) indicate that the extract was adsorbed spontaneously on the metal surface. From \(\Delta G^{\text{o}}_{\text{ads}}\) values, the adsorption of the PJF components is mixed one, but mainly chemisorbed. Positive value of (a) showed attractive forces between adsorbed molecules [32] on the LCS surface. Large values of K ads modify more effective adsorption and hence higher protective effective [33]. K ads values that are raised with the rise in temperature indicate that the PJF extract is mainly chemically adsorbed onto the LCS surface. The high values of \(\Delta H^{\text{o}}_{\text{ads}}\) indicate the chemisorption type [34]. From the LCS van’t Hoff equation,

$${\text{Log }}K_{\text{ads}} = \left( { - \Delta H^{\text{o}}_{\text{ads}} /2.303 \, RT} \right) + {\text{constant}}$$
(7)

\(\Delta H^{\text{o}}_{\text{ads}}\) can be also deduced from the plot of log K ads versus 1/T giving straight lines with slopes of \(\Delta H^{\text{o}}_{\text{ads}}\)/R (Fig. 4).

Fig. 4
figure 4

Log K ads versus 1/T for the corrosion of LCS in the presence of PJF extract

From Fig. 5, the entropy of adsorption can be measured from Eq. (8):

$$\Delta G^{\text{o}}_{\text{ads}} = \Delta H^{\text{o}}_{\text{ads}} - T \, \Delta S^{\text{o}}_{\text{ads}}$$
(8)
Fig. 5
figure 5

\(\Delta G^{\text{o}}_{\text{ads}}\) versus T for the corrosion of LCS in the presence of PJF extract

The calculated \(\Delta H^{\text{o}}_{\text{ads}}\) and \(\Delta S^{\text{o}}_{\text{ads}}\) are given in Table 3. The data showed that the calculated \(\Delta H^{\text{o}}_{\text{ads}}\) values are positive which indicate that the adsorption process is endothermic. The higher and positive values of \(\Delta S^{\text{o}}_{\text{ads}}\) indicate that the small molecules or ions such as H2O, Cl- which interact with the surface atoms of LCS are replaced by PJF extract molecules that raise the disorder of the medium [35].

4.4 Effect of Temperature

The corrosion rate of LCS in 1 M HCl and with concentrations of PJF extract was tested in the range of temperature from 303 to 323 K by ML method (Fig. 6). From Table 4, both of the rate of k corr and  %IE for PJF extract were increased by raising temperature. The increase in %IE with raising the temperature proves that at low temperatures the extract is physisorbed, but at high temperature is chemisorbed [36, 37].

Fig. 6
figure 6

Effect of concentration and temperature on the %IE of PJF extract

Table 4 Data of %IE, (θ) and (k corr) in hydrochloric acid using ML method with different PJF extract concentrations at various temperatures

4.5 Activation Studies

The dissolution reaction parameters were measured from the equation of Arrhenius (9):

$${\text{Log }}k_{\text{corr}} = - E_{\text{a}}^{ *} /2.303\,RT + { \log }A$$
(9)

where R is universal gas constant, \(E_{\text{a}}^{ *}\) is energy of activated complex, T is Kelvin’s temperature, and A is Arrhenius factor. From Table 5, the magnitude of \(E_{\text{a}}^{ *}\) for the metal in corrosive medium in the absence and presence of different PJF extract concentrations calculated from drawing k corr Logarithm against temperature reciprocal plots is shown in Fig. 7. Table 5 shows that the \(E_{\text{a}}^{ *}\) decreases in the occurrence of PJF due to the delayed rate of adsorption with a resultant closer approach to equilibrium during the experiments at higher temperatures according to Hoar and Holliday [38]. "But, Riggs and Hurd [39] explained that the reduction in the activation energy of corrosion at higher levels of inhibition arises from a shift of the net corrosion reaction from the uncovered part of the metal surface to the covered one”. For the activated complex, the enthalpy change (ΔH * ) and entropy change are calculated from Eq. (10):

$$k_{\text{corr}} = \left( {RT/Nh} \right){ \exp }\left( {\Delta S^{ *} /R} \right){ \exp }\left( { - \Delta H^{ *} /RT} \right)$$
(10)

where k corr is the metal corrosion rate, h is Planck’s constant, and N is Avogadro’s number. Figure 8 indicates a draw of log k corr/T versus 1/T with PJF extract in hydrochloric acid. Straight lines are given (slopes = (ΔH */2.303 R) and intercepts are [log (R/Nh + ΔS * /2.303 R)] written in Table 5.

Table 5 Kinetic parameters for activated state of LCS without and with PJF extract concentrations in 1 M hydrochloric acid
Fig. 7
figure 7

Diagram of Arrhenius (1/T versus log k corr) for dissolution of LCS in 1 M HCl without and with different PJF extract concentrations

Fig. 8
figure 8

Diagram of (log k corr/T) versus 1/T for dissolution of LCS in hydrochloric acid without and with different PJF extract concentrations

The activation energy decreases with the increase in the extract content (Table 5), and then, the adsorption is chemical type. The positive ΔH * indicates the extract adsorption is endothermic. The negative ΔS *with and without the extract shows that in the rate-determining step, the association of unstable coordinated compound is more than the dissociation [40].

4.6 Electrochemical Frequency Modulation Technique (EFM)

EFM is safe dissolution method that identified the current magnitude without meaningful Tafel constants, and with only a small signal of polarizing [41]. Figure 9 shows the EFM spectrum of LCS in hydrochloric acid solution with various PJF extract contents. From Table 6, the addition of PJF extract with different concentrations to the corrosive medium reduces the current density of corrosion, meaning that PJF extract acts as inhibitor by adsorption process. The causality factors are very closer to theoretical values which according to EFM theory [42] should prove the validity of Tafel slopes and corrosion current densities. %IEEFM raises by rising contents of extract, and it can be measured using Eq. (11):

$$\% {\text{IE}}_{\text{EFM}} = \left[ {1 - \left( {{\text{i}}_{\text{corr}} /{\text{i}}^{\text{o}}_{\text{corr}} } \right)} \right] \times 100$$
(11)

where \(i^{\text{o}}_{\text{corr}}\) and i corr are corrosion current densities without and with extract, respectively.

Fig. 9
figure 9

EFM spectrums for the dissolution of LCS in 1 M HCl without and with various PJF extract extent

Table 6 EFM parameters for LCS in the absence and presence of various PJF concentrations in 1 M HCl at 25 °C

4.7 Electrochemical Impedance Spectroscopy (EIS) Tests

Figure 10 indicates the resistance curves for LCS in 1 M hydrochloric acid medium without and with PJF extract. The Nyquist plots do not produce perfect semicircles due to the irregularity of frequency [43] resulting from the surface asymmetry and the roughness of the surface. “The semicircular shape shows that the corrosion of LCS is controlled by the charge transfer and the presence of PJF does not change the mechanism of LCS dissolution” [44]. The addition of PJF raises the R ct value in corrosive medium. The C dl reduces with the increase in PJF concentration. These results prove the occurrence of a protective adsorbed layer.

Fig. 10
figure 10

a Nyquist diagram for the LCS dissolution in hydrochloric acid without and with PJF extract concentrations at 25 °C. b The Bode diagram for the LCS dissolution in hydrochloric acid without and with various PJF extract concentrations at 25 °C

Figure 11 shows the equivalent electrical circuit utilized for fitting the results. The C dl, Y 0 and n were measured by Eq. (12) [45]:

$$C_{\text{dl}} = Y_{0} \omega^{n - 1} /{ \sin }[n \, \left( {\pi /2} \right)]$$
(12)

where Y 0 is the CPE value, ω = 2πf max, f max is the angular frequency, and n is the exponential. From Table 7, the CPE/C dl decreases with a decrease in dielectric factor and/or to an increase in the double-layer thickness, advising that the extract components are adsorbed at the metal/solution interface [46]. The %IE can be measured from Eq. (13) [47]:

$$\% {\text{IE}}_{\text{EIS}} = \left[ {1-\left( {R ^ {\text{o}}_{\text{ct}} /R_{\text{ct}} } \right)} \right] \times 100$$
(13)

where \(R^{\text{o}}_{\text{ct}}\) and R ct are the resistance of charge moving values in extract free and inhibitory solution, respectively.

Fig. 11
figure 11

Equivalent circuit for fitting EIS data for LCS in 1 M hydrochloric acid solutions

Table 7 Parameters measured by EIS method for LCS in 1 M hydrochloric acid without and with PJF extract concentrations at 25 °C

The Bode plot (Fig. 10b) shows single maximum at intermediary frequencies, broadening of this maximum in the presence of PJF extract resulting from the formation of a protective film onto the low-carbon steel surface. The higher values of both phase angle and impedance for inhibitory solutions than uninhibited solution reproduce the inhibition effect of PJF extract. Additionally, these values rise on the rise in the concentration of studied extract [48].

4.8 Potentiodynamic Polarization Curves

Figure 12 shows the polarization curves for LCS corrosion in one molar hydrochloric acid with and without PJF extract extent at 25 °C. The protective percent and covered surface area are measured from Eq. (14):

$$\% {\text{IE}}_{p} = \left[ {\left( {i^{\text{o}}_{\text{corr}} -i_{\text{corr}} } \right)/i^{\text{o}}_{\text{corr}} } \right] \times 100 = \theta \times 100$$
(14)

where i corr and i corr are the free and inhibited current densities, respectively. From Table 8, the decrease in i corr is clearly with the increase in the inhibitor concentration. The maximum displacement in E corr is < 85 mV/E corr, which considers that the PU affects the reaction of both anodic and cathodic [49]. Additionally, this extract causes no change in the Tafel slopes, signifying that this extract is firstly adsorbed onto metal surface and therefore resist by only blocking the active positions with no change in the reaction mechanism [50].

Fig. 12
figure 12

Corrosion polarization plots for the LCS in 1 M hydrochloric acid without and with PJF extract concentrations at 25 °C

Table 8 Dissolution voltage (E corr), current density (i corr), Tafel constants (β c, β a) and (θ), and protective percent (%IEp) of LCS in hydrochloric acid at room temperature for PJF extract

4.9 Scanning Electron Microscopy (SEM) Analysis

Surface morphology of LCS was evaluated by scanning electron microscopy after 24-h dipping in 1 M HCl before and after the addition of inhibitor. The SEM micrograph of Fig. 13a represents the smooth surface of LCS, while Fig. 13b shows powerfully damaged steel surface due to the dissolution after dipping in 1 M HCl. SEM image of low-carbon steel surface after immersion in 1 M HCl and 300 ppm PJF is shown in Fig. 13c. However, in the presence of 300 ppm PJF, the LCS surface coverage increases, proposing formation of a protective inhibitory layer at the surface of LCS.

Fig. 13
figure 13

SEM micrographs of a polished LCS, b low-carbon steel immersed in 1 M HCl, c LCS immersed in1 M HCl containing 300 ppm PJF

4.10 Atomic Force Microscopy (AFM) Analysis

AFM provides images with atomic or near-atomic-resolution surface topography, capable of computing surface roughness of samples. The three-dimensional (3D) AFM morphologies for polished LCS surface and LCS surface in 1 M HCl with and without PJF extract are shown in Fig. 14.

Fig. 14
figure 14

Three-dimensional AFM images of the surface of a as-polished LCS; b LCS immersed in 1 M HCl; c LCS immersed in 1 M HCl containing PJF (300 ppm)

From Table 9, the data suggest that low-carbon steel surface immersed in 1 M HCl has a greater surface roughness than the polished metal surface, which shows that LCS sample is severely scratched due to the acid attack. The roughness average of protected LCS was reduced to 250.4 nm. These parameters confirm that the surface is smoother. The smoothness of the surface is due to the formation of a compacted protective film of extract on the metal surface, thereby preventing the corrosion of LCS [51].

Table 9 AFM data for LCS surface dipped in inhibited and uninhibited media

4.11 Mechanism of Corrosion Inhibition

According to electrochemical measurements, the addition of PJF extract leads to retarding the LCS corrosion. From the results, the mechanism of inhibition involves blocking of surface active sites by adsorption of PJF molecules. The adsorption mechanism of PJF extract on the LCS surface involves a physisorption. Phytochemical analysis of PJF extract indicates the existence of flavonoids, alkaloids, carbohydrates, phenols, tannins. These components have heteroatoms such as –N, –O, which strongly was adsorbed onto a LCS surface. The inhibitive effect of these components may be recognized to their adsorption via the –NH, C=O, OH, etc., groups and also the presence of π-electrons in the rings. These organic molecules get adsorbed on the metal surface, forming a protective film, and therefore, the inhibition occurs [52].

5 Conclusions

PJF extract has corrosion inhibitory effect on LCS in hydrochloric acid medium. Polarization plots data mention that the PJF extract is mixed-type inhibitor. Corrosion protection efficiencies of PJF extract rise with the rise in temperature, but the energy of corrosion activation was decreased (chemisorption). The adsorption of PJF extract follows the Temkin adsorption isotherm. SEM and AFM techniques give information about morphology, topography and the roughness of the metal surface. There is good agreement between chemical and electrochemical techniques.