1 Introduction

Mild steel has an extensive variety of industrial application due to its low cost, availability, and ductility. However, this metal suffers from corrosion because of its contact with mineral acids, particularly hydrochloric acids, which are widely used for acid cleaning, acid descaling, acid pickling, and oil well acidizing [1,2,3]. Last decades, the search for new eco-friendly and efficient solution becomes an obligation to prevent metallic materials from corrosion. The use of organic molecules containing heteroatoms (nitrogen, oxygen, sulfur atoms, heterocyclic compounds, and π-electrons) as corrosion inhibitors for steels in acidic medium is well developed [3,4,5,6,7,8,9]. In fact, these organic inhibitors have proved an efficient effect to prevent metals and its alloys from corrosion through adsorption process on the metallic surface. Several factors, including molecular size of inhibitor, nature of substituents, inhibitor concentration, temperature, and nature of test solution, influence the inhibition mechanism [10,11,12].

Sodium polyacrylate and poly(acrylic acid) belong to polyelectrolytes ionizable groups which are able to dissociate in a polar solvent (usually water) [13]. The presence of charged groups in the structure of these polymers increases solubility chains and makes them widely used in industrial applications [14, 15], especially in agriculture [16], hygiene products [17], medicine [18], pharmaceuticals [19], cosmetic industry, paper industry, and alumina industry [20].

Therefore, the aim of this work is to study the anticorrosive properties of two acrylic polymers PANa and PAA which have been previously studied as a removal of heavy metals in wastewater treatment [21, 22], on mild steel corrosion in 1.0 M HCl using stationary method (polarization curves), transient method [electrochemical impedance spectroscopy (EIS)], Bode plots, scanning electron microscopy (SEM), asnd Energy-dispersive X-ray Analysis (EDAX). The mathematical modeling and the thermodynamic study were also explored to evaluate and define the adsorption process type. Besides, the computational investigations using DFT, MD, and MC simulations were evaluated in order to study the electronic properties as well as the reactivity of PAA and PANa molecules with steel surface.

2 Experimental details

2.1 Preparation of working electrodes

The study was carried out on mild steel in which the chemical composition (wt %) is shown in Table 1. Before each experiment, the specimen’s surface was polished with emery paper at different grit sizes (from 180 to 1200), cleaned with double-distilled water, degreased with ethanol, and dried at hot air.

Table 1 Chemical composition of mild steel (wt%)

2.2 Solution preparation

The studied inhibitors are considered as the most popular acrylic polymers. They contain –COO groups:

  • Sodium polyacrylate (PANa) white powder, under reference: Model Number SNN560-011, supplied by the company Henan CXH Purity Industrial and Trading Co., Ltd. On Origin: Henan, China (Mainland). This polymer is characterized as follows:

    • Ionization rate = 100%,

    • Cross linking ratio r = 1%,

    • 10 mmol of –COONa corresponding to one gram of polymer sites

  • Poly(acrylic acid) (PAA) powder whose grain diameter is close to 0.5 mm synthetized by Norsolor-AtochemCoCompany (France). This polymer is characterized as follows:

    • Ionization rate = 80%,

    • Cross linking ratio r = 1%,

    • 10 mmol of –COO(H,Na) corresponding to one gram of polymer sites.

PANa and PAA were studied without any pretreatment. The molecular formula of both inhibitors is illustrated in Table 2.

Table 2 PANa and PAA properties

The corrosive medium was 1.0 M hydrochloric acid prepared from 37% analytical grade reagent by dilution with double-distilled water. From a stock solution, four diluted solutions containing PANa and PAA were prepared with different concentrations 5 × 10–5, 10–5, 5 × 10–6, and 10–6 M.

2.3 Gravimetric study (weight loss)

Gravimetric measurements method was performed on different specimens of mild steel at 298 ± 1 K with different concentrations of PANa and PAA (5 × 10–5, 10–5, 5 × 10–6, and 10–6 M). The mild steel specimens (1.0 × 4.0 × 0.1 cm3) were completely immersed in a glass flask containing 100 ml test solution in 1.0 M HCl for 6 h. They were taken out, rinsed with double- distilled water, scrubbed gently with a bristle brush to remove the corrosion products, washed successively with double-distilled water, and acetone dried until obtaining constant weight.

Experiments of weight loss measurements were performed in three different measurements. In each case, the mean value of the experiment has been reported. The weight loss was calculated from the difference obtained by measuring the specimen’s weight before and after the immersion. The inhibition efficiency (\(\eta_{\omega }\), %) and the surface coverage (θ) were calculated from Eqs. (1) and (2):

$$\eta_{\omega } \% = \frac{{\omega_{{{\text{corr}}}}^{0} - \omega_{{{\text{corr}}}} }}{{\omega_{{{\text{corr}}}}^{0} }} \times 100,$$
(1)
$$\theta = {{\eta_{\omega } \% } \mathord{\left/ {\vphantom {{\eta_{\omega } \% } {100}}} \right. \kern-\nulldelimiterspace} {100}},$$
(2)

ω0corr and ωcorr are, respectively, the corrosion rates in the absence and the presence of inhibitors.

2.4 Electrochemical analysis methods

An electrolysis cell that is a borosilicate glass cylinder (Pyrex®) was used in order to investigate all electrochemical measurements. The cell contains three electrodes: the working electrode (WE) which is a mild steel substrate pressurized in a polytetrafluoroethylene (PTFE) support, so that only 1 cm2 of electrode has been immersed vertically in the aggressive solution. The electrolysis cell contains also platinum and saturated calomel that were used, respectively, as a counter electrode (CE) and a reference electrode (SCE).

2.5 Potentiodynamic polarization (stationary method)

The potentiodynamic polarization (IE) curves were realized by changing the electrode potential automatically from negative to more positive values versus Ecorr using a Potentiostat/Galvanostat model PGZ 100, at a scan rate of 1 mV s−1. The open-circuit potential (OCP) was evaluated from potential time curve, which was proved sufficient to attain the stability of Ecorr. The working solution was thermostatically controlled at 298 ± 2 K in air atmosphere.

To investigate parameters of corrosion kinetic, a fitting by Stern–Geary equation was studied. The overall current density values, i, were considered as the product of two contributions, anodic, and cathodic current ia and ic, respectively. It can be considered that both processes obey the Tafel law. It can be derived from Eq. (3):

$$i = i_{a} + i_{b} = i_{{{\text{corr}}}} \times \left\{ {\exp \left[ {b_{a} \times \left( {E - E_{{{\text{corr}}}} } \right)} \right] - \exp \left[ {b_{c} \times \left( {E - E_{{{\text{corr}}}} } \right)} \right]} \right\},$$
(3)

where icorr is the corrosion current density (Acm−2); ba and bc are the Tafel constants of anodic and cathodic reactions (V−1), respectively. These constants are obtained from the Tafel slopes β (V dec−1) in usual logarithmic scale described by Eq. (4):

$$\beta = \frac{\ln (10)}{b} = \frac{2.303}{b}.$$
(4)

The corrosion parameters were obtained by non-linear least square method by Eq. (3) using Origin Pro8 software. The potential range applied was limited to ± 0.100 V around Ecorr, else a significant systematic divergence was sometimes observed for both anodic and cathodic branches.

The corrosion inhibition efficiency is evaluated from the corrosion current density values using Eq. (5):

$$\eta_{{{\text{pp}}}} = \frac{{i_{{{\text{corr}}}}^{0} - i_{{{\text{corr}}}} }}{{i_{{{\text{corr}}}}^{0} }} \times 100.$$
(5)

The surface coverage values (θ) have been achieved from Tafel plots corresponding to the different concentration values of PAA and PANA using the following equation:

$$\theta = \frac{{i_{{{\text{corr}}}}^{0} - i_{{{\text{corr}}}} }}{{i_{{{\text{corr}}}}^{0} }},$$
(6)

where icorr0 and icorr, respectively, are the corrosion current density values in the absence and the presence of the inhibitor.

2.6 Electrochemical impedance spectroscopy (transient method)

The Electrochemical Impedance Spectroscopy (EIS) study was effectuated by employing a transfer function analyzer (VoltaLab PGZ 100) using 10 mV ms−1 as amplitude AC signal with frequency spectrum ranging from 100 kHz until 100 MHz with five points per decade. The diagrams were resulted using Nyquist representation. The obtained data were analyzed and then illustrated as an equivalent electrical circuit by applying Boukamp program.

The inhibition efficiency derived from EIS, ηEIS, is also added in Table 3 and calculated was using Eq. (7):

$$\eta_{{{\text{EIS}}}} \% = \frac{{R_{{\text{p}}} - R_{{\text{p}}}^{0} }}{{R_{{\text{p}}} }} \times 100,$$
(7)

where Rp0 and Rp represent the charge transfer resistance values in the absence and in the presence of PANa and PAA, respectively.

Table 3 Gravimetric parameters at different concentration values of PANa and PAA

The interfacial double-layer capacitance (Cdl) was calculated from the impedance value using Bode plots by Eq. (8):

$$\left| Z \right| = \frac{1}{{2\pi fC_{{{\text{dl}}}} }},$$
(8)

In order to verify reproducibility, all measurements were repeated three times. The inaccuracy did not exceed 5%.

2.7 Quantum chemical calculations

The calculation of quantum chemical descriptors has been widely used to study reaction mechanisms. It is also approved to be a very important tool to study the physical properties related to the structure of inhibitor. The quantum chemical descriptors were computed using Functional Density Theory (DFT) method at the Becke-3-parameter-Lee–Yang–Parr (B3LYP) level on the 6-31G (d,p) basis. All these calculations were performed by the Gaussian (03).

DFT descriptors, including gap energy, absolute chemical hardness (η), absolute chemical softness (σ), electronegativity (χ), electrophilicity (ω), and number of electrons transferred (∆N), are calculated using the following equations [23,24,25]:

$${\Delta }E\,{ = }\,E_{{{\text{LUMO}}}} - E_{{{\text{HOMO}}}} ,$$
(9)
$$\eta { = }\frac{{{\Delta }E}}{{2}}{ = }\frac{{E_{{{\text{LUMO}}}} - E_{{{\text{HOMO}}}} }}{{2}},$$
(10)
$$\sigma \, = \, \frac{1}{\eta } \, = \, - \frac{2}{{E_{{{\text{HOMO}}}} - E_{{{\text{LUMO}}}} }},$$
(11)
$$\chi \,{ = }\,\frac{{{(} - E_{{{\text{HOMO}}}} {) + (} - E_{{{\text{LUMO}}}} )}}{{2}},$$
(12)
$$\omega \,{ = }\,\frac{{\chi^{{2}} }}{{{2}\eta }},$$
(13)
$${\Delta }N\,{ = }\,\,\frac{{\chi_{{{\text{Fe}}}} - \chi_{{{\text{inh}}}} }}{{{2}\left( {\eta_{{{\text{Fe}}}} { + }\eta_{{{\text{inh}}}} } \right)}}.$$
(14)
  • \(\chi_{{{\text{Fe}}}}\) and \(\chi_{{{\text{int}}}}\) represent the absolute electronegativity of iron and both studied inhibitors, respectively;

  • \(\eta_{{{\text{Fe}}}}\) and \(\eta_{{{\text{inh}}}}\) indicate, respectively, the absolute hardness of iron and the inhibitor molecule;

  • The theoretical values of \(\chi_{{{\text{Fe}}}} {\text{ = 7 eV}}\) and \(\eta_{{{\text{Fe}}}} { = 0}\) are used to calculate the number of electrons transferred [26].

2.8 Monte Carlo (MC) and molecular dynamic (MD) simulation details

The interaction between the inhibitor molecules (PAA and PANa) and the iron plane surface Fe (1 1 0) was investigated using Monte Carlo simulations.

Monte Carlo simulations were used to scrutinize the interactions between the inhibitor’s molecules (PAA and PANa) and Fe (110) surface. In a typical simulation study, four atom-tick of (Fe(110) surface to satisfy the periodic boundary conditions. A simulation cell with the size of 32.271 Å × 32.271 Å × 6.461 Å with the insertion of a 30 Å vacuum layer at C axis. To simulate the corrosion system 730 water molecules/1 inhibitor molecule (either PAA or PANa)/30 sodium + 30 chloride ions. MC simulations are conducted using the adsorption locator module integrated with the Materials studio 7.0 software [27, 28]. Also, the calculations were executed based on optimized molecular fields in condensed phase for atomic simulation studies (COMPASS). NVT canonical ensemble at 298 K is used for MD run with a 1 fs time step and a total simulation time of 500 ps [29,30,31]. Berendsen thermostat is used to control the temperature while running the simulations [32]. For accuracy, the reliable COMPASSII force field is used for MC and MD simulations [33,34,35]. The radial distribution function (RDF) analysis included the complete MD trajectory [36, 37].

3 Results and discussion

3.1 Gravimetric study

The effect of concentration of PANa and PAA on the inhibition of mild steel corrosion in 1.0 M HCl was studied using weight loss technique due to its good reliability and simplicity. The inhibition efficiency (\(\eta_{\omega }\), %), the corrosion rate (ω0), and the surface coverage (θ) at various concentrations of the inhibitors are given in Table 3. Furthermore, calculating precision is essential to determine if the weight loss measurements well enough to get good data. Also, it is very important to choose the best measure of precision. In our case, the precision of the corrosion rate is calculated by using three different measurements. The standard deviation (σcorr) is a robust statistic for measuring the precision. σcorr can be estimated utilizing the following formula:

$$\sigma_{{{\text{corr}}}} = \sqrt {\frac{{\sum {\left( {X - \mu } \right)^{2} } }}{n}} .$$

The obtained results have revealed that both the studied polymers provide good protection for mild steel against corrosion inhibition in 1 M HCl medium. The inhibition efficiency has attained 97% for PAA and 93% for PANa at 5 × 10−5 M. The highest value of the inhibition efficiency obtained for PAA is attributed to the substitution of sodium carboxylate groups (–COO, Na+) with carboxylic groups (–COOH), which influence the adsorption of this polymer on mild steel surface, then indicate that the inhibition efficiency is proportional to OH groups which the polymer contains. According to the literature, substances that contain functional groups, such as –OR, NR2 and/or SR, –COOH, can be used as a good corrosion inhibitor of metallic surfaces in acid solutions [38, 39].

3.2 Potentiodynamic polarization measurements

Figure 1 shows the potentiodynamic polarization curves for mild steel in 1.0 M HCl solution in the absence and the presence of different concentration values of PANa and PAA. The values of icorr, Ecorr, βc, and βa were evaluated by Tafel extrapolation method of linear part of the cathodic branch and are summarized in Table 4. It is seen that the addition of the studied acrylic polymers reduces at the same time anodic metal dissolution and cathodic hydrogen evolution reactions. The reduction of icorr was more pronounced by increasing inhibitors concentration.

Fig. 1
figure 1

Potentiodynamic polarization curves for mild steel in 1.0 M HCl in the presence of different concentrations of PAA and PANa

Table 4 Electrochemical parameters of mild steel in 1 M HCl solution in the presence of different concentrations of PAA and PANa

The increase of inhibition efficiency values with the increase of PANa and PAA concentrations indicates that the tested polymers act as inhibitors by adsorption on the metallic surface [40, 41].

It is clear that the presence of PAA and PANa affects cathodic and anodic current densities. These polymers could be classified as a mixed type of corrosion inhibitors. However, the cathodic Tafel slopes (βc) change after adding PANa and PAA to aggressive solutions which reveal the modification of hydrogen reduction reaction. All results suggest that these polymers can act as an excellent inhibitor of corrosion process of mild steel by covering the surface with a layer due to reactive molecules adsorption which the inhibitor contains. Moreover, the low value of inhibition efficiency corresponding to PANa in comparison with PAA can be attributed to the low electron densities around the chemisorption center. The studied polymers can produce protons in the corrosive solution through interaction of –COO group with HCl. This reaction is easier in the case of the presence of –OH in PAA and its absence in PANa. The better performance of PAA over PANa is also due to the more surface area which leads to more adsorption on the metal surface, thereby exhibiting a better inhibitory effect [42]. This deference may be related to the degree of cross linking of the polymeric chains.

3.3 Electrochemical impedance spectroscopy (EIS) studies

The Nyquist diagrams of working electrode in 1.0 M HCl solution without and with addition of selected concentrations of the studied inhibitors at corrosion potential are shown in Fig. 2. It is evident from these plots, that the addition of both inhibitors to corrosive solution increase impedance values. This increase became more significant after the addition of high concentrations of PANa and PAA.

Fig. 2
figure 2

Nyquist plots corresponding to mild steel in 1.0 M HCl at different concentrations of PAA and PANa

In fact, Nyquist plots contain a semi-circular shape with only time constant in all tested concentrations, over the studied frequency range, which is associated with a charge transfer mechanism on the substrate surface [43]. This mechanism mainly controls the mild steel corrosion. In this case, the equivalent electric circuit (EEC) illustrated in Fig. 5 was suggested to reproduce these results by non-linear regression calculation. Excellent fit with this model was obtained for all experimental data. The simulated Nyquist and Bode plots for mild steel in acid solution in the presence of PAA and PANa and the absence of the inhibitors are presented in Figs. 2, 3, and 4. It was observed that the simulated data using the equivalent electric circuit (Fig. 5) and the original Nyquist plot have the same pattern.

Fig. 3
figure 3

Bode plots corresponding to mild steel in 1.0MHCl at different concentrations of PAA and PANa

Fig. 4
figure 4

Simulated Nyquist and Bode plot for mild steel in 1 M HCl at 298 K

Fig. 5
figure 5

The equivalent circuit model used to fit the impedance measurement

The Constant Phase Element (CPE) was suggested in parallel to Rct in order to investigate the inhibitive film properties on metallic surface. The impedance of the CPE can be described by the following equation:

$$Z_{{{\text{CPE}}}} = \frac{1}{{Q(j\omega )^{n} }},$$

where j is the imaginary number, Q is the frequency independent real constant, ω = 2πf is the angular frequency (rad s − 1), f is the frequency of the applied signal, n is the CPE exponent, which indicates the degree of surface inhomogeneity [44], and CPE is the classical lumped element capacitor (C) and resistance(R).

The introduction of inhibitors had increased n values from 0.773 to 0.885 and 0.881 for PAA and PANa, respectively, which implicate the decrease of surface inhomogeneity considering the adsorption of polymer molecules.

The double-layer capacitance (Cdl) derived from the CPE parameters was calculated according to Eq. (16) [45]:

$$C_{{{\text{dl}}}} = \left( {Q_{{{\text{dl}}}} R^{1 - n} } \right)^{{_{1/n} }} .$$

All obtained data from the equivalent circuit are presented in Table 5. It is clear that the inhibitors concentrations increase, the impedance and the Cdl values decrease caused by a decrease in local dielectric constant and/or an increase in the thickness of the double layer. These results can suggest that inhibitors molecules inhibit the mild steel corrosion by adsorption at the metal/acid interface. It is shown that n values increase with the increase of PANa and PAA concentrations, then the metal surface heterogeneity increases with the adsorption of the inhibitors molecules forming a uniform layer responsible for the mild steel inhibition.

Table 5 Fitting results of EIS for mild steel in 1.0 M HCl in the absence and presence of different concentrations of PAA and PANa

In addition, the resistance values of charge transfer have confirmed the potentiodynamic polarization results, which concluded that PAA has given better results than PANa for mild steel inhibition.

It is found that, as the inhibitors concentrations increase, the Rp values increase, but the Cdl values tend to decrease. The decrease in the Cdl value is due to the adsorption of PANa and PAA on the metal surface. This decrease can be caused by a decrease in the local dielectric constant and/or the increase in the thickness of the double layer. It shows that the molecules of inhibitor act by adsorption at the solution–metal interface.

According to Bode diagrams, the slope of the linear part is different to − 1, which implicates the inhomogeneity of the specimen surface. The evolution of log (Z) versus log (freq) has shown a shift of the phase angle toward negative values after addition of PAA and PANa to the aggressive medium, which includes the adsorption of the active sites of the studied polymers on the surface of the working electrode immersed in corrosive solution [46].

3.4 Thermodynamic study

In order to determine the adsorption type of PAA and PANa and its efficiency at higher temperatures, potentiodynamic polarization technique was used with temperatures ranging from 293 to 323 K for mild steel electrode in 1.0 M HCl without and with 5 × 10−5 M of PAA and PANa after an hour of time immersion. The obtained results were presented in (Fig. 6). It is clear that the increase of temperature does not change the iron dissolution and hydrogen evolution mechanism. The oxidation of Fe and reduction of H+ ions at the mild steel surface was produced through a charge transfer mechanism.

Fig. 6
figure 6

Effect of temperature on the behavior of mild steel/1 M HCl interface in the absence of the inhibitor (c) and the presence of 5 × 10−5 M of PAA (a) and 5 × 10–5 M of PANa (b)

The corresponding results are given in Table 6. It is noticed that the increase of temperature leads to the increase of cathodic and anodic current density values and consequently the increase of icorr values. Moreover, the increase in current density is highly more pronounced in uninhibited than inhibited media. However, there is no significant change concerning Ecorr values at higher temperatures without and with addition of PAA and PANa. The increase of temperature medium has affected both the cathodic hydrogen evolution reaction as well as anodic mild steel dissolution with the rise of temperature.

Table 6 Electrochemical parameters of mild steel in 1.0 M HCl with and without 5 × 10–5 M of PAA and PANa at different temperatures

icorr values increase with the increase of medium temperature, while \(\eta_{{{\text{pp}}}}\) values decrease. This behavior reflects physical adsorption of PAA and PANa on the mild steel surface. The inhibition properties of the studied inhibitors can be explained by kinetic model. The dependence of the corrosion value icorr on the temperature can be regarded as Arrhenius-type process given by Eq. (17) [45]:

$$\ln i_{{{\text{corr}}}} = \ln A - \frac{{E_{{\text{a}}} }}{{{\text{RT}}}},$$

where Ea is the apparent activation energy of corrosion process, R is the universal gas constant, A is the Arrhenius pre-exponential constant, and T is the absolute temperature.

The Arrhenius plot of mild steel in the absence and presence of 5 × 10–5 M of PAA and PANa corresponding to the higher efficiency values according to Eq. (17) is presented in Fig. 7. The apparent activation energy values (Ea) were determined from the slope of ln (icorr) vs. T−1 plots and are shown in Table 7. All the linear regression coefficients are very close to one, which indicates that the mild steel corrosion in 1.0 M HCl solution can be modeled using Arrhenius equation.

Fig. 7
figure 7

Arrhenius plots ln (Icorr) vs. T−1 of mild steel in 1.0 M HCl without and with 5 × 10–5 M of PAA and PANa

Table 7 Activation parameters Ea, ΔHa, and ΔSa for mild steel in 1.0 M HCl in the absence and presence of PAA and PANa

The Ea values in the presence of inhibitors are higher than values corresponding to blank solution. The decrease of corrosion rate is determined by the apparent activation energy Ea. The comparison of Ea values corresponding to the corrosion process without and with addition of PANa and PAA can provide further evidence concerning the inhibition mechanism [47]. The decrease of the inhibitor efficiency with the increase of medium temperature refers to a higher value of Ea in comparison with the blank. These results can be attributed to the electrostatic character of the inhibitor’s adsorption. From Table 7, the addition of PAA and PANa affects the Ea values; this modification may be explicated by the change in the corrosion mechanism in the presence of inhibitor molecules [48].

The Ea values were up to 20 kJ mol−1, which reveal that the inhibition process is controlled by the surface reaction [49]. In fact, PANa and PAA have blocked some of active sites on the metal surface. The inhibitors were adsorbed through most active sites in the metal surface, where the Ea values are low and thus have isolated them. Other active sites with higher Ea values have continued corrosion process.

Other kinetic data were determined using the alternative formulation of the Arrhenius Eq. (18) [50]:

$$i_{{{\text{corr}}}} = \frac{{{\text{RT}}}}{{{\text{Nh}}}}e^{{\left( {\frac{\Delta S}{R}} \right)}} e^{{\left( { - \frac{\Delta H}{{{\text{RT}}}}} \right)}} ,$$

where h is Plank’s constant, N is Avogadro’s number, ΔS is the activation entropy, and ΔH is the activation enthalpy.

Plots of ln (icorrT−1) vs. T−1 are presented in Fig. 8 for mild steel in 1 M HCl in the absence and presence of 5 × 10–5 M of PAA and PANa.

Fig. 8
figure 8

Arrhenius plots (ln(icorr T−1) vs. T−1) for mild steel in 1 M HCl without and with 5 × 10–5 M of PAA and PANa

The values ΔH and ΔS were calculated and are listed in Table 7. The positive values of enthalpy ΔH have implicated the endothermic nature of the steel dissolution process, while the negative values of entropy ΔS have proved that disorder of metal dissolution had decreased [51, 52].

3.5 Adsorption isotherms

The adsorption isotherms can provide additional information about inhibition mechanism of an inhibitor [21]. Several isotherm models have been considered, such as Temkin, Langmuir, and Frumkin (Eqs. (19), (20), and (21)) [53].

$${\text{Temkin isotherm}} e^{f\theta } = K_{{{\text{ads}}}} C_{{{\text{inh}}}} ,$$
(19)
$${\text{Langmuir isotherm}} \frac{\theta }{1 - \theta } = K_{{{\text{ads}}}} C_{{{\text{inh}}}} ,$$
(20)
$${\text{Frumkin isotherm}} \frac{\theta }{1 - \theta }e^{ - 2f\theta } = K_{{{\text{ads}}}} C_{{{\text{inh}}}} ,$$
(21)
$${\text{Freundlich isotherm}} \theta = K_{{{\text{ads}}}} C_{{{\text{inh}}}} {,}$$

where the fractional coverage surface (θ) is evaluated from impedance measurements given in Table 5, Kads is the equilibrium constant of adsorption process, Cinh is the inhibitor concentration, and f is the factor of energetic inhomogeneity. The linear coefficient regression (LCR), R2, and the slope were used to choose the suitable isotherm (Table 8). Kads is related to the free energy of adsorption, ΔGads, by Eq. (23) [52]:

$$K_{{{\text{ads}}}} = \frac{1}{55.5}e^{{ - \frac{{\Delta G_{{{\text{ads}}}} }}{{{\text{RT}}}}}} ,$$
(23)

where the value 55.5 is the water concentration in solution (mol L−1), T is the absolute temperature, and R is the universal gas constant.

Table 8 Parameters corresponding to Langmuir model for mild steel in 1.0 M HCl in the presence of PAA and PANa

The Langmuir isotherm curve is represented in Fig. 9 and was characterized by correlation factor around unity (r ≈ 1). The adsorption of PAA and PANa on metallic surface obeys the Langmuir adsorption isotherm model and exhibit monolayer adsorption type. This kind of isotherm involves the assumption of no interaction between the adsorbed species on the electrode surface [54]. Kads and ΔGads values are calculated and are given in Table 8. The high Kads values implicate the high adsorption of this inhibitor on metallic surface. In addition, the negative values of ΔGads and also the strong interaction between inhibitor molecules and energy of adsorption indicate spontaneous adsorption of PAA and PANa on the mild steel surface [55, 56]. In fact, standard free energy values more than − 20 kJ mol−1 are associated with an electrostatic interaction between charged molecules and charged metal surface (physical adsorption). However, those less than − 40 kJ mol−1 have involved charge transfer from the inhibitor molecules to the metal surface to form a coordinate covalent bond (chemical adsorption) [57]. According to the literature [58], results obtained from thermodynamic study indicate that the adsorption mechanism of PAA and PANa on mild steel surface in 1.0 M HCl solution involves two types of interaction, electrostatic adsorption (ionic) and physisorption (molecular).

Fig. 9
figure 9

Langmuir plots for mild steel in 1.0 M HCl corresponding to PAA and PANa

3.6 Surface analysis by SEM/EDAX

Scanning Electronic Microscopy (SEM) analysis coupled with Energy-Dispersive X-ray Analysis (EDAX) was performed in order to investigate the surface morphology of the mild steel after immersion in 1.0 M HCl in the absence (Fig. 10) and presence of 5 × 10−5 M of PAA (Fig. 11) and PANa (Fig. 12) exposed for 12 h at 25 ± 2 °C.

Fig. 10
figure 10

SEM and EDAX analysis of mild steel after immersion for 12 h in 1.0 M HCl

Fig. 11
figure 11

SEM and EDAX analysis of mild steel after immersion for 12 h in 1.0 M HCl with 5 × 10–5 M of PAA

Fig. 12
figure 12

SEM and EDAX analysis of mild steel after immersion for 12 h in 1.0 M HCl with 5 × 10–5 M of PANa

In order to verify and confirm all previous results obtained through gravimetric and electrochemical tests, the analysis of mild steel samples surface immersed in 1.0 M HCl was carried out for 12 h (Fig. 10) before and after addition of an optimal concentration (5 × 10–5 M) of PAA and PANa (Figs. 11 and 12), using scanning electron microscopy (SEM).

The acquired results have shown that after 12 h of immersion of the mild steel in 1.0 M HCl without inhibitor (Fig. 10), the surface of the sample was damaged and then was corroded. However, Figs. 11 and 12 show that mild steel had not been attacked in the presence of PANa and PAA, which can be attributed to the development of a protective film on the surface of specimens [59, 60].

In order to establish the nature of the formed film on the surface of mild steel after 12 h of immersion in 1.0 M HCl, in the absence and in the presence of 5 × 10–5 M PANa and PAA, EDX analysis was carried out as shown in Figs. 11 and 12. The obtained spectra make it possible to deduce that the corrosion products, observed in Fig. 10, contain Fe with a high percentage of oxygen, which explains the presence of iron oxide resulting from the corrosion of mild steel in 1.0 M HCl. The percentage of oxygen in the case of presence of 5 × 10–5 M of PAA (Fig. 11) is low in comparison with the uninhibited solution, which can be attributed to the presence of a protective layer formed by the adsorption of carboxylate (–COO, Na+) and carboxylic (–COOH) sites present in the polymeric chains of PANa and PAA, which limits the access of the electrolyte to the metal surface.

3.7 Quantum chemical calculations

Functional Density Theory (DFT) has recently appeared as a powerful computational tool to describe the interactions that occur at the interface of metal and polymeric inhibitors [61]. The optimized structure geometries, molecular orbitals (HOMO and LUMO), Mulliken charge distribution, and molecular electrostatic potentials (ESP) of both studied polymers, namely, PAA and PANa, are presented in Figs. 13 and 14. The analysis of the electron density of the orbital boundaries (HOMO and LUMO) is very important for understanding the reactive sites of the investigated molecules. Quantum descriptors can be employed to study the reactivity of polymeric inhibitors. In addition, the increase in HOMO energy leads to an increase in the tendency of the molecule to donate electrons, i.e., High chemical reactivity [62]. On the other hand, a decrease in LUMO energy is a good indication of the ability to accept electrons [63]. Figures 13 and 14 show that the electron density distribution (HOMO) is localized on the carboxylic acid function and the carboxylic acid salt group for the two polymers studied, respectively. On the other hand, the electronic density distribution (LUMO) is mainly located over the entire surface of both investigated molecules. From Figs. 13 and 14, it is clear that Mulliken charges distribution is present on the oxygen atoms and carbon atoms of the ethylene group that carry the highest negative charges [64]. From Figs. 13 and 14, it is clear that Mulliken charges distribution is present on the oxygen atoms and carbon atoms of the ethylene group that carry the highest negative charges. Therefore, it can be assumed that these atoms are responsible for nucleophilic attack toward the metal surface. The derived electrostatic molecular potential (ESP) for the polymeric inhibitors is shown in Figs. 13 and 14. The red color has been assigned to the most negative region of the ESP and the blue color to the most positive region of the ESP. Therefore, the increase in potential follows the sequence: red > orange > yellow > green > blue [65]. It can be seen that the dark red color is located mostly on the (CO2) group, suggesting that these fractions interact with the metal surface by electrostatic forces. Then, the remaining part of the molecule under test interacts with chemical forces.

Fig. 13
figure 13

Optimized structure, molecular orbital (HOMO and LUMO), charge distribution of Mulliken, and ESP of PANa

Fig. 14
figure 14

Optimized structure, molecular orbital (HOMO and LUMO), Mulliken charges distribution, and ESP of PAA

The quantum chemical descriptors, such as HOMO and LUMO energies (EHOMO and ELUMO), the gap energy (ΔEgap), the absolute chemical hardness (η), the absolute chemical softness (σ), the electronegativity (χ), the electrophilicity ω, the number of electrons transferred (∆N), the total energy (ET), and the dipole moment (µ) of both studied PAA and PANa, are listed in Table 9. The highest value of the HOMO energy, the lowest value of the LUMO energy, and the value of the lower gap energy (ΔE) are compatible with high metal–inhibitor interactions and therefore high inhibition efficiency, as previously indicated (experimental part). PANa with a lower gap energy value (6.687 eV) is also associated with lower hardness (3.343 eV) and high softness (0.299 eV) and therefore higher protection capability. These findings are not consistent with the experimental results. The number of electrons transferred (ΔN) is less than 3.6. This indicates the tendency of a polymer to give electrons to the metal surface. These results indicate that the quality of the protective film is well formed.

Table 9 Quantum chemical descriptors of PAA and PANa using DFT/B3LYP/6-31G(d,p)

Fukui indices have been employed to estimate the adsorption centers of both investigated molecules.\(f_{k}^{ - }\) represents the reactivity with respect to electrophilic attack or when the molecule loses electrons, \(f_{k}^{ + }\) corresponds to the reactivity to nucleophilic attack [66]. Fukui indices were computed using natural population analysis (NPA) as follows [67]:

$${\text{For nucleophilic attack}}:f_{k}^{ + } = P_{k} (N + 1) - P_{{_{k} }} (N),$$
$${\text{For electrophilic attack}}:f_{k}^{ - } = P_{k} \left( N \right) - P_{k} \left( {N - 1} \right),$$
(25)

where \(P_{k} (N)\), \(P_{k} (N + 1)\), and \(P_{k} (N - 1)\) represent the population of electronic site k in the neutral, anionic, and cationic system, respectively.

The maximum positive of the Fukui indices is located on C4 (Table 10). On the other hand, the maximum negative values are located on C6 (Table 10). These atoms participate in giving electrons to the metal surface.

Table 10 Fukui Indices (\(f_{k}^{ + }\) and \(f_{k}^{ - }\)) values for both studied molecules PAA and PANa

3.8 Molecular dynamics (MD) simulations

The adsorption behavior of studied polymers on iron surface in hydrochloric acid solution was investigated in order to understand and explain their interaction with iron surface. The fluctuation of energy, such as potential energy, kinetic energy, non-bond energy, and total energy (a), and temperature curves (b) after 500 ps of MD simulations for Fe(110)/PAA/50HCl/500H2O (a) and Fe(110)/PANa/50HCl/500H2O (b) systems are displayed in Fig. 15. It can be seen from Fig. 15 that after 500 ps, the energy fluctuation reached a balance which explains that the system acquired the state of equilibrium.

Fig. 15
figure 15

Energy fluctuation curves obtained from MD simulations for PAA and PANa

Top and side views of the most stable adsorption configuration for both adsorbed polymers on the surface of Fe (110) at 298 K are presented in Fig. 16. It can be noticed from Fig. 16 that PAA and PANa are positioned during the process of simulation exactly above and parallel with the first layer of superficial iron. Therefore, the macromolecular structure of these polymers leads to coverage of the entire surface of iron. The heteroatoms of oxygen were oriented to the metal surface of iron Fe (110) (see RDF method). For this reason, it can be concluded that the studied polymers are very effective against the corrosion of mild steel.

Fig.16
figure 16

Top and Side views of the most stable adsorption configurations of PAA and PANA in HCl medium

Radial distribution function (RDF) method was utilized to compute the distances between the atoms of studied polymers and iron [68]. RDF can be defined as the probability of finding particle B in the range r + dr around a particle A. RDF is described by the function g (r) according to the following expression [69]:

$$g_{AB} (r) = \frac{1}{{\langle \rho_{B} \rangle_{{{\text{local}}}} }} \times \frac{1}{{N_{X} }}\sum\limits_{i \in A}^{{N_{A} }} {\sum\limits_{i \in B}^{{N_{B} }} {\frac{{\delta (r_{ij} - r)}}{{4\pi r^{2} }}} } ,$$
(26)

where \(\langle \rho_{Y} \rangle_{local}\) is the particle density of the particle B averaged over all shells around particle A. The distances of the most active atoms (Fe(110)…W) in Ångström (Å) for both studied polymers with iron (Fe) atoms are shown in Fig. 17. In this figure, the RDFs of (Fe(110)…O, Fe(110)…Na) can be observed. The types of bonds formed can be determined by estimating bond length values [70]. Generally, chemical bonds are formed in the case of interatomic values between 1 Å and 3.5 Å. However, the electrostatic interactions are associated with bond length values higher than 3.5 Å[71]. It can be noticed from Figs. 17 and 18 that the first peaks of g(r) Fe–W all appear in distances below 3.5 Å. These results indicate that the most interaction between both investigated polymers and surface of iron Fe(110) is chemisorption type[72]

Fig. 17
figure 17

RDF of PAA on Fe (110) surface in HCl solution

Fig. 18
figure 18

RDF of PANa on Fe (110) surface in HCl solution

3.9 Monte Carlo (MC) simulations

The interaction between both examined polymers and Fe (1 1 0) surface was also performed using Monte Carlo simulations. Figure 18 shows a typical graph of the energy distribution for Fe(110)/PAA/50HCl/500H2O (Fig. 18a) and Fe(110)/PANa/50HCl/500H2O (Fig. 18b) systems during the energy optimization process, which consists of total energy, average total energy, Van Der Waals energy, electrostatic energy, and intermolecular energy (Figs. 19, 20).

Fig. 19
figure 19

Adsorption energy distributions for Fe (110)/PAA/50HCl/500 H2O and Fe (110)/PANa/50HCl/500 H2O systems using adsorption locator module

Fig. 20
figure 20

Top side of stable adsorption configurations for Fe (110)/either inhibitor molecule/50HCl/500 H2O system using adsorption locator module

As shown in Fig. 21, the higher point density remapped on the iso-surface Density Field indicates more likely adsorption locations of the studied molecules on Fe (1 1 0) plane surface. Top and side views of the most stable configurations of the studied polymers on the Fe (1 1 0) surface using Monte Carlo simulations are presented in Fig. 20. https://www.sciencedirect.com.eressources.imist.ma/science/article/pii/S1018364718307535-f0070. In addition, adsorption energy (AE), total energy (TE), rigid adsorption energy (RAE), deformation energy (DE), as well as \(\left( {\frac{{d{\text{E}}_{{{\text{ads}}}} }}{{d{\text{N}}_{i} }}} \right)\) are listed in Table 11. It is clear from Table 11 that the negative values of the adsorption energies reflect the spontaneity of the adsorption process [73]. From Table 11, the values of all types of energies, i.e., TE, AE, RAE, and DE are negative, indicating that the adsorption ability of PAA and PANa onto iron surface. The adsorption energy (AE) denotes the energy released (or required) when the released adsorbate has been adsorbed on the substrate and can be defined as the ∑(RAE + DE) for the adsorbate component. Besides, the rigid adsorption energy represents the energy released (or required) when the unreleased adsorbate component (prior to the geometry optimization step) has been adsorbed onto the substrate. \(\left( {\frac{{d{\text{E}}_{{{\text{ads}}}} }}{{d{\text{N}}_{i} }}} \right)\) is also computed and reports the energy of the substrate adsorbate configurations where one of the adsorbate components has been removed [74]. As shown in Table 5 that PAA shows high adsorption energy (− 2.22 104 kcal/mol). This high value explains their highest inhibition efficiency obtained experimentally.

Fig. 21
figure 21

Density field of iso-surface of the equilibrium adsorption configuration for Fe (110)/ either inhibitor/50HCl/500 H2O system using adsorption locator module

Table 11 Descriptors computed employing an adsorption locator module for the most stable configurations for Fe(110)/PAA/50HCl/500H2O and Fe(110)/PANa/50HCl/500H2O systems (all values are in Kcal/mol)

4 Conclusion

On the basis of the results presented on mild steel in 1.0 M HCl solution in the presence of sodium polyacrylate and poly(acrylic acid), the potentiodynamic polarization method shows that both the studied acrylic polymers PANa and PAA can react as a mixed type of corrosion inhibitors. The adsorption of PANa and PAA on mild steel has exhibited Langmuir isotherm model that has shown a physical and chemical adsorption. The thermodynamic study has proved that the investigated adsorption mechanism is a spontaneous and exothermic. Spectroscopic analyses (SEM–EDAX) were performed on mild steel samples after 12 h of immersion in acidic solution with of 5 × 10–5 M of PANa and PAA, confirming our electrochemical results. DFT, MD, and MC simulations have been also emphasized in order to gain theoretical insight and to better understand the experimental results. In fact, theoretical calculations have also proved a strong tendency of PANa and PAA molecules for adsorption to the steel surface. The acquired results from gravimetric, potentiodynamic polarization, spectroscopic analyses, and theoretical simulations are in a good agreement.