1 Introduction

Mild steel, a type of carbon steel with very low carbon content is also known as low carbon steel. Mild steel has become an in-demand material over the decades due to its affordability and exceptional properties such as ductility, malleability, machinability, and weldability which makes it suitable for a wide range of industrial projects and structures. These applications include steel frame buildings, machinery parts, and onshore and offshore facilities such as pipelines and vessels [1,2,3]. However, mild steel is prone to degradation (corrosion) when it comes in contact with aggressive environments resulting in rusting. This most often occurs during industrial processes such as acid pickling of steel which exposes it to an aggressive acid environment and accelerates its rate of degradation [3,4,5]. In most cases, acid pickling is done as a surface-treatment process to clean steel by removing impurities, stains, rust, or scale from ferrous metals. Typically, a solution (pickle liquor) containing an acid, such as hydrochloric acid, is used to perform the procedure [4, 5]. Hydrochloric acid increases the mild steel corrosion rate, and in some cases, cause extra damage as a result of hydrogen embrittlement; a process that makes steel fragile and susceptible to cracks by allowing hydrogen generated during the corrosion process to diffuse into the inside of the metal [6, 7]. To guarantee desirable pickling speeds, solution temperatures and acid concentrations are often kept under control; a process which is more often difficult to achieve. This challenge calls for corrosion mitigation strategies to minimize material loss; hence the need for additives such as corrosion inhibitors to retard the acid corrosion [8,9,10].

Corrosion inhibitor usage is one of the useful strategies used to combat corrosion, when used in the correct amount, it can bring about desired effects such as; lowering the acid content, enhancing the pickling outcome, and increasing the steel’s service life. However, most of the commercially available corrosion inhibitors (mostly inorganic chromate based) are toxic and harmful to the environment [11,12,13,14]. The rising awareness of the need to conserve our dilapidating environment and the strict environmental laws has necessitated the need for the development of benign eco-friendly and nontoxic sustainable alternative corrosion inhibitors; otherwise known as green corrosion inhibitors. Most green inhibitors are sourced from natural biomass or synthesized from appropriate precursors, for instance, drugs and non-toxic chemicals [15,16,17]. Drugs are a class of green inhibitors that have attracted research attention in the past decades. The detrimental effect on environmental safety from the use of inorganic inhibitors prompted increased attention to drugs (mostly expired drugs). The inhibition properties of these compounds are a result of the availability of π electrons as well as functional groups such as –NR2–CO2R, –SR, –NH2, –OH, –OR, and –CO2H. The majority of these drug molecules contain hetero atoms like nitrogen, oxygen, sulfur, and phosphorus [18, 19]. These functional groups or heteroatoms provide appropriate adsorption sites to the Fe-metal surface’s unoccupied d-orbitals hence creating a barrier between the metal surface and the corrosive environment [20].

The possible use of drugs (expired) as competitive options for green corrosion inhibition is gaining increased acceptance among researchers. This is because they meet the requirements of environmentally sustainable materials for corrosion protection; non-toxic, eco-friendly, readily available, and cost-effective [21,22,23,24,25,26,27,28,29,30]. A variety of drugs have been assessed as inhibitors of corrosion for different grades of steel, such as ambroxol [21], irbesartan [22], cephapirin [23], chloramphenicol [24], tramadol [25], ampicillin [26], and diclofenac sodium salt [27], paracetamol [28], atorvastatin [29], lorazepam [30], 1-phenytoin sodium [31], ranitidine [32], nifedipine [33], declophen [34], Carvedilol [35], Pheniramine,[36] expired asthalin drug [37], ketosulfone drug [38], cloxacillin [39], cephalexin [40], ibuprofen [41]. More recently, vitamin B12 [42], hydrazones [43], aspirin [44] and benzotriazole [45] were also evaluated for their corrosion inhibition potentials on steel.

Chlorpheniramine (Fig. 1) also known as chlorphenamine or piriton is an antihistamine used to treat a wide range of allergic conditions. Its molecular structure contains a benzene ring and a pyridine ring which are aromatic and rich in pi-electrons in addition to two nitrogen hetero atoms [46, 47]. These features are suitable for the donation of electron pairs to the metal atom, hence, a potential candidate for corrosion inhibition, however this corrosion inhibition potential of this compound has not been investigated especially in acid solution across a temperature range as is obtained in practice. In addition, chlorphenamine ready available, cost-effective, and eco-friendly and meet the requirement for green corrosion inhibitor [48].

Fig. 1
figure 1

Molecular structure of chlorpheniramine

This work aims to appraise the corrosion inhibition performance of chlorphenamine in acid solution over a range of temperatures, and also, provide theoretical insights on the molecular properties of chlorphenamine and its subsequent interaction with the surface of the metal using a combined experimental and computational approach. Thermodynamic and kinetic adsorption parameters were deduced. The results obtained indicate that chlorphenamine is a promising candidate for preventing mild steel from corroding in acidic environments. Meanwhile, the impressive social implications of this research approach will be of immense benefit to various industries. This is because chlorphenamine is eco-friendly, readily available and cost effective offering our society a sustainable approach to protecting steel structures. Chlorphenamine is also envisaged to be probable replacement for the widely used toxic and expensive chromate based inhibitors in the industrial sector. With this approach, the life span of industrial structures is prolonged while still conserving our environment.

2 Materials and Method

2.1 Materials

The University of Calabar’s Mechanical Workshop in Calabar provided the mild steel sheets that were used. The composition of the mild steel composition is as stated in our previous reports [15]. Steel sheets with a thickness of 0.08 cm were physically press cut into 2 cm × 5 cm coupons. The samples were abraded using emery paper with grit sizes ranging from 600 to 1000, degreased in ethanol, dried in acetone, and then kept in a moisture-free desiccator. Analytical grade reagents from Sigma-Aldrich were used to create the corrosive medium, which was 2 M HCl. All of the reagents were prepared using distilled water. The AEADAMPGW253e digital analytical balance was used for all weighing tasks [15, 17].

2.2 Stock Solution of Chlorpheniramine

Chlorpheniramine was ground to powder; 400 mg of the powder was taken and dissolved in 500 mL of the blank solution (2 M HCl) to get 800 mg/L concentration. The stock solution of 800 mg/L was serially diluted to get 50, 100, 200, and 400 mg/L. These solutions were then used for the corrosion test at temperatures of 303, 313, 323, and 333 K using the gasometric assembly.

2.3 Gasometric Method

The reaction chamber was filled with 100 mL of the corrodent blank solution, which was linked to a burette through a delivery line. The reaction vessel was rapidly closed after a weighted mild steel coupon was placed into the solution in the chamber to prevent hydrogen gas leakage. The decrease in paraffin oil level served as a gauge to measure how much hydrogen gas was produced throughout the reaction. At 303 K, 313 K, 323 K, and 333 K, this drop in the paraffin oil level was noted every minute for 30 min. The same experiment was repeated at concentrations of 50 mg/L, 100 mg/L, 200 mg/L, 400 mg/L, and 800 mg/L of chlorpheniramine,. The gradient of the trend line of the line graph the volume of evolved hydrogen per surface area versus time was used to calculate the rate of hydrogen evolution [17].

2.4 Computational Details

All quantum chemical simulations including geometry optimization and energy equilibration were performed with the Gaussian 16 code and Gaussview 6.0.16 [49]. The density functional theory approach was utilized in all cases with the RB3LYP functional and 6-311++G (d,p) basis set. The tight convergence criteria were utilized in all cases with symmetry restrictions imposed while other default settings maintained throughout the optimization. Prior to geometry optimization, frequency computations were equally conducted on the optimized geometry to ascertain the absolute concordance of the optimized geometry to the lowest potential energy minima on the potential energy surface. All quantum chemical calculations including EHOMO, ELUMO, dipole moments, Ionization potential (IP), chemical hardness (η), and electronegativity (χ) were archived via the Koopmans hypothesis in line with previous works [50,51,52]. MD simulation was conducted at varying temperatures (303 K, 313 K, 323 K, and 333 K) to assess the most appropriate adsorption configurations of the inhibitor at the Fe 110 surface. The utilized surface Fe 110 was chosen based on previous reports which have demonstrated its effectiveness and thermodynamic stability compared to other body-centered cubic structures of metallic Fe. Periodic boundary conditions of the simulation box were set to 9.93 Ǻ × 9.93 Ǻ × 56.08 Ǻ, which is composed of a suitable vacuum region of 50 Ǻ thickness and a four-layer slab model. In all cases, the Forcite module was utilized along with the condensed-phase optimized molecular potentials for atomistic simulation studies (COMPASS) force field to compute the MD simulation. The Fe 110 surface utilized herein was modeled in line with our previous works taking into account all energy/geometry equilibration, unit cell dimension, solvation, and number of ions as reported therein [53,54,55]. The adsorption energy of the studied inhibitor on the Fe surface was estimated following Eq. 1. The cleaved Fe 110 surface embedded in the Material Studio software version 7.0 developed by Accelrys Inc. (San Diego, CA), was utilized for MD simulation.

$${{\text{E}}_{{\text{ads}}}} = \, {{\text{E}}_{{\text{total}}}}-- \, \left( {{{\text{E}}_{{\text{metal}}}}_{{\text{surface}}} + \, {{\text{E}}_{{\text{inhibitor}}}}} \right),$$
(1)

where Etotal, Emetal surface, Einhibitor designate the energies of inhibitor/Fe surface, Fe surface, and inhibitor respectively.

3 Results and Discussion

3.1 Hydrogen Evolution Experiments

3.1.1 Effect of Time

Hydrogen evolution is a characteristic of mild steel acid corrosion, and the rate of corrosion is related to the amount of hydrogen evolved [56,57,58,59]. When mild steel was corroded in a solution of 2 M HCl at temperatures of 303 K, 313 K, 323 K, and 333 K in the presence and absence of chlorpheniramine, the volume of hydrogen that developed (VH) was determined as a function of time. The volume of hydrogen evolved per surface area as a function of time at different temperatures is depicted in Fig. 2. The rate of hydrogen evolved per surface area was noted to increase progressively with increase in time. Compared to a blank system; the amount of hydrogen generated during the corrosion process was lower in the presence of chlorpheniramine. As the concentration of chlorpheniramine rises, it is seen that the rate of corrosion reduces. From Fig. 2, the corrosion rate was estimated from the slope of the trend line of the curves. The surface coverage (\(\theta\)) and inhibition efficiency were calculated using Eqs. 2 and 3. Table 1 displays the calculated corrosion rate, surface coverage, and inhibition efficiency.

Fig. 2
figure 2

Variation of the volume of hydrogen gas evolved per surface area with time for mild steel coupon in 2 M HCl containing the chlorpheniramine at different temperatures

Table 1 Calculated corrosion rate, surface coverage (θ), and inhibition efficiency (% IE) of mild steel in 2 M HCl in the presence and absence of Chlorpheniramine
$$Surface \,coverage \left(\theta \right)= \frac{{CR}_{Blank - {CR}_{inh}}}{{CR}_{Blank}}$$
(2)
$$Inhibiton \, efficiency \left(\% IE\right)= Surface \, coverage (\theta ) \times 100$$
(3)

3.1.2 Effect of Chlorpheniramine Concentration on Corrosion of Mild Steel

The effect of the concentration of Chlorpheniramine on the corrosion of mild steel in acidic media was studied by varying the concentration from 0 to 800 mg/L. Figure 2 illustrates how the amount of hydrogen changed over time for the corrosion of mild steel in 2 M HCl in the presence and absence of inhibitors at various concentrations, including blank (0 mg/L), 50 mg/L, 100 mg/L, 200 mg/L, 400 mg/L, and 800 mg/L of chlorpheniramine. On addition of chlorpheniramine, the corrosion rate was found to decrease compared to that of the free solution (blank) across 303–333 K (Fig. 2 and Table 1). This shows that mild steel corrosion in an acidic medium is slowed down by chlorpheniramine. The surface coverage and percentage inhibition efficiency increase with an increase in Chlorpheniramine concentration, a trend which is consistent with generally observed for corrosion inhibitors [60]. The maximum inhibition efficiency obtained at 50 mg/L, 100 mg/L, 200 mg/L, 400 mg/L and 800 mg/L of Chlorpheniramine are 45.9%, 66.3%, 91.9, 76.7% and 81.9%, respectively at 303 K.

3.1.3 Effect of Temperature on Corrosion Mild Steel in the Presence and Absence of Chlorpheniramine

The effect of temperature on the corrosion of mild steel in 1.0 M sulphuric acid was monitored in the absence and presence of Chlorpheniramine across the temperature range 303–333 K. Table 1 shows how temperature affects the rate of mild steel corrosion. The rate of corrosion is reported to increase as temperature rises; this may be because mild steel’s chemical dissolution is anticipated to increase as the temperature rises [61]. Surface coverage and inhibitory efficiency are seen to drop with the rise in temperature, suggesting a decrease in the inhibition efficacy of chlorpheniramine at elevated temperatures. Probably physisorption of chlorpheniramine may likely be the dominant phenomena at the metal surface, this is speculated because of possible desorption of adsorbed chlorpheniramine from the metal surface at elevated temperatures as a result of increased agitation of solution which is capable of shaking weakly adsorbed chlorpheniramine molecules. The maximum inhibition efficiency obtained at 303 K, 313 K, 323 K, and 333 K are 95.1%, 70.1%, 46.1%, and 31.9%, respectively at 800 mg/L of aspirin.

3.2 Thermodynamic Deduction

The varying temperatures made it possible to calculate thermodynamic quantities including the activation energy \({(E}_{a}\)), entropy \((\Delta S),\) and enthalpy \((\Delta H)\). The activation energy was calculated using the Arrhenius equation (Eq. 4) and while the entropy and enthalpy were calculated using the transition state equation (Eq. 5).

$$\mathrm{ln}CR= lnA - \frac{{E}_{a}}{RT}$$
(4)
$$\left(\frac{CR}{T}\right)=\mathrm{ln}\frac{K}{h}+ \frac{\Delta S}{R}+ -\frac{\Delta H}{RT},$$
(5)

where CR is the corrosion rate, Ea is the activation energy, A is the Arrhenius pre-exponential factor, T is temperature, R is the universal gas constant, ΔH is the enthalpy, ΔS is the entropy, K is the Boltzmann constant and h is the Planck constant. The values of Ea., ΔS, and ΔH obtained from the Arrhenius and transition state plots (Figs. 3, 4) are presented in Table 2. It is seen that the activation energy in the presence of chlorpheniramine (52.7–101.7 kJ/mol) was all higher than that of the blank solution (29.7 kJ/mol) and it generally increased with the increase in concentration. More also, the values of the activation energies in the presence of chlorpheniramine were above and below 80 kJ/mol, this suggests the inhibitor species and the steel surface may have formed a weak chemical or physical connection as a result. Ea values above 80 kJ/mol are considered to be due to chemical adsorption and values below are linked to physical adsorption [62]. The relatively high values of Ea values in the vicinity of 80 kJ/mol suggest the possibility of a mixture of physical and chemical adsorption of chlorpheniramine on the steel surface.

Fig. 3
figure 3

Arrhenius plot for the corrosion of mild steel in the presence and absence of chlorpheniramine

Fig. 4
figure 4

Transition state plot for mild steel in 2 M HCl solution in the presence and absence of chlorpheniramine

Table 2 Thermodynamic quantities for the corrosion of mild steel in the presence and absence of chlorpheniramine

The values of \(\Delta H\) are seen to be all positive (31.5–133.3 kJ/mol) indicating that the corrosion process is an endothermic reaction. Additionally, it was observed that the values of the \(\Delta H\) typically increased when chlorpheniramine concentration increased indicating that more heat is needed to drive the process at increased inhibitor concentrations. The values of \(\Delta S\) were also positive indicating the spontaneous nature of the reaction [62, 63].

3.3 Adsorption Consideration

Adsorption isotherms were employed to assess the experimental results to acquire a deeper understanding of the nature of chlorpheniramine’s adsorption on the metal surface. Langmuir, Freundlich, and Temkin adsorption isotherms were all applied and the correlation factors R2 obtained are displayed in Table 3. The consistency of the experimental data with these isotherms was adjudged by the deviation of the correlation coefficient R2 of each of the isotherms from unity. The range of R2 is when 0 \(<\) R2 \(<1\), the closer the value is to 1 the greater the consistency to the isotherm and vice versa [62, 63]. The Langmuir, Freundlich, and Temkin adsorption isotherms are given by Eqs. 68 respectively.

$$\frac{c}{\theta }= \frac{1}{{K}_{ads}}+\mathrm{ c}$$
(6)
$$\theta =\frac{RT}{b}\mathrm{ln}\;K + \frac{RT}{b}\mathrm{ln}\;c$$
(7)
$$\mathrm{log}\;\theta =\mathrm{log}\;{K}_{f}+ \frac{1}{n}\mathrm{log}\;c,$$
(8)

where c is the concentration, θ is the degree of surface coverage and Kads is the equilibrium constant, R is the universal gas constant, b is the Temkin constant, f the is heterogeneous factor and T is the temperature. From the R2 values obtained, the R2 was of Langmuir isotherm were almost equal to one (0.9955–0.9991) while that of Freundlich (0.0020–0.5917) and Temkin (0.0245–0.5538) deviated significantly away from unity, this implies the adsorption process can be best described by the Langmuir adsorption isotherm. The adsorption–desorption equilibrium constant was calculated from the Langmuir plot shown in Fig. 5.

Table 3 Correlation factor (R2) deduced from Langmuir, Temkin, and Freundlich isotherms for the corrosion of mild steel in 1 M H2SO4 inhibitors at different temperature
Fig. 5
figure 5

Langmuir adsorption isotherm for the corrosion of mild steel in the presence of Chlorpheniramine at different temperatures

The strength between the adsorbate and adsorbent is shown by the adsorption-desorption rate constant, Kads. A high Kads value indicates stronger adsorption and, hence, stronger inhibitory effectiveness. The current situation shows that Kads values fall as temperature increases, indicating that the inhibitors are physically adsorbing to the mild steel surface [64]. The values for the free energy of adsorption ΔGads were also calculated from Eq. 9

$$\Delta {G}_{ads }= -RT\mathrm{ln}( {K}_{ads } \times 55.5),$$
(9)

where ΔGads is the free energy of adsorption, R is the universal gas constant, T is the temperature, and Kads is the adsorption-desorption equilibrium constant. The calculated results of ΔGads are presented in Table 4. The negative values Gads show that the inhibitor spontaneously adsorbs to the metal surface and also show that the adsorption layer is stable. The magnitude of ΔGads values obtained are − 1.8 kJ/mol, − 1.1 kJ/mol, − 5.9 kJ/mol, and − 8.2 kJ/mol are less than − 40 kJ/mol which indicates a physical adsorption mechanism for the adsorption of the inhibitor on the mild steel [65].

Table 4 The equilibrium constant (Kads) and Adsorption free energy (ΔGads) deduced from Langmuir, isotherm for the corrosion of mild steel at different temperatures

3.4 Kinetic Considerations

The influence of concentration and other measurable quantities on the rate of a chemical reaction depends on the order of the reaction [66, 67]. To determine the order of the reaction, the experimental data was tested for the first-order integrated rate equation (Eq. 10)

$${k}_{1}= \frac{2.303}{t}log\left(V/V_{\infty }\right),$$
(10)

where V is the volume of H2 evolved (cm3), k1 is the first-order rate constant in (min−1), and t is the immersion time in (min). The data were tested at 0, 15, and 20 min, and they were seen to be consistent with the first-order reaction kinetics at different temperatures and concentrations. The average rate constant at a particular temperature and concentration is illustrated in Table 5. From, Table 5, the rate constants generally decreased with an increase in concentration from the blank to 800 mg/L. Also, it was found to generally increase with the increase in temperature from 0.067 to 0.149 on going from 303 to 333 K. This is expected as more heat is added to the system an increased amount of the metal possesses enough energy to oxidize (corrode). This trend in the first-order rate constant is consistent with the calculated corrosion rate.

Table 5 Kinetics of the corrosion process: first-order rate constant k1

3.5 Computational Details

3.5.1 Quantum Chemical Descriptors

To gain insights into the molecular properties and adsorption properties/configuration of Chlorpheniramine, the computational details were obtained. The DFT/B3LYP/6-311++G(d,p) basis set was employed in order to clearly substantiate the reactivity and stability of chlorpheniramine. The quantum chemical descriptors of chlorpheniramine molecule are given in Table 6. The HOMO and LUMO isosurface plots of the chlorpheniramine molecule are shown in Fig. 6. The energies of the frontier molecular orbitals (the HOMO and LUMO) are chemically connected to the ionization potential and electron affinity according to Koopman [49], this HOMO–LUMO calculated values were found to be − 0.210 a.u and − 0.008 a.u., respectively. Meanwhile, 3.364 eV was calculated to be the energy gap corresponding to the density of state plot as shown in Fig. 7. The frontier molecular orbital energies aid in the explanation of important aspects concerning molecules [49, 50]. The ionization potential (IP), is the amount of energy required to remove an electron from an isolated atom or molecule, while the electron affinity (EA) is the ability of a molecule to accept an electron from its surroundings. The calculated IP and EA values are 5.725 eV and 0.235 eV, respectively. More so, other global quantum descriptors were equally calculated, these include; the chemical-potential (μ) and the electrophilicity-index (ω) which indicates the direction of electron flow through a molecule [50, 51]. The calculated values of μ and ω are − 2.978 eV and 12.177 eV its values respectively. These indices offer information regarding structural reactivity, stability, and toxicity. A good electrophile is a molecule with a high μ, ω value, and a good nucleophile is a molecule with a low μ, ω value [51].

Table 6 Quantum chemical descriptors of chlorpheniramine molecule
Fig. 6
figure 6

HOMO and LUMO isosurface plots of the chlorpheniramine molecule

Fig. 7
figure 7

Density of state maps and energy gap of the inhibitor molecule

3.5.2 Natural Bond Orbital

Analysis of natural bond orbital (NBO) is one of the many methods for ‘translating’ Schrödinger’s wave equation computational solutions into the language of chemical bonding principles because it is a good tool for studying intramolecular bonding, charge transport, and conjugative interactions in molecular systems [50]. This charge transfer between non-covalent bonding and anti-bonding interactions is very useful in determining the stabilizing energy of all possible interactions, which can be quantitatively described in terms of the second-order perturbation interaction energy (E(2)), which depicts the magnitude of the stabilization energy. The diagonal NBO Fock matrix elements are estimated using this energy. The second-order perturbation energy estimated in this work was conducted using the mathematical expression given in the literature [61]. The natural bond orbital (NBO) analysis of chlorpheniramine is given in Table 7. Comprehensively the natural bond orbital elucidated efficiently the inter and intramolecular interaction owing to the delocalization of electrons observed at the σ–σ*and LP–σ* which suggests these interactions to be highly reactive with sum perturbation energies of 49.07 kcal/mol and 23.75 kcal/mol. However, at the σ–σ* transitions the following intermolecular interactions existed between C10–H29–C8–H26, C14–H36–C16–Cl45, C17–H40–N2–C7, and C17–H40–C15–C18 elucidated the highest perturbation energy. Whereas, lone pair electrons demonstrated less perturbation with interaction seen between N2–C5–H23, N2–C5–H22, N2–C7–C10, and N2–N1–C5.

Table 7 Natural bond orbital (NBO) analysis of chlorpheniramine

3.5.3 Atomic Population

The evaluation of the distribution of atomic charges in compounds is essential as it further explicates electronegativity equalization and discrepancies which affects molecular behavior. The distribution of atomic charges influences the behavior of inhibitor molecules in different electronic environments, in-fact the exact active site of interaction can be quickly ascertained by considering the charge possessed by each atom constituting the active site. Two distinct population analyses (the natural population and Mulliken population) were considered to espy the distribution of charges and thereby provide a pictorial representation of the most susceptible sites for adsorption or interaction with surfaces. The results are presented in pictorial representations of the charges is depicted in Fig. 8. The results of the Mulliken population clearly shows that C7 C5, C14, and C13 possess the highest negative charges of − 0.859, − 0.868, − 1.042, and − 0.798, respectively, while the highest positive charge of 0.577, 0.340, 0.259 corresponding to C16, C6 and C3 were obtained from the Mulliken population respectively. This clearly distinguishes the highly susceptible sites for electrophilic and nucleophilic reactions respectively. These carbon atoms are adjacent to the highly electronegative atoms and therefore the differences in electronic distribution are due to dative covalent bonding. However, the natural population analysis discloses N1 and N2 to possess the highest negative charge of − 0.563 and − 0.683, respectively different from the Mulliken population which revealed carbon atoms to possess the highest negative charge. While the carbon atoms with the highest negative values are C18, C4, C9, C11, C12, and C13 which correlates with the results of the Mulliken population analysis even though significant differences in atomic charge distribution is ostensible.

Fig. 8
figure 8

Natural and Mulliken atomic charge distribution of the Chlorpheniramine

3.5.4 Electron Localization Function (ELF)

The electron localization function (ELF) is a molecular indicator that aims at unveiling all molecular regions with a high propensity for electron density localization based on the kinetic energy densities (ρ) of the surface [55]. ELF focuses more on electron pair density localization rather than orbital overlap by virtue of high-density gradient. The pictorial representation of the ELF plot is depicted in Fig. 9. The plot is represented by color dispersity based on low and high electron localization density respectively. The plot shows that bonding and nonbonding localized electrons are localized between 0.1 to 1.0 intervals, the absence of delocalized electrons is expressed by the absence of intense dark blue coloration around selected atoms. The plot clearly discloses that regions of high localized bonding and nonbonding electrons are the nitrogen and carbon atoms which are shown by high ELF index colored in yellow-red, these regions are also associated with covalent regions. Electrons depletion zones are represented by blue circles around C11, C9, C2, C4, etc. overall, the plot shows that hydrogen and carbon atoms constitute the main sites of high localized orbital locators and thus serve as active sites of adsorption.

Fig. 9
figure 9

Electron localization function isosurface plot for the inhibitor

3.6 MD Simulations

The effectiveness of MD simulations in explaining interactive mechanisms of adsorption or interaction of inhibitors and surfaces cannot be overemphasized. In fact, MD simulation has set its standards such that its contribution to the holistic comprehension of surface chemistry and surface behavior of adsorbate molecules cannot be neglected [20, 66]. Based on these notions, MD simulation has been employed herein to espy the nature and mechanism of adsorption of the proposed corrosion inhibitor and thereby assess its efficacy in combating Fe corrosion. The effectiveness, of an inhibitor to bind favorably and inhibit a corroded surface can be ascertained by its adsorption configuration on the surface, adsorption energy as well as its adsorption mechanism with variation in adsorption temperature. The interaction energies and equilibration energies of both inhibitor and complex are presented in Table 8 while the 2D visualizations of the interaction configuration of the inhibitor and surface are depicted in Fig. 10. Based on the obtained results from energetic considerations, it could be inferred that the inhibitor binds effectively with the Fe surface. Favorable adsorption energies in the range of − 122.669 to − 157.202 kJ/mol were obtained from MD simulations of the inhibitor and the surface. The MD simulation energies also disclose that protonation of the inhibitor decreases the adsorptive interaction energies of the inhibitor considerably with changes in temperature [54, 66]. The interaction energy can be seen to decrease from − 156.723 to − 122.562 kJ/mol at 303 K upon protonation of the inhibitor molecule, the same decrease in interaction energy was observed with other temperatures; specifically, the adsorption energies decreased by 34.2%, 28.2%, 34.5% and 12.3% when the simulations were conducted at 303 K, 313 K, 323 K, and 333 K respectively. Thus, it is apparent that protonation did not favor the corrosion inhibitory potency of the studied inhibitor. The adsorption configuration of the inhibitor and the surface was observed to be flat regardless of the temperature of simulation; therefore, prompting the suitability or efficacy of the inhibitor to effectively adsorb onto corroded Fe surface. The mechanism of adsorption is also tilted towards the physisorption type of adsorption due to the utilization of hydrogen atoms as principal adsorption sites however, substantial enhancement of adsorption energies orchestrated by the lone pairs on nitrogen atoms was also noticeable and thus these atomic sites are essential for the inhibitory potential of the studied inhibitor. The conclusion is that the neutral inhibitor molecule performed better in terms of adsorption interaction with the metal surface probably due to the molecular and equalization of charge density within the inhibitor molecule, unlike the protonated structure in which substantial distortions in atomic charges are paramount. Thus, the neutral inhibitor molecule is more stabilized and in turn, interacts better with the metal surface [20, 66]. The influence of temperature on adsorption energies is observed to be less progressive, only slight changes in interaction energy are observed as a result of temperature variation. This temperature variation affected the neutral inhibitor specie minimally when compared to the protonated species in which a substantial decrease in adsorption energy was observed. Therefore, suggesting that the inhibitor molecule could inhibit Fe surface corrosion regardless of temperature.

Table 8 Simulation energies and interaction energies of the inhibitor/metal surface at temperatures
Fig. 10
figure 10

Adsorption orientation of the inhibitor molecule on Fe (110) surface at different temperatures

3.7 Comparative Studies of the Studied Inhibitor with Previous Drug-Based Inhibitors

For clarity purposes, the performance of chlorpheniramine was compared to other available data for mild steel in HCl solutions as presented in Table 9. It can be seen that the studied inhibitor performed competitively well inhibition efficiency of 95.1 under a very aggressive condition of 2 M HCl.

Table 9 Comparative studies of acetylsalicylic acid with other similar drug-based inhibitor

4 Conclusion

The corrosion inhibition of mild steel by chlorpheniramine in acidic media has been evaluated using a combined experimental and DFT study, and the following conclusions have been made

  1. 1.

    Chlorpheniramine inhibits the corrosion of mild steel in acidic media. The inhibition efficiency increases with an increase in extract concentration and decreases with an increase in temperature.

  2. 2.

    Thermodynamic considerations reveal that the corrosion process is spontaneous and endothermic. Kinetic data reveals that the experimental data is consistent with the first-order reaction kinetics across the concentrations and temperatures studied.

  3. 3.

    The adsorption of chlorpheniramine on the mild steel is seen to be consistent with the Langmuir adsorption isotherm and the values of Gibbs free energies of adsorption indicate that the adsorption process is spontaneous. The physical adsorption mechanism is the predominant mechanism of the adsorption of chlorpheniramine.

  4. 4.

    Quantum chemical simulations reveal probable adsorption sites and molecular dynamic simulations very strong interaction exists between the chlorpheniramine and Fe surface with apparent interaction energy of 157.2 kcal/mol.