Introduction

Organic pollutants in water, especially persistent organic pollutants (POPs)1, have adverse effects on all living organisms due to their high toxicity2, long-term persistence3, high solubility4, and resistant to natural degradation3. One of these pollutants are dyes which are used in industries5 such as dyeing5, paper6, printing7, plastic8, leather9, and pharmaceutical industries10. Dumping the wastes of these industries in freshwater has harmful ecotoxicological effects and causes respiratory problems11, skin irritation12, itching, lung disease11 and increases the risk of cancer in humans13.

Colors consist of two components: color agent and color enhancer14. The dyeing agent imparts color to the water, while the color enhancer increases the solubility of the coloring agent and allows it to adhere to surfaces15. Many dyes are very stable to light and temperature, which slows down their degradation16. This long-term degradation cycle can make the natural degradation of paints challenging over time. Organic dyes such as methyl orange (MO)17, gentian violet (GV)18, cationic brilliant green (BG)19, tolonium chloride (TC)20, methylene blue (MB)21, anionic congo red (CR)22, and rhodamine B (Rh B)23, are common pollutants which widely used in industrials. These dyes are classified as biohazardous substances due to their high toxicity24, long-term persistence25 in the environment, mutation in DNA26, and carcinogenicity27. Among the mentioned dyes, methyl orange and Congo red have N = N groups in their structure that are known as azo dyes28,29,30, methylene blue is a thiazine dye31, and rhodamine B is a fluorescent dye32. Bright green color is used in various fields such as medicine and veterinary medicine33, but it shows high toxicity, especially in contact with skin and eyes, ingestion, and inhalation34. Gentian violet is a synthetic organic compound35 that is used in various industries like textiles36, cosmetics, and medicine. The high pollution of these colors has caused serious concerns for the environment and living organisms. Therefore, it is necessary to prevent their spread and remove them from polluted waters with effective methods37. Various strategies have been investigated for the removal of water pollutants, including adsorption38, membrane processes39, and photocatalytic degradation40. Among the mentioned methods, the adsorption of pollutants using covalent organic frameworks (COFs) has attracted much attention41,42,43,44. In 2005, Yaghi45 and his colleagues discovered COFs that belong to the category of crystalline porous materials and consist of lightweight elements linked by covalent bonds. These frameworks can take on a two-dimensional (2D) or three-dimensional (3D) structure46,47. 3D COFs featuring spatially periodic networks offer notable advantages compared to their 2D counterparts. These advantages include interconnected channels and more extensive exposure to active sites48. Due to their unique properties like the well-defined structure49, tunable pore sizes for the encapsulation of a diverse range of guest molecules50, excellent physical and chemical stability51, ease of functionalization52, thermal stability53, extensive internal surface areas for separation54, and catalytic processes55, show great potential as high-performance membranes for capturing and separating dye pollutants. In recent years, there has been extensive research into the realm of 3D COFs, uncovering their wide-ranging applications across diverse fields48. These include adsorption56, gas storage57, separations58, heterogeneous catalysis58, conductivity59, fluorescence60, chemical sensing61, and battery technology62. The capacity to meticulously engineer COFs with varying pore sizes and enhanced specific surface areas during both design and production underscores their potential. So, their inherent hydrophilic properties make them promising for desalination and extracting contaminants such as pharmaceuticals, dyes, pesticides, and pollutants. Despite the promising potential inherent in structural diversity and high-yielding synthesis, COFs have primarily been studied for their capacity to adsorb dyes from aqueous media48,63,64,65.

The unique characteristics of COFs arise from their layered structure, where covalent bonds connect repetitive units within each layer, and van der Waals interactions play a crucial role in binding these layers together66. Moreover, Attributes like surface charge and hydrophilicity significantly influence the performance of COFs. Ensuring the stability of COF materials when exposed to water is crucial for their effective utilization in water treatment39,67,68. Moreover, it is essential to explore various environmental factors, including reaction time and temperature69, to comprehensively understand the removal mechanism70. The adsorption phenomenon hinges on the interaction between the adsorbent and adsorption, making it crucial to delve into mechanistic details. Understanding these intricacies holds significant importance, as it plays a pivotal role in shaping the foundation for the development of future COFs materials. Therefore, various challenging factors such as designing COFs for aquatic applications present67 (e.g., COF stability in acidic71), modifying COFs’ pore size69, pollutant concentrations72, neutral73, basic environments74, material safety75, expensive building blocks55, recyclability and reusability76, and limited adsorption; thus, researchers should attempt to resolve all of these main challenges and limitations77. Up to now, only a few papers about the application of COF-based materials in environmental have been used and their adsorption mechanism for eliminating contaminants. For instance, Ghahari et al.41,78 designed a 2D covalent organic framework to explore its capacity for capturing and removing environmental pollutants. Also, polyimide-based covalent-organic frameworks through the condensation reaction of tris (4-aminophenyl) amine (TAPA) with pyromellitic dianhydride (PMDA) is synthesized and evaluated their practical application for the removal of MO and Rh B from industrial wastewater by ref. 79 Their results showed that the COFs are good candidates to serve as an efficient adsorbent for the removal of MB with high selectivity in the post-treatment of the dyeing process. Konavarapu et al.80 synthesized three triazene-based imine-functionalized covalent organic frameworks (COFs 1–3) for the removal of organic dye pollutants. Their result showed that the COFs can used as a promising adsorbent for removing anionic and cationic organic dye pollutants from aqueous solutions. In another work, Huo et al.81 prepared the COF with O-linked flexible 2, 4, 6-tris (p-formyl phenoxy)-1, 3, 5-triazine for removing methylene blue from wastewater. Their results illustrate that COF has highly adsorption capacity for stability in aqueous and functions as a robust adsorbent. In a similar vein, Razavi et al.42 investigated the Cu-BTC-metal-organic framework (MOF) to evaluate the interaction energy of dye pollutants with -NH2-MOF, -OH-MOF, and -NO2-MOF to remove Rh B pollutants in the wastewater. From these examples, it can be drawn out that COFs are an ideal platform for dye capture and pore structure modification can efficiently increase dye sorption capacity.

Herein, molecular dynamics (MD) and well-tempered metadynamics simulations are employed for investigating the adsorption affinity of a 3D COF TFPPy in removing seven different dyes contaminants (methyl orange, tolonium chloride, rhodamine b, methylene blue, brilliant green, Gentian violet cat, and congo red) in aquatic ecosystems. Furthermore, the well-tempered metadynamics is applied to analyze the free energy surface (FES) to adsorb pollutants on COF’s structure. Meanwhile, detailed analyses showed that MO/COFs and then GV/COFs systems exhibit the highest free energy, interaction energy, and adsorption affinity towards covalent organic frameworks. Hydrogen bond formation and van der Waals (vdW) forces were identified as the primary adsorption mechanisms. Therefore, the intriguing observation of the high selectivity exhibited by these 3D COFs toward dyes prompted us to delve into the underlying factors contributing to these exceptional performance characteristics.

Result and discussion

MD simulation

In this study, to investigate the adsorption capacity of COFs substrate toward seven different dye pollutants (MO, GV, BG, TC, MB, CR, and Rh B), MD simulations and a series of analyses on their outputs are performed. The analyses can provide detailed insight into the energy of interacting molecules, the spontaneity of the process, the distribution of dye molecules around the adsorbent, and the stability of the seven systems (Table 1): (1) COFs-MO; (2) COFs-GV; (3) COFs-BG; (4) COFs-TC; (5) COFs-MB; (6) COFs-CR and; (7) COFs-Rh B that have been designed and investigated.

Table 1 Detail of the simulation boxes used in this study

Our results reveal that an increasing number of dye pollutant molecules are adsorbed on the adsorbent surface during the simulation time (see Fig. 1 and Supplementary Fig. 1).

Fig. 1: The final snapshots of the dyes-COFs.
figure 1

Water molecules are not shown for clarity. a MO/COFs (b) GV/COFs (c) CR/COFs (d) Rh B/COFs. Water molecules are not shown for clarity.

A close inspection of the presented snapshots (Fig. 1) displays that almost all contaminant molecules are adsorbed in the inner cavity or outside the COFs surface. These results reveal that the dye molecules have a strong affinity towards the cavity of the COFs materials and its surface which leads to a strong interaction between the dye pollutants (DPs) and the three adjacent COFs layers. In the overall design of an effective water treatment system, it is crucial to consider both the availability of active sites and the size of the nanopores on the surface. In this regard, the distance between identical monomers in the COFs material is approximately 5.4 Å and 12.90 Å. The pore size of COFs is a crucial factor influencing the adsorption of dye molecules (and dyes sizes are about MB 12.4 Å, GV 12.1 Å, BG 11.6 Å, RH B 12.9 Å, TC 6.4 Å, BG 8.8 Å, MO 12.1 Å, CR 22.1 Å). Therefore, the studied three-dimensional COFs has a high adsorption capacity for pollutants, which can be attributed to their large surface area. To accurately assess the adsorption capacity of the selected COFs, further quantitative evaluations are necessary, which are elaborated upon below.

Interaction energies

To gain a better understanding of the DPs adsorption mechanism on COFs surfaces, the interaction energies are studied. Figure 2 shows the Lennard-Jones (L-J), electrostatic, and total energies for the adsorption process. The comparison among the total energy values of the investigated systems shows that the most interaction energy belongs to the MO/COFs and GV/COFs systems with values of −448.54 and −435.40, respectively.

Fig. 2
figure 2

The interaction energy between dye molecules and COFs.

It’s noteworthy to highlight that MO and GV dyes exhibit the highest affinity for interacting with COFs, underscoring that the adsorption of MO/GV dyes onto the adsorbent surface constrains their mobility. MO, characterized by a common azo-anionic group (-N = N-) linked to two substituted aromatic rings and the neutral form (R-SO3H), shares a distinctive structure82. Additionally, GV, a triphenylmethane dye with a robust aromatic molecular structure, features benzaldehyde or the azo group (R–N = N–R′)83. Consequently, the adsorption of GV/MO fosters OH-π interactions between benzene rings or active sites (–CHO group) on the COFs adsorbent surface. Notably, hydrogen bonding mechanisms, specifically X–Hπ (X = C, N, O; π = aromatic system) interactions, and the formation of π − π stacking interactions between the benzene ring of MO/GV and COFs enhance molecular rigidity, impeding their movement. It is noteworthy that, the outcomes substantiate that the adsorbent surface is well-suited for the adsorption of these dye molecules, with a robust electrostatic interaction formed between the adsorbent and MO/GV molecules. A close inspection of Fig. 2 indicates that the total interaction energy between COF and DPs have negative values in all studied systems, and they have the following order;

MO/COFs> GV/COFs> BG-COFs> TC-COFs> MB-COFs> CR-COFs> Rh B-COFs. Our findings reveal that the interactions gradually increase, and more dye molecules are adsorbed on the substrate with the passage of time. A detailed examination of the electrostatic and L-J energies shows that the L-J energy plays a crucial role in the interaction and total energy of COFs/dyes systems (see Fig. 2).

As shown in Fig. 2, the MO/COFs and GV/COFs systems had the most average number of adsorbed dye pollutants molecules at the end of the simulation. While the lowest average number of adsorbed drug molecules is related to the Rh B/COFs system. These findings are consistent with the depicted snapshots in Fig. 1.

Stability of systems

By examining the time-dependent root mean square deviation (RMSD) between the DPs and the COF, the stability of the investigated systems can be assessed. The RMSD diagrams demonstrate that all studied systems reached equilibrium after 100 ns (see Fig. 3). As depicted in Fig. 3, the RMSD curves of all systems display regular geometric fluctuations and the morphology of COFs remained stable throughout total simulation time, for all systems. It is noteworthy that the DPs cross a short path of 20 Å to reach a substrate with a large contact surface area and eventually adsorbed on the surface or diffuse within the cavity of the substrate. This feature enhances the stability and removal speed of pollutants in aquatic environments. Accordingly, it can be expected that this 3D COFs acts as an appropriate candidate for DPs removal.

Fig. 3: The RMSD of dye molecules and COFs systems.
figure 3

a Mo/COFs; b GV/COFs; c BG/COFs; d TC/COFs; e MB/COFs; f CR/COFs; g Rh B/COFs systems, respectively.

Dispersion of molecules in water

The interaction between molecules and their environment, including solvents, depends on the level of exposure to the solvent. In molecular dynamics simulations using solvent-accessible surface area (SASA) analysis, it is possible to investigate the contact area between different molecules, including MO/GV/BG/TC/MB/CR and Rh B DPs/COFs and the aqueous medium. SASA is an acronym for solvent accessible surface area, which is the surface area of a molecule that is available for interaction with a solvent. In this study, to determine contact areas between DPs and the solvent, SASA analysis is carried out that evaluates the capacity of COFs to offer suitable areas for DPs removal. It is expected that when DPs are less dispersed in water and more adsorbed on COFs, the average SASA value decreases. Upon careful examination of Supplementary Figure 2, it is evident that the hydrophobic SASA of all studied systems decreases over time throughout the simulation. The cause of this phenomenon is due to the rise in π-π interactions between DPs and the aromatic rings of the substrate. This results in a large build-up of DPs around the structure of COFs, leading to a reduction in the area of dye molecules that are accessible to the solvent.

The obtained results show the following trend for the accessible surface of the investigated systems with solvents: MO/COFs< GV/COFs< BGN/COFs< TC/COFs< MB/COFs< CR/COFs< Rh B/COFs.

The average hydrophobic solvent-accessible surface area values for MO/GV/BG/TC/MB/CR and Rh B-COFs are 32.402 nm2, 41.701 nm2, 53.51 nm2, 66.3 nm2, 73.39 nm2, 81.22 nm2, and 106.60 nm2, respectively. The least SASA value belongs to MO/COFs (32.402 nm2), and the highest SASA values observed for the Rh B-COFs (106.60 nm2), in comparison to the other dyes, confirm that the Rh B-COFs system has a larger surface area available for interaction with water molecules. A good agreement was also found between our experimental prediction and theoretical and experimental data by Wang, Khedri, Gao, Pande, and Adeleke et al.84,85,86,87,88.

Hydrogen bonds formation potential

The number of hydrogen bonds (n-HB) for all systems has been indicated in Fig. 4. It is clear that after the adsorption of DPs on the surface of COFs, the number of hydrogen bonds between the DPs and the surface of COFs increases. The active sites of the adsorbent are involved in the formation of hydrogen bonding with the dyes (MO, GV, BG, TC, etc.). According to both theoretical and experimental41,42,73,74 evidence, the presence of these HBs can increase substrate adsorption capacity and system stability. The active sites of the adsorbent are involved in the formation of hydrogen bonding with the dyes. Inspection of Fig. 4 shows the following order for the n-HB between COFs structure and Dyes: MO/COFs> GV/COFs > BGN/COFs> TC/COFs> MB/COFs> CR/COFs> Rh B/COFs. Therefore, the MO-COFs and Rh B-COFs systems have the most and least average number of hydrogen bonds, respectively. Notably, fewer hydrogen bonds in the COFs/Rh B system can be due to more formation of HB between the dye molecules and water. So, it can be concluded that the hydrogen bonding between DPs and the COFs surface can be the driving force for the adsorption of DPs on the surface of the COFs structure. However, our results show that van der Waals interactions have a more significant role than electrostatic interactions in the adsorptiontof the mentioned dye89,90,91,92,93,94,95.

Fig. 4: The number of hydrogen bonds.
figure 4

Against the simulation time between COFs and Dye molecules.

Mean square displacement (MSD)

Obtained results can be better presented through the mean squared displacement (MSD) calculations to gain the diffusion coefficient of organic dye pollutants, which can be calculated based on Eq. (1)

$${\rm{MSD}}({\rm{t}})=\frac{1}{N}\mathop{\sum }\limits_{n=1}^{N}\langle\, [xn\,({t})^{2}]{-xn({t}_{{\rm{o}}})}\left]\right.^{2}\rangle$$
(1)

Where N is the number of particles to be averaged, xn (t0) is the referenced position of each particle and xn (t) is the specific position of a particle at time.

Furthermore, the self-diffusion coefficient (Di) can be calculated using Einstein’s relation (Eq. 2).

$${{\rm{D}}}_{{\rm{i}}}=\frac{1}{6Nt}\mathop{\mathrm{lim}}\limits_{t\to \infty }\frac{d}{dt}\left\langle \mathop{\sum }\limits_{n=1}^{N} <\, [xn{(t)}^{2}]-xn({t}_{{\rm{o}}}){\left]\right.}^{2}\right\rangle$$
(2)

Where d/dt represents the slope of the MSD curve.

As seen in Fig. 5, the MSD curve for the MO/COFs system has a lower slope and less self-diffusion coefficient than the other dye/COFs systems. It’s important to mention that the lower slope in the MSD curves indicates that the adsorption of dye molecules on the adsorbent surface limits the mobility of the dye molecules. This fact can be related to the strong interaction of dye molecules with the active sites of COFs, which is caused by the formation of hydrogen bonds between the dimethyl amino phenyl azo group (C-N = N-C) and the substrate, as well as van der Waals forces, particularly π-π interactions. Also, less Di value of MO molecule in the MO/COFs system can be due to its lower molecular weight, which makes it migrate faster towards the COFs surface. Our findings show that the slope of the MSD curve for the Rh B molecule is more than the other DPs, which is probably due to more mass and strong repulsive interactions between Rh B and COFs. The values of the diffusion coefficient for systems with the most adsorption (MO/COFs) and the minimum adsorption (Rh b/COFs) on the substrate are equal to 0.0099 × 1e-5 and 0.0128 × 1e-5 cm2/s, respectively. These outcomes are confirmed by the RDF diagrams in Fig. 6, which demonstrate the possibility of the presence of Rh b molecules at a further distance from the adsorbent than in other systems. Likewise, the RDF diagram for MO/COFs, which is the most stable complex, shows that the probability of finding MO molecules at the closest distance to the adsorbent is higher than the other systems.

Fig. 5: MSD pattern.
figure 5

Time evolutions of MSD for the different dyes in the simulated COFs systems.

Fig. 6: RDF diagrams.
figure 6

A between pollutants dye molecules and COFs. a Mo/COFs; b GV/COFs; c BG/COFs; d TC/COFs; e MB/COFs; f CR/COFs; g Rh B/COFs systems, respectively.

Pair distribution functions of Pollutants

In addition, molecular interactions can be examined through the radial distribution functions (RDF) of adsorbate molecules located at a distance ‘r’ from the adsorbent slabs. In this analysis, we investigate the distribution of dye molecules around the COFs structure using the RDF. The RDF, is studied using the following equation:

$$g({\rm{r}})={\rm{n}}({\rm{r}})/2\pi {\rm{r}}\triangle {\rm{r}}\rho$$
(3)

Where: g(r) represents the radial distribution function, which quantifies the probability of locating a dye molecule at a distance ‘r’ from a reference substrate. The n (r) denotes the number density of molecules at a specific distance ‘r’ from the reference molecule. Δr corresponds to the width of the shell at distance ‘r’, and ρ signifies the total number density of molecules in the investigated system.

Figure 6 presents the RDF analysis for the studied systems, providing critical information about the interaction between dye molecules and substrate. The height of the RDF peaks in the systems follows this order of MO/COFs > GV/COFs > BG/COFs > MB/COFs > CR/COFs > Rh B/COFs.

Intermolecular forces between dye molecules and COF are an influential factor in RDF analysis. The results of RDF analysis show that, after equilibrium, most of the DPs are absorbed. As seen in Fig. 6, the strongest RDF peak is observed for the MO/COFs system, which is located at a distance of 0.48 nm from the surface of the COF. This fact confirms that the MO dye molecule has the most interaction with the COFs surface, which is due to the interaction between the aromatic rings of COFs with the terminal parts and the aromatic rings of MO molecule.

Interestingly, the highest peak of function g(r) for the GV molecule is observed almost 0.29 nm further away compared to the MO molecule. It may be due to the bigger size and more steric effect of the GV molecule, which caused the repulsive force to be stronger. Furthermore, a careful examination of Fig. 6 reveals that as the interaction energy decreases, the intensity of the RDF peaks appears at a further distance. These observations correlate well with the other obtained results in this investigation41,42,96,97.

Density profile

The density profile reflects the probability of water’s presence at a specific location. Considering the density profile (ρ) is essential due to the variation in water concentration among the different systems (where ρ signifies the density of water molecules). However, we have calculated the density profile of dye molecules for MO/GV/BG/TC/MB/CR and Rh B/COFs systems in the z-plane of the structure. The density distribution of dye molecules across the substrate is illustrated in Fig. 7. As depicted in Fig. 7, three distinct oscillating density peaks can be observed for each system, suggesting the presence of three-layer structures within the COFs that confine water molecules. The distribution of water molecules near the substrate exhibits a high degree of symmetry, characterized by multiple peaks that reflect the influence of the COFs structure on the adsorption of DPs. Furthermore, the presence of three peaks within a short range signifies the existence of a local hydrogen bonding structure. Specifically, the first hydrogen bond peak is observed at approximately 0.5 nm for MO/GV systems, while for other designs, it occurs at 1.5 nm, as anticipated.

Fig. 7: The profile density.
figure 7

For dye molecules in the studied systems. a MO-GV, and BG-COFs and (b) TC-MB-CR, and Rh B-COFs systems.

The overall shape of the density profiles is almost similar, but a significant difference in the height of the peaks has been observed, so that the highest peak in MO/GV/BG/TC/MB/CR and Rh B-COFs systems is approximately 325.79, 171.972, 135.106, 133.936, 107.186, 65.71 and 26.75 kg/m3, respectively.

The obtained results show that the MO-COFs system has the highest peak height compared to other systems, which can be attributed to the high tendency of MO molecules to form hydrogen bonds and interact with the substrate. It is noteworthy that the highest peak in the density profile may result from a decrease in the number of water molecules surrounding the substrate’s surface, where the highest concentration of hydrogen bonds and π-π stacking interactions between dye molecules and the structure are present.

Metadynamics

The well-tempered metadynamics simulation is a method that accelerates rare events and estimates the free energy surface (FES) to describe complex molecular systems. In this study, the Parrinello and Laio method, which calculates the FES as a function of distances between the centers of masses (COMs) of two components, is utilized. Metadynamics simulations are used to investigate the free-energy surface for the interaction of dye molecules with COFs surface in MO/GV/BG/TC and Rh B/COFs systems. Figure 8 illustrates the FES as a function of the distance between the COM of the dye molecules and the COFs substrate. As the DPs move toward the COFs, the adsorption processes during the metadynamics simulations for FES have become more negative. These systems encounter energetic boundaries and local minima as they approach their respective global minima. The free energy values for the COFs/PPMs complexes at their global minima are approximately −512.127, −435.603, −381.244, −300.313, and −283.230 kJmol−1 in the MO/COFs, GV/COFs, and BG/ COFs, TC COFs, and Rh B COFs systems, respectively. The free energy results are in complete agreement with the interaction energies presented in Table 2. Additionally, the MO/GV/TC and Rh B dye molecules experience a relative energy barrier of approximately 249.59, 285.51, 1 39.2, and 135.4 kJ mol−1, respectively, when they reach a distance of ~ d = 3.23 nm, 3.97 nm, 2.33 nm, and 1.18 nm at the water-substrate interface. Once this barrier is crossed, the free energy value decreases as the dye molecules approach the outside and inner of the COF’s cavities, which leads to the attainment of the most stable state. The investigated of the free energy surface between COFs and pollutants with the recent computational findings41,42,78,98,99, indicate that this 3D COFs is a good candidate for the removal of pollutants.

Fig. 8: The FES patterns.
figure 8

For transferring dye molecules (MO/GV/BG/TC and Rh B) towards the COFS materials. a MO/COFs; (b) GV/COFs; (c) BG/COFs; (d) TC/COFs; (e) Rh B/COFs.

Table 2 The vdW and electrostatic (Elec) (kJ/mol) and total energies

In summary, we have demonstrated the successful application of porous COFs structure with accessible cavities to adsorb colored pollutants in water and study their host-guest interactions.

The COF’s negative surface charge makes them attractive for adsorbing dye molecules, allowing us to remove dyes from aqueous mixtures. Molecular dynamics and metadynamics simulations are employed to investigate the adsorption of dye molecules onto or into the covalent organic framework in an aqueous environment. Our results reveal that the dye molecules spontaneously adsorbed on the substrate in all investigated systems. It is worth noting that the adsorption of DPs onto the COFs in MO/COFs is higher compared to other systems. Analysis of interaction energies highlights the crucial role of Lennard-Jones interactions in the adsorption of dye molecule contaminants on the COFs. The total interaction energy values for the examined systems indicate that the MO/COFs and GV/COFs systems exhibit the highest interaction energies, with values of −448.54 and −435.40, respectively. The RMSD diagrams indicate that all the investigated systems achieved equilibrium by the 100 ns mark.

The results from the other analyses, including the number of hydrogen bonds, SASA, mean-squared displacement, and radial distribution function, support the findings from the interaction energy analysis.

Specifically, the MO/COFs system exhibited the highest number of H-B. Moreover, The MO/COFs have the lowest SASA value of 32.402 nm2, while the Rh B-COFs have the highest at 106.60 nm2. This indicates that the Rh B-COFs system has a larger surface area than the other dyes, enabling it to interact with water molecules more efficiently. The MO/COFs system had the lowest diffusion coefficient approximately D = 0.0099 × 10−5 cm2/s. The highest RDF peak for the MO molecule at the closest of the surface is located at a distance of 0.48 nm. Notably, the highest peak in the density profile can be attributed to a reduction in the number of water molecules surrounding the substrate’s surface, particularly in the region where the highest concentration of hydrogen bonds and π-π stacking interactions between dye molecules and the structure occurs. The FES analysis of the studied systems reveals that achieving a global minimum requires DPs to surmount an energy barrier. Our metadynamics simulations, which aim to determine the adsorption behavior, demonstrate that the FES’s global minimum depends on the influences of the active sites on the COF’s surface. The obtained results from free energy are in agreement with the interaction energies. Overall, our results confirm that COFs are a good candidate for the adsorption of DPS.

Methods

MD simulations section

The MD simulation is applied to investigate the potential of COFs as a promising candidate for the elimination of dye-contaminated wastewater. It is worth mentioning that the initial structure of the COFs is taken from the X-ray data, which is reported by Dalapati et al.100, Jin et al.87, Wang et al.86, Yusuf et al.85, Chen et al.83, and Gao et al.’s work82. Dalapati et al.100. explored the chemical stability of the COF across various organic solvents, including hexane, Tetrahydrofuran, MeOH, aqueous HCl (1 M), and NaOH (1 M) solutions, at 25 °C for 24 h. Their findings revealed that the COF samples remained intact under these conditions, with no observable decomposition. Furthermore, they highlighted the preservation of high crystallinity in the COF samples. This exceptional chemical stability in diverse solvents is uncommon, underscoring the robust chemical nature of the monomer linker101. Herein, we utilized the 3D structure based on 1, 3, 6, 8-tetrakis (4 formyl phenyl) pyrene (Fiure1, TFPPy), which is a self-assembly and hydrophilic covalent organic framework to remove dye pollutants from water. The organic monomers form covalent interactions and are arranged through non-covalent bonds like aromatic stacking, van der Waals forces, and hydrogen bonding in the COF structure. As a result, the COF structure exhibits enduring high crystallinity and porosity. These non-covalent bonds between layers can significantly impact bulk properties such as surface area, porosity, electrical conductivity, crystallinity, and stability in the COF, contributing to its overall characteristics101.

In this study, the self-assembly COF system based on TFPPy with three layers is designed for removing dye pollutant molecules including MO, GV, BG, TC, MB, CR, and Rh B in water. In the designed simulation systems, DPs are located around the adjacent COF layers (Fig. 9); this position permits them to interact with four COF layers simultaneously, maximizing the COFs/DPs interaction strength. The schematic representation of the COF and its monomer is shown in Fig. 10. The DPs are initially randomly positioned at least 20 Å away from the framework surface. We observed spontaneous association for dyes within 100 ns of simulation time. A representative frame taken from the MD simulations of DPs is displayed in Fig. 9. The structure of the 3D COFs is designed with three layers using the Gauss View software102. MD simulations are conducted using the GROMACS software package (version 2019.2)103 with the CHARMM force field104. The simulation box has dimensions of 9 × 9 × 10 nm³ and contains COFs at the center, along with 6 dye molecules. The system is dissolved in a 6140 TIP3P water model105, mimicking the neutral medium. Periodic boundary conditions are applied to prevent interactions between components and neighboring cells. The particle mesh Ewald method is employed to manage non-bonded electrostatic and Lennard-Jones interactions within a 1.4 nm cutoff. The temperature and pressure are controlled at 310 K and 1 bar, respectively, utilizing the Nose-Hoover thermostat106 and the Parrinello-Rahman barostat107. The linear constraint solver algorithm108 is employed to maintain the bond lengths at their equilibrium values. Initially, the simulation system is relaxed through energy minimization using the steepest descent algorithm109 to reduce unfavorable interactions. Subsequently, MD simulations were performed for 100 ns using a time step of 1.5 fs. The initial configuration of the systems under investigation is depicted in Fig. 9. The Visual Molecular Dynamics (VMD) package110 is utilized for visualizing the simulated results. It is important to note that, in this study, the impact of different dye molecules on the adsorptions by COFs is considered.

Fig. 9: The initial snapshot of the studied systems.
figure 9

For (COFs/dyes, such as methyl orange (MO), gentian violet (GV), cationic brilliant green (BG), Tolonium chloride (TC), methylene blue (MB), anionic Congo red (CR), and rhodamine B (Rh B)). Color code Carbon: cyan, Hydrogen: gray, Sulfur: yellow, and Nitrogen: blue.

Fig. 10
figure 10

Schematic representation of COFs, COF and TFPPY. Color code: C, cyan; O, red; N, blue; and H, white.

Metadynamics simulations

The well-tempered metadynamics simulation technique111, proposed by Parrinello et al.112 is utilized to identify the free energy surface (FES) with respect to the collective variables (CVs). The metadynamics simulations are performed using the PLUMED plug-in version 2.5.2113, which is integrated into the Gromacs 2019.04 package. In the well-tempered metadynamics algorithm, an initial Gaussian height of 1.0 kJ mol−1 and a width of 0.25 Å are employed. A bias factor of 15 is used, and deposition occurs every 500-time steps. It is important to note that the metadynamics simulations are conducted for 100 ns across all investigated systems. Overall, the metadynamics simulations presented in this study provide a reliable approximation of the free energy landscape for COFs, with the systems ranked as MO > GV > BG > TC > MB > CR > Rh B.