Combined Pretreatment by Ultrasound and Struvite Precipitation of Raw Substrates: A Strategy to Overcome C/N Ratio Unbalance in Nitrogen-Rich Anaerobic Co-Digestion Systems

: The present study aimed to optimize the struvite chemical precipitation process in nitrogen-rich anaerobic co-digestion systems. Struvite precipitation experiments were carried out using a mixture of cattle slurry liquid fraction and sewage sludge, with and without ultrasound pretreatment. Marine salt or MgCl 2 were used as magnesium source in NH 4+ :Mg 2+ stoichiometric proportions of 1:1.5 and 1:3. Under the tested conditions, ammonium nitrogen and orthophosphate were removed from the mixed liquor with a maximum observed efﬁciency of 43% and 92%, respectively, when the ultrasound treatment was applied prior to struvite precipitation, using MgCl 2 as source of magnesium (NH 4+ :Mg 2+ of 1:3). The operating time was 40 min. Different pretreatments were tested prior to the biomethanization experiments, struvite precipitation, ultrasound and a combination of both pretreatments. The application of ultrasound (with an energy input of 218 kJ L − 1 ) and struvite precipitation (NH 4+ :Mg 2+ of 1:3) increased the methane content in the biogas by 82% and reduced hydraulic retention time by 28%, when compared to the anaerobic co-digestion assays without pretreatment. The hydrolytic pretreatment increased the bioavailability of nitrogen by 5%, thus enhancing the removal efﬁciency of ammonium nitrogen by 20%. Consequently, an increase in the carbon to nitrogen ratio was observed, favoring the methanogenesis process.


Introduction
The most recent trend in wastewater treatment processes is to foster bottom-up synergies in order to advance resource recovery and move towards a circular economy. In this regard, wastewaters produced at dairy farms are accessible sources for nutrient and bioenergy recovery. Removal of nitrogen (N) and phosphorous (P) from wastewaters is becoming an increasing challenge for operators as regulatory authorities tighten discharge standards to avoid eutrophication problems in receiving water bodies. Another environmental burden concerns the excess of sewage sludge (SwS) from wastewater treatment plants (WWTP). Anaerobic digestion (AD) processes are currently used to produce biogas from sewage sludge with the aim of recovering heat and electricity. However, anaerobic digestion units are often operated at sub-optimal performance due to a variety of factors, among which the excess of nitrogen and the low biodegradability of substrates are commonly referred [1,2].
The anaerobic digestion inhibition by excess of nitrogen can be caused by the accumulation of ammonia (NH 3 ) and ammonium ion (NH 4 + ) in the system. The total ammonium nitrogen (TAN) concentrations in the range of 1500-3000 mg L −1 may cause partial inhibition and complete inhibition was observed at concentrations above 3000 mg L −1 [1,[3][4][5]. According to Astals et al. (2018) [6], the methanogenesis was partially inhibited at a free ammonia nitrogen (FAN) concentration below 15 mg L −1 and totally inhibited at and above 130 mg L −1 . Other studies reported potential inhibition in a variety of FAN concentrations, ranging from 0.05 to 1.4 g L −1 [5,7].
The anaerobic co-digestion (AcoD) of different substrates may be used as a strategy to overcome the carbon to nitrogen ratio (C/N) unbalance phenomenon [8,9] and maximize methane production in energy recovery systems. In a circular economy approach, nutrient recovery is also a key factor and both sewage sludge and dairy farm wastewaters are perceived as nutrient-rich sources, with an interesting potential for nitrogen, phosphorus, calcium, and potassium recovery and application in agriculture [10].
One of the techniques used to recover nitrogen and phosphorus from wastewater is the precipitation of struvite (magnesium ammonium phosphate-MAP, MgNH 4 PO 4 .6H 2 O). The process can be affected by the chemical composition of the wastewater, temperature and pH [11]. Many authors reported the use of different sources of magnesium such as Mg(OH) 2 [12], MgCl 2 [13], MgSO 4 [14], and MgO [15]. As a pH dependent process, the wider pH range reported is from 7 to 11 [14,16]. Yoshino et al. (2003) [14] reached high nutrient removal efficiencies operating at pH of 8. 5.
In some studies, the solids present in the waste or wastewater are not separated from the liquid prior to struvite precipitation. So, the resulting settled material includes organic matter and other constituents contained in the raw substrates and, therefore, does not qualify as a pure struvite, but as struvite containing sludge [17].
The low biodegradability of substrates may also limit biogas production rate. However, substrate pretreatment with ultrasound may induce solubilization of organic compounds, thus increasing wastewater biodegradability. The ultrasonication by cavitation consists of disrupting the microbial cells by the growth and collapse of gas-bubbles causing an extraction of the intracellular material [18]. Pretreatment of substrates using ultrasound can have several beneficial effects for AD processes. These benefits include (i) reducing the particle size [18], (ii) increasing the rate of hydrolysis [19], and (iii) shortening hydraulic retention time [20]. An increase in the solubilization rate of extracellular and intracellular substances, further benefits the struvite precipitation by increasing the bioavailability of NH 4 + and PO 4 3− ions [21,22]. Struvite precipitation has been mostly applied as an anaerobic digestion post-treatment process. Indeed, struvite precipitation not only allows the removal of NH 4 + and PO 4 3− from anaerobically digested wastewater [13] in order to meet the legal requirements for effluent discharge, but it also presents the opportunity to recover and reuse these macronutrients as a valuable fertilizer [23]. However, the present research follows an alternative approach, aiming at advancing the knowledge on controlled struvite precipitation for application prior to the biomethanization process as a strategy to overcome potential inhibition by ammonium nitrogen. In that regard, the present study is focused on assessing the effects of: (i) two different sources of magnesium (marine salt and MgCl 2 ), (ii) two different stoichiometric NH 4 + :Mg 2+ ratios (1:1.5 and 1:3); (iii) ultrasound pretreatment prior to struvite precipitation; and (iv) combined pretreatment of ultrasound and struvite precipitation prior to the biomethanation process in anaerobic sequencing batch reactor (ASBR).

Materials and Methods
Two main sets of experiments were performed, the first one aiming at optimizing struvite precipitation in a mixture of cattle slurry liquid fraction (CSLF) and sewage sludge, and the other one comprising biomethanation assays with and without pretreatment.

Struvite Precipitation Optimization Batch Assays
In order to identify the optimal conditions for struvite precipitation in a mixture of cattle slurry liquid fraction and sewage sludge, five assays were performed under different operational conditions, as described in Table 1. Table 1. Assays description.

Assays Description
Control -MS marine salt as source of magnesium using a NH 4 + :Mg 2+ stoichiometric proportion of 1:1.5

MC2
MgCl 2 as source of magnesium using a NH 4 + :Mg 2+ stoichiometric proportion of 1:3 MC2U ultrasound pretreatment with an energy input (EI) of 218 kJ L −1 followed by struvite precipitation using MgCl 2 as magnesium source and a NH 4 + :Mg 2+ stoichiometric proportion of 1:3

Substrates Pretreatment with Ultrasound
The ultrasound pretreatment was conducted using an ultrasonic processor (SONOREX Super 10P Bandelin) operating at the nominal power of 90.8 W, low-frequency of 35 kHz and temperature of 25 • C. A 500 mL sample of the mixture of cattle slurry liquid fraction from a dairy farm and sewage sludge from an urban wastewater treatment plant (1:1, in volume) was sonicated for 20 min resulting in an energy input of 218.4 kJ L −1 and specific energy (SE) of 10,180 kJ kgTS −1 .
The energy input and specific energy applied were calculated by Equations (1) and (2), respectively, considering that P is the power in kWatt (kW), t is the treatment time in seconds (s), V is the volume in liters (L) of the mixture of substrates treated and TS (kg L −1 ) the total solid content. The operating conditions for the ultrasound pretreatment were selected based on the studies performed by Ruiz-Hermando et al. (2014) [18] and Ometto et al. (2014) [24].
The ultrasound treatment was applied prior to struvite precipitation process, in order to assess its effect on the crystallization process and, further, on biomethanation.

Struvite Chemical Precipitation
The struvite precipitation assays were carried out in batch reactors with a working volume of 300 mL and a mixture of cattle slurry liquid fraction and sewage sludge from an urban wastewater treatment plant (1:1, in volume). The initial pH was adjusted to 8.5 by dropwise addition of NaOH (1 M) and then, one of the sources of magnesium was added, as described in Table 1. The batch reactors were placed in an orbital incubator, at 150 rpm and 35 • C. The experiments were performed with a reaction period of 1 h. Every 20 or 30 min, measurements of pH (Orion benchtop pH meter) were performed and the pH was adjusted to 8.5, when necessary. After the reaction period, the solution was allowed to settle for 30 min and the precipitate was sampled.

Statistical Analysis
One-way analysis of variance (ANOVA) was used to assess significant differences between process parameters, in order to assess significant differences between treatments. The significant differences in all comparisons were set at p < 0.05. SPSS statistics software, in version 22 (SPSS Inc., Chicago, IL, USA) was used for data analyses.

Substrates and Inoculum
The liquid fraction of cattle slurry was collected at the dairy farm of Professional School of Agriculture and Rural Development of Ponte de Lima (Portugal). The sewage sludge was collected from the secondary settling tank of an urban wastewater treatment plant located in Tougues, Portugal. The inoculum used in the present study was collected from the anaerobic digester of the same WWTP.

Ultrasound Pretreatment
Ultrasound pretreatment was applied to the mixture of substrates (1:1, in volume), aiming to increase the biodegradability of the mixture and thus, improve the efficiency of the process in terms of methane production.
The ultrasound pretreatment was carried out with an ultrasonic processor (SONOREX Super 10P Bandelin) operating at the nominal power of 90.8 W and low frequency of 35 kHz. Two different treatment times were tested, 20 min (ASBR2) and 10 min (ASBR3), resulting in an energy input of 218 kJ L −1 and 109 kJ L −1 , respectively (Equation (1)).
The ultrasound treatment was applied to the mixture of substrates, prior to inoculation and start-up of the anaerobic digester operation, corresponding to a specific energy of 8180 kJ kgTS −1 and 4270 kJ kgTS −1 , in reactors ASBR2 and ASBR3, respectively (Equation (2)).

Struvite Precipitation
Struvite precipitation was induced through the addition of MgCl 2 to the mixture of substrates (1:1, in volume) previously treated with ultrasound. The initial pH was adjusted to 8.5 by dropwise addition of NaOH (1 M) and then MgCl 2 solution (157 g L −1 ) was added in order to achieve the stoichiometric ratio of NH 4 + :Mg 2+ of 1:3, which led to higher nutrient removal efficiencies in the struvite precipitation assays, as described in Section 3.1.1. The struvite precipitation pretreatment was applied during 1 h, under mesophilic conditions (35 • C). Every 20 min, measurements of pH (Orion benchtop pH meter) were performed and adjusted to 8.5, when necessary. Finally, the mixture was allowed to settle.
After the struvite precipitation pretreatment, the entire mixture was inoculated for subsequent anaerobic digestion. The goal was to assess the effect of a combined pretreatment (ultrasound and struvite precipitation) on methane production, in a nitrogen rich system.

Reactor Start-Up and Experimental Procedure
Anaerobic (co-)digestion assays, with and without pretreatment (ASBR1, ASBR2, and ASBR3), as described in Table 2, were carried out under mesophilic conditions (35 • C) in anaerobic sequencing batch reactors, mechanically stirred, with a total volume of 8 L and a working volume of 5.5 L. All the reactors had a water jacket and the temperature was maintained at 35 • C using a thermostatic bath and a water recirculation system. The gas analyzer (Bluesens BACVis software version 7.6.2.1), connected to the reactor, registered the methane content in the biogas. Three different reactors were operated under the conditions described in Table 2.
The experiment ASBR1 corresponds to the anaerobic co-digestion of SwS and CSLF without pretreatment (control). In experiments ASBR2 and ASBR3 a combination of both pretreatments, ultrasound, and chemical precipitation of struvite, was applied. The assay ASBR3 was performed under the same operational conditions as in assay ASBR2, except for the energy input in ultrasound treatment, which was 109 kJ L −1 (SE of 4270 kJ kgTS −1 ), half of the one applied to reactor ASBR2, 218 kJ L −1 (SE of 8180 kJ kgTS-1).
After the pretreatment, the reactors were inoculated and the gas analyzer system was connected. No nutrient addition or pH correction were performed during the anaerobic digestion process.

Analytical Procedure
All the analytical procedures followed the guidelines described in APHA (1992) [25] and the parameters analysed were total COD (tCOD), soluble COD (sCOD), total solids (TS), volatile solids (VS), Total Kjeldahl Nitrogen (TKN), total ammonium nitrogen (TAN), orthophosphate (PO 4 3 -P) and pH. The total organic carbon (TOC) was determined by the ratio between the organic matter (OM) content, in terms of VS, and the constant 1.8 [26,27]. Free ammonia (FAN) was calculated based on TAN concentration, according to Equation (3) [28]: where FAN = free ammonia nitrogen concentration (mg L −1 ); TAN = total ammonia nitrogen concentration (mg L −1 ) T = temperature (K) pH = hydrogen ionic potential All analyses were performed in triplicate and standard deviation was <10%. The biogas was conducted to a gas analyzer system and the methane content in the biogas was measured in real time using a data acquisition software (Bluesens BACVis software version 7.6.2.1).
The digested and precipitated sludges resulting from the biomethanation experiment were collected and washed with distilled water by centrifugation, to eliminate impurities and soluble salts. The washing process consisted of three washing cycles of the digested sludge with distilled water (1:2, in volume). Each washing cycle was carried out for 15 min, at 4500 rpm. Thereafter, the sludge was overdried for 36 h at 40 • C.
The elemental composition was assessed using Scanning Electron Microscopy with Energy Dispersive Spectroscopy (SEM-EDS Hitashi SU1510) and the crystallization products were characterized by X-ray diffraction using a high resolution X-ray Diffractometer (Bruker D8 Advance Davince) with Cu Kα radiation (λ = 1.5406 Å) produced at 40 mA and 40 kV. Data were collected in the 2θ range between 10º and 80º with a 2θ-step size of 0.0260º per second. The identification of crystalline structures was performed using EVA software V.4.0 from Bruker AXS.

Struvite Precipitation Optimization Batch Assays
The initial characterization of the mixture of substrates in the five experiments is summarized in Table 3. Table 3. Initial characterization of the mixture of substrates. From the results presented in Table 3, it is important to highlight the very low C/N ratio (4 ± 0.1) of the mixture of substrates, as well as the high TS concentration (20 ± 1 g L −1 ), the fraction of volatile solids being 80%, approximately (16 ± 2 g L −1 ). Despite the high COD, only 12%, approximately, corresponds to dissolved compounds (2.04 ± 0.45 g L −1 ), suggesting that methane production may be limited by solubilization of particulate organic matter.

Kinetics of the Struvite Precipitation Process
As mentioned before, in the struvite precipitation experiments, the pH was monitored, at the beginning of the experiment and every 20 or 30 min, during the reaction time ( Figure 1). After each measurement, the pH of the mixture was adjusted to 8.5 by dropwise addition of NaOH (1 M), whenever necessary. At the beginning of the experiment, whenever the pH was adjusted to 8.5, a sudden decrease relatively to this threshold value was observed (Figure 1). This can be explained by the release of H + in the solution, as struvite precipitates, lowering the pH [29]. After 40 min of reaction, a tendency to a linear pH profile (around 8.5) was, in general, observed. These results suggest that the ions PO 4 3− , NH 4 + , and Mg 2+ , which are participating in struvite crystallization process, are being removed from the liquid phase due to struvite precipitation, until the reaction reaches the equilibrium, after 40 min, under the tested conditions ( Figure 1).
The average operating time to achieve the highest removal efficiencies of macronutrients through struvite precipitation reported in the literature varies considerably. Battistoni et al. (2001) [30] reported nutrient removal from anaerobically digested sludge higher than 80% through crystallization in about 100 min. Pullmmanappallil et al. (2001) [31] developed a process for nutrient recovery through struvite precipitation in a sequential batch reactor and recommended a reaction time below 30 min. The high water-solubility of both sources of magnesium (marine salt and magnesium chloride) was considered to be a key enabling factor for the struvite precipitation process, contributing to shorten the overall reaction time.
The PO 4 3− -P and NH 4 + -N removal efficiencies obtained in the struvite precipitation experiments are depicted in Figure 2. Control assays (with no external magnesium source) revealed PO 4 3− -P and NH 4 + -N removal efficiencies of 15% and 11%, respectively ( Figure 2). Since no source of magnesium was added to promote the formation of struvite in the control assays, NH 4 + -N losses may be due to stripping processes favored by high pH values [32]. The observed orthophosphate removal may be explained by the uptake by biomass present in the substrates [33].
As depicted in Figure 2, decreasing the NH 4 + to Mg 2+ molar ratio from 1:1.5 to 1:3 led to a slight increase in nitrogen removal efficiency (29% in experiment MC2 and 23% in MC1; p < 0.05). Simultaneously, the orthophosphate removal efficiency significantly increased by approximately 61% (from 32% in MC1 to 50% in MC2). A comparison between MC1 and MS assays shows significant differences in the orthophosphate removal efficiencies (32% and 23% respectively) but not on the TAN removal efficiencies (23% and 22%, respectively). This result is in accordance with the studies performed by Pinatha et al. (2020) [34], demonstrating that marine salt formed struvite 18% less than did MgCl 2 . The low values of N and P removal efficiencies obtained when marine salt was used as external Mg source may probably be related to the presence of sea salt crystals when this resource was used to provide the Mg 2+ concentration required for struvite precipitation, indicating that the amount of dissolved magnesium was insufficient for an efficient nutrient recovery.
The application of ultrasound (SE of 10,180 kJ kgTS −1 ) prior to struvite precipitation, in MC2U experiment, led to an increase of 38% in TAN concentration (from 710 ± 98 mg L −1 in MC2 to 980 ± 68 mg L −1 in MC2U) ( Table 4). Similar values were observed by Bougrier et al. (2005) [35], who reported an increase of 40% in organic nitrogen solubilization after ultrasonic treatment of waste-activated sludge with a specific energy input of 15,000 kJ kgTS −1 . Salsabil et al. (2005) [36] observed a linear increase in total nitrogen solubilization with increasing specific energy, for specific energies above 3600 kJ kgTS −1 , reaching 19.6% for a specific energy of 108,000 kJ kgTS −1 . The effect of sonication on phosphorus behaviour is rarely described in literature. Following the trend reported by Salsabil et al. (2005) [36], the ultrasound pretreatment applied in MC2U experiment also increased phosphorus solubility. In fact, an increase of 85% in orthophosphate concentration was observed, from 389 ± 3 mg L −1 in MC2 to 719 ± 3 mg L −1 in MC2U. The highest orthophosphate and TAN removal efficiencies (92% and 43%, respectively) were obtained when the ultrasound treatment was applied prior to struvite precipitation (MC2U). Several authors reported ammonium nitrogen removal efficiencies higher than 90% when the process of struvite precipitation was applied as post-treatment, after the anaerobic digestion [37,38]. This can be explained by the enhanced availability of N-NH 4 + and P-PO 4 3− as result of the mineralization of organic compounds that occurs during anaerobic digestion, thus increasing the potential for struvite precipitation [39].

Biomethanization Assays
In order to assess the effect of pretreatment of substrates on methane production in anaerobic sequencing batch reactors, biomethanation experiments were performed using cattle slurry liquid fraction and sewage sludge as substrates, as previously described in Section 2.2. The main physical and chemical characteristics of the substrates (CSLF, SwS) and the inoculum are presented in Table 5.  The results presented in Table 5 demonstrate the complexity, but also the potential for nutrient and energy recovery of the substrates used in the present study, with high nitrogen, phosphorus and organic matter concentrations. The volatile solid content represented 75 to 83% of the total solids in the SwS and 58 to 73% of the TS in the CSLF. Nevertheless, despite the high COD levels, the soluble fractions correspond to 10-14% and 28-30% on SwS and CSLF, respectively. Table 6 presents the characterization of the mixture of substrates before (T BU ) and after (T AU ) ultrasound treatment and after struvite precipitation treatment (T AS ) of the mixture of substrates previously treated with ultrasound. Table 6. Characterization of the mixture of substrates before (T BU ) and after (T AU ) ultrasound pre-treatment and after struvite treatment (T AS ), prior to reactor inoculation.  After treatment with ultrasound, the sCOD in the mixture of substrates increased 75% and 43%, when the specific energy was 8180 kJ kgTS-1 (ASBR2) and 4270 kJ kgTS-1 (ASBR3), respectively. The TAN concentration slightly increased 5% on both assays (ASBR2 and ASBR3). With struvite precipitation, the NH 4 + -N removal efficiency increased 20% in both reactors, after ultrasound pretreatment. This can be explained by enhanced solubilization of nitrogen compounds due to sonication and increased availability of ammonium nitrogen for struvite formation. Table 7 presents the initial physicochemical characterization of the mixed liquor in all the anaerobic sequencing batch reactors (ASBR), after inoculation, in terms of pH, TS and VS, total and dissolved organic matter as COD, TKN, TAN, and FAN. Some operational parameters are also depicted in Table 7, namely the applied organic load rate (OLR) (as COD and VS), methane yield (Y CH4/VS ) and methane content in the biogas, maximum observed biodegradation rate, maximum observed methane production rate, and the hydraulic retention time (HRT). It is important to notice that despite the pH being adjusted to 8.5 during the struvite precipitation process, after inoculation, the pH values decreased ranging between 7.4 and 7.8 in the bioreactors (Table 7), which is in the range of the optimal pH (6.5 to 8.5) reported by different authors [2,40].

CODs
A comparison between ASBR1 (control) and ASBR2 experiments revealed that treatment with ultrasound followed by struvite precipitation resulted in an increase in C/N ratio from 5.0 to 8.6, as well as in FAN/TAN from 2.7 to 6.6, leading to an increase in the biogas methane content of 83% (from 33 to 60%). In ASBR3, a similar pattern was observed, the C/N ratio being increased from 5.0 to 8.1 and FAN/TAN from 2.7 to 5.3, thus increasing the methane content in the biogas by 74% (from 33 to 57%). Moreover, a reduction in the hydraulic retention time was observed in both reactors (28% and 25% in ASBR2 and ASBR3, respectively). In fact, the low C/N ratio observed in ASBR1 is related to a lower maximum observed degradation rate (0.17 g L −1 d −1 ) and a lower maximum observed methane production rate (77 mL g −1 d −1 ). This is in accordance with the lower final methane yield (26.5 mLCH 4 gVS −1 ) and lower methane content in biogas (33%) suggesting that methanogenesis was partially inhibited. However, despite the higher maximum observed degradation rate (0.64 g L −1 d −1 ) and maximum observe methane production rate (743 mL g −1 d −1 ) obtained in ASBR 3, the methane content in biogas were similar to ASBR 2 ( Table 7), indicating that the methanogenesis was not hindered. These kinetic parameters are higher than those reported by Mao et al. (2017) [41] and Nutongkaew et al. (2020) [42], 12 mL g −1 d −1 and 50 mL g −1 d −1 , respectively, suggesting that the combined treatment with ultrasound and struvite precipitation leads to an enhancement of the biomethanization process.
With the overall pretreatment process (ultrasound followed by struvite precipitation), it was possible to overcome the C/N unbalance, resulting in a higher efficiency of the anaerobic co-digestion process in terms of methane production, as well as total COD and volatile solids removal efficiency (Figure 3). The content in methane of the biogas produced in reactors ASBR2 and ASBR3 was similar, around 60%. However, the conversion efficiency of VS to methane decreased by 44% (from 48.5 mLCH 4 gVS −1 to 32.2 mLCH 4 gVS −1 ) when the energy input was reduced from 218 kJ L −1 (SE = 8180 kJ kgTS −1 ) to 109 kJ L −1 (SE = 4270 kJ kgTS −1 ). The low methane yields (in mL gVS −1 ) obtained in the present study may be explained by the very high initial volatile solids concentration, ranging between 10 and 22.3 g L −1 (as depicted in Table 7). However, despite de high initial VS concentration, a removal efficiency of only 13-24% was observed, leading to a low methane yield, in mL gVS −1 .
Despite the high content of methane (60%) in the biogas produced in reactors ASBR2 and ASBR3 and the higher COD removal efficiencies (60 and 50%, respectively), when compared to ASBR1 (control without substrates pretreatment), the treated effluent still presents a very high COD content, 6200 mg L −1 and 5012 mg L −1 , in ASBR 2 and ASBR3, respectively, as well as nitrogen and phosphorus, indicating the need of a post-treatment before wastewater discharge according to Portuguese law (DL 236/98, of 1 August).
Scanning Electron Microscopy with Energy Dispersive Spectroscopy analysis (Figure 4), suggest that the heterogeneity of the samples presented itself as an obstacle in the identification and quantification of the formed compounds, mainly due to the very high solids content, typical of the SwS and CSLF, originating a sludge-containing struvite crystals. In fact, beside struvite crystals, the formation of other compounds such as newberyite (MgHPO 4 ·3H 2 O), monetite (CaHPO 4 ), brushite (CaHPO 4 .2H 2 O), may have occurred as a consequence of pH variations and the presence of ions such as Ca 2+ and Mg 2+ [43]. Therefore, the characterization of the precipitates occurred in two steps, the former supported on SEM analysis in order to identify the main elements present in the samples, and the latter based on crystals characterization by X-ray diffraction. In a sample collected in ASBR2, 72% corresponded to water-soluble compounds that were removed after the washing process. The X-ray analyses of the sample collected in ASBR2, after washing and drying, as described in Section 2.3, confirmed the presence of struvite ( Figure 5). Approximately 85% of the digested sludge sample, previously washed and dried, was quantified as struvite, The X-ray diffraction also indicated correlating peaks for both quartz (SiO2) and calcite (CaCO3), but in smaller quantities (8 and 7%, respectively). The quartz (SiO2) is a compound naturally found in both substrates (SwS and CSLF), given the nature of the agro-industrial activities that origin such waste and/or wastewater. According to [43,44], magnesium containing species and species containing calcium are ion and pH dependent and can also be formed under similar conditions to the struvite precipitation process, which may explain the presence of calcite.
Considering the heterogeneity of the sludge sample, the semi-quantitative analyses obtained by X-ray and the treatment conditions in ASBR2 and ASBR3, it is possible to suggest that, approximately 230 g L −1 and 100 g L −1 of struvite, respectively, can be obtained.

Conclusions
When ammonium drives anaerobic processes inhibition, nitrogen removal through struvite precipitation, as pretreatment, may have a positive effect on methanogenesis. Since the ultimate goal was primarily to remove NH 4 + -N, the results obtained were favorable from this perspective and the combined ultrasound and struvite precipitation pretreatment has shown to be a feasible option to enhance further bioenergy processes.
The following conclusions may be highlighted from the struvite precipitation experiment: • the reaction time of 40 min seems to be suitable for crystallization and precipitation of struvite using a mixture of urban WWTP sludge and cattle slurry liquid fraction as substrate; • to fulfill the stoichiometric requirements of magnesium, high amounts of marine salt are necessary, resulting in the presence of insoluble crystals, which may limit nutrient recovery processes; • the ammonium nitrogen and orthophosphate removal efficiencies increased when the NH 4 + : Mg 2+ stoichiometric ratio decreased from 1:1.5 to 1:3. reaching 29% and 50%, respectively; • the application of ultrasound to the mixture of substrates, prior to the struvite precipitation process, resulted in an increase in ammonium nitrogen and orthophosphate removal efficiencies, reaching 43% and 92%, respectively, as a result of the increase in the solubilization rate of organic compounds; Regarding the biomethanation experiment, the main conclusions are as follows: • the treatment of the substrates with ultrasound (either with a EI of 109 kJ L −1 (SE of 4270 kJ TS −1 ) or EI of 218 kJ L −1 (SE of 8180 kJ TS −1 )) resulted in an increase of 73-82% in methane content in the biogas (57-60%) and a reduction in the HRT of 25-28%; • the treatment of the substrates with ultrasound prior to struvite precipitation enhanced ammonium nitrogen removal and, consequently, increased methane yield; • the reduction of the energy input from 218 kJ L −1 (SE of 8180 kJ TS −1 ) to 109 kJ L −1 (SE of 4270 kJ TS −1 ) resulted in a decrease of 44% in methane yield (from 48.5 mLCH 4 gVS −1 to 32.2 mLCH 4 gVS −1 ), despite de methane content in biogas remained similar (60%); • the combination of ultrasound (SE of 8180 kJ kgTS −1 ) and struvite precipitation (NH 4 :Mg 2+ of 1:3) as pretreatment may be a feasible option to increase the efficiency of ACoD of SwS and CSLF in a context of nitrogen-rich systems, in terms of COD removal and methane production; • the FAN/TAN ratio seems to be correlated to the methane production; • the TAN values lower than 311 mg L −1 seems to be unfavorable to the methanogenesis; Informed Consent Statement: Not applicable.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to patent pending process.