Introduction

Agricultural waste is one of the valuable and renewable organic resources. The annual straw production is more than 600 million tons in China, which is one of the largest sources of agricultural waste. The untreated straw is burned directly at random, which has a negative impact on the ecological environment. So, it is imperative to recycle these wastes for reducing energy consumption, improving resource utilization and promoting the sustainable development of agricultural production. At present, the resource utilization of straw has the following aspects: (1) energy generation; (2) fertilizer; (3) feed for livestock; (4) cultivation medium and (5) product application (e.g., plant fiber mulch, enzyme and biochar) (Awual et al. 2019b, 2023; Dey et al. 2023). Biochar is derived from the thermochemical decomposition of biomass in an oxygen-limited atmosphere. There are many ways (e.g., fast pyrolysis, intermediate pyrolysis, slow pyrolysis, gasification and flash carbonization) to prepare biochar (Nartey and Zhao 2014, Wang et al. 2020a). Biochar has shown widespread use, such as soil amendment (Liu et al. 2022), catalyst support (Devi et al. 2020), adsorbent (Wang et al. 2023a), energy storage (Rawat et al. 2023) and reduction of greenhouse gases emissions (Wang et al. 2023b). In addition, biological template technology has attracted much attention for its feature of less expense and convenient operation. Biological template technology is a method of preparing synthetic materials and the produced materials, which use natural or simple artificial processed organisms or biomass as the template to prepare a product replicating and preserving the micromorphological structure of template. Therefore, the biological template technology is an effective way to improve the adsorption performance of biochar. Two hyphae/starch porous carbon materials were successfully prepared by biological self-assembly method and adsorbed rhodamine B and tetracycline hydrochloride (Zhang et al. 2022).

Phosphorus (P) is an important plant nutrient and a non-renewable resource. Phosphorus is an essential nutrient element in agricultural production, and it is also the important source of water eutrophication (Awual 2019; Tian et al. 2023). Thus, phosphorus removal and phosphorus recovery from the water have become urgent priorities. Currently, there are four main technologies for removing and recovering phosphorus from wastewater, including precipitation, biological treatment, membrane separation and adsorption. Among the various effective technologies, adsorption is considered to be the most effective and feasible method. In addition, biochar has been proven to be one of the eco-friendly and low-cost adsorbents. It is very practical to remove and recover phosphorus by straw-based biochar. However, some problems arise when straw-based biochar is used to adsorb phosphorus, such as release of water-soluble phosphorus and poor adsorption capacity (Luo et al. 2019; Melia et al. 2019; Wang et al. 2020b). Therefore, numerous researchers have focused on the modification of straw-based biochar to achieve superior phosphorus adsorption performance and to restrain the release of phosphorus. At present, the modification methods mainly include physical modification (Awual et al. 2019a), surface chemical modification, magnetic modification (Li et al. 2022b), metal and metal oxide modification (Zhu et al. 2020), mineral modification (Cao et al. 2020; Wang et al. 2021) and carbonaceous nanomaterials modification (Ai et al. 2022; Rehan et al. 2023; Waliullah et al. 2023). Adsorption properties of metal oxide modified biochar for phosphorus have shown mixed results. Mg and Ca were the most widely studied due to the strong divalent cation bridging between Mg or Ca and phosphorus. Additionally, it has been reported that materials can be prepared by combining biological template and metal oxide modification to adsorb phosphorus. For instance, MgO-doped ordered mesoporous carbon was synthesized by evaporation-induced self-assembly, which showed good phosphorus removal performance in aqueous solution (Liu et al. 2021). A needle-like MgO particle coated tea waste biochar composite (MTC) was prepared through a novel biological assembly and template elimination process to adsorb phosphorus (Feng et al. 2023). However, preparation method of straw-based biochar by combining biological template and metal impregnation to adsorb phosphorus has been rarely reported.

Therefore, the objectives of this study included: (1) to combine metal impregnation and bio-template technology to prepare rice straw-based biochar with high adsorption capacity for phosphate; (2) to investigate the adsorption process and mechanism of phosphate by the biochar; (3) to discuss the effects of environmental factors (such as pH, co-existing ions and humic acid) on phosphate removal by biochar. The results would provide a theoretical and practical basis for the use of biochar to removal of phosphate from eutrophic water bodies or wastewaters.

Materials and methods

Chemicals

MgCl2·6H2O, FeCl3·6H2O, KH2PO4, NaOH and HCl were of analytical grade and were purchased from Cologne Chemicals Co. (Chengdu, China), Ltd.

Fabrication of biochars

The preparation of biochars (BCs) in this study referred to the prepared method of MTC (Feng et al. 2023). The rice straw was washed with deionized water (DW) and dried at 60 ℃, and the dried straw was broken and passed through the 60-mesh screen. Added DW to fifty grams of powdered feedstock and boiled for 1 h. After being cooled, the slurry underwent solid–liquid separation. The liquid was stored for use as a template substance, and the solid was dried at 60 ℃. A ratio of dried solid to NaHCO3 was mixed at 1:2; then, the mixed powder was placed in a crucible and carbonized at 5 ℃/min of heating rate to 650 ℃ and kept for 1 h under nitrogen condition. Next, it was washed with 1 mol/L HCl and DW until the pH of the supernatant was stable. The supernatant was discarded, and solid was dried at 60 ℃. Two-gram rice straw biochar was impregnated with a 40 mL template solution, and the mixture was placed into an ultrasound device at room temperature for 30 min and dried at 60 ℃. The operated biochar was carbonized again and ground to screen through a 200-mesh standard sieve. The product was recorded as O-BC; 0.81 g FeCl3·6H2O and 5 g dried solid that was not mixed with NaHCO3 were immersed in 200 mL of DW and stirred for 1 h and left to separate, then dried. By adding this step, iron-containing biochar could be prepared. The sample was named as Fe-BC. By adding 11.09 g MgCl2·6H2O to the 40 mL template solution, Mg-containing biochar can be prepared. The sample was named as Mg-BC. Similarly, MgFe-BC can be obtained.

Adsorption experiments

Unless otherwise stated, all the batch experiments were performed at neutral pH and repeated three times. Sorption experiments were carried out using KH2PO4 as sources of phosphate. The accurately weighed biochar (0.05 g) and 50 mL various concentrations of phosphate solution were mixed into a 150-mL conical bottle. The pH of the initial phosphate solution was adjusted to 7. And then they were shaken for 24 h at 150 rpm. The mixture was filtered through 0.45-μm microfiltration membrane. The adsorptive capacity (q, mg/g) and the removal efficiency of phosphate were calculated by Eqs. (12):

$$q = \frac{{(c_{0} - c_{e} )V}}{m}$$
(1)
$${\text{Removal efficiency}} = \frac{{(c_{0} - c_{e} )}}{{c_{0} }} \cdot 100\%$$
(2)

where C0 and Ce represent the initial and final concentrations of phosphate (mg/L), respectively. V represents volume of solution (L); m represents mass of BCs (g).

Adsorption kinetics experiments were performed with 2 mg P/L solution for 0.25, 1, 2, 3, 4, 6, 8, 12, 16, 20, 24 and 30 h, respectively. Adsorption isotherm experiments were conducted with initial adsorptive concentrations of 0.25–10 mg P/L (0.25, 0.5, 1, 2, 5, 7.5 and 10 mg/L) at 288, 298 and 308 K, respectively. The pH of the initial phosphate solution was adjusted to 7. The concentration of phosphate in the filtrate was analyzed.

Analytical methods

Characterization techniques

The specific surface area and pore size of BCs were calculated using the Brunauer–Emmett–Teller (BET) equation through an Autosorb iQ automated gas sorption analyzer by nitrogen adsorption at 77 K (NOVAtouch). X-ray diffraction (XRD) was carried out to identify the crystallographic structure (X’Pert PRO, PANalytical). Scanning electron microscope (SEM) analysis was done on a Sigma300 (ZEISSi, Germany) sputter-coating the samples with gold to examine the surface topography. Energy dispersive spectrometer (X-MAXN20, OXFORD, UK) was used to analyze the type and content of elements in the microregion of materials. The samples were measured using a Fourier transform infrared spectrometer (FT-IR), and the spectra were recorded between 4000 and 400 cm−1. FT-IR (Spectrum One, PerkinElmer, USA) was used to analyze the surface functional groups of BCs by the intensity changes and displacements of peak adsorption. The element binding energies of BCs were investigated by the X-ray photoelectron spectroscopy (XPS) (Thermo ESCALAB 250Xi).

The determination of phosphate

The phosphate concentrations in water were analyzed using the molybdenum blue method on an ultraviolet–visible spectrometer (UV–Vis, TU-1950, Puxi, China) at a wavelength of 700 nm.

The measurement of point of zero charge

Fifty milligrams of MgFe-BC was added to 50 mL of KNO3 solution (0.001 mol/L, 0.01 mol/L, 0.1 mol/L). It should be noted that the initial pH values (pHi) of 50 mL of KNO3 solution were adjusted pH (4 to 12) by adding a small amount of HCl or NaOH solution, keeping the ionic strength constant. The mixed solutions were shaken at 25 ℃ at 150 rpm for 24 h to achieve equilibration. The final pH values (pHf) of solutions was measured after solid–liquid separation. The changes in pH were plotted with (pHi) and ΔpH (ΔpH = pHi − pHf) (Wang et al. 2022).

Data analysis

Kinetic models

To research the adsorption kinetic of phosphate on MgFe-BC, three models were used to fit the batch experimental data.

The pseudo-first-order model is shown as follows:

$$q_{t} = q_{e} \left[ {1 - \exp \left( { - K_{1} t} \right)} \right]$$
(3)

where qe is the adsorbed amount of phosphate at equilibrium (mg/g), and K1 is the pseudo-first-order rate constant (1/h).

The pseudo-second-order model is written as follows:

$$q_{t} = \frac{{q_{e}^{2} K_{2} t}}{{1 + q_{e} K_{2} t}}$$
(4)

where K2 is the pseudo-second-order rate constant (1/h).

The intraparticle diffusion model is presented as follows:

$$q_{t} = K_{ip} t^{\frac{1}{2}} + C$$
(5)

where Kip (mg/(g·h1/2)) is the intraparticle diffusion rate constant, and C (mg/g) represents the thickness of the boundary layer.

Isotherm models

Different models were used to fit the adsorption experimental data to illustrate the isotherm adsorption process.

Langmuir model can be represented as follows:

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

where qm is the maximum adsorptive capacity (mg/g), Ce is the equilibrium concentration of phosphate in the solution (mg/L) and KL is the Langmuir constant (L/mg).

Conversely, the Freundlich model is given in the following equation:

$$q_{e} = K_{F} C_{e}^{n}$$
(7)

where KF (L/mg) is the Freundlich constant, and \(n\) is the heterogeneity factor. Generally, it is considered easy adsorption when 0.1 < n < 1, whereas it is considered difficult adsorption when n > 2.

The Langmuir–Freundlich model can be expressed as follows:

$$q_{e} = \frac{{q_{g} (K_{lf} C_{e} )^{n} }}{{1{ + (}K_{lf} C_{e} )^{n} }}$$
(8)

Where \({q}_{g}\) is the maximum adsorption capacity (mg/g), \({K}_{if}\) is the affinity constant (L/mg) \(and n\) is the index of heterogeneity.

Site energy distribution

Site energy distribution theory (SEDT) studies the uneven adsorption energy on the adsorbent surface from the perspective of energy. The energy of the adsorption site represents the strength of binding of adsorbent and adsorption site. SEDT extends the analytical method for studying the adsorption mechanism and can be combined with the isothermal adsorption model used in most adsorption studies.

The current view theorizes a uniform energy distribution and derives the relationship between the adsorption energy and residual concentration of adsorbate as Eq. (9) presents (Li et al. 2021):

$$C_{e} = C_{s} \exp ( - \frac{{E - E_{s} }}{RT}) = C_{s} \exp ( - \frac{{E^{*} }}{RT})$$
(9)

where C (mg/L) is maximum solubility of the adsorbate, E (J/mol) and Es (J/mol) are thermodynamic potential energies at Ce and Cs, and the difference value between Ce and Cs is adsorption energy denoted as E* (J/mol).

According to formula (9), the adsorption isotherm formula can be described as a function qe(E*) associated with E*. For qe(E*), obtain the site energy distribution function F (E*):

$$F(E^{*} ) = \frac{{ - dq_{e} (E^{*} )}}{{dE^{*} }} = \frac{{C_{e} }}{RT}\frac{{dq_{e} (E^{*} )}}{{dC_{e} }}$$
(10)

Results and discussions

Adsorption isotherms

Three adsorption isotherm models (Langmuir, Freundlich and Langmuir–Freundlich) were used to study the relationship between adsorbate and adsorbents (Rasee et al. 2023). The matched curves, fitted model parameters and coefficient of determination (R2) were shown in Fig. 1 and Table 1. As shown in Fig. 1, O-BC without modification emerged phosphate release in the adsorption experiment. Fe-BC slightly adsorbed phosphate, and the adsorption of phosphate was greatly improved by Mg-BC. Moreover, MgFe-BC had the best performance of adsorption on phosphate. The adsorption capacity of BCs increased as the temperature increased from 288 to 308 K, indicating that adsorption was a spontaneous endothermic process and high temperature promoted the removal of phosphate by BCs (Rehan et al. 2023). This was attributed to the accelerated movement of phosphate leading to an increase in the contact opportunity with the active site of BCs at high temperature. The basic characteristic of Langmuir isotherm can be expressed in terms of the dimensionless constant equilibrium parameter RL (RL = 1/1 + KLC0) or the separation factor, which was used to predict the favorability of the adsorption system. For a good adsorption process, the RL value is between 0 and 1. In this study, the RL values of MgFe-BC lied within 0.02 to 0.67, indicating it was a favorable process. This finding had also been proved by the “n” value of the Freundlich model which was in the range from 0.1 to 1. The three models could well describe the adsorption process, but the Langmuir–Freundlich model had a relatively higher R2 than other two models. The result showed that the adsorption of phosphate by MgFe-BC had both monolayer and multilayer adsorption. The maximum adsorption capacities of the three biochar to phosphate at 298 K were 6.93, 5.75 and 0.23 mg/g, respectively. The maximum adsorption capacities of MgFe-BC at 288 K, 298 K and 308 K were 2.92, 6.93 and 8.13 mg/g, respectively. Moreover, the excellent removal capacity of 6.93 mg phosphate for per gram MgFe-BC was greater than other reported materials, such as Fe modified biochar (5.99 mg P/g) (Hu et al. 2023), porous magnetic biochar (3.47 mg P/g) (Tomin and Yazdani 2022) and Zn-chitosan complex modified biochar (6.3 mg P/g) (Yazdani et al. 2017).

Fig. 1
figure 1

a Phosphate release on O-BC. Adsorption isotherm for Fe-BC (b); Mg-BC (c) and FeMg-BC (d). Dosage of BCs: 1 g/L; Reaction time: 24 h. Error bars represent standard error of triplicate samples (n = 3)

Table 1 Isotherm parameters for the adsorption of phosphate on BCs

Adsorption kinetics

Adsorption kinetic is a vital method to evaluate the adsorption rate and adsorption mechanism. Figure 2 showed the relationship between the adsorption amount of phosphate and the contact time. More than 90% of phosphate was captured by MgFe-BC within 15 h, and the equilibrium was reached within 20 h. The slow capture of phosphate by MgFe-BC might be ascribed to the affinity between the positively charged MgFe-BC surface and negatively charged phosphate ions. The adsorption properties of MgFe-BC were studied by fitting the experimental data with different kinetic models. Compared with the pseudo-first-order kinetic model, the experimental data fitted better by the pseudo-second-order kinetic model, indicating that chemical adsorption dominated the adsorption process. The adsorption kinetics were further evaluated using the intraparticle diffusion model. The fitting line of the intraparticle diffusion model was also shown in Fig. 2b. It demonstrated that the phosphate adsorption on MgFe-BC was characterized by multilinearity and most probably featured three steps. The fitting line did not pass through the origin, indicating that intra-particle diffusion was not the only rate-limiting step in the adsorption process. As shown in Table 4, the K value becoming smaller gradually showed that the adsorption sites on the adsorbent were occupied; the above change during the diffusion process indicated that the phosphate adsorption on MgFe-BC was a multi-step process. In conclusion, the adsorption of phosphate by MgFe-BC could be divided into three stages: (i) quick adsorption at an early stage due to more available active sites, (ii) slow adsorption towards equilibrium, and (iii) keeping adsorption equilibrium.

Fig. 2
figure 2

Adsorption kinetic of phosphate; initial phosphate concentration: 2 mg/L; reaction temperature: 298 K; dosage of MgFe-BC: 1 g/L

Characterization of BCs

BET and pore distribution analysis

The nitrogen adsorption and desorption isotherms were conducted to examine the porous nature of O-BC, Fe-BC, Mg-BC and FeMg-BC (Sheikh et al. 2023). The N2 adsorption–desorption isotherm of O-BC, Fe-BC, Mg-BC and FeMg-BC was shown in Fig. S1. The dominance of mesopores and micropores was confirmed through the type IV isotherm of BCs. Fig. S3 further provided pore size distribution of BCs. Compared with O-BC (42.524 m2/g), the specific surface area of modified biochar (17.910 ~ 39.336 m2 /g) decreased as shown in Table 2. Moreover, the mesopore volume of modified biochar also decreased, and its mesopore size became bigger. These changes indicated the metal oxide blocked some of the pores. But, the degree of pore blockage of MgFe-BC was the least. The value of pore volume (0.023 cm3/g) and pore sizes (0.432 nm) of MgFe-BC confirmed the existence of micropores. Abundant pore structures and relatively high surface area could benefit the contact between the adsorption sites of BCs and phosphate, improving the adsorption capacity.

Table 2 Pore properties of the adsorbents

SEM analysis

The surface morphological features of BCs were characterized by SEM analysis (Fig. 3). The surface of BCs was rough and porous, which might be due to the addition of pore-forming agent and the release of tar and clogged substances at higher pyrolysis temperature (Usman et al. 2015). Such a porous structure provided more adsorption sites for pollutant molecules especially for organic in nature. It was clearly seen that plenty of microscopic needle-like substances were well agglomerated on the surface of Mg-BC and MgFe-BC after MgCl2 modification (Fig. 3c, d). Moreover, increased Mg content could be observed from the EDS spectra of the MgFe-BC (Fig. S3). Adsorbed MgCl2 on biochar can be converted into MgO under high temperature by Eqs. (1112) (Huang et al. 2011). The needle-like substance may be due to the presence of MgO crystal deposited on the surface.

$${\text{MgCl}}_{{2}} \cdot {\text{6H}}_{{2}} {\text{O }} \to {\text{ Mg}}\left( {{\text{OH}}} \right){\text{Cl }} + {\text{ 5H}}_{{2}} {\text{O}} \uparrow \, + {\text{ HCl}} \uparrow$$
(11)
$${\text{Mg}}\left( {{\text{OH}}} \right){\text{Cl }} \to {\text{ MgO }} + {\text{ HCl}} \uparrow$$
(12)
Fig. 3
figure 3

SEM images of a O-BC; b Fe-BC; c Mg-BC and d MgFe-BC

FT-IR analysis

The FT-IR results showed the presence of some functional groups of the BCs (Fig. 4a). The absorption peaks near 3418 cm−1 corresponded to O–H tensile vibration in hydroxyl groups. Compared with O-BC, the intensity of O–H from spectra of Fe-BC and Mg-BC gradually weakened. This suggested that more hydroxyl groups broke down and reacted with magnesium and iron ions to form new chemical bonds. However, MgFe-BC had the strongest O–H absorption peak due to iron-magnesium interaction. The small peak at approximately 2966 cm−1 was attributed to aliphatic C–H vibrations, which was strengthened due to the formation of metals oxide in the modified BCs (Han et al. 2020). The characteristic peaks at 1584 cm−1 and 1087 cm−1 belonged to the C = C stretching of aromatic components and asymmetric stretching of C–O–C of cellulose and hemicelluloses, respectively (Gao et al. 2023). The bands at approximately 1438 cm−1 were due to O–H in-of-plane bending vibration on the surface of adsorbent. The signals situated on 802 cm−1 were attributed to the –CH2– bond stretching vibrations of O-BC and Fe-BC. Its disappearance after Mg adding indicated that the functional group reacted with Mg. Additionally, the out-of-plane bending vibration of C–H (875 cm−1) bond from aromatic compounds was found (Wei et al. 2023). In addition, the magnesium-modified biochar appeared strong absorptive peaks at 886 and 1438 cm−1, indicating that the magnesium-modified biochar contained more C–H and O–H groups which were good for adsorption. The presence of oxygen-containing surface group confirmed the interaction between surface functional groups and metal ions to form surface complexes.

Fig. 4
figure 4

a FT-IR spectra of BCs; b XRD spectra of MgFe-BC

XRD and XPS analysis

To confirm the presence of Fe and Mg in the BCs, the samples were further analyzed using XRD. The XRD pattern of O-BC only had an apparent carbon peak (2θ = 26.5°) in Fig. S5 (a). It was a typical biochar characteristic peak (Yang et al. 2021). Compared with O-BC, the XRD pattern of modified BCs had greatly changed. It had testified that Fe oxide and Mg oxide had been successfully fixed to the surface of BCs. Before adsorption, MgFe-BC had representative peaks of magnesium iron oxide (PDF#772,365, 2θ = 36.8°, 42.9°, 62.1°, 74.5°, 78.3°) in Fig. 4b. Fe-BC had characteristic peaks of Fe3O4 (Shi et al. 2018) (PDF #99–0073, 2θ = 30.1°, 35.4°, 43.1°, 56.9°, 62.5°) in Fig. S5 (b). Mg-BC also had peaks of MgO (Li et al. 2017; Xiao et al. 2019) (PDF #71–1176, 2θ = 36.9°, 42.9°, 62.2°, 74.6°, 78.5°) in Fig. S5 (c). After the adsorption reaction, magnesium iron oxide characteristic peak of MgFe-BC-P had weakened because of the formation of Fe3(PO4)2 (PDF #39–0341, 2θ = 30.0°, 35.1°).

According to previous researches, metal oxides can be bonded to phosphate by electrostatic attraction and chemical bonding (Angkawijaya et al. 2022; Cheng et al. 2021; Peng et al. 2021). To further investigate the adsorption mechanism, XPS analysis of O-BC, MgFe-BC and adsorbed MgFe-BC-P was performed. Compared with O-BC (Fig. S5 (d)), the full-scan spectrum of MgFe-BC (Fig. 6b) appeared two new peaks, which were Mg 1 s and Fe 2p. The appearance of Mg 1 s and Fe 2p indicated metal oxides were successfully loaded onto the biochar. The full-scan spectrum of MgFe-BC-P (Fig. 6b) showed a new peak attributed to P 2p, suggesting the phosphate was successfully loaded on the MgFe-BC.

As shown in the C1s spectra of MgFe-BC and MgFe-BC-P (Fig. 5a, d), three peaks were attributed to C = O (286.9 eV), C–O (285.9 eV) and C–C (284.8 eV), respectively. The peaks at binding energies of 533.3 and 532.2 eV in the O1s spectrum could be assigned to the C–O and the lattice O* (including Mg–O and Fe–O), respectively (Shi et al. 2021) (Fig. 5b, e). Two intense peaks near 712.1 and 725.0 eV can be attributed to Fe2p3/2 and Fe2p1/2 levels and the shake-up satellite peak located at 719.6 eV (Lee and Kim 2022) (Fig. 6a, d). Because magnetite was a stable material, the form of iron ions was stable before and after adsorption. MgHPO4 (134.6 eV), Mg (H2PO4)2 (133.6 eV) and Fe3(PO4)2 (132.5 eV) were detectable after MgFe-BC adsorbed phosphate (Fig. 6e). This demonstrated that phosphate was bonded to the active sites on the MgO and Fe3O4 of biochar. According to the deconvolution of the Mg1s peak (Fig. 5f) of the MgFe-BC-P, the peaks at the binding energy of 1304.8, 1305.6 and 1306.6 eV can be assigned to the characteristic peaks of MgO, Mg(H2PO4)2 and MgHPO4, which were consistent with the result of phosphate.

Fig. 5
figure 5

XPS spectrum of MgFe-BC before and after adsorption. a, d C1s, b, e O1s and c, f Mg1s

Fig. 6
figure 6

XPS spectrum of MgFe-BC before and after adsorption and SED deduction from Langmuir–Freundlich model for MgFe-BC. a, d Fe2p, b full-scan spectrum, e P2p, c SED of frequency of energy distribution, f SED of adsorption energy

LFM-based site energy distribution

As previously mentioned, the Langmuir–Freundlich model best fits the data of MgFe-BC adsorption to phosphate at different temperatures. Therefore, a site energy distribution equation based on the Langmuir–Freundlich model will be established to further study the site energy distribution (SED) during adsorption and further analyze the adsorption mechanism. Combine Eq. (8) with Eq. (9) to obtain the equation for qe(E*)

$$q_{e} (E^{*} ) = \frac{{q_{g} \left[ {K_{lf} C_{s} \exp (\frac{{ - E^{*} }}{RT})} \right]^{n} }}{{1 + \left[ {K_{lf} C_{s} \exp (\frac{{ - E^{*} }}{RT})} \right]^{n} }}$$
(13)

The derivative of formula (13) is calculated according to Eq. (10) and obtained the site energy distribution formula based on the Langmuir–Freundlich model:

$$F(E^{*} ) = \frac{{q_{g} n(K_{lf} C_{s} )^{n} }}{RT}\exp (\frac{{ - nE^{*} }}{RT})\left[ {1 + (K_{lf} C_{s} )^{n} \exp (\frac{{ - nE^{*} }}{RT})} \right]^{ - 2}$$
(14)

where qg, n and Klf are the correlation coefficients of the Langmuir–Freundlich model, whose values are shown in Table 1.

The maximum solubility (Cs) of KH2PO4 in the aqueous solution at different temperatures is shown in Table 4. Based on the above known parameters, the energy distribution curve of the adsorption site can be drawn by Eq. (14). In addition, according to formula (14), the energy (E* m) with the largest distribution in the site energy distribution curve can be obtained from the following equation:

$${E}_{\text{m}}^{*}=\frac{\text{d}F}{\text{d}E^{\star}}=0$$
(15)
$$E_{{\text{m}}}^{*} = RT\ln (K_{lf} \cdot C_{s} )$$
(16)

E* m can divide adsorption sites into lower energy adsorption sites (LEDS, whose value is less than E* m) and high energy adsorption sites (HEDS, whose value is greater than E* m) (He et al. 2019a). The high energy region and the low energy region respectively located at the right side and the left side of the energy distribution diagram. Moreover, according to formula (9), ln Ce and E* show a linear negative correlation. So, the high energy region corresponded to the low concentration region, while the low energy region often corresponded to the high concentration region respectively. The adsorbent first occupied the high energy adsorption site on the adsorbent, thus increasing the uniformity of the adsorbent surface. And we can also calculate the percentage of the LEDS and HEDS as Eqs. (1718) exhibit:

$$P_{LEDS} = \int_{0}^{{E_{{\text{m}}}^{*} }} {f(E^{*} } )dE/\int_{0}^{ + \infty } {f(E^{*} } )dE^{*}$$
(17)
$$P_{HEDS} = 1 - P_{LEDS}$$
(18)

As the SED curve described the occurring frequency of the available adsorption sites with specific energy, the mathematical expectation value (μ) and standard deviation (σ) could be used to represent the heterogeneity of adsorption potential energy (Li et al. 2021; Shen et al. 2015):

$$E_{m} = \mu ({\text{E}}^{*} ) = \int_{0}^{ + \infty } {E^{*} f(E^{*} } )dE^{*} /\int_{0}^{ + \infty } {f(E^{*} } )dE^{*}$$
(19)
$$\mu ({\text{E}}^{{*^{2} }} ) = \int_{0}^{ + \infty } {{\text{E}}^{{*^{2} }} f(E^{*} } )dE^{*} /\int_{0}^{ + \infty } {f(E^{*} } )dE^{*}$$
(20)
$$\sigma ({\text{E}}^{*} ) = \left[ {\mu ({\text{E}}^{{*^{2} }} ) - \mu ({\text{E}}^{*} )^{2} } \right]^{0.5}$$
(21)

As shown in Table 3, Mg-BC and MgFe-BC scored distinguishably higher \({\mathrm E}_m^\ast\) values compared with Fe-BC, suggesting that the adsorption process for phosphate uptake by Fe-BC was distinct versus others. As shown in fig. S4, the peak F(E*) of the energy distribution curve of Mg-BC was larger than Fe-BC suggesting the adsorption amount of Mg-BC was greater than Fe-BC. The greater σ(E*) value of MgFe-BC proved that MgFe-BC’s surface sites diversified in energy distribution. The higher µ(E*) value of MgFe-BC also meant an desirable affinity between MgFe-BC and phosphate (Yan et al. 2017). It was also consistent with isothermal model. As the temperature increased, the SED curve of MgFe-BC moved to the right as a whole, indicating that the energy of the adsorption site was generally increased. Meanwhile, the Em value, which represented the average energy, also increased with the increase of temperature. The plots of E* rose with rising temperature, indicating higher temperature had positive effect on the phosphate adsorption on MgFe-BC. All above changes indicated that with the increase of temperature, the energy of MgFe-BC surface sites and the total amount of active sites increased. Moreover, E* decreased with rising qe, which proved the uneven feature of SED and the existence of restricted high-energy adsorption sites on BCs (He et al. 2019b). The standard deviation of MgFe-BC decreased with temperature increasing, which proved the higher the temperature, the lower the heterogeneity. Besides, when the temperature rose, phosphate solubility improved, which led to an increase in the concentration difference between the solid and liquid phases and a decrease in the solution viscosity. This allowed more phosphate molecules stuffed onto the MgFe-BC surface. With temperature increasing, the higher µ(E*) value obviously enhanced the affinity between phosphate and MgFe-BC, resulting in more phosphate absorption on MgFe-BC.

Table 3 Key parameters of SED calculation results by BCs

Adsorption mechanisms

By analyzing the characteristics, magnesium and iron were effectively loaded on the biochar by tube furnace pyrolysis. The porous structure of BCs, as well as the abundance of metal oxide and functional groups, worked together to strengthen adsorption to phosphate. Previous studies had shown that physical adsorption, precipitation, electrostatic attraction and inner-sphere complexation contribute to phosphate adsorption in metal-modified BCs (Lee and Kim 2023, Zhou et al. 2023). To deduce the mechanism of phosphate adsorptive capture by BCs, the XRD and XPS spectra analyses of BCs (before and after adsorption) were performed. The results indicated that the mechanism of phosphate adsorption by metal oxides included two parts: iron oxide and magnesium oxide.

On the one hand, since the \({\mathrm HPO}_4^2-\) and \({\mathrm H}_2\mathrm{PO}_4^-\) were existed mainly in the solution at pH 2–10 (Li et al. 2022a), Mg(H2PO4)2 and MgHPO4 formed by precipitation reaction between phosphate ions and the Mg2+. The result was consistent with the analysis of XPS. Therefore, the chemical mechanism between MgO and phosphate can be described by Eqs. (2224).

$${\text{MgO }} + {\text{ H}}_{{2}} {\text{O }} \to {\text{ Mg}}\left( {{\text{OH}}} \right)_{{2}} \to {\text{ Mg}}^{{2 + }} + {\text{ OH}} -$$
(22)
$${\text{Mg}}^{2 + } + {\text{HPO}}_{4}^{{2{ - }}} \to {\text{ MgHPO}}_{4}$$
(23)
$${\text{Mg}}^{2 + } + {\text{H}}_{{2}} {\text{PO}}_{4}^{ - } \to {\text{ Mg}}\left( {{\text{H}}_{{2}} {\text{PO}}_{{4}} } \right)_{2}$$
(24)

Moreover, the surface of MgFe-BC was positively charged at pH 2–10. The \(\mathrm{HPO}_4^{2-}\) and \({\mathrm H}_2\mathrm{PO}_4^-\) were adsorbed on the surface of MgFe-BC by electrostatic attraction to form an external complex. The reaction equations were as follows (Eqs. 2527):

$${\text{MgO }} + {\text{ H}}^{ + } \to {\text{ MgOH}}^{ + } \left( {{\text{Protonation}}} \right)$$
(25)
$${\text{MgOH}}^{ + } + {\text{H}}_{{2}} {\text{PO}}_{4}^{ - } \to {\text{MgOH}}^{ + } - - {\text{H}}_{{2}} {\text{PO}}_{4}^{ - } \left( {\text{Electrostatic attraction}} \right)$$
(26)
$$2\left( {{\text{MgOH}}^{ + } } \right) \, + {\text{ HPO}}_{4}^{{2{ - }}} \to \, 2\left( {{\text{MgOH}}^{ + } } \right) - - {\text{ HPO}}_{4}^{{2{ - }}} \left( {\text{Electrostatic attraction}} \right)$$
(27)

Furthermore, according to the results of BET and pore distribution analysis, pores filling occurred in biochar due to its large specific surface areas and rich pore structures.

On the other hand, before and after adsorption, XRD showed that Fe3O4 reacted with phosphate formed Fe3(PO4)2 in accordance with the characteristic peaks on the P2p of XPS. Phosphate may also react with iron oxide to form an inner sphere surface complex in biochar (Li et al. 2016). This reaction between phosphate and iron oxide was not an advantage comparing with Mg-phosphate reaction taking account of high content of MgO in the MgFe-BC.

Effect of environmental factors

Effect of initial solution pH

Solution pH value was one of the critical environmental factors evaluating the potential of an adsorbent. Studies showed that the pH value of the solutions might affect the surface change of the adsorbent and the ionization and speciation of the adsorbate (Huang et al. 2019). So it was necessary to study the effect of pH on the adsorption of phosphate (Fig. 7a). When the initial concentration was 2 mgP/L and pH at 3–7, the removal rate of phosphate was basically about 100%, and the removal rate decreased with the increase of pH, especially pH = 12. When C0 = 5 mgP/L and pH at 3–7, the phosphate removal rate increased slightly with the rise of pH, and when the pH at 8–12, the trend was the same as that of 2 mgP/L. In addition, the point of zero charge (pHpzc) of MgFe-BC was 10.3. The higher pHpzc indicated that the surfaces of the MgFe-BC were positively charged in water over a wider range of pH (Bian et al. 2023). Upon contact of MgFe-BC with phosphate solution, MgO crystals of biochar surface rapidly protonated and formed MgOH+, resulting in the formation of positively charged surface groups at 2.1 < pH < 7.2. At this time, phosphate mainly existed in the form of \({\mathrm H}_2\mathrm{PO}_4^-\). Thus, the phosphate removal process involved phosphate being attracted to the positively charged MgOH+ site by static electricity to form surface complexes (Zhu et al. 2020). When 7.2 < pH < 10.3, the surface of MgFe-BC carried positive charge and phosphate species were \(\mathrm{HPO}_4^{2-}\) and \({\mathrm H}_2\mathrm{PO}_4^-\). This was similar to the situation at low pH and the electrostatic attraction promoted adsorption. When pH>10.3, the surface of MgFe-BC carried negative charge and phosphate species were \(\mathrm{PO}_4^{3-}\) and \(\mathrm{HPO}_4^{2-}\). It caused more electrostatic repulsion to phosphate. However, MgO on MgFe-BC could react with phosphate species to form crystalline Mg3(PO4)2 (Hu et al. 2023).

Fig. 7
figure 7

Effect of a solution pH. Effect of b, c co-existing ions and ionic strength; and d humic acid on phosphate removal; initial phosphate concentration: 2 mgP/L

Effect of co-existing ions and ionic strength

Usually, different types of inorganic ions in contaminated water interfered with the adsorption of phosphate by adsorbent. Therefore, the experiment was performed by adding \(\mathrm{NO}_3^-\), Cl, \(\mathrm{CO}_3^{2-}\), Na+, Ca2+ and Al3+ with a concentration of 10–2000 mg/L. As depicted in Fig. 7b, c, different ions and ionic strength had different effects on phosphate removal by biochar. It can be found that the presence of \(\mathrm{NO}_3^-\), Cl and Na+ had no obvious influence on phosphate adsorption with concentration of 10–2000 mg/L, indicating weak bond with adsorption sites of MgFe-BC (Rehan et al. 2023; Zhang et al. 2020). Compared with the solution only with phosphate (BK), the existence of \(\mathrm{CO}_3^{2-}\) restrained phosphate adsorption, especially concentration of \(\mathrm{CO}_3^{2-}\) greater than 500 mg/L. The phosphate removal capacity decreased to 30.8%, 23.7% and 18.8%, respectively, when the concentration of \(\mathrm{CO}_3^{2-}\) rose from 1000 to 2000 mg/L (Table 4). This was because \(\mathrm{CO}_3^{2-}\) had a higher charge to compete adsorption sites. Oppositely, the co-existence of Ca2+ promoted phosphate removal by MgFe-BC in result that Ca2+ can form stable CaHPO4 and Ca3(PO4)2 precipitate with \(\mathrm{PO}_4^{3-}\) (Leite et al. 2023). When the concentration of Al3+ was in the range of 200–2000 mg/L, Al3+ had a significant inhibitory effect on adsorption, and the removal rate of phosphate reduced to about 10%. This was due to the excessive positive charge occupying a large number of adsorption sites on the adsorbent surface, resulting in a decrease in adsorption capacity (Yang et al. 2020). When Al3+ was less than 200 mg/L, it promoted the adsorption of phosphate by biochar. This may be because the phosphate formed covalent bonds with the metal cations on the adsorbent surface, which made the phosphate form an inner sphere complex on the adsorbent surface.

Table 4 Kinetics parameters for the adsorption of phosphate on MgFe-BC

Effect of humic acid

A major constituent commonly presented in surface water that requires removal was natural organic matter (NOM). Humic acid (HA), as one of the main components of NOM, accounted for about 50–90% of the total NOM in water bodies. Humic acid was a macromolecular organic acid composed of aromatic and various active functional groups, which has high reactivity (Sun and Yang 2023). Figure 7d showed the effect of humic acid on the removal of phosphate by MgFe-BC, and with the increase of humic acid, the higher removal rate of phosphate. It is probably because phosphate adsorption was driven by multiple mechanisms. For example: (1) the hydroxyl group of humic acid was exchanged with the ligand of phosphate; (2) humic acid, magnesium oxide and phosphate formed complex compounds. In addition, the addition of humic acid changed the initial pH value and thus affected the adsorption process.

Conclusions

The rice straw-based biochar modified by biological template and metal impregnation were successfully synthesized, which had abundant pore structure, high specific surface area, rich surface functional groups and metal oxides. The adsorption of phosphate on MgFe-BC had both monolayer and multilayer adsorption. MgFe-BC reacted with phosphate to form Mg(H2PO4)2, MgHPO4 and a little Fe3(PO4)2. The adsorption capacities of phosphate on Fe-BC, Mg-BC and MgFe-BC at 298 K were 0.23 mg P/g, 5.75 mg P/g and 6.93 mg P/g, respectively. Moreover, the excellent removal capacity of 6.93 mg phosphate for per gram MgFe-BC was greater than some reported materials. The energy of the adsorption site generally increased with increasing temperature, and higher temperature was beneficial to the phosphate adsorption on MgFe-BC. The E* increased, indicating higher temperature was beneficial to the phosphate adsorption on MgFe-BC. Surface sites of MgFe-BC diversified in energy distribution and desirable affinity existed between MgFe-BC and phosphate. MgFe-BC had a strong buffer capacity against the initial pH of aqueous solutions, and the effects of various ions and ionic strength in water on phosphate adsorption by MgFe-BC were also quite different. Adding to humic acid, the removal rate of phosphate was improved. This study provided a basis for further elucidating the adsorption mechanism of phosphate on biochar and also provided a reference for water eutrophication, phosphate recovery and agricultural waste resource utilization.