Introduction

Carbon steels are frequently used in the petroleum industry especially petroleum products related issues; such as for their financial benefits and exceptional physical features, in oil products including pipeline systems, petroleum exploration facilities, oil refining processes1,2,3,4,5. Particularly, through the crude oil transportation, pipelines may experience interior corrosion, which reduces their service life and causes significant resource waste and financial losses6,7,8. The lengthy life of the pipeline is severely impacted by the corrosive character of the fluids it carries, complicated flow conditions, and sporadic solid particle presence. This causes early localized perforation and corrosion. For instance, pitting may occur and the passivation film on the surface of mild steel may dissolve when certain aggressive anions, like chloride, migrate into the active corrosion zone9,11. Internal corrosion is mostly prevented in a variety of industries, most notably the oil and gas sector, by corrosion inhibitors because of acid treatment and acidic, moist environments. Corrosion inhibitors are added either constantly or semi-continuously, with a concentration of around one part per million, without stopping the process.

According to the literature11, cathodic protection, surface manipulation of metal, and synthetic corrosion inhibitors can all be used to prevent corrosion in carbon steel. Synthetic corrosion inhibitors, which are one of these because of their affordability and simplicity of application, are among the most efficient ways to lessen corrosion in industrial operations12. Commonly employed as corrosion inhibitors and potentially damaging to the environment are chemical chemicals, primarily organic ones including tungstates, molbdates, vanadates and chromates. As a result, demand for eco-friendly chemicals is growing13,14,15.

At the water-metal contact, water is replaced by hydrophobic tails, which also repel the electrolyte, and the polar group of the corrosion inhibitor, which has a great affinity for both. The use of organic compounds as corrosion inhibitors for metal surfaces has been well documented16,17,18,19,20 because they can combine with heteroatoms such O, N, P, and S-bonds. Non-toxic corrosion inhibitors are desperately needed because organic traditional inhibitors have a negative impact on the surrounding environment. Biopolymers, surfactants, amino acids, natural products, lanthanides and ionic liquids (ILs)21,22,23,24,25, all are proposed as novel environmentally benign corrosion inhibitors. ILs are made up of ions, normally melts at ambient temperatures (below 100 °C). They are mostly non-flammable, have approximately negligible vapor pressure, and has exceptional thermal stability when compared to organic solvents26,27,28 ILs possess no vapor-related hazards because they are often harder to break down and vaporize than other potential green corrosion inhibitors.

The world corrosion prevention is constantly growing, with new discoveries happening all the time. Scientists are particularly excited about organic heterocyclic molecules with special atoms like sulfur, nitrogen, and oxygen in their structure. These molecules work their magic at the meeting point between metal and solution, where they form a protective layer. This layer stops the metal from deteriorating by clinging to the surface. The secret to their success lies in how they interact with the metal using special donor atoms, electron pathways, and the overall structure of the molecule itself. In acidic environments, these heterocyclic molecules can even take on a positive charge, making them even better at stopping metal from corrosion29,30,31.”

In 2017, Sugirtha Velusamy et al.32 investigated the potential of imidazolium based ILs as corrosion inhibitors for mild steel in variety of fluids; CaCl2, HCOOCs and ZnBr2. Resulting from different methodologies ILs suggested to explore and develop anti-corrosive completion fluids suitable for oil and gas reservoir areas. Ardakani et al. in 202126, summarized the corrosion inhibition properties of various ionic liquid inhibitor compounds based on different cations into different corrosive environments acidic, basic, salty and aqueous media. According to Ardakani's analysis, numerous ionic liquid particularly which based on imidazolium cations notable effectiveness as corrosion inhibitors attributing to presence of heteroatoms with free pair electrons (O, S, N, P, etc.), pi-electron, polar functional groups and the conjugated system. Also in 2021, Kobzar et al.31 aimed is to assess the advanced trends in developing the different types of ILs in the corrosion inhibition field over the past three years. Kobzar`s review based on molecular mass, ionic nature and chemical structure of ILs. Haldhar et al. in 202313, noted that the corrosion inhibitors with extending alkyl chains of enhance the inhibition performance, all these expectations were confirmed using experimental and theoretical calculations. Jia et al. 202433, synthesized phosphorus-based ionic liquids (PBILs) with different alkyl chain length and evaluated their anticorrosion efficiencies for mild steel (MS) in 1 M HCl aqueous solution physically and theoretically. The results revealed that PBILs performed excellently (inhibition efficiencies > 93%).

These data led some researchers to suggest that ILs are the best substance for preventing corrosion in metals34,35. Investigations into ILs corrosion inhibitors are growing fast from a different perspective. In our research, to contribute to this hot research domain, this work focus on the creation, confirmation, and application of a newly designed series of cyclic ammonium-based ionic liquids, assessed as inhibitors for carbon steel corrosion in 1M HCl solution. This evaluation employs Electrochemical Impedance Spectroscopy (EIS) and Potentiodynamic Polarization (PDP) methods at various inhibitor concentrations ranging from 20 to 100 ppm, alongside Density Functional Theory (DFT) computational calculations. Furthermore, we explore and discuss both kinetic and thermodynamic parameters. Additionally, as a semi-pilot bench scale for potential industrial applications, cleaning processes are executed to evaluate the anti-corrosive efficacy of the synthesized ionic liquids.

Experimental

Materials

The aforementioned chemicals are being used to synthesize the targeted ILs without further purifications: Naphthalen-2-ol (99%), potassium hydroxide (97%), Ethanol (99%), dibromoethan (98%), 1-methylpyrrolidine (97%), 1-methylpiperidine (99%), pyridine (98%), 3-methylpyridine (98%), 4-methylpyridine (99%) and acetonitrile (99%). All the used chemicals were delivered from Alfa Aesar and Sigma Aldrich companies.

Synthesis of Ionic liquids

Preparation of 2-(2-bromoethoxy) naphthalene (I)

Equivalent amount of Naphthalen-2-ol and potassium hydroxide 0.1mol were dissolved in 50 mL of Ethanol with stirring. Over around two hours and at 25 °C, 0.01 mol of dibromoethane was gradual added; drop by drop to a stirring solution and replaced in the manuscript as clear using track changes. KBr precipitate (byproduct) was elevated and the white solid product was obtained by removing the solvent under vacuum. The produce was washed, using deionized water and then recrystallized from ethanol. Figure 1 The melting-point was recorded with complete compatible comparing with those in literatures; 80–82 °C35.

Figure 1
figure 1

Preparation of 2-(2-bromoethoxy) naphthalene.

Preparation of IL-1MPyrBr, IL-1MPipBr, IL-2PyBr, IL-3MPyBr, IL-4MPyBr

Different cyclic amines (1-methylpyrrolidine, 1-methylpiperidine, 2-methyl pyridine, 3-methylpyridine, and 4-methylpyridine) were refluxed with solution of 2-(2-bromoethoxy) naphthalene (I) in presence of 50 ml CH3CN for six hours at 80°C. The products were concentrated and evaporated under vacuum Fig. 2.

Figure 2
figure 2

Preparation of IL-1MPyrBr, IL-1MPipBr, IL-2PyBr, IL-3MPyBr, IL-4MPyBr.

The chemical structure confirmation for the synthesized ILs was carried out through different techniques. Elemental analysis (Perkin Elmer 2400 CHN elemental analyzer. Waltham, MA). FT-IR (Perkin-Elmer-1430 infrared spectrophotometer, Waltham, MA) by using the potassium bromide wafer method. 1H-NMR and 13C spectra were determined via a burker advance III 400 MHz (high performance digital FT-NMR spectrometer) using dimethyl sulfoxide (DMSO)-d6 as a solvent. Chemical shifts were noted in d (ppm) regarding to tetramethylsilane (TMS) as an internal standard structures (TMS). Thermal gravimetric analysis was determined via the thermal analyzer at heating rate of 10 °C/min. samples were heated from room temperature to 600 °C under flow of nitrogen.

Evaluation of the inhibitory performance

Electrochemical methods

In the context of electrochemical assessments, a glass cell with a capacity of 100 ml was employed, equipped with three electrodes. The experimental setup comprised a platinum sheet serving as the counter electrode, and a saturated calomel electrode (SCE) as the reference electrode. As the working electrode, carbon steel with a surface area of 0.345 cm2 was utilized. All experimental procedures were conducted using an OrigaMaster 5potentiostat/galvanostat. Potential current plots were generated under specific conditions, including a scan rate of 1.0 mV s−1 and a potential range of ± 250 mV versus OCP (Open Circuit Potential) Furthermore, electrochemical impedance spectroscopy (EIS) tests were conducted at OCP within specific parameters, involving a frequency range of 100 kHz to 0.1 Hz and an AC voltage amplitude of 20 mV. The construction of the equivalent circuit was facilitated by the utilization of the OrigaMaster 5 software. Density Function Theory (DFT) for the MNDO semi empirical process was used to determine the quantum parameters for the synthesized ILs theory research. All the computational studies were carried out using GAUSSIAN 09 revision-D.01-SMP (DFT).

Weight loss method

Carbon steel sheets, employed for corrosion testing, have a consistent exposed surface area of 0.345 cm2. The sheets underwent abrasion using a series of emery papers and were subsequently cleaned following the G1-03/ASTM standard method. Prior to immersion in 100 ml of an HCl solution at preset concentrations for 180 min within temperature ranges of 298, 313 and 323 K, the specimens were accurately weighed. To examine the impact on corrosion rates, varying doses of IL-3MPyBr, the selected ionic liquid for the study, were introduced into the acidic solutions. The prepared solutions were then exposed to the atmosphere, removed at specific intervals, cleaned, dried, and meticulously reweighed. Each experiment was conducted in triplicate, involving the weighing of three carbon steel sheets, and the resulting averages were calculated.

Theoretical studies

For the purpose of studying the various inhibitory efficiencies as well as the reactive sites of the synthesized ILs as corrosion inhibitors, a theoretical analysis of IL-1MPyrBr, IL-1MPipBr, IL-2PyBr, IL-3MPyBr, and IL-4MPyBr was carried out. The determination of corrosion inhibitors was in relation to several parameters such as dipole moment (λ), highest occupied molecular orbital energy (EHOMO), lowest unoccupied molecular orbital energy (ELUMO) and energy gap (ΔE). All parameters were calculated regarding to DFT theory using the GAUSSIAN 09 Revision-D.01-SMP programs36,37,38.

Results and discussion

Confirmation of the synthesized ILs

1-methyl-1-(2-(naphthalen-2-yloxy) ethyl) pyrrolidin-1-ium Bromide (IL-1MPyrBr)

IR (KBr, ʋ cm−1): 1214 (C–O), 1389–1457 (C–N), 1598 (C=C), 2943 (CH Aliphatic), 3050 (CH Aromatic);1 H NMR (DMSO-d6) δ ppm: naphthalene protons 7.22–7.38 (m, 7H), spacer protons 4.5 (t, 2H, O–CH2), 3.6 (t, 2H, O–CH2 CH2), 3.9 (s,3H,CH3), pyrrolidinium protons 2.06 (t, 4H), 3.16 (t, 4H); 13C-NMR (DMSO-d6) δ ppm: 156.09 (C=C–O), naphthalene (134.93–107.83), spacer 64.86 (O–CH2), 62.77 (O–CH2CH2), 48.58 (CH3) pyrrolidinium carbons (21.08, 21.41, 62.17); Anal. Calcd for C17H22BrNO + (335.09): C, 60.72; H, 6.59; Br, 23.76; N, 4.17; O, 4.76; Found: 60.03; H, 6.49; N, 4.21.

1-methyl-1-(2-(naphthalen-2-yloxy) ethyl) piperidin-1-ium Bromide (IL-1MPipBr)

IR (KBr, ʋ cm−1): 1214 (C–O), 1389–1457 (C–N), 1598 (C=C), 2943 (CH Aliphatic), 3050 (CH Aromatic); 1H NMR (DMSO-d6) δ ppm: naphthalene protons 7.18–7.89 (m, 7H), spacer protons 4.6 (t, 2H, O CH2), 4.46 (t, 2H, CH2 CH2), piperidinium protons 1.57 (t, 2H), 1.87 (t, 4H), 3.19 (t, 4H), 3.8 (s, 3H); 13C-NMR (DMSO-d6) δ ppm: 155.76 (C=C–O), naphthalene (134.16–107.14), spacer 67.78 (O–CH2), 61.34 (O–CH2CH2), 49.99 (CH3) piperidinium carbons (20.55, 19.36, 60.89) ; Anal. Calcd for C18H24BrNO + (349.10): C, 61.72; H, 6. 91; Br, 22.81; N, 4.00; O, 4.57; Found: 61.51; H, 6.70; N, 4.45.

2-methyl-1-(2-(naphthalen-2-yloxy) ethyl) pyridin-1-ium bromide (IL-2MPyBr)

IR (KBr, ʋ cm−1 1213 (C–O), 1389–1455 (C–N), 1598 (C=C), 2950 (CH Aliphatic), 3066 (CH Aromatic);1 H NMR (DMSO-d6) δ ppm: pyridinium protons 7.84–9.76 (m, 4H), naphthalene protons 7.17–7.67 (m, 7H), spacer protons 5.17 (t, 2H, CH2 CH2), 4.41 (t, 2H, O CH2), 3.4 (s, 3H, CH3); 13C-NMR (DMSO-d6) δ ppm: 156.09 (N=C–CH3) pyridinium carbons (145.94, 134.67, 128.02, 119.01), 155.77 (C=C–O), naphthalene (129.94, 129.77, 129.77, 129.77, 128.38, 126.58, 124.27, 125.1, 109.18, 107.62), spacer 68.48 (O–CH2), 60.4 (O–CH2CH2), 31.83 (CH3); Anal. Calcd for C18H18BrNO + (343.06): C, 62.80; H, 5.27 Br, 23.21; N, 4.07,O, 4.65; Found: 62.82; H, 5.13; N, 4.08.

3-methyl-1-(2-(naphthalen-2-yloxy) ethyl) pyridin-1-ium Bromide (IL-3MPyBr)

IR (KBr, ʋ cm−1 1215 (C–O), 1389–1457 (C–N), 1598 (C=C), 2940 (CH Aliphatic), 3050 (CH Aromatic); 1 H NMR (DMSO-d6) δ ppm: pyridinium protons 8.09–9.74 (m, 4H), naphthalene protons 7.12–7.79 (m, 7H) , spacer protons 4.42 (t, 2H, O CH2), 5.11 (t, 2H, CH2 CH2), 3.41 (s, 3H, CH3); 13C-NMR (DMSO-d6) δ ppm: 155.77 (N=C–CH3) pyridinium carbons (145.94, 135.07, 128.02, 119.1), 156.09 (C=C–O), naphthalene (129.99, 129.77, 129.75, 129.26, 129.13, 126.93, 124.26, 123.09, 109.24, 107.81), spacer 68.48 (O–CH2), 60.4 (O–CH2CH2), 31.83 (CH3); Anal. Calcd for C18H18BrNO + (343.06): C, 62.80; H, 5.27 Br,23.21; N, 4.07,O, 4.65; Found: 62.70; H, 5.15; N, 4.10.

4-methyl-1-(2-(naphthalen-2-yloxy)ethyl)pyridin-1-ium Bromide (IL-4MPyBr)

IR (KBr,ʋ cm−1 1214 (C–O), 1389–1457 (C–N), 1598 (C=C), 2943 (CH Aliphatic), 3049 (CH Aromatic); 1 H NMR (DMSO-d6) δ ppm: 3.8 (s, 3H, CH3), spacer protons 4.63 (t, 2H, O CH2), 5.12 (t, 2H, CH2 CH2), naphthalene protons 7.13–7.79 (m, 7H) , pyridinium protons 7.81–9.9 (m, 4H); Anal. Calcd for C18H18BrNO+ (343.06): C, 62.80; H, 5.27 Br, 23.21; N, 4.07, O, 4.65; Found: 62.67; H, 5.30; N, 4.09.

Thermal stability

Thermal stability was confirmed via studying (TGA) and DTG composite pictures of the synthesized compounds. ILs were shown to have high onset temperatures, which may indicate that they are resistant to thermal degradation. Figure 3 illustrated that IL-1MPyrBr, IL-1MPipBr, IL-2MPyBr, IL-3MPyBr, IL-4MPyBr are thermally stable and firstly decomposed between 198 and 288 °C and finally decomposed up to 400 °C; the endothermal phenomenon was noticed till 100% sample weight loss28,39,40. The position of CH3 group on the pyridinium ring influence the thermal stability; in case of IL-3MPyBr (meta position), the compound demonstrated greater thermal stability more than IL-4MPyBr and IL-2MPyBr (para and ortho position in order) related to the mesomeric resonance effect, which resist C-bond leakage.

Figure 3
figure 3

Thermal stability of the synthesized ILs.

Anti-corrosion characteristics of the synthesized ILs

Electrochemical methods

In the case of IL-1MPyrBr, IL-1MPipBr, IL-2MPyBr, IL-3MPyBr, IL-4MPyBr, the polarization curves are depicted in Fig. 4. Tafel is the format of the plot documents the polarization characteristics, which include the corrosion potential (Ecorr), Tafel slopes (βa and βc), and corrosion current density (jcorr). The following formula is used to determine the protection efficiency (Pj%)41.

Figure 4
figure 4

Curves of Potentiodynamic polarization for carbon steel immersed in 1M HCl solution at 298 K.

In a blank acid solution, the corrosion current density jcorr (0) represents the initial corrosion rate. Table 1 provides the following insights:

  1. 1.

    The jcorr values are notably reduced to very low levels by the presence of ILs.

  2. 2.

    Compared to the blank solution, there has been less than a 35 mV shift in Ecorr. This suggests that the synthesized ILs exhibit heterogeneous characteristics41,42,43.

  3. 3.

    3. The percentage of Pj varies from 76.43 to 97.56% at 298 K.

  4. 4.

    Higher Pj% values are observed at low ILs concentrations. Additional concentrations of ILs do not significantly affect the ILs efficacy. The propensity of the newly created ILs to adsorb on carbon steel specimens is the key factor behind the reduced corrosion rate in a 1M HCl electrolyte.

  5. 5.

    These ILs are able to inhibit anodic and cathodic processes at the same time. Heteroatoms and p-electrons are the main adsorption centres on the surface of carbon steel44,45.

Table 1 Effect of ILs concentrations on the polarization variables and inhibition efficiency on carbon steel immersed 1 M HCl solution.

The resulted data showed that IL-1MPipBr and IL-3MPyBr obtain the best adsorption, whereas IL-1MPyrBr and IL-4MPyBr perform the worst. This implies that the adsorption efficacy of the synthesized ILs is directly influenced by the cationic component of their interfacial structure11.

Comprehensive investigation into the effectiveness of newly developed ILs was conducted through Electrochemical Impedance Spectroscopy (EIS) measurements. Figure 5 Illustrates specific Nyquist and Bode-phase angle plots for the five synthesized ILs and Fig. 6 represents bode-phase angle & module plots for carbon steel immersed in 1 M HCl solution at 298 K for 100 ppm concentration for blank and 1MPyrBr. The semicircle indicates that charge transfer process at the electrode/solution interface mainly controlled the corrosion of the metal in the studied medium. Clearly, the diameter of the Nyquist graph increases with increasing ILs concentrations, which suggests slower rate of charge transfer and better protection of the electrode surface probably due to the strengthening of the protective layer. The effect of concentration is also seen in the Bode Phase representation, i.e. the Phase angle is shifted towards higher value with increase in concentration. The shape of the Nyquist and Bode plots are the same in the unprotected and protected systems and indicates same corrosion mechanism.

Figure 5
figure 5figure 5

Impedance spectra includes Nyquist, Bode-phase angle for carbon steel immersed in 1 M HCl solution at 298 K for the synthesized ILs.

Figure 6
figure 6

Bode-phase angle & module plots for carbon steel immersed in 1 M HCl solution at 298 K for 100 ppm concentration for blank and 1MPyrBr.

The equivalent circuit that describe the EIS data is shown in Fig. 7 It consists of Rs (solution resistance), Rct (charge transfer resistance), a CPE (constant phase element) and the film resistance element Rf. CPE is used instead of an ideal capacitor due to the heterogeneity of the surface as reflected by the imperfectness of the semicircles46.

Figure 7
figure 7

The selected Equivalent Circuits describing EIS data (A,C for blank and B,D for 100 ppm concentration of 1MPyrBr).

Refer to all EIS parameters Table 2, the Rs remains consistently low across solutions because of the high conductivity of the studied ILs. By increasing the concentrations of ILs, the magnitude of Rct steadily rises until achieving maximum efficacy. To calculate the protection effectiveness (ηR %), the following equation was employed47:

Table 2 EIS variables and inhibition efficiency of carbon steel immersed 1 M HCl solution as a function of ILs concentrations.
$$\mathrm{\eta R\%}=\frac{{\text{Rct}}-{\text{Rcto}}}{{\text{Rct}}}*100$$
(1)

(Rct0 = charge transfer resistance in the blank solution) In general, raising the concentrations of the synthesized ILs results in an enhancement of the ηR% value, particularly up to effective concentrations as indicated in Table 2. Notably, when IL-3MPyBr was at 100 ppm, the maximum ηR % (97.70%) was achieved.

It is worth mentioning that the reported percentages of corrosion inhibition derived from both polarization and EIS studies exhibit a consistent pattern. The remarkable ability of the synthesized compounds to adsorb to the metal surface plays a major role in diminishing the corrosion rate of carbon steel specimens immersed in a 1M HCl solution48. The versatile action of ILs encompasses the suppression of both cathodic and anodic processes simultaneously. The adsorption sites on the steel surface are primarily attributed to oxygen (O), nitrogen (N) atoms, and π-electrons. Data analysis shows that among the studied ionic liquids, IL-3MPyBr emerges as the most efficient, whereas IL-4MPyBr demonstrates the lowest performance. This observation further confirms that the cationic component of the ILs significantly influences its adsorption capacity49.

Weight loss method

Concentrations of IL-3MPyBr and inhibitory effect: Weight loss-time curves of the carbon steel samples before and after the addition of the synthesized IL are shown in Fig. 8. The curves demonstrate that when the ILs concentrations in the acidic solution increase, the weight losses values (mg.cm−2) of the carbon steel decrease, which enhances the inhibitor efficacy to impede corrosion. It is indicated that the formation of complex between ILs-donating species and carbon steel surface resulting the dissolution hindrance. The corrosion rate can be estimated using the inserted equation 50.

Figure 8
figure 8

Langmuir isotherm of the studied ILs at different temperatures.

Figures 8 and 9 shows weight loss-time curves for the carbon steel samples both before and after introducing the synthesized IL. The curves illustrate that as the concentrations of IL-3MPyBr in the acidic solution increase, the weight loss values (in mg.cm−2) of the carbon steel decrease. This indicates an improved inhibitory effect on corrosion. The observed trend suggests the formation of complexes between IL-donating species and the surface of the carbon steel, leading to hindered dissolution. The inhibition efficiency (Pw%) of the applied IL-3MPyBr on the carbon steel surface at various studied concentrations was determined in relation to the calculated corrosion rate, as depicted in the inserted equations:

$$ W_{corr} = \frac{{W_{1} - W_{2} }}{S \times t} $$
(2)
Figure 9
figure 9

Arrhenius plot for the immersed carbon steel in 1 M HCl without and with IL-3MPyBr (100 ppm).

The equation involves the mass losses, denoted as W1 and W2, which pertain to samples of C-steel before and after immersion in acid. S denotes the area of C-steel, and t signifies the immersion time.

$$ P_{w} \% = \frac{{W_{corr}^{0} - W_{corr} }}{{W_{corr}^{0} }} \times 100 $$
(3)

The corrosion rates of C-steel in the acid solution are represented as W0corr and Wcorr, corresponding to situations without and with the presence of IL, respectively. The collected mass loss data is summarized in Table 3.

Table 3 Corrosion rate and inhibition efficiency of carbon steel immersed 1 M HCl solution containing ionic liquid IL-3MPyBr as a function of temperatures.

The influence of temperatures on the inhibitory effect: The corrosion rate of the synthesized ILs, exemplified by IL-3MPyBr, was investigated at various temperature levels to assess the stability of the protective film formed. The impact of temperatures (298, 313, and 323 K) on the weight losses, and consequently on the corrosion rate of carbon steel, both in the absence and presence of IL-3MPyBr at the same concentration of acidic medium (1 M HCl). Temperature plays a significant role in influencing the rate of metal corrosion. In an acidic solution, due to the reduction in hydrogen evolution over potential (hydrogen depolarization), the corrosion rate exponentially increases with temperature47. The results indicate that the corrosion rate rises with an increase in temperature, leading to a gradual loss of efficacy in the corrosion inhibition of the carbon steel surface. The corresponding data have been calculated and are presented in Table 3.

Adsorption process investigation: Utilizing data obtained from weight loss tests, we investigated the optimal adsorption isotherm to characterize the adsorption process of the IL-3MPyBr on the surface of steel in 1M HCl. The Gibbs free energy (G°ads) associated with the adsorption process and Kads (equilibrium constant of the adsorption/desorption process) are represented in the given equation:

$$\frac{{C}_{inh}}{\uptheta }=\frac{1}{{{\text{K}}}_{{\text{ads}}}}+{C}_{inh}$$
(4)
$$ \Delta G^\circ_{ads} = - {\text{RT}}\;\ln \left( {10^{6} K_{ads} } \right) $$
(5)

In the provided equation, where R represents the universal gas constant, and T is the temperature measured in Kelvin. Figure and Table record the Langmuir isotherm and isotherm parameters for the producing ionic IL-3MPyBr.

In this case, the linear regression coefficient (R2) parameters approaching one indicate the availability of the isotherm. The relatively small values of Kads, suggest that the molecules bonded to the steel surface are predominantly undergoing physical adsorption.

The reported ∆G°ads in Table 4 is − 37.9076 kJ mol−1, and this negative value for IL-3MPyBr signifies the spontaneous adsorption on the carbon steel surface 50. The range of − 20 to − 40 kJ mol−1 suggests an association of both physisorption and chemisorption for the IL on the carbon steel surface.

Table 4 Langmuir isotherm parameters of IL-3MPyBr at 298 K.

The activation energy (Ea) for the corrosion process can be determined using the following formula from an Arrhenius-type plot:

$$ W_{{{\text{corr}}}} = k\;{\text{exp }}\left( { - E_{{\text{a}}} /RT} \right) $$

In the given equation, Wcorr represents the corrosion rate, k is the Arrhenius pre-exponential factor, and R and T denote the universal gas constant and absolute temperature, respectively. The calculated values of activation energy (Ea) are positive, indicating that the corrosion process is endothermic in nature, aligning with previous studies. By comparing to the blank, the activation energy; Ea values; Table 5 and Fig. 10 for the systems inhibited by IL-3MPyBr are smaller, providing support for the chemical adsorption mechanism with the prepared IL in 1M HCl solution.

Table 5 Carbon steel activation parameters in 1M HCl solution before and after using 100 ppm IL-3MPyBr.
Figure 10
figure 10

Transition state plot for the immersed carbon steel in 1 M HCl without and with IL-3MPyBr (100 ppm).

The kinetic activation parameters have been assessed using Fig. 9 and Eq. 6.

$${W}_{corr}=\frac{RT}{{N}_{A}h}{\text{exp}}\left(\frac{{\Delta S}^{*}}{R}\right){\text{exp}}\left(\frac{{\Delta H}^{*}}{RT}\right)$$
(6)

In the provided equation, NA represents Avogadro’s number, h is Planck’s constant, ΔS* is the entropy of activation and ΔH* is the enthalpy of activation. Notably, the positive values of ΔH* signify an endothermic activation process. It's noteworthy that the calculated Ea values are slightly larger than the apparent activation enthalpy (ΔH*). The ΔS* values for the IL-3MPyBr system are more negative compared to the value obtained for the uninhibited acid system, indicating that the IL plays an effective role against the corrosion process. This suggests a reduction in disturbance as low carbon steel dissolves in systems with inhibitors.

Theoretical study

The computed Tables 6 and 7 and the experimental results were agreed entirely. As shown in Table 6 the values of ΔEback-donation for the synthesized ammonium based ILs recorded (− 0.669, − 0.656, − 0.828, − 0.664& 0.827). One of the most important indicators of the corrosion inhibition process is the dipole moment51. Increasing the dipole moment leads to an improvement in strain energy and an increase in molecule adsorption on the metal surface. Therefore, increasing the dipole moment increases the effectiveness of corrosion inhibition52. As mentioned in Table 7 IL-3MPyBr has a larger dipole moment value (17.1497 Debye) than IL–IL-1MPipBr, IL-1MPyrBr, IL-2MPyBr and IL-4MPyBr which recorded values as 17.1383, 15.9486, 15.8485 and 14.6848 Debye in order. Showing that the IL-3MPyBr's capacity to adhere to the surface of carbon steel and enhance inhibition is stronger37,53. Furthermore, the selection of inhibitory molecules to protect carbon steel's surface from corrosive environments is influenced by the molecular surface of the material46.

Table 6 The calculated quantum parameters for the synthesized cyclic ammonium based ILs.
Table 7 EHOMO, ELUMO and the optimized molecular structures for the synthesized cyclic ammonium based ILs.

Effect of Structure on the inhibitory performance

The five synthesized ILs possess anionic part (Br) and five different cationic hetero rings (N-methylpyrrolidinium, N-methylpipredinium and three pyridinum derivatives). The main reason for the inhibition efficiency differences is the structure of the catationic part 50. IL-1MPyrBr and IL-1MPipBr in which the cations are saturated, whereas IL-2PyBr, IL-3MPyBr and IL-4MPyBr having aromatic pyridinium cations. The planarity of the pyridinium ring makes IL-2PyBr, IL-3MPyBr and IL-4MPyBr spread well on the metal surface since, they record more corrosion inhibition than IL-1MPyrBr and IL-1MPipBr. Moreover, the six membered ring is less strained ring than the five membered ones, so the binding force between the metal and IL-2PyBr, IL-3MPyBr & IL-4MPyBr is greater than that between the metal surface and IL-1MPyrBr &IL-1MPipBr. Also, for IL-2PyBr, IL-3MPyBr & IL-4MPyBr, the presence of Me group in meta-position lets it free and less affected by the electron with drawing pyridinium ring than in para- and ortho-positions, so IL-3MPyBr records the best corrosion efficiency using the lower concentration (20 ppm)54.

Inhibition performance after acid-cleaning operations using IL-3MPyBr

As a semi-pilot bench scale for the industrial application; the cleaning process47 could be performed by involving the immersion of materials in a hydrochloric acid solution, with a carefully chosen concentration (1M). IL-3MPyBr are introduced to mitigate the potential corrosive effects of the acid. The influence of critical parameters, including acid concentration (1M), temperature (40 °C), and inhibitor dosage (100 ppm) for definite time (72 h), is systematically investigated to optimize the cleaning process. Table 8 showed that the inhibition performance is 97.41%.

Table 8 Inhibition performance after acid-cleaning operations.

Mechanism of inhibition

The mechanism by which ILs inhibit corrosion can be elucidated in Fig. 11 as the attachment of ILs' donating components onto the anodic sites of carbon steel, forming a layer that adheres to the surface and enhances protection against corrosion. ILs possess the capability to displace water molecules adsorbed on the surface of C-steel, functioning similarly to commercial inhibitors. Initially, a physisorption process occurs as the positively charged cations on metal surfaces interact electrostatically with the anions of the ILs. Additionally, physisorption may happen through the interaction between anionic species on metal surfaces and the cationic portions of the ILs under study. It is hypothesized that at cathodic sites on the metal surface, the larger cations of ILs can readily replace the adsorbed water molecules. This results in enhanced protection against corrosion, facilitated by the presence of hetero-organic moieties that offer additional protective potential and long chains that increase coverage per molecule.

Figure 11
figure 11

Mechanism of inhibition.

This interaction involves coordination bonds as IL molecules adhere to form a restrictive layer at the interface between metal and solution. The presence of N=`C–N moieties provides active sites for adsorption on the metal surface, and the adsorption process may be intensified by the presence of multiple bonds. Moreover, the proposed chemical adsorption process involves interactions where the π-electrons on the nitrogen atom of the imidazolium ring and the π-electrons of the aromatic moieties interact with the vacant d-orbital of the carbon steel, thus preventing its dissolution in the aggressive medium. It has also been suggested that adsorption may occur through the orientation of the cation species of the ILs parallel to the metal surface. The delocalization of the nitrogen atom of the cation within the ring creates a mild positive charge on the entire IL cation. Consequently, the IL cation seeks to accept electrons from the carbon steel surface. This process can alter the polarity of the carbon steel surface by forming a multilayer of the adsorbed species on the surface. Additionally, the aromatic moieties of the IL donate π-electrons to the vacant d-orbitals on the surface of the carbon steel, resulting in the formation of donor–acceptor complexes. These preceding processes generate an inter-electronic repulsion between the IL and the metal surface, facilitating back bonding or retro-donation. The donation of electrons and back donation strengthen one another, effectively blocking the surface of the carbon steel and subsequently preventing corrosion. This creates a stable chemical coating that reduces friction and wear53.

Conclusion

In conclusion, series if cyclic ammonium based ionic liquids (IL-1MPyrBr, IL-1MPipBr, IL-2PyBr, IL-3MPyBr, and IL-4MPyBr) were synthesized and well confirmed via variety spectroscopic techniques to prevent corrosion of C-steel in 1 M HCl and understanding the compounds' structure–property relationship. The anti-corrosion properties of the synthesized ILs were being assessed by weight loss, chemical and electrochemical parameters (PDP and EIS). According to the current study, all these inhibitors has exceptional ability to prevent the corrosion. At low and high concentration; 20 and 100 ppm, IL-3MPyBr has the maximum corrosion inhibition efficacy of 94.16 and 97.56% respectively. The experimental results were in complete combatable with the theoretical, which showed that, IL-3MPyBr has a larger dipole moment value (17.1497 Debye) showing its capacity to adhere to the surface of carbon steel and enhance inhibition. These observed results will motivate a number of ongoing researchers to put in endless effort to uncover the anti-corrosion properties of new ILs in the acid additives markets.