1 Introduction

Since the twentieth century, phosphorus has become an essential resource to keep agricultural production at the required level to supply world food requirements (Cordell et al. 2011). Figure 1 shows the real population growth in the last decades compared to estimated growth in a scenario without the use of synthetic nitrogen fertilizers. The separation between the two growth lines starts in the early twentieth century when the process of producing ammonia from gaseous nitrogen and hydrogen was developed at a laboratory scale by Fritz Haber (1868–1934) and industrialized by Carl Bosch (1874–1940), both awarded with the Nobel Prize in Chemistry (Haber 1920; Bosch 1932). Although initially used for war purposes—the produced ammonia was oxidized to nitrate, raw material for explosives—, the new ammonia production process led to an increase in fertilizer production, which boosted the agroindustry and the consequent rise in the world population (Kumar and Elias 2019; Zhang et al. 2019a).

Fig. 1
figure 1

World population with (real) and without (estimated) nitrogen synthetic fertilizers (data retrieved from Erisman et al. (2008))

As ammonia, phosphorus is a raw material for fertilizer production. While nitrogen can be taken from the air, the main natural source of phosphorus is phosphate rock, a non-renewable resource (al Rawashdeh and Maxwell 2011). According to data from the United States Geological Survey (USGS 1996, 2024), the world phosphate rock production has risen from 137 Mt in 1995 to 220 Mt in 2023. Since phosphate rock reserves are concentrated in a few countries (Fig. 2), with Morocco accounting for more than 50% of the world reserves, geopolitical issues may arise in the future in the case of phosphorus shortage (Li et al. 2018). Phosphate rock shortage is a topic that raises a wide discussion. A simple calculation shows that, if producing 220 Mt of phosphate rock per year, the 74 Gt world reserves will be exhausted in 336 years, not considering new possible reserves or demand increase. Nedelciu et al. (2020) used a simulation model that predicted the need for double phosphorus production to ensure phosphorus requirements, especially due to the high population increase in regions like South Asia, Latin America, and Sub-Saharan Africa. In 1993, Herring and Fantel (1993) predicted that phosphate rock reserves would be depleted between 2043 and 2093. This estimation, however, conflicts with more recent studies, which point to the phosphate rock reserves depletion between 2088–2158 (Kisinyo and Opala 2020) and 2311–2411 (Li et al. 2018). Although the duration of the current reserves could be in doubt, their finiteness is not, which, in addition to geopolitical issues already mentioned and environmental concerns, triggers the need for phosphorus recovery technologies (Herring and Fantel 1993; Edixhoven et al. 2014; Baveye 2015; Li et al. 2018; Kisinyo and Opala 2020).

Fig. 2
figure 2

Phosphate rock reserves by country in 2023 (data retrieved from USGS 2024)

One of the environmental concerns caused by the increase in fertilizer production is the excessive phosphorus application in soil, which causes the eutrophication of waterbodies (Huang et al. 2017; Ren et al. 2022; Ritchie et al. 2022). Additionally, phosphate rock mining contributes to watercourses pollution with phosphorus and heavy metals like zinc, copper, and cadmium (Aoun et al. 2015; Fayiga and Nwoke 2016).

Phosphorus is a raw material used in several industries to produce pharmaceuticals and flame retardants, among others (Boer et al. 2018). Although the cost of recovered phosphorus is higher than that of standard phosphorus products, it becomes lower when the costs due to phosphorus release in the environment are accounted for (Martín-Hernández et al. 2023). Among the different industries requiring phosphorus, fertilizer production is, by far, the one with the biggest usage: in 2004, 75% of produced phosphorus was used in fertilizer production, increasing to more than 90% in 2010 (Villalba et al. 2008; al Rawashdeh and Maxwell 2011).

Currently, wastewater treatment methods are mainly biological-based, promoting phosphorus removal by transferring it to the treatment by-products. Although these by-products are rich in phosphorus, they are poorly efficient for use, resulting in the loss of the removed resource (Chu et al. 2022). These treatment methods focus on obtaining P-free wastewater (i.e., phosphorus removal) instead of P-rich products (i.e., phosphorus recovery) (Tomei et al. 2020). In the last decades, Enhanced Biological Phosphorus Removal (EBPR) has been investigated to increase phosphorus removal efficiency by using Polyphosphate Accumulating Organisms (PAO), which can store phosphate as polyphosphates (linear polymers of orthophosphate residues) (Streichan and Schön 1991; Oehmen et al. 2007; Khourchi et al. 2023). Tomei et al. (2020) proposed the adaptation of a treatment facility to implement EBPR followed by mineral precipitation, obtaining fertilizers without requiring significant structural facility adaptations. In a different study, a Biofilm Sequencing Batch Reactor (BSBR) was proposed as a new technology derived from EBPR, using the same kind of microorganisms (PAOs) but through a different mechanism, which resulted in a lower volume of sludge produced (Ni et al. 2022). Zheng et al. (2024) used a BSBR to concentrate phosphate from 2.6 mg L−1 in the influent to 81.6 mg L−1 in the recovered liquid. Despite the encouraging results, EBPR and BSBR have limitations associated with narrow ranges of pH and temperature, large reactor sizes, and high hydraulic retention times. Moreover, a post-treatment (e.g., chemical precipitation) to recover the removed phosphorus is required (Ren et al. 2022). The variability of the wastewater characteristics, when considering industrial effluents, is another key aspect affecting the efficiency of biological-based technologies, as microbial adaptation can be a complex process (Snyder and Morales-Gujo 2022).

Phosphorus recovery through chemical and electrochemical processes has been widely investigated in the past years, with promising features compared to biological-based ones (Ren et al. 2022). The main advantages offered by these technologies include: (i) higher recovery efficiency, especially in concentrated streams (Dockhorn 2009); (ii) faster process times, minutes to hours vs. days to weeks in biological systems (Hug and Udert 2013; Perera et al. 2019); (iii) more consistent and predictable output, as they are less sensitive to environmental fluctuations (like temperature or pH) and can be finely controlled via input conditions (e.g., voltage, dosing) (Perera et al. 2019); (iv) suitability for decentralized or on-site systems, as they can be modular and compact (Wang et al. 2024); (v) generation of marketable products, like high-purity struvite or calcium phosphate that can be directly used as fertilizers or raw materials (Lei et al. 2019c; Sultana and Greenlee 2023). Still, despite all the benefits, there are technical, economic, and systemic barriers limiting the large-scale implementation of these processes.

Studies on the optimization of operational parameters in chemical and electrochemical phosphorus recovery processes are scattered across numerous scientific papers, often focusing on specific conditions, materials, or system configurations. This fragmented knowledge makes it challenging to form a comprehensive understanding of how different variables interact and affect process efficiency. Therefore, this literature review intends to gather and synthesize all relevant information that is essential not only to optimize existing recovery processes but also to identify knowledge gaps and critical aspects that require further investigation. A comprehensive examination of the core principles underlying chemical and electrochemical phosphorus recovery technologies is presented, alongside the latest developments regarding their implementation in the treatment of industrial effluents. Special attention is given to the role of key operational parameters—such as pH, temperature, reagent concentration, and electrical input—in influencing recovery performance, aiming to support future research directions and promote more informed decision-making in process optimization and technology selection.

2 Fundamentals of chemical and electrochemical recovery of phosphorus

The recovery of phosphorus is mainly carried out through mechanisms that lead to calcium phosphates (CaP, e.g. hydroxyapatite) or struvite (NH4MgPO4·6H2O), also called magnesium ammonium phosphate hexahydrate (MAP) (Peng et al. 2018). The recovery mechanism is similar and consists of two steps. Initially, a high pH is required to ensure that PO43− and HPO42− species are present in the solution, as shown in Fig. 3. When the concentration of other ions, like calcium, magnesium, and ammonium, exceeds the solubility product, insoluble solids are formed and precipitate. These solids can then be recovered and used as fertilizers.

Fig. 3
figure 3

Fraction of the various phosphate species as a function of pH (adapted from Ren et al. (2022))

The focus of current research is: (1) how to adjust the pH to make the medium proper for phosphorus recovery; (2) which product (i.e., CaP or MAP) is the most suitable to recover; and (3) how to collect the produced solids. The answer to these questions determines which kind of process should be applied. Table 1 summarizes the main differences between these topics for chemical and electrochemical methods.

Table 1 Main differences between chemical and electrochemical recovery of phosphorus in key topics

The requirement for pH control is due to the several pH-controlled equilibria involved in phosphorus precipitation (e.g., struvite achieves its minimum solubility at a pH near 10, and a pH near 8–9 is optimum for struvite precipitation processes since it avoids ammonia evolution) (Bhuiyan et al. 2007; Ferraro et al. 2023). In chemical precipitation, pH is controlled by alkali dosage, and, if required, magnesium and calcium concentrations are adjusted by salt dosage (Melgaço et al. 2021). This addition of chemicals can be made separately (e.g., adding MgCl2 to supply magnesium and NaOH to control the pH) or with one single reagent (e.g., adding MgO, which supplies magnesium and controls the pH). However, pH adjustment through the addition of chemicals is not desirable since it increases operational costs (Dockhorn 2009). In processes for struvite recovery, a promising alternative is using magnesium sources that automatically adjust the pH, as demonstrated by Wei et al. (2019) and Crutchik et al. (2018). Nevertheless, they have some drawbacks, as will be further discussed. In electrochemical precipitation, the pH is controlled near the cathode’s surface through H2O reduction to HO, making the medium proper to phosphorus precipitation, even if bulk pH is not sufficiently high, as shown in Fig. 4 (Lei et al. 2017; Du et al. 2023). Therefore, electrochemical methods eliminate the need for alkali dosage.

Fig. 4
figure 4

Precipitation of phosphorus at the cathode’s surface in electrochemical recovery (adapted from Ning et al. 2021)

Most industrial wastewaters contain suitable amounts of calcium, avoiding the need for dosage (Lei et al. 2017). However, the same is not observed for magnesium. While the electrochemical recovery of CaP is chemical-free, the recovery of MAP often requires a magnesium source, which is the main parcel of the process cost, up to 75% (Bradford-Hartke et al. 2021). Nevertheless, MAP-based processes can recover phosphorus and nitrogen, which can be advantageous when the wastewater is rich in nitrogen. Moreover, MAP is a well-known long-term fertilizer used as direct fertilizer and as a component of fertilizer mixtures (Sousa et al. 2023), and its slow dissolution in soil enhances phosphorus absorption and reduces losses to waterbodies (Massey et al. 2009; Lei et al. 2019a). Either way, the choice of the most suitable process will depend on the characteristics of the wastewater to be treated.

Collecting the solids is another critical aspect of phosphorus recovery technologies. The choice of method will mainly depend on where the precipitate is formed, at the electrode surface or in bulk. When the solids are at the electrode surface, the usual method is scraping. Still, this is unsuitable for industrial applications because it demands process interruption. Identified in the literature as a weakness of the electrochemical phosphorus recovery technology, it is suggested the use of detachable electrodes or automatic scrappers (Wang et al. 2022b). Polarity reversal is also a promising alternative to scraping (Takabe et al. 2020). In this process, the electrode previously used as a cathode turns into an anode, and vice versa. The adhered solids at the anode (previously cathode) are gradually detached to the solution. Ideally, the solids should be detached and remain in the bulk. Therefore, polarity reversal should be carefully optimized to avoid both precipitation at the new cathode (previously anode) and dissolution of the precipitates. This was achieved by Lei et al. (2022) while treating cheese wastewater to recover calcium phosphate. In this scenario, as well as when the precipitate is formed in the bulk, the collection should be made by filtration or sedimentation. Sedimentation is the simplest and cheapest method since the particles will spontaneously decant. Nonetheless, the dimensions of the recovered solids are affected by multiple factors that must be well-controlled to allow sedimentation (Kékedy-Nagy et al. 2020a; Wang et al. 2021; Aka et al. 2023). A large Mg/P ratio favors crystal aggregation and produces larger struvite crystals, which is beneficial for sedimentation but significantly increases the operational costs if the wastewater has low magnesium content (Fattah et al. 2008). On the other hand, filtration, although more expensive due to the membranes, is more suitable when the solids remain suspended. Wastewaters with a high suspended solids content are not suitable for filtration, as membrane fouling will occur more quickly. Moreover, the recovered product will have low purity due to the accumulation of other solids with the phosphorus precipitates. Optimizing the process to obtain decantable solids without requiring extra magnesium dosage seems to be the best option for more straightforward and lower-cost phosphorus recovery.

3 Operational parameters in chemical and electrochemical phosphorus recovery

Tables 2 and 3 summarize the main studies reported in the literature on chemical and electrochemical recovery of phosphorus, respectively. Based on this literature review, the influence of the main parameters in chemical and electrochemical P recovery, namely initial pH, critical ions concentration, magnesium source, and applied current or voltage, is discussed.

Table 2 A summary of the main studies on chemical recovery of phosphorus from simulated and real matrices
Table 3 A summary of the main studies on electrochemical recovery of phosphorus from simulated and real matrices

3.1 Initial pH

Although phosphorus recovery by electrochemical processes is closely related to the local pH (i.e., near the cathode), bulk pH and local pH are linked (Lei et al. 2017; Siciliano et al. 2020). As previously shown in Fig. 3, phosphate species in solution vary with pH. For example, the solubility product constant (Ksp) for hydroxyapatite is 3 × 10−58 (Bell et al. 1978), which results in solubility variation with the pH of the medium, as shown in Fig. 5. Therefore, precipitation efficiency is expected to increase with pH. Lei et al. (2018a) found that phosphorus recovery as CaP can be carried out at pH from 4 to 10, but it does not occur when buffers are present at pH 6, probably due to the neutralization of hydroxide ions generated near the cathode by the buffer species. Although an acidic medium (pH < 4) reduces recovery efficiency, it can also reduce the percentage of byproducts (e.g., calcite and brucite) in the recovered solids (Lei et al. 2019b). As can be seen in Table 3, electrochemical recovery of phosphorus can be effective in very acidic wastewater, which is quite challenging in chemical recovery. Only one of the studies on P chemical recovery (Table 2), performed by Wei et al. (2019) with light calcined magnesite, was carried out without pH adjustment.

Fig. 5
figure 5

Variation of hydroxyapatite solubility with pH

When non-orthophosphate (NOP) species are present, the pH dependence can be non-linear due to the need to oxidize NOP to orthophosphate before precipitation. Zhang et al. (2021) found that phosphorus recovery efficiency from a phosphonate solution (ethylenediamine tetra(methylene phosphonic acid), EDTMP) had no significant change in a wide pH range (from 3 to 12), indicating that NOP oxidation was not affected by an alkaline medium, i.e., the system behavior was similar to an orthophosphate system. Conversely, Ning et al. (2021) found that the phosphorus recovery efficiency from a pesticide solution (acephate) dropped from 87% at pH 4 to 72% at pH 9, which was justified by the formation of intermediate species in the acidic medium through the protonation of oxygen and/or nitrogen atoms that can be more easily attacked by hydroxyl radical. However, both acephate and EDTMP chemical structures have oxygen and nitrogen atoms that can be protonated (Supplementary Material, Fig. S1). Considering these dissimilar results reported, further research is required for a better understanding of the behavior of NOP systems in phosphorus recovery processes.

3.2 Critical ions concentration

The phosphorus concentration in wastewater is an important parameter in phosphorus recovery since it directly impacts the operational cost. Dockhorn (2009) estimated that the cost of struvite production significantly increases when phosphorus concentration is below 200–300 mg L−1. This author found that the cost for struvite production is 5-fold higher when using wastewater containing 50 mgP L−1 than when the wastewater contains 800 mgP L−1. Besides the costs, the process efficiency is also affected. Lei et al. (2019c) used a bioelectrochemical system to recover phosphorus from domestic wastewater and found that the fraction of removed calcium, which formed calcium phosphates, rose from 0.22 to 0.73 when phosphorus concentration increased from 0.23 to 0.76 mM, with a decrease in energy consumption. According to the literature, electrochemical methods for phosphorus recovery are not feasible for wastewater with low phosphorus content. Nevertheless, their efficiency can be improved by association with a biological process, namely through the valorization of the gases produced (oxygen and hydrogen) (Lei et al. 2019a). Zheng et al. (2024) showed that combining electrochemical technology with BSBR can be an advantageous approach.

Although the electrochemical phosphorus recovery is usually favored by high phosphorus content in wastewater, in specific situations, the high phosphorus content can be a hindrance. In a continuous system, the rate of hydroxide ions production can be lower than that required to allow the treatment of a high P content. In this context, the dilution of the wastewater can be a solution, since it is cheaper to dilute the wastewater than increase the electrodes’ surface. Lei et al. (2019a) found an efficiency increase from 40% (non-diluted) to 54 and 64% when the wastewater (836 mgP L−1) was diluted by 2 and 10-fold, respectively. According to the authors, this was due to the increase in [HO]/[P] ratio and to the decrease in the wastewater buffer capacity. Consequently, the specific energy consumption (SEC) was increased from 51.5 (non-diluted) to 306.1 kWh kgP−1 (10-fold diluted). Since the difference between the recovery efficiencies for 2-fold and 10-fold dilutions was just 10%, there was probably a more suitable dilution factor between 2 and 10 that would allow a good recovery efficiency with a lower increase in energy consumption.

Figure 6 presents the correlation between SEC and the natural logarithm of phosphorus initial content. Although comprising data from different wastewaters and operational conditions, a strong correlation is observed, with a Pearson correlation coefficient of − 0.81 and p-value of 0.0008, indicating a confidence level higher than 99.9% to the negative correlation between SEC and P initial concentration.

Fig. 6
figure 6

Correlation between SEC and the natural logarithm of P initial content [data of points A to M retrieved from different studies reported in the literature on electrochemical recovery of phosphorus, summarized in Table S1 (Supplementary Material)]

Along with phosphorus, calcium, magnesium, and ammonium are critical ions in phosphorus recovery, as phosphorus is mainly precipitated with calcium or magnesium/ammonium. In CaP systems, hydroxyapatite is usually the most thermodynamically favored solid, but a Ca/P ratio >> 1 induces the formation of byproducts, such as calcite, since phosphorus cannot precipitate all the calcium available (Lei et al. 2018b). Contrarywise, if Ca/P << 1, phosphorus is not efficiently removed. When phosphorus is mainly as orthophosphate, Ca/P ratios of 1.5−2.0 are optimal, as higher ratios can induce byproduct formation and bulk precipitation (Lei et al. 2018c). As for electrochemical recovery when phosphorus is mainly NOP, Zhang et al. (2021) reported no significant difference in recovery efficiency when Ca/P changes from 0.95 to 1.9. The authors explained this behavior with the gradual release of orthophosphate in solution by the anodic oxidation of NOP. The mentioned Ca/P ratios are related to total phosphorus (orthophosphate + NOP), but the precipitation process only depends on the ratio between calcium and orthophosphate. Since organic phosphorus is gradually oxidized to orthophosphate, which is subsequently precipitated, the orthophosphate concentration is always lower than the organic phosphorus concentration, being the ratio between calcium and orthophosphate always higher than the ratio between calcium and total phosphorus. For an exact calculation of the ratio between calcium and orthophosphate, continuous monitoring of orthophosphate concentration is required.

For struvite systems, a Mg/P ratio of about 1.0−1.5 is usually enough to ensure a good precipitation efficiency, with minor variations observed within this interval, except when the matrix contains chelating agents that can sequestrate magnesium ions (Sun et al. 2020; Tai et al. 2022). The Mg/P ratio influences the crystal accumulation rate and, consequently, the recovery rate (Tai et al. 2022). While the Mg/P experimental optimal ratio is close to the theoretical value (i.e., 1), the N/P optimal ratio is usually higher. Tai et al. (2022) obtained recovery efficiencies of 26, 59, and 94% for N/P ratios of 1, 2, and 4, respectively, which, according to the authors, was mainly due to the conversion of ammonium to other N-species (e.g., ammonia) at higher pH values. Still, this higher N/P ratio required does not represent a major drawback, as ammonium content in wastewater is often much higher than phosphorus content, being nitrogen supplementation a scarce practice.

The saturation index (SI), calculated from Eq. (1), where IAP is the ionic activity product (Bradford-Hartke et al. 2021), can be used to predict precipitation occurrence.

$$\text{SI}=\text{log}\left(\frac{\text{IAP}}{{\text{K}}_{\text{sp}}}\right)$$
(1)

When SI > 0, supersaturation occurs, favoring the precipitation, whose extension increases with SI. Since the ionic activity coefficients are related to the ionic strength, the SI depends not only on the ions involved in the precipitation but also on all the matrix constituents. Useful theoretical calculations related to SI can be carried out using appropriate software, such as PHREEQC®, developed by the USGS (Natsi and Koutsoukos 2024).

3.3 Magnesium source

Magnesium supplementation is often required when aiming for phosphorus recovery as MAP, and the recovery process’s feasibility depends on using cost-effective magnesium sources (Crutchik et al. 2018; Fattah et al. 2022). Magnesium salts, especially magnesium chloride, are the easiest way to dose magnesium, due to their high solubility (Li et al. 2019). The first full-scale nutrient recovery facility in North America became operational in Oregon, United States, in 2009, using magnesium chloride as Mg-source (Cullen et al. 2013). Silveira et al. (2024) used magnesium chloride and magnesium sulfate to recover struvite from sanitary landfill leachate in a zero-liquid discharge process, obtaining high recovery rates. Similarly, Wang et al. (2024) used magnesium chloride to recover struvite from an anaerobically digested sludge, achieving a recovery efficiency of 75%. Despite these results, there is a wide discussion about the expense of magnesium salts for struvite recovery and, thus, alternative low-cost magnesium sources have been investigated (Huang et al. 2011; Lahav et al. 2013; Barbosa et al. 2016; Crutchik et al. 2018; Peng et al. 2018; Bradford-Hartke et al. 2021; Enyemadze et al. 2021).

Seawater is a renewable resource, virtually inexhaustible, with an average magnesium concentration of approximately 1.3 g L−1. For phosphorus recovery plants based near the coast, seawater can be a promising low-cost magnesium source, although the presence of other ions (e.g., sodium and chloride) can be a constraint (Shaddel et al. 2020; Battaz et al. 2024). Conversely, bittern, the waste produced after sodium chloride extraction from seawater (Etter et al. 2011), has a magnesium concentration between 9 and 32 g L−1 (Zangarini et al. 2020), being, according to Wang et al. (2018), a cost-effective magnesium source for phosphorus recovery as struvite when the distance between the saline industry and the fertilizer production plant is shorter than 270 km. Sciarria et al. (2023), during agronomic experiments with Brassica rapa chinensis, observed similar performance between common fertilizers and struvite obtained from a mixture of bittern and a liquid digestate of an anaerobic digestion plant treating swine manure and corn wastewater. Being a byproduct, bitterns' usage to produce fertilizers from wastewaters valuably boosts the circular economy. Alongside bittern, brine, also known as desalination wastewater as it is a by-product of the desalination industry, has the same ions naturally present in seawater, but in a higher concentration (magnesium content is about 9 g L−1), making it a feasible magnesium source to produce struvite (Heraldy et al. 2017).

As can be seen in Table 2, several studies are reporting the use of what can be called magnesium liquid sources (i.e., sources in which magnesium is dissolved as Mg2+), which include, for example, seawater, bittern, brine, and natural brine. These low-cost magnesium sources have been investigated in a chemical precipitation approach, aiming to produce struvite while treating wastewater. As described above, the medium pH (or bulk pH) can be a limiting factor in this approach, since struvite requires high pH to precipitate (Etter et al. 2011). Wang et al. (2018) developed a fluidized bed reactor to recover struvite from swine wastewater, which required NaOH dosage and, according to the literature, alkali dosage can account for 10–30% of the total cost of struvite production, depending on the phosphorus concentration in the wastewater (Dockhorn 2009). Electrochemical processes allow high local pH (i.e., near the cathode) even if bulk pH is not high (Lei et al. 2017). Thus, combining magnesium liquid sources with an electrochemical process could improve the performance of phosphorus recovery, especially in terms of economic feasibility.

Another low-cost magnesium source is magnesite, a mineral containing mainly magnesium carbonate (MgCO3) that can act as a magnesia (MgO) source (Gunay et al. 2008; Li et al. 2021). Besides the low cost, magnesite alkalinity raises the pH by itself, not requiring further pH adjustments with alkali (Wei et al. 2019). Still, the low magnesite solubility poses a constraint to its use, requiring the use of a large amount of acid to deliver the magnesium ions or the application of a pre-treatment step (Huang et al. 2010). Huang et al. (2010) investigated the thermal decomposition of magnesite and concluded that the cost of magnesite plus its decomposition is lower than the cost of combined magnesium chloride and sodium hydroxide. Some magnesite derivatives have also been studied as magnesium sources, like magnesite dust (Al-Mallahi et al. 2020), light calcined magnesite (Wei et al. 2019), and magnesite slags (Liang et al. 2022). However, the thermal decomposition of these materials requires very high temperatures (500–1000 ºC). Zhang et al. (2019b) tried to overcome this drawback by electrochemically dissociating magnesite in a two-chamber system. While the anodic chamber had a pH low enough to dissolve magnesite, due to the hydronium ions produced at the anode, the cathodic chamber had a pH sufficiently high to favor struvite precipitation, due to the hydroxide ions produced at the cathode. Despite the promising results, the authors failed to investigate the membrane lifetime, which would help to assess the industrial application of this process. In a different study, Li et al. (2021) examined the feasibility of using a magnesite-packed column to deliver magnesium in a membrane-free system. Since magnesite was packed, it acted as an anode itself, being the precipitation mechanism controlled by local pH instead of bulk pH. The hydronium ions produced near the anode rapidly react with magnesite to produce soluble magnesium, while hydroxide ions produced near the cathode allow a high local pH suitable for struvite precipitation (Lei et al. 2017). The authors concluded that magnesite-packed columns act as low-cost magnesium anodes, thus being a low-cost magnesium source.

Magnesium has been widely used as a sacrificial material for engineering purposes (Song et al. 2020). For electrochemical recovery of phosphorus, magnesium anodes present advantages like magnesium ions in situ generation, pH regulation, high-purity struvite production, and reduced coprecipitation of micropollutants (Zhou and Chen 2019; Luo et al. 2022; Song et al. 2024). Although Egner and Brynioc (2007) deposited, in 2007, a patent for struvite production through magnesium electrochemical dissolution, it was Hug and Udert (2013) who, six years later, authored the first paper describing the use of a magnesium anode to recover phosphorus. In the authors’ work, magnesium AZ31 (i.e., a magnesium alloy with aluminum and zinc at 3 and 1% w/w, respectively) was used as an anode to recover struvite from human urine, with high current efficiency (> 100%) and low energy consumption (1.7 kWh kgP−1). The process cost was lower than that of using magnesium salts (e.g., MgCl2), but higher than that of using magnesite. Thenceforth, several authors investigated the use of magnesium anodes for electrochemical recovery of phosphorus. Luo et al. (2022) used magnesium rods (99%) to recover phosphorus from an anaerobically digested chicken manure slurry, attaining a high phosphorus recovery (> 90%). Kékedy-Nagy et al. (2020a) investigated the effects of using pure magnesium or AZ31 anodes in struvite recovery, observing that: (1) at a constant potential, pure magnesium kept a higher current density than that of AZ31, with a maximum difference between them of ~ 1.5 mA cm−2; (2) both materials are feasible to produce high purity struvite; and (3) solids formation occurred both in bulk solution and at the cathode and anode surfaces, with no difference in their elemental composition, either using pure magnesium or AZ31. In a previous study, the authors found different corrosion dynamics in magnesium dissolution for pure magnesium and AZ31 during struvite recovery, with pure magnesium exhibiting a better performance (Kékedy-Nagy et al. 2019). Conversely, Singh et al. (2015) found that AZ31 is more easily corroded than AZ91 and pure magnesium in a NaCl 3.5% solution. Therefore, the difference in the corrosion of magnesium materials depends not only on the material composition but also on the wastewater matrix. Since the studies described were conducted with simulated wastewater, it is not possible to state that similar behavior will occur when treating real wastewater, requiring comprehensive research to better understand these dynamics. While the matrix effect when using pure magnesium has already been investigated (Kékedy-Nagy et al. 2022), no similar research has been found for magnesium alloys in the literature. Regardless of that, the differences reported so far when comparing pure magnesium and AZ31 do not justify the use of pure magnesium, as its cost is significantly higher than that of magnesium alloys.

Being the collection of the phosphorus precipitates a key topic in phosphorus recovery, it should be noted that, in current research on electrochemical P recovery (Table 3), most of the produced solids are recovered by scraping the electrodes, which is not desirable for industrial applications due to the inherent difficulties with doing it at a large scale. Nevertheless, according to a recent study, when using magnesium anodes, the formation of suspended solids (in bulk) is favored over the formation of adhered solids (at the electrodes’ surface), enabling the collection of the precipitates by simple filtration and the scale-up of this technology (Sousa et al. 2023). It should be underlined that, in wastewater matrices containing high solids content, the precipitate collection by filtration may not be feasible, due to the reasons pointed out above.

3.4 Applied current or voltage

In CaP systems, the electric field generated by current/voltage input is the main driving force for P electrochemical recovery, since it is responsible for the ionic migration and the high local pH that enables precipitation. Increasing the energy input has the positive effect of maximizing recovery efficiency, but it also has the negative effect of coprecipitating byproducts, such as brucite and calcite, reducing the purity of the recovered solid (Lei et al. 2019a). Lei et al. (2018b) studied the precipitation sequence in electrochemical P recovery as CaP and observed that the main ions involved (i.e., calcium, magnesium, phosphate, and inorganic carbon) precipitated simultaneously, being required to have a thorough control of the energy input to minimize byproducts formation. In a different study, using a microbial electrolysis cell, Wang et al. (2020) observed that, when increasing the applied voltage from 1.0 to 1.2 V, the operation time required to achieve a phosphorus recovery above 90% was reduced to half (from 16 to 8 hours). Although the precipitate obtained was identified as hydroxyapatite, its purity was not assessed.

The influence of applied current or voltage in MAP systems is similar to that described for CaP systems. Wang et al. (2022a) observed, after 60 minutes of operation, a phosphorus concentration decrease of 23 and 63% at applied current densities of, respectively, 5.76 and 17.29 A m−2. However, struvite purity decreased from 41.5 to 9.87% with the increase in applied current, which, according to the authors, could be due to the breach of struvite deposits on the cathode surface caused by the enhanced hydrogen evolution at higher applied currents.

Kékedy-Nagy et al. (2020b) reported a novel method for phosphorus recovery that does not require an external energy input. Figure 7 presents a schematic diagram of the process, which is based on magnesium's spontaneous oxidation. In contrast to that observed at constant applied voltage, with precipitate formation both on the electrodes and in bulk (Sousa et al. 2023), struvite was only produced at the anode surface in the electroless process (Kékedy-Nagy et al. 2020b).

Fig. 7
figure 7

Copyright © 2020 American Chemical Society

Schematic diagram of electroless struvite production. Reprinted with permission from Kékedy-Nagy et al. (2020b).

Differences were also found between the struvite produced on pure magnesium and AZ31 anodes, with the latter exhibiting a more compact layer that increased the electrical resistance. The formation of this passivation film (either using pure magnesium or AZ31) is a barrier to applying this technology in a continuous-flow operation. Aiming to mitigate this downside, Sultana and Greenlee (2023) recently investigated the effects of a pulsating anode potential on phosphorus recovery using a pure magnesium anode. The authors reported higher recovery rates when using a pulsed potential than when applying a constant potential. Interestingly, higher frequencies produced a more compact layer in the anode. It would be worth performing a similar study with magnesium alloys to determine the optimal experimental conditions for obtaining a porous layer on magnesium alloy anodes. Moreover, the combination of spontaneous magnesium anode dissolution with pulsating potential (or current) would be an excellent achievement for phosphorus recovery technologies since it would significantly reduce costs and avoid the need for regular cleaning of the anode.

4 Main challenges and prospects

Phosphorus recovery technologies provide an alternative source of phosphate while mitigating waterbodies’ eutrophication. The cost and efficiency of these technologies are mainly affected by the wastewater composition and the process configuration. The most critical parameters are the wastewater pH, its ionic composition, the magnesium source (for MAP precipitation), and the energy input. Although intensive research has been conducted in this field, some interesting topics are worthy of further investigation.

The NOP oxidation mechanism in coupled oxidation-precipitation systems has not been thoroughly examined. A systematic study to elucidate some topics, such as the effect of initial pH on the oxidation efficiency of NOP to orthophosphate, would significantly contribute to optimizing the phosphorus recovery process. An attempt to correlate functional groups and/or types of molecules with a major/minor influence of initial pH could be an interesting scope of study. The influence of the total phosphorus concentration on oxidation efficiency is another critical topic not fully explored.

In MAP systems, magnesium liquid sources are often used for chemical precipitation. The use of an electrochemical approach with inert electrodes could improve precipitation efficiency due to the higher local pH when compared to bulk pH. Data on the increase in precipitation efficiency by the use of this electrochemical approach and a balance on costs vs. gains would be valuable. Also, packed columns of low-cost magnesium sources are a promising strategy for producing low-cost magnesium anodes. It is worth noting that the magnesium source in the solid state does not contribute to wastewater dilution as occurs when using liquid sources (e.g., seawater), without the consequent reduction in the recovery process efficiency.

Some studies have been carried out to investigate the difference in the phosphorus recovery performance when using pure magnesium or magnesium alloys as consumable anodes. However, most of these studies were performed with simulated wastewater. Systematic research focusing on the corrosion dynamics of the magnesium anodes (e.g., high purity, AZ31, AZ61, and AZ91) in different wastewater matrices and on the influence of these dynamics on the phosphorus recovery efficiency would greatly aid the optimization of the process. Obtaining a correlation between the main ionic composition and the corrosion dynamics would be a significant achievement. Regarding the passivation layer formed in the anodes, pulsating potential/current can successfully clean the electrodes without requiring process interruption, which is the ultimate challenge for continuous-flow applications. Still, further research is needed using different electrode materials and wastewater matrices.

Organic load removal (typically quantified in terms of chemical oxygen demand (COD) and total organic carbon) is usually neglected in studies addressing electrochemical recovery of phosphorus. From 17 scientific papers found in the Scopus database containing the words “Phosphorus”, “Electrochemical”, and “Recovery” in the title, only 4 indicated the initial COD of the sample under study, and, from those, only 3 presented COD removal results, which ranged from 30% to 84% (Supplementary Material, Table S2). Although COD removal is not the primary objective during a phosphorus recovery process, it would be valuable to understand how these two parameters relate, aiming at the optimization of both phosphorus recovery and wastewater remediation. Alongside phosphorus recovery, electrochemical processes have been extensively studied for wastewater remediation, demonstrating high efficiency in eliminating organic pollutants (Khan et al. 2023). Despite the existing research in both phosphorus recovery and organic load removal, the effects of coupling the two processes have been poorly assessed, being a vast open field for research. The implications of phosphorus recovery as a pre-treatment in processes focusing on COD removal should be evaluated to understand if recovery works better as a pre- or post-treatment process.

Phosphorus recovery often seeks fertilizer production, as the main phosphorus requirements are related to this industry. However, other interesting recovery products have been investigated, with the potential to boost circular economy approaches in other industrial areas. Meesschaert et al. (2020) used potato processing pretreated wastewater to recover calcium phosphate for phosphoric acid production through the wet process. Although the recovered product could not be directly used, it could be mixed with standard calcium phosphate, reducing its requirements. Zou et al. (2024) used biogas slurry to recover ferric phosphate for use as a raw material in the lithium battery industry. The authors found that the recovered solid had the same characteristics as standard ferric phosphate. Vivianite is another iron phosphate that can be used in the lithium battery industry, and, according to the literature, it can be recovered with acceptable purity considering the standard criteria (Wu et al. 2019; He et al. 2023). These alternative approaches for recovered phosphorus usage are essential to broadening the phosphorus recovery technology, further applicable to a wider range of matrices and supplying varied products. For instance, acidic buffered wastewaters are not suitable for struvite recovery but can be proper for ferric phosphate recovery, since this latter precipitates at a lower pH. Moreover, contaminant criteria depend on the final use of recovered products. Thus, wastewater unsuitable for fertilizer production (e.g., high iron content) can be excellent for other uses (e.g., vivianite recovery).

Finally, it should be highlighted that successful examples of large scale applications of chemical P recovery are found worldwide, such as the Durham Advanced Wastewater Treatment Facility in Oregon/USA (Cullen et al. 2013), and the Ostara's Pearl® System, operated at 14 municipal wastewater treatment plants across North America and Europe (Gysin et al. 2018). Being true that chemical precipitation has been used for a long time to produce struvite, the research over the last decades has led to the improvement of using waste as a nutrient source, transforming it into value-added products in a circular economy approach. Since then, research studies started to focus on alternative magnesium sources, through chemical and electrochemical methods, to lower the operational cost (Bradford-Hartke et al. 2021). While technical feasibility has already been proved by several works investigating electrochemical methods, there is no large-scale plant operating to date. Despite that, some works have addressed important issues to enable it, such as innovative reactor designs and long-term operation performance (Lei et al. 2021; Sultana and Greenlee 2023; Xue et al. 2024).

Moving forward in the research and clarifying the suggested topics will greatly contribute to further development of the phosphorus recovery processes, improving the sustainability in chemical recovery plants, and boosting electrochemical ones. This is not related to replacing biological treatment plants, but to providing effective alternatives when specific conditions require so.