Introduction

Corrosion control of equipment used in industrial processes is a major importance in guaranteeing their continued development under optimum conditions in terms of safety and reliability [1]. The choice of materials, especially mild steel or carbon steel, is based on knowledge acquired by researchers over the past decades and on studies dedicated to satisfying the new objectives of the process industries and environments. Mild steel is seen as one of the most widely used materials for industrial use as a result of its high strength and reliability. Corrosion is very expensive to combat and tends to destroy metallic materials. Acid minerals are used in cleaning operations of industrial installations, as catalyst for other alkylation processes, oil well acidizing, descaling, petrochemical pickling and degreasing. As a result of hostile nature of acid minerals during the routine cleaning operations metallic materials loss its high strength and reliability through corrosion process [2]. The failure is very catastrophic in industries. Due to environmental regulatory restrictions on the use of imported/toxic inhibitors to curb this ugly menace, efforts have been geared toward the use and development of green/friendly corrosion inhibitors, particularly those with polar heteroatoms and conjugate structures and is generally believed to be a desirable development [3,4,5,6,7]. The inhibitory activities of these organic constituents to mitigate corrosion attack have been attributed to their tendency to get adsorbed on the steel surface to form a dense film layer obstructing the invading of the corrodent species.

Research findings have shown that bioextracts from different plant parts are effective in retarding metals corrosion in different hostile conditions and useful results were obtained [8]. We have collected some representative references in similar research area. Apreal et al. [9] studied the corrosion protection of mild steel in 1 M H3PO4 solution by apricot juice at varying temperature. Their studies show that the inhibitor adsorbed on the metal surface. Average value of heat of adsorption was − 14.93 kJ/mol which indicates spontaneous physical adsorption mechanism. They further observed that the activation parameters did not change with addition of inhibitor. Also from their statistical analysis (ANOVA), corrosion rate was influenced by temperature, inhibitor concentration and combined interaction of them. The inhibition effects, adsorption nature, mathematical and electrochemical modeling of peach juice as corrosion inhibitor were examined by Apreal et al. [10]. They found out that the inhibition efficiency rose with the increase in peach juice concentration and temperature up to 50 °C, while at temperature above 50 °C the values of efficiency decrease. The inhibitor adsorbed physically on the metal surface and obeyed Langmuir adsorption isotherm. Maximum inhibition efficiency obtained was 91% at 50 °C in 50 cm3/ inhibitor concentration. Karim et al. [11] evaluated the inhibitory action of citrus aurantium leaves extract as corrosion inhibitor of mild steel in 1 M H2SO4. They considered effect of temperature, time and inhibitor concentration using a combined experimental approach. From their findings, the inhibition efficiency was found to increase with the increase in inhibitor concentration, whereas the temperature shows otherwise. Maximum inhibition efficiency attained was 89% at 40 °C and 10 ml/L inhibitor conc. The adsorption mode was found to obey Langmuir adsorption model. The free energy of adsorption was around − 20 kJ/mol which is indicative of physical adsorption between charged molecules and charged metal. Anees et al. [12] investigated the inhibitory performance of xanthium strunarium leaves as corrosion inhibitor for low CS in 1 M HCl. From the result, the inhibition efficiency was found to increase with increase in inhibitor concentration and temperature. The inhibition efficiency was 94.82% at higher level of inhibitor and temperature. The adsorption study was found to obey Langmuir adsorption model. The free energy of adsorption was more than − 20 kJ/mol which is indicative of mixed mode of physical and chemical adsorption. Anees and Khalid et al. [13] studied the corrosion inhibition of mild steel in 2.5 M HCl solution by kiwi juice at varying operating conditions. They observed that corrosion rate increased with temperature and the inhibitor adsorbed according to Langmuir adsorption isotherm. The FTIR analysis showed that the peaks correspond to phenols and quercetin was the main constituent responsible for the inhibition process. The optimum conditions were estimated with maximum inhibitor efficiency of 96.1%. Seyed et al. [14] examined the inhibitory nature of thymus vulgaris leaves aqueous extract for mild steel in acidizing solution (1 M HCl) using combined experimental and DFT method. Their achievement confirmed that 1000 ppm of thyme vulgaris controlled about 95% of acidic solution attack via mixed form inhibition ability after 24-h steel exposure in 25 °C temperature. The surface analysis revealed that the metal substrate was covered with a highly compact smooth protective layer and the surface heterogeneity sufficiently decreased after surface protection. High compliance of experimental results via Langmuir isotherm confirmed a monolayer of the thyme vulgaris leaves extracts controlled the chloride corrosive attacks. However, the major constraint (draw back) on the use of these type of inhibitor according to umoren et al. [15] is that plant extracts contain myriads of heteroatoms which makes it cumbersome to pinpoint a definite molecule responsible for inhibition process. They proffered a solution (way forward) that it is pertinent to isolate a definite molecule as corrosion inhibitor. The above-mentioned limitation can systematically be resolved by using a mechanistic/theoretical approach of density functional theory (DFT) to elucidate more on the inhibition mechanism of the isolated molecule in the overall inhibition process.

In our previous study, an attempt was made to isolate and evaluate tridecene and luteolin as major constituents of pigeon pea leaf extract as anti-corrosion agent for mild in HCl electrolyte and very encouraging results were obtained [16]. Following our previous study, the present discovery focuses on the use of pigeon pea seed extract as little or no work on the seed extract as corrosion inhibitor was performed to the best of our knowledge.

In science and engineering, prior to practical works, design of experiment (DOE) is pertinent in order to obtain accurate prediction between the input variables and output responses. This is achievable through modeling via statistical methods. DOE facilitates systematic, sustainable, accurate and orderliness of experimental data. According to the literature findings, numerous volumes of investigations were documented in other fields [17,18,19], and in similar research, well-respected colleagues have effectively employed statistical models to obtain optimal responses [20,21,22,23,24,25]. Maximizing points and minimizing loses are always a great concern in engineering field; to find the optimum response, there are several optimization steps one could perform. In view of this, particle swarm optimization (PSO) has become pertinent. PSO is a stochastic-based algorithm programmed on the concept of artificial intelligence which is capable of optimizing nonlinear problems. Furthermore, modeling via response surface methodology is more robust in controlling multiple tasks at a specific time, taking into consideration of both the main, linear and quadratic interaction effects at a considerably reduced number of experimental runs and has been found to be a desirable development.

Pigeon pea seed is chosen for the study because it is readily found in abundant throughout the year. It is also very cheap to procure, nonpoisonous and contains polyphenol, flavonoids, aromatic ring and heteroatoms in their compounds to scavenge free radicals induce detoxification [26]. As presented, Fig. 1 shows the isolated bioactive constituents of pigeon pea seed extract.

Fig. 1
figure 1

Bioactive constituents of pigeon pea seed extract

The aim of the search developed below is the evaluation of the inhibitory effect of pigeon pea seed (isoflavone) molecules as corrosion inhibitor of mild steel in oilfield descaling environments. Experiments involve detailed insight into electro-kinetics, surface examinations, DFT and the use of statistical models to optimize the nonlinear interactions.

Experimental

Preparation of the extract/isolation of the molecules

Fresh pigeon pea seed sample was sourced from Ogbete market Enugu State of Nigeria. The seeds were de-hulled, air-dried for 10 days in a conducive environment to eliminate moisture content as presented in Fig. 2, ground into powder to expose the extract constituents and increase the yield. Two analytical techniques as documented by [27] were employed to obtain the extract. Also significant dose of the isolate active constituents was obtained as described in the literature [28]. The extract stock solution was stored at − 4 °C until further use. The chemicals used were of analytical grade.

Fig. 2
figure 2

Fresh pigeon pea seed dry pigeon pea seed

Metals preparation

The mild steel specimen was mechanically press cut (5 × 4 × 0.1 cm) with chemical composition of 99% [21]. Prior to corrosion studies, each coupon was abraded using 220, 800 and 1200 emery papers to obtain a smooth/uniform surface area. The coupons were further degreased with acetone, rinsed with deionized water to remove debris and dried in warm air. This is in line with technique of previous report [29].

Characterization of pigeon pea seed extract

Further analytical test (titrimetric method) was used to categorize the bioactive compounds. To classify the various active functional groups into segments, FTIR analysis was also conducted on the crude extract (PPS). In the inhibited medium, metal coupons were further implanted. Later, corrosion by products with cavities were obtained, combined with KBR. The frequency of Nicolet Magna-IR 560 used ranges from 4000 to 400 cm−1 to identify the bioactive constituents responsible for the inhibition process. Gas chromatography mass spectrometric analysis (SHIMADZU QP2010 PLUS) was employed to isolate and check the existence of heterocyclic compounds as an inhibitor of corrosion.

Weight reduction

Test coupons in triplicates were immersed freely in a glass reaction vessel 500-ml capacity beaker containing corrosive solution without and with varying operating conditions [16]. After detailed experiment, the samples were dismantled, dipped in acetone, scrubbed with a bristle brush under running water and dried in warm air before reweighing. The weight loss was calculated as the variation between the initial and final weight of the steel. Obtain data were noted and appraised using Eqs. (1), (2), (3) and (4) as described in the literature [30].

$$ \Delta w = w_{i} - w_{f} $$
(1)
$$ {\text{CR}} = \frac{{ W_{{{\text{bl}}}} - W_{{{\text{inh}}}} }}{{{\text{Area}} \left( {m2} \right) \times t \left( {{\text{time}}} \right){\text{day}}}} $$
(2)
$$ {\text{IE}}\% = \frac{{W_{{{\text{bl}}}} - W_{{{\text{inh}}}} }}{{W_{{{\text{bl}}}} }} \times 100 $$
(3)
$$ \theta = \frac{{ W_{{{\text{bl}}}} - W_{{{\text{inh}}}} }}{{W_{{{\text{bl}}}} }} $$
(4)

where Δw represents average weight loss of mild steel, and wi and wf are initial and final weight of the coupons. wbl and winh are the weight loss values obtained in the blank and inhibited environments. A is denoted as entire area of steel, and t represents time of study, CR is the corrosion rate, IE % is the inhibition efficiency, and θ is the total surface coverage.

Electrochemical test

Detailed electrochemical test was performed using a VERSASTAT 400 full set DC Voltammetry and Corrosion System, with V3 Studio software for electrochemical impedance study over a frequency range of 100 kHz–10 MHz with a signal amplitude perturbation of 10 mV and Potentiodynamic/Galvanostat Corrosion System with E-chem software for polarization study considering ± 250 mV versus \(E_{{{\text{corr}}}}\) and further monitored systematically at a scan rate of 0.333 mV/s. In this case, three-electrode configuration was considered, including the prepared mild steel samples as the working electrode, saturated calomel electrode (SCE) as the reference electrode and platinum foil as the auxiliary electrode. Prior to EIS test, working electrode was suspended in 1.2 M H2SO4 solution without and with varying PPS concentrations for 1800s at the open-circuit potential (EOCP) to attain a stationary condition. The test temperature was maintained at 303 K. For reproducibility of average values generated and further statistical evaluation, all data set was performed in triplicates.

MIMO modeling using particle swarm optimization and response surface methodology

An attempt was made to compare PSO and RSM statistical models to optimize the expected response (output). To accomplish this task, four (4) prime factors considered as multi-input (MI) parameters were in assortment of acid conc., inhibitor conc., temperature and time, while the multi-output (MO) parameter includes weight reduction, corrosion rate and inhibition efficiency. A detailed process of a basic PSO algorithm is presented in Fig. 3:

Fig. 3
figure 3

Process flowchart of PSO

For the purpose of RSM, a regression model of second-order associating with input and output parameters is presented in Eq. (5).

$$ Y = A_{0} + A_{{1X1}} + A_{{2X2}} + A_{{3X3}} + A_{{12X1X2}} + A_{{13X1X3}} + A_{{23X2X3}} + A_{{11X1^{2} }} + A_{{22X2^{2} }} + A_{{33X3^{2} }} $$
(5)

\(Y\) is the response prediction (output), in this case IE %,\(A_{0}\) is kept constant, \(A_{1,} A_{2}\) and \(A_{3}\) are linear terms,\(A_{12,} A_{13}\) and cross-product terms,\(A_{11,} A_{22}\) and \(A_{33}\) are the quadratic terms.\(X_{i}\) is the coded factors (MI) usually programmed in levels of (+ 1, 0 and − 1). Also to validate the robustness, capability and predictive nature of the proposed model, statistical factors like sum of squares and model summary analysis were scrutinized. The R2 value was employed to scrutinize consistency or stability of the model’s order.

Computational method

Density functional theory (DFT) calculations were done in form of the electronic structure program DMol3, using a Mulliken population method. Within the context of this study electronics parameters include the Perdew–Wang (PW) local correlation density functional and restricted spin polarization using DND basis set. The geometry optimization was obtained using the COMPASS force field and Smart minimization approach. Some quantum chemical parameters like HOMO, LUMO, the energy gap ΔE (HOMO–LUMO), molecular structure and adsorption energy were performed for the isolated molecules.

Results and discussion

FTIR study

Since bioextract is made up of myriads of compounds, and these compounds adsorbed on the steel surface shielding it against corrosion. So, FTIR study of metal surface can be helpful in pinpointing actual organic inhibitors adsorbed or desorbed from the steel surface. These methods of examination were used to evidence that corrosion mitigation of metals in hostile environments is via adsorption of inhibitor molecules on the steel surface. The distinctive action of PPS on mild steel in H2SO4 solution can be elucidated with respect to the adsorption of isoflavone molecules onto the steel facial layer via lone pairs of electrons on the oxygen atom [31] and on the basis of donor–acceptor interactions between π-electrons of aromatic ring and vacant d- orbitals of Fe [32]. Thorough inspection in Fig. 4 evidenced the existence of some peaks, which could be ascribed to the functional groups. Evidently, virtually all the peaks in the seed extract residue were also detected in the adsorbed film layer on the metal surface, confirming the existence of these active groups in the inhibitor film. Some of the peaks diverged, while some vanished which signify that they have been depleted during the inhibition. In 1.2 M H2SO4 there is a shift from 1730 to 1689 cm−1due to the C = O stretch, the bands associated with O–H/N–H at 3409 shifts to 3324 cm−1, the bands associated with C-N at 1001 vanished after inhibition study. The shift of C = C and C–O stretching frequencies from 1650 to 1630 cm−1 and from 1240 to 1076 cm−1, respectively [33], suggests the adsorption of PPS molecules on the corroding metal surface.

Fig. 4
figure 4

FTIR analysis of PPS in pure form and in corrosion product

Mass spectrometry

In accordance with the GC–MS library interpretation, thorough analysis of bioactive constituents in PPS was performed and could assist in further research. Figure 5 shows the GC–MS spectrum of pigeon pea seed extract. Y-axis indicates the segment of intensity or frequency and the X-axis in minutes. The peaks reflect various heterocyclic compounds in PPS. Constituents with molecular structures having lone pairs of electrons or π electrons involved in heteroatoms such as nitrogen, oxygen and aromatics groups can be strongly adsorbed on the metal surface due to the reciprocal interaction of these electrons with vacant d-orbitals of metal atom on the steel surface. PPS naturally contains myriads of constituents with above-named structures that can enhance the inhibition cycle. PPS also has OH group embedded in their structures, and they can be trapped on the steel surface by sharing electrons of OH and vacant d- orbitals of M-steel. On the contrary, the presence of OH-group in the constituents implies that it can fuse to Ca2+ and Mg2+ ions in order to minimize water hardness and impede the formation of corrosion scales which initiates corrosion.

Fig. 5
figure 5

GC–MS of pigeon pea seed extract

Weight loss

Mass loss evaluation is a traditional and nonelectrochemical approach of predicting of corrosion rates and distinctive nature of an inhibitor, and it provides more accurate and reliable data than electrochemical method because the experimental conditions involved are arranged and carried out in a more convincing way, yet the test period or intervals are time-consuming [34]. Thus, based on the above characteristics and differences in experimental nature, the obtained values would evidently vary from the electrochemical values. Table 1 presents the inhibition efficiency (IE %) for PPS extracts at varying conditions. Close scrutiny of the results revealed that as the dosage of PPS increased, the inhibition level was also promoted due to the spontaneous attachment of active PPS molecules (concentration-dependent) which creates a barricade for mass transfer operations and averts further dissolution [31]. However, additional increase in PPS concentration does not expedite the inhibition level; on the contrary, the inhibition level remains stable or decline slightly under some conditions. This connotes that the rate of surface attachment on the steel has attained the phase of equilibrium with flat adsorption coordination [35] which also conforms to the computer simulation technique used. On the contrary, inhibition level declined bit by bit at optimum temperature (324 K); this could be associated with acquisition of severe dissolution energy influence by the corrosive agents within the hostile environment [36]. Also the dispersion of PPS molecules due to strong solution agitation by H2 gas evolution at 324 K is feasible and may cause significant reduction on the level of surface attachment by the PPS molecules [37]. The peak of inhibition was attained at 0.9 g/L−1. This is an indication that adsorption mode between the adsorbate (PPS) and the steel surface is adequately proven and result to the establishment of a dense metal-inhibitor relationship, thereby impeding the invading of chloride ions (Cl) to adsorb on the facial layer of the steel.

Table 1 Gravimetric result of MS in 1.2 M H2SO4 with PPS extract

Adsorption model and thermodynamics studies

Adsorption phenomenon by which molecules tends to adsorb on the corroding facial layer has been regarded as the starting point of corrosion inhibition. The level of surface coverage occupied by PPS molecules (θ) through traditional weight loss method was employed to scrutinize the best adsorption mode in this study. In order to further elucidate on the inhibitive action of isoflavone molecules (PPS) on the mild steel surface, Langmuir model was proposed and scrutinized for suitability using Eq. (6) Ref [38].

$$ {\text{Langmuir}}: \frac{C}{\theta } = \frac{1}{{K_{{{\text{ads}}}} }} + C $$
(6)

where \(\theta\) is the facial layer occupied by sub-planted PPS molecule, \(K_{{{\text{ads}}}}\) is the attainment of equilibrium phase, and \(C\) is dosage of PPS molecules required for inhibition. As revealed in Fig. 6, the plot of \(\frac{\mathrm{C}}{\uptheta }\) as a function of \(\mathrm{C}\) obviously specified a mathematical models of a straight line equation, with values of the slope and intercept, respectively, and linear graphs were generated and the prime regression coefficient (R2) almost one ranging from 0.988 to 0.991. However in all, the data were best fitted in Langmuir model which has the highest R2 of 0.991 and 0.988 with \(\Delta G_{{{\text{ads}}}}\) values of − 10.3 and − 10.5 at 300 K and 324 K, respectively. It shows that Langmuir model reflects the best fitting for the inhibition process via physical adsorption [38]. The nonconformity in the values of slope of the plots from one (unity) may be via repulsive forces existing within the adsorbed molecules in close area, which may have adverse influence on the heat of adsorption [39]. Also activation and thermodynamics were considered to be a vital area of interest. As presented in Table 2, \(\Delta G_{{{\text{ads}}}}\) negative values indicate the stable form of the adsorbed film layer on the mild steel surface and a spontaneous behavior of the isolated molecules during the adsorption at varying temperatures. All the negative values signify that PPS molecules intensely adsorbed onto the steel surface. According to the literature findings, \(\Delta G_{{{\text{ads}}}}\) values around − 20 kJmol−1 or lesser are linked to the electrostatic collaboration between the charged molecules and the charged metal (physisorption); those around − 40 kJmol−1 or advanced values encompass charge sharing or distribution of organic molecules to the metal surface, to establish a coordinate form of bond (chemisorption) [40] and values that falls between the two adsorption mode are indicative of mixed physiochemical mechanism [41]. However, \(\Delta G_{{{\text{ads}}}}\) values less than − 30 kJmol−1 show that the PPS adsorption phenomenon on mild steel in 1.2 M H2SO4 solution is verified through physical adsorption. In same vain as shown in Table 2 high values of \(E_{{\text{a}}}\) in inhibited solution compared to the blank system are frequently interpreted as being suggestive of formation of a stable film of physical/electrostatic force existing between –ve charged metal surface and + ve charged ions of PPS species. Conversely, \(E_{{\text{a}}}\) increases as the concentration of PPS increases. The values of \(E_{{\text{a}}}\) obtained in the inhibited medium compared to the values for the blank solution are also a confirmation of PPS extract retardation of the corrosion of metal in the hostile environment, thus resulting in near-perfect surface coverage. This is due to the physical barrier created by adsorbed PPS molecules on the facial layer.

Fig. 6
figure 6

Plot of Langmuir for mild steel in H2SO4 with PPS extract at 300 and 324 K

Table 2 The \(E_{a}\) and \(Q_{ads}\) for corrosion inhibition of MS in H2SO4 with PPS extract

Electrochemical kinetics

Figure 7a and 7b represents the open-circuit potential results obtained in the absence and presence of PPS extracts in 1.2 M H2SO4 and 0.3 M H2SO4 environments, respectively. The obtained results reveal that the solutions investigated reached an acceptable level of stable state before the beginning of the impedance and polarization experiment. The obtained potential values in each case tend to move toward the positive (noble) direction, revealing a slight anodic influence on the corrosion inhibition process.

Fig. 7
figure 7

Variation of potential with time in; a 1.2 M H2SO4 and b 0.3 M H2SO4 showing the effect of PPS extract

A corrosion system that originates from two coupled electrochemical reactions, one corresponding to oxidation of mild steel (M → Mn+  + n e) and the other to reduction of the oxidizing agent present in the electrolyte for example (2H + 2e → H2). Before the application of any external current, the absolute values of the anodic dissolution and cathodic reduction current densities are equal. The curve produced from the study is called a polarization curve (Fig. 8). This curve consists of the sum of reducing agent, anodic curve and the oxidizing agent, cathodic curve. So common is the case of only one electrode system where one of these reactions eventually becomes negligible on moving away from the Ecorr values and the curve enters the corresponding Tafel region. Potentiodynamic polarization and electrochemical impedance spectroscopy measurements were employed in the examination of the effect of various concentrations of PPS extract in 1.2 M H2SO4 and 0.3 M H2SO4 on mild steel. It was clearly observed from the listed electrochemical kinetics parameters in Table 3 that the corrosion current density which was initially 1340µAm−2 for the blank solution decreased to 758.2 and 120.7 µAm−2 for 1.2 M H2SO4 and in 0.3 M H2SO4 the value was 728.4µAm−2 for blank, 412.6 and 92.7 µAm−2 representing 0.3 and 0.9 g/L−1, respectively. This showed that the addition of PPS extract enhanced inhibition of mild steel [42], while the degree of inhibition required by the metal depends on the corresponding increase in the concentration of the extract molecules. Inevitably, it was observed that an increase in PPS extract into the aggressive solution has no significant effect on the corrosion potential (Ecorr). The value of the optimal shift in corrosion potential was extrapolated from Tafel curve. This implies that the protective ability of the inhibitor increased, while the rate at which mild steel dissolution occurred decreased. In view of the observed values of polarization data obtained, it was confirmed that the plant extract is classifiable as a mixed-mode inhibitor [43, 44]. More so, anodic and cathodic reactions engaged a charge transfer between the electronic conductors also known as electrode and an ionic conductor which is regarded as the electrolyte. This charge transfer reaction is observable from the calculated corrosion parameters in respect of βa and βc. The βa tends to accelerate adsorption of charged organic species toward noble value at active sites of the anode. In much same way, βc which represented cathodic slope is associated with hydrogen evolution at cathodic sites.

Fig. 8
figure 8

Polarization plots for M-steel in the blank and inhibited solution

Table 3 Parameter from Tafel polarization measurements

Furthermore, electrochemical test approach was successfully used to assess the corrosivity of acid electrolyte on Fe surfaces [45]. Experiments were performed to further elucidate the kinetics that occurred in the blank and inhibited media between metal and acid solution at varying concentrations of PPS. Figure 9 represents one imperfect semi-Nyquist plots generated for mild steel under varying operating conditions [46]. The impedance parameters are enumerated in Table 4. The Nyquist plots are generally made up of one large depressed capacitive loop at high frequencies and a low-frequency inductive loop. The high-frequency capacitive loop is usually associated with the charge transfer process of the corrosion reaction, including formation of an oxide film, whereas the low-frequency inductive loop may be associated with bulk or rather surface relaxation processes as a result of the adsorption of intermediate products on the oxide film forming a layer on the electrode surface. Furthermore, the ionic conductivity and dielectric properties of the oxide film show that it can be depicted as a parallel circuit of a resistor and a capacitor (Fig. 9 h, i). The observed depression of the Nyquist semicircle with center under the real axis is distinctive for solid metal electrodes that show frequency dispersion of the impedance data. Whenever this type of nonideal frequency response is present, the capacitance of the oxide film is substituted by a constant phase element (CPE) [47]. The CPE is denoted by [16].

$$ Z_{{{\text{CPE}}}} = Q^{ - 1} \left( {J\omega } \right)^{ - n} $$
(7)

where \(Q\) and \(n\) are associated with CPE and exponent, respectively, \(j^{2}\) = \(- 1\) is regarded as imaginary axis, \(\omega\) stand for angular frequency in \({\text{rads}}^{ - 1}\),\((\omega = 2\pi f\) explain frequency in \(H_{Z}\)\()\), \(R_{S}\) signifies solution resistance, \(W\) denotes the Warburg parameter, and \(n\) is the considered shifting factor.

Fig. 9
figure 9figure 9

Nyquist, Bode and Phase angle plots for M-steel in the blank and inhibited solution, and the corresponding equivalent electrical circuit models

Table 4 EIS modules for mild steel in H2SO4 with PPS extract

Using the ZsimpWin software, the Nyquist plot for the substrate in the absence and presence of the inhibitor was properly analyzed by fitting to the equivalent circuit model presented in Fig. 9, which consists of solution resistance, Rs, a CPE, Q, in parallel with parallel resistances Rct, RL1, RL2; RL1 and RL2 are in series with inductors L1 and L2, respectively. The equivalent circuit suggests the presence of two relaxation processes taking place, which is a reflection of the processes occurring on the oxide film.

Careful observation of the Bode phase angle and Bode modulus plots reveals an increase in size showing clear evidence of corrosion resistance in the presence of PPS.

Evidently as seen in the Nyquist plots, the diameter of the capacitive loop arc increases with the increase in PPS concentration, which signifies possible adsorption of PPS on the mild steel surface and also lead to increase in charge transfer resistance. Also is worth explaining that the increase in shifting mechanism of N1-N2 values (0.80–0.88) on addition of PPS can be associated with reduction in surface inhomogeneities and fractal geometry due to adsorption of PPS molecules and energy distribution in the film layer. Because 'n' values deviate from unity with PPS concentration and function of the studied inhibitor, a reciprocal connection between the molecular structures and the inhibitor's surface attachment can be inferred. Further modification or decline in capacity \(\left( {C_{{{\text{dl}}}} } \right)\) as PPS concentration increases is linked to the diminution in the local dielectric constant or an increase in the double-layer compactness, and this conforms to Helmholtz model [48].

$$ C_{{{\text{dl}}}} = \frac{{\varepsilon \varepsilon_{o} A}}{\delta } $$

ε is the dielectric constant, ε0 denotes permittivity of free area, “A” area of electrode and δ compactness of the facial layer. This upholds to the fact that PPS acts by adsorption between Fe/acid solution by substitution of H2O molecules with PPS molecules, forming a dense film layer on the Fe surface.

DFT studies

The intricate nature of bioextracts poses a major limitation in identifying of a definite molecule behind surface adsorption, thereby promoting inhibition. In view of the above, electronic/molecular structure analysis from computer modeling using density functional theory (DFT) can be considered vital to theoretically assess the synergistic nature of the isolated constituents of the extracts [49]. The optimized/electronic structures of the molecules indicated in Figs. 10a and 11a evidently exhibit desirable characteristics of electron-rich areas. The strength of a molecule to transfer electrons can be identified by maximum value of EHOMO, while detailed insight to receive electrons is an indication of low ELUMO values [50]. Also the variation between EHOMO and ELUMO energies denotes the energy gap (∆E), which is also an important parameter to scrutinize and justify the stability index of a corrosion inhibitor. The lower the (∆E) value, the better is the mutual relationship between the inhibitor and Fe surface. Conferring to the results in Table 5, PPS has high values of EHOMO and low ELUMO. Within the context of this study, molecular dynamics was adopted to elucidate on the mechanism of inhibition via adsorption. Thus, detailed understanding on the adsorption phenomenon among inhibitors and Fe surface is of great importance, as such MD simulation can be helpful to pinpoint the molecule’s atoms that have good mutual interaction with the Fe surface. Highest occupied molecular orbital (HOMO) represents the area where the isolated molecules and Fe surface demonstrate optimum bonding activity. The lowest unoccupied molecular orbital (LUMO) denotes the area in which the isolated molecules and Fe surface also display anti-bonding orbital to form a bond which aids mutual interaction between PPS molecules and Fe surface. The relation between the metal surfaces and the atoms of the studied inhibitor molecules depends solely on the optimized geometry of the inhibitors as well as the nature of their frontier molecular orbitals HOMO and LUMO. The interpretation of the results for HOMO areas in both compound provides a simple and general explanation of the feasible adsorption center of the cajanin 5,2,4-trihydroxy-4methoxyisoflavone and cajanol 5,4-dihydroxy-7,2-dimethoxyisoflavanone inhibitors, and the electron density of the HOMO level in the both compounds is well localized around the double bonds of the benzene rings where the \(\pi\)- electron oxygen heteroatoms and hydroxyl group are found. Thus, the hydroxyl group and lone pair electrons of oxygen atoms provide a great synergy to the binding mechanism and thus increase the adsorption centers of the inhibitors, whereas in the case of LUMO level, no significant difference is observed. The interaction between the adsorbate and the Fe surface is shown in Figs. 10e and 11e; this illustrated the distance (L) between the oxygen atoms of both inhibitors with surface of the metal leading to a stable complex film. The adsorption energy for cajanol (188 kJ/mol) was found to be lower than cajanin (212 kJ/mol), and this could be classified as physical adsorption mechanism, whereas the cajanin possesses the characteristics of chemical adsorption. Figures 10f and 11f show plot of enthalpy versus optimization steps. The results demonstrated a decrease in enthalpy with increase in the optimization steps reflecting exothermic and endothermic reaction of the corrosion process based on the negative and the positive sign of the enthalpy values shown on the plots.

Fig. 10
figure 10

MD simulation for cajanin molecule

Fig. 11
figure 11

MD simulation for cajanol molecule

Table 5 Calculated quantum chemical parameters of the PPS molecule

Multi-input multi-output modeling using PSO and RSM model

PSO prediction

Prior to experiment, independent variables and output responses were systematically used considering the mathematical model equations in terms of actual and coded factors. PSO was used as a statistical method to optimize and predict the fitness between the available data set and the expected responses. As presented in Table 6, Y1, Y2 and Y3 represent the output predictions by PSO. Maximum inhibition efficiency of 91% was predicted.

Table 6 Particle swarm optimization results

RSM prediction

In view to further analyze the effect of varied operating conditions on the expected responses, 3D-surface plots were adopted to analyze the variables that have significant effects on the corrosion mechanism via RSM prediction [51]. From the 3D plots (Fig. 12), details of interactions were highlighted. Impact of PPS concentration was significant, increase in PPS at 0.9 g/L−1create spontaneous formation of the feasible adsorption areas of the molecule on the steel surface, thereby impeding the level of iron oxide formation which also necessities corrosion. Rise in electrolyte concentration expedites the level of surface dissolution giving rise to invading of corrosion agents. Effect of temperature and acid concentration is a major concern in corrosion studies. Increase in temperature up to 324 K disperses the extract molecules from the steel surface causing a lower surface coverage by PPS extract. As the electrolyte concentration increases, the level of corrosion also increases due to the availability of chloride ions. Thus increase in both variables expedites the electrochemical process. Effect of time is a stand-out criteria to assess the stability of the adsorbed film layer within a specific period. At the beginning of the study, there was a rapid formation of the active molecules via surface adsorption but later attain phase of equilibrium, while increase in electrolyte concentration resulted in a decrease in the surface coverage. The effect of temperature has always been a negative factor affecting the level of metal protection. On the contrary, at optimum concentration of PPS (0.9 g/L) a significant inhibition mechanism was achieved owing to the availability of active molecules needed for surface adsorption. Effect of time and inhibitor concentration is the most significant input variables; effect of time at early period of study was significant owing to the rapid adsorption of PPS molecules. In addition to that effect, the gradual increase in PPS concentration expedites surface attachment of the heterocyclic molecules, thereby promoting the inhibition efficiency of 94% as listed in Table 7. In same vain, after 21 h of study the active molecules appear to attain equilibrium state, and no further observation was recorded. The effect of time and temperature was discussed; the surface coverage declines gradually with an increase in time and temperature, reason being that the longer the exposure time, more the metal corrodes and at elevated corrosive conditions; the metal becomes physically adsorbed.

Fig. 12
figure 12figure 12figure 12

3D surface plots for multi-input multi-output modeling using RSM prediction

Table 7 Experimental range and levels via RSM

From the comparative analysis between PSO and RSM as a statistical method, RSM is more robust with high degree of accuracy.

Model fitness

Four variables were systematically correlated with three responses, Y1, Y2 and Y3 using quadratic model equation. The coded factors are shown in Eqs. (9), (10) and (11) generated from the experimental data.

$$ Y_{1} = + 0.41 + 0.028*A - 0.18*B + 0.099*C + 0.053*D - 0.012*AB - 2.5*AC + 0.025*BC + 0.017*BD + 5.0*CD \, + 0.057*A^{2} + 0.017*B^{2} + 6.57*C^{2} + 6.57*D^{2} $$
(9)
$$ Y_{2} = \, + 1.47 + 0.075*A - 0.82*B + 0.45*C - 0.92*D - 0.030*AB - 6.0*AC + 0.06*BC + 0.36*BD - 0.21*CD + 0.23*A^{2} + 0.086*B^{2} + 0.050*C^{2} + 0.43*D^{2} $$
(10)
$$ Y_{3} = \, + 68.37 + 2.14*A + 14.36*B - 4.43*C + 2.88*D - 0.43*AB - 0.011*AC + 1.83*BC - 1.25*BD - 0.051* \, CD - 7.45*A^{2} - 0.75*B^{2} + 2.20*C^{2} - 1.50*D^{2} $$
(11)

In view of multiple variables considered as input. The effect of one variable is adequately satisfied by the coefficient of a factor, while the interaction between the four variables and the quadratic factor is well defined by coefficient of two or more factors. A positive sign is an indication of combined effect, while a negative sign denotes antagonistic process [52].

To further appraise the fitness of the proposed model, a statistic overview and ANOVA were used [53]. ANOVA results are presented in Table 8, and the statistic overview shows mean of 0.47, standard deviation 0.024, ////R2 0.991, adj. R2 0.982 and C.V.% 5.07 for weight loss. For corrosion rate, mean 1.94, standard deviation 0.13, R2 0.993, adj. R2 0.986 and C.V.% 6.80 while inhibition efficiency shows mean of 63.86, standard deviation 1.60, R2 0.992, adj. R2 0.984 and C.V.% 2.51. Also from Table 8, Y1 parameter shows that A, B, C, D, BC, BD, A^2 are significant terms. Y2 A, B, C, D, BC, BD, CD, A^2, D^2 and Y3 A, B, C, D, BD, A^2, C^2 were significant, respectively. The observed high R2 values imply that the model was well suited to the responses [54]. The second-order analysis for the output responses is an indication that the models were significant because the f values were satisfactorily high. Also, for quadratic models, p values provide vital information of the model in relation to the f value less than 0.05. For a 90–99% performance level, it shows that model overview was reasonably significant.

Table 8 ANOVA results for three responses

Inhibition mechanism

The experimental result evidenced that PPS (isoflavone molecules) was inhibiting the dissolution of mild steel in 1.2 M H2SO4 electrolyte. The nature of the result obtained inferred that the corrosion protection ability was caused by the PPS molecules tending to interact and adsorbed on the MS/solution interface. It is generally known that the adsorption process is govern by several factors, the chemical composition of the electrolyte, nature of the metal and electro-kinetics potential at the MS/solution interface [55]. The corrosion inhibition process is attributed to the physical adsorption of PPS molecules on the MS surface. The inhibiting effects of PPS may be corresponding to the spontaneous accumulation of the isoflavone molecules on the MS which obstruct or impede direct contact of the MS surface with the electrolyte species. The π electrons in the aromatic ring and the empty d orbital of the Fe atoms form a donor–acceptor, which is adsorbed on the metal surface to establish a passivation film [56]. On the contrary, the protonated species of PPS are adsorbed on the metal through electrostatic attraction between the protonated and the negatively charged ions adsorbed on the MS surface, resulting in physical adsorption, Fig. 13 [57].

Fig. 13
figure 13

Schematic diagram of inhibition mechanism of PPS in the blank and inhibited solution

SEM/AFM

SEM/AFM are considered to be good techniques to establish a detailed surface interaction of inhibitors and metal surface. Figure 14a depicts a micrograph of the sample in blank electrolyte which evidenced coarse and uneven layers with cavities and pores throughout the surface due to corrosion attack [58]. For the inhibited sample, Fig. 14c the degree of hostile attack on the MS was massively minimized and the surface appeared to be uniform/normal compared to blank sample. Such phenomenon conforms to the establishment of a thin film layer after 21-h study containing 0.9 g/L−1 PPS [59]. AFM photographs illustrate the 3D images for the MS in 1.2 M H2SO4 with and without inhibitor. Figure 14b shows corrosion topography of MS with high level of macro- and micropits [60]. The obtained average roughness was 433 nm. On the contrary, Fig. 14d portrays a different surface nature. The isolated molecules impede the level of macro- and micropits with average roughness 100 nm, and this affirms the existence of a thin film layer on MS obstructing direct contact with the electrolyte [61].

Fig. 14
figure 14

SEM /AFM study of mild steel in a, b blank electrolyte and c, d inhibited medium

Conclusion

Based on the indices obtained, the following points can be inferred.

  • PPS exhibited good inhibiting performance for mild steel corrosion in oilfield descaling environment.

  • FTIR and GC MS analysis confirmed the existence of various functional groups in the PPS extract.

  • Polarization test result revealed that PPS acted as a mixed-mode inhibitor.

  • Adsorption studies demonstrated that adsorption for this inhibitor obeyed Langmuir adsorption isotherm.

  • DFT studies confirmed the consistency of the employed techniques.

  • The statistical models developed analyzed the nonlinear interactions between independent variables and the expected responses.