1 Introduction

Organic dyes are mainly used to modify the color of various products, such as textile, leather, paper, and food processing, etc. (Cai et al. 2020). However, residual dyes in wastewater are one of the highly toxic and carcinogenic chemicals for human and aquatic life (Li et al. 2020b). Recently, numerous approaches have been developed to remove dyes from wastewater, such as biodegradation, chemical oxidation, and adsorption, etc. (Cheng et al. 2021a). Among these approaches, adsorption is the most promising approach due to the low cost of adsorbents, the high removal efficiency, and the less requirement during the pre-treatment process (Li et al. 2020c). In recent years, several types of adsorbents (e.g., porous biochar, activated carbon, magnetic materials, and functional polymers) have been explored for the highly efficient removal of dyes from wastewater (Ambika et al. 2022).

Biochar is an eco-friendly, economical, and porous carbon material which presents great potential to act as an adsorbent for the removal of contaminants from aquatic environments. However, biochar, conventionally produced from slow pyrolysis of biomass in the inert atmosphere without any modification, usually presents a low adsorption capacity due to the limitation of specific surface area (SSA) and the lack of specific functional groups (Ling et al. 2017; Xu et al. 2016; Yuan et al. 2023). Hence, the increasing of the specific surface area of biochar and the incorporation of some specific functional groups in biochar are two promising methods to promote its adsorption capacity. First, physical or chemical activation method can remarkably improve the SSA of biochar. Compared to the physical activation method (e.g., water vapor and CO2), activated biochar prepared by chemical activation method using the alkali or acid solutions (e.g., KOH, NaOH, H3PO4) usually had a more well-developed pore structure with higher value of SSA over 1000 m2 g−1 (Yang and Qiu 2010; Yazidi et al. 2020). Second, the incorporation of the heteroatoms (e.g., N, S, P, and B) into biochar is a viable method for tuning the surface chemical structure of biochar through introducing new active sites and defects, which could further increase the adsorption capacity of biochar (Fan et al. 2022; Pan et al. 2021; Shentu et al. 2022). Compared with other heteroatoms, the atomic size of N atom is much closer to that of C atom. Therefore, the C atom in the carbon skeleton of bio-char can be easily replaced by N atom. The incorporation of N species on biochar can provide extra π electrons in the sp2-hydrid carbon skeleton, which can promote the interactions between dye molecules and the carbon skeleton, resulting in higher removal efficiency of dyes (Wan et al. 2020; Zhen et al. 2021).

Traditional N doping biochar is prepared by the co-pyrolysis of biomass and exogenous nitrogen sources (e.g., ammonia, urea, and melamine). The N atoms can be incorporated into the carbon-net framework via a series of chemical reactions (i.e., direct cyclization, dehydration, decarbonylation, decarboxylation, and Millard reaction) (Chen et al. 2018a, 2017; Leng et al. 2020). The gaseous ammonia (NH3) and the liquid aqueous ammonia (NH3·H2O) are two typical nitrogen sources for preparation of N-doped biochar. First, the gaseous NH3 can be used as the reaction atmosphere to replace the conventional inert atmosphere (e.g., N2 or Ar) during biomass pyrolysis for the incorporation of N atom in biochar. During this process, NH3 would firstly dissociate into the radical of NH2* and NH*, and then react with the O-containing functional groups of biomass via the Maillard reaction, resulting in an incorporation of N element into the biochar (Chen et al. 2018b; Luo et al. 2014). Yu et al. (2018) and Lian et al. (2016) prepared the N-doped biochar by biomass pyrolysis in NH3 atmosphere. The content of N remarkably increased in biochar compared to the raw feedstock, indicating that the N element has been well doped into the biochar. Furthermore, the NH3 atmosphere was in favor of developing the microporous structure due to the consumption of oxygen functionalities. Second, the liquid NH3·H2O is another nitrogen source which can be incorporated into the biochar during the biomass hydrothermal carbonization process. Xu et al. (2019) prepared N doped biochar by ball-milling process between biochar and the ammonium hydroxide. Results showed that the –NH2 and C≡N groups were introduced successfully in the biochar through the reaction between the O-containing groups and the NH3·H2O molecules. Schipper et al. (2019) demonstrated a cheap and sustainable ammonothermal approach towards nitrogen-doped porous carbons. During this process, NH3·H2O was used as the liquid nitrogen source and the nitrogen content of N-doped porous carbons could reach up to 7 wt.% after post carbonizations. Although N element can be incorporated effectively into biochar by using the nitrogen source of gaseous ammonia (NH3) and the liquid aqueous ammonia (NH3·H2O), the relatively low specific surface area of biochar limits its adsorption performance (Feng et al. 2021; Świetlik et al. 2014). Therefore, the improvement of the specific surface area of biochar and the incorporation of the N species in biochar are both important two aspects for the highly efficient removal of contaminant in wastewater. The incorporation of N species coupled with the chemical activation of biomass might be an ideal approach to producing N-doped porous biochar with high surface area and excellent performance for the adsorption of organic dyes in wastewater. Torrefaction pretreatment is a mild pre-pyrolysis process at the temperature range of 180 to 300 ºC. It is traditionally used to improve the calorific value of biomass by regulating the element distribution in biomass, namely increasing the C content and reducing the O content through a series of deoxygenation reaction. According to the different reaction mediums, torrefaction pretreatment can be divided into the following two approaches, which are the dry torrefaction (DT) in the gaseous atmosphere and the wet torrefaction (WT, also known as low temperature hydrothermal carbonization) in the aqueous solution (Kambo and Dutta 2015). If the gaseous ammonia (NH3) and the liquid aqueous ammonia (NH3·H2O) were employed as the reaction medium in DT and WT respectively, the N species could be incorporated into the biomass prior to chemical activation via the Millard reaction. By using the gaseous ammonia (NH3), Ma et al.’s group (Li et al. 2021; Ma et al. 2019b) developed the ammonia (NH3) dry torrefaction pretreatment (ADT) to regulate the element distribution of bamboo and microalgae, and found that the content of nitrogen in bamboo and microalgae increased from 0.03% and 8.3% to 7.59% and 11.51%, respectively. These results indicated that the ammonia torrefaction process could efficiently introduce the N-containing groups in the biomass. By using the liquid aqueous ammonia (NH3·H2O), Feng et al. (2021) constructed the N-doped hierarchical biochar by the ammonia wet torrefaction pretreatment (AWT) coupled with KOH chemical activation. After that, the N species has been successfully incorporated into biochar, and the BET surface area reached its maximum value of 1982.67 m2 g−1. The N-doped hierarchical biochar could effectively remove phenol from the wastewater. Therefore, the ammonia torrefaction pretreatment of biomass coupled with the chemical activation is a promising approach to producing N-doped hierarchical biochar with excellent adsorption performance of contaminant in wastewater. Inspired by the above intuition, combining ammonia (NH3) dry torrefaction pretreatment (ADT) and ammonia (NH3·H2O) wet torrefaction pretreatment (AWT) onto biochar is expected to greatly confer high excellent high specific surface area and improve its organic dyes adsorption performance. However, correlative studies on organic dyes-targeted N-doped hierarchical biochar have rarely been reported until now.

This work aims to prepare an N-doped hierarchical biochar with high specific surface area by combining ammonia (NH3·H2O) wet torrefaction pretreatment (AWT) and alkali activation methods and apply it to the efficient removal of organic dyes. The elements composites, chemical structures and microstructures of N-doped hierarchical biochar were characterized by a variety of techniques. The adsorption kinetics and isotherms kinetics were  investigated to elucidate the adsorption process of MO. Meanwhile, the relationship between the absorption capacity and the pore structure parameters of N-doped hierarchical biochar was deeply studied and the adsorption mechanism was illustrated. Besides, the N-doped hierarchical biochar presented the excellent reusability. Furthermore, the main adsorption sites were further identified by density functional theory (DFT) calculation. The present work provided a novel sustainable strategy for the preparation of highly efficient bio-based adsorbents for removing organic dyes from aqueous solution.

2 Materials and methods

2.1 Materials

NH3·H2O, KOH, and HCl were purchased from Sinopharm Chemical Reagent Co., Ltd (Shanghai, China). Methyl Orange (C14H14N3NaO3S, Ind.) was obtained from Shanghai Yuanye Bio-Technology Co., Ltd (Shanghai, China). Poplar wood (PW) chip was collected from Zhejiang Treezo Investment Group, Co., Ltd in Hangzhou, China. Before the ammonia torrefaction pretreatment, the sample was milled into powder with a particle size of 40 ~ 60 meshes by a grinder (ML-1000, Wuyi Haina Instrument Technology Co., Ltd.) and then dried at 105 ºC for 12 h in an oven, and stored in a desiccator for further use.

2.2 Preparation of the N-doped hierarchical biochar

The N-doped hierarchical biochar was prepared by the ammonia torrefaction pretreatment coupled with KOH chemical activation process using poplar wood as feedstock. First, the ammonia (NH3) dry torrefaction pretreatment (ADT) and the ammonia (NH3·H2O) wet torrefaction pretreatment (AWT) was employed to incorporate N species in poplar wood. Figure 1 presents the schematic diagram of the tube furnace and autoclave for the ammonia dry and wet torrefaction pretreatment. During the ADT process, 5 g PW powder was torrefied in a tube furnace at 200 ~ 300 ºC for 1 h under the NH3 atmosphere. The ammonia dry torrefied PW was named as ADT-200, ADT-250, ADT-300, where the number of 200, 250, and 300 was the ADT temperature. During the AWT process, PW powder (5 g) and NH3·H2O ((25 g L−1), 55 mL) were added into a 100 mL stainless steel reactor (Anhui Kemi Machinery Technology Co., Ltd) at 200 ~ 300 ºC for 1 h. The ammonia wet torrefied PW was named as AWT-200, AWT-250, AWT-300. Then, the torrefied PW and KOH at a mass ratio of 1:2 were mixed, then activated at 800 ºC with a heating rate of 10 ºC min−1 for 1 h under an N2 atmosphere. After that, the activated sample was washed with 0.1 mol L−1 of HCl and deionized water until neutral, then it was dried at 85 ºC for 6 h. Finally, the N-doped hierarchical biochar was collected, and was named as ADTC-200, ADTC-250, ADTC-300, AWTC-200, AWTC-250, and AWTC-300, respectively. Besides, the blank samples of biochar were dry and wet torrefied at 300 ºC without the ammonia source (named as DT-300 and WT-300), and activated at 800 ºC using KOH. These two blank samples of activated biochar were named as DTC-300 and WTC-300.

Fig. 1
figure 1

The experimental scheme of this work

2.3 Characterization of the torrefied poplar wood and the N-doped hierarchical biochar

The ultimate analysis of the sample was determined using an elemental analyzer (Vario EL III, Elementary, Germany). The surface microstructure of sample was analyzed using the scanning electron microscope (SEM, SU-8010, Hitachi, Japan). The Brunauer–Emmett–Teller (BET) surface area, pore size, and pore volume of the sample were analyzed with an Automatic Surface Area and Pore Analyzer (ASAP2460, Micromeritics, USA). The biochar structure was characterized by X-ray Diffraction (XRD 6000, Shimadzu, Japan) with Cu Kα radiation, scanning was run from 10° to 80° (2θ). Raman spectra of the sample were recorded using a Renishaw InVia micro-Raman spectrometer with laser excitation at 633 nm. The surface functional group of the sample was analyzed with an FT-IR spectrophotometer (Nicolet 6700, Thermo Fisher Scientific, USA). The surface chemical states of the catalyst were analyzed by X-ray photoelectron spectrometry (XPS) using a K-Alpha spectrometer with Al Kα radiation (Thermo Fisher Scientific, USA).

2.4 Adsorption experiments of organic dyes using the N-doped hierarchical biochar

The methyl orange (MO)was selected as a model dye to investigate the adsorption behavior of the biochar. Briefly, 50 mg obtained biochar was dispersed into 100 mL methyl orange solution of 300 mg L−1 under vigorous stirring at 298 K. After that, 5 mL solution was filtered with a filter membrane (0.2 μm) to remove the residue solids. The concentration of methyl orange solution was detected with an ultraviolet spectrophotometer (UV-2400, Shanghai SUNNY HENGPING Scientific Instrument Co., Ltd, China). The adsorption capacities (qe, mg g−1) of dye were calculated by using Eq. (1):

$${\text{q}}_{{\text{e}}} = ({\text{C}}_{0} - {\text{C}}_{{\text{e}}} ) \times {\text{V}}/{\text{M}}$$
(1)

where C0 and Ce are the initial concentration and the equilibrium concentration (mg L−1) of the methyl orange solution, respectively. V is the solution volume (L), and M is the adsorbent mass (g).

The spent biochar was collected by centrifugation after each run followed by 3 washings with deionized H2O. The spent biochar was directly applied to the adsorption experiment. And after the fifth adsorption experiment, the spent biochar was collected to regenerate at 500 ºC under N2 for 30 min, then used to absorb the methyl orange again.

2.5 Kinetics studies of the adsorption of methyl orange

The pseudo-first-order model (Eq. (2)) and pseudo-second-order model (Eq. (3)) were used to predict the adsorption mechanism of methyl orange on the surface of biochar. The kinetic experiment of biochar was performed using 100 mL methyl orange solution (300 mg L−1) and 50 mg biochar sample at 298 K. The intra-particle diffusion model (Eq. (4)) was performed for the rate-determining step of biochar for methyl orange removal in a liquid system.

$${\text{q}}_{{\text{t}}} = {\text{q}}_{{\text{e}}} (1 - {\text{e}}^{{ - {\text{k}}_{1} {\text{t}}}} )$$
(2)
$${\text{t}}/{\text{q}}_{{\text{t}}} = 1/{\text{k}}_{2} {\text{q}}_{{\text{e}}}^{2} + {\text{t}}/{\text{q}}_{{\text{e}}}$$
(3)
$${\text{q}}_{\text{t}} = {{\text{k}}_{\text{dif}}}{\text{t}}^{0.5}+ {\text{C}}$$
(4)

where k1 (min−1), k2 (min−1), and kdif (mg g−1 min−1/2) are the rate constants of pseudo-first-order, pseudo-second-order, and intra-particle diffusion models, respectively. C is the film thickness.

2.6 Isotherms studies of the adsorption of methyl orange

The linearized Langmuir model (Eq. (5)), the Freundlich model (Eq. (6)), and the Temkin model (Eq. 7)) were employed to investigate the adsorption isotherms of biochar for evaluating the distribution of methyl orange molecules in the solid samples and liquid phase when the adsorption process achieved equilibrium. The experiments of adsorption isotherm were conducted with 50 mg as-obtained biochar added into 100 mL methyl orange solution ranging from 270 ~ 390 mg L−1 condition.

$${\text{Langmuir: C}}_{\text{e}} / {\text{q}}_{\text{e}}={\text{C}}_{\text{e}} / {\text{q}}_{\text{max}}+1/({\text{K}}_{\text{L}}{{\text{q}}}_{\text{max}})$$
(5)
$$\text{Freundlich:} \,\, {\text{ln q}}_{\text{e}}= {\text{lnK}}_{\text{F}} +1/ {\text{nln C}}_{\text{e}}$$
(6)
$${\text{Temkin:q}}_{{\text{e}}} = {\upbeta }\ln {\upalpha } + {\upbeta }\ln {\text{C}}_{{\text{e}}}$$
(7)
$${\upbeta } = {\text{RT}}/{\text{b}}$$
(8)

where qmax (mg g−1) is the maximum adsorption capacity of MO. KL (L mg−1), KF (L mg−1), β (L mg−1) are the adsorption constants of Langmuir, Freundlich, and Temkin models, respectively. 1/n and b (J mg−1) are the adsorption intensity constant of Freundlich and the adsorption heat constant of Temkin, respectively. R = 8.314 L mol−1 K−1.

2.7 Density functional theory calculations

The calculation of density functional theory (DFT) was carried out with the Vienna Ab Initio Simulation Package (VASP) (Kresse and Furthmüller 1996). The correlation potential and exchange were calculated with the general gradient approximation (GGA) in the scheme of Pedew-Burke-Ernzerho (PBE) functional. The energy cutoff was fixed as 450 eV. The convergence criteria for self-consistent calculation were settled as 10–4 eV. The convergence threshold for forces was settled as less than 0.05 eV. Monkhorst–Pack k-point mesh of 3 × 3 × 1 was selected for all calculations and a 20 Å vacuum layer was added along the Z-direction to minimize spurious effects. As shown in Additional file 1: Fig. S1, a supercell (5 × 11) of single-layer graphite was used as the calculation model. Then, the corresponding C atoms were replaced by N atoms to construct the models of graphite-N, pyridine-N, and pyrrole-N sites. The following formula was used to calculate the adsorption energy of methyl orange on different N sites of N-doped biochar surface:

$${\text{E}}_{\text{ads(MO)}}={\text{E}}_{\text{MO/biochar}} - {\text{E}}_{\text{MO}} - {\text{E}}_{\text{biochar}}$$
(9)

Eads(MO) represents the adsorption energies of methyl orange on the N-doped biochar surface. Ebiochar is the energy of slabs, including graphite-N, Oxidized-N, pyridinic-N, and pyrrolic-N. EMO is the energy of methyl orange and EMO/biochar is methyl orange molecule adsorption on the surface of biochar, respectively. All the energies are based on optimized structures.

3 Results and discussion

3.1 Characterization of torrefied poplar wood and the N-doped hierarchical biochar

3.1.1 Ultimate analysis of torrefied poplar wood

Table 1 lists the effect of ADT and AWT on the mass yield and element distribution of PW. The mass yields of the ADT and AWT pretreated PW both gradually declined with increasing torrefaction temperature due to the thermal degradation of carbohydrates in PW (Li et al. 2021). In addition, the mass yield of AWT treated PW was much lower than that of ADT treated PW at the same temperature, indicating that the thermal degradation degree of AWT was stronger than that of ADT. The element distribution of PW changed greatly after the torrefaction pretreatment, especially for the C, O, and N elements. First, the C element increased a lot after ADT and AWT, rising from 45.62% of PW to 62.88% of ADT-300 and 71.32% of AWT-300, respectively. Second, the O element declined remarkably after ADT and AWT due to the deoxygenation reaction at higher torrefaction temperature, reaching the maximum deoxygenation rates of 47.30% (ADT-300) and 75.59% (AWT-300). Third, the N element remarkably increased from 0.17% of PW to 11.50% of AWT-300 and 7.59% of ADT-300, showing that the N element from the NH3∙H2O and NH3 have been incorporated successfully into the torrefied PW through the Maillard reactions. It was worth noting that the N-doping rate of AWT was higher than that of ADT. This was caused by the fact that the heat and mass transfer between PW and NH3∙H2O in the aqueous solution was better than that between PW and NH3 in the gaseous atmosphere. In conclusion, AWT could not only remove more oxygen element from PW than ADT, but incorporate more nitrogen element in torrefied PW than ADT as well. The torrefied PW obtained in the ammonia environment was an excellent precursor which could be converted into N-doped hierarchical biochar after chemical activation.

Table 1 Effect of ADT and AWT on the mass yield and element distribution of PW

3.1.2 Evolution of the surface functional groups on torrefied poplar wood

Additional file 1: Fig. S2 shows the FT-IR spectra which were conducted to explore the evolution of the surface functional groups of torrefied PW after torrefaction. All FT-IR spectra of samples displayed the peaks at about 3465 cm−1, 1633 cm−1, 1400–1250 cm−1, 1125–1014 cm−1, and 500–800 cm−1, which were assigned to the stretching vibrational modes of –OH/–NH, C=O, C–N, C–O, C–H, respectively (Ma et al. 2019c; Xu et al. 2019). Compared with the raw PW, the intensity of –OH/–NH, C=O, and C–O in the WT-300 and DT-300 samples decreased, indicating that the oxygen element was removed after torrefaction pretreatment. However, the intensity of the wide peak at 3465 cm−1 (attributed to –OH/–NH) increased after the ammonia torrefaction pretreatment, which confirmed the N-containing groups had been introduced into the structure of torrefied PW.

Figure 2 shows the evolution of N-containing functional groups at varying torrefaction temperatures through XPS analysis. Three typical peaks (pyridinic-N at 398.1 eV, pyrrolic-N at 399.4 eV, and graphitic-N at 401.1 eV) could be observed in the spectra of torrefied PW (Ma et al. 2019b). The N element was incorporated into the torrefied PW through the Maillard reactions between the NH2*/NH* radicals from the ammonia source and the O-containing functional groups from PW. The pyrrolic-N accounted about 60–80% of the total N-containing functional groups and was the dominant N-containing specie in the torrefied PW. The relative content of the pyridinic-N and graphitic-N gradually increased with the increasing torrefaction temperature, while that of the pyrrolic-N decreased. In addition, the relative content of the pyrrolic-N of ADT treated PW was higher than that of AWT pretreated PW, while the relative contents of pyridinic-N and graphitic-N presented an opposite trend. This result indicated that AWT pretreatment on PW was in favor of the formation of pyridinic-N and graphitic-N, which could act as the adsorption active sites for the dyes (Hou et al. 2020; Huang et al. 2023).

Fig. 2
figure 2

XPS analysis of ADT and AWT treated PW at varying torrefaction temperatures

3.1.3 Textural properties of the N-doped hierarchical biochar

The morphology of the N-doped hierarchical biochar prepared by combined approaches of the ammonia torrefaction pretreatment and the KOH chemical activation is displayed in Fig. 3a–c and Additional file 1: Fig. S3. As shown in Fig. 3a, pore structure in PWC without torrefaction pretreatment looked like a fragmentized and irregular thick sheet with a porous structure. It can be seen that a more ordered arrangement of pore structure was observed in the N-doped hierarchical biochar (Fig. 3b, c). In addition, tinier honeycomb-like pore and larger average pore size were observed in the N-doped hierarchical biochar at higher torrefaction temperature. In summary, the SEM images of biochar showed the “honeycomb-like” morphology, exhibiting a large number of multilayer pores with the pore size ranging from 0.83 to 2.56 μm.

Fig. 3
figure 3

The SEM images (ac), the N2 adsorption–desorption isotherms (d), and the pore size distribution curves (e) of the N-doped hierarchical biochar prepared by combined approaches of the ammonia torrefaction pretreatment and the KOH chemical activation

The N2 adsorption–desorption isotherms and the pore size distribution curves of the N-doped hierarchical biochar are displayed in Fig. 3d, e. For all samples, the adsorption curves of the isotherms exhibited two adsorption phenomena, located at the low (P/P0 < 0.1) and high (0.45 < P/P0 < 0.99) relative pressure, respectively. The adsorption of nitrogen at a low relative pressure (P/P0 < 0.1) was mainly assigned to the monolayer adsorption on micropores. The capillary condensation was observed at high relative pressure (0.45 < P/P0 < 0.99). According to the IUPAC classification, all samples exhibited type I/IV isotherm with H4 hysteresis loop (Zhou et al. 2022). The micro-mesoporous structure in the N-doped hierarchical biochar was observed in the pore size distribution curves, leading to the enhancement of the mass transfer during the adsorption process of organic pollution (Zheng et al. 2020).

Table 2 summarizes the textual property of the N-doped hierarchical biochar. For the biochar without torrefaction pretreatment (PWC), the specific surface area (SSA) and total pore volume were 1401.82 m2 g−1, 0.684 cm3 g−1, respectively. The pore volume analysis results suggested that the content of micropore volume and the mesopore volume were 0.556 and 0.128 cm3 g−1, respectively. It can be seen that the SSA and pore volume of biochar increased to 1845.51 m2 g−1 and 0.877 cm3 g−1 of DTC-300 and 2111.03 m2 g−1 and 0.954 cm3 g−1 of WTC-300 after the torrefaction pretreatment. These results could be attributed to the change of surface structures and the reformation of inside pore structure during the torrefaction process (Zhang et al. 2016). Furthermore, the SSA of biochar derived from ammonia-torrefied PW (ADTC-300 and AWTC-300) further increased from 1845.51 and 2111.03 m2 g−1 to 2165.64 and 2324.61 m2 g−1, respectively. Simultaneously, the total pore volume increased from 0.877 and 0.954 cm3 g−1 to 1.015 and 1.099 cm3 g−1. The –NH2 functional groups of the ammonia torrefied PW could release NH3 and NH3 could dissociate to the radicals (*NH, *NH2 and *H) at the high temperature (Chen et al. 2018b; Tian et al. 2013), which could further etch the biochar to form the microporous structure (Zhu et al. 2018a). Besides, NH3 could also activate with the N-doped hierarchical biochar via the reaction of 3C (s) + 4NH3 (g)→2N2 (g) + 3CH4 (g) (Luo et al. 2014). The result of ultimate analysis displayed that N content decreased from 7.59% and 11.50% of torrefied-PW to 4.51% and 5.03% of N-doped hierarchical biochar, as shown in Table 1 and Additional file 1: Table S1, which further confirmed the N-containing functional groups involved in the activation process of biochar. In addition, the biochar derived from AWT exhibited higher SSA and higher pore volume compared to that from ADT. This is caused by two reasons: (1) The wet-torrefaction process could promote the removal of hemicellulose and the rearrangement of cellulose macromolecules in hydrothermal condition, which could more seriously destroy the internal structure of PW, which is consistent with the results reported by Zheng and Kambo (Kambo and Dutta 2015; Zheng et al. 2015). (2) The ash of PW could be efficiently removed under the aqueous condition, and the lower ash content of PW could produce the higher quality of biochar, which is confirmed by the findings of Wang et al. (2018).

Table 2 Textural parameters of the N-doped hierarchical biochar

As the literature reported, the mesoporous and microporous structures of biochar mainly formed via the degradation of cellulose and lignin, respectively (Guo and Rockstraw 2006). Table 2 shows the SSA and volume of mesopore of biochar derived from torrefied-PW increased, which was caused by the removal of hemicellulose and cellulose during the torrefaction process. The larger SSA and micro-meso hierarchical porous structure of N-doped biochar could support vital nitrogen-containing groups and oxygen-containing groups for the adsorption of dyes, thus improving the adsorption performance of N-doped biochar (Chen et al. 2020). Moreover, the micropores could appear easily capable of adsorption force to MO and mesopores can provide smaller MO-transport resistance. Therefore, the N-doped hierarchical biochar provided the most outstanding performance (qe = 564.7 mg g−1, AWTC-300).

3.1.4 Other properties of the N-doped hierarchical biochar

Figure 4 presents the XRD pattern, the Raman spectra, and the XPS spectra of the N-doped hierarchical biochar. As shown in Fig. 4a, the broad peak located at 23° and a weak one located at 43° were assigned to the (002) plane of amorphous carbon and the (100) plane of crystalline carbon, indicating that the formation of disordered carbon structure in the biochar (Zheng et al. 2023). Moreover, the diffraction peak of the (002) in AWTC-300 shifted to a high field, indicating the interplanar spacing of N-doped biochar decreased, which may be caused by abundant N atoms in the carbon skeleton (Yang et al. 2022). The diffraction peak at around 43° of biochar was relatively smooth, which is due to the damage to the graphitic structure caused by the expansion of the carbon lattice with the N doping (Qu et al. 2022).

Fig. 4
figure 4

The XRD pattern (a), the Raman spectra (b), and XPS spectra (cf) of the N-doped hierarchical biochar

As shown in the Raman spectra of the N-doped hierarchical biochar (Fig. 4b), two characteristic peaks at 1350 cm−1 and 1580 cm−1 could be observed clearly which were assigned to the D band (disorder structure of biochar) and the G band (graphitic structure of biochar), respectively, suggesting the formation of carbon net-structure during the torrefaction and activation processes (Tran et al. 2020). The ID/IG of PWC was 1.15. However, after torrefaction in inert atmosphere, the ID/IG increased to 1.18 of DTC-300 and 1.19 of WTC-300. Furthermore, after torrefaction in ammonia environment, the ID/IG continued to increase to 1.2 of ADTC-300 and 1.25 of AWTC-300. This result indicated that more amorphous structure was formed in the biochar after ammonia torrefaction pretreatment, which might be contributed by the doping of nitrogen atoms into carbon net-structure and the disruption of the graphitic structure in biochar (Zaeni et al. 2020). Among these samples of biochar, the highest value of ID/IG was observed in the sample of AWTC-300, proving that more N-containing functional groups and defects were formed in the structure of AWTC-300, which is beneficial to the absorption of organic pollution (Cai et al. 2021).

As shown in the XPS spectra (Fig. 4c), the peak at 400.0 eV was assigned to the binding energy of the N element, indicated that the N atoms had been incorporated into the biochar via the ammonia torrefaction pretreatment. According to the element analysis of the N-doped hierarchical biochar listed in Additional file 1: Table S1, the N contents in ADTC and AWTC were 4.51% and 5.03%. The C 1 s spectra of all samples in Fig. 4d could be deconvoluted into three peaks, i.e., C–C/C=C at 284.9 eV, C–O/C–N at 285.4 eV, and O–C=O at 288.9 eV (Ma et al. 2019a). The relative content of C–C/C=C in PWC was 71.11% which was higher than that of AWTC-300 (69.3%) and WTC-300 (49.18%) due to more amorphous carbon formed after torrefaction pretreatment. The characteristic peaks of biochar shifted to lower field after N doping doped because of the insertion of N atoms in the carbon skeleton. The C–O/C–N bonds were mainly contributed by the surface hydroxyl group and C–N bond in the carbon skeleton of biochar which was beneficial to the electron transfer during the π–π interaction between the biochar and the organic pollutions (Hou et al. 2020). The O 1 s spectra of biochar (Fig. 4e) could be deconvoluted into three individual peaks at around 531.1 eV, 533.0 eV, and 535.0 eV, assigned to C=O, the hydroxyl on the biochar surface and adsorbed H2O (Oads), respectively (Zhang et al. 2020). These O-containing groups could also act as active sites to absorb dyes via hydrogen bonding (Liu et al. 2011). The high-resolution N 1 s spectra (Fig. 4f) could be deconvoluted into four characteristic peaks at 398.7 eV (Pyridinic-N), 399.9 eV (Pyrrolic-N), 401.3 eV (Graphitic-N), and 404.5 eV (Oxidized-N) (Ji et al. 2021; Lyu et al. 2022). The content of pyridinic-N and graphitic-N in AWTC-300 was much higher than that of ADTC-300, and these species were reported as the main adsorption active sites for dyes (Hou et al. 2020; Huang et al. 2023).

3.2 The adsorption performance of the N-doped hierarchical biochar

Figure 5a shows the adsorption performance of the N-doped hierarchical biochar. The PWC provided 272.4 mg g−1 of adsorption capacity of MO. And it can be seen that the adsorption capacity increased to 320.3 mg g−1 of DTC-300 and 340.2 mg g−1 of WTC-300, which is due to the higher SSA of   biochar derived from combined approaches of torrefaction pretreatment and alkali activation. Furthermore, the adsorption capacity of N-doped hierarchical biochar derived from ammonia-torrefied PW further increased to 539.2 mg g−1 of ADTC-300 and 564.7 mg g−1 of AWTC-300. This result was caused by the incorporation of the N-containing functional groups, the higher SSA and micro-meso porous structure of N-doped hierarchical biochar (Issaka et al. 2022). Besides, the N-doped hierarchical biochar derived from PW treated from different torrefaction temperatures showed different adsorption capacity. Specifically, with the torrefaction temperature increasing, the SSA and total pore volume, the content of N-containing groups of the biochar gradually increased, which leads to the adsorption capacity increased. This result was confirmed by BET, ultimate analysis and the experimental results. In addition, the electronegative graphitic-N could tune the electronic structure of adjacent carbons (asymmetric spin density and a low electron density), which could further enhance the chemical bonding interaction with the electron-rich oxygen/nitrogen atoms of the MO molecules (Zhao et al. 2013). Besides, the oxygen-containing groups (such as hydroxyl group (C–OH)) could also promote the adsorption performance of N-doped hierarchical biochar by increasing the surface adsorption energy of MO (Feng et al. 2021). It is worthwhile pointing out that the AWTC-300  showed the most excellent adsorption capacity (564.7 mg g−1) of MO, which profited from the highest specific surface area (2324.61 m2 g−1), abundant N-containing groups, and special surface electronic structure. Additionally, more defects could be found in the AWTC-300 as confirmed by XRD and Raman analysis, which further promoted the transportation of unpaired electrons, thus further improving the adsorption capacity of biochar.

Fig. 5
figure 5

The adsorption capacity of the N-doped hierarchical biochar (a), (Adsorption conditions: adsorption temperature = 298 K, concentration of MO = 300 mg L−1, and  dosage of N-doped hierarchical biochar = 0.5 g L−1), the comparison of the adsorption capacity with other samples of biochar from literatures (b)

Figure 5b lists the comparison of the adsorption performance of MO between the N-doped hierarchical biochar in this work and other biochar from literatures. Compared to other biochar samples, e.g., SLAC-Fe, BSC-M20, Fe3O4-CS, N-doped MCM@TiO2 and NPCs-0.5-800 (Chen et al. 2020; Cheng et al. 2021a; Hou et al. 2020; Sun et al. 2019; Zhou et al. 2021), the adsorption capacity of ADTC-300 and AWTC-300 provided higher adsorption capacity of MO which was mainly contributed by the higher SSA, and abundant N-containing groups, and the special surface electronic structure. Hence, the combination approach of the ammonia torrefaction pretreatment and the KOH activation was a potential method for the preparation of biochar with excellent adsorption performance.

3.3 The relationship between textural properties and adsorption performance of the N-doped hierarchical biochar

The relationship between the absorption capacity and the pore structure parameters is shown in Fig. 6a–c. It can be seen that the adsorption capacity increased with the increase of specific surface area of biochar (Fig. 6a), which is due to the fact that high SSA could provide more adsorption sites. Besides, the pore structure showed an important influence on the adsorption capacity of biochar. Figure 6b and c showed the micropore structure had a greater effect on the adsorption capacity of biochar (R2(Vmicro) = 0.512 > R2(Vmeso) = 0.109) than that of mesopore structure, which may be due to the more N-containing active sites distributed in the micropore (Feng et al. 2021). In a word, the adsorption capacity was usually related to the porosity, in detail, the excellent pore structure could be in favor of the migration of MO molecules and a large SSA could also expose abundant active sites to absorb dye molecules (Ahmed et al. 2017).

Fig. 6
figure 6

Relationship between the absorption capacity and the pore structure parameters (ac), relationship between the absorption capacity and the N content (d)

Notably, Fig. 6d  shows a highly positive correlation between the absorption capacity and the N content (p = 0.0002 < 0.05, R2 = 0.997). Specifically, the SSA of WTC-300 (2111.03 m2 g−1) was similar to that of AWTC-250 (2042.57 m2 g−1), while the AWTC-250 provided an obviously higher MO adsorption capacity (453.1 mg g−1) than WTC-300 (340.2 mg g−1). This result further indicated that the N-containing functional groups are the key influencing factor during the adsorption process.

3.4 Adsorption kinetics and isotherms studies of methyl orange

Figure 7a–c and Table 3 show the adsorption kinetics and other parameters of MO by using different kinetic models (i.e., pseudo-first-order equation, pseudo-second-order equation, and intra-particle diffusion model). As shown in Fig. 7a, a high adsorption rate of MO on the biochar by using pseudo-first-order equation was observed at the initial adsorption stage of 0–10 min, which might be caused by the strong driving force of the mass transfer derived from the high concentration difference of methyl orange between the MO aqueous solution and the biochar (Tang et al. 2018). Besides, the biochar could provide enough active sites for the adsorption of MO molecules during the initial stage of adsorption. Ten minutes later, the adsorption rate gradually decreased. The equilibrium adsorption capacities of PWC, DTC-300, ADTC-300, WTC-300, and AWTC-300 were 272.4, 320.3, 539.2, 340.2, 564.7 mg g−1, respectively. As shown in Fig. 7b, the correlation coefficient (R2) of the fitting curve using the pseudo-second-order kinetic model was higher than 0.99, indicating that the chemisorption was the dominant adsorption behavior (Wang et al. 2021). Especially, the interaction between the O-/N-containing sites and the MO was caused by the π–π dispersion interaction, donor–acceptor effect, and hydrogen bonds which could provide a strong impetus for the rapid adsorption process. Overall, chemisorption was the dominant adsorption behavior during the removal of MO using the N-doped hierarchical biochar as an absorbent (Jung et al. 2019).

Fig. 7
figure 7

The adsorption kinetics of MO (Pseudo-first-order (a), Pseudo-second-order (b), and Intraparticle diffusion (c)), (Adsorption conditions: adsorption temperature = 298 K, concentration of initial MO = 300 mg L−1, and dosage of N-doped hierarchical biochar = 0.5 g L−1), the adsorption isotherms of MO (Langmuir isotherms (d), Freundlich isotherms (e), and Temkin isotherms (f)); (Adsorption conditions: adsorption temperature = 298 K, concentration of initial MO = 270 ~ 390 mg L−1, and dosages of N-doped hierarchical biochar = 0.5 g L.−1)

Table 3 Adsorption kinetic parameters of MO dye on the N-doped hierarchical biochar

Figure 7c shows the adsorption process using the intraparticle diffusion model. The multi-liner pot of the Weber-Morris model did not pass through the origin, manifesting that the adsorption process of MO was governed by the boundary diffusion and intra-particle diffusion (Zheng et al. 2020). The high value of kdif1 (Table 3) suggested that MO molecules rapidly diffused from solution to the outer surface of biochar. The low kdif2 (Table 3) value indicated that MO molecules migrated from the external surface of biochar to the adsorption active sites. During this process, MO molecules would transfer in pore structure of biochar and intra-particle space. Besides, the adsorption–desorption balance of dye molecules also occurred at the vacant sites of biochar (Zhu et al. 2018b). The above results indicated that the external diffusion and intra-particle diffusion were the rate-limiting steps for the adsorption of MO on the N-doped hierarchical biochar (Yang et al. 2013).

The adsorption isotherms can be used to describe the distribution of MO in biochar. Therefore, the linearized adsorption isotherms (Langmuir, Freundlich, and Temkin models) were employed to investigate the relationship between the adsorption capacity of adsorbent and the equilibrium concentration of adsorbates. As shown in Fig. 7d–f and Additional file 1: Table S2, the model fitting of experimental data were evaluated by the correlation coefficient (R2). The R2 from the Langmuir model was higher than that of the Freundlich and Temkin models, indicating that the Langmuir model was more favorable to be used to evaluate the adsorption behavior of the N-doped hierarchical biochar. It is well known that the Langmuir model represents the monolayer and homogeneous distribution of the adsorbate on the surface of the adsorbent. Herein, this result indicated the MO molecules were adsorbed on the surface of biochar in the mode of monolayer. The adsorption process of the Langmuir model was described by the separation factor (RL), as defined in Eq. (10).

$${\text{R}}_{\text{L}} =1/(1+{{\text{K}}_{\text{L}}} {{\text{C}}_0} )$$
(10)

where the rate constant of the Langmuir model and initial concentration of MO are identified as KL (g L−1) and C0 (mg L−1), respectively. 0 < RL < 1 is the favorable process, while RL > 1 is the unfavorable process (Pandiarajan et al. 2018). The calculated RL value of biochar (Additional file 1: Table S2) ranged from 0.025 to 0.145, indicating the favorable adsorption process of biochar (Zong et al. 2023). At the same MO initial concentration, the RL of ADTC-300 and AWTC-300 were lower than that of PWC, DTC-300, and WTC-300, suggesting that N-modified biochar has the potential to act as an adsorbent for the efficient removal of MO from the aquatic environment.

3.5 Reusability and regeneration of the N-doped hierarchical biochar

In order to estimate the reusability of the N-doped hierarchical biochar, the absorbent was recycled after each adsorption experiment. Then, MO molecules were desorbed from the AWTC-300, and were directly applied to the next adsorption process. Figure 8 displays that the adsorption capacity of MO slightly descended with the number of experimental running, which may be due to the removal incompletely of MO from the active sites of AWTC-300. Remarkably, the fifth adsorption experiment also provided 460.8 mg g−1 of MO adsorption capacity. In addition, the used AWTC-300 at 500 °C was regenerated under N2 atmosphere, and the adsorption capacity of AWTC-300 rose back to 545.3 mg g−1 of MO. The slight decrease of adsorption capacity may be ascribed to the residual MO molecules blocking the pores of biochar. Nonetheless, the regenerative N-doped biochar also provided a high adsorption capacity of MO, which suggested the N-doped biochar could show excellent recycling performance, further exhibiting the potential for scale application.

Fig. 8
figure 8

Reusability of AWTC-300 for the MO removal. Adsorption conditions: adsorption temperature of 25 ºC, initial MO concentration of 300 mg L−1, and biochar adsorbent dosage of 0.5 g L.−1

3.6 Adsorption mechanisms of methyl orange moleculeson the N-doped hierarchical biochar

Based on the previous characterization and experimental results, the adsorption performance of N-doped biochar for the MO was determined by physical effects (e.g., pore-filling mechanism) and chemical interactions (e.g., electrostatic effect, π-π interactions, etc.) (Cheng et al. 2021b; Gao et al. 2022).

Firstly, the developed pore structure of N-doped biochar after pyrolysis and activation could provide physical space for adsorption. When the biochar prepared by the same method, the adsorption capacity of biochar improved with an increase of the specific surface area and pore volume (Table 2). Besides, the reusability of the N-doped hierarchical biochar was explored. The results showed that the adsorption capacity decreased as the number of cycles increased, which may be due to MO molecules blocking pores. Subsequently, the recovered N-doped biochar was regenerated, then its adsorption capacity reached almost the same level as the fresh N-doped biochar. Thus, it was reasonable to conclude that the pore-filling mechanism played an important role during the adsorption process.

Secondly, the analysis of the relationship between textural properties and adsorption performance of the N-doped hierarchical biochar and adsorption kinetics results indicated that the chemical interactions were the dominant in the adsorption of MO. Hence, the chemical states of the O- and N-containing functional groups before and after adsorption were studied by XPS. The XPS spectra of O 1 s and N 1 s of ADTC-300 and AWTC-300 are shown in Fig. 9a–d. The binding energy of C=O and –OH groups shifted towards lower field, suggesting that electron cloud shifted from MO molecules to hydroxyl groups on the surface of N-doped biochar. This shift may be attributed to the interaction between O-containing groups of biochar and methyl orange molecules through π-electron interaction (Ding et al. 2022; Li et al. 2020a). Especially, the binding energy of surface hydroxyl on AWTC-300 shifted to a lower field (about 0.8 eV) compared to that of ADTC-300 (about 0.3 eV). This result indicated the higher π-electron acceptor capacity of AWTC-300, thereby resulting in the more excellent adsorption performance of AWTC-300 than ADTC-300 (Ding et al. 2022). Notably, the adsorption capacity of N-doped biochar enhanced significantly, when the N-containing functional groups were introduced into the biochar (Table 2). Hence, the chemical states of the N species before and after adsorption were further investigated (Fig. 9b, d). The binding energies of N species shifted to a higher field, suggesting that they may all be involved in the adsorption of dye molecules via electrostatic interaction, the “donor–acceptor effect” and the “π–π dispersion interaction” (Cheng et al. 2022). Specifically speaking, the N species in AWTC-300 could provide the electron for the electron-deficient sites of MO molecules via the “donor–acceptor effect”. Besides, the N atoms in the ring of biochar structure could tune the electronic distribution of C atoms, which could enhance the π–π dispersion interaction between biochar and benzene ring of MO molecules (Li et al. 2020a). In addition, the oxygen/nitrogen functional groups tuned the surface electrostatic potential energy of biochar, which could enhance the Van der Waals force between molecules and active sites on the absorbent, thus promoting the electrostatic interaction and complexation interaction between biochar and methyl orange (Feng et al. 2021).

Fig. 9
figure 9

The XPS spectra of ADTC-300 and AWTC-300 after adsorption of MO. a O 1 s of ADTC-300, b N 1 s of ADTC-300; c O 1 s of AWTC-300, (d) N 1 s of AWTC-300, (e) MO absorbed on graphitic-N, (f) MO absorbed on pyridinic-N, (g) MO absorbed on pyrrolic-N, (h) MO absorbed on oxidized-N

According to the result of XPS analysis, it can be seen that the graphitic-N, pyridinic-N, pyrrolic-N, and oxidized-N were the main active sites on the N-doped biochar. However, there were differences in adsorption performance because of the different content of N species on N-doped biochar. To further explore the roles of N sites, the adsorption energy of MO molecules at different N active sites was calculated using DFT theory (Fig. 9e–h). It can be seen that the adsorption energies of MO molecules at different N active sites were −1.98 eV, −1.72 eV, −1.41 eV, and −1.13 eV, corresponding to graphitic-N, pyridinic-N, pyrrolic-N, and oxidized-N, respectively. The calculation results showed that the MO molecules would tend to interact with graphitic-N and pyridinic-N, which is similar to the adsorption of BPA on the Fe/N-biochar (Xu et al. 2022). Graphitic N is the nitrogen atom connected to three carbon atoms and maintaining the integrity of the six-membered ring. The higher electronegativity of graphitic N can accelerate the transfer of the electrons to N atoms, which will eventually lead to a decrease in the overall charge density of the carbon skeleton, thereby increasing the π-acceptor capacity of N-doped biochar (Chen et al. 2018c; Duan et al. 2014; Li et al. 2009; Liang et al. 2017). The change of charge density of carbon skeleton would enhance the adsorption performance of N-doped biochar. The pyridinic contains lone pair electrons that can form sp2 conjugated system, which is favorable for binding to MO molecule with aromatic ring π electrons through π-π dispersion interaction (Cheng et al. 2022). Meanwhile, the pyrrolic N can form weak hydrogen bonds with the MO molecules (Zhang et al. 2013). Therefore, the N-doped biochar provided abundant active sites for the adsorption of MO. Notably, the XPS analysis results showed that the graphitic-N and pyridinic-N of AWTC-300 (59.74%) were more than those of ADTC-300 (46.55%), which resulted in the more excellent adsorption performance of the AWTC-300. Based on the characterization, test results, experimental data, and DFT calculations, the proposed adsorption mechanism for MO removal on N-doped biochar (AWTC-300) is presented in Fig. 10. In summary, the MO molecules were adsorbed on the N-/O-containing active sites via the donor–acceptor effect, hydrogen bond, Van der Waals force, electronic interaction and π–π dispersion.

Fig. 10
figure 10

Proposed adsorption mechanism for the removal of MO by the N-doped hierarchical biochar

4 Conclusion

The combined approach of the ADT and the alkali activation was developed for the preparation of the nitrogen-doped hierarchical biochar with high surface area for the enhanced removal of organic dyes. Results showed that ADT could not only incorporation N element into poplar wood, but obtain the loose structure of poplar wood which made the torrefied poplar wood a better precursor for the production of activated carbon with high specific surface area. Compared with the ADT, the AWT had better performance on the N-doping rate on the biochar and higher specific surface area, resulting in higher adsorption capacity of MO. In addition, the pseudo-second-order and Langmuir model fitted well with the adsorption kinetics and isotherms of the N-doped hierarchical biochar. Based on the DFT, the N-/O-containing functional groups, especially the graphitic-N and pyridinic-N, were the dominant adsorption active sites of MO. This work provides a new strategy for preparing highly efficient N-doped biochar to purify the dye wastewater.