1 Introduction

The acid treatment of metals, namely acid pickling, descaling, etching, etc., renders the metal surface free from stain, scale, rust, and other impurities. However, this action exposes the clean, bare metal more to the aggressive medium resulting in an increased metal dissolution. Therefore, corrosion inhibitors are used as additives in the cleaning acids. These additives mitigate corrosion by adsorbing themselves on the metal surface, forming a protective film that prevents the metal surface from being exposed to the aggressive environment [1, 2]. The use of inhibitors is economical and compatible compared to other mitigation techniques. Besides, it allows the use of low-grade carbon steel in the place of high-cost alloys [3]. There are numerous corrosion inhibitors tested and proven, but only a few are employed in practice. This observation reveals that in addition to protection, certain other factors such as cost-effectiveness, eco-friendly, non-toxic nature, ready availability, and compatibility in combating corrosion also matters. Polymers can act as effective corrosion inhibitors due to their inherent stability, ability to form complexes that can blanket the metal surface, and multiple binding sites that help in slower desorption.

Many of the natural polymers such as natural gums [4, 5], pectin [6,7,8], derivatives of cellulose [9,10,11,12], starch [13,14,15], carrageen [16, 17], alginates [18, 19], polysaccharide from maca (Lepidium meyenii) root extract [20], biomolecules-based expired drugs [21] expired herbal drug bearing glycosides and polysaccharides [22] have been evaluated as potential corrosion inhibitors for different metals in acidic and neutral solutions.

Chitosan derived by N-deacetylation process of chitin, the second most abundant polysaccharide on earth next to cellulose is found to be a promising biopolymer in the field of corrosion inhibition. Chitosan, the only cationic natural polysaccharide is composed of β-(1 → 4)-linked d-glucosamine and N-acetyl-d-glucosamine units. The presence of reactive poly hydroxyl groups and free amine groups make it an efficient functional material that can be exploited in various applications [23]. These functional groups can serve as potential adsorption sites to interact effectively with the metal surface. In addition, the ecofriendliness of chitosan has driven the research studies towards the evaluation of the corrosion inhibition efficiency of chitosan for different metals in different aggressive environment. Vorster filed a patent on chitosan as relatively cheap and non-toxic corrosion inhibitor for ferrous metals in acid chlorides and acid sulphates [24]. Though the evaluated inhibition efficiency of chitosan was promising, the drawback of low water solubility limited its application as corrosion inhibitor. Hence chitosan was chemically modified to enhance its solubility in water so that it can be used as corrosion inhibitor in any pH conditions.The hydroxyl group at the C-6 position and amino group at the C-2 position in chitosan are potential avenues for modification through chemical reactions even under mild conditions [25]. Chitosan-based thiosemicarbazide, thiocarbohydrazide, and Schiff bases also proved to be efficient green corrosion inhibitors [26, 27]. Studies on chitosan and its derivatives reveal its efficacy as potential green corrosion inhibitors. Polyaniline chitosan demonstrated a corrosion inhibition efficiency of 84.78% for Q235 mild steel in the acid medium [28]. PEG crosslinked chitosan showed an excellent corrosion inhibition efficiency of 93.9% for mild steel in sulphamic acid [29]. Amylose acetate blended carboxymethyl chitosan records an anticorrosive potential of 97.65% against mild steel in the acid medium [30]. Sodium lauryl sulfate modified chitosan and disodium EDTA functionalized chitosan revealed an inhibition efficiency of 96.44% and 96.63%, respectively [31, 32]. Synthetic chitosan derivatives such as N-phenylthiourea chitosan and N-phenyl-O-benzylthiourea chitosan showed a corrosion inhibiton efficiency of 98.4% and 98.5%, respectively, at the concentration of 100 mg/L for carbon steel [33]. l-arginine grafted chitosan was found to show an inhibition efficiency of 91.4% for mild steel in 0.5 M HCl [34]. Chitosan derivatives are proved to be excellent corrosion mitigators of other metals such as magnesium alloy in saline medium, copper in 1 M HCl, aluminium in sodium chloride solution [35,36,37].

The literature survey also reveals the various attempts to relate the antioxidant properties with that of the anticorrosive behavior in different plant extracts and organic compounds. Sher and Voevoda made a comparative study of antioxidant and anticorrosive properties of metal dialkyl- and diaryldithiophosphates [38]. Boujakhrout et al. studied the antioxidant activity and corrosion inhibitive behavior of Garcinia cola seeds and brazilian plant extracts [39]. Hussin et al. investigated derivatives of (2Z,4E)-3-hydroxy-1-(2-hydroxyphenyl)-5-phenylpenta-2,4-die-1-ones for their antioxidant activity and corrosion inhibition potential [40]. Mayakrishnan et al. evaluated antioxidant and anticorrosion properties of Epipremnum aureum leaves [41]. While Vorobyova et al. concluded that increase in total antioxidants in plant extracts can increase the corrosive inhibition [42]. This survey was done to analyze whether antioxidative properties can serve as a predictive index to evaluate the corrosion inhibition efficiency. Therefore, the present study targets the preparation of a water-soluble chitosan modified corrosion inhibitor with excellent antioxidant properties. By employing chitosan from the seafood waste, the dire need of the hour, namely practicing circular economy, has been realized in this research work.

In the present investigation, ferulic acid modified chitosan (FCS) was prepared using the method reported earlier [43] with slight modification and was characterized using different techniques. FCS plays a significant role in several biomedical applications, and for the first time, its application in the field of corrosion is explored in the present study. The corrosion mitigation efficiency of FCS was assessed using the gravimetric method and electrochemical studies. Surface studies serve as evidence for the mitigation potential of the inhibitor [31]. Theoretical studies were done to validate the experimental results.

2 Experimental

2.1 Instrumentation

The functional group characterization of FCS was done using ATR-FTIR (Shimadzu IRSpirit), UV–visible (Shimadzu UV-1800), and proton NMR (Bruker 400 MHz NMR) spectral studies. Thermogravimetric and differential scanning calorimetric curves were recorded (STA-6000 from Perkin Elmer) to analyze the temperature response. Malvern Zeta sizer (ZEN 3600) was employed to study the particle charge and size analysis.

Gamry Reference—600 instrument was employed for the electrochemical studies and Echemanalyst software for interpreting the experimental results.

Surface morphology studies of the metal samples were done to relate the decrease in metal dissolution with the inhibitor film formation. The contact angle analyzer, Phoenix 300 Plus model, was used for the contact angle measurement. Carl Zeiss Sigma V Field Emission Scanning Electron Microscope was employed for SEM and EDAX analyses. Atomic force microscope (NTDMT model) and optical profilometer (ZETA-20 model), engaged for surface topography and roughness studies. Images in the optical profilometer captured using a ×20 magnification lens. Zeta 3D software is used for the analysis of the images.

2.2 Chemicals and Reagents

Chitosan (75% deacetylated) from Sigma-Aldrich, ferulic acid (minimum assay of 99.0%) from Hi-Media Laboratories Pvt. Ltd. the carbodiimide coupling reagent (EDC) and doubly distilled water from Sisco Research Laboratories Pvt. Ltd. were procured for the present research. Analar grade concentrated hydrochloric acid, acetone, ethanol, methanol were used for the investigation. Chitosan was further washed with boiling water, followed by methanol, and dried in a vacuum desiccator [44].

2.3 Mild Steel Metal Samples

Mild steel samples were cut into strips of 5 × 1 × 0.2 cm dimension and 1 × 1 cm dimension for weight loss and electrochemical studies. The metal samples were polished with a buff wheel, abraded with fine emery sheets, cleaned, and degreased before storing in the desiccator for further use.

2.4 Preparation of Corrosion Inhibitor

Chitosan in 25 ml of 0.25 M hydrochloric acid was stirred overnight at room temperature. An equal amount of ferulic acid is added to the EDC coupling reagent in 10 ml of absolute ethanol. The mixture is then slowly transferred to the chitosan solution placed on a magnetic stirrer maintained at 60 °C. The stirring was continued for 3 h, and the white precipitate obtained was washed with acetone, then kept in a desiccator for drying. Scheme 1 display the chemical reaction involved in the preparation of the modified chitosan.

Scheme 1
scheme 1

Preparation of FCS

2.5 Assessment of Anticorrosive Performance of FCS

2.5.1 Gravimetric Studies

Gravimetric studies was carried out based on standard ASTM procedure (ASTM G1-03) [45]. Mild steel specimen of composition Fe-94.43%, C-0.175%, Si-0.258%, Mn-0.456%, P-0.013%, S-0.007%, Cr-0.983%, Mo-0.195%, Ni-3.306%, Al-0.023%, Cu-0.078%, Ti-0.004%, V-0.011%, W-0.040%, Pb-0.005%, N-0.015%, Nb-0.006% was used for the present investigation. Preweighed metal samples in triplicates were held in suitable glass hooks and immersed in 100 ml beakers containing 0 to 500 ppm concentration of FCS inhibitor in 1 M HCl [46]. The immersion periods chosen for the present study include ½, 1, 3, 6, 12, and 24 h at 303 K. After the stipulated immersion periods, the samples were removed, washed thoroughly with water, and placed in the desiccator. The metal samples are weighed again to note the weight loss. The same procedure was repeated for the temperature studies done at 303, 313, 323, 333, and 343 K for an immersion period of half an hour. Both the immersion and temperature studies were performed in triplicates under aerated and unstirred conditions.

The inhibition efficiency (ηCI) of FCS against corrosion was calculated using Eq. 1 and corrosion rate (\({K}_\text{CR}\)) using Eq. 2.

$${\eta }_{\mathrm{CI}}=\frac{W_\text{b}-W_\text{i}}{W_\text{b}} \times 100$$
(1)
$${K}_{\mathrm{CR}} \left(\mathrm{mpy}\right)=\frac{3.45 \times {10}^{6} \times \mathrm{weight \, loss}}{\mathrm{DAT}},$$
(2)

where wb and wi represent the weight loss of the metal samples when exposed to 1 M hydrochloric acid and FCS solution, respectively. D is the metal density in g/cm3, A is the area of the metal samples in cm2 and T indicates the exposure period in hours.

2.5.2 DC and AC Electrochemical Measurements

Tafel, linear polarization resistance, and AC impedance studies were carried out at room temperature under aerated and unstirred conditions using Gamry Reference 600 instrument. Mild steel sample was employed as the working electrode, stable and robust saturated calomel electrode as reference electrode, and platinum electrode as an auxiliary to complete the cell circuit. The electrochemical impedance spectroscopic studies were performed at a frequency range of 100 kHz to 0.01 Hz with 10 mV amplitude as AC signal at steady-state open circuit potential. Echemanalyst software interpreted the experimental results. Tafel polarization curves were obtained by applying a sweeping potential of + 250 mV anodically and − 250 mV cathodically versus the open circuit potential at 0.1666 mV/s scan rate as per ASTM G59-97 (2014) [47]. Mostly 1 mV/s is used as scan rate for potentiodynamic polarisation measurements of corrosion rates as was found in the literature. However, the experiment was performed at the standard scan rate of 0.1667 mV according to ASTM recommendations, although a faster scan rate of 1 mV/s is permitted [48,49,50,51,52,53,54]. Low scan rate as recommended by ASTM can produce high quality and reliable output, however is a time-consuming process [55]. Therefore, scan rates in the order of 0.5 mV/s, 1 mV/s and 1.67 mV/s are employed which also is found to give good results [56,57,58,59,60,61]. The scan rate is an important parameter in the polarisation experiment as the rapid scan rate results in the incomplete charge transfer within the interface of the working electrode, while the lowest scan rate may cause irreversible changes to the interface structure of the corroding system leading to erroneous results [55]. The linear polarization resistance measurements were made at ± 20 mV vs. OCP and 0.5 mV/s scan rate [62, 63].

The percentage of inhibition efficiency of the FCS inhibitor is calculated using icorr values from Tafel studies, LPR values from linear polarisation studies, and Rp values from impedance studies employing the following equations.

$$IE_{{\text{T}}} \, \left( \% \right) = \left( {\frac{{I_{{{\text{corr}}_{{\text{0}}} }} - I_{{{\text{corr}}_{{{\text{inh}}}} }} }}{{I_{{{\text{corr}}_{0} }} }}} \right) \times 100$$
(3)
$$IE_{{{\text{LPR}}}} \, \left( \% \right) = {\text{ }}\left( {\frac{{{\text{LPR}}_{{{\text{inh}}}} - {\text{LPR}}_{0} }}{{R{\text{p}}_{{_{{{\text{inh}}}} }} }}} \right) \times 100$$
(4)
$$IE_{{{\text{Rp}}}} \, \left( \% \right) = \left( {\frac{{R{\text{p}}_{{{\text{inh}}}} - R{\text{p}}_{0} }}{{R{\text{p}}_{{{\text{inh}}}} }}} \right) \times 100$$
(5)

where \({I_{\text{corr}_{0}}}\) and \({I_{\text{corr}_\text{inh}}}\), \(\text{LPR}_{0}\mathrm{ \, and \,}\text{LPR}_\text{inh}\), \({R_{\text{P}_{0}}}\mathrm{ \, and \,}{R_{\text{P}_\text{inh}}}\) represent the corrosion current density, linear polarisation resistance, and polarization resistance obtained when the electrolyte solution was 1 M HCl and FCS, respectively

2.6 Theoretical Studies

2.6.1 Quantum Chemical Calculations

Quantum chemical calculations were done using density functional theory employing Gaussian 09 software in the framework of the B3LYP/6 − 31 + G (d, p) basis set. Theoretical parameters were calculated for the optimized molecular geometry of neutral and protonated FCS [64]. The Mulliken charges generated aided to locate the potential sites of protonation, and the most favourable protonation site was decided by calculating the proton affinity values for each potential site. According to Koopman’s theorem, the following parameters are related to the energy of the frontier orbitals EHOMO and ELUMO by Eqs. S1 and S2.

According to Mulliken, the electronegativity (\(\chi )\) is the average value of ionization potential and electron affinity represented by Eq. S3. Similarly, the global hardness (η\()\) is calculated using the Eq. S4.

η is related to the energy gap between the frontier molecular orbitals. The lesser the energy gap, the more is the softness, and the greater is its chemical reactivity.

According to Parr et al., the electrophilicity index (ω) is the natural tendency of a species to accept electrons. The electrophilicity index (ω) can be calculated using the Eq. S5.

The quantum parameter ΔN is used to evaluate the altitude of the transferred electrons and is represented by the Eq. S6.

2.6.2 Monte Carlo and Molecular Dynamic Simulation Details

The evaluation of the interaction between the Fe (110) surface and the inhibitor molecule (FCS) throughout Monte Carlo (MC) and Molecular dynamic (MD) simulation is performed in the simulated corrosion medium by the use of a seven atom-thick layer unit cell of Fe (110) surface. The slab size used in these calculations was: 24.842 Å × 24.842 Å × 12.533 Å with a 25 Å vacuum layer. This box is filled with 550 water molecules/1 inhibitor molecule (in neutral or protonated state)/10 hydronium + 10 chloride ions [65].

MD was attained using the NVT at 298 K over a simulation time of 300 ps (using a 1 fs time step and 0.5 ns simulation time) [66,67,68,69]. The temperature control is attained via the Berendsen thermostat [70]. The recurrently COMPASSII forcefield used in corrosion studies was used for the MC (Monte Carlo) and MD (Molecular Dynamic) [71,72,73,74]. The Radial Distribution Function (RDF) analysis is implemented on the complete trajectory of the MD [31, 73, 75].

3 Results and Discussion

3.1 Spectral Characterization, Thermal Stability, and Zeta Potential Analysis of FCS

Comparative infrared spectra of (a) chitosan biopolymer, (b) ferulic acid, and (c) FCS is displayed in Fig. 1. The chitosan spectrum shows absorption bands at 3270–368 cm−1 arising due to N–H and O–H stretching vibrations. This band also includes intramolecular hydrogen bond characteristic of polysaccharides. The symmetric and asymmetric stretching of C–H bonds occur at 2911 and 2867 cm−1. The C=O and C–N stretching vibrations of the N-acetyl group are found at 1637 cm−1 and 1317 cm−1. The absorbance band found at 1568 cm−1 is due to N–H bending vibrations of the primary amine. CH2 bending vibrations and CH3 symmetrical deformations are identified at 1420 cm−1 and 1381 cm−1, respectively. IR peaks at 1144 cm−1, 1059 cm−1 and 1025 cm−1 corresponds to the C–O–C bridge and C–O asymmetric stretching. The C–H bending vibrations of out of plane of the monosaccharide ring correspond to the peak at 900 cm−1 [76]. Ferulic acid has the following characteristic peaks, namely O–H stretching at 3448 cm−1 and C–H stretching at 2911–3015 cm−1, C=O stretching of the carboxyl group at 1703 cm−1, C=C of the aromatic ring at 1517 cm−1, and C–O stretching of the carboxylic group at 1272 cm−1 [77]. The new peak at 1512 cm−1 corresponds to C=C of the aromatic ring that serves as evidence for FCS formation. The intensity of C=O and N–H stretching bands of the amide group found at 1625 cm−1, and 1553 cm−1 is also increased. The increased peak intensity at 2926 cm−1 can be attributed to C–H stretching. The disappearance of the N–H absorption peak of the primary amine at 1589 cm−1 further supports the grafting process [43, 78]. There is no IR peak at 1730 cm−1 that confirms the absence of ester formation.

Fig. 1
figure 1

Comparative IR spectrum of (a) chitosan biopolymer, (b) ferulic acid and (c) FCS

Figure 2 displays the UV–visible spectra of chitosan biopolymer, ferulic acid, and FCS. Chitosan in 1% acetic acid is found to give no absorption peak in the entire spectral range from 250 to 400 nm. An ethanolic solution of ferulic acid shows an absorbance maximum at 290 nm and 321 nm. FCS in 1 M HCl solution shows the same absorbance maxima at 321 nm that supports chitosan ferulic acid amide [43, 79]. Some literature studies also have highlighted redshift for ferulic acid grafted chitosan [80].

Fig. 2
figure 2

Comparative UV spectrum of (a) chitosan, (b) ferulic acid, and (c) FCS

The chemical structure of the FCS inhibitor is further characterized using H1 NMR spectra portrayed in Fig. 3. The D2O solvent peak is found at 4.8 ppm, and the proton signals at 3.8 ppm, 6.3 ppm, and 7.6 ppm correspond to –OCH3 and methine protons CH(g), CH(h) of ferulic acid, respectively. The remaining aromatic protons, namely H(e–f), show doublet signals at 7.1 ppm, 6.8 ppm, and 7.2 ppm. The proton signals at 5.2 ppm, 3.18 ppm, 3.7–4.5 ppm correspond to chitosan protons H(1–6) [43].

Fig. 3
figure 3

NMR spectrum of FCS inhibitor

Comparative TGA and DSC curves of chitosan and FCS are shown in Fig. S1(a) and (b), respectively. TGA curve of chitosan reflects a weight loss of 50% at the degradation temperature range of 295–370 °C, whereas that of the modified polymer is 209–302 °C. The thermal stability of FCS is reduced compared to chitosan biopolymer. The decrease may be accounted due to the loose packing structure or reduction in the intermolecular hydrogen bonding [78, 81]. DSC curve of chitosan shows a broad endothermic peak at 122 °C that corresponds to the loss of moisture content bound to the polymeric backbone. The exothermic peak at 337 °C is attributed to the decomposition of chitosan. In contrast, the endothermic and exothermic peaks of FCS are found at lower temperatures than chitosan, i.e., at 114 °C and 210 °C, respectively [43].

Figure S2(a) and (b) reveals the zeta potential value and the average particle diameter distribution of FCS are + 49.5 mV and 383.3 nm, respectively. Polymers with a zeta potential value greater than 30 mV can show a more stable dispersion as the particles repel each other [82, 83]. Corrosion inhibitors with a positive zeta potential value can enhance corrosion protection. The positive surface charge on the inhibitor thus serves in adhering to the oxidized metal surface through the anions of the acid solution [84].

3.2 Measurement of the Anticorrosive Performance of FCS

3.2.1 Gravimetric Studies

Figure 4a portrays the change in the inhibition efficiency of FCS with varying immersion periods at 303 K. FCS showed the highest value of 95.96% when the metal samples were immersed in 500 ppm concentration of inhibitor solution. Such good anticorrosion performance can be corroborated with enhanced adsorption of the heteroatoms of the inhibitor on the metal surface [85]. Figure 4b displays the variation in the corrosion inhibition efficiency of FCS with the change in temperature from 303 to 343 K. The inhibition potential increases with temperature up to 313 K and after that is found to decrease slowly. Prolonged exposure of the metal surface to the inhibitor solution (> 6 h) and an increase in temperature (> 313 K) showed a slight decrease in the inhibition performance of FCS. The decreased stability of the adsorbed inhibitor on the longer exposure time and increased metal surface kinetic energy at higher temperatures may have led to the desorption process and hence a fall in efficiency [6, 86].

Fig. 4
figure 4

Change in corrosion inhibition performance of FCS for mild steel in 1 M HCl at various a immersion periods, b temperatures

The corrosion rate and the temperature can be related by the Arrhenius and transition state equations represented by the Eqs. 6 and 7.

$$log {K}_\text{CR}= \frac{-{E}_\text{a}}{2.303RT}+\mathrm{log}A$$
(6)
$$log\frac{{K}_\text{CR}}{T}=\frac{R}{Nh}{\mathrm{exp}}^{\frac{\Delta {S}^{*}}{R}}{\mathrm{exp}}^{\frac{-\Delta {H}^{*}}{RT}}$$
(7)

where Ea is the apparent activation energy, ΔS* and ΔH* refers to the entropy and enthalpy of activation. Table 1 lists the activation parameters calculated from the linear plots drawn based on Eqs. 6 and 7, namely log KCR vs. 1/T and log (KCR/T) vs. 1/T. The Ea values of the inhibited solutions are found to be less than that of the uninhibited solution. Such lower or unchanged Ea values can be corroborated with the chemical interaction between the metal and the heteroatoms of the FCS molecules [87, 88]. The increased inhibition performance of FCS with the temperature rise implies that chemisorbed passive film formation is higher than the dissolution rate. The lowering values of the frequency factor A can be correlated with the decreased corrosion rate in the presence of FCS [89]. The positive values of ΔH* reveals that the metal dissolution involves an endothermic process. The negative values of ΔS* declare the decrease in the disorderliness that may be due to the formation of the more orderly activation complex [90].

Table 1 Activation parameters for mild steel in acid solution without and with FCS

The inhibition efficiency relies on the corrosion inhibitor's quickness to diffuse from the solution to the metal surface. Thereby, it replaces the adsorbed water molecules and effectively binds to the active sites present on the surface [91]. The degree of surface coverage θ decides the nature and the mode of inhibitor adsorption [92]. The θ values at different temperatures were calculated using Eq. 8 and were fitted into various adsorption isotherm models. Based on the linear regression coefficient R2 values, Langmuir adsorption isotherm represented by Eq. 9 was found to be the best fit.

$$\mathrm{Surface \, coverage \, \theta }=\frac{W_\text{b}-W_\text{i}}{W_\text{b}}$$
(8)
$$\frac{C}{\theta }= \frac{1}{{K}_{\mathrm{ads}}}+C$$
(9)

where C represents the inhibitor concentration, and Kads refers to the equilibrium constant. Figure 5 displays the Langmuir plot, and slope values are found to deviate from unity. The deviation can be attributed due to the mutual attractive or repulsive interaction between the polar atoms or groups present in the polymers when adsorbed on the metal surface. On the contrary, the Langmuir isotherm equation was derived ignoring these interaction between the adsorbed molecules. In addition, the changes in the adsorption heat with increase in the surface coverage of the inhibitor was not included during the derivation of the Langmuir isotherm [93]. The slope deviation reveals that in addition to R2 values, another physical characteristic KL of the adsorption isotherm is to be considered for the best fit [94, 95]. KL is referred to as the dimensionless separation factor of inhibitor adsorption and is related to Kads by the following equation

Fig. 5
figure 5

Langmuir isotherm plot for mild steel in 1 M HCl without and with FCS

$${K}_\text{L}=1/1+{K}_\text{ads}C$$
(10)

The average values of KL values calculated based on Eq. 6 is displayed in Table 2. According to Eduok and Khaled, if KL < 1, then the adsorption process is considered favorable. If KL > 1 or KL = 1 then, the adsorption process is unfavorable or deemed to be irreversible [95]. Based on this literature, it is clear that the FCS inhibitor favors the Langmuir adsorption process.

Table 2 Adsorption parameters for mild steel in 1 M HCl without and with FCS inhibitor at different temperatures

Table 2 lists the other adsorption parameters calculated for mild steel in 1 M hydrochloric acid without and with FCS inhibitor. The standard free energy of adsorption ΔGads is calculated using the following equation:

$$\Delta {G}_{\mathrm{ads}}=-{RT{\mathrm{ln}}}(1 \times {10}^{6}{{K}}_\text{ads})$$
(11)

where R represents the ideal gas constant, T is the temperature in Kelvin, and 106 is the value of water concentration in ppm [96]. The negative values of ΔGads support the spontaneity of the adsorption process. When the values of ΔGads is less than 20 kJ/mole corresponds to physisorption, and greater than 40 kJ/mole conforms to chemisorption [97]. The ΔGads values listed in Table 2 lies between 28 and 32 kJ/mol. These values can be corroborated with the initial electrostatic interaction between the FCS inhibitor and the metal surface, leading to physisorption. The transfer of electron pairs from the heteroatoms to the empty d orbitals of Fe2+ ions and retro donation to the unoccupied π* orbital of the FCS molecule occurs, resulting in the chemisorption process [98]. The value of Kads also reflects the increased binding of the inhibitor molecules on the metal surface [21, 94].

3.2.2 Electrochemical Measurement Techniques

3.2.2.1 Polarization/Tafel Studies

Tafel studies help to analyze the influence of the inhibitor to mitigate the corrosion process taking place at the anode or cathode or both. Figure 6 illustrates the polarization curves obtained for mild steel at room temperature in the absence and presence of FCS inhibitor. The Tafel plot depicts the decrease of current density with an increase in FCS concentration. The decrease implies that the inhibitor film formed impedes the passage of aggressive ions to the metal surface [95]. Table 3 display the various corrosion parameters obtained from the Tafel polarization curves. The Ecorr values can be related to the driving force towards the corrosion reaction. Higher Ecorr values imply a greater energy requirement for the corrosion reaction to take place [99]. The positive shift of Ecorr values from − 443 to − 189 mV illustrates the corrosion inhibition performance of the inhibitor [100]. This potential shift is further supported by the lowering of the corrosion current icorr density [30]. The change in both anodic (βa) and cathodic Tafel slopes (βc) reveals that the inhibitor influences both cathodic and anodic reactions but predominantly anodic [101]. The LPR values increases with the concentration of the FCS polymer as displayed in Table 2. This increase indicates a decreased metal dissolution due to the adsorption of the inhibitor molecules on the metal surface. The inhibition efficiency calculated using icorr values showed a maximum of 97.4% for 500 ppm concentration which matches with those calculated from LPR values.

Fig. 6
figure 6

Tafel plot for mild steel in 1 M HCl with and without FCS

Table 3 Tafel electrochemical parameters for mild steel in 1 M HCl without and with FCS
3.2.2.2 AC Electrochemical Impedance Studies

EIS technique has emerged out as an excellent tool to study the effectiveness of the corrosion inhibitors, both qualitatively and quantitatively [102]. Figure 7a and b represents the Nyquist and Bode plots obtained for mild steel in blank and in the presence of FCS. The Nyquist plot clearly shows an increase in the diameter of the impedance plot with the inhibitor concentration. This increase can be attributed to the inhibitor film formation by protecting the metal surface from corrosion [103]. The inhibition of corrosion is further supported by the rise in the phase angle with the increase in the inhibitor's concentration, as shown in the Bode plot [104]. The Bode plot reveals only one time constant, which can be corroborated with the corrosion inhibition by the charge transfer process and is not changed by the inhibitor's presence [105]. The semi-circle in the Nyquist plot is not perfect due to the metal surface's inhomogeneity, surface irregularities, impurities, surface active sites collectively referred as frequency dispersion effect [98, 106]. Hence the capacitor in the equivalent circuit is replaced by the constant phase element to compensate the depression in the semi-circle [107]. Table 4 lists the equivalent circuit fitted impedance parameters, and Fig. 8 displays the equivalent circuit. The double-layer capacitance Cdl can be calculated from the magnitude of constant phase element Y0 values using the Eq. 12.

Fig. 7
figure 7

a Nyquist spectra, b impedance bode modulus plots for mild steel in 1 M HCl without and with FCS inhibitor at 303 K

Table 4 EIS parameters for mild steel in 1 M HCl without and with FCS
Fig. 8
figure 8

Equivalent circuit

$${C}_\text{dl}={\left({Y}_{0}*{{R}_\text{ct}}^{1-n}\right)}^{1/n}$$
(12)

The decreasing Cdl values and increasing charge transfer resistance (Rp) values ith FCS concentration can be correlated with the increased thickness of the protective film leading to an increased corrosion inhibition [108].

3.3 Surface Characterization

3.3.1 Contact Angle Measurements

Figure 9 displays the contact angle of (a) plain metal surface, (b) & (c) the metal surfaces exposed to acid and acid containing FCS, respectively. An angle of 90° or less indicates that the steel surface is hydrophilic and higher than 90° hydrophobic. The enhanced hydrophobic nature of the inhibitor immersed metal sample reveals the FCS's adsorption on the metal surface, leading to the protective film formation [109,110,111].

Fig. 9
figure 9

Contact angle of mild steel surfaces a plain, b exposed to acid, c exposed to acid containing the FCS inhibitor

3.3.2 Field Emission Scanning Electron Microscopic Analysis

Figure 10a portrays the scanning electron microscopic images of the metal surface before exposure to the acid solution. Figure 10b depicts the extensive damage produced when the metal sample is in contact with the aggressive acid medium in the inhibitor's absence. Figure 10c reflects the resistance offered by the FCS inhibitor against the metal dissolution as the surface is smooth as that of the plain metal.

Fig. 10
figure 10

SEM image of the mild steel surfaces a plain, b exposed to acid, c exposed to acid containing FCS

3.3.3 Energy Dispersive X-ray Analysis

EDAX images with % of different element contents of the bare metal surface, surface exposed to uninhibited and inhibited acid solution are displayed in Fig. 11a–c.

Fig. 11
figure 11

EDAX image of surfaces a plain metal, b exposed to 1 M HCl, c exposed to 1 M HCl containing FCS

The rich iron content peak in Fig. 11a portrays the polished mild steel surface [62]. The surface damage of the metal surface and the reduction in the corrosion active sites when immersed in the absence and presence of FCS containing acid solution can be explained by comparing Fig. 11b and c, respectively. The presence of oxygen and chlorine peaks in Fig. 11b reflects the formation of the corrosion products such as chlorides and oxides on the mild steel surface [112, 113]. On the other hand, suppression in the oxygen and chlorine peaks, increase in iron and carbon content supports the formation of the organic polymer film on the surface inhibiting the corrosion [114, 115].

3.3.4 Optical Profilometric Studies

Figure 12a–c portrays the optical profilometric images of the bare metal surface and surfaces exposed to uninhibited and inhibited solution. Arithmetic average roughness value (Sa) and the root mean square roughness value (Sq) for the well-polished plain metal surface were found to be 1.551 µm and 1.977 µm, respectively. The metal surface exposed to uninhibited acid solution showed an increased roughness value of 3.371 µm (Sa) and 4.456 µm (Sq). However, the metal surface exposed to an acid solution containing an optimum FCS concentration has shown a decreased surface roughness value of 1.597 µm (Sa) and 2.305 µm (Sq). This decrease may be corroborated with the reduction in corrosion in the presence of the inhibitor [116].

Fig. 12
figure 12

3D images of mild steel surfaces a plain metal, b exposed to acid and c exposed to acid containing FCS

3.3.5 Atomic Force Microscopy (AFM)

AFM is a useful tool for monitoring the corrosion processes by visualizing the surface morphology of different materials. Figure 13 represent AFM (2 D and 3 D) images of the bare metal surface, metal surface exposed to uninhibited and inhibited solution, for 6 h. It is evident from Table 5 that the average roughness value and root mean square value of the metal sample exposed to acid containing FCS shows a significant decrease. This result can be corroborated with the film formed by the inhibitor adsorbed on the metal surface [117].

Fig. 13
figure 13

AFM image of surfaces a plain metal, b exposed to 1 M HCl and c exposed to 1 M HCl containing FCS

Table 5 AFM parameters for mild steel surface exposed to acid without and with FCS

3.3.6 UV Spectral Analysis

Figure 14 depicts the UV–visible spectra of FCS solution before and after the immersion of mild steel samples. The UV–vis spectrum of FCS solution before immersion of the metal samples show absorption bands at 290 nm and 321 nm. These bands correspond to the ππ* electronic transitions of the aromatic ring and nπ* transitions by the lone pair of electrons on the nitrogen and carbonyl group, respectively [118]. On the other hand, the UV–vis spectrum of the FCS solution taken after 6 h of immersion of metal samples shows an increase in the absorbance bands from 321 to 266 nm (blue shift). Besides, the absorbance band at 290 nm is disappeared. The increase and change in the position of the absorbance band can be corroborated with the strong interactions of the heteroatoms of the FCS inhibitor and the Fe2+ ions resulting in the complex formation [119,120,121,122].

Fig. 14
figure 14

UV–visible spectra of FCS solution before and after introducing the mild steel samples

4 Theoretical Studies

4.1 DFT Studies

DFT studies serve as a successful tool in predicting the reciprocity between the inhibitor and the metal. The theory throws light on the chemical reactivity and selectivity of corrosion inhibitors, thereby aid to propose a suitable mechanism for the corrosion inhibition process. The quantum chemical calculations were performed for the neutral FCS molecule and also for the protonated form as the study is done in an acid medium. These calculations will enable identifying the preferred form of the inhibitor that can selectively interact with the metal surface.

Figure 15 displays the optimized geometry, frontier molecular orbitals, electrostatic potential mapping of the FCS in both neutral and protonated forms. The protonation site in the FCS molecule was decided based on the proton affinity values calculated using the following equation

$$PA = E_{{{\text{prot}}}} + E_{{{\text{water}}}} - E_{{{\text{non}}_{{{\text{prot}}}} }} - E_{{{\text{hydronium ion}}}}$$

where, the term are the corresponding sum of electronic and thermal enthalpies of the protonated inhibitor, neutral inhibitor, water and hydronium ion [123, 124]. The protonation of FCS as supported from DFT calculations (results presented in Table 6) involves the amino group of the molecule.

Fig. 15
figure 15

Optimized molecular structure, frontier MO and electrostatic potential mapping of neutral and protonated FCS

Table 6 Sum of electronic and thermal enthalpies (SE & TE) and the calculated proton affinity (PA) for the inhibitor

The electron density distribution plots of the frontier molecular orbitals, i.e., HOMO and LUMO orbitals, are useful to locate the preferred sites of adsorption in the inhibitor molecules. The electron distribution is solely on the ferulic acid moiety and the methyl group of the methoxy group of the ferulic acid moiety is found to contribute to a smaller extent to the HOMO and no contribution to the LUMO; in both neutral and protonated forms. This suggests the charge transfer by the –CH3 group of ferulic acid through s—type HOMO and the heteroatoms of the chitosan moiety to the vacant orbital d orbital of the Fe on the mild steel surface [125]. The electrostatic potential structure reveals the nucleophilic region (red color) and the electrophilic region (blue) of the FCS inhibitor [126].

Table 7 gives quantum chemical parameters calculated based on the density functional theory for the neutral and protonated FCS molecule. The EHOMO and ELUMO values provide valuable information regarding the electron donating and accepting capacity of the neutral and protonated FCS molecule. The greater the value of EHOMO, the more it behaves as an electron donor, and the lower ELUMO value characterizes electron acceptors. When an inhibitor shows a tendency to donate electrons to the metal surface and at the same time tends to accept the electrons back donated by the metal, then stronger is the adsorption process [29, 127]. Table 6 reveals that neutral and protonated molecules behave as an electron donor and a good electron acceptor, respectively. This behavior can be corroborated with the increased global electronegativity (χ), electrophilicity index (ω) values of the protonated FCS molecule, and the higher fraction of the electron transfer (ΔN) value for the neutral molecule [29]. Electrophilicity index value denotes the energy stabilization after accepting the additional electrons from the environment. The energy gap (ΔE) between the frontier molecular orbitals measures the kinetic stability of the corrosion inhibitor [128]. Smaller energy gap values indicate lesser kinetic stability and hence greater reactivity with the metal surface. Thus, protonated form contributes to the better performance of the inhibitor than that of the neutral molecule. Dipole moment (μ) values can be related to the electrostatic interaction between the inhibitor molecules and the metal surface. The higher values of the dipole moment reveal that protonated molecule contributes physisorption process compared to that of the neutral molecule [129].

Table 7 Quantum chemical parameters of neutral and protonated FCS molecule

4.2 Monte Carlo and Molecular Dynamic Simulation Studies

The interaction of the FCS and FCS-H+ onto the Fe (110) surface offers a mean to calculate the adsorption energetics of this adsorption process. Quantitatively, this is done by calculating the adsorption energy (Eads) using the following equation [31, 69, 75, 130,131,132,133,134,135,136]:

$$E_{\text{adsorption}} = E_{{\text{Fe}}\;\left({110} \right)_{||} {\text{FCS or FCS-H}}+} - \left( {E_{{\text{Fe}}\;\left( {110} \right)}} + E_{{{\text{FCS or FCS-H}}+}} \right)$$
(13)

where \({E}_{\mathrm{Fe}{\left(110\right)}_{||}\mathrm{FCS \, or \, FCS}\mathrm{-H}+}\) is the total energy of the simulated corrosion system, EFe, and \(E_{\mathrm{FCS \, or \, FCS}\mathrm{-H}+}\) are the total energy values of the Fe (110) surface and the free inhibitor molecules (in their neutral or protonated state) [31].

The lowest energy configuration of FCS and FCS-H+ on the Fe (110) surface is presented in Fig. 16. The inhibitor is absorbed on the Fe (110) surface in a geometry that takes advantage of the surface contact through its oxygen atoms.

Fig. 16
figure 16

MC poses the lowest adsorption configurations for the FCS and FCS-H+ in the simulated corrosion media on the Fe (110) surface

The energy values (in terms of different contributions) over the random MC configuration search are shown in Fig. 17. After 3,000,000 MC steps as perceived from the graph, the value of total average energy is equilibrated, indicating that the lowest energy configuration of the inhibitors was attained.

Fig. 17
figure 17

The presentation of the different energy terms contributions during the Monte Carlo calculations for FCS (neutral) and FCS-H+ (protonated) inhibitor molecule

The Eads. distribution of the FCS and FCS-H+ inhibitor gained by a massive number of unsystematic configurations from Monte Carlo calculations (values of adsorption energies for ten lowest energy poses are presented in supporting information Table S1) is presented in Fig. 18.

Fig. 18
figure 18

Distribution of adsorption energies for: FCS (neutral) and FCS-H+ (protonated) inhibitor onto the Fe (110) surface

The corrosion inhibitor mitigate corrosion by adsorbing on the metal surface replacing the water molecules. The negative values obtained for the adsorption energy of the FCS inhibitor, water molecules and the aggressive species namely H3O+ and Cl ions on Fe (110) surface indicates the spontaneity of the adsorption process. Also, the greater adsorption energy values obtained for the FCS inhibitor compared to water, H3O+ and Cl ions reveals the adsorption strength of the FCS inhibitor on the Fe (110) surface. This remarkable ability of FCS makes it a significant corrosion inhibitor for iron surface in HCl solution [137, 138]. The Eads onto Fe surface values (Fig. 18) for the FCS adsorption is from − 239.35 to − 285.55 kcal/mol (with the maximum value of Eads probability distribution at –262.15 kcal/mol). The adsorption energies are higher for the protonated form of the FCS molecule (namely FCS-H+). They are in the range of − 372.95 to − 415.86 kcal/mol (with the maximum value of Eads probability distribution at − 395.85 kcal/mol). These huge Eads. are suggestive of a strong adsorptive interaction of this inhibitor with the Fe (110) surface [67, 68, 132].

MD poses presented in Fig. 19, show that the adsorption of these molecules, although in its neutral state, only covers a small fraction of the iron surface. In the case of the protonated FCS it’s adsorption properties increase—in this case, the molecule tends to have a flat geometry onto the Fe (110) surface (the equilibration of the temperature and the energy terms during the MD simulations are shown in the supporting information).

Fig. 19
figure 19

MD poses the lowest adsorption configurations for the FCS and FCS-H+ in the simulated corrosion media on the Fe (110) surface

A modest method to attain the information vis-à-vis the adsorption process is to use the RDF peak appearance distance [68, 70, 75, 131, 139]. The peak presence for the FCS and FCS-H+ inhibitor is at a lesser distance than 3.5 Å from the surface of Fe indicates the chemisorption process, while for physisorption, this is projected at larger distances. As evidenced in Fig. 20, the RDF value for nitrogen and oxygen atoms in the FCS-H+ case is present at 3.01 Å (O) and 3.07 Å (N) from the Fe (110) surface—an expected value for the chemisorption process. Whereas for the FCS, accountable atoms for the absorption are oxygen atoms [RDF is 2.97 Å (O)]; the nitrogen atoms, as evidenced from the RDF distance of 8.80 Å (N) are do not contribute to the adsorption process. The corresponding RDF analysis support that the chemisorption is involved during the adsorption of the inhibitor that decreases the corrosion rate of the Fe (110) surface [66, 67, 69, 71, 130, 140].

Fig. 20
figure 20

RDF of heteroatoms (nitrogen and oxygen,) for FCS and FCS-H+ on the Fe surface obtained from MD trajectory

4.2.1 Corrosion Inhibition Mechanism

Corrosion inhibitors adopt surface-based adsorption mechanism to protect the metal from corroding when exposed to aggressive environment.The inhibitor molecules get adsorbed on the metal surface replacing the already adsorbed water molecules [141]. The adsorption mechanism include both physisorption, chemisorption and electrostatic adsorption. Physisorption involve a weak Vander waals force of attraction and that the adsorbed inhibitor on the metal surface may be easily desorbed with raise in temperature. On the other hand, chemisorption involve the formation of covalent bonds due to the exchange of electrons between the surface sites of the metal and the inhibitor molecules. While, electrostatic adsorption involves coloumbic force of attraction between charged metal surface and the charged functional groups. Based on the corrosive medium employed and nature of the polymer used, corrosion inhibitor adsorption can occur via physisorption, chemisorption, electrostatic adsorption or all the three modes of adsorption.The present study involves acid medium, so preferentially electrostatic adsorption come into play as FCS is in protonated form. On the other hand the anions of the acid medium namely Cl adsorbed on the oxidised metal surface literally attracts the protonated FCS towards it. This aid in the surface coverage of the inhibitor which increases with the increase in inhibitor concentration. The electrostatically attracted protonated FCS may now interact chemically with the metal surface leading to chemisorption. The chemisorption process encountered in the inhibition study is supported by the increase in inhibition with increase in temperature and also from Ea values. Further support comes from the lower energy gap values of the protonated FCS compared to neutral FCS by DFT study. The Monte Carlo and molecular dynamics simulation studies and RDF analysis further endorse the preferential adsorption of the protonated FCS on the metal surface through chemisorption process. Though the dipole moment value indicates a physisorption process, a large molecule like FCS can show numerous such weak vanderwaals forces leading to summative interactions stronger like chemisorptions [142]. Hence, in case of large molecules a mixed adsorption process is encountered. The presence of the lone pair of electrons on the functional groups present in the polymer can act as a ligand forming metal ligand complexes as was reflected in the UV spectral studies.

4.2.2 Comparative Study of Corrosion Inhibition Efficiency

The inhibition efficiency of the FCS corrosion inhibitor evaluated in the present study is compared with that of chitosan and ferulic acid from which it was prepared. The chitosan which is water insoluble showed a corrosion inhibition efficiency of 96% at 60 °C by weight loss studies while the Tafel and Impedance studies record of 68% and 61.5%, respectively, for mild steel in 0.1 M HCl solution [143]. Rabizadeh and Khameneh Asl reported corrosion inhibition efficiency of chitosan to be 92.1% for mild steel in 0.1 M HCl for an immersion period of 24 h at 298 K [144]. Neeraj et al. compared the corrosion inhibition efficiency of chitosan alone and in combination with KI for mild steel in 1M sulfamic acid and showed that an addition of 5 ppm KI to 200 ppm chitosan improved the inhibition efficiency from 73.8 to 90% [145]. Similarly Solomon et al. investigated the inhibition efficiency of chitosan which was found to be 46.98% and was almost doubled when incorporated with silver nanoparticles (94.98%) for St37 steel in 15% H2SO4 [146, 147]. Okoronkwo et al. evaluated the corrosion inhibition efficiency of chitosan extracted from snail shells and have reported an inhibition efficiency of 93.2% by weight loss studies for plain carbon steel (mild steel) in acid media [148]. Ferulic acid, a constituent of Kraft and Soda lignins extracted from oil palm empty fruit bunch extract and from spent ground coffee extract is accounted for good anticorrosive activity for mild/carbon steel in neutral solution and acid solution, respectively [149,150,151]. Biobased aromatic acids that include ferulic acid showed potential as additive for mild steel protection in immersion or partial immersion applications in water-based electrolytes [152]. The corrosion inhibition potential of ferulic acid as active constituents in plant extracts such as Juglans regia for mild steel in 3.5 weight % NaCl solution and Hemerocallis fulva against aluminium in sulphuric acid solution were also studied [153, 154].

The inhibition efficiency comparison of FCS with the other corrosion inhibitors employed for mild steel in 1 M HCl solution is displayed in Table 8.

Table 8 Comparison of the inhibition efficiency of FCS with other corrosion inhibitors for mild steel in HCl solution

5 Conclusion

  • The corrosion inhibition performance of FCS reached 95.96% at 500 ppm and 6 h of immersion period.

  • Thermodynamic activation and adsorption parameters namely Ea and ΔGads endorse a mixed adsorption process involving an initial electrostatic interaction followed by chemisorption of the inhibitor molecules on the metal surface. This conclusion is further supported by the increase in the inhibition efficiency with increase in temperature.

  • Tafel studies showed that the FCS inhibitor was a mixed type inhibiting both the cathodic hydrogen evolution and anodic dissolution of the mild steel metal.

  • Protonated molecule contributes to the inhibitor efficiency more than that of the neutral molecule.

  • FCS shows that it is an efficient, green corrosion inhibitor that can be used as an additive during acid cleaning of mild steel.

  • MC and MD calculations validate that there is a vigorous adsorptive interaction that takes place amongst the FCS inhibitor (in the neutral and protonated state) and the Fe surface. The obtained theoretical results are in good agreement with the experimental results.