## Introduction

Corrosion is a crucial issue for metals and their alloys because it produces significant economic losses and environmental problems. Aluminum is an essential metal in many industrial areas due to its several desirable properties, which include exceptional low density, thermal and electrical conductivity, high ductility, and abundance in nature1. It is utilized in vehicles, aircraft, household appliances, packaging, and electrical gadgets2,3. It resists corrosion due to its capacity to generate a natural oxide coating on its surface in various environments4. Because of the presence of hydroxide ions, which solubilize the amphoteric aluminum oxide protective layer, the alkaline media is the most corrosive for aluminum5.

Adding corrosion inhibitors to aluminum and its alloys in the aggressive media poses one of the efficient techniques to shield metals from corrosion, even though they slow down the rate of the corrosion process. Several studies have devoted on the developing of environmentally-friendly corrosion inhibitors with excellent inhibitory effectiveness6,7,8,9,10,11,12. Drugs have recently been employed as corrosion inhibitors for different metals owing to multiple benefits over traditional inhibitors that are toxic, hazardous to humans and other organisms, and have a negative impact on the environment13,14,15,16,17,18,19. Advantages of using drugs as corrosion inhibitors can be summarized into; (i) the presence of hetero-active centers in their molecular structures, (ii) their eco-friendly nature, and (iii) their highly molecular size20. There are two possible explanations for the corrosion protection provided by drug inhibitors: either an electrostatic attraction or chemical bonds formed with the metal's vacant orbitals21.

The second group of β-lactam antibiotics is known as cephalosporins, that are considered as the most effective broad-spectrum antibiotics and classified into five generations according to their antimicrobial properties22. Ceftriaxone sodium and ceftazidime drugs belong to the third generation of cephalosporins that were used for the corrosion protection technology23,24,25,26,27. Shukla and Quraishi studied the ceftriaxone drug as a green corrosion inhibitor for mild steel in HCl media27. They explained the ceftriaxone's inhibitory activity by its physical adsorption on steel substrate through β-lactam carbonyl and carboxylate group, and its adsorption following Langmuir isotherm. Singh et al. studied the inhibition efficiency of ceftazidime as an effective mild steel corrosion inhibitor in 1.0 M HCl media using electrochemical measurements, as well as AFM and SEM were used to investigate the microstructure23. The obtained data demonstrated that the tested drug with a concentration of 1.83 × 10–4 M decreased the metal roughness to 230 nm compared to 660 nm for the inhibitor-free solution.

Guo et al., introduced expired ceftriaxone sodium (Ceft), cefuroxime (Cefu) and cefotaxime sodium (Cefo) as corrosion inhibitors for carbon steel in 0.1 M H2SO4 solution13. Results showed that the order of the inhibition efficiency was Ceft > Cefo > Cefu due to the difference in their molecular structures.

Computational studies are performed to determine the relationship between the inhibitors' molecular structures and their inhibition efficiency28,29. The experimental findings of two antibacterial medicines, sulfamethoxazole (SZ) and norfloxacin(NF), were validated using quantum chemistry calculations and molecular dynamics simulations (MD)30. The inhibitory efficiency of NF was greater than that of SZ because the energy gap(ΔE) of NF was smaller than that of SZ. On the other hand, the calculated binding energy (Ebinding) of NF was relatively higher than that of SZ, reflecting the better stability of the created complex and increasing the inhibitory efficiency for NF compared to SZ.

To the best of our knowledge, ceftriaxone sodium (Cefx), and ceftazidime (Cefz) drugs have never been applied as corrosion inhibitors for Al in NaOH media. Furthermore, there are few reports on the total suppression of aluminum corrosion in strong alkaline solutions owing to hydroxyl ion-specific adsorption on the metal surface. Therefore, our goal is to estimate the performance of these drugs to protect the vigorous corrosion of Al in 0.1 M NaOH media by electrochemical measurements, surface analysis and theoretical calculations. In addition, the inhibition protection will be correlated to their anionic structures as a result of the deprotonation of their functional groups in 0.1 M NaOH solutions31,32,33. The suggested drugs pave the way for developing a green and cost-effective corrosion inhibitors strategy for various industrial applications, including Al-air batteries, food and beverage packaging, and heavy sector implantation in the automotive, marine, and aerospace sectors. The structures of the studied anionic state of Cefx and Cefz are shown in Fig. 1.

## Experimental

### Materials and chemicals

The Cefx and Cefz are used as received from the Egyptian pharmaceutical store. Sodium hydroxide is provided from PIOCHEM chemical Co., Egypt. Al substrate as a working electrode was provided by (Naghammady Aluminum Co., Egypt) with the following chemical composition (wt%) 99.57% Al, 0.31% Fe, 0.07% Si, 0.015% Ti, 0.0016% Zn, 0.0003% Cr, 0.0019% Mn and 0.0007% Cu. Stock solutions of the studied drugs are prepared using doubled distilled H2O.

### Electrochemical

Electrochemical analyses are carried out using an electrochemical workstation (Origalys, OGF01A, France) in a glass cell with a standard three-electrode system, cleaned and polished Al metal (1 cm2) as working, Ag/AgCl and Pt wire as reference and counter electrodes, respectively. The obtained electrochemical results were recorded and analyzed using OrigaMaster-5 software. The potentiodynamic polarization curves are measured at a fixed potential of ± 100 mV around EOCP at 293 K with a fixed sweep rate of 1 mV s−1. The electrochemical impedance spectroscopy (EIS) tests are performed at EOCP using 10 mV amplitude, and the frequency range was 10 kHz to 100 mHz. The ZSimpWin software was utilized to fit the obtained results.

### Surface characterization

The morphological characteristics of Al substrates (1 cm × 1 cm × 0.1 cm) in the absence and existence of the examined drugs are investigated using FESEM (Zeiss Sigma 500 VP Analytical FE-SEM, Germany). In addition, the elemental composition of the surface is analyzed using XPS and elemental mappings coupled with the FESEM. XPS analyses are performed using (K-ALPHA, Thermo Fisher, USA). Al samples are polished, cleaned with acetone, rinsed with distilled water, and dried before being submerged in pure 0.1 M NaOH media and the presence of 300 ppm of each drug for 2 h at 293 K.

### Water contact angle measurements

The impact of Cefx and Cefz drugs on the surface wettability characteristics of Al surfaces are examined using the water contact angle (WCA) analysis. The Goniometer (model 250, Ramé-Hart, USA) was employed to estimate a sessile drop's static contact angle. Typically, 5–8 μL of aqueous solutions are dropped onto a polished and balanced Al surface using a microsyringe at room temperature. The resulted images are processed using DROP-image software to evaluate the contact angle (θ).

### Computational methodology

#### Hartree Fock calculations (HF)

Quantum chemical calculations (QC) depending on HF are carried out utilizing Gaussian 09 program34. The input files of the studied drugs are prepared with GaussView6.0.16. The structures of Cefx and Cefz are optimized by 6-311G++ (d, p) basis set. The energies of the boundary molecular orbitals (HOMO and LUMO) for the tested drugs are acquired and utilized to compute additional molecular properties such as ionization energy (I), global hardness (η), electron affinity (A), electronegativity (χ), and softness (σ) using the following equations35,36:

$${\text{I}} = - {\text{E}}_{{{\text{HOMO}}}}$$
(1)
$${\text{A }} = - {\text{ E}}_{{{\text{LUMO}}}}$$
(2)
$$\upchi = \left( {{\text{I }} + {\text{ A}}} \right)/{2}$$
(3)
$$\upeta = \left( {{\text{I }}-{\text{ A}}} \right)/{ 2}$$
(4)
$$\upsigma = 1/\upeta$$
(5)

The value of χ and η can be used to compute the proportion of electrons transported (ΔN) from the inhibitor molecule to the Al surface using Eq. (6)35,36.

$$\Delta {\text{N }} = \left( {\upchi_{{{\text{Al}}}} - \upchi_{{{\text{inh}}}} } \right)/2\left( {\upeta_{{{\text{Al}}}} + \upeta_{{{\text{inh}}}} } \right)$$
(6)

where χAl = 3.23 eV/mol and ηAl = 0 eV/mol, based on Pearson's electronegativity scale, supposing the I = A for the Al bulk structure owing to they are softer than neutral Al atoms37.

#### Monte Carlo simulation (MC)

MC simulation of the configurational space of a single molecule of the Cefx and Cefz with Al (111) surface is employed to determine low-energy adsorption sites as the temperature gradually reduces. The simulated annealing process used the Metropolis method. The MC simulation is carried out by the Adsorption Locator module that existed in the BIOVIA Materials Studio 2017 package. A simulation box (28.63 Å × 28.63 Å × 37.01 Å) with a 35 Å-thick vacuum slab above the surface is created from a supper cell of (5 × 5) using a unit cell of (4.05 Å × 4.05 Å × 4.05 Å) Al with a cell formula of Al4. The simulations are carried out using the COMPASS forcefield and its charges are used. The summation method for the electrostatic interaction is Ewald38. For the van der Waals interactions, a cut-off distance of 15.5 Å is used with a cubic spline switching function, and the summing approach is atom-based.

#### Molecular dynamics simulation (MD)

The MD simulations are conducted employing the FORCITE module implemented in the BIOVIA Materials Studio. Because corrosion occurs in aqueous solution, the lowest-energy structures of the inhibitor-Al complexes derived from the MC simulation are filled with water (950 molecules) to model the influence of solvent. The forcefield and its charges, as well as the summation method, are the same as in the MC simulations. The MD simulations are run at 298 K (controlled by the Nose thermostat) utilizing a canonical ensemble (NVT) with a time step of 1.0 fs, and a simulation time of 1000 ps (1 × 106 steps).

## Results and discussions

### Open circuit potential (EOCP) measurements

The change in the EOCP values of the Al electrode with immersion time in the pure 0.1 M NaOH media and existence of different concentrations of Cefx and Cefz is studied to emphasize the electrochemical properties in alkaline solutions at 293 K. Figure 2 depicts the EOCP of the Al substrate as a function of the immersion duration in various concentrations of Cefx (Fig. 2a) and Cefz (Fig. 2b) ranged from 0 to 300 ppm in 0.1 M NaOH solution. The detailed EOCP values, on the other hand, are listed in Table 1. As represented in the Fig. 2 that the EOCP value in a blank solution shows a positive shift at the initial 400-s period, which can be explained by the anodic passivation caused by the formation of insoluble Al2O3 or Al(OH)339. Then, when the immersion period is increased, it enters a stable state. The addition of Cefx and Cefz causes the EOCP to move negatively compared to the blank solution, suggesting that the cathodic corrosion process is significantly slowed.

The positive shift in the beginning of the curve for the inhibited solutions occurs till 200 s period indicating that the studied drugs cover the Al surface and hence form protective film on Al surface40,41. The inhibition of the cathodic reaction causes accumulation of the electrons generated from the anodic reaction, leading to more negative potential values for inhibited solutions compared to blank solution40.

The EOCP are also analyzed at 303, 313 and 323 K in the absence and existence of 300 ppm of the investigated drugs and their values are listed in Table 2. It is clearly shown from Fig. 3a–c that the positive shift in the beginning of the curves at high temperature is less than that at 293 K, indicating that the time taken for the formation of passive layer before reaching the steady-state value declines and therefore the inhibition efficiency decreases. In addition, the EOCP curves at high temperatures are shifted to positive direction compared to that at 293 K either for blank or both studied drugs. Figure 3d represents the OCP curves of blank and 300 ppm of the studied drugs at 323 k. The figure indicates that the Curves in presence of both Cefx and Cefz drugs are remained in negative direction relative to blank one at the same temperature indicating that increasing the temperature doesn't alter the mechanism of inhibition or type of used inhibitor.

### Potentiodynamic polarization (PDP) measurements and the mechanism

PDP tests are performed on Al in 0.1 M NaOH medium by automatically altering the potential ± 100 mV against its EOCP value in the absence and existence of various concentrations (50–300 ppm) of Cefx and Cefz at 293 K with a sweep rate of 1 mV/s. Table 1 lists the electrochemical polarization characteristics, including corrosion potentials (Ecorr), corrosion current densities (icorr), anodic Tafel slopes (βa) and cathodic Tafel slopes (βc). The inhibition efficiencies (η%) are obtained using the equation below42,43.

$$\eta \% = \left[ {\left( {{\text{i}}^{{\text{o}}}{_{{{\text{corr}}}}} - {\text{i}}_{{{\text{corr}}}} } \right)/{\text{i}}^{{\text{o}}}{_{{{\text{corr}}}}} } \right] \times 100$$
(7)

where iocorr and icorr are the corrosion current densities for blank and inhibited solutions, respectively. Figure 4 represents the PDP profiles of the Al in the pure 0.1 M NaOH and existence of different concentrations of Cefx (Fig. 4a) and Cefz (Fig. 4b). The results demonstrate that the greater value of Icorr and the more positive value of the Ecorr (212.29 µA/cm2, − 1463.7 mV vs. Ag/AgCl) are observed in the inhibitor-free solution compared to (45.78 µA/cm2, − 1533.4 mV vs. Ag/AgCl) and (85.99 µA/cm2, − 1512.2 mV vs. Ag/AgCl) in the presence of 300 ppm from Cefx and Cefz, respectively. Furthermore, the values of Ecorr for all studied concentrations of both drugs are slightly shifted to negative direction compared to inhibitor-free solution, this means that the used drugs are cathodic ones, that mainly inhibit the cathodic reduction reaction of H2O through the retardation of the cathodic polarization and decreasing the corrosion current density without any effect on the anodic polarization44. The multistep electrochemical process of anodic dissolution of Al in the alkaline solution has been summarized as follows40,45:

$${\text{Al}}\left( {{\text{ss}}} \right) + {\text{ OH}}^{ - } \to {\text{Al}}\left( {{\text{OH}}} \right)_{{{\text{ads}}}} + {\text{ e}}^{ - }$$
(8)
$${\text{Al}}\left( {{\text{OH}}} \right)_{{{\text{ads}}}} + {\text{ OH}}^{ - } \to {\text{Al}}\left( {{\text{OH}}} \right)_{{{2},{\text{ads}}}} + {\text{ e}}^{ - }$$
(9)
$${\text{Al}}\left( {{\text{OH}}} \right)_{{{2},{\text{ads}}}} + {\text{ OH}}^{ - } \to {\text{Al}}\left( {{\text{OH}}} \right)_{{{3},{\text{ads}}}} + {\text{ e}}^{ - }$$
(10)

The final step is the conversion of Al(OH)3,ads to soluble aluminate species leaving a bare surface site (ss)

$${\text{Al}}\left( {{\text{OH}}} \right)_{{{3},{\text{ads}}}} + {\text{ OH}}^{ - } \to {\text{Al}}\left( {{\text{OH}}} \right)_{{4}}^{ - } + {\text{ ss}}$$
(11)

On the surface of aluminum, the cathodic process includes the reduction of water molecules45,46.

$${\text{ss }} + {\text{ H}}_{{2}} {\text{O }} + {\text{ e}}^{ - } \to {\text{H}}_{{{\text{ads}}}} + {\text{ OH}}^{ - }$$
(12)
$${\text{H}}_{{{\text{ads}}}} + {\text{ H}}_{{2}} {\text{O }} + {\text{ e}}^{ - } \to {\text{H}}_{{{2}({\text{gas}})}} + {\text{ OH}}^{ - } + {\text{ ss}}$$
(13)

Figure 5 exhibits the variation of the calculated values of η% of Cefx and Cefz as a function of their concentrations. The findings reveal that η% values enhance with increasing the concentrations of the tested drugs. The maximum inhibition efficiency (78.4%) is detected at 300 ppm of Cefx, concerning 59.5% at 300 ppm of Cefz. The analyses show that increasing the concentrations of Cefx and Cefz improves the Al surface coverage and hence the inhibition efficiency in the sequence Cefx > Cefz. Due to their adsorption via their hetero-active sites on the Al surface, these drugs produce a barrier protective film that inhibits the active sites for reduction reactions47.

PDP measurements are also accomplished at 303,313 and 323 K in the absence and presence 300 ppm of Cefx and Cefz drugs. The electrochemical polarization parameters such as icorr, Ecorr, βc and βa are given in Table 2. Figure 6 represents PDP of the Al in pure 0.1 M NaOH and presence of 300 ppm of Cefx and Cefz drugs at various temperatures from 293 to 323 K. As demonstrated in the Fig. 6, the Ecorr at high temperatures is shifted to positive direction relative to that at 293 K which implies that the studied drugs act as cathodic inhibitors even at high temperatures. Increasing the temperatures results in the desorption of Cefx and Cefz anions from Al surface so the inhibition of cathodic reaction decreases, accumulation of electrons at the anode reduces and thus the potential moves to positive direction. Table 2 strongly suggests that raising the temperature increases the corrosion current (icorr), lowering the inhibitory efficiency of both Cefx and Cefz drugs.

### Electrochemical impedance spectroscopy (EIS) measurements

Aluminum/electrolyte interface relationship during the corrosion process is evaluated using EIS technique at different concentrations of both Cefx and Cefz at EOCP. Figure 7a depicts the Nyquist plots of Al in blank 0.1 M NaOH media and existence of 300 ppm of both Cefx and Cefz at 293 K. The impedance profile displays the presence of two capacitive loops at high and low-frequency zones, which are ascribed to charge transfer reactions through the Al/electrolyte interface, as well as the presence of one inductive loop at the intermediate frequency region for the adsorption of the corrosion product intermediates on Al surface46,48. However, in the presence of both drugs, the capacitive loops' width grows without altering the impedance diagrams' forms, indicating that the corrosion process is unchanged in the absence and presence of the examined drugs49.This observation agrees well with PDP measurements which can be indicated from the parallel cathodic polarization curves44. At high frequencies, the large capacitive semicircle is referred to as the redox Al to Al+ reaction (Eq. 8) which is the rate-determining phase in the charge transfer reaction throughout the corrosion process48,49. At low frequencies, the second capacitive semicircle can be attributed to the fast-complementary redox Al+ to Al3+ reactions (Eqs. 9 and 10). Meanwhile, the inductive loop in the middle frequencies is assigned to the presence of the adsorbed Al(OH)1–3 intermediates on Al surface during its dissolution48,49. The corresponding phase angle and Bode impedance magnitude plots for Al in pristine 0.1 M NaOH solution and existence of 300 ppm of the Cefx and Cefz at 293 K are depicted in Fig. 7b. The bode graphs indicate the presence of two-time constants for charge transfer events during Al dissolution. Furthermore, the area under the curves is ordered as follows: Cefx > Cefz > blank. This discovery may be illustrated by the adsorption of the examined medicines on the Al surface, which protects it against corrosion. Furthermore, the higher area in the presence of Cefx compared to Cefz suggesting the Al surface coverage in case of Cefx is higher than that of Cefz, consequently its higher inhibition efficiency.

Figure 7c depicts a model of the experimental data fitted to an electrochemical equivalent circuit, which is consistent with recent work by Yong Liu et al.49.

According to equivalent circuit measurements, the electrochemical parameters including, resistance to charge transfer (Rct1, Rct2), bulk resistance (Rs), and double-layer (Cdl) in pure NaOH electrolyte and in existence of varying concentrations of Cefx and Cefz are summarized in Table 3. Data show that the presence of Cefx and Cefz changes the structure of the Al electrolyte interface compared to inhibitor free solution. This behaviour is resulted from increasing Rs, Rct1 and Rct2 values with decreasing Cdl and CPE values in the presence of the studied drugs compared to the inhibitor free solution. These findings can be explained to the replacement of water molecules by the adsorbed barrier protective insulating layers from Cefx and Cefz on Al surface, which decreasing the local dielectric constant and/or increasing the thickness of the adsorbed barrier protective layer, that impedes the charge transfer reaction through Al/electrolyte interface47. The inhibition efficiencies (η%) are calculated from total charge transfer resistance RT (RT = Rct1 + Rct2) and listed in Table 3 using the following equation48:

$$\eta \% = \uptheta \times 100$$
(14)
$$\uptheta = \left( {{\text{R}}_{{\text{T}}} - {\text{ R}}_{{\text{T}}}{^{{\text{o}}}} } \right)/{\text{ R}}_{{\text{T}}}$$
(15)

where θ is the surface coverage, RTo and RT are total charge transfer resistances in the absence and presence of the studied drugs, respectively. Data show that, the values of η% increase with increasing the concentrations of both drugs in the following order: Cefz < Cefx and reach the maximum (69.6%) at 300 ppm for Cefx which agreed well with PDP measurements.

EIS measurements are also performed at 303,313 and 323 K in the absence and presence 300 ppm of Cefx and Cefz drugs at EOCP. Data obtained at 303 K are fitted to the same equivalent circuit which fits 293 K data (assume EC1) while this EC1 doesn't fit the data obtained at 313 and 323 K (assume EC2), therefore Cdl in EC1 is replaced by CPE in EC2. The electrochemical parameters derived from EC2 (Fig. S1), including constant phase element (CPE1 and CPE2), charge transfer resistances (Rct1, Rct2), solution resistance (Rs), calculated RT and η% are given in Table 4. It is clearly shown from Fig. 8 that the shape of high frequency capacitive loop changes which is proved by the replacement of the Cdl in EC1 (Fig. 7c) for Al samples at 293 and 303 K by CPE in EC2 (Fig. S1a) at 313 and 323 K which is elucidated to the desorption of Cefx and Cefz anions from Al surface at high temperatures and thus increase the corrosion rate and consequently the inhomogeneity of Al surface. It is clear from Table 4 that the addition of the studied drugs to sodium hydroxide solution at any given temperature rises the value of RT but reduces the value of Cdl compared to blank solution at the same temperature. The decrease in RT values of Cefx and Cefz drugs with increasing the temperature confirms the desorption of the studied drugs from Al surface, decreasing the Al surface coverage with these drugs, increasing the corrosion rate and therefore decrease the inhibition efficiencies. Bode plots are shown in Fig. S1b–d. It is clearly seen that the impedance (Z) of Al in the absence and presence of Cefx and Cefz drugs at 293 and 303 K is more at lower frequency and it declines small with a rise in frequency and then rises again up to a precise frequency after this frequency, the impedance decreases steeply signifying the presence of two time constants while at 313 and 323 K the change in the impedance values before the sharp decrease is not clear due to the change in the shape of Nyquist plots. Moreover, the impedance of all samples decreases with the increase in temperature at low frequency region.

Furthermore, the inhibition efficiency of Cefx and Cefz are compared to those of other organic compounds described in the literature as inhibitors for aluminum and its alloys and summarized in Table 550,51,52,53,54,55. According to Table 5, the proposed drugs have close efficiency or relativity higher than some expired, extracted, synthetic drugs recently reported.

### Surface analysis

The morphology of Al surface in 0.1 M NaOH solutions immersed for 2 h at 293 K in the pure electrolyte and presence of 300 ppm Cefx and Cefz is investigated using FESEM. The FESEM images demonstrate numerous characteristic pores of Al2O3 in the pure alkaline media with a significant level of roughness caused by the damage of Al surface by the attack of aggressive hydroxide ions while the number and size of these pores decrease in the presence of Cefx and Cefz as shown in Fig. 9. Furthermore, the homogeneity of Al surface in the existence of Cefx is greater than in the presence of Cefz, indicating that Cefx is a more effective inhibitor than Cefz. The improvement of the homogeneity of the Al surface is attributed to the adsorption of these medicines on the Al surface, resulting in the formation of a protective film that shields the metal from the aggressive NaOH solution5.

Furthermore, elemental mappings are taken to confirm the distribution and existence of different elements on Al surface after immersion in pure 0.1 M NaOH for 2 h at 293 K in and presence of 300 ppm Cefx and Cefz. Figure 9 reveals the presence of oxygen in the absence of the studied drugs, indicates the presence of Al oxide/hydroxide due to the aggressive attack by OH ions. While the existence of C, N and S elements following immersion in solutions containing Cefx and Cefz confirmed drug adsorption on the Al surface, the production of the protective adsorbed films that suppressed the aggressive attack between Al surface and OH ions.

XPS is accomplished to investigate the adsorption of Cefx and Cefz on Al surface and examine the chemical composition of the adsorbed film. Table 6 explores the survey spectra inspects the surface composition of Al substrates subjected to the pure NaOH solution and presence of 300 ppm of the examined Cefx and Cefz. The pristine sample has a 24.36 at.% Al and 39.75 at.% O related to the presence of Al oxide/hydroxide. The adsorption of Cefx and Cefz is confirmed by decreasing Al and O contents with increasing the C content, as well as the appearance of new peaks for N and S. High-resolution XPS spectra in the binding energy (BE) range of the Al 2p, C 1s, N 1s, S 2p, and O 1s peaks are presented in Figs. 10, S2, S3, and S4. The deconvolution of the Al 2p (Fig. 10a–c) included two peaks at 73.1 eV and 75 eV for blank, Cefx and Cefz, which are assigned to the Al metal and Al-O respectively50,56. The intensity of the Al 2p peak falls somewhat in the presence of the examined drugs as they form a layer on the Al substrate, as shown by the presence of N 1s, S 2p, and an increase in the carbon content on the Al surface. The resolved C 1s spectra of Al for blank solution is deconvoluted into two peaks as shown in Fig. 10d. The first peak at 285.2 eV signified to C–C/C–O/C–H, while the second peak at 289 eV attributed to O–C=O group57. The addition of the studied drugs leads to the deconvolution of C 1s peak into five peaks, as shown in Fig. 10e,f. The peak at 284.6 eV was attributed to C–C/C=C/C–H bonds that may have originated from the examined medications, but also to adventitious carbon adsorbed on the Al surface as a result of air exposure58. The peaks at 285.5 eV and 286.3 eV are attributed to C–O and C–N/C–S/C=N59,60. The two remaining peaks, at 287.5 eV and 289.1 eV, directly correlate to carbonyl and carboxyl functional groups respectively58. The XPS spectrum related to the O1s signal is shown as supplementary Fig. S2. The oxygen O1s peak is deconvoluted into two peak singlets. The predominant component at 532.7 eV is ascribed to surface hydroxyl groups in blank samples and oxygen in carbonyl or ester groups inside the adsorbed layer in inhibited solutions while the peak at 531.5 eV is assigned to C–O/Al–O–C60. The XPS spectrum related to N 1s (Fig. S3) shows five characteristic peaks at 398.4, 399.5, 400.4, 401.2 eV and 402 eV, corresponding to the C–N, Al–N, C=N, N–C=O and N–N/N–O bonds respectively61,62. The S 2p peak of Cefx is deconvoluted into four peaks at binding energies of 162.1 eV, 163.3 eV, 164. eV, and 164.2 eV, assigned to endocyclic (2p3/2, 2p1/2) for thiazine ring, exocyclic C–S–C bond, and C–S–C of thiazole ring, respectively. On the other hand, The figure (Fig. S4) presents the S 2p peak of Cefz is deconvoluted into three peaks due to the absence of an exocyclic S atom63,64,65,66. The appearance of spectra of N 1s and S 2p for inhibited Al samples reveals that Cefx and Cefz can adsorb on Al surface and increase its corrosion resistance. The atomic percent of elements (Table 6) indicate that the adsorption of the examined medicines on the Al surface occurs in the following order: Cefx > Cefz.

### Wettability measurements

Contact angle measurements proven to be an effective and efficient approach for characterizing the surface wettability behaviour of Al in the absence and existence of 300 ppm of Cefx and Cefz. These findings imply that the hydrophilic character of the blank Al surface with the value of θ = 56o, undergoes a significant transition to hydrophobic nature, with values of 98° and 73o for the Cefx and Cefz, respectively, as shown in Fig. 11. The hydrophobicity nature of Al surface in the presence of the studied drugs can be correlated to the adsorption of the hydrophobic groups in their molecular structures. Therefore, it decreases the adhesion contact with Al surface and enhances its corrosion resistance67,68,69,70,71. This increase in hydrophobicity is consistent with the predicted inhibitory efficiencies, which are listed in the following order: Cefx > Cefz.

### Thermodynamic activation parameters

Thermodynamic activation parameters are determined and summarised in Table 2 for the pure electrolyte, and the existence of 300 ppm of Cefx and Cefz are calculated and tabulated in Table 2 using Arrhenius and transition state equations as follows76:

$${\text{Ln }}\left( {{\text{CR}}\sim {\text{ I}}_{{{\text{corr}}}} } \right) = {\text{ Ln A}} - {\text{ E}}_{{\text{a}}} /{\text{RT}}$$
(16)
$${\text{Ln }}\left( {{\text{CR}}\sim {\text{ I}}_{{{\text{corr}}}} /{\text{T}}} \right) = {\text{ Ln}}\left( {{\text{R}}/{\text{Nh}}} \right) + \Delta {\text{S}}^{*}/{\text{R }} -\Delta {\text{H}}^{*}/{\text{RT}}$$
(17)

where A is the Arrhenius constant, R represents the universal gas constant, T donates the absolute temperature, n is Avogadro's number and h refers to plank's constant. ΔH* and ΔS* are the dissolution process's activation enthalpy and entropy. The corrosion rate (CR) is directly proportional to the corrosion current density (Icorr), and Ea denotes the activation energy. Figure 13a represents the linear relationships of Ln (Icorr) with 1/T for Al in pure 0.1 M NaOH and presence of 300 ppm of Cefx and Cefz. The values of Ea are calculated and listed in Table 2. Data show that the values of Ea in the presence of studied drugs are higher than that in blank solution which indicate that rate of Al dissolution decreases in presence of Cefx and Cefz. Moreover, the values of Ea increase in the following order Cefz < Cefx which indicate that the rate of Al dissolution in the presence of Cefx is lower than that in the presence of Cefz and hence Cefx is more efficient inhibitor than Cefz. Figure 13b represents the relation between Ln (Icorr/T) and 1/T, from which the values of ΔH* and ΔS* are calculated and summarized in Table 2. The obtained results display that ΔH* values are positive indicating the endothermic nature of Al dissolution process. Higher values of ΔH* in the presence of Cefx and Cefz compared to inhibited free solution enhance the corrosion resistance of Al in 0.1 M NaOH76, as a result of their adsorption on its surface forming an energy barrier which is higher for Cefx in comparison with Cefz. Furthermore, negative values of ΔS* suggest that association rather than dissociation is the rate-determining step to produce activated complex, resulting in a reduction in disturbance76. Furthermore, the higher ΔS* values in the presence of Cefx and Cefz may be ascribed to an increase in randomness at the Al/solution interface after their adsorption, which can be explained by the increased number of water molecules desorbed off the Al surface77. Moreover, the more positive value of ΔS* for Cefx (− 78.49 kJ/mole) compared to Cefz (− 104.19 kJ/mole) implying that the higher protection efficiency is for Cefx.

### Quantum chemical calculations

The corrosion inhibition efficiency of the Cefx and Cefz are also investigated by doing QC based on HF. The adjusted molecular structures, HOMO (the highest occupied molecular orbital), LUMO (the lowest unoccupied molecular orbital) and molecular electrostatic potentials (ESP) of both drugs are depicted in Fig. 14. The quantum chemical factors, including EHOMO, ELUMO, HOMO–LUMO energy gap (ΔE), ionization energy (I), electron affinity (A), electronegativity (χ), chemical hardness (η), softness (σ) and fraction of electron transferred (ΔN) are used in corrosion studies to evaluate the inhibition performances of the studied drugs. EHOMO is correlated to the electron donating ability of the molecules. The higher the EHOMO, the higher the electron transfer from inhibitor to the unoccupied molecular orbital of the metal that facilitates the adsorption and therefore enhances inhibition efficiency78. ΔE is an important parameter considered in corrosion science as we know the reactivity of inhibitor molecules through it. As ΔE decreases, the inhibition efficiency of inhibitors increases. Ionization energy (I) is another important parameter of chemical reactivity of atoms and molecules. Small (I) implies high reactivity of molecules while high (I) indicates the inertness of the molecules and hence low inhibition efficiency79. The electron affinity (A) denotes the intensity of inhibitor adsorption on the surface of metal sample; a high negative value of (A) indicates that the inhibitor molecule firmly absorbs on the metal surface, forming a protective coating on the surface80. The electronegativity is very important descriptor as it represents electron pulling power of the molecules. High χ values suggest that the molecules cannot give electrons easily81. Furthermore, low value of ΔE indicates that the molecule is soft and polarizable. Polarizable and soft molecules give electrons to metal easier than the unpolarizable and hard ones82. Hardness and softness are crucial factors because they measure a molecule's reactivity and stability82. The inhibitory efficiency is proportional to the percentage of electrons transferred (ΔN) and the positive ΔN values imply that the electrons are moved from the inhibitor to the metal, while negative ΔN values indicate that electrons are transferred from the metal to the inhibitor molecule83. The inhibitory efficacy of inhibitors rises as ΔN values increase owing to an increase in electron donating between the examined medicines and the Al surface.

It is clear from Fig. 14 that HOMO of the studied drugs is focused on oxygen, nitrogen, and Sulphur of cephalosporin group for Cefz and dioxo-methyl-triazine sulfanyl group for Cefx. The higher inhibition efficiency of Cefx compared to Cefz is correlated to its higher values of EHOMO, σ and ΔN with lower values of ΔE, I, A, χ and η as shown from Table 8. The above results can be illustrated to the presence of dioxo-methyl-triazine sulfanyl group in Cefx molecular structure.

Molecular electrostatic potential (ESP) maps are very important parameters as they provide a visual method to know the parts of molecules on which the electron density is higher than other parts to determine the reactive parts in the molecules82. Different colors reflect different ESP values. The blue indicates the area with the highest positive ESP, the red indicates the region with the most negative ESP, and the green indicates the region with zero ESP. It can be shown from Fig. 14 that Cefz has red regions less than that of Cefx. In additions the figure shows that the electron rich centers are referred to the oxygen of dioxo-methyl-triazine sulfanyl group and other functional groups in Cefx while oxygen of carboxylate and amide groups in Cefz. It can be concluded that the presence of dioxo-methyl-triazine sulfanyl group in Cefx drug increases its electron density, so increases the electrostatic attraction with Al surface and consequently its inhibition efficiency. These findings agree well with experimental data.

### Monte Carlo simulations

MC simulations explore the interaction between the studied inhibitors and Al surface. The side and top views of the stable adsorption configuration of a single molecule of Cefx and Cefz with Al (111) surface are shown in Fig. 15. It is observed from the figure that the surface adsorption of Cefx molecule preferably happened by flat type molecular orientation and parallel to Al surface. This orientation allows its active centers to react effectively with the Al surface leading to higher protection efficiency than Cefz molecule. On the hand, the adsorption energies of Cefx and Cefz are − 239.81 and − 156.55 kcal/mol, respectively. Cefx's largest negative adsorption energy value reflects its strongest spontaneous adsorption on Al when compared to Cefz, and hence its better inhibitory effectiveness81,83.

### Molecular dynamics simulations

MD simulations are performed to explore the interactions of the investigated drugs with Al surface in presence of water molecules. The side views of the final MD snapshots of the Cefx and Cefz adsorbed on the surface of Al (111) with the presence of 950 H2O molecules are shown in Fig. 16. This image clearly shows that the examined drugs are situated extremely close to the metal surface, indicating that the affinity of Cefx and Cefz for the Al surface is strong even in the presence of solvent molecules. This validates the adsorption of these medicines on the Al surface, protecting it against corrosion.

Radial distribution function (RDF) is applied to calculate the distances between the atoms of the studied drugs and the Al surface to highlight the type of the adsorption process. If the value of the interatomic distance (r) is within the range of 1–3.5 Å, then the chemical bonds are favorably present, while physical interactions have been observed at r > 3.5 Å84. Figure S5 shows RDF for oxygen atoms of the active functional groups for both Cefx and Cefz drugs and top layer of Al (111) surface. It is observed from the figure that, the distance found for O13 (2.71 Å), O14 (2.93 Å), O21&O22 (6.07 Å), O23 (5.35 Å) and O50 &O51 (3.33 Å) with respect to Al(111) surface in case of Cefx, while the distances for Cefz are O13 (2.83 Å), O14 (3.25 Å), O21&O22 (4.47 Å), O23(2.75 Å) and O45&O46 (5.67 Å). These results suggesting a mixed type adsorption of these drugs on Al surface, that agree with the values of ΔGoads calculated from the best fit experimental adsorption isotherms.

## Conclusion

In this work, various doses of anionic states of Cefx and Cefz medicines are tested as corrosion inhibitors for Al in 0.1 M NaOH solution at 293 K. The electrochemical results show that Cefx and Cefz are effective Cathodic inhibitors. Furthermore, the inhibitory efficiencies rise with increasing concentrations, with the greatest percent (78.4 percent) recorded at 300 ppm of Cefx compared to 59.5 percent at 300 ppm of Cefz. The activation energy barrier of Al dissolving in 0.1 M NaOH is low compared to that in the presence of Cefx, which is greater than that of Cefz, suggesting a reduction in corrosion rate in the presence of the examined medications. Surface analysis and wettability studies show the existence of adsorbed hydrophobic layers of Cefx and Cefz on the Al surface. Cefz obeys the Freundlich isotherm with spontaneous and mixed type adsorption, while Cefx obeys the Temkin isotherm with spontaneous and mixed type adsorption. MC/MD simulations demonstrate that Cefx has an adsorbed flat type molecular orientation parallel to the Al surface, indicating that it has a greater protective effect than Cefz medication.