Introduction

Dyes containing wastewaters, when released into the environment, pose a great risk to public health and the ecosystem itself. It is estimated that more than 1,000,000 tons of textile dyes are produced each year and employed in plastic, rubber, printing and other dye-related industries (Gupta and Suhas 2009). It has been reported that > 15% of the produced dyes are lost during production and leaked into industrial effluents, adversely affecting the health of all living forms in the aquatic system (Arfi et al. 2017).

Scientist have taken on the challenge of removing the dyes from wastewaters by providing cost-effective and efficient strategies. Physical adsorption is one of the most common methods used to perform this task. It takes place on the surface of a solid adsorbent, which is put in contact with a liquid or gaseous adsorbate to help its removal. It is an attractive method to treat wastewater because it is simple, cost-effective and can be performed without additional pretreatment steps (Gupta and Suhas 2009; D’Cruz et al. 2021). A variety of materials can be employed for the adsorptive removal of organic dyes, such as inorganic materials (Chen et al. 2011), porous organic polymers (Al-Hetlani et al. 2020; Al-Hetlani et al. 2021), industrial by-products (Bendary et al. 2021), activated carbon (Zare et al. 2015) and others (Adeniyi and Ighalo 2019).

Because of the ease of their synthesis and functionalization, polymers of intrinsic microporosity (PIMs) represent ideal materials for this task. They are part of a subcategory of porous polymers that has been successfully used for gas adsorption and separation (Felemban et al. 2021), along with many other applications such as catalysis and electrochemistry (Carta et al. 2013; Zhou et al. 2022; Antonangelo et al. 2022; Marken et al. 2021). More specifically, this work involves the use of the triptycene core, which has often been employed to produce high-performing PIMs (Ikai et al. 2019; Moh et al. 2018; Carta et al. 2014). Its success is mainly attributable to the highly rigid and contorted structure of its core that does not permit the efficient packing of its polymer chains in the solid state, leaving pores of nano-dimension (Comesaña-Gándara et al. 2019).

Of the many dyes present in wastewaters, malachite green (MG) and methyl orange (MO) are some of the most common. Their chemical structures are shown in Fig. 1. The former is a cationic triarylmethane generally used to dye paper, cotton, silk, wool and others. It is highly stable and environmentally persistent and, more importantly, the exposure to MG can cause damage to the nervous system, liver, kidney and other vital organs (Raval et al. 2017). The latter is a highly stable acidic azo-dye, which is a very popular compound in the textile and pharmaceutical industry (Iqbal and Datta 2019). Unfortunately, also this material can cause several health conditions when humans are exposed to a high concentration, varying from skin irritation, nausea and others (Gong et al. 2013).

Fig. 1
figure 1

Chemical structure of malachite green and methyl orange dyes

As a method to increase the rate of adsorption of these dyes, ultrasonic-assisted adsorption of pollutants from wastewater has emerged as an attractive technique (Deb et al. 2019). Hydrodynamic and acoustic cavitation can help boosting the mass transfer and, at the same time, shorten the time required for the pollutant molecules to separate from the aqueous medium, and to reach the adsorbent surface and pores (Sharifpour et al. 2016). In a recent work, we investigated the effect of polymers of intrinsic microporosity (PIMs) in the removal of antidepressants from wastewater, utilizing triphenylbenzene- and triptycene-based PIMs and studying the effect of introducing the sulfonate groups on the adsorption process (Al-Hetlani et al. 2022). Based on the obtained results, we established that: (1) triptycene-based PIMs produce better performance compared to the related triphenylbenzenes; (2) the –SO3H functionalized polymers showed both higher efficiency and higher adsorption capacity compared to unsubstituted hydrocarbon polymers. This proved that a good chemical affinity between adsorbent and pollutants is as important as the porosity, noting that the substituted polymers performed better than the more porous hydrocarbon-based ones. Based on the above literature, there are limited studies on the use of functionalized polymers of intrinsic microporosity (PIMs) in the removal contaminants from wastewater, despite their high efficiency in this research area. Therefore, this work demonstrates for the time the use of triptycene-based PIMs functionalized with nitro-, amino- and sulfonic groups, to produce TRIP-NO2, TRIP-NH2, TRIP-SO3H PIMs, for the efficient removal of MG and MO from wastewater. These functionalized polymers were compared with the pristine hydrocarbon TRIP-HC. Additionally, we evaluated the effect of adsorption of dyes using ultrasound and compared it with conventional magnetic stirrer approach. The ultrasonic-assisted adsorption of the anionic MO with TRIP-SO3H and TRIP-HC resulted in enhanced adsorption efficiencies for both cationic and anionic dyes. The effect of dye concentration and pH was also thoroughly assessed, along with their kinetics and isotherms. Competitive adsorption of MG and MO was investigated by mixing the two dyes, with the aim to identify the most selective of the four polymers. Finally, the effect of the type of water (tap and seawater) on the adsorption behavior was explored.

Experimental

Materials and reagents

Malachite green (MG), methyl orange (MO), acetone, hydrochloric acid and sodium hydroxide were purchased from Sigma-Aldrich. All reagents were procured at analytical grade and used without further purification. The DI water used for experiments was obtained from a deionizer Elix Milli-Q.

Adsorption experiments

The adsorption of the cationic (MG) and anionic (MO) dyes (molecular structure of the dyes is shown in Fig. 1) from wastewater was investigated by performing batch experiments with four triptycene-based hypercrosslinked PIMs, namely TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC. Briefly, 5 mg of each polymer was mixed with 10 mL of 25–150 ppm MG or MO aqueous solution in ultrasonic bath reactor (Bandelin sonorex) operating at an ultrasound frequency of 35 kHz. The water level was kept about 5 mm higher than the bottom of the reaction vessel. After leaving the dispersion under sonication for 2, 4, 6, 8, 10, 20, 30 and 40 min, it was filtered utilizing a 0.45-µm PTFE syringe filter (Pall Corporation). The concentration of the dyes was obtained by measuring the change in absorbance at λmax in a quartz cuvette using a UV–Vis spectrophotometer. MG has a characteristic absorption band at 617 nm and MO has a characteristic absorption band at 464 nm. The adsorption efficiency (%AE) for the dyes using all four polymers was estimated using:

$$\% {\text{AE}} = \frac{{\left( {C_{{\text{o}}} - C_{{\text{t}}} } \right)}}{{C_{{\text{o}}} }} \times 100$$
(1)

where Co and Ct are the initial concentration of MG and MO dyes and their concentration at time t (mg L−1), respectively. Qt is the quantity of MG and MO adsorbed per unit mass of TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC at time t was calculated using:

$$Q_{{\text{t}}} = \frac{{\left( {C_{0} - C_{{\text{t}}} } \right)V}}{m}$$
(2)

where V and m are the volume of solution (L) and the mass of the four polymers employed (g), respectively. At equilibrium, the equation is modified to:

$$Q_{{\text{e}}} = \frac{{\left( {C_{0} - C_{{{\text{eq}}}} } \right)V}}{m}$$
(3)

where Qe and Ceq are the amount of MG and MO dyes adsorbed per gram of TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC (mg g−1) and the concentration of MG and MO at equilibrium (mg L−1), respectively.

Furthermore, to investigate the effect of pH on the adsorption, the pH of the MG and MO was adjusted using either 0.1 M HCl or 0.1 M NaOH, to reach the required pH. For MG the pH values were 2.75, 4.18, 6.78, 9.28 and 10.77, while for MO the pH values were 4.40, 5.22, 6.68, 8.93 and 10.37. Finally, based on the optimum results both adsorption, isothermal and kinetic studies were performed.

Selectivity experiments

The adsorption of mixtures of MG and MO dyes was evaluated by mixing 100 ppm MG and with an equal volume of 100 ppm MO (pH = 4.30). UV–Vis spectra for each separate dye and the mixture before and after adding TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC polymers were determined. Subsequently, the adsorption efficiency for polymer was evaluated using Eq. 1.

Effect of magnetic stirring and water type

In order to investigate the variation of adsorption efficiency (%AE), the adsorption of MG and MO was performed using TRIP-SO3H and TRIP-HC (optimum polymers) under magnetic or ultrasonic stirring, under the same experimental condition: 100 ppm dye concentration, 5 mg and adsorbent amount at 25 °C. After mixing it under magnetic stirring (or sonicating it) for 10 min, the solution was filtered. The concentration of the dyes was obtained by measuring the change in absorbance, which afforded the calculation of the %AE. The effect of water type in which the adsorption experiments were carried out was studied as follows: MG and MO were dissolved in either sea or tap water, and their removal was performed using TRIP-SO3H and TRIP-HC. The ions present in solution and their respective concentrations, in both type of water, were measured using inductively coupled plasma mass spectrometry (ICP-MS, PerkinElmer NexIon 2000P). Tap water was used as is, whereas the seawater was centrifuged at 8000 rpm for 5 min twice and filtered through 0.45 µm PTFE, to remove any dust particulate, before dissolving the dyes and adjusting the pH. The adsorption experiments were performed as previously mentioned.

Regeneration of TRIP-SO3H and TRIP-HC

The reusability and stability of TRIP-SO3H and TRIP-HC was studied by separating the adsorbed MG and MO from the polymers for five regeneration cycles. After each adsorption experiment, MG-TRIP-SO3H and MO-TRIP-HC were sonicated in acetone for 20 min, followed by centrifugation at 8000 rpm for 5 min, to separate and collect the polymers. The washing with acetone was performed four times at room temperature, to ensure the complete desorption of the dyes from the pores. TRIP-SO3H and TRIP-HC were then sonicated in DI water for 15 min and separated by centrifugation. Finally, TRIP-SO3H and TRIP-HC were collected and allowed to dry at 100 °C under vacuum overnight. The reusability was assessed by mixing again the dried TRIP-SO3H and TRIP-HC with MG and MO solutions, respectively, and determine their adsorption efficiency via UV–Vis spectroscopy. To investigate the stability of the polymers, micrographs and elemental composition, before and after the adsorption cycles, were obtained using JSM-IT100 InTouchScope™ scanning electron microscope.

Results and discussion

Synthesis and characterization of the polymers

As anticipated, all the polymers that we have employed for this work are based on the triptycene core. In fact, its unique trigonal geometry with a paddlewheel-like structure with 120° angles between the aromatic moieties always provided highly porous materials. This is mainly due to the restricted rotation of the bonds that form its core, which produces a very inefficient packing of the polymer chains that leaves high internal free volume (IFV) (Ikai et al. 2019; Gu et al. 2021; Lau et al. 2019). Another advantage of the triptycene is represented by the easy functionalization of its backbone, which allows the introduction of polar groups that help tuning the affinity of similarly polar compounds and, in the end, their removal from water (Al-Hetlani et al. 2022). The functionalization of the polymers used for this work was performed according to a recently published procedure (Zhou et al. 2022). We started from the Friedel–Craft polymerization of the triptycene, which formed the initial TRIP-HC. This was nitrated with concentrated nitric acid, in the presence of sulfuric acid as a catalyst to obtain TRIP-NO2. The latter was reduced to amino-triptycene with a methanol/water solution of sodium dithionite, to form TRIP-NH2. The sulfonated TRIP-SO3H was obtained by direct sulfonation of TRIP-HC, using concentrated sulfuric acid and heating up to 60 °C (Fig. 2). All hypercrosslinked polymers proved to be highly porous and completely insoluble in any media, which permits their easy removal from solutions by simple filtration, and so their recycling. The porosity, assessed by the calculation of their BET surface areas by isothermal N2 adsorption at 77 K, follows the order TRIP-HC (1880 m2g−1) > TRIP-SO3H (1145 m2g−1) > TRIP-NO2 (975 m2g−1) > TRIP-NH2 (610 m2g−1). Along with the high BET surface areas, all polymers showed a great affinity for CO2 and good selectivity toward N2 and CH4. The full physical characterization can be found in Table S1, and in our previous article (Zhou et al. 2022).

Fig. 2
figure 2

Synthesis and functionalization of triptycene polymers

Effect of the adsorbent concentration and pH

Control sonication experiments were performed without the adsorbent by placing the MO and MG solutions and sonicate for one hour and measured their absorbance before and after exposure to the sonication waves. As demonstrated in Figure S1a, there is no change in their absorbance behavior which indicates the ultrasound radiation did not degrade the dyes. The dependency of removal efficiency from the initial concentration of MG and MO was investigated for the four synthesized polymers. The results obtained using MG and MO at initial concentrations ranging from 25 to 150 ppm are displayed in Fig. S1b–c, and show that for MG the adsorption efficiency follows the order TRIP-SO3H ~ TRIP-HC > TRIP-NO2 > TRIP-NH2. The data for MO (Fig. S1b), instead, show a trend TRIP-SO3H > TRIP-HC > TRIP-NH2 ~ TRIP-NO2, proving that the sulfonated polymer has a slight edge over the others despite the lower porosity. The adsorption efficiency of TRIP-HC and TRIP-SO3H produced consistent results with about 100% removal of the cationic MG at all the investigated concentrations, while it drastically dropped after 100 ppm for TRIP-NH2 and TRIP-NO2. The adsorption behavior of the anionic dye MO, however, showed a different trend. Initially both TRIP-HC and TRIP-SO3H exhibited good efficiencies at low MO concentration, however, beyond 100 ppm a significant performance loss was observed. In contrast, for TRIP-NH2 and TRIP-NO2, the adsorption efficiency rapidly decreased when the concentration of the dyes exceeded only 25 ppm. The latter can be attributed to the number of vacant sites available, which are fixed for a particular adsorbent. This suggests that, at low initial concentration of the dye, larger number of active adsorption sites on the polymer are accessible, while at a higher concentration this number drops. Another parameter that is worth to be considered is the influence of the pH on the adsorption efficiency when using a fixed dose of the adsorbents and dyes concentration, as illustrated in Fig. S2a–b. Interestingly, for MG all tested polymers exhibited the optimum adsorption efficiency at pH = 4.18 (%AE ≈ 100%), and the adsorption efficiency proved steady for TRIP- NO2 at all acidic and basic pH values. As the pH increased the adsorption efficiency for TRIP-NH2, TRIP-SO3H and TRIP-HC dropped for the cationic dye (TRIP-NO2 > TRIP-SO3H ~ TRIP-HC > TRIP-NH2). Performing the same study for MO, we observed that the acidic pH of 4.40 proved to be the optimum for all PIMs, with the highest adsorption efficiency obtained for TRIP-HC. As the pH value increased, the adsorption efficiency was evidently affected, decreasing for all polymers (TRIP-HC > TRIP-SO3H > TRIP-NO2 ~ TRIP-NH2), and reaching less than 20% for TRIP-NO2 and TRIP-NH2 when moving toward more basic pH. We, thus, reached the conclusion that the pH has a considerable effect on the adsorption behavior of the polymers for both cationic and anionic dyes and, therefore, further experiments were conducted at the optimum pH of 4.18 for MG and 4.40 for MO.

Isotherm and kinetic studies

The kinetic mechanism of the adsorption of MG and MO was identified by employing pseudo-first and pseudo-second kinetic models. The Lagergren equation was applied to determine the adsorption mechanism:

$$\ln \left( {q_{{\text{e}}} - q_{{\text{t}}} } \right) = \ln q_{{\text{e}}} - k_{1} t,$$
(4)

where qe (mg g−1) and qt (mg g−1) are the adsorbed amount of the MG and MO at equilibrium and any time (t) and k1 is the rate constant. k1 and qe values are determined from the slope and intercept of ln(qe − qt) versus time.

The pseudo-second-order kinetics is defined as below:

$$\frac{t}{{q_{{\text{t}}} }} = \frac{1}{{q_{{\text{e}}} }}t + \frac{1}{{k_{2} q_{{\text{e}}}^{2} }},$$
(5)

Here, k2 (g mg−1 min−1) is the rate constant of second order kinetics, both qe and k2 are obtained from the plot of t/qt versus t.

The results obtained for MG and MO using all tested polymers are shown in Fig. 3a, b and Table 1. For MG, TRIP-NO2, TRIP-SO3H and TRIP-HC, the optimum contact time was achieved after 6 min, while TRIP-NH2 took almost 40 min to stabilize. For the removal of MO, TRIP-NO2, TRIP-SO3H and TRIP-HC stabilized after 8 min, and TRIP-NH2 required 10 min, instead. Studying the kinetics, the data show R2 values in the range 0.920–1.000, which revealed that all the four polymers follow pseudo-second-order kinetics for both the cationic MG and the anionic MO.

Fig. 3
figure 3

Adsorption kinetics of a MG and b MO using TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC (Temperature: 298 K, [MG] = [MO] = 100 ppm, adsorbent dose: 5 mg, pH = 4.18 for MG and for MO pH = 4.40)

Table 1 Fitting parameters of the pseudo-first order and pseudo-second-order kinetic, Langmuir isotherm and Freundlich isotherm models for the adsorption of MG and MO on TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC polymers

Generally, to identify the adsorption type, properties and tendency of the adsorbents toward the adsorbates, the equilibrium adsorption isotherm (at 298 K) is investigated. To determine the maximum adsorption capacity of TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC toward the removal of MG and MO, the equilibrium data were fitted using Langmuir and Freundlich isotherm equation:

$$\frac{{C_{{\text{e}}} }}{{q_{{\text{e}}} }} = \frac{{C_{{\text{e}}} }}{{Q_{{\text{m}}} }} + \frac{1}{{K_{{\text{L}}} Q_{{\text{m}}} }}$$
(6)

where Ce (mg L−1) is the concentration of MG and MO at equilibrium, qe (mg g−1) is the amount adsorbed of MG and MO at equilibrium, Qm (mg g−1) is the maximum adsorption capacity, and KL (mL mg−1) is the adsorption equilibrium constant. The Freundlich isotherm model is represented by the equation:

$$\ln \;q_{{\text{e}}} = \ln \;K_{{\text{f}}} + \frac{{\ln \;C_{{\text{e}}} }}{n}$$
(7)

where Kf (mg g−1) is the Freundlich constant, which is related to the adsorption capacity, and n is the adsorption intensity, or heterogeneity.

Sorption isotherms for MG and MO using all tested polymers are displayed in Fig. S3a–d, and the data reported in Table 1. Based on these results, the Langmuir isotherm proved the best fit for the experimental data for all polymers when using both MG and MO. The R2 value ranged between 0.854 and 1.000, indicating a good fitting, and implying that a monolayer coverage of the adsorbent surface with a finite number of adsorption sites is obtained rather than multilayers. When the adsorption is at equilibrium the adsorption capacity reaches a maximum. The removal of the cationic dye shows that the sulfonated polymer has the best uptake, with a trend TRIP-SO3H (303.03 mg g−1) > TRIP-HC (294.12 mg g−1) > TRIP-NO2 (161.29 mg g−1) > TRIP-NH2 (113.64 mg g−1). On the other hand, the maximum adsorption capacities, when removing MO, follow the order TRIP-HC (270.27 mg g−1) > TRIP-SO3H (109.89 mg g−1) > TRIP-NH2 (75.76 mg g−1) > TRIP-NO2 (30.39 mg g−1). These values suggest that the cationic dye has a strong affinity for TRIP-SO3H, indicating that the acidic group plays a crucial role, whereas the anionic dye is better removed with TRIP-HC, proving that it responds better to its higher porosity. Table S2 shows the adsorption capacity of MG and MO for the four functionalized PIMs in comparison with other published materials. Adsorption capacity of 303.03 mg g−1 was obtained using AC/zinc hydroxide nanoparticles composite (Altıntıg et al. 2021) for the removal of MG, which is the same value we obtained using TRIP-SO3H, but we used much lower amount of the adsorbent (only 5 mg vs 100 mg). For the adsorption capacity of MO, a value of 240.84 mg g−1 was obtained using a ZnO/polyaniline nanocomposite and employing 20 mg/L of MO and 0.25 g/L of the adsorbent (Deb et al. 2019); in this work, we reached 270.270 mg g−1 using 5 mg of TRIP-HC. The results show that all four polymers used in this work are highly efficient for the removal of cationic and anionic dyes from wastewater, and the maximum adsorption capacities are comparable, if not better, with other composites previously utilized in the literature. Furthermore to our advantage, we typically employ much smaller amounts of the adsorbents, which makes our system cheaper.

Selectivity studies

The selectivity of the four polymers toward both cationic and anionic dye was also investigated. Figure 4a shows the changes in absorbance of the mixture of MG and MO dye before and after their adsorption by TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC. As possible to assess from the figure, the characteristic absorption bands at 617 nm (Raval et al. 2017) for MG and 464 nm for MO (Iqbal and Datta 2019) can be clearly distinguished for the mixture. Upon sonication of the four polymers, a complete disappearance of both bands occurred for TRIP-HC, whereas a small band was retained for TRIP-SO3H at 464 nm (corresponding to MO). A more pronounced band on the same position was observed for both TRIP-NO2 and TRIP-NH2. The photographs show the mixture of both MG and MO before and after adsorption by all polymers: TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC (Fig. 4b). It can be inferred in the before image that the mixture has strong dark-green color; however, after completing the adsorption experiment, medium orange color was observed for TRIP-NO2 and TRIP-NH2, whereas faint orange color was observed for TRIP-SO3H (due to complete removal of MG dye). Finally, a complete colorless solution was observed for the solution containing TRIP-HC due to the removal of both dyes. The study of the adsorption behavior proved that MG was completely adsorbed by all four polymers, MO was entirely removed by TRIP-HC, partly adsorbed by TRIP-SO3H (%AE = 96%) and, to a lesser extent, removed by TRIP-NO2 (%AE = 87%) and TRIP-NH2 (%AE = 86.5%). These evident changes prove that MG and MO can be effectively eliminated by all four polymers. On the other hand, MG can be selectively sequestrated by TRIP-SO3H, TRIP-NO2 and TRIP-NH2 but MO is completely eliminated only using TRIP-HC. These results strongly highlight the efficiency of the removal of MG and MO from mixed dyes for all four polymers.

Fig. 4
figure 4

a UV–Vis absorption spectra of MG and MO mixture before and after adsorption using TRIP-NO2, TRIP-NH2, TRIP-SO3H and TRIP-HC. b Photographs showing the MG and MO before and after adsorption. (Temperature: 298 K, [MG] = 50 ppm, pH = 4.18, [MO] = 50 ppm, pH = 4.40, adsorbent dose: 5 mg)

Effect of magnetic stirring versus ultrasounds

To evaluate the contribution of the ultrasounds in the adsorption of MG and MO, the experiments were performed also using simple magnetic stirring for 10 min using two of our best polymers (TRIP-SO3H and TRIP-HC). These results were compared with the ones obtained with ultrasonic-assisted adsorption, which were performed under our optimized experimental conditions. The UV–Vis spectra of the MG and MO solutions, before and after adsorption, are shown in Fig. 5a–d, and summarized in Table S3. As we can see from the table, ultrasonic-assisted adsorption of cationic MG using TRIP-SO3 and TRIP-HC yielded 100 and 99.17%, respectively, while magnetic stirred adsorption with the same dye yielded only 2.59 and 28.52% for TRIP-SO3H and TRIP-HC, respectively. The ultrasonic-assisted adsorption of the anionic MO with TRIP-SO3H and TRIP-HC resulted in %AE of 83.43 and 97.30%, respectively, while the use of magnetic stirring produced 59.36 and 97.31%, respectively. Ultrasonic-assisted adsorption proves superior to magnetic stirring, and this can be explained by the adsorption mechanism of these dyes under the influence of ultrasounds. When the latter is used in a heterogeneous mixture of the polymer–dye aqueous solution, cavitation bubbles are rapidly generated, which then asymmetrically collapse near the polymer surface due to high pressure and temperature. This asymmetric disintegration causes the formation of high-speed micro-jets that improves the diffusion process (mass transfer) of the dyes. Additionally, it produces an acoustic microstreaming effect and the formation of shock waves (i.e., it generates turbulences) that helps moving the dyes from polymers surface into their pores and separating them from the aqueous medium (Hamdaoui and Naffrechoux 2009; Hamdaoui et al. 2003). Thus, we can see that three simultaneous and effective sonochemical mechanisms are involved in the adsorption process: high velocity micro-jets, acoustic microstreaming and shock waves. Their contribution resulted in enhanced removal of MG and MO, compared to the traditional magnetic stirring.

Fig. 5
figure 5

UV–Vis absorption spectra of magnetic stirring versus sonication for a TRIP-SO3H and MG, b TRIP-SO3H and MO, c TRIP-HC and MG and d TRIP-HC and MO. (Temperature: 298 K, [MG] = 100 ppm, pH = 4.18, [MO] = 100 ppm, pH = 4.40, adsorbent dose: 5 mg)

Potential mechanism of interaction between dyes and polymers

In the attempt of establishing a mechanism of interaction between the polymers and the dyes, we recorded Fourier transform infrared spectroscopy (FT-IR) of the polymers before and after the adsorption of each compound. Figure 6a, shows the spectra recorded before and after the adsorption of the two dyes onto TRIP-SO3H polymer. A close inspection around the region ~ 1675–1650 cm−1 (Fig. 6b) demonstrates a peak that is common to all the spectra which is attributable to the original sulfonated PIM, this peak has shifted slightly to the right after the adsorption of the dyes. This shows the existence of a weak chemical interaction between the two entities. The main peaks of the diazo are difficult to distinguish from others because of the overlap. One of the common bands at ~ 1600 and 1500 cm−1 does overlap with other aromatic peaks of the polymer (also considering that the dyes are in low concentration compared to the absorbent). Probably, the most plausible explanation is due to the larger peak at ~ 1368 cm−1 (the –C–N=N– bond), which is present when the MO is absorbed, but not in the original polymer, Fig. S5a–b. However, being this shift very small, we believe that the adsorption mechanism is likely dominated by physisorption rather than chemisorption, meaning that there is not a strong bond between the adsorbate and the adsorbent. It is plausible that a weak bond is partly formed, due to the similar polarity of functional groups and the dyes but, considering the amount of unengaged sulfonic moieties and the number of analogous sites in the dyes, the dominant mechanism is physisorption of the dyes into the pores. That is partly reinforced by the fact that a similar shift is seen also in the non-functionalized TRIP-HC (Figure S4). This is not that surprising, as the results of the CO2 uptake at different temperatures provided relatively weak heats of adsorption, which also suggested a physisorption mechanism (Zhou et al. 2022).

Fig. 6
figure 6

a FT-IR overlay of the adsorption of MG and MO onto Trip-SO3H. b Inset zooming on the region 1675–1650 cm−1, showing the slight shift of the peaks

Effect of water type and recyclability of polymers

To have a more general idea of the application of these polymers for the removal of dyes from water, the effect of the water type was studied. Thus, along with the typical DI water, also tap and seawater were employed and the obtained results were compared. Both MG and MO (at the concentration of 100 ppm) were dissolved in the selected type of water, and ultrasonic-assisted adsorption was performed for 10 min. The ions concentrations in tap and seawater were determined using ICP-MS, and Ca, Mg, K and Na ions were detected. For tap water the concentrations were found at 20.7, 2.1, 0.9 and 15.5 ppm, respectively, whereas for seawater the concentrations were significantly higher at 537.2, 1685.9, 915.3 and 12,302.0 ppm. According to our optimized results, the effect of water type was investigated using TRIP-SO3H for the removal of MG and TRIP-HC for MO. Their adsorption behavior is shown in Fig. 7a and Table S3. The best efficiencies in DI water were found at 100% and 99.2% for MG and MO, using TRIP-SO3H and TRIP-HC, respectively. Replacing DI water with tap or seawater clearly affected the adsorption behavior of the polymers. The efficiency of TRIP-SO3H toward MG did not significantly change in the presence of tap water, whereas a substantial decrease was obtained with the ion-rich seawater, with a reduction up to 72.4%. This fluctuation can be attributed to the interaction of the negatively charged polymer with monocations (K+ and Na+) and dications (Ca2+ and Mg2+), all present in considerably high concentrations. In the absence of other external factors, this must, to some extent, limit the adsorption of the cationic MG. On the other hand, the adsorption of MO was not greatly influenced by the type of water when using TRIP-HC, as the efficiencies recorded were 97.00% and 96.80% for tap and seawater, respectively. This clearly indicates that the adsorption behavior of TRIP-HC toward the anionic dye (MO) is independent from the presence of different cations.

Fig. 7
figure 7

a Effect of DI, tap and seawater on the adsorption of MG and MO using TRIP-SO3H and TRIP-HC, respectively, and b recyclability of TRIP-SO3H and TRIP-HC toward MG and MO, respectively. (Temperature: 298 K, [MG] = 100 ppm, pH = 4.18, [MO] = 100 ppm

To evaluate the stability and reusability of the polymers, adsorption–desorption experiments were performed using the same polymer and carried out up to five cycles. In a typical experiment, the MG adsorption experiments were conducted using TRIP-SO3H while the MO experiments were carried out using TRIP-HC. The adsorption efficiency for both polymers up to five cycles is shown in Fig. 7b. For TRIP-SO3H, the adsorption of MG was reduced to 88.52% after five cycles, while a decrease to 73.15% was recorded for MO using TRIP-HC. These results suggest that the performance of these polymers is maintained, even after several washings. The stability of the polymers was also investigated by scanning electron microscopy-energy dispersive X-ray analysis (SEM–EDS). As possible to see from Figure S6a and c, the morphology of TRIP-SO3H and TRIP-HC before the adsorption proved to be very similar, showing homogenous spherical globules. After completing the adsorption cycles, the micrographs of TRIP-SO3H and TRIP-HC were found to be very similar to the original (Fig. S6b and d), which confirms the high stability and recyclability of the polymers toward adsorption–desorption cycles, washing and ultrasound. Elemental composition was also studied, pre- and post-adsorption. As expected, TRIP-SO3H showed mainly carbon, oxygen and sulfur before adsorption, whereas after adsorption also nitrogen (which is present in MG) appeared after adsorption. Regarding TRIP-HC, carbon and some oxygen (most likely moisture from the environment) was detected before adsorption, while sulfur and nitrogen from MO were observed post-adsorption.

Conclusion

A series of novel polymers of intrinsic microporosity (PIMs) of triptycene backbone functionalized with; nitro-, amine-, sulfonic- and hydrocarbon—showed excellent adsorption behavior toward cationic and anionic dyes. Among these polymers, TRIP-SO3H and TRIP-HC produced high adsorption capacities toward the removal of MG and MO, respectively, and good stability toward adsorption–desorption cycles as illustrated by their SEM micrographs. The adsorption was highly influenced by the use of ultrasonic-assisted adsorption, which worked more efficiently than the traditional magnetic stirring. The choice of water types displayed slightly different behavior, particularly when seawater, which is rich in competing ions, was used. The mechanism of interaction shows that the dominant adsorption is due to physisorption, but the shift of selected peaks also shows that a certain chemical interaction between adsorbate and adsorbent exists. Based on our findings, functionalized triptycene-based polymers can be considered as promising and effective adsorbent for cationic and anionic dyes in wastewater using a small amount with high stability.