1 Introduction

Nowadays, drinking water resources are significantly reduced due to population growth accompanied by robust industrialization and intensive development of agriculture. The release of a wide variety of organic pollutants into the environment is constantly increasing [1, 2]. These organic contaminants have several adverse health impacts. In addition, the deterioration of the quality of different environmental media directly affects the equilibrium of ecosystems (soil, water, air). Dyes are a sort of recalcitrant organic compound, and they are mainly used in the textile and dyeing industry [3]. These areas are among the most water-consuming industries. They generate significant pollution because their various immense effluents are too loaded with acid or basic dyes. In order to protect water resources from pollution, it is necessary to treat contaminated water from its source, which is a significant challenge. Many treatment methods have been employed to eliminate dyes in contaminated water, such as coagulation, chemical oxidation photocatalysis, and adsorption [4,5,6,7,8,9]. Adsorption is one of the most hopeful and promising processes, has attracted considerable attention in the treatment of dye wastewater, and is widely used in industry because it is simple to apply and very effective, even for heavily loaded effluents [10,11,12]. In recent years, significant efforts have been made to develop new materials to improve water quality. The application of activated carbon for dyes removal has been the subject of much research due to its many economic advantages [13, 14]. The performance efficiency is highly dependent on the physical properties and the functional groups of the activated carbon [15, 16]. Activated carbons can be obtained from various types of natural resources (e.g., non-renewable sources like coal and renewable sources like biomass) by two activation processes (physical and chemical) or by a combination of both. For this purpose, we researched to valorize the Argan nutshells constituting an abundant co-product after extracting the almond (source of argan oil) by its use as a precursor for the production of activated carbons [15]. At present, the local residents use spent argan shells as a heating source. However, biomass as a renewable resource like coconut shell, almond, or olive pomace is increasingly employed as a natural-resources to synthesize activated carbon since these resources are inexpensive and sustainable. At the same time, only a few studies use argan nutshells as a precursor of activated carbons synthesized via chemical treatment utilizing K2CO3, KOH, and H3PO4 as activating agents [15, 17]. To the best of our knowledge, this is the first study to use Na@Ac prepared by chemical activation with Na2CO3 to remove Rhodamine B.

In this manuscript, the synthesis of activated carbon from Argan nutshell via chemical activation and its structural, morphological, and characterization have been reported. The performance of adsorption for the removal of Rhodamine B using the prepared Na@Ac material was examined. Furthermore, density functional theory (DFT) calculations were performed to complete the experimental findings and better understand the RhB dye’s uptake mechanism on Na@Ac.

2 Material and methods

2.1 Preparation of activated carbon

The argan nutshell (ANS) was collected from the southwest of Morocco. The material was sieved, and a material smaller than 100 µm was selected. Activated carbon was produced using the chemical treatment using sodium carbonate (Na2CO3) as the activator. In the first stage, the argan nutshell was rinsed with MilliQ water and dried at 110 °C for 24 h, and then the raw ANS was impregnated with Na2CO3 solutions for 24 h with continuous stirring (800 rpm). In the second stage, the mixture was dried for 24 h at 110 °C. This sample was denoted as Na_ANS. Afterwards, the sample was subjected to a carbonization process at 400–700 °C with a heating rate of 10 °C/min for 60 min, under a continuous flow of 60 mL/min of purified nitrogen gas. Following the carbonization, the product was boiled with an HCl acid solution (10 wt %) under reflux for 4 h to eliminate impurities and minimize the ash contents of the activated carbon [18, 19]. Finally, the product was rinsed many times with MilliQ water until chloride ions were not detected and then dried for 24 h at 110 °C. Activated carbon prepared was labeled as Na@Ac.

All chemicals in this present work were used as received without further purification. All experimental solutions were prepared using high-purity deionized water. The activating agent was sodium carbonate Na2CO3 (purity > 99%) purchased from Sigma-Aldrich. Rhodamine B (RhB) was purchased from Sigma-Aldrich.

The scanning electron microscopy (SEM) technique using an SEM Hitachi SU3500 instrument was used to characterize the surface morphology of raw materials and activated carbons. Samples were coated with a thin gold layer during SEM operation. The FTIR spectra Fourier-Transform InfraRed (FTIR) spectra of the raw materials and activated carbon were obtained with a PerkinElmer FT-IR Spectrometer Frontier equipped with the ATR sampling accessory (diamond crystal). The measurements were performed in transmittance mode throughout the range 4000–400 cm−1 with a spectral resolution of 4 cm−1. The specific surface area pores volume and size distribution of the activated carbon were evaluated according to the Brunauer Emmet–Teller (BET) equation with nitrogen adsorption–desorption isotherms at 77 K using a Micrometrics Gemini V device. The isoelectric point titration of the activated carbon was performed using a Zetasizer Nano ZS (Malvern Instruments).

2.2 Adsorption experiments

Different batch adsorption experiments were performed to study the adsorption of RhB from an aqueous solution using the synthesized Na@Ac activated carbon. Firstly, the Na@Ac obtained at different temperatures (400–700 °C) were tested for the RhB removal in a preliminary experiment to select the best adsorbent (see Fig. SI.1). From the preliminary data, the Na@Ac prepared at 600 °C showed much higher RhB adsorption capacity, and was therefore selected for the optimization experiments using RSM. The RSM was applied to optimize the removal efficiency of RhB on Na@Ac. These experiments were performed in 15 mL Corning© tubes with 10 mL of varying initial concentrations (30–70 mg/L) of the aqueous RhB solution at different solution pH (3–7) and temperatures (10–30 °C). In batch adsorption tests, 10 mg of Na@Ac were mixed with 10 mL of RhB solution in 15 mL Corning© tubes. The pH of solutions was adjusted with NaOH/HCl (0.1 M). The tubes were centrifuged after being continuously stirred at 60 rpm for 24 h on an orbital shaker. Kinetics (0–60 min) assays were carried out using the optimum adsorption conditions. The concentration of RhB after adsorption (see Fig. SI.2) was measured using a UV-spectrophotometer (Shimadzu UV–vis spectrometer) at a maximum wavelength of (λmax = 554 nm). The RhB Adsorption percentage (%) and quantity adsorbed qe (mg/g) were determined using Eqs. (1) and (2), respectively:

$${\mathrm{q}}_{\mathrm{e}}{=}\frac{\left({\mathrm{C}}_{0}-{\mathrm{C}}_{\mathrm{e}}\right)* \mathrm{V}}{\mathrm{W}}$$
(1)
$${\% \;\mathrm{Adsorption} =}\left({1} - \frac{{\mathrm{C}}_{\mathrm{e}}}{{\mathrm{C}}_{0}}\right){*100}$$
(2)

where C0 and Ce denote the initial RhB dye concentration and equilibrium concentration (mg/L), respectively. Conversely, V (L) denotes the solution volume, while W (g) stands for the quantity of Na@Ac.

3 Results and discussion

FTIR analyzed the presence of the functional group in ANS, Na_ANS, and Na@Ac, and the spectra are shown in Fig. 1. For all the samples in Fig. 1, bands at 3443 and 2926 cm−1 are attributed to the (O–H) vibrations in the hydroxyl and (C-H) vibrations groups, respectively [20]. The FTIR spectra of ANS and Na_ANS are identical. The bands at 1732 and 1597 cm−1 are related to the C = O stretching vibrations in ketones (RCOR’) and aromatic C = C bonds, respectively. While the band situated around 1505 cm−1 might be attributed to the C = C ring stretch of aromatic rings [21]. The peak at 1462 cm−1 confirms the presence of the C = C of aromatic rings. Furthermore, the peak at 1372 cm−1 could be assigned to the C-O vibrations in carboxylate groups. Besides, the bands in the range of 1000–1300 cm−1 could be attributed to the C-O stretching vibrations. The peak at 591 cm−1 is attributed to the in-plane ring deformation [15, 22]. The FTIR spectrum of Na@Ac showed that the intensity of the bands strongly decreased, and others disappeared compared to the raw argan nutshell. Moreover, these bands disappeared for Na@Ac, as proof of removing most surface functional groups during the activation process.

Fig. 1
figure 1

FTIR spectra of ANS, Na_ANS, and Na@Ac

The morphology of Na_ANS (Fig. 2a) showed a relative roughness surface caused by chemical activation with no porosity, except for occasional cracks. The morphology of activated carbon Na@Ac (Fig. 2b) showed considerable changes in the surface porosity caused by the activation process. This porosity improvement is consistent with the findings shown by the prepared activated carbon’s textural characteristics.

Fig. 2
figure 2

SEM images of Na_ANS (a) and Na@Ac (b)

The textural characteristics of the Na_ANS and Na@Ac were determined by nitrogen physisorption at 77 K in Fig. 3a. It is apparent from the shape of the obtained isotherms that the Na_ANS and the prepared Na@Ac were mainly macroporous (isotherm, type II) and microporous (isotherm, type I), respectively, according to the IUPAC classification [23, 24]. These experiments calculated the specific surface area (BET), and the total pore volume of Na_ANS was 155 m2/g and 0.076 cm3/g, respectively. When considering the prepared activated carbon Na@Ac, a remarkable increase was noted in the specific surface area of 1543 m2/g and total pore volume of 0.96 cm3/g, in accordance with SEM observations. It is possible to deduce that the observed increase in specific surface area and total pore volume is caused by the chemical activation at 600 °C. The isoelectric point (IEP) was determined by zeta potential measurement and found at a pH value of 4.36 (Fig. 3b).

Fig. 3
figure 3

The surface area of Na_ANS and Na@Ac using N2 adsorption–desorption isotherms (a) and the zeta potential of Na@Ac activated carbon as a function of pH (b)

3.1 Response surface methodology modeling

The present design focuses on a three-level central composite design (CCD) in response surface methodology to seek the best conditions for removing RhB onto Na@Ac. Three variables influence the present procedure: (pH―X1, temperature―X2, and initial dye concentration―X3). This research used 17 runs to assess the impact of the three input factors on RhB uptake efficiency. Table 1 depicts the arrangement of the factorial design. Table 2 provides a comprehensive overview of the investigations and their respective responses to RhB removals.

Table 1 Actual and coded variables and their levels
Table 2 The CCD matrix design with three experimental variables and the associated experimental outcomes

After applying analysis of variance (ANOVA) to the experimental runs, the CCD design table findings were derived and fitted using a suitable polynomial equation. The second-order polynomial (Eq. (3)) model was selected and fairly fitted for all three experimental variables and responses (RhB removal efficiency) based on the model assessment in Table 3, which focuses on maximum R2, predicted R2, and adjusted R2. The predictive of the quadratic (second-order) polynomial response model may thus be defined as follows (Eq. (3)) [25, 26]:

$$Y={\beta }_{0}+{\sum }_{i=1}^{n}{\beta }_{i}{X}_{i}+{\sum }_{i=1}^{n}{\beta }_{ii}{{X}}_{{i}}^{2}+{\sum }_{i=1}^{n}{\sum }_{i>1}^{n}{\beta }_{j}{X}_{1}{X}_{j}$$
(3)

where Y represents the predicted response,β0 βi and represent the intercept and linear coefficients, βii and βij represent the quadratic and interaction coefficients, and Xi and Xj represent the coded values of the experimental variables.

Table 3 Model summary statistics

For RhB removal, an ANOVA analysis was made, and the outcomes are shown in Table 4. The results of the ANOVA analysis revealed that the F and P-values were less than 1000 and 0.0500, respectively. This proved the significance of the model terms. Simultaneously, the lack of fit F-value in the ANOVA tables present a minor error concerning the pure error. The quadratic polynomial model in Eq. 4 was generated using the experimental data (CCD data in Table 2) by randomization and multiple regression analysis using the Design Expert® version 11.1.2.0 software.

Table 4 ANOVA analyses of the quadratic (second-order) model and determination coefficients for RhB removal efficiency
$$RhB removal\mathrm{ \%}=0.0797096+-0.00177*pH+-0.00520468*T+6.3564e-05*{C}_{0}+-9.4226e-05*pH*T\pm 4.7176e-05*pH*{C}_{0}+5.75147e-06*T*{C}_{0}+0.000124609*{T}^{2}+1.58608e-06*{C}_{0}^2$$
(4)

The statistical diagnostics test is a great and valuable method for validating the supplied model. Figure 4 depicts these diagnostic plots. It is possible to see that the data points are essentially straight-line by categorizing the fraction of predicted probability in terms of residuals (Fig. 4a). The actual responses were compared to their residuals based on predicted responses in the other diagnostic plots, indicating that the second-order polynomial model was essential to forecast retrieval effectiveness in the experimental input conditions (Fig. 4b). Furthermore, as shown in the plots (Fig. 4c), the data was homogeneous.

Fig. 4
figure 4

Diagnostic graphs for retention of rhodamine B: probability plot for the studentized residuals (a), comparison of actual and predicted values (b), the plot of the externally studentized residuals versus experimental runs (c)

The assessed model (Eq. 4) uses the RSM approach to create the 3-D plots and determine the optimum conditions for RhB removal efficiency. Figure 5 shows that the removal of RhB rises as the pH of the solution increases. In the 3D and contour plot presented in Fig. 5a and d, respectively, the interactions between temperature and pH are shown. For example, at the lower value of pH and temperature, the adsorption efficiency of prepared Na@Ac was decreasing. An increase in the pH solution and temperature led to the better removal efficiency. At pH 5 and temperature 20 °C, the adsorption percentage of the Na@Ac was 96.84%. The efficiency decreases significantly in acidic environments or below the optimum pH. It was clear from Fig. 5, that the adsorption percentage of RhB dye is strongly dependent on the solution pH and mainly related to the activated carbon’s zeta potential [27, 28]. Moreover, It was also observed that RhB concentration*temperature interaction affects the RhB adsorption efficiency onto Na@Ac significantly. In summary, based on these outcomes with three variables, the best efficiency was 96.84% for the removal of RhB and was obtained at pH 5, temperature: 20 °C, and initial concentration: 33.2 mg/L (Table 2).

Fig. 5
figure 5

a, b, and c 3D response surface plot and d, e, and f contour plot for the impact of variables on the Rhodamine B sorption efficiency

3.2 Kinetics and regeneration studies

This work used the pseudo-first-order and the pseudo-second-order kinetic models to study the kinetic behavior of RhB adsorption onto the Na@Ac. The pseudo-first-order kinetic model [29] is often appropriate for the adsorption process’s first 20 to 30 min [30]. This model assumes the reversibility of the adsorption process [31]. The following equation expresses this model:

$${\mathrm{q}}_{\mathrm{t}}{=}{\mathrm{q}}_{\mathrm{e}}{(1-}{\mathrm{e}}^{-{\mathrm{k}}{\mathrm{1t}}}{)}$$
(5)

In contrast to the pseudo-first-order model, the pseudo-second-order kinetic model [32], predicts the behavior throughout the whole range of adsorption time scales. The pseudo-second-order model assumes that the rate-limiting step may be chemisorption, which implies valence forces by electron sharing or exchange between the sorbate and the sorbent [33]. The following expression gives the pseudo-second-order equation:

$${\mathrm{q}}_{\mathrm{t}}{=}\frac{{\mathrm{k}}_{2}{{\mathrm{q}}_{\mathrm{e}}}^{2}{\mathrm{t}}}{{1} + {\mathrm{k}}_{2}{{\mathrm{q}}}_{\mathrm{e}}{\mathrm{t}}}$$
(6)

where k1 is the rate constant of pseudo-first-order in min−1 and k2 is the rate constant of pseudo-second-order in (g mg−1 min−1), and qt and qe represent the quantity of solute adsorbed at time t and equilibrium, respectively.

Figure 6 depicts the effect of contact time on the adsorption of RhB onto Na@Ac. The result demonstrates that the sorption uptake of RhB increased gradually with time and reached about 96% removal efficiency at 60 min. This relatively fast kinetic may be due to the high number of available binding sites on the surface of the Na@Ac, which reduced drastically as time passed. Other researchers have observed similar findings [12, 34]; and it is explained that as time progresses, the number of unoccupied sites reduces, and hence, the adsorption process approaches saturation. To predict the linear correlations between the experimental data points and equilibrium, the pseudo-first-order (PS1) and pseudo-second-order (PS2) order models were applied (Fig. 6b). The correlation coefficients, R2 for the PS1 and PS2 models were 0.922 and 0.971, respectively. Coupled with its higher R2 value, the PS2 estimated the equilibrium uptake (qe = 35.9 mg/g) slightly above the experimental value of 32.27 mg/g, suggesting that equilibrium was almost reached. These findings revealed that the RhB sorption follows the PS2 kinetic model, and hence portrays the chemical nature of the interaction between the RhB molecules and active sites of Na@Ac.

Fig. 6
figure 6

a Experimental data of contact time effect on the sorption of RhB onto Na@Ac. b The solid and dash lines represent the pseudo-first-order and pseudo-second-order modeling fitting, respectively

The reusability of the Na@Ac green-activated carbon is essential to its practical implementation. After each cycle, 10 mg of Na@Ac laden with RhB was agitated with 10 mL ethanol solution for 30 min, and then the mixture was washed three times with milliQ water and finally dried at 110 °C for next use. In this work, the reused performance of Na@Ac is illustrated in Fig. 7. The adsorption performance of Na@Ac was relatively efficient at removing RhB after the five cycles. The adsorption efficiency of RhB on Na@Ac was around 91.8%, up to the fifth cycle. The current study concludes that Na@Ac is an effective green material owing to its outstanding activity and good reuse performance, as well as its good performance for the elimination of Rhodamine B. Therefore, its usage in an industrial process is plausible.

Fig. 7
figure 7

Reusability cycles for RhB removal on Na@Ac. (Experimental conditions: C0 = 33.2 mg/L, pH = 5, m = 10.0 mg, V = 10.0 mL, T = 20 °C and time = 60 min)

Table 5 reports the maximum RhB dye adsorption capacity of the Na@Ac produced in this paper and those of some usual agricultural wastes-based activated carbons from the literature, chosen for their composition close to the studied activated carbon. Even though the direct comparison of Na@Ac with other adsorbents is fairly challenging owing to the diverse experimental conditions utilized, it has been determined that the Na@Ac adsorption capacity for RhB is among the highest. Therefore, considering the adsorption capacities of other considered agricultural wastes-based activated carbon, low cost, accessibility, and environment-friendly green-material, it can be concluded that the activated carbon produced from argan nutshell via chemical activation at 600 °C (Na@Ac) proved to be a promising low cost-effective adsorbent to remove rhodamine B dye from aqueous solutions.

Table 5 Reported experimental adsorption capacities (mg/g) of various agricultural wastes-based adsorbents with a composition close to the studied activated carbon

3.3 DFT calculations

3.3.1 Geometry optimization

Geometry optimization and frequency of RhB dye were performed by applying the density functional theory (DFT) using Becke-three-Lee–Yang–Parr (B3LYP) with the 6-31G (d, p) basis set [47]. The computations were done utilizing Gaussian 09 [48] software package, and the optimized structure of RhB dye is illustrated in Fig. 8.

Fig. 8
figure 8

Optimized structure of RhB dye by DFT/B3LYP/6-31G (d, p) level of theory. Dark gray is C, red is O, and blue is N

3.3.2 Frontier molecular orbital analysis (FMOs)

The highest occupied molecular orbital (HOMO) and the lowest unoccupied molecular orbital (LUMO), which are known as molecular orbitals (MOs) as well as their gap (∆E), are very significant factors in quantum chemistry. The HOMO represents the area of a molecule that can donate an electron, while LUMO represents the area of a molecule that can accept an electron [49]. Figure 9 illustrates the plot of MOs (HOMO and LUMO) for the RhB dye. As described in this figure, the HOMO orbital is essentially located on the two benzene rings substituted by +N(Et2) and N(Et2), while the LUMO orbital is situated over the benzene ring substituted by RCOOH. These results indicate that both benzene rings substituted by +N(Et2) and N(Et2) are electron donors and the other benzene ring substituted by RCOOH is an electron acceptor. Therefore, hydrogen bonding and π-π interactions may be preferred onto Na@Ac adsorbent.

Fig. 9
figure 9

Atomic orbital compositions of the frontier molecular orbital of RhB dye

3.3.3 Molecular electrostatic potential (MEP) mapping

To better understand the chemical reactivity and electron density change in the RhB dye, the molecular electrostatic potential (MEP) and electrostatic potential (ESP) surfaces were generated. The results are presented in Fig. 10. The MEP characteristic is beneficial for studying reactivity in molecular modeling research [50]. Different colors denote the varied electrostatic potential values of the surface; for example, the dark red areas represent the highest electron density (more negative potential), whereas the blue areas characterize the lowest electron density (more positive potential) [51]. The MEP plot of the RhB dye reveals that the C = O group favors the electrophilic attack, and the O–H group favors the nucleophilic attack. The large yellow area around the two benzene rings substituted by +N(Et2) and N(Et2) indicates that these regions may favor the electrophilic attacks. A red-to-yellow coloration of the carbonyl groups in the ESP plot suggests that the electron density is more concentrated on the oxygen atoms.

Fig. 10
figure 10

A Molecular electron potential energy surface (ESP) for RhB dye, B contour map of molecular electrostatic potential surface (MEP) for RhB dye

Based on the results of MOs and MEP plots and the Mulliken atomic charges of RhB dye (Table 6), we can conclude that the C = O group is an attracting electron or charge part while the O–H group is donating an electron or charge part from the adsorbent. The two remaining benzene groups, substituted by +N(Et2) and N(Et2), may interact as attractive groups. The possible adsorption mechanism of RhB onto Na@Ac is given in Fig. 11.

Table 6 Mulliken atomic charges of RhB dye
Fig. 11
figure 11

Schematic representation of the hydrogen bonding and the π–π interaction between RhB/Na@Ac

4 Conclusion

Conventional synthesis of argan nutshell, an abundant co-product, was used as a precursor for activated carbon production and studied to remove RhB dye in an aqueous solution. This manuscript aimed to investigate the performance of the adsorption process towards Rhodamine B dye onto Na@Ac. Kinetic investigation revealed that the adsorption of RhB on Na@Ac followed a pseudo-second-order model, with a maximum uptake capacity of 35.9 mg/g for RhB. Based on RSM, the results demonstrated that the maximum efficiency was 96.84% for removing RhB and was obtained at pH 5. DFT calculations suggest that hydrogen bonding and π-π interactions are likely the main keys controlling the RhB dye adsorption onto Na@Ac. The present research shows that Na@Ac is an effective green material due to its excellent activity and reuse performance and its strong performance in removing Rhodamine B. Therefore, its industrial application is conceivable.