Inhibition Effect of Triphenylmethane Dyes for the Corrosion of Carbon Steel in CO2-Saturated NaCl Corrosion Medium

Carbon dioxide corrosion presents a significant challenge in the oil and gas field. This study simulates the corrosive environment characteristics of oil and gas fields to investigate the corrosion inhibition properties of three triphenylmethane dyes. The inhibitive performance and mechanisms of these dyes were analyzed through weight loss and electrochemical testing, revealing that crystal violet (CV) exhibited a superior inhibition effectiveness over malachite green (MG) and Fuchsine basic (FB). At a concentration of 150 ppm in a CO2-saturated 5% NaCl solution at 25 °C, CV achieved an impressive maximum inhibition efficiency of 94.89%. With the increase in temperature, the corrosion rate slightly decreased, and the corrosion rate was 92.94% at 60 °C. The investigated CV acted as a mixed-type corrosion inhibitor and its protection obeyed the Langmuir adsorption isotherm. The corrosion morphology was characterized by scanning electron microscopy (SEM), X-ray photoelectron spectroscopy (XPS), and confocal laser scanning microscopy (CLMS). Quantum chemical calculations and molecular dynamics simulations were employed to validate the corrosion inhibition mechanisms, providing guidance for the further application of these dyes in corrosion control.


Introduction
Corrosion is a serious problem that significantly impacts industrial development, particularly in the oil and gas industry, where it has caused serious economic losses and potential safety hazards [1,2].One of the most common types of corrosion is CO 2 corrosion, which forms an acidic medium that corrodes the metal surface, leading to equipment damage and production interruptions [3].The production and transportation processes of oil and gas often face severe CO 2 corrosion issues, impeding the industry's safe and efficient production.To address the corrosion problem, the injection of corrosion inhibitors is considered the most economically effective approach [4][5][6].
Most dyes contain complex molecular structures with both hydrophilic and hydrophobic segments that are associated with many donor centers that interact with the metallic species, which is essential for the corrosion mitigation effect [7,8].There are some literature studies that show that many dye series have excellent anticorrosive properties for many metal/electrolyte combinations because of their abundant electron-donating sites as polydentate and chelating ligands [9][10][11].Triphenylmethane dyes are compounds with abundant phenyl ring structures which generally have strong interactions with the metal surface [12].They have a good solubility and adsorption capacity, allowing them to quickly attach to the metal surface and form a protective film that hinders the attack of the corrosive medium.The inhibition of type 304LSS corrosion in hydrochloric acid by New Fuchsin was explored in the study of Zahed et al. [13].New Fuchsin has been found to be a good, mixed-type inhibitor of corrosion, which decreases the partial cathodic and anodic current densities.Li et al. studied the inhibition effect of crystal violet (CV) on the corrosion of cold-rolled steels in 1.0 M HCl solution and found that it is an excellent inhibitor [14].Careful examination of the data reveals that triphenylmethane dyes can block the active sites of corrosion and reduce the corrosion current density, thereby inhibiting the corrosion of metal in hydrochloric acid [15][16][17].Despite numerous studies on dyes as corrosion inhibitors, the performance of triphenylmethane dyes in CO 2 corrosion remains unexplored, which represents a novel direction for corrosion research.
In this study, we innovatively investigated the potential of triarylmethane dyes as corrosion inhibitors in CO 2 -rich environments that simulate the corrosive environment in the oil and gas industry.Quantum chemical calculations and molecular dynamics simulations were employed to elucidate the underlying corrosion mechanisms.By focusing on a class of compounds known for their strong adsorption abilities and electron-donating characteristics, we tried to open up new avenues for the development of corrosion inhibitors with enhanced performance and sustainability.

Materials
Sodium chloride, malachite green (MG), crystal violet (CV), Fuchsine basic (FB) were purchased from Aladdin Chemical Reagent Co., Ltd.(Shanghai, China) with an aluminum mass fraction purity of 98%.Deionized water purified by Milli-Q filtration was used for all the experiments.All corrosion tests were performed on L360N carbon steel with a size of 3 cm × 1.5 cm × 0.3 cm and were obtained from Shandong Yangxin Shengxin Technology Co., Ltd.(Shandong, Jinan, China), and their chemical composition was basically as follows (%, wt): C 0.2, Si 0.35, Mn 1.42, S 0.019, P 0.02, and balanced Fe.All specimens were consistently ground with 600, 800, and 1200-grit SiC papers, rinsed with distilled water, degreased in acetone, washed with anhydrous ethanol, dried, weighed (with an accuracy of 0.0001 g), and stored in a desiccator until use.

Weight Loss Measurements
All specimens were exposed to CO 2 -saturated water with 5% NaCl brine solution containing 100 ppm dyes for three days at 40 • C. Three specimens were tested for each condition simultaneously.After the tests, specimens were taken out and corrosion products on the surface of specimens were removed with a Clark's solution (10 g hexamethylenetetramine, 100 mL hydrochloric acid, and 900 mL water) [18].Then, these samples were rinsed in water, cleaned in anhydrous ethanol, dried, and weighed.The corrosion rate (ν, mm/y) and inhibition efficiency (η, %) can be calculated by Equations ( 1) and ( 2): where m 1 and m 2 represent the weights of specimens before and after the experiment, respectively (g); A represents the surface area (cm 2 ); ρ represents the density of the specimen (g/cm 3 ); and t represents the experimental duration (h).
where ν 0 and ν 1 represent the corrosion rates of the specimens in the absence and presence of inhibitors, respectively.

Electrochemical Measurements
All electrochemical assays were conducted on a three-electrode cell in a glass container (250 mL) at allocated temperatures via a CS2350 electrochemical workstation (Wuhan Corrtest Instruments Corp., Ltd., Wuhan, China), in which L360N carbon steel with a tested surface area of 0.5 cm 2 , a platinum sheet, and saturated calomel electrode (SCE) behaved as the working, counter-, and reference electrodes, respectively.All the tests were performed in a CO 2 -saturated solution with 5% NaCl containing various concentrations of inhibitors at different temperatures.After, samples were immersed in the solution to reach steady state with the measurement of the open-circuit potential (OCP).Electrochemical impedance spectra (EIS) were obtained in the frequency range from 10 5 to 10 −2 Hz with a sinusoidal wave amplitude of 5 mV.Following the measurement, the relevant test data were fitted to obtain equivalent circuit models with ZSimpWin software v3.60.Potentiodynamic polarization (PDP) tests were performed in the potential bounds of −0.25~0.25 V vs. OCP with a sweeping rate of 0.5 mV/s.All of the electrochemical tests were repeated three times to ensure the reproducibility of experimental data.

Surface Analysis
The surface morphology of the specimens was examined by scanning electronic microscopy (SEM, JSM-IT500HR, JEOL, Tokyo, Japan) and confocal laser scanning microscopy (CLSM, VK-150K, Keyence, Osaka, Japan).X-ray photoelectron spectroscopy (XPS, K-Alpha, Thermo Scientific, Waltham, MA, USA) was employed to analyze the surface composition of the samples with a monochromatic Al Kα X-ray source.

Quantum Chemical Calculations
These corrosion inhibitor molecules were optimized with quantum chemical calculations on the basis of density functional theory (DFT) using the B3LYP/6-311++G** method with the consideration of the solvent effects (water) using Gaussian v09W software.The corresponding quantum chemical calculation parameters were obtained to explore the interaction between these dye molecules and steel surface, including the highest occupied molecular orbital (HOMO), the lowest unoccupied molecular orbital (LUMO), and their energy gap (∆E = ELUMO − EHOMO) [19].The electrostatic potential (ESP) distribution on a molecular surface was visualized using Visual Molecular Dynamic (VMD) v1.9.3 software [20].

Molecular Dynamics (MD) Simulation
The adsorption behavior of three dye molecules on the iron substrate was calculated by MD simulation with the Forcite module in Materials studio v7.0 software [21].The Fe (110) surface was chosen to simulate the interaction between the inhibitor and the surface of the specimen due to its highly stabilized and packed structure [22].The solvent layer (250 H 2 O, 4 Cl − , 4 Na + , and the optimized structure of inhibitor) was in interaction with the Fe (110) surface in the COMPASS II force field.A vacuum layer of 15 Å was established above the solution layer to isolate the interaction of periodic structures in the vertical direction [23].MD simulations were conducted under a canonical ensemble (NVT) for 1.0 fs time steps with 500 ps as the simulation time at 298.15 K.In addition, adsorption energy (E ads ) was used to quantitatively evaluate the interaction strength of the inhibitor with the Fe surface and was calculated by Equation (3) [24]: where E total represents the energy of the entire adsorption system, E surf+solu represents the single-point energy of the Fe (110) surface and solvent, E inh+solu stands for the energy of the inhibitor and solvent, and E solu is the energy of the solvent.

Weight Loss Measurements
Weight loss measurement is simple and straightforward to use to evaluate the corrosion of metals [25].Table 1 lists the results of specimens exposed to the solution with 100 ppm inhibitors for three days at 40 • C. The corrosion rate and inhibition efficiency of the specimens in the solution with CV, MG, and FB are 0.050 mm/y, 0.102 mm/y, and 0.143 mm/y and 82.8%, 64.1%, and 49.8%, respectively, while the average corrosion rate is 0.323 mm/y in the blank solution.The addition of dyes results in an increase in corrosion inhibition efficiency, which suggests that dyes can likely adsorb on the specimen surface.Among them, the corrosion inhibition efficiency of CV is best.

Electrochemical Measurements
Electrochemical measurements are effective methods for exploring corrosion mechanisms at the metal solution interface [26].In order to further investigate the inhibition properties of CV, EIS and PDP experiments were performed in the solution without or with different concentrations of CV at 25, 40, and 60 • C.

EIS Measurements
The results of the Nyquist and Bode plots of the specimens are shown in Figure 1.The Nyquist plot demonstrates a semicircular arc in the high-frequency domain, which is indicative of the electrode surface's roughness and non-uniformity as well as the adsorption of corrosion inhibitors on the carbon steel surface.In the low-frequency domain, the presence of a sloped line suggests that a diffusion process of ions is taking place at the electrode [27].The characteristic frequency ω c of the characteristic arc is labeled with a black arrow in the figure.It can be seen that the shapes of the impedance with various inhibitor concentrations at different temperatures are similar, with all showing a single capacitive arc.The diameter of the semicircle increases considerably with the increase in corrosion inhibitor concentration.However, the diameter or radius gradually decreases under the same corrosion inhibitor concentration as the temperature gradually increases.A higher diameter of the capacitive arc reflects the formation of potential barriers that must be resolved to facilitate charge transfer, suggesting a decrease in the rate of corrosion [28].Moreover, the wide phase angle peaks in the presence of CV indicate the existence of two time constants compared to the blank solution in the Bode plots, indicating that the corrosion inhibitor has successfully adsorbed on the surface of the steel sheet to form a corresponding adsorption film [25].The equivalent circuit moles are used to fit the EIS data without or with CV and are shown in Figure 2. It is commonly accepted that the corrosion mechanism of unprotected metals often potentially involves a charge transfer mechanism.However, the introduction of corrosion inhibitors tends to complicate the metal's corrosion mechanism.Consequently, for the uninhibited solution, an equivalent circuit like that shown in Figure 2a is typically employed for fitting purposes, while for the more intricate impedance characteristics observed after the addition of corrosion inhibitors, equivalent circuits of Figure 2b are used for fitting.In these equivalent circuits, R s represents the solution resistance, R ct represents the charge transfer resistance, CPE dl represents the constant-phase element standing for the double-layer capacitance, and R f and CPE f represent the resistance and capacitance of the corrosion product film and/or the inhibitor films, respectively [29].The equivalent circuit indicates that the addition of CV results in the formation of a film on the carbon steel surface, thereby inhibiting its corrosion.
Materials 2024, 17, x FOR PEER REVIEW 5 of 20 layer capacitance, and Rf and CPEf represent the resistance and capacitance of the corrosion product film and/or the inhibitor films, respectively [29].The equivalent circuit indicates that the addition of CV results in the formation of a film on the carbon steel surface, thereby inhibiting its corrosion.

PDP Measurements
Figure 3a-c show the polarization curves obtained in blank solution as well as with the addition of different corrosion inhibitor concentrations at temperatures of 25 °C, 40 °C, and 60 °C, respectively.It can be seen from the figures that the addition of the corrosion inhibitor results in a shift in both the cathodic and anodic polarization curves to the left to various extents, and the reduction in polarization current density indicates that the corrosion inhibitor has a significant inhibitory effect on both the anodic dissolution and the reduction in cathodic hydrogen ions in the corrosion process of carbon steel [18].Additionally, the figures reveal that the corrosion potential of this inhibitor does not show significant differences at different concentrations, indicating that CV is a mixed-type corrosion inhibitor [30].

PDP Measurements
Figure 3a-c show the polarization curves obtained in blank solution as well as with the addition of different corrosion inhibitor concentrations at temperatures of 25 • C, 40 • C, and 60 • C, respectively.It can be seen from the figures that the addition of the corrosion inhibitor results in a shift in both the cathodic and anodic polarization curves to the left to various extents, and the reduction in polarization current density indicates that the corrosion inhibitor has a significant inhibitory effect on both the anodic dissolution and the reduction in cathodic hydrogen ions in the corrosion process of carbon steel [18].Additionally, the figures reveal that the corrosion potential of this inhibitor does not show significant differences at different concentrations, indicating that CV is a mixed-type corrosion inhibitor [30].
By fitting the polarization curves, the following electrochemical parameters are obtained: E corr (corrosion potential) and i corr (corrosion current density), which are listed in Table 2.The inhibition efficiency (η p %) of the corrosion inhibitor can be calculated using Equation (4) [29]: where i 0 corr and i corr represent the corrosion current density of the blank solution and the solution with the added corrosion inhibitor, respectively.By fitting the polarization curves, the following electrochemical parameters are obtained: Ecorr (corrosion potential) and icorr (corrosion current density), which are listed in Table 2.The inhibition efficiency (ηp %) of the corrosion inhibitor can be calculated using Equation (4) [29]: where i corr 0 and i corr represent the corrosion current density of the blank solution and the solution with the added corrosion inhibitor, respectively.From Table 2, it is evident that i corr decreases and η p increases with the increase in the concentration of the corrosion inhibitor at different temperatures.Furthermore, the lowest i corr and highest η p can be observed at 25 • C by comparing these values at different temperatures, indicating that CV is most effective at inhibiting corrosion at this temperature.As the temperature increases, the inhibitory effect of the corrosion inhibitor gradually weakens (as shown in Figure 4).Both the cathodic and anodic current densities are observed to decrease after the addition of the corrosion inhibitor, which indicates that the adsorption of the inhibitor film on the surface hinders both the cathodic and anodic processes [31].Table 3 lists the inhibition efficiencies of the studied dyes and other dyes reported in the literature.The literature primarily investigates the corrosion inhibition performance in hydrochloric or sulfuric acid solutions, with no studies addressing its efficacy against CO 2 corrosion.Table 3 reveals that CV exhibits an excellent corrosion inhibition efficiency in the CO 2 -saturated 5% NaCl solution.
adsorption of the inhibitor film on the surface hinders both the cathodic and anodic processes [31].Table 3 lists the inhibition efficiencies of the studied dyes and other dyes reported in the literature.The literature primarily investigates the corrosion inhibition performance in hydrochloric or sulfuric acid solutions, with no studies addressing its efficacy against CO2 corrosion.Table 3 reveals that CV exhibits an excellent corrosion inhibition efficiency in the CO2-saturated 5% NaCl solution.

Adsorption Thermodynamic and Kinetic Analysis
In order to investigate the adsorption mechanism, the adsorption isotherm of CV is shown in Figure 3d, and its adsorption capacity is calculated for the corrosion inhibitor at 40 • C using the following Langmuir adsorption formula [36]: where C inh represents the concentration of CV, θ is the coverage rate of the corrosion inhibitor on the steel surface (θ = η p ), and K ads is the adsorption-desorption equilibrium constant, which could be determined with the intercept of the C inh /θ vs. C inh plots.The standard Gibbs free energy of adsorption (∆G 0 abs ) can be calculated by Formula (6) [37]: where R represents the universal gas constant (8.314JK −1 mol −1 ), T is the thermodynamic temperature, and 1 × 10 6 is the value of the concentration of water (mg/L) in solution.
The thermodynamic parameters of CV are listed in Table 4.The linear correlation coefficient (R 2 ) is 0.99, demonstrating that CV follows the Langmuir adsorption model.As calculated, the Gibbs free energy (∆G 0 abs ) of the corrosion inhibitor is −27.496kJ/mol, indicating that the adsorption type of this adsorbent simultaneously exhibits physical adsorption and chemical adsorption [25].Taking into consideration the impact of temperature on the corrosion inhibitor, the corrosion kinetics were further investigated in this process.The relationship between current density and temperature was explored in a solution containing the inhibitor or an inhibitor-free solution using the Arrhenius equation [38]: where A represents the frequency factor, E a is the activation energy, and i corr is the current density of the corrosion inhibitor at 150 ppm.R and T represent the universal gas constant and thermodynamic temperature, respectively.The Arrhenius plots and E a are shown in Figure 5.As can be seen from Figure 5, the activation energy with the addition of CV (E a = 46.29) is higher than that of without the inhibitor (E a = 37.29).This result suggests that the addition of the corrosion inhibitor increases the energy barrier of the corrosion reaction, inhibiting the occurrence of the reaction.Generally speaking, the higher the barrier, the less likely the reaction is to proceed [18].Therefore, it can be seen that the addition of CV effectively inhibits the corrosion of carbon steel.
Materials 2024, 17, x FOR PEER REVIEW 10 of 20 the addition of the corrosion inhibitor increases the energy barrier of the corrosion reaction, inhibiting the occurrence of the reaction.Generally speaking, the higher the barrier, the less likely the reaction is to proceed [18].Therefore, it can be seen that the addition of CV effectively inhibits the corrosion of carbon steel.The surface morphology of samples exposed to the corrosion medium at 40 °C with or without 100 ppm inhibitors is presented in Figure 6.It is evident that significant nonuniform corrosion is observed on the uninhibited sample, with a large amount of corro-

Surface Morphology
The surface morphology of samples exposed to the corrosion medium at 40 • C with or without 100 ppm inhibitors is presented in Figure 6.It is evident that significant nonuniform corrosion is observed on the uninhibited sample, with a large amount of corrosion products (Figure 6a).For the system added with the corrosion inhibitor, a certain degree of corrosion can be observed.It is evident that CV performs better than MG, which in turn is superior to FB in terms of corrosion inhibition.Numerous crystals are present on the surface of CV-treated specimens due to the direct drying treatment of the sample surface after removal, which are attributed to sodium chloride crystals.In the presence of CV, the fine scratches produced during the grinding process can still be observed on the specimen surface, possibly indicating that CV exhibits the best corrosion inhibition performance [39].

XPS Analysis
Figure 7 presents the XPS spectra of the sample after immersion in the CO 2 -saturated 5% NaCl corrosion without or with 100 ppm CV at 40 • C for 72 h.The full spectrum of XPS (Figure 7a) indicates the presence of C, O, N, and Fe elements.The elements of C, O, and Fe are present as expected; however, an increased amount of N is attributed to CV adsorbed on the surface of the sample.The high-resolution XPS spectra for C 1s, N 1s, O 1s, and Fe 2p, as well as the bonding configurations for each peak, are displayed in Figure 7b-e.The C 1s spectrum (Figure 7b) can be deconvoluted into peaks at 284.7, 286.6, and 288.2 eV, corresponding to C-C, C=O, and FeCO 3 , respectively [40].For the N 1s spectrum (Figure 7c), the peak at 399.1 eV is attributed to the C-N in the corrosion inhibitor molecule, while the peak at 399.9 eV corresponds to N-Fe [41,42].The O 1s spectrum features three peaks at 530.2, 531.9, and 532.7 eV, which are assigned to FeO, C=O, and CO 3 2− , respectively [43,44].In the Fe 2p spectrum, two typical Fe2p1/2 and Fe 2p3/2 peaks are observed at binding energies of 725.0 eV and 709.3 eV, respectively.According to previous studies referenced in the literature [40, 45,46], the peak located at 709.3 eV of Fe 2p3/2 is assigned to FeCO 3 .Additionally, satellite features associated with iron are present at binding energies of 719.1 eV and 733.2 eV.Furthermore, the Fe2p1/2 spectral feature at 725.0 eV is associated with the presence of FeO(H 2 O) [47].Therefore, the XPS analysis confirms that CV has been successfully adsorbed onto the carbon steel surface.

CLSM Analysis
Figure 8 presents three-dimensional images of the L360N carbon steel with and without CV after being exposed for 72 in the CO2-saturated 5% NaCl solution environment.It is observed from Figure 8a-c that L360N surfaces are significantly compromised, with 3D imagery highlighting "mountain peak"-shaped corrosive deposits adorning the metal surface without any corrosion inhibitor.In contrast, Figure 8d-f display a markedly smoother and more homogenous surface, with only minor depressions and pits in morphology.This

CLSM Analysis
Figure 8 presents three-dimensional images of the L360N carbon steel with and without CV after being exposed for 72 in the CO 2 -saturated 5% NaCl solution environment.It is observed from Figure 8a-c that L360N surfaces are significantly compromised, with 3D imagery highlighting "mountain peak"-shaped corrosive deposits adorning the metal surface without any corrosion inhibitor.In contrast, Figure 8d-f display a markedly smoother and more homogenous surface, with only minor depressions and pits in morphology.This improvement is attributed to the inclusion of 100 mg/L CV, which appears to greatly slow the corrosion process.
Materials 2024, 17, x FOR PEER REVIEW 14 of 20 perpendicular to it.A higher Str value indicates that the surface texture elements (such as scratches and grooves) are more pronounced in the principal texture direction.This indicates that the corrosion of carbon steel in the CO2-saturated 5% NaCl solution is very severe and that the addition of CV can significantly mitigate the impact of this corrosion.

Quantum Chemical Calculations
Figure 9 presents optimized molecular structures of the inhibitors and their LUMO and HOMO distribution.HOMO and LUMO can determine the capacity of the molecule to accept electrons and provide electrons, respectively.The HOMO and LUMO distribution of three dyes are similar and around the benzene ring and N atoms, indicating that these structures can provide electrons to Fe atoms and can accept electrons from the Fe atoms.In addition, the values of EHOMO, E LUMO, and ΔE for MG, MV, and FB are shown in Figure 9.Typically, a higher EHOMO value indicates more reactive electrons within the bonding orbitals and an enhanced capability of the corrosion inhibitor molecules to donate electron pairs.Conversely, a smaller ELUMO value signifies a reduction in the system's energy following the transfer of electron pairs to the bonding orbitals, facilitating the acceptance of electrons by the corrosion inhibitor [50].The highest EHOMO (−5.671 eV) of CV surpasses those of MG and FB, which are −5.752eV and −5.805 eV, respectively, signifying a superior electron-donating characteristic for CV.Furthermore, the ELUMO of MG at −3.214 eV is lower than that of CV at −2.977 eV and FB at −2.945 eV, indicating that MG possesses a more pronounced electron-accepting capability.It is clear that all dye molecules have positive ΔE values, which suggests that triphenylmethane Table 5 catalogs various parameters such as the arithmetic mean height (S a ), maximum height (S z ), texture aspect ratio (S tr ), arithmetic mean peak curvature (S pc ), and developed interfacial area ratio (S dr ).From the surface roughness, we can more intuitively see that the roughness without the inhibitor (0.929 µm) is significantly higher than that with the inhibitor (0.277 µm) [48,49].At the same time, for the sample with CV added, its other three-dimensional profile parameters are also much lower than those of the steel sample without the corrosion inhibitor except for S tr .The S tr parameter represents the ratio of the size of the surface texture in the principal texture direction to the size in the direction perpendicular to it.A higher S tr value indicates that the surface texture elements (such as scratches and grooves) are more pronounced in the principal texture direction.This indicates that the corrosion of carbon steel in the CO 2 -saturated 5% NaCl solution is very severe and that the addition of CV can significantly mitigate the impact of this corrosion.The van der Waals (vdW) ESP distribution is usually used to predict electrophi nucleophilic reaction sites [22], and the ESP distribution of three dyes are present in 9.The red and blue surfaces illustrate the positively and negatively charged regions, tively.The orange and cyan spheres indicate the maxima and minima of the ESP respectively.These structures, near the extreme points of ESP, are the most likely s chemical reaction.As can be seen in Figure 9, many extreme points are distributed a the benzene ring and N atoms, which indicates that the two regions are more incline sites of electrophilic or nucleophilic reactions for dye molecules with Fe atoms [1].

MD Simulation
The interaction between the dye molecules and Fe surface is demonstrated by t simulation to further clarify the adsorption mechanism.Figure 10 shows the side a views of dye adsorption configurations on the Fe (110)/H2O interface system.From 10, dyes are adsorbed onto the metal surface in place of water, which creates a ba prevent corrosion.All dyes are absorbed almost parallel to the surface of Fe from view.According to Mulliken charges, electrons of the dye molecules' N atom and ar The van der Waals (vdW) ESP distribution is usually used to predict electrophilic and nucleophilic reaction sites [22], and the ESP distribution of three dyes are present in Figure 9.The red and blue surfaces illustrate the positively and negatively charged regions, respectively.The orange and cyan spheres indicate the maxima and minima of the ESP points, respectively.These structures, near the extreme points of ESP, are the most likely sites for chemical reaction.As can be seen in Figure 9, many extreme points are distributed around the benzene ring and N atoms, which indicates that the two regions are more inclined to be sites of electrophilic or nucleophilic reactions for dye molecules with Fe atoms [1].

MD Simulation
The interaction between the dye molecules and Fe surface is demonstrated by the MD simulation to further clarify the adsorption mechanism.Figure 10 shows the side and top views of dye adsorption configurations on the Fe (110)/H 2 O interface system.From Figure 10, dyes are adsorbed onto the metal surface in place of water, which creates a barrier to prevent corrosion.All dyes are absorbed almost parallel to the surface of Fe from the top view.According to Mulliken charges, electrons of the dye molecules' N atom and aromatic ring are shared with Fe to create dative bonds through chemical adsorption [51].Compared to Figure 10, the CV molecule is most parallel to the iron surface, which makes it highly effective at preventing corrosion.Table 6 displays    Despite the abundance of research focused on the corrosion inhibition properties of dyes, there has been relatively scant attention paid to a detailed examination of their underlying inhibition mechanisms [12].Based on the experimental and theoretical calcula-

Inhibition Mechanism of Triphenylmethane Dyes
Despite the abundance of research focused on the corrosion inhibition properties of dyes, there has been relatively scant attention paid to a detailed examination of their underlying inhibition mechanisms [12].Based on the experimental and theoretical calculation results, a possible adsorption mechanism for triphenylmethane dyes is proposed.The corrosive solution is saturated with carbon dioxide containing 5% NaCl, and it is rich in species such as H 2 O, HCO 3 − , CO 2 , H 2 CO 3 , and Cl − (Figure 11), which can severely corrode the surface of carbon steel.The anodic process involves the dissolution of Fe, while the cathodic process involves the reduction of H + and H 2 CO 3 [1,43].Upon the addition of the dye, surface analysis through XPS and theoretical calculations suggests that the dye can adsorb onto the steel surface both physically and chemically.The inhibition mechanism encompasses a dual strategy involving both physical adsorption (through electrostatic attraction) and chemical adsorption (involving the sharing of electron density), as depicted in Figure 11.In the electrolyte solution, this orientation of negatively charged Cl − toward the solution interface promotes the physical adsorption of N + in the dye molecule [51].As for chemisorption, it is proposed that the inhibitors adhere to the surface through the interaction between the lone pairs of electrons on the N atom or the π-electrons from the aromatic benzene ring in the dye molecule with the unoccupied d-orbitals of iron atoms [28].CV exhibits the best adsorption effect, attributed to its multiple electron-donating groups, which enhance the electron-donating capability of its benzene rings.for chemisorption, it is proposed that the inhibitors adhere to the surface through the interaction between the lone pairs of electrons on the N atom or the π-electrons from the aromatic benzene ring in the dye molecule with the unoccupied d-orbitals of iron atoms [28].CV exhibits the best adsorption effect, attributed to its multiple electron-donating groups, which enhance the electron-donating capability of its benzene rings.

Conclusions
In conclusion, our investigation demonstrates that among the triphenylmethane dyes studied as corrosion inhibitors for L360N carbon steel in the CO2-saturated 5% NaCl corrosion medium, CV exhibits the most effective corrosion inhibition for carbon steel, outperforming MG and FB.Electrochemical assessments clearly categorize CV as a mixedtype corrosion inhibitor, which conforms to the Langmuir adsorption isotherm, suggesting a combination of physical and chemical adsorption mechanisms.Surface analysis techniques including SEM, XPS, and CLMS have validated the substantial improvement in the corrosion resistance of carbon steel in the presence of CV.Furthermore, quantum chemical calculations and molecular dynamics simulations have provided insight at the molecular level to understand the inhibitors on the surface of carbon steel, affirming the primary adsorption sites, adsorption behavior, and adsorption energies of dyes.This research offers a strong foundation for the application of triphenylmethane dyes as effective corrosion inhibitors in relevant industrial settings.

Figure 2 .
Figure 2. The equivalent circuit models used for fitting the EIS data: (a) in the absence of inhibitor, (b) in the presence of inhibitor.

Figure 2 .
Figure 2. The equivalent circuit models used for fitting the EIS data: (a) in the absence of inhibitor, (b) in the presence of inhibitor.

Figure 4 .
Figure 4. Inhibition efficiencies of L360N carbon steel in the CO2−saturated 5% NaCl corrosion medium with different concentrations of CV at 40 °C.

Figure 4 .
Figure 4. Inhibition efficiencies of L360N carbon steel in the CO 2 −saturated 5% NaCl corrosion medium with different concentrations of CV at 40 • C.

Figure 5 .
Figure 5. Arrhenius plots of L360N carbon steel in the CO2−saturated 5% NaCl corrosion medium with and without 150 ppm inhibitor of MV at 40 °C.

Figure 5 .
Figure 5. Arrhenius plots of L360N carbon steel in the CO 2 −saturated 5% NaCl corrosion medium with and without 150 ppm inhibitor of MV at 40 • C.

Figure 8 .
Figure 8. Three-dimensional image and height distribution map of L360N carbon steel obtained by CLSM test in the CO2-saturated 5% NaCl corrosion medium at 40 °C for 72 h: (a-c) without inhibitor; (d−f) with 100 ppm CV.

Figure 8 .
Figure 8. Three-dimensional image and height distribution map of L360N carbon steel obtained by CLSM test in the CO 2 -saturated 5% NaCl corrosion medium at 40 • C for 72 h: (a-c) without inhibitor; (d-f) with 100 ppm CV.

Figure 9
Figure 9 presents optimized molecular structures of the inhibitors and their LUMO and HOMO distribution.HOMO and LUMO can determine the capacity of the molecule to accept electrons and provide electrons, respectively.The HOMO and LUMO distribution of three dyes are similar and around the benzene ring and N atoms, indicating that these structures can provide electrons to Fe atoms and can accept electrons from the Fe atoms.In addition, the values of EHOMO, E LUMO, and ∆E for MG, MV, and FB are shown in Figure 9.Typically, a higher EHOMO value indicates more reactive electrons within the bonding orbitals and an enhanced capability of the corrosion inhibitor molecules to donate electron pairs.Conversely, a smaller ELUMO value signifies a reduction in the system's energy following the transfer of electron pairs to the bonding orbitals, facilitating the acceptance of electrons by the corrosion inhibitor [50].The highest EHOMO (−5.671 eV) of CV surpasses those of MG and FB, which are −5.752eV and −5.805 eV, respectively, signifying a superior electron-donating characteristic for CV.Furthermore, the ELUMO of MG at −3.214 eV is lower than that of CV at −2.977 eV and FB at −2.945 eV, indicating that MG possesses a more pronounced electron-accepting capability.It is clear that all dye molecules have positive ∆E values, which suggests that triphenylmethane dyes could donate π-electrons or lone pair electrons to the iron atoms.The smallest energy gap ∆E of MG indicates that it forms chemical bonds more easily in the adsorption process [40].Materials 2024, 17, x FOR PEER REVIEW

Figure 9 .
Figure 9.The obtained optimized structure, HOMO, LUMO, and electrostatic potential ma of three dyes by DFT.

Figure 9 .
Figure 9.The obtained optimized structure, HOMO, LUMO, and electrostatic potential map (ESP) of three dyes by DFT.
the data for the adsorption locator's outputs and descriptor.The obtained Eads values are −187.447,−215.611, and −163.795kcal/mol for MG, CV, and FB, respectively.The negative value for Eads indicates that the inhibitors' adsorption on the surface of Fe is spontaneous adsorption [40].The largest negative adsorption energy value of CV compared to other dyes shows that it exhibits a strong interaction by the Fe surface, which further explains its dominant role in preventing corrosion.Materials 2024, 17, x FOR PEER REVIEW 16 of 20

Figure 10 .
Figure 10.Side and top views of equilibrium adsorption configuration of the three adsorbed dye molecules onto the Fe (110) surface.

Figure 10 .
Figure 10.Side and top views of equilibrium adsorption configuration of the three adsorbed dye molecules onto the Fe (110) surface.

Figure 11 .
Figure 11.Schematic representation for corrosion inhibition mechanism of CV on L360N carbon steel.

Figure 11 .
Figure 11.Schematic representation for corrosion inhibition mechanism of CV on L360N carbon steel.
investigation demonstrates that among the triphenylmethane dyes studied as corrosion inhibitors for L360N carbon steel in the CO 2 -saturated 5% NaCl corrosion medium, CV exhibits the most effective corrosion inhibition for carbon steel, outperforming MG and FB.Electrochemical assessments clearly categorize CV as a mixed-type corrosion inhibitor, which conforms to the Langmuir adsorption isotherm, suggesting a combination of physical and chemical adsorption mechanisms.Surface analysis techniques including SEM, XPS, and CLMS have validated the substantial improvement in the corrosion resistance of carbon steel in the presence of CV.Furthermore, quantum chemical calculations and molecular dynamics simulations have provided insight at the molecular level to understand the inhibitors on the surface of carbon steel, affirming the primary

Table 1 .
Weight loss measurements for L360N carbon steel exposed to CO 2 -saturated NaCl corrosion medium at 40 • C.

Table 2 .
Fitted electrochemical parameters deduced from polarization curves for L360N carbon steel in the CO 2 -saturated 5% NaCl corrosion medium with different concentrations of CV at 40 • C.

Table 2 .
Fitted electrochemical parameters deduced from polarization curves for L360N carbon steel in the CO2-saturated 5% NaCl corrosion medium with different concentrations of CV at 40 °C.

Table 3 .
The inhibition efficiencies of studied dyes and other dyes reported in the literature.

Table 3 .
The inhibition efficiencies of studied dyes and other dyes reported in the literature.

Table 4 .
Thermodynamic parameters of CV exposed to CO 2 -saturated NaCl corrosion medium at 40 • C (313.15 K).

Table 5 .
Surface roughness parameters of CLSM images for L360N carbon steel without and with 100 ppm CV in the CO2-saturated 5% NaCl corrosion medium at 40 °C for 72 h.

Table 5 .
Surface roughness parameters of CLSM images for L360N carbon steel without and with 100 ppm CV in the CO 2 -saturated 5% NaCl corrosion medium at 40 • C for 72 h.

Table 6 .
Outputs and descriptors calculated from MD simulations for dyes on Fe (110)/H2O system.

Table 6 .
Outputs and descriptors calculated from MD simulations for dyes on Fe (110)/H 2 O system.