1 Introduction

Citric acid (C6H8O7) is a weak organic acid which occurs naturally in oranges and other citrus fruits. It has been the most important organic acid with a global estimated production of about 1.4 million tons in 2004 [1]. The acid is used in cosmetics, soda, beverages, and toiletries and in an extensive range of industrial applications as a buffering, pickling, descaling, oil well acidizing, and chelating agent. C6H8O7 is also applied as a reactive intermediate in cleaners and disinfectants and chemical synthesis [2,3,4,5]. It is non-toxic chemical compound, but yet causes accelerated corrosion to carbon steels. Corrosion is a naturally occurring problem responsible for the deterioration of engineering materials due to chemical or electrochemical interaction with their environment. The consequence of corrosion often leads to expensive damages within manufacturing plants, loss of production time and industrial shut downs [6, 7]. The occurrence of corrosion has been a significant problem in food processing industries due to the risk of consumer product contamination by corrosion products. The presence of citric acid in fruits and as an intermediate compound in a variety of products degrade metallic parts, structure, and devices made of carbon steel over time necessitating their periodic maintenance/replacement. Carbon steel is extensively applied in numerous industries. It is readily available, easily fabricated, relatively cheap, and has good physical and mechanical properties. Its weakness to corrosion when in contact with corrosive solutions during industrial activities such as acid cleaning, transportation of acid, descaling, pickling boiler applications, heat transport systems of heavy water reactor systems, and other chemical processes is a major disadvantage. This results in its short service life and continual replacement. Corrosion has been a major problem in cooling water systems. Some thermal power equipment’s are chemically cleaned with citric acid solutions to remove scales, rust etc. before operation. However, there is the problem of flash rust after cleaning due to the corrosive properties of C6H8O7 [8]. Sekine et al. studied the corrosion inhibition of mild steel in hydroxy acid solutions of lactic, malic, tartaric, and citric acids. Results showed that the corrosion rate of the steel increased with increasing acid concentrations [9].

In addition to their corrosive properties, C6H8O7 are known to be corrosion inhibitors for aluminum alloys. Solmaz et al. studied the inhibition effect of citric acid on the corrosion behavior of aluminum in NaCl solution. Results showed the acid inhibited the corrosion of aluminum with inhibition performance subject to the acid concentration [10]. Preventive measures for controlling carbon steel corrosion have changed over the years due to increased awareness of product effects on health, safety and the environment, operation at higher cycles, the availability of improved treatments, and increasing economic pressures [11]. One of the most effective methods of controlling carbon steel corrosion in citric acid is through the use of corrosion inhibitors [12]. Corrosion inhibitors are chemical compounds that suppress the electrochemical mechanisms responsible for corrosion of metallic alloys in aggressive environments at significantly low concentrations. Inhibitor act by chemically adsorbed on the surface of the metal and forming a protective thin film on the metallic surface, formation of oxide on the base metal, and reaction of the corrosive species to form harmless complexes. Plant extracts are viewed as rich source of naturally synthesized chemical compounds that can be extracted by simple procedures with low cost [13]. They have been proven to be sustainable corrosion inhibitors at affordable cost [14,15,16,17,18]. Aqueous extract of Piper Nigrum L. was evaluated for its corrosion inhibition properties on mild steel in citric acid media. However, the maximum inhibition efficiency obtained is less than 40% [12]. Alka et al. [19] used gravimetric method to study the corrosion inhibition effect of aqueous extract of Fenugreek seed on the corrosion of iron in citric acid solutions. Inhibition efficiency was observed to increase with concentration. Loto [20,21,22] studied the synergistic combination of different essential oil extracts on mild steel and low carbon mold steel in HCl and H2SO4 environments with excellent results proving the inhibition performance of the oil extracts to be concentration dependent. The results obtained from relatively stronger inorganic acids make it probable for essential oil extracts to be applicable for citric acid, a relatively weak acid. Due to the ever increasing production of citric acid coupled with its extensive application as an intermediate and finished product across significant number of industries where carbon steel is employed, the need to suppress carbon steel corrosion without limiting the usefulness of citric acid necessitates more research into alternative sustainable corrosion inhibitors of carbon steel. Azadirachta indica oil is a vegetable oil extracted from the fruits and seeds of the Azadirachta indica tree. The oil is a major component of non-pesticidal management due to the toxic properties of synthetic pesticides [23]. It is used in the preparation of polymeric resins such as alkyd resins and its juice is a potent ingredient for a mixture of wall plaster [24, 25]. The medicinal value of Azadirachta indica has been recognized by the US National Academy of Science [26]. Azadirachta indica oil is also used for the manufacture of cosmetics such as soap, shampoo, balms, toiletries, lubricants, and toothpaste. The oil extract is added to fertilizers as a nitrification inhibitor [27]. This research aims to study the corrosion inhibition and adsorption properties of Azadirachta indica on low carbon steel in citric acid, and in sulphuric acid for comparative analysis.

2 Materials and Methods

Low carbon steel (LCS) purchased from the open market in Nigeria was analyzed at the Materials Characterization Laboratory, Department of Mechanical Engineering, Covenant University, Ota, Ogun State, Nigeria with PhenomWorld scanning electron microscope. It’s nominal (wt%) composition is shown in Table 1. LCS has cylindrical configuration with diameter of 1.2 cm. The carbon steel was cut to average thickness of 1 cm, smoothened with emery grinding papers (80, 320, 600, 800, and 1000 grits) and polished with 6 µm diamond polishing paste before washing with distilled water and acetone. Azadirachta indica (AZI) purchased from Now Foods, USA is a golden oily liquid. AZI was prepared in volumetric concentrations of 0%, 1.5%, 2.5 3.5, 4.5, and 5.5% per 200 mL of 2.5 M of C6H8O7 solution. Electrochemical analysis through potentiodynamic polarization technique was conducted at 30 C with a ternary multi-component electrode system (resin mounted LCS working electrodes with exposed surface area of 1.13 cm3, Ag/AgCl reference electrode and platinum counter electrode) inside a transparent cell containing 200 mL of the C6H8O7/AZI solution at predetermined AZI concentrations interfaced with to Digi-Ivy 2311 potentiostat and computer. Potentiodynamic polarization plots were produced at scan rate of 0.0015 V/s between potentials of − 1 V and + 1.25 V. Corrosion rate, CR (mm/years) was determined as shown below;

Table 1 Composition (wt%) of low carbon steel
$$ C_{\text{R}} = \frac{{0.00327 \times C_{\text{J}} \times E_{\text{q}} }}{D} $$
(1)

D is the density in (g/cm3); Eq is the equivalent weight (g). 0.00327 is the corrosion rate constant and CJ is the corrosion current density. The percentage inhibition efficiency (η) was calculated from corrosion rate values using the equation below;

$$ \eta = 1 - \left[ {\frac{{C_{{{\text{R}}_{2} }} }}{{C_{{{\text{R}}_{1} }} }}} \right] \times { 1}00 $$
(2)

where R1and R2 are the corrosion rates with and without NB inhibitor. Polarization resistance (Rp, Ω) was calculated from Eq. (3) below;

$$ R_{\text{p}} = { 2}: 30 3*{\raise0.7ex\hbox{${\text{BaBc}}$} \!\mathord{\left/ {\vphantom {{\text{BaBc}} {{\text{Ba }} + {\text{Bc}}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{\text{Ba }} + {\text{Bc}}}$}}\left[ {{\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {I_{\text{cr}} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${I_{\text{cr}} }$}}} \right] $$
(3)

where Ba is the anodic Tafel slope and Bc is the cathodic Tafel slope, both are measured as (V/dec).

LCS coupon analyses was carried out in 200 mL of C6H8O7/AZI for 192 h at 24 h interval. The corrosion rate (CR) data from the weight loss value were determined according to the equation below;

$$ C_{\text{R}} = \left[ {\frac{87.6W}{\text{DAT}}} \right] $$
(4)

W is the weight loss in grams, D is the density in g/cm2, A is the area in cm2, and T is the time of exposure in hours. The data of inhibition efficiency (\( 2 \)) calculated from the equation below;

$$ \eta^{2} = \left[ {\frac{{W_{1} - W_{2} }}{{W_{1} }}} \right]*100 $$
(5)

W1 and W2 are the weight loss of the control and inhibited MS in the acid media with respect to exposure time. Graphical plots of corrosion rate and inhibition efficiency versus exposure time were plotted from the data obtained during measurement. Open circuit potential measurement was performed at 0.1 V/s step potential for 6000 s using Digi-Ivy Potentiostat interfaced with computer to study the thermodynamic stability and corrosion of LCS at rest potentials. Optical images of corroded and AZI inhibited LCS surface were studied and compared after coupon analysis with Omax trinocular metallurgical microscope.

3 Result and Discussion

3.1 Potentiodynamic Polarization Studies

Potentiodynamic polarization plots of LCS corrosion and inhibition in 2.5 M C6H8O7 solution at 0, 1.5, 2.5, 3.5, 4.5, and 5.5% AZI concentrations are shown in Fig. 1. Data obtained from the polarization plots are shown in Table 2. Figures 2a to 3b shows the optical images of LCS morphology before corrosion, after corrosion in 2.5 M C6H8O7 and after corrosion in 2.5 M C6H8O7/1.5% and 5.5% AZI solution. At 0% AZI concentration, corrosion rate of 4.09 mm/years was obtained corresponding to a corrosion current density of 3.58 × 10−4 A/cm2. This is due to oxidation of LCS in C6H8O7 solution as shown in Fig. 2b where general surface deterioration is apparent. C6H8O7 being a tripotic acid which ionizes in H2O according to the Eqs. (68) below produces H3O+, which increases the acidity of the solution. This triggers electrochemical reaction with the majority Fe component of LCS. The excess H+ cause the LCS to lose electrons as it changes to its ionic form, resulting in the formation of Fe oxides and hydroxides. C6H8O7 reacts with LCS according to Eq. (9).

Fig. 1
figure 1

Potentiodynamic polarization plot of LCS corrosion and inhibition in C6H8O7/0%–5.5% AZI

Table 2 Potentiodynamic polarization data for LCS corrosion in 2.5 M C6H8O7 solution at 0% to 5.5% AZI concentration
Fig. 2
figure 2

Optical microscopic images of LCS a before corrosion and b after corrosion from 2.5 M C6H8O7/0% AZI concentration

Fig. 3
figure 3

Optical microscopic images of LCS after corrosion a from 2.5 M C6H8O7/1.5% AZI concentration and b after corrosion from 2.5 M C6H8O7/5.5% AZI concentration

$$ {\text{C}}_{6} {\text{H}}_{8} {\text{O}}_{{7\;({\text{aq}})}} + \;{\text{H}}_{2} {\text{O}}_{{({\text{l}})}} \leftrightarrow {\text{C}}_{6} {\text{H}}_{7} {\text{O}}_{{7\;({\text{aq}})}}^{ - } + \;{\text{H}}_{3} {\text{O}}^{ + }_{{({\text{aq}})}} $$
(6)
$$ {\text{C}}_{ 6} {\text{H}}_{ 7} {\text{O}}_{{ 7\;({\text{aq}})}}^{ - } + {\text{ H}}_{ 2} {\text{O}}_{{({\text{l}})}} \leftrightarrow {\text{C}}_{ 6} {\text{H}}_{ 6} {\text{O}}_{{ 7\;({\text{aq}})}}^{ 2- } + {\text{ H}}_{ 3} {\text{O}}^{ + }_{{({\text{aq}})}} $$
(7)
$$ {\text{C}}_{ 6} {\text{H}}_{ 6} {\text{O}}_{{ 7\;({\text{aq}})}}^{ 2- } + {\text{ H}}_{ 2} {\text{O}}_{{({\text{l}})}} \leftrightarrow {\text{C}}_{ 6} {\text{H}}_{ 5} {\text{O}}_{{ 7\;({\text{aq}})}}^{ 3- } + {\text{ H}}_{ 3} {\text{O}}^{ + }_{{({\text{aq}})}} $$
(8)
$$ {\text{C}}_{6} {\text{H}}_{8} {\text{O}}_{7} + {\text{Fe}}_{2} {\text{O}}_{3} \to 2{\text{FeO}} + 6{\text{CO}} + 2{\text{H}}_{2} {\text{O}} + 2{\text{H}}_{2} $$
(9)

Addition of AZI at 1.5–5.5% concentration changed the dynamics of the electrochemical reaction on LCS surface. A significant decrease in corrosion rate occurred from 0.79 mm/years at 1% to 0.45 mm/years at 5.5% AZI concentration. This corresponds to inhibition efficiency of 80.69% and 88.88% at 5.5% AZI. The corrosion current density at optimal inhibition efficiency is 3.99 × 10−5 Acm−2. Observation of Fig. 3a shows that the presence of C6H8O7 on LCS surface causes selective deterioration. This is probable for two reasons (i) monolayer surface coverage due to insufficient cationic molecules of AZI and (ii) selective breakdown of the protective film under high electric potential. The morphology in Fig. 3b is a significant improvement compared to Fig. 3a due to availability of sufficient AZI molecules to counteract the surface oxidation of LCS. Variation of AZI concentration enhances its inhibition efficiency, proving it to be partially concentration dependent. The corrosion potential values show active–passive behavior of the anodic–cathodic polarization plots due to inhibition of the LCS oxidation and H2 evolution reactions. However, with a maximum anodic displacement of 124 mV, AZI is considered an anodic type inhibitor. This shows surface coverage, limiting the dissolution of LCS dominates the AZI inhibition mechanism. This is further confirmed for the Tafel slopes with respect to AZI concentration. At 0% AZI, the higher cathodic Tafel slope value compared to the anodic counterpart is the result of higher anodic exchange current density due to unrestrained surface oxidation of LCS surface in the acid solution. In the presence of AZI, the higher anodic Tafel slopes are due lower anodic exchange current density resulting from suppression of anodic currents by AZI cations. Increase in AZI concentration cause a corresponding decrease in anodic exchange current density signifying anodic type inhibition.

3.2 Passivation Studies

Figure 4 shows the polarization plots of C6H8O7 passivation of LCS. Results from polarization studies showed that C6H8O7 corrodes LCS and the presence of AZI compound significantly reduced the corrosion rate values. However, after anodic polarization LCS underwent metastable pitting activity before stable passivation after steady state current. Observation of the plots shows two metastable pitting regions, the first before passivation and the second after passivation. This is due to the formation of transient corrosion pits before passivation. The plots show that despite the electrochemical reaction processes responsible for corrosion at 0% AZI, LCS eventually passivation after anodic dissolution reactions. The absence of AZI compound results in early passivation of LCS compared to the plots at various AZI concentrations. While AZI is an effective corrosion inhibitor, it interferes with the passivation reaction mechanism of C6H8O7, delaying the potential at which metastable pitting and subsequent passivation occurs. The tricarboxylic acid trianion component of C6H8O7 obtained by deprotonation of the three carboxylic groups is responsible for the passivation of LCS. Previous research has shown that they have an inhibiting effect on carbo steels [28,29,30].

Fig. 4
figure 4

Polarization plot of metastable pitting activity of LCS in C6H8O7/0%–5.5% AZI

3.3 Coupon Measurement and Macro Image Analysis

Figures 5 and 6 shows the variation of LCS corrosion rate and AZI inhibition efficiency versus exposure time, while Figs. 7a to 8b shows the macroscopic images of LCS before corrosion, and after corrosion from C6H8O7/0% AZI, C6H8O7/1.5% AZI, and C6H7O8/5.5% AZI solutions, respectively. Table 3 presents the data from the coupon measurement. LCS at 0% AZI concentration underwent severe morphological deterioration as shown in the plot on Fig. 5. The corrosion rate initiated at 0.0034 mm/years (24 h) and progressed significantly to a peak value of 0.0101 mm/years at 144 h. The macro image in Fig. 7b confirms the corrosion and surface deterioration of the carbon steel. This observation agrees with the results obtained from potentiodynamic polarization test. General surface deterioration and enlarged corrosion pits are clearly visible. The improved surface morphology in Fig. 8a, b is due to the inhibition effect of AZI which formed an effective protection film on the steel. Observation of the plots in Fig. 5 (1.5–5.5% AZI) shows AZI effectively inhibited LCS from the onset of the corrosion test confirming its time independent action, secondly its final inhibition efficiency values (1.5–5.5% AZI) on Table 3 shows AZI performance is non-concentration dependent to a large degree. AZI being a green chemical compound and an essential oil extract displayed effective inhibition performance with the lowest value above 98%.

Fig. 5
figure 5

Variation of LCS corrosion rate versus exposure time for 192 h in C6H8O7/0%–5.5% AZI solution concentrations

Fig. 6
figure 6

Variation of AZI inhibition efficiency versus exposure time in C6H8O7/0%–5.5% AZI solution concentrations

Fig. 7
figure 7

Macro images of LCS a before corrosion and b after corrosion from C6H8O7/1.5% AZI at 192 h of exposure

Fig. 8
figure 8

Macro images of LCS after corrosion after 192 h of exposure in a C6H8O7/1.5% AZI and b C6H8O7/5.5% AZI

Table 3 Data on the LCS corrosion and inhibition from coupon measurement at 192 h of exposure

3.4 Open circuit Potential Measurement (OCP)

The OCP plots of potential versus time for LCS in C6H8O7 solution at 0, 1.5, and 5.5% AZI concentrations are depicted in Fig. 9. The plot at 0% AZI increased progressively to positive potential values. The values initiated at − 0.854 V (0 s) and peaked at − 0.315 V (6000 s). This phenomenon is due to the ability of C6H8O7 to chelate LCS, passivating it as evident in the positive shift of corrosion potential [31,32,33,34]. Previous research has shown C6H8O7 to be a multidentate chelating compound capable of forming stable complexes with metallic cations ions in aqueous media [35]. However, the visible potential transients show the passive film is thermodynamically unstable. OCP plot of LCS at 5.5% AZI was relatively thermodynamically stable throughout the exposure hours due to the effective surface coverage effect of AZI. This assertion is confirmed from the results obtained from potentiodynamic polarization. The OCP plots at 1.5% AZI displayed minimal instability till − 0.737 V at 2700 s due to delayed electrochemical action of AZI cations. Beyond this point there was relative stability coupled with limited shift in potential to more electronegative values.

Fig. 9
figure 9

Plot of corrosion potential vs exposure time for LCS corrosion and passivation in C6H8O7 at 0, 1.5, and 5.5% AZI concentration

3.5 ATF-FTIR Spectroscopy

AZI being an essential oil extract is a multi-component compound consisting of varying functional groups at different wavelengths capable of adsorbing unto LCS surface to suppress oxidation of the steel in C6H8O7 solution. Figure 10 shows the ATF-FTIR spectra plots of C6H8O7/AZI solution before and after LCS corrosion. Observation of the spectra plots (C6H8O7/AZI after corrosion) between wavelengths of 500 cm−1 and 3750 cm−1 shows significant decrease in the transmittance of functional groups in AZI after LCS corrosion in C6H8O7/AZI solution. This is probably due to physisorption and physiochemical interaction of the functional groups of alcohols, phenols, primary, secondary amines, amides, carboxylic acids, alkynes, aromatics, alkanes, alkenes, aldehydes, nitriles, carbonyls, esters, saturated aliphatic, ketones, nitro compound, and alkyl halides (consisting of bonds such as O–H stretch, N–H stretch, –C(triple bond)C–H: C–H stretch, C–H stretch, = C–H stretch, C(triple bond)N stretch, C=O stretch, C–C stretch (in–ring) etc.) with the steel surface. The wavelength peaks between 2853 and 2922 cm−1 on the same spectra peak consisting of C–H stretch alkanes (C–H stretch) completely disappeared signifying chemisorption interaction between protonated AZI molecules and LCS surface [36].

Fig. 10
figure 10

ATF-FTIR spectra of C6H8O7/2.5 M AZI solution before and after LCS corrosion test

4 Conclusion

Azadirachta indica oil extract effectively inhibited the corrosion and surface deterioration of low carbon steel in citric acid solution from the lowest to the highest concentration studied. The oil extract formed an effective coverage over the entire steel surface, suppressing metallic oxidation and attaining peak inhibition efficiency above 99%. This is due to the action of protonated oil extract molecules that adsorbed on the steel. ATF-FTIR spectroscopy confirmed limited adsorption at some wave lengths and at some other wavelengths complete adsorption. Anodic inhibition characteristics were the most dominant inhibition mode exhibited by the compound. Potentiostatic studies showed that azadirachta indica significantly influences the onset of passivation of the carbon steel in citric acid, through further analysis from open circuit potential measurement showed the passivation is thermodynamically unstable compared to the protective film formed by azadirachta indica. Images from optical microscopy and macro-analytical technique show azadirachta indica hinders the formation of corrosion pits.