Introduction

In recent years, freshwater consumption has experienced a surge due to advancements in technology and rapid population growth (Khamis et al. 2020; Muniyandi and Govindaraj 2021). This has led to the generation of substantial volumes of wastewater that necessitates direct disposal into natural habitats. In addition, water pollution from various sources such as dyes, heavy metals, antibiotics, chelating agents, and insecticides generates different types of wastewater, posing a significant threat to the environment and human life (Liu et al. 2022; Jjagwe et al. 2021; Wang et al. 2020).

Wastewater treatment related to the oil industry, organic effluents, such as benzene, toluene, cyclohexane (Fan et al. 2022), oily wastewater (Ma et al. 2021), oil/water mixtures (Lu et al. 2022), and aqueous solutions containing fluoride, is always challenging (Jian et al. 2022 Jian et al. 2022).

In the meantime, dye wastewater from the textile industry with high organic content, difficult degradation, and deep chroma, has a detrimental impact not only on the environment but also on the health of human life and causes many cancers, allergies, and mutations (Liu et al. 2022; Li et al. 2019; Sherugar et al. 2022).

Consequently, the ability to effectively remove these pollutants from wastewater becomes crucial for safeguarding both human health and the environment. Cationic dyes including methylene blue (MtlB), malachite green (MalG), and crystal violet (CryV), were widely used in veterinary medicine, bacteriostatic agents, colorants, and biological stains (Xue et al. 2024; Ibrahim et al. 2022). These dye molecules are teratogenic and toxic, resistant to degradation in the natural environment, and will pose a great threat to human health and the ecological environment (Lu et al. 2023). The acid dyes, such as acid blue, acid red, acid yellow, direct violet, and reactive red, contain the azo group (-N=N-) and aromatic rings in their chemical structure, making them anionic dyes. Due to the presence of amino groups and complex aromatic rings, these dyes are difficult to biodegrade (Mehdi et al. 2022). Alizarin Red S (ARS) has been widely used for dyeing textiles (Rehman et al. 2011; Moulya et al. 2024).

Due to its optical, high thermal, and physicochemical stability, it resists degradation and thereby cannot be removed by conventional processes (Gholivand et al. 2015). Hence, remediation techniques for their economic and safe removal on simple, easy, and highly efficient processes are concentrated (Machado et al. 2016).

It is an anionic dye, specifically a water-soluble anthraquinone dye known as 1, 2-dihydroxy-9,10-anthraquinone sulfonic acid sodium salt (Veni et al. 2024).

It is noteworthy that ARS is considered the most hazardous dye, associated with various adverse effects such as skin and eye irritation upon contact and a potential cancer hazard. Consequently, it is imperative to eliminate this dye from industrial wastewater due to its severe impact on health and the environment (Nachiyar et al. 2023).

Rhodamine B (RhB) and Rhodamine 6G (R6G) are both derivatives of xanthene dyes and are commonly used in fluorescent labeling, textiles, paper, and printing due to their vibrant pink color. However, both compounds are generally toxic and can lead to allergies, asthma, skin irritation, and respiratory tract irritation. As a result, the use of RhB and R6G in food products is strictly prohibited (Chao et al. 2020). M.-U.-N. Khilji et al. used MgO@GO nanocomposite for Rhodamine 6G degradation (Nahyoon et al. 2023). Various methods have been developed for treating wastewater contaminated with dyes, including the use of photodegradation (Yaacob et al. 2021), membrane technology (Jian et al. 2022; Ding et al. 2022), photocatalysis (Aziz et al. 2022), and photothermal conversion (Li et al. 2022). These methods can eliminate or break down the organic pollutants and dyes in wastewater. Nonetheless, these techniques face limited adoption due to their high costs, economic disadvantages, and the generation of secondary waste. Among accessible techniques, adsorption has been extensively considered as a technique for removing dye due to its high efficiency, low cost, simplicity, and ease of operation (Borthakur et al. 2016; Ayati et al. 2016; Hou et al. 2022; Nassar et al. 2022). These adsorbents include activated carbon, biomass, zeolites, hydrogels, COFs, MOFs, etc. (Xue et al. 2024).

Covalent organic frameworks (COFs) exhibit molecular ordering and inherent porosity, coupled with robust stability across a broad spectrum of conditions. Recently recognized as versatile platforms, COFs have emerged for diverse applications, including gas storage, heterogeneous catalysis, and adsorption (Wang et al. 2020; Zeng et al. 2016; Guan et al. 2018; Lu et al. 2022; Zhong et al. 2021; Yue et al. 2021). Organic building blocks are connected by covalent bonds (by linkers) and COFs are synthesized (Cote et al. 2005; Lyle et al. 2019; Jiang et al. 2016). COFs are in the category of porous and crystalline polymer materials, which have numerous uses, including: gas storage, chemosensing, ion exchange, separation, heterogeneous catalysis, sensing, and transport (Wang et al. 2019; Das et al. 2015; Furukawa and Yaghi 2009; Ding et al. 2016; Kandambeth et al. 2018; Sasmal et al. 2022). The reticular structure and modular property of COFs are promising for the synthesis of arbitrary porous building blocks with different and diverse functions (Alahakoon et al. 2020; Gao et al. 2020; Karak et al. 2018; Jin et al. 2022; Kang et al. 2020).

Their promising performance is attributed, in part, to the ease with which they can be carefully tuned during the preparation of their organic constituents. The relatively mild synthesis conditions necessary for the final COF material contribute to their advantageous properties. Despite the potential benefits stemming from structural diversity and high-yielding synthesis (Xu et al. 2016; Vyas et al. 2016; Pang et al. 2016; Nguyen et al. 2016; Ma et al. 2016; Lohse et al. 2016; Huang et al. 2016; Dalapati et al. 2016; Ascherl et al. 2016), COFs have been specifically explored for their effectiveness in the adsorption of dyes from aqueous media (Liu et al. 2012).

Today, COFs are receiving attention due to their physicochemical properties (Cui et al. 2016), high design flexibility (Kong et al. 2021), high specific surface areas (Chen et al. 2021), nanoporous structure, mechanical robustness (Dey et al. 2021), well-proportioned cavities (Choudhury and Kalamdhad 2021), low densities excellent solvent, and thermal stabilities (Qi et al. 2021). Shang et al. explored the adsorption process of three types of nanoplastics, including polyethylene terephthalate, nylon-6, and polyethylene on the COF (TpPa-X, X = CH3, F, NO2, H, and OH) by the molecular dynamic (MD) simulations. Their results showed that COF polymers at the atomic level have the potential to develop effective COF materials to combat nanoplastic (NP) pollution (Shang et al. 2022). Ghahari et al. used a covalent organic framework to adsorb and reduce phenol compounds from water&wastewater. The study confirmed that COFs have the potential to be used as adsorbents for removing phenol from water and wastewater (Ghahari et al. 2022). Ali et al proposed COF-based lamellar membranes for desalination of water. They explained how COF materials could be used for exchange and separation applications, such as desalination (Ali et al. 2023).

Jatoi et al. PEGylated graphene oxide lamellar membranes were introduced for organic solvent removal. Their studies confirmed the successful removal of organic solvents such as methanol, acetone, hexane, etc. (Jatoi et al. 2023). Ali et al. designed functionalized graphene oxide-based (FGO-based) lamellar membranes with tunable channels for ionic and molecular separation (Ali et al. 2022). Xue et al. explored the spiroborate-based three-dimensional COF for effective adsorption and separation of organic dyes (cationic dyes; (MtlB), (CryV), and (MalG), as well as anionic dyes; fluorescein sodium (FluS), methyl orange (MtyO), and methyl blue (MtyB)) (Xue et al. 2024).

Xue et al. also examined the functionalization, valency design, and various applications of 3D COFs, including 1. gas adsorption (hydrogen storage, CO2 capture, methane storage, acetylene storage), 2. gas separation (hydrogen separation, carbon dioxide separation, acetylene and ethylene separation), 3. adsorption and separation in the liquid phase (adsorption of organic pollutants, ion sieving, macromolecule separation, chromatography separation, drug delivery), 4. catalysis (heterogeneous catalysis, photocatalysis, electrocatalyst), 5. external stimulus response, 6. ionic and electronic conduction (electronic conduction, ionic conduction and electrolytes), 7. energy storage devices (solar cells, supercapacitors, lithium metal batteries), which is a testament to the importance of COFs (Xue et al. 2024).

Chen et al. studied a 2D sulfonate anionic COF membrane, finding it effective for removing cationic organic pollutants from the environment. They also found that the high porosity of the COF membrane could make it a candidate for nanofiltration and separation of some organic pollutants (Chen et al. 2021). Tong et al. designed a few-layered 2D-COF nanofilter/membranes and investigated their CO2&N2 separation performance via MD simulations (Tong et al. 2016). The results also showed that various few-layered 2D-COF membranes can be made for a variety of separations and even molecular sieves. Zhan et al. designed a series of 2D functional COF membranes for reducing salt in water and the influential factors of water permeance (Zhang et al. 2017).

This work focuses on the adsorptive removal process of alizarin (ALI) dye and its derivatives, including Alizarin blue (ABL), Alizarin purpurin (APU), Quinalizarin (AQU), Alizarin cyanin (ACY), and Alizarin Red S (ARS) from water and wastewater using COFs as porous super absorbents. So, in this study, we for the first time used classical simulation to examine the adsorption mechanisms of alizarin dye and its derivative pollutants on well-established COFs.

Electrostatic (elec) and van der Waals (vdW) interactions are responsible for adsorbing dye pollutants on COFs. To analyze the penetration of dye on COF nanomaterial, various parameters including radial distribution function (RDF) and diffusion coefficient (DC) of the dye are analyzed for all simulated systems.

Among all the simulated systems, the metadynamics simulation technique was performed for the APU-COF1 and AQU-COF2 systems, which both of them have the highest adsorption energy. The obtained results confirm that COFs have a high potential in the removal of environmental pollutants, especially water and wastewater. In summary, we first investigate the mechanism of dye adsorption on COFs; next, we compared the ability of two types of COFs to attract alizarin dye and its derivatives. Finally, we propose the best COFs most efficiently remove alizarin dye and its derivatives.

Results and discussion

MD simulation

In this work, the COF1 and COF2 structures are designed in five layers, including 1320 and 1560 atoms, respectively, via using the GaussView software. Inspired by the work of Jiang et al. the distance between the layers was determined to be about 3.4 angstroms (Jiang et al. 2020). In addition, to investigate the adsorption process of alizarin dye and its derivatives, including alizarin blue, alizarin purpurin, quinalizarin, alizarin cyanin, and alizarin red S by two COFs (COF1&COF2), we designed a total of 12 simulation systems. Structures of two COF nanostructure (COF1&COF2) and dye molecules are presented in Fig. 1a and b. Snapshots of the configurations of the dye-COF complexes at the initial are presented in Fig. 2 and supplementary Fig. S1 and Fig. S2 also; final simulation times are shown in Fig. 3 and supplementary Fig. S3 and Fig. S4. As shown in these figures, the molecules of dye move to create a more parallel arrangement; in this orientation, they can have more π-π interactions with a substrate surface. It is clear that dye molecules, containing three benzene rings, form strong π-π stacking interactions with the surface of COFs.

Fig. 1
figure 1

The structures of a dye molecules (1, ABL; 2, ACY; 3, ALI; 4, APU; 5, AQU; 6, ARS), b COF1&COF2 nanostructures, respectively (color code: O, red; N, blue; S, yellow; C, cyan; H, white)

Fig. 2
figure 2

Snapshots of the configurations of the dye-COF complexes at the initial simulation times (a, ABL/COF1; b, AQU/COF2). Water and ions molecules are not shown for clarity

Fig. 3
figure 3

Snapshots of the configurations of the dye-COF complexes; at the final simulation times (a, APU/COF1; b, ACY/COF1; c, AQU/COF2; d, ARS/COF2). Water and ions molecules are not shown for clarity

Moreover, the inter-molecular interactions between dye molecules and the adsorbent surfaces at a distance of ~0.25–0.39 nm were observed. In summary, in all 12 systems, the contaminants are relocated from an aqueous phase to the adsorbent surface in the adsorption process (see Figs. 4 and 5). The values of Lennard-Jones (van der Waals), Coulombic (electrostatic), and total energies are given in Table ST1.

Fig. 4
figure 4

The total interaction energy of dye molecules, on the COF1 nanostructure during 120 ns time of simulation

Fig. 5
figure 5

The total interaction energy of dye molecules, on the COF2 nanostructure during 120 ns time of simulation

Looking at the data in Table ST1, we notice that in all systems, the Lennard-Jose and electrostatic energies decrease during the simulation time, although the value of the electrostatic energy is lower compared to the van der Waals energy; therefore, the Lennard-Jones energy has a major contribution to the total interaction energy. The adsorption energy values indicate a stronger interaction of alizarin purpurin dye with COF1 than other complexes, which confirms that the COF1substrate has a more tendency for the capture of alizarin purpurin dye than the other dyes, whereas, according to the obtained results, the tendency of the COF2 substrate for the removal of quinalizarin dye is more than the others. At the initial of the simulation times, both L-J and elec interaction energies are zero, which is because the dye molecules are adequately far from the adsorbent surface (at a distance of ~2 nm). Figures 4 and 5 show the variations of total interaction energy (LJ&CUL) between dye molecules and COFs versus time of simulation. After approximately 25 nanoseconds, dye molecules quickly adsorb onto COFs and then fluctuate around the overall interaction energy average, as shown in these figures.

The most interaction energy average is about −600 kJ/mol and −450 kJ/mol for APU/COF1 and AQU/COF2 complexes, respectively. This fact confirms the high kinetics of dye molecules' adsorption onto COFs. Also, the obtained results from Figs. 4 and 5 confirm the better efficiency of the COF1 adsorbent in removing dye molecules compared to the COF2 adsorbent. This fact is probably due to the presence of sulfonic groups, which increases the steric hindrance in the COF2 substrate and, subsequently, its π-π stacking interactions with the dye molecules reduce.

To investigate the interaction modality between dye molecules and two substrates, the RDF analysis between dye–COFs (D–C) and dye–water (D–W) is carried out, and obtained results are presented in Fig. 6a and b. Based on the obtained RDF results, it is evident that the most intense peak observed at a distance of 0.46-0.56 nm. This aligns with the reported π–π distances in the conjugated complexes (An et al. 2012). In other words, the probability of finding dye molecules at ~0.5 nm distance from the substrate surface is the highest, which can be attributed to the strong attraction forces between adsorbate molecules and the substrate. As depicted in Fig. 6a and b, the height of the RDF peak for the APU-COF1 and AQU-COF2 complexes is the most, while for the ACY-COF1 and ARS-COF2 complexes is the least. In complexes containing COF1 (system 1), the strongest RDF peak is observed at a distance of around 0.45 nm with a g(r) value of 10; meanwhile, in complexes containing COF2 (system 2), the location of the most intense peak is roughly the same with the system 1, but its g(r) value is 8. This suggests that the COF1 substrate removes Alizarin dye and its derivatives better than the COF2 substrate. All these properly properties in system 1, including stronger attraction forces and higher efficiency in dye removal, are probably due to more π-π stacking interactions between dye molecules and COFs nanostructure, while in system 2, due to the steric hindrance of sulfonic groups, the efficiency of the adsorption process decreases. The mobility of a molecule can be estimated by analyzing the mean-square displacement (MSD) and self-diffusion coefficient (Di) (Benkhaya et al. 2021).

Fig. 6
figure 6

Radial distribution functions of dye molecules, around the COF1&COF2 nanostructures surface during 120 ns time of simulation

The paper employs the "Einstein" relation to compute the diffusion coefficient (Cui et al. 2016). The slope of the mean-square displacement curve demonstrates the dye molecules' diffusion to the adsorbent surface. In other words, it examines the interaction of dye molecules with the COF surface in the 1 and 2 systems (Fig. 7a and b). The smaller slope in the mean-square displacement curves of dye molecules in the AQU-COF2 and APU-COF1 systems confirms that the adsorption of AQU and APU on the adsorbent surface restricts dye movement. In simpler terms, less movement of AQU and APU molecules means more adsorption onto the substrate. In general, the results showed that system 1 has a better performance than system 2 in removing dye molecules. This observation can be ascribed to electrostatic(cul), van der Waals (lj), π-π stacking interactions, and hydrogen bonds.

Fig. 7
figure 7

Time evolutions of MSD of COF1&COF2 nanostructures in the simulated systems

Metadynamics

The effectiveness of COFs nanostructures depends on their ability to adsorb and remove dye molecules from water and wastewater. Therefore, we have investigated the adsorption process of dye molecules on the COFs nanomaterial, through well-tempered metadynamics simulations. In this study, we examine how the free energy surface changes based on the distance between the center of mass of dye molecules and the COFs nanostructure in APU-COF1 and AQU-COF2 complexes. Figure 8a and b illustrates the free energy landscape for the dye molecules adsorption on the investigated COFs substrates. As depicted in Figure 8, when the dye molecules reach near the adsorbent surface, their free energy decreases, causing the global minimum to converge at -319 kJ/mol (d1=0.79 nm) and -260 kJ/mol (d1=1.98 nm for APU-COF1 and AQU-COF2 complexes, respectively). In simple terms, the free energy is set to zero when the dye molecules are positioned far from the COFs surface and whenever the free energy level decreases, the dye molecules become more near to the substrate surface as well as there is an energy barrier that prevents releasing of dye molecules from the COFs surfaces. This barrier has a height of approximately 210 kJ/mol and 15 kJ/mol for APU-COF1 and AQU-COF2 complexes, respectively. These findings are in good agreement with the obtained results from RDF in MD simulations.

Fig. 8
figure 8

The free energy landscape of the a APU molecules' adsorption onto COF1 and b APU molecules' adsorption onto COF2

The results of this study have validated that dye molecules face significant energy barriers during their desorption on the COF substrate. Therefore, using COF as an adsorbent is an effective way to purify polluted water sources. This research has great potential for practical applications in the field of water and wastewater purification.

Methods

MD simulations

To explore the potential of using COFs carriers for treating water and wastewater contaminated with alizarin dye and its derivative, we designed a total of 12 simulation boxes. COF1 is made up of a p-phenylenediamine (Pa) linker and 1,3,5-triformylphloroglucinol (Tp) building units (see Fig. 1b), while COF2 is composed of a p-phenylenediamine (Pa) linker and functionalized 1,3,5-triformylphloroglucinol (Tp) building units with -SO3H groups (see Fig. 1b) The COFs pores have a van der Waals diameter of 22.07 Å and are formed through robust covalent interactions (Wei et al. 2018).

The initial geometries of the COF structures are designed in five layers, including 1320 atoms for COF1 and 1560 atoms for COF2, respectively, via using the GaussView software, and the structures are optimized using the Gaussian 09 program (Frisch 2009).

Inspired by the work of Jiang et al. the distance between the layers was determined to be about 3.4 angstroms (Jiang et al. 2020). Additionally, the structural data file for dye molecules was obtained from the PubChem database (see Fig. 1a). Also, a simulation box with the dimension of 6 × 8 × 9 nm, containing five layers of the COFs, is designed at the center, and dye molecules are dissolved in TIP3P water model with a salinity of 0.01 M NaCl (Jorgensen et al. 1983). The dye molecule topology parameters and COFs were obtained from the SwissParam web server (available https://www.swissparam.ch/). Table ST2 provides additional details on the designed systems.

In order to avoid interaction between components and neighboring cells, the periodic boundary condition is used. The Particle Mesh Ewald method manages Lenard-Jones and non-bonded electrostatic interactions by implementing a cutoff of 1.4 nm. The pressure and temperature are maintained at 1 bar and 310 K by using the Parrinello–Rahman barostat (Podio-Guidugli 2010) and Nose-hoover thermostat (Leimkuhler et al. 2009), respectively. In the simulation, all bonds are constrained to their equilibrium length using the linear constraint solver algorithm (Hess et al. 1997). At first, in order to minimize any negative interactions, the simulation system is relaxed through energy minimization, accomplished with the steepest descent algorithm (Piche 1994). Finally, MD simulations are performed for 120 ns using the GROMACS software package version 2019.2 (Abraham et al. 2015) along with the CHARMM 36 force field (Huang et al. 2017). The Visual MD package is used to visualize the simulated products (Humphrey et al. 1996).

Metadynamics simulations

In order to obtain FE surfaces, we use well-tempered metadynamics simulations as a function of the set of CVs developed by Chrobak, W. et al (Chrobak et al. 2021). The WTMtD simulation was conducted over a period of 100 ns after the equilibration process, using the PLUMED version 2.5.2 plugin in the Gromacs 2019.2 software (Wang et al. 2022; Carvalho Martins et al. 2021). In the well-tempered metadynamics algorithm used in this study, the initial Gaussian height is set at 1.0 kJ mol-1, while the width is set at 0.25 A°. Additionally, a bias factor of 15 is deposited every 500 timesteps. The simulations were run for a duration of 100 ns on four systems. Overall, these metadynamic simulations provide a reliable estimate of the free energy landscape of COFs/dye systems. In other words, the FE surface can be computed as a function of the distance between the center of mass (COM) of dye molecules and the COFs nanostructure surface.

Conclusion

In this study, the mechanism of the dye molecules attraction process onto the surface of COFs is investigated. For this purpose, classical molecular dynamics and well-tempered metadynamics simulations are employed. Our results have shown that when a dye molecule adsorbed onto the adsorbent surface, the energy value of the dye-adsorbent average interaction reaches around −600 kJ/mol and −450 kJ/mol for dye/COF1 and dye/COF2 complexes, respectively. Moreover, when each dye molecule varies its initial position and becomes near the adsorbent surface, it creates a synergistic impact within the original dye-COFs complex. As a result of this synergy, the interaction energy is further reduced. The RDF analysis shows that for all of the investigated dyes, the probability of dye molecules' presence is the most at a distance of 0.46-0.56 nm from the substrate surface. This is in agreement with the reported π–π distances in the conjugated complexes. Our results confirm that the π-π interactions are the essential determining factor in the stability of dye-COF complexes. A metadynamic simulation has been performed to investigate the process of dye molecule adsorption onto the COFs nanostructure. The results of the metadynamics study indicate that there are energy barriers that prevent dye molecules from being adsorbed onto the nanostructure surface.